commit 330a2ccfda6f1ce854478ca3c467a71e2493ceac Author: Georgy Khatuncev Date: Fri Sep 4 12:49:15 2020 +0500 First commit Send all results diff --git a/.vs/Projects/DesignTimeBuild/.dtbcache.v2 b/.vs/Projects/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 0000000..f0838a7 Binary files /dev/null and b/.vs/Projects/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/Projects/v16/.suo b/.vs/Projects/v16/.suo new file mode 100644 index 0000000..b5624fb Binary files /dev/null and b/.vs/Projects/v16/.suo differ diff --git a/DataClients/DataClients.csproj b/DataClients/DataClients.csproj new file mode 100644 index 0000000..b92d046 --- /dev/null +++ b/DataClients/DataClients.csproj @@ -0,0 +1,17 @@ + + + + netstandard2.0 + DataClients + + + + 0 + + + + + + + + diff --git a/DataClients/FileClient.cs b/DataClients/FileClient.cs new file mode 100644 index 0000000..56a79cf --- /dev/null +++ b/DataClients/FileClient.cs @@ -0,0 +1,136 @@ +using ICSharpCode.SharpZipLib.GZip; +using ICSharpCode.SharpZipLib.Tar; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; + +namespace DataClients +{ + public class FileClient + { + private char split = '/'; + //private char split = '\\'; + //private string dir = @"Y:\data"; + //private string dir = @"C:\data"; + private string dir = @"/archive_rmt/data"; + + public FileClient() + { + TempDir.StartCkeckDir(); + } + public FileClient(string directory) + { + TempDir.StartCkeckDir(); + dir = directory; + } + + public byte[] GetFile(DateTime time, ushort vdp, ushort index) + { + var name = time.ToString("yyyyMMdd") + "." + vdp.ToString("D2") + index.ToString("D1"); + var tmpFileName = TempDir.GetTempDirectory() + split + name; + + if (!TempDir.IsExist(name)) + { + if (!CheckArchive(time, vdp)) return new byte[0]; + if (!ExtractArchive(time, vdp)) return new byte[0]; + } + if (!TempDir.IsExist(name)) return new byte[0]; + while (TempDir.IsProtect(name)) Thread.Sleep(1000); + TempDir.AddProtect(name); + Stream fs = File.OpenRead(tmpFileName); + var result = new List(); + try + { + for (var i = 0; i < fs.Length; i++) + result.Add((byte)fs.ReadByte()); + return result.ToArray(); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + return new byte[0]; + } + finally + { + TempDir.RemoveProtect(name); + fs.Close(); + } + } + + private bool CheckArchive(DateTime time, ushort vdp) + { + var tmp = + dir + split + + time.Year.ToString("D4") + split + + time.Month.ToString("D2") + split + + time.Day.ToString("D2") + split + + vdp.ToString("D2"); + return (File.Exists(tmp + ".tar") || File.Exists(tmp + ".tar.gz")); + } + private bool ExtractArchive(DateTime time, ushort vdp) + { + var tmp = + dir + split + + time.Year.ToString("D4") + split + + time.Month.ToString("D2") + split + + time.Day.ToString("D2") + split + + vdp.ToString("D2"); + if (File.Exists(tmp + ".tar")) + { + ExtractTar(tmp + ".tar", TempDir.GetTempDirectory()); + return true; + } + else if (File.Exists(tmp + ".tar.gz")) + { + ExtractTarGZ(tmp + ".tar.gz", TempDir.GetTempDirectory()); + return true; + } + return false; + } + private void ExtractTarGZ(String gzArchiveName, String destFolder) + { + Stream inStream = File.OpenRead(gzArchiveName); + Stream gzipStream = new GZipInputStream(inStream); + try + { + TarArchive tarArchive = TarArchive.CreateInputTarArchive(gzipStream); + tarArchive.ExtractContents(destFolder); + tarArchive.Close(); + } + catch (Exception e) + { + Console.WriteLine("Can't extract: " + gzArchiveName); + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + } + finally + { + gzipStream.Close(); + inStream.Close(); + } + } + private void ExtractTar(String tarFileName, String destFolder) + { + Stream inStream = File.OpenRead(tarFileName); + try + { + TarArchive tarArchive = TarArchive.CreateInputTarArchive(inStream); + tarArchive.ExtractContents(destFolder); + tarArchive.Close(); + } + catch (Exception e) + { + Console.WriteLine("Can't extract: " + tarFileName); + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + } + finally + { + inStream.Close(); + } + } + } +} diff --git a/DataClients/NetClient.cs b/DataClients/NetClient.cs new file mode 100644 index 0000000..cba51f5 --- /dev/null +++ b/DataClients/NetClient.cs @@ -0,0 +1,221 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading; + +namespace DataClients +{ + public class NetClient + { + private string ServerStr = "10.10.45.152"; + private int PortStr = 1070; + private IPEndPoint IpPoint; + + public enum Cmd : uint + { + check_command = 4294967295, + pasp_download = 4, + download_nh = 21, + dir_browse = 23, + user_flags = 26 + } + + //constructor + public NetClient() + { + IpPoint = new IPEndPoint(IPAddress.Parse(ServerStr), PortStr); + } + public NetClient(string ipAddr, int port = 1070) + { + ServerStr = ipAddr; + PortStr = port; + IpPoint = new IPEndPoint(IPAddress.Parse(ServerStr), PortStr); + } + + //main functions + public byte[] CreateCommand(Cmd cmd, string val = null) + { + List result = new List(); + result.AddRange(BitConverter.GetBytes((uint)cmd)); + if (cmd == Cmd.dir_browse) result.Add(0x00); + if (cmd == Cmd.dir_browse && String.IsNullOrEmpty(val)) + result.AddRange(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00 }); + if (!String.IsNullOrEmpty(val)) + { + result.AddRange(BitConverter.GetBytes((uint)val.Length)); + result.AddRange(Encoding.ASCII.GetBytes(val)); + result.Add(0x00); + } + + return result.ToArray(); + } + public byte[][] SocketWork(Cmd code, string val = "") + { + var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) + { + ReceiveTimeout = 5000, + SendTimeout = 5000 + }; + var result = new List(); + + //Install Params + var check_start_mark = true; + var check_end_mark = true; + uint static_size = 0; + + switch (code) + { + case Cmd.check_command: + check_end_mark = false; + static_size = 4; + break; + case Cmd.pasp_download: + check_end_mark = false; + static_size = 1528; + break; + case Cmd.dir_browse: + case Cmd.download_nh: + case Cmd.user_flags: + check_end_mark = true; + static_size = 0; + break; + } + + try + { + //Connect + socket.Connect(IpPoint); + //SendRequest + Thread.Sleep(5); + socket.Send(CreateCommand(code, val)); + + uint? fullSize = null; + byte mark = 0x01; + + if (check_start_mark) mark = SocketReadByte(ref socket); + while(mark != 0xff) + { + switch (mark) + { + case 0x01: + var tmpL = new List(); + if (code == Cmd.pasp_download) + { + tmpL.AddRange(SocketReadBytes(ref socket, 16)); + if (tmpL.Last() == 0x01) + tmpL.AddRange(SocketReadBytes(ref socket, 1512)); + mark = 0xff; + result.Add(tmpL.ToArray()); + break; + } + + { + uint size = (static_size > 0) ? + static_size : BitConverter.ToUInt32(SocketReadBytes(ref socket, 4), 0); + tmpL.AddRange(SocketReadBytes(ref socket, size)); + mark = 0xff; + result.Add(tmpL.ToArray()); + break; + } + case 0x02: + var currSize = BitConverter.ToUInt32(SocketReadBytes(ref socket, 4), 0); + fullSize = fullSize.HasValue ? fullSize + currSize : currSize; + break; + case 0x03: + Thread.Sleep(1000); + if (check_start_mark) mark = SocketReadByte(ref socket); + continue; + case 0x00: + if (!check_end_mark) + throw new Exception("Can't catch all packeges."); + if (result.Count == 0) + return result.ToArray(); + mark = 0xff; + break; + case 0xff: + if (!check_end_mark || !fullSize.HasValue || fullSize.Value != result.Count) + throw new Exception("Can't catch all packeges."); + return result.ToArray(); + default: + throw new Exception("Can't get mark for download."); + } + if (check_end_mark) mark = SocketReadByte(ref socket); + } + return result.ToArray(); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + return result.ToArray(); + } + finally + { + socket.Disconnect(false); + } + } + + private byte SocketReadByte(ref Socket socket) + { + try + { + byte[] t = new byte[1]; + t[0] = 0xff; + Thread.Sleep(5); + int countbyte = socket.Receive(t); + if (countbyte != 1) + throw new Exception("Error get Byte."); + return t[0]; + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + return 0xff; + } + } + private byte[] SocketReadBytes(ref Socket socket, uint length) + { + try + { + var result = new List(); + var count = 5; + do + { + byte[] t = new byte[length]; + Thread.Sleep(5); + int countbyte = socket.Receive(t); + if (countbyte != length) + { + if (countbyte > 0) + { + var c = new byte[countbyte]; + Array.Copy(t, c, countbyte); + result.AddRange(t); + length = length - (uint)countbyte; + count = 5; + continue; + } + else + { + count--; + Thread.Sleep(5); + } + } + result.AddRange(t); + return result.ToArray(); + } while (count >= 0); + throw new Exception("Error get Bytes."); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + return new byte[0]; + } + } + } +} diff --git a/DataClients/STPClient.cs b/DataClients/STPClient.cs new file mode 100644 index 0000000..a3dd07e --- /dev/null +++ b/DataClients/STPClient.cs @@ -0,0 +1,412 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading; + + +namespace DataClients +{ + public class STPClient + { + private NetClient netClient; + private FileClient fileClient; + + public STPClient() + { + netClient = new NetClient(); + fileClient = new FileClient(); + } + public Pasport GetPasport(string link) + { + var result = new Pasport(); + var arr = new List(); + { + var tmp = netClient.SocketWork(NetClient.Cmd.pasp_download, link); + foreach (var e in tmp) arr.AddRange(e); + } + result.byteArr = arr.ToArray(); + return result; + } + public Tuple[] GetListPasport(DateTime date) + { + var result = new List>(); + var str = date.ToString(@"yyyy\/MM\/dd"); + var e = netClient.SocketWork(NetClient.Cmd.dir_browse, str); + + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); + var enc = Encoding.GetEncoding(866); + foreach(var t in e) + { + var subres = ""; + var r1 = enc.GetString(t); + var r2 = r1.Split('-'); + if (r2.Length > 1) + for (var i = 1; i < r2.Length; i++) { + if (subres.Length > 0) subres = subres + "-"; + subres = subres + r2[i].Split('.')[0]; + } + if (!String.IsNullOrEmpty(subres)) + result.Add(new Tuple(subres, str + '/' + r1)); + } + return result.ToArray(); + } + public ADresult GetAnalogDiscret(DateTime start, DateTime end, ushort vdp) + { + var cursor = start; + byte[] subRes = new byte[0]; + var resByteMatrix = new List(); + while (cursor.AddDays(-1) <= end) + { + subRes = GetFile(cursor, vdp, 1); + var arr = STPConverter.GetADByteMatrix(cursor, subRes); + resByteMatrix.AddRange(arr); + cursor = cursor.AddDays(1); + } + return STPConverter.AnalogDiscret(resByteMatrix,vdp); + } + + public List GetIshData(DateTime start, DateTime end, ushort vdp) + { + var result = new List(); + var cursor = start.AddDays(-1); + byte[] subRes = new byte[0]; + + do + { + cursor = cursor.AddDays(1); + subRes = GetFile(cursor, vdp, 0); + var arr = STPConverter.IshData(subRes); + foreach (var e in arr) + if (start <= e.time && e.time <= end) + result.Add(e); + } while (cursor <= end); + return result; + } + public List GetTechCycle(DateTime start, DateTime end, ushort vdp) + { + var result = new List(); + var cursor = start; + byte[] subRes = new byte[0]; + do + { + cursor = cursor.AddDays(-1); + subRes = GetFile(cursor, vdp, 3); + } while (subRes.Length == 0 && cursor > start.AddDays(-10)); + + TechCycle a = new TechCycle() + { + start = start, + index = TechCycle.Operation.unloading_loading + }; + + { + if (subRes.Length > 0) + { + var b = STPConverter.TechCycle(subRes); + if (b.Length > 0) a = b.Last(); + } + a.start = start; + } + + cursor = start.AddDays(-1); + do + { + cursor = cursor.AddDays(1); + subRes = GetFile(cursor, vdp, 3); + var arr = STPConverter.TechCycle(subRes); + foreach(var e in arr) + { + if (e.start <= start) + { + a = e; + continue; + } + if (e.start >= end) + { + a.end = end; + result.Add(a); + break; + } + if (e.start > start && e.start < end) + { + a.end = e.start; + result.Add(a); + a = e; + } + } + } while (cursor <= end); + return result; + } + + public List GetProtectData(DateTime start, DateTime end, ushort vdp) + { + var result = new List(); + var cursor = start.AddDays(-1); + byte[] subRes = new byte[0]; + do + { + cursor = cursor.AddDays(1); + subRes = GetFile(cursor, vdp, 4); + + var arr = STPConverter.ProtectData(subRes); + foreach (var e in arr) + if (start <= e.time && e.time <= end) + result.Add(e); + } while (cursor <= end); + return result; + } + + + private byte[] GetFile(DateTime time, ushort vdp, ushort index) + { + var result = new List(); + var name = time.ToString("yyyyMMdd") + "." + vdp.ToString("D2") + index.ToString("D1"); + var temp = new List(); + temp.AddRange(fileClient.GetFile(time, vdp, index)); + if (temp.Count == 0) + { + var subTemp = netClient.SocketWork(NetClient.Cmd.download_nh, name); + foreach (var e in subTemp) + temp.AddRange(e); + } + return temp.ToArray(); + } + } + + public static class STPConverter + { + public static IshData[] IshData(byte[] arr) + { + var result = new List(); + try + { + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); + var enc = Encoding.GetEncoding(866); + var strs = enc.GetString(arr).Split('\n'); + foreach (var e in strs) + { + var substr = e.Split('\t'); + if (substr.Length < 3) continue; + var time = Converter.ConvertUnixTimeToDateTime(Int32.Parse(substr[1])); + for(var i = 2; i < substr.Length; i++) + { + if (String.IsNullOrEmpty(substr[i])) continue; + var tmp = substr[i].Split(' '); + var c = new IshData() { time = time, id = Convert.ToUInt16(tmp[0]) }; + var val = ""; + for (var j = 1; j < tmp.Length; j++) + val = j < (tmp.Length - 1) ? val + tmp[j] + ' ' : val + tmp[j]; + c.value = val; + result.Add(c); + } + + } + return result.ToArray(); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + return result.ToArray(); + } + } + public static TechCycle[] TechCycle(byte[] arr) + { + var result = new List(); + try + { + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); + var enc = Encoding.GetEncoding(866); + var strs = enc.GetString(arr).Split('\n'); + foreach(var e in strs) + { + var substr = e.Split('\t'); + if (substr.Length != 3) continue; + + var cycle = new TechCycle(); + cycle.index = (DataClients.TechCycle.Operation)UInt32.Parse(substr[0]); + cycle.start = Converter.ConvertUnixTimeToDateTime(Int32.Parse(substr[2])); + result.Add(cycle); + } + return result.ToArray(); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + return result.ToArray(); + } + } + public static Protect[] ProtectData(byte[] arr) + { + var result = new List(); + try + { + var cursor = 0; + var time = new DateTime(); + while (cursor < arr.Length) + { + if (cursor + 4 >= arr.Length) break; + time = Converter.ConvertUnixTimeToDateTime(BitConverter.ToInt32(arr, cursor)); + cursor += 4; + + if (cursor + 4 >= arr.Length) break; + time = time.AddMilliseconds((double)BitConverter.ToInt32(arr, cursor) / 1000000); + cursor += 4; + + while (true) + { + if (cursor >= arr.Length) break; + if (arr[cursor] == 0xff) + { + cursor++; + break; + } + + var id = (int)arr[cursor]; + cursor++; + + if (cursor >= arr.Length) break; + var value = (int)arr[cursor]; + cursor++; + + result.Add(new Protect() + { + time = time, + id = id, + value = value + }); + } + } + return result.ToArray(); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + return result.ToArray(); + } + } + + public static ADresult AnalogDiscret(List adBytes, int vdp) + { + var result = new ADresult(); + try + { + var aMatrix = new AnalogsMatrix(vdp); + foreach(var an in aMatrix.matrix) + { + var subRes = new List>(); + foreach(var b in adBytes) + { + var c = new byte?[2]; + for(var i = 0; i < 2; i++) + c[i] = b.matrix.Length > an.Value.byteId[i] ? + b.matrix[an.Value.byteId[i]] : null; + double? d = c[0].HasValue && c[1].HasValue ? + (double?)BitConverter.ToInt16(new byte[] { c[0].Value, c[1].Value }, 0) * an.Value.mul : null; + d = !d.HasValue ? null : d.Value < an.Value.min ? an.Value.min : d.Value > an.Value.max ? an.Value.max : d; + var e = new Tuple(b.time, d); + if (subRes.Count > 1 && subRes[subRes.Count - 1].Item2 == e.Item2 && subRes[subRes.Count - 2].Item2 == e.Item2) + subRes.RemoveAt(subRes.Count - 1); + subRes.Add(e); + } + result.an.Add(an.Key, subRes.ToArray()); + } + + var dMatrix = new DiscretsMatrix(vdp); + foreach (var di in dMatrix.matrix) + { + var subRes = new List>(); + foreach (var b in adBytes) + { + bool? c = b.matrix.Length <= di.Value.byteId ? null : + !b.matrix[di.Value.byteId].HasValue ? null : + (bool?)((b.matrix[di.Value.byteId] & (1 << di.Value.bitId)) != 0); + c = !c.HasValue ? null : di.Value.invert ? !c : c; + var e = new Tuple(b.time, c); + if ((subRes.Count == 0) || (subRes.Count > 0 && subRes[subRes.Count - 1].Item2 != e.Item2)) + subRes.Add(e); + } + result.di.Add(di.Key, subRes.ToArray()); + } + return result; + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + return result; + } + + return result; + } + public static List GetADByteMatrix(DateTime time, byte[] arr) + { + var result = new List(); + var byteArr = new List(); + var currTime = new DateTime(time.Year, time.Month, time.Day, 0, 0, 0); + var halfsec = 0; + var cursor = 0; + try + { + while (cursor < arr.Length) + { + var id = arr[cursor]; + cursor++; + + switch (id) + { + case 0xfb: + halfsec = BitConverter.ToInt32(arr, cursor); + cursor = cursor + 4; + break; + case 0xfc: + byteArr = new List(); + result.Add( + new ByteMatrix() + { + time = currTime.AddSeconds((double)(halfsec + 1) / 2), + matrix = byteArr.ToArray() + } + ); + halfsec = BitConverter.ToInt32(arr, cursor); + cursor = cursor + 4; + break; + case 0xfe: + halfsec = halfsec + BitConverter.ToInt16(arr, cursor); + break; + case 0xff: + result.Add( + new ByteMatrix() + { + time = currTime.AddSeconds((double)halfsec / 2), + matrix = byteArr.ToArray() + } + ); + halfsec++; + break; + default: + var a = Convert.ToInt32(id); + while (byteArr.Count <= a) byteArr.Add(null); + byteArr[a] = arr[cursor]; + cursor++; + break; + } + } + return result; + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + return result; + } + } + } + +} + diff --git a/DataClients/TempDir.cs b/DataClients/TempDir.cs new file mode 100644 index 0000000..74ec1c4 --- /dev/null +++ b/DataClients/TempDir.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace DataClients +{ + public static class TempDir + { + private static readonly char split = '/'; + private static string dir = Directory.GetCurrentDirectory() + split + "temp"; + private static List protect = new List(); + private static Task checkTask = null; + private static async Task CheckDir() + { + while (true) + { + Directory.CreateDirectory(dir); + var listFiles = Directory.GetFiles(dir); + foreach (var e in listFiles) + { + var name = e.Split(split).Last(); + if (!protect.Contains(name) && File.GetCreationTime(e) < DateTime.Now.AddMinutes(-5)) + File.Delete(e); + } + await Task.Delay(5 * 60 * 1000); + } + } + public static void StartCkeckDir() + { + if (checkTask == null) + checkTask = Task.Run(() => CheckDir()); + } + public static bool AddProtect(string name) + { + StartCkeckDir(); + if (!protect.Contains(name)) + { + protect.Add(name); + return true; + } + return false; + } + public static bool RemoveProtect(string name) + { + StartCkeckDir(); + if (protect.Contains(name)) + { + protect.Remove(name); + return true; + } + return false; + } + public static string GetTempDirectory() + { + StartCkeckDir(); + return dir; + } + public static bool IsProtect(string name) + { + StartCkeckDir(); + return protect.Contains(name); + } + public static bool IsExist(string name) + { + StartCkeckDir(); + if (File.Exists(dir + split + name)) + if (File.GetCreationTime(dir + split + name) > DateTime.Now.AddMinutes(-5)) + return true; + else + File.Delete(dir + split + name); + return false; + } + + } +} diff --git a/DataClients/Variables.cs b/DataClients/Variables.cs new file mode 100644 index 0000000..fd136f6 --- /dev/null +++ b/DataClients/Variables.cs @@ -0,0 +1,603 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace DataClients +{ + public class IshData + { + public DateTime time; + public ushort id; + public string value; + } + + public class TechCycle + { + public enum Operation : ushort + { + end_tech_cycle = 0, + unloading_loading = 1, + vacuum_welding = 2, + welding = 5, + cooling_welding = 6, + looking_welding = 7, + vacuum_melting = 8, + breeding_bathtub = 9, + melting = 10, + VUR = 11, + cooling_ingot = 12, + unloading_kit = 13, + vacuum_reflow = 14, + reflow = 15, + cooling_reflow = 16, + overflow_metal = 17, + check_protection = 25 + } + public DateTime start; + public DateTime end; + public Operation index; + } + public class ByteMatrix + { + public DateTime time; + public byte?[] matrix; + } + public static class Converter + { + public static char ConvertByteToChar(byte b) + { + char temp; + switch (b) + { + case 0x00: temp = ' '; break; + case 0x09: temp = '\t'; break; + case 0x0a: temp = '\n'; break; + case 0x80: temp = 'А'; break; + case 0x81: temp = 'Б'; break; + case 0x82: temp = 'В'; break; + case 0x83: temp = 'Г'; break; + case 0x84: temp = 'Д'; break; + case 0x85: temp = 'Е'; break; + case 0x86: temp = 'Ж'; break; + case 0x87: temp = 'З'; break; + case 0x88: temp = 'И'; break; + case 0x89: temp = 'Й'; break; + case 0x8a: temp = 'К'; break; + case 0x8b: temp = 'Л'; break; + case 0x8c: temp = 'М'; break; + case 0x8d: temp = 'Н'; break; + case 0x8e: temp = 'О'; break; + case 0x8f: temp = 'П'; break; + case 0x90: temp = 'Р'; break; + case 0x91: temp = 'С'; break; + case 0x92: temp = 'Т'; break; + case 0x93: temp = 'У'; break; + case 0x94: temp = 'Ф'; break; + case 0x95: temp = 'Х'; break; + case 0x96: temp = 'Ц'; break; + case 0x97: temp = 'Ч'; break; + case 0x98: temp = 'Ш'; break; + case 0x99: temp = 'Щ'; break; + case 0x9a: temp = 'Ъ'; break; + case 0x9b: temp = 'Ы'; break; + case 0x9c: temp = 'Ь'; break; + case 0x9d: temp = 'Э'; break; + case 0x9e: temp = 'Ю'; break; + case 0x9f: temp = 'Я'; break; + case 0xa0: temp = 'а'; break; + case 0xa1: temp = 'б'; break; + case 0xa2: temp = 'в'; break; + case 0xa3: temp = 'г'; break; + case 0xa4: temp = 'д'; break; + case 0xa5: temp = 'е'; break; + case 0xa6: temp = 'ж'; break; + case 0xa7: temp = 'з'; break; + case 0xa8: temp = 'и'; break; + case 0xa9: temp = 'й'; break; + case 0xaa: temp = 'к'; break; + case 0xab: temp = 'л'; break; + case 0xac: temp = 'м'; break; + case 0xad: temp = 'н'; break; + case 0xae: temp = 'о'; break; + case 0xaf: temp = 'п'; break; + case 0xe0: temp = 'р'; break; + case 0xe1: temp = 'c'; break; + case 0xe2: temp = 'т'; break; + case 0xe3: temp = 'у'; break; + case 0xe4: temp = 'ф'; break; + case 0xe5: temp = 'х'; break; + case 0xe6: temp = 'ц'; break; + case 0xe7: temp = 'ч'; break; + case 0xe8: temp = 'ш'; break; + case 0xe9: temp = 'щ'; break; + case 0xea: temp = 'ъ'; break; + case 0xeb: temp = 'ы'; break; + case 0xec: temp = 'ь'; break; + case 0xed: temp = 'э'; break; + case 0xee: temp = 'ю'; break; + case 0xef: temp = 'я'; break; + case 0xf0: temp = 'Ё'; break; + case 0xf1: temp = 'ё'; break; + default: temp = Convert.ToChar(b); break; + } + return temp; + } + public static DateTime ConvertUnixTimeToDateTime(int unixTimeStamp) + { + DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0); + dtDateTime = dtDateTime.AddSeconds(unixTimeStamp).AddHours(5); + return dtDateTime; + } + } + public static class Names + { + public static List techCycle = new List() + { + "Конец технологического цикла", //00 + "Выгрузка-загрузка", //01 + "Вакуумирование на приварку", //02 + "Цикл 3", //03 + "Цикл 4", //04 + "Приварка", //05 + "Охлаждение приварки", //06 + "Осмотр приварки", //07 + "Вакуумирование на плавку", //08 + "Разведение ванны", //09 + "Плавка (основной режим)", //10 + "ВУР", //11 + "Охлаждение слитка", //12 + "Выгрузка комплекта", //13 + "Вакуумирование на оплавление", //14 + "Оплавление", //15 + "Охлаждение оплавыша", //16 + "Слив металла", //17 + "Цикл 18", //18 + "Цикл 19", //19 + "Цикл 20", //20 + "Цикл 21", //21 + "Цикл 22", //22 + "Цикл 23", //23 + "Цикл 24", //24 + "Проверка защит" //25 + }; + public static List analogFull = new List() + { + "", //000 + "", //001 + "", //002 + "", //003 + "", //004 + "", //005 + "", //006 + "", //007 + "", //008 + "", //009 + "", //010 + "", //011 + "", //012 + "Вакуум" //013 + }; + public static List analogShort = new List() + { + "", //000 + "", //001 + "", //002 + "", //003 + "", //004 + "", //005 + "", //006 + "", //007 + "", //008 + "", //009 + "", //010 + "", //011 + "", //012 + "Вакуум" //013 + }; + public static List analogMeasure = new List() + { + "", //000 + "", //001 + "", //002 + "", //003 + "", //004 + "", //005 + "", //006 + "", //007 + "", //008 + "", //009 + "", //010 + "", //011 + "", //012 + "мкм.рт.ст" //013 + }; + public static List discretFull = new List() + { + "", //000 + "", //001 + "", //002 + "", //003 + "", //004 + "", //005 + "", //006 + "", //007 + "", //008 + "", //009 + "", //010 + "", //011 + "", //012 + "", //013 + "", //014 + "", //015 + "", //016 + "", //017 + "", //018 + "", //019 + "", //020 + "", //021 + "SZO включен" //022 + }; + public static List discretShort = new List() + { + "", //000 + "", //001 + "", //002 + "", //003 + "", //004 + "", //005 + "", //006 + "", //007 + "", //008 + "", //009 + "", //010 + "", //011 + "", //012 + "", //013 + "", //014 + "", //015 + "", //016 + "", //017 + "", //018 + "", //019 + "", //020 + "", //021 + "" //022 + }; + public static List dscretMods = new List() + { + new string[] { "","" }, //000 + new string[] { "","" }, //001 + new string[] { "","" }, //002 + new string[] { "","" }, //003 + new string[] { "","" }, //004 + new string[] { "","" }, //005 + new string[] { "","" }, //006 + new string[] { "","" }, //007 + new string[] { "","" }, //008 + new string[] { "","" }, //009 + new string[] { "","" }, //010 + new string[] { "","" }, //011 + new string[] { "","" }, //012 + new string[] { "","" }, //013 + new string[] { "","" }, //014 + new string[] { "","" }, //015 + new string[] { "","" }, //016 + new string[] { "","" }, //017 + new string[] { "","" }, //018 + new string[] { "","" }, //019 + new string[] { "","" }, //020 + new string[] { "","" }, //021 + new string[] { "Нет","Да" } //022 + }; + public static List protect = new List() + { + "", //00 + "", //01 + "", //02 + "", //03 + "", //04 + "", //05 + "", //06 + "", //07 + "", //08 + "", //09 + "", //10 + "", //11 + "", //12 + "", //13 + "", //14 + "", //15 + "", //16 + "", //17 + "", //18 + "", //19 + "", //20 + "", //21 + "", //22 + "", //23 + "", //24 + "", //25 + "", //26 + "", //27 + "", //28 + "", //29 + "", //30 + "", //31 + "", //32 + "", //33 + "", //34 + "", //35 + "", //36 + "", //37 + "", //38 + "", //39 + "", //40 + "", //41 + "", //42 + "", //43 + "", //44 + "", //45 + "", //46 + "", //47 + "", //48 + "", //49 + "", //50 + "", //51 + "", //52 + "", //53 + "", //54 + "", //55 + "", //56 + "", //57 + "", //58 + "", //59 + "", //60 + "", //61 + "", //62 + "", //63 + "", //64 + "", //65 + "", //66 + "", //67 + "", //68 + "", //69 + "", //70 + "", //71 + "Алгоритм 31: Низкая скорость плавки!", //72 + "", //73 + "", //74 + "", //75 + "", //76 + "", //77 + "", //78 + "", //79 + "" //80 + }; + } + public class Pasport + { + public byte numVDP = 0x00; + public DateTime time_start = DateTime.Now; + public DateTime time_end = DateTime.Now; + public bool have_pasport = false; + public int kod_npl = 0; + public string nplav = ""; + public string rm = ""; + public string splav = ""; + public string _is = ""; + public ushort notd = 0; + public ushort vessl = 0; + public ushort diam = 0; + public ushort prpl = 0; + public string tin = ""; + public string dzap = ""; + public short dlog = 0; + public short last = 0; + public short dlper = 0; + public string nazn = ""; + public ushort kompl = 0; + public ushort izl = 0; + public float robm = 0.0f; + public float rizol = 0.0f; + public ushort dkr = 0; + public string nkon = ""; + public string pos = ""; + public string ukaz = ""; + public string zakaz = ""; + public string kat = ""; + public string pril = ""; + public string rezerved = ""; + + public byte[] time_start_byte { set { time_start = byte_to_date(value); } } + public byte[] time_end_byte { set { time_end = byte_to_date(value); } } + private DateTime byte_to_date(byte[] a) { return (a.Length < 7) ? DateTime.Now : new DateTime(BitConverter.ToUInt16(a, 0), (int)a[2], (int)a[3], (int)a[4], (int)a[5], (int)a[6]); } + + public byte[] byteArr + { + set + { + var i = 0; + if (value.Length < i + 1) return; + numVDP = value[i]; i += 1; + + if (value.Length < i + 7) return; + var arr = new byte[7]; + Array.Copy(value, i, arr, 0, 7); + time_start_byte = arr; i += 7; + + if (value.Length < i + 7) return; + arr = new byte[7]; + Array.Copy(value, i, arr, 0, 7); + time_end_byte = arr; i += 7; + + if (value.Length < i + 1) return; + have_pasport = value[i] == 0x01; i += 1; + + if (!have_pasport) return; + + if (value.Length < i + 4) return; + kod_npl = BitConverter.ToInt32(value, i); i += 4; + + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); + var enc = Encoding.GetEncoding(866); + + if (value.Length < i + 12) return; + nplav = enc.GetString(value, i, 12); i += 12; + + if (value.Length < i + 11) return; + rm = enc.GetString(value, i, 11); i += 11; + + if (value.Length < i + 101) return; + splav = enc.GetString(value, i, 101); i += 101; + + if (value.Length < i + 51) return; + _is = enc.GetString(value, i, 51); i += 51; + + if (value.Length < i + 2) return; + notd = BitConverter.ToUInt16(value, i); i += 2; + + if (value.Length < i + 2) return; + vessl = BitConverter.ToUInt16(value, i); i += 2; + + if (value.Length < i + 2) return; + diam = BitConverter.ToUInt16(value, i); i += 2; + + if (value.Length < i + 2) return; + prpl = BitConverter.ToUInt16(value, i); i += 2; + + if (value.Length < i + 9) return; + tin = enc.GetString(value, i, 9); i += 9; + + if (value.Length < i + 9) return; + dzap = enc.GetString(value, i, 9); i += 9; + + if (value.Length < i + 2) return; + dlog = BitConverter.ToInt16(value, i); i += 2; + + if (value.Length < i + 2) return; + last = BitConverter.ToInt16(value, i); i += 2; + + if (value.Length < i + 2) return; + dlper = BitConverter.ToInt16(value, i); i += 2; + + if (value.Length < i + 51) return; + nazn = enc.GetString(value, i, 51); i += 51; + + if (value.Length < i + 2) return; + kompl = BitConverter.ToUInt16(value, i); i += 2; + + if (value.Length < i + 2) return; + izl = BitConverter.ToUInt16(value, i); i += 2; + + if (value.Length < i + 4) return; + robm = BitConverter.ToSingle(value, i); i += 4; + + if (value.Length < i + 4) return; + rizol = BitConverter.ToSingle(value, i); i += 4; + + if (value.Length < i + 2) return; + dkr = BitConverter.ToUInt16(value, i); i += 2; + + if (value.Length < i + 51) return; + nkon = enc.GetString(value, i, 51); i += 51; + + if (value.Length < i + 6) return; + pos = enc.GetString(value, i, 6); i += 6; + + if (value.Length < i + 51) return; + ukaz = enc.GetString(value, i, 51); i += 51; + + if (value.Length < i + 51) return; + zakaz = enc.GetString(value, i, 51); i += 51; + + if (value.Length < i + 51) return; + kat = enc.GetString(value, i, 51); i += 51; + + if (value.Length < i + 3) return; + pril = enc.GetString(value, i, 3); i += 3; + + if (value.Length < i + 1023) return; + rezerved = enc.GetString(value, i, 1023); i += 1023; + } + } + + public string ToString() + { + var r = new StringBuilder(); + r.Append("numVDP:\t"); r.Append(numVDP); r.Append('\n'); + r.Append("tStart:\t"); r.Append(time_start.ToString()); r.Append('\n'); + r.Append("tEnd:\t"); r.Append(time_end.ToString()); r.Append('\n'); + r.Append("Check:\t"); r.Append(have_pasport.ToString()); r.Append('\n'); + if (!have_pasport) return r.ToString(); + r.Append("knpl:\t"); r.Append(kod_npl); r.Append('\n'); + r.Append("nplav:\t"); r.Append(nplav); r.Append('\n'); + r.Append("rm:\t"); r.Append(rm); r.Append('\n'); + r.Append("splav:\t"); r.Append(splav); r.Append('\n'); + r.Append("_is:\t"); r.Append(_is); r.Append('\n'); + r.Append("notd:\t"); r.Append(notd); r.Append('\n'); + r.Append("vessl:\t"); r.Append(vessl); r.Append('\n'); + r.Append("diam:\t"); r.Append(diam); r.Append('\n'); + r.Append("prpl:\t"); r.Append(prpl); r.Append('\n'); + r.Append("tin:\t"); r.Append(tin); r.Append('\n'); + r.Append("dzap:\t"); r.Append(dzap); r.Append('\n'); + r.Append("dlog:\t"); r.Append(dlog); r.Append('\n'); + r.Append("last:\t"); r.Append(last); r.Append('\n'); + r.Append("dlper:\t"); r.Append(dlper); r.Append('\n'); + r.Append("nazn:\t"); r.Append(nazn); r.Append('\n'); + r.Append("kompl:\t"); r.Append(kompl); r.Append('\n'); + r.Append("izl:\t"); r.Append(izl); r.Append('\n'); + r.Append("robm:\t"); r.Append(robm); r.Append('\n'); + r.Append("rizol:\t"); r.Append(rizol); r.Append('\n'); + r.Append("dkr:\t"); r.Append(dkr); r.Append('\n'); + r.Append("nkon:\t"); r.Append(nkon); r.Append('\n'); + r.Append("pos:\t"); r.Append(pos); r.Append('\n'); + r.Append("ukaz:\t"); r.Append(ukaz); r.Append('\n'); + r.Append("zakaz:\t"); r.Append(zakaz); r.Append('\n'); + r.Append("kat:\t"); r.Append(kat); r.Append('\n'); + r.Append("pril:\t"); r.Append(pril); r.Append('\n'); + r.Append("rezerv:\t"); r.Append(rezerved); r.Append('\n'); + return r.ToString(); + } +} + public class ADresult + { + public Dictionary[]> an = new Dictionary[]>(); + public Dictionary[]> di = new Dictionary[]>(); + } + public class AnalogsMatrix + { + public Dictionary matrix = new Dictionary(); + + public AnalogsMatrix(int vdp = 0) + { + matrix.Add(13, new Analog() { min = 0, max = 1000, mul = 0.1, byteId = new ushort[] { 26, 27 } }); + } + } + public class Analog + { + public double min = double.MinValue; + public double max = double.MaxValue; + public double mul = 1; + public ushort[] byteId = new ushort[0]; + } + public class DiscretsMatrix + { + public Dictionary matrix = new Dictionary(); + public DiscretsMatrix(int vdp = 0) + { + matrix.Add(22, new Discret() { byteId = 0x30, bitId = 6, invert = false }); + } + } + public class Discret + { + public ushort byteId = 0x00; + public ushort bitId = 0x00; + public bool invert = false; + } + public class Protect + { + public DateTime time; + public int id; + public int value; + } +} diff --git a/DataClients/bin/Debug/netstandard2.0/DataClients.deps.json b/DataClients/bin/Debug/netstandard2.0/DataClients.deps.json new file mode 100644 index 0000000..c7f963e --- /dev/null +++ b/DataClients/bin/Debug/netstandard2.0/DataClients.deps.json @@ -0,0 +1,97 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "DataClients/1.0.0": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "SharpZipLib": "1.2.0", + "System.Text.Encoding.CodePages": "4.7.1" + }, + "runtime": { + "DataClients.dll": {} + } + }, + "Microsoft.NETCore.Platforms/1.1.0": {}, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "SharpZipLib/1.2.0": { + "runtime": { + "lib/netstandard2.0/ICSharpCode.SharpZipLib.dll": { + "assemblyVersion": "1.2.0.246", + "fileVersion": "1.2.0.246" + } + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Text.Encoding.CodePages/4.7.1": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encoding.CodePages.dll": { + "assemblyVersion": "4.1.3.0", + "fileVersion": "4.700.20.21406" + } + } + } + } + }, + "libraries": { + "DataClients/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "path": "microsoft.netcore.platforms/1.1.0", + "hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "SharpZipLib/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zvWa/L02JHNatdtjya6Swpudb2YEHaOLHL1eRrqpjm71iGRNUNONO5adUF/9CHbSJbzhELW1UoH4NGy7n7+3bQ==", + "path": "sharpziplib/1.2.0", + "hashPath": "sharpziplib.1.2.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Text.Encoding.CodePages/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i2fOvznVVgOOTLUz8FgSap/MsR98I4Iaoz99VXcOW/e7Y2OdY42zhYpBYpZyivk5alYY/UsOWAVswhtjxceodA==", + "path": "system.text.encoding.codepages/4.7.1", + "hashPath": "system.text.encoding.codepages.4.7.1.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/DataClients/bin/Debug/netstandard2.0/DataClients.dll b/DataClients/bin/Debug/netstandard2.0/DataClients.dll new file mode 100644 index 0000000..5c663b8 Binary files /dev/null and b/DataClients/bin/Debug/netstandard2.0/DataClients.dll differ diff --git a/DataClients/bin/Debug/netstandard2.0/DataClients.pdb b/DataClients/bin/Debug/netstandard2.0/DataClients.pdb new file mode 100644 index 0000000..74fb79f Binary files /dev/null and b/DataClients/bin/Debug/netstandard2.0/DataClients.pdb differ diff --git a/DataClients/bin/Debug/netstandard2.0/STPClient.deps.json b/DataClients/bin/Debug/netstandard2.0/STPClient.deps.json new file mode 100644 index 0000000..f627088 --- /dev/null +++ b/DataClients/bin/Debug/netstandard2.0/STPClient.deps.json @@ -0,0 +1,47 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "STPClient/1.0.0": { + "dependencies": { + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "STPClient.dll": {} + } + }, + "Microsoft.NETCore.Platforms/1.1.0": {}, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + } + } + }, + "libraries": { + "STPClient/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "path": "microsoft.netcore.platforms/1.1.0", + "hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/DataClients/bin/Debug/netstandard2.0/STPClient.dll b/DataClients/bin/Debug/netstandard2.0/STPClient.dll new file mode 100644 index 0000000..1845bf4 Binary files /dev/null and b/DataClients/bin/Debug/netstandard2.0/STPClient.dll differ diff --git a/DataClients/bin/Debug/netstandard2.0/STPClient.pdb b/DataClients/bin/Debug/netstandard2.0/STPClient.pdb new file mode 100644 index 0000000..7fb6b9a Binary files /dev/null and b/DataClients/bin/Debug/netstandard2.0/STPClient.pdb differ diff --git a/DataClients/obj/DataClients.csproj.nuget.dgspec.json b/DataClients/obj/DataClients.csproj.nuget.dgspec.json new file mode 100644 index 0000000..2815b2c --- /dev/null +++ b/DataClients/obj/DataClients.csproj.nuget.dgspec.json @@ -0,0 +1,76 @@ +{ + "format": 1, + "restore": { + "F:\\Projects1\\DataClients\\DataClients.csproj": {} + }, + "projects": { + "F:\\Projects1\\DataClients\\DataClients.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\DataClients\\DataClients.csproj", + "projectName": "DataClients", + "projectPath": "F:\\Projects1\\DataClients\\DataClients.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\DataClients\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "SharpZipLib": { + "target": "Package", + "version": "[1.2.0, )" + }, + "System.Text.Encoding.CodePages": { + "target": "Package", + "version": "[4.7.1, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/DataClients/obj/DataClients.csproj.nuget.g.props b/DataClients/obj/DataClients.csproj.nuget.g.props new file mode 100644 index 0000000..1771934 --- /dev/null +++ b/DataClients/obj/DataClients.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\google\.nuget\packages\;C:\Microsoft\Xamarin\NuGet\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder + PackageReference + 5.6.0 + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/DataClients/obj/DataClients.csproj.nuget.g.targets b/DataClients/obj/DataClients.csproj.nuget.g.targets new file mode 100644 index 0000000..f09823b --- /dev/null +++ b/DataClients/obj/DataClients.csproj.nuget.g.targets @@ -0,0 +1,9 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + \ No newline at end of file diff --git a/DataClients/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs b/DataClients/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs new file mode 100644 index 0000000..45b1ca0 --- /dev/null +++ b/DataClients/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] diff --git a/DataClients/obj/Debug/netstandard2.0/DataClients.AssemblyInfo.cs b/DataClients/obj/Debug/netstandard2.0/DataClients.AssemblyInfo.cs new file mode 100644 index 0000000..d6d6ee0 --- /dev/null +++ b/DataClients/obj/Debug/netstandard2.0/DataClients.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("DataClients")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("DataClients")] +[assembly: System.Reflection.AssemblyTitleAttribute("DataClients")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Создано классом WriteCodeFragment MSBuild. + diff --git a/DataClients/obj/Debug/netstandard2.0/DataClients.AssemblyInfoInputs.cache b/DataClients/obj/Debug/netstandard2.0/DataClients.AssemblyInfoInputs.cache new file mode 100644 index 0000000..5a0aa81 --- /dev/null +++ b/DataClients/obj/Debug/netstandard2.0/DataClients.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +5b50c6ff4854229e53843d7ef9f5704fbed5215a diff --git a/DataClients/obj/Debug/netstandard2.0/DataClients.assets.cache b/DataClients/obj/Debug/netstandard2.0/DataClients.assets.cache new file mode 100644 index 0000000..bba558a Binary files /dev/null and b/DataClients/obj/Debug/netstandard2.0/DataClients.assets.cache differ diff --git a/DataClients/obj/Debug/netstandard2.0/DataClients.csproj.CoreCompileInputs.cache b/DataClients/obj/Debug/netstandard2.0/DataClients.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..a28a59c --- /dev/null +++ b/DataClients/obj/Debug/netstandard2.0/DataClients.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +28f25e2c7da5c3cddc132285b76b94739ff791dd diff --git a/DataClients/obj/Debug/netstandard2.0/DataClients.csproj.FileListAbsolute.txt b/DataClients/obj/Debug/netstandard2.0/DataClients.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..f2bee33 --- /dev/null +++ b/DataClients/obj/Debug/netstandard2.0/DataClients.csproj.FileListAbsolute.txt @@ -0,0 +1,18 @@ +F:\Projects1\DataClients\bin\Debug\netstandard2.0\DataClients.deps.json +F:\Projects1\DataClients\bin\Debug\netstandard2.0\DataClients.dll +F:\Projects1\DataClients\obj\Debug\netstandard2.0\DataClients.csprojAssemblyReference.cache +F:\Projects1\DataClients\obj\Debug\netstandard2.0\DataClients.AssemblyInfoInputs.cache +F:\Projects1\DataClients\obj\Debug\netstandard2.0\DataClients.AssemblyInfo.cs +F:\Projects1\DataClients\bin\Debug\netstandard2.0\DataClients.pdb +F:\Projects1\DataClients\obj\Debug\netstandard2.0\DataClients.dll +F:\Projects1\DataClients\obj\Debug\netstandard2.0\DataClients.pdb +F:\Projects1\DataClients\obj\Debug\netstandard2.0\DataClients.csproj.CoreCompileInputs.cache +G:\Projects1\DataClients\bin\Debug\netstandard2.0\DataClients.deps.json +G:\Projects1\DataClients\bin\Debug\netstandard2.0\DataClients.dll +G:\Projects1\DataClients\bin\Debug\netstandard2.0\DataClients.pdb +G:\Projects1\DataClients\obj\Debug\netstandard2.0\DataClients.csprojAssemblyReference.cache +G:\Projects1\DataClients\obj\Debug\netstandard2.0\DataClients.AssemblyInfoInputs.cache +G:\Projects1\DataClients\obj\Debug\netstandard2.0\DataClients.AssemblyInfo.cs +G:\Projects1\DataClients\obj\Debug\netstandard2.0\DataClients.csproj.CoreCompileInputs.cache +G:\Projects1\DataClients\obj\Debug\netstandard2.0\DataClients.dll +G:\Projects1\DataClients\obj\Debug\netstandard2.0\DataClients.pdb diff --git a/DataClients/obj/Debug/netstandard2.0/DataClients.csprojAssemblyReference.cache b/DataClients/obj/Debug/netstandard2.0/DataClients.csprojAssemblyReference.cache new file mode 100644 index 0000000..60b4636 Binary files /dev/null and b/DataClients/obj/Debug/netstandard2.0/DataClients.csprojAssemblyReference.cache differ diff --git a/DataClients/obj/Debug/netstandard2.0/DataClients.dll b/DataClients/obj/Debug/netstandard2.0/DataClients.dll new file mode 100644 index 0000000..5c663b8 Binary files /dev/null and b/DataClients/obj/Debug/netstandard2.0/DataClients.dll differ diff --git a/DataClients/obj/Debug/netstandard2.0/DataClients.pdb b/DataClients/obj/Debug/netstandard2.0/DataClients.pdb new file mode 100644 index 0000000..74fb79f Binary files /dev/null and b/DataClients/obj/Debug/netstandard2.0/DataClients.pdb differ diff --git a/DataClients/obj/Debug/netstandard2.0/STPClient.AssemblyInfo.cs b/DataClients/obj/Debug/netstandard2.0/STPClient.AssemblyInfo.cs new file mode 100644 index 0000000..d6d6ee0 --- /dev/null +++ b/DataClients/obj/Debug/netstandard2.0/STPClient.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("DataClients")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("DataClients")] +[assembly: System.Reflection.AssemblyTitleAttribute("DataClients")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Создано классом WriteCodeFragment MSBuild. + diff --git a/DataClients/obj/Debug/netstandard2.0/STPClient.AssemblyInfoInputs.cache b/DataClients/obj/Debug/netstandard2.0/STPClient.AssemblyInfoInputs.cache new file mode 100644 index 0000000..5a0aa81 --- /dev/null +++ b/DataClients/obj/Debug/netstandard2.0/STPClient.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +5b50c6ff4854229e53843d7ef9f5704fbed5215a diff --git a/DataClients/obj/Debug/netstandard2.0/STPClient.assets.cache b/DataClients/obj/Debug/netstandard2.0/STPClient.assets.cache new file mode 100644 index 0000000..f631866 Binary files /dev/null and b/DataClients/obj/Debug/netstandard2.0/STPClient.assets.cache differ diff --git a/DataClients/obj/Debug/netstandard2.0/STPClient.csproj.CoreCompileInputs.cache b/DataClients/obj/Debug/netstandard2.0/STPClient.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..c794f4c --- /dev/null +++ b/DataClients/obj/Debug/netstandard2.0/STPClient.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +7ee31470a41af845680b94375cd688c73b182d3e diff --git a/DataClients/obj/Debug/netstandard2.0/STPClient.csproj.FileListAbsolute.txt b/DataClients/obj/Debug/netstandard2.0/STPClient.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..4a57970 --- /dev/null +++ b/DataClients/obj/Debug/netstandard2.0/STPClient.csproj.FileListAbsolute.txt @@ -0,0 +1,9 @@ +D:\Projects\STPClient\bin\Debug\netstandard2.0\STPClient.deps.json +D:\Projects\STPClient\bin\Debug\netstandard2.0\STPClient.dll +D:\Projects\STPClient\bin\Debug\netstandard2.0\STPClient.pdb +D:\Projects\STPClient\obj\Debug\netstandard2.0\STPClient.csprojAssemblyReference.cache +D:\Projects\STPClient\obj\Debug\netstandard2.0\STPClient.AssemblyInfoInputs.cache +D:\Projects\STPClient\obj\Debug\netstandard2.0\STPClient.AssemblyInfo.cs +D:\Projects\STPClient\obj\Debug\netstandard2.0\STPClient.csproj.CoreCompileInputs.cache +D:\Projects\STPClient\obj\Debug\netstandard2.0\STPClient.dll +D:\Projects\STPClient\obj\Debug\netstandard2.0\STPClient.pdb diff --git a/DataClients/obj/Debug/netstandard2.0/STPClient.csprojAssemblyReference.cache b/DataClients/obj/Debug/netstandard2.0/STPClient.csprojAssemblyReference.cache new file mode 100644 index 0000000..c53053a Binary files /dev/null and b/DataClients/obj/Debug/netstandard2.0/STPClient.csprojAssemblyReference.cache differ diff --git a/DataClients/obj/Debug/netstandard2.0/STPClient.dll b/DataClients/obj/Debug/netstandard2.0/STPClient.dll new file mode 100644 index 0000000..1845bf4 Binary files /dev/null and b/DataClients/obj/Debug/netstandard2.0/STPClient.dll differ diff --git a/DataClients/obj/Debug/netstandard2.0/STPClient.pdb b/DataClients/obj/Debug/netstandard2.0/STPClient.pdb new file mode 100644 index 0000000..7fb6b9a Binary files /dev/null and b/DataClients/obj/Debug/netstandard2.0/STPClient.pdb differ diff --git a/DataClients/obj/STPClient.csproj.nuget.dgspec.json b/DataClients/obj/STPClient.csproj.nuget.dgspec.json new file mode 100644 index 0000000..be9e915 --- /dev/null +++ b/DataClients/obj/STPClient.csproj.nuget.dgspec.json @@ -0,0 +1,68 @@ +{ + "format": 1, + "restore": { + "F:\\Projects1\\STPClient\\STPClient.csproj": {} + }, + "projects": { + "F:\\Projects1\\STPClient\\STPClient.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\STPClient\\STPClient.csproj", + "projectName": "DataClients", + "projectPath": "F:\\Projects1\\STPClient\\STPClient.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\STPClient\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/DataClients/obj/STPClient.csproj.nuget.g.props b/DataClients/obj/STPClient.csproj.nuget.g.props new file mode 100644 index 0000000..1771934 --- /dev/null +++ b/DataClients/obj/STPClient.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\google\.nuget\packages\;C:\Microsoft\Xamarin\NuGet\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder + PackageReference + 5.6.0 + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/DataClients/obj/STPClient.csproj.nuget.g.targets b/DataClients/obj/STPClient.csproj.nuget.g.targets new file mode 100644 index 0000000..f09823b --- /dev/null +++ b/DataClients/obj/STPClient.csproj.nuget.g.targets @@ -0,0 +1,9 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + \ No newline at end of file diff --git a/DataClients/obj/project.assets.json b/DataClients/obj/project.assets.json new file mode 100644 index 0000000..6e0d0eb --- /dev/null +++ b/DataClients/obj/project.assets.json @@ -0,0 +1,380 @@ +{ + "version": 3, + "targets": { + ".NETStandard,Version=v2.0": { + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + }, + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + }, + "build": { + "build/netstandard2.0/NETStandard.Library.targets": {} + } + }, + "SharpZipLib/1.2.0": { + "type": "package", + "compile": { + "lib/netstandard2.0/ICSharpCode.SharpZipLib.dll": {} + }, + "runtime": { + "lib/netstandard2.0/ICSharpCode.SharpZipLib.dll": {} + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "compile": { + "ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": {} + }, + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": {} + } + }, + "System.Text.Encoding.CodePages/4.7.1": { + "type": "package", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "compile": { + "lib/netstandard2.0/System.Text.Encoding.CodePages.dll": {} + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encoding.CodePages.dll": {} + }, + "runtimeTargets": { + "runtimes/win/lib/netstandard2.0/System.Text.Encoding.CodePages.dll": { + "assetType": "runtime", + "rid": "win" + } + } + } + } + }, + "libraries": { + "Microsoft.NETCore.Platforms/1.1.0": { + "sha512": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "type": "package", + "path": "microsoft.netcore.platforms/1.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "ThirdPartyNotices.txt", + "dotnet_library_license.txt", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.1.1.0.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json" + ] + }, + "NETStandard.Library/2.0.3": { + "sha512": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "type": "package", + "path": "netstandard.library/2.0.3", + "files": [ + ".nupkg.metadata", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "build/netstandard2.0/NETStandard.Library.targets", + "build/netstandard2.0/ref/Microsoft.Win32.Primitives.dll", + "build/netstandard2.0/ref/System.AppContext.dll", + "build/netstandard2.0/ref/System.Collections.Concurrent.dll", + "build/netstandard2.0/ref/System.Collections.NonGeneric.dll", + "build/netstandard2.0/ref/System.Collections.Specialized.dll", + "build/netstandard2.0/ref/System.Collections.dll", + "build/netstandard2.0/ref/System.ComponentModel.Composition.dll", + "build/netstandard2.0/ref/System.ComponentModel.EventBasedAsync.dll", + "build/netstandard2.0/ref/System.ComponentModel.Primitives.dll", + "build/netstandard2.0/ref/System.ComponentModel.TypeConverter.dll", + "build/netstandard2.0/ref/System.ComponentModel.dll", + "build/netstandard2.0/ref/System.Console.dll", + "build/netstandard2.0/ref/System.Core.dll", + "build/netstandard2.0/ref/System.Data.Common.dll", + "build/netstandard2.0/ref/System.Data.dll", + "build/netstandard2.0/ref/System.Diagnostics.Contracts.dll", + "build/netstandard2.0/ref/System.Diagnostics.Debug.dll", + "build/netstandard2.0/ref/System.Diagnostics.FileVersionInfo.dll", + "build/netstandard2.0/ref/System.Diagnostics.Process.dll", + "build/netstandard2.0/ref/System.Diagnostics.StackTrace.dll", + "build/netstandard2.0/ref/System.Diagnostics.TextWriterTraceListener.dll", + "build/netstandard2.0/ref/System.Diagnostics.Tools.dll", + "build/netstandard2.0/ref/System.Diagnostics.TraceSource.dll", + "build/netstandard2.0/ref/System.Diagnostics.Tracing.dll", + "build/netstandard2.0/ref/System.Drawing.Primitives.dll", + "build/netstandard2.0/ref/System.Drawing.dll", + "build/netstandard2.0/ref/System.Dynamic.Runtime.dll", + "build/netstandard2.0/ref/System.Globalization.Calendars.dll", + "build/netstandard2.0/ref/System.Globalization.Extensions.dll", + "build/netstandard2.0/ref/System.Globalization.dll", + "build/netstandard2.0/ref/System.IO.Compression.FileSystem.dll", + "build/netstandard2.0/ref/System.IO.Compression.ZipFile.dll", + "build/netstandard2.0/ref/System.IO.Compression.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.DriveInfo.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.Primitives.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.Watcher.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.dll", + "build/netstandard2.0/ref/System.IO.IsolatedStorage.dll", + "build/netstandard2.0/ref/System.IO.MemoryMappedFiles.dll", + "build/netstandard2.0/ref/System.IO.Pipes.dll", + "build/netstandard2.0/ref/System.IO.UnmanagedMemoryStream.dll", + "build/netstandard2.0/ref/System.IO.dll", + "build/netstandard2.0/ref/System.Linq.Expressions.dll", + "build/netstandard2.0/ref/System.Linq.Parallel.dll", + "build/netstandard2.0/ref/System.Linq.Queryable.dll", + "build/netstandard2.0/ref/System.Linq.dll", + "build/netstandard2.0/ref/System.Net.Http.dll", + "build/netstandard2.0/ref/System.Net.NameResolution.dll", + "build/netstandard2.0/ref/System.Net.NetworkInformation.dll", + "build/netstandard2.0/ref/System.Net.Ping.dll", + "build/netstandard2.0/ref/System.Net.Primitives.dll", + "build/netstandard2.0/ref/System.Net.Requests.dll", + "build/netstandard2.0/ref/System.Net.Security.dll", + "build/netstandard2.0/ref/System.Net.Sockets.dll", + "build/netstandard2.0/ref/System.Net.WebHeaderCollection.dll", + "build/netstandard2.0/ref/System.Net.WebSockets.Client.dll", + "build/netstandard2.0/ref/System.Net.WebSockets.dll", + "build/netstandard2.0/ref/System.Net.dll", + "build/netstandard2.0/ref/System.Numerics.dll", + "build/netstandard2.0/ref/System.ObjectModel.dll", + "build/netstandard2.0/ref/System.Reflection.Extensions.dll", + "build/netstandard2.0/ref/System.Reflection.Primitives.dll", + "build/netstandard2.0/ref/System.Reflection.dll", + "build/netstandard2.0/ref/System.Resources.Reader.dll", + "build/netstandard2.0/ref/System.Resources.ResourceManager.dll", + "build/netstandard2.0/ref/System.Resources.Writer.dll", + "build/netstandard2.0/ref/System.Runtime.CompilerServices.VisualC.dll", + "build/netstandard2.0/ref/System.Runtime.Extensions.dll", + "build/netstandard2.0/ref/System.Runtime.Handles.dll", + "build/netstandard2.0/ref/System.Runtime.InteropServices.RuntimeInformation.dll", + "build/netstandard2.0/ref/System.Runtime.InteropServices.dll", + "build/netstandard2.0/ref/System.Runtime.Numerics.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Formatters.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Json.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Primitives.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Xml.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.dll", + "build/netstandard2.0/ref/System.Runtime.dll", + "build/netstandard2.0/ref/System.Security.Claims.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Algorithms.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Csp.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Encoding.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Primitives.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.X509Certificates.dll", + "build/netstandard2.0/ref/System.Security.Principal.dll", + "build/netstandard2.0/ref/System.Security.SecureString.dll", + "build/netstandard2.0/ref/System.ServiceModel.Web.dll", + "build/netstandard2.0/ref/System.Text.Encoding.Extensions.dll", + "build/netstandard2.0/ref/System.Text.Encoding.dll", + "build/netstandard2.0/ref/System.Text.RegularExpressions.dll", + "build/netstandard2.0/ref/System.Threading.Overlapped.dll", + "build/netstandard2.0/ref/System.Threading.Tasks.Parallel.dll", + "build/netstandard2.0/ref/System.Threading.Tasks.dll", + "build/netstandard2.0/ref/System.Threading.Thread.dll", + "build/netstandard2.0/ref/System.Threading.ThreadPool.dll", + "build/netstandard2.0/ref/System.Threading.Timer.dll", + "build/netstandard2.0/ref/System.Threading.dll", + "build/netstandard2.0/ref/System.Transactions.dll", + "build/netstandard2.0/ref/System.ValueTuple.dll", + "build/netstandard2.0/ref/System.Web.dll", + "build/netstandard2.0/ref/System.Windows.dll", + "build/netstandard2.0/ref/System.Xml.Linq.dll", + "build/netstandard2.0/ref/System.Xml.ReaderWriter.dll", + "build/netstandard2.0/ref/System.Xml.Serialization.dll", + "build/netstandard2.0/ref/System.Xml.XDocument.dll", + "build/netstandard2.0/ref/System.Xml.XPath.XDocument.dll", + "build/netstandard2.0/ref/System.Xml.XPath.dll", + "build/netstandard2.0/ref/System.Xml.XmlDocument.dll", + "build/netstandard2.0/ref/System.Xml.XmlSerializer.dll", + "build/netstandard2.0/ref/System.Xml.dll", + "build/netstandard2.0/ref/System.dll", + "build/netstandard2.0/ref/mscorlib.dll", + "build/netstandard2.0/ref/netstandard.dll", + "build/netstandard2.0/ref/netstandard.xml", + "lib/netstandard1.0/_._", + "netstandard.library.2.0.3.nupkg.sha512", + "netstandard.library.nuspec" + ] + }, + "SharpZipLib/1.2.0": { + "sha512": "zvWa/L02JHNatdtjya6Swpudb2YEHaOLHL1eRrqpjm71iGRNUNONO5adUF/9CHbSJbzhELW1UoH4NGy7n7+3bQ==", + "type": "package", + "path": "sharpziplib/1.2.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net45/ICSharpCode.SharpZipLib.dll", + "lib/net45/ICSharpCode.SharpZipLib.pdb", + "lib/net45/ICSharpCode.SharpZipLib.xml", + "lib/netstandard2.0/ICSharpCode.SharpZipLib.dll", + "lib/netstandard2.0/ICSharpCode.SharpZipLib.pdb", + "lib/netstandard2.0/ICSharpCode.SharpZipLib.xml", + "sharpziplib.1.2.0.nupkg.sha512", + "sharpziplib.nuspec" + ] + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "sha512": "zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "type": "package", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll", + "lib/net461/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/net461/System.Runtime.CompilerServices.Unsafe.dll", + "ref/net461/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml", + "ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll", + "ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml", + "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512", + "system.runtime.compilerservices.unsafe.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Text.Encoding.CodePages/4.7.1": { + "sha512": "i2fOvznVVgOOTLUz8FgSap/MsR98I4Iaoz99VXcOW/e7Y2OdY42zhYpBYpZyivk5alYY/UsOWAVswhtjxceodA==", + "type": "package", + "path": "system.text.encoding.codepages/4.7.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Text.Encoding.CodePages.dll", + "lib/net461/System.Text.Encoding.CodePages.dll", + "lib/net461/System.Text.Encoding.CodePages.xml", + "lib/netstandard1.3/System.Text.Encoding.CodePages.dll", + "lib/netstandard2.0/System.Text.Encoding.CodePages.dll", + "lib/netstandard2.0/System.Text.Encoding.CodePages.xml", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/win/lib/net461/System.Text.Encoding.CodePages.dll", + "runtimes/win/lib/net461/System.Text.Encoding.CodePages.xml", + "runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll", + "runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.xml", + "runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll", + "runtimes/win/lib/netstandard2.0/System.Text.Encoding.CodePages.dll", + "runtimes/win/lib/netstandard2.0/System.Text.Encoding.CodePages.xml", + "system.text.encoding.codepages.4.7.1.nupkg.sha512", + "system.text.encoding.codepages.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + } + }, + "projectFileDependencyGroups": { + ".NETStandard,Version=v2.0": [ + "NETStandard.Library >= 2.0.3", + "SharpZipLib >= 1.2.0", + "System.Text.Encoding.CodePages >= 4.7.1" + ] + }, + "packageFolders": { + "C:\\Users\\google\\.nuget\\packages\\": {}, + "C:\\Microsoft\\Xamarin\\NuGet\\": {}, + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\DataClients\\DataClients.csproj", + "projectName": "DataClients", + "projectPath": "F:\\Projects1\\DataClients\\DataClients.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\DataClients\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "SharpZipLib": { + "target": "Package", + "version": "[1.2.0, )" + }, + "System.Text.Encoding.CodePages": { + "target": "Package", + "version": "[4.7.1, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/DataClients/obj/project.nuget.cache b/DataClients/obj/project.nuget.cache new file mode 100644 index 0000000..89dce8a --- /dev/null +++ b/DataClients/obj/project.nuget.cache @@ -0,0 +1,14 @@ +{ + "version": 2, + "dgSpecHash": "luIlLkJpphdxn+N0Tej8I3Q8t0JhY6JKvYdSHoGjFRJtuja+iy9Rig0D/ls+i8l95ePrv+iVmnnMZKlk07oDFA==", + "success": true, + "projectFilePath": "F:\\Projects1\\DataClients\\DataClients.csproj", + "expectedPackageFiles": [ + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\netstandard.library\\2.0.3\\netstandard.library.2.0.3.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\sharpziplib\\1.2.0\\sharpziplib.1.2.0.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\4.7.1\\system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\system.text.encoding.codepages\\4.7.1\\system.text.encoding.codepages.4.7.1.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/Mailing/Mailing.csproj b/Mailing/Mailing.csproj new file mode 100644 index 0000000..ad9065d --- /dev/null +++ b/Mailing/Mailing.csproj @@ -0,0 +1,19 @@ + + + + Exe + netcoreapp3.1 + + + + + + + + + + + + + + diff --git a/Mailing/Program.cs b/Mailing/Program.cs new file mode 100644 index 0000000..a3c5393 --- /dev/null +++ b/Mailing/Program.cs @@ -0,0 +1,91 @@ +using DataClients; +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net.Mail; +using System.Text; + +namespace Mailing +{ + class Program + { + static void Main(string[] args) + { + if (args.Length < 1) + Console.WriteLine("Need params."); + var mailList = new List(); + { + var strings = File.ReadAllLines(args.Last()); + foreach (var e in strings) + { + var tmp = e.Split(' '); + foreach (var ee in tmp) + { + try + { + MailAddress m = new MailAddress(ee.ToLower()); + if (!mailList.Contains(ee.ToLower())) + mailList.Add(ee.ToLower()); + } + catch (Exception) { } + } + } + } + switch (args[0]) + { + case "SZO": + if (args.Length != 3) + { + Console.WriteLine("Wrong format"); + Console.WriteLine("Example: Maling SZO 2020.07.14 /mail.list"); + return; + } + + var time = DateTime.Now; + { + try + { + var s = args[1].Split('.'); + time = new DateTime( + Convert.ToInt32(s[0]), + Convert.ToInt32(s[1]), + Convert.ToInt32(s[2])); + } + catch + { + Console.WriteLine("Wrong format data"); + Console.WriteLine("Example: 2020.07.14"); + return; + } + } + GenSZO.GetPDF(time); + var file = Directory.GetCurrentDirectory() + "/" + time.ToString("yyyy-MM-dd") + ".pdf"; + foreach (var e in mailList) + Mailing.SendMail(new MailAddress(e), file); + break; + + } + } + } + public static class Mailing + { + private static readonly MailAddress From = new MailAddress("no-reply@vsmpo.ru", "ASCKU_32_ROBOT"); + private static SmtpClient Smtp = new SmtpClient("mail.vsmpo.ru", 25); + private static string Subject = "Контроль работы SZO"; + private static string Body = "Ежедневная рассылка контроля работы " + + "водокольцевых насосов SZO на ВДП в цехе №32"; + public static void SendMail(MailAddress to, string file) + { + MailMessage m = new MailMessage(From, to) + { + Subject = Subject, + Body = Body + }; + m.Attachments.Add(new Attachment(file)); + Smtp.Send(m); + + } + } +} diff --git a/Mailing/Properties/launchSettings.json b/Mailing/Properties/launchSettings.json new file mode 100644 index 0000000..b718a6c --- /dev/null +++ b/Mailing/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Mailing": { + "commandName": "Project", + "commandLineArgs": "SZO 2020.08.28 F:\\Projects1\\Mailing\\bin\\Debug\\netcoreapp3.1\\mailing_SZO.list" + } + } +} \ No newline at end of file diff --git a/Mailing/SZO.cs b/Mailing/SZO.cs new file mode 100644 index 0000000..c66d650 --- /dev/null +++ b/Mailing/SZO.cs @@ -0,0 +1,379 @@ +using DataClients; +using MigraDoc.DocumentObjectModel; +using MigraDoc.DocumentObjectModel.Tables; +using MigraDoc.Rendering; +using PdfSharp.Drawing; +using PdfSharp.Fonts; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace Mailing +{ + public static class GenSZO + { + private static DateTime timeStart = DateTime.Now.AddDays(-1); + private static DateTime timeEnd = DateTime.Now; + private static Dictionary> resFull = new Dictionary>(); + + public static void GetPDF(DateTime time) + { + timeStart = new DateTime(time.Year, time.Month, time.Day, 0, 0, 0); + timeEnd = new DateTime(time.Year, time.Month, time.Day, 0, 0, 0).AddDays(1); + GetData(); + PDFGenSZO.AddHeader("Контроль работы водокольцевых насосов SZO ", timeStart, timeEnd); + foreach (var e in resFull) + PDFGenSZO.AddSZOTable(e.Key, e.Value); + PDFGenSZO.AddTotalTime(); + PDFGenSZO.Print(time); + } + + private static void GetData() + { + var a = new STPClient(); + for (ushort i = 1; i <= 50; i++) + { + var tc = a.GetTechCycle(timeStart, timeEnd, i); + var ad = a.GetAnalogDiscret(timeStart, timeEnd, i); + foreach (var e in tc) + { + int[] chk1 = { + (int)TechCycle.Operation.cooling_ingot, + (int)TechCycle.Operation.cooling_reflow, + (int)TechCycle.Operation.cooling_welding }; + int[] chk2 = + { + (int)TechCycle.Operation.end_tech_cycle, + (int)TechCycle.Operation.unloading_loading, + (int)TechCycle.Operation.looking_welding, + (int)TechCycle.Operation.unloading_kit + }; + if (!chk1.Contains((int)e.index) && !chk2.Contains((int)e.index)) + continue; + + if (chk1.Contains((int)e.index)) + { + var test = + (from l in ad.an[13] + where l.Item1 >= e.start && + l.Item1 <= e.end && + l.Item2 >= 30 + select l).ToArray(); + if (test.Length == 0) + continue; + } + + var currstat = new Tuple(e.start, null); + foreach (var d in ad.di[22]) + { + if ( + currstat.Item1 <= e.end && + d.Item1 >= e.start && + currstat.Item2.HasValue && + currstat.Item2.Value + ) + { + var t1 = currstat.Item1 > e.start ? currstat.Item1 : e.start; + var t2 = d.Item1 > e.end ? e.end : d.Item1; + var res = t2 - t1; + currstat = d; + if (chk1.Contains((int)e.index) && res.TotalMinutes < 15) + continue; + if (!resFull.ContainsKey(i)) + resFull.Add(i, new List()); + resFull[i].Add(new SZOWork() + { + oper = e.index, + techCycleStart = e.start, + WorkTime = res + }); + } + currstat = d; + } + } + } + } + + public class SZOWork + { + public TechCycle.Operation oper = TechCycle.Operation.unloading_loading; + public DateTime techCycleStart = DateTime.Now; + public TimeSpan WorkTime = new TimeSpan(); + } + } + + public static class PDFGenSZO + { + private static TimeSpan totalTime = new TimeSpan(); + private static Document doc = new Document(); + public static void AddHeader(string name, DateTime start, DateTime end) + { + EZFontResolver fontRes = EZFontResolver.Get; + GlobalFontSettings.FontResolver = fontRes; + fontRes.AddFont("TNR", XFontStyle.Regular, @"./times.ttf"); + fontRes.AddFont("TNR", XFontStyle.Bold, @"./timesbd.ttf"); + fontRes.AddFont("TNR", XFontStyle.BoldItalic, @"./timesbi.ttf"); + fontRes.AddFont("TNR", XFontStyle.Italic, @"./timesi.ttf"); + + Section page = AddPage(); + var title = page.AddParagraph(); + title.Format.Alignment = ParagraphAlignment.Center; + title.Format.Font.Size = 14; + title.Format.Font.Name = "TNR"; + title.Format.SpaceAfter = new Unit(10, UnitType.Millimeter); + + title.AddText(name + "\n"); + end = end.AddSeconds(-1); + title.AddText("за период с " + start.ToString("dd.MM.yyyy") + " по " + end.ToString("dd.MM.yyyy") + "\n"); + } + + public static void AddSZOTable(int vdp, List res) + { + var title = doc.LastSection.AddParagraph(); + title.Format.Alignment = ParagraphAlignment.Left; + title.Format.Font.Size = 12; + title.Format.Font.Name = "TNR"; + title.Format.SpaceAfter = new Unit(2, UnitType.Millimeter); + title.AddText("Работа SZO печи №" + vdp.ToString("D2") + "\n"); + + var table = doc.LastSection.AddTable(); + table.Format.Alignment = ParagraphAlignment.Center; + table.Format.Font.Size = 12; + table.Format.Font.Name = "TNR"; + table.Rows.LeftIndent = 0; + + int[] colSize = { 5, 8, 4 }; + foreach (var e in colSize) + { + var col = table.AddColumn(new Unit(e, UnitType.Centimeter)); + col.Borders.Left.Color = new Color(0, 0, 0); + col.Borders.Left.Width = 0.25; + col.Borders.Right.Color = new Color(0, 0, 0); + col.Borders.Right.Width = 0.25; + } + + var row = table.AddRow(); + row.Borders.Top.Color = new Color(0, 0, 0); + row.Borders.Top.Width = 0.25; + row.Borders.Bottom.Color = new Color(0, 0, 0); + row.Borders.Bottom.Width = 0.25; + row.HeadingFormat = true; + row.VerticalAlignment = VerticalAlignment.Center; + row.Cells[0].AddParagraph("Время начала операции"); + row.Cells[1].AddParagraph("Название операции"); + row.Cells[2].AddParagraph("Время работы SZO"); + + var totalVDP = new TimeSpan(); + foreach (var e in res) + { + row = table.AddRow(); + row.Borders.Bottom.Color = new Color(0, 0, 0); + row.Borders.Bottom.Width = 0.25; + row.VerticalAlignment = VerticalAlignment.Center; + + row.Cells[0].AddParagraph(e.techCycleStart.ToString(@"yyyy.MM.dd HH:mm:ss.ff")); + row.Cells[1].AddParagraph(Names.techCycle[(int)e.oper]); + row.Cells[2].AddParagraph(e.WorkTime.ToString(@"hh\:mm\:ss")); + totalVDP = totalVDP.Add(e.WorkTime); + } + + title = doc.LastSection.AddParagraph(); + title.Format.Alignment = ParagraphAlignment.Right; + title.Format.Font.Size = 12; + title.Format.Font.Name = "TNR"; + title.Format.SpaceAfter = new Unit(10, UnitType.Millimeter); + title.AddText( + "Общее время работы SZO печи №" + vdp.ToString("D2") + + ": " + totalVDP.ToString(@"hh\:mm\:ss") + ); + totalTime = totalTime.Add(totalVDP); + } + public static void AddTotalTime() { AddTotalTime(totalTime); } + public static void AddTotalTime(TimeSpan time) + { + var title = doc.LastSection.AddParagraph(); + title.Format.Alignment = ParagraphAlignment.Left; + title.Format.Font.Size = 12; + title.Format.Font.Name = "TNR"; + title.Format.SpaceAfter = new Unit(10, UnitType.Millimeter); + title.AddText("Общее время работы SZO: " + time.ToString(@"%d\.hh\:mm\:ss")); + } + + public static void Print(DateTime time) + { + var file = Directory.GetCurrentDirectory() + '/' + time.ToString("yyyy-MM-dd") + ".pdf"; + if (File.Exists(file)) + File.Delete(file); + var pdfRenderer = new PdfDocumentRenderer(true) { Document = doc }; + pdfRenderer.RenderDocument(); + pdfRenderer.PdfDocument.Save(file); + } + private static Section AddPage() + { + Section section = doc.AddSection(); + section.PageSetup.PageFormat = PageFormat.A4; + section.PageSetup.Orientation = Orientation.Portrait; + section.PageSetup.BottomMargin = new Unit(20, UnitType.Millimeter); + section.PageSetup.TopMargin = new Unit(20, UnitType.Millimeter); + section.PageSetup.LeftMargin = new Unit(30, UnitType.Millimeter); + section.PageSetup.RightMargin = new Unit(15, UnitType.Millimeter); + return section; + } + } + + /// + /// EZFontResolver is a generic font resolver for PDFsharp. + /// It implement IFontResolver internally. + /// To use it, just pass your fonts as filename or byte[] + /// in calls to AddFont. + /// + public class EZFontResolver : IFontResolver + { + EZFontResolver() + { } + + /// + /// Gets the one and only EZFontResolver object. + /// + public static EZFontResolver Get + { + get { return _singleton ?? (_singleton = new EZFontResolver()); } + } + private static EZFontResolver _singleton; + + /// + /// Adds the font passing a filename. + /// + /// Name of the font family. + /// The style. + /// The filename. + /// if set to true bold will be simulated. + /// if set to true italic will be simulated. + /// + /// Font file is too big. + /// or + /// Reading font file failed. + /// + public void AddFont(string familyName, XFontStyle style, string filename, + bool simulateBold = false, bool simulateItalic = false) + { + using (var fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read)) + { + var size = fs.Length; + if (size > int.MaxValue) + throw new Exception("Font file is too big."); + var length = (int)size; + var data = new byte[length]; + var read = fs.Read(data, 0, length); + if (length != read) + throw new Exception("Reading font file failed."); + AddFont(familyName, style, data, simulateBold, simulateItalic); + } + } + + /// + /// Adds the font passing a byte array containing the font. + /// + /// Name of the font family. + /// The style. + /// The data. + /// if set to true bold will be simulated. + /// if set to true italic will be simulated. + public void AddFont(string familyName, XFontStyle style, byte[] data, + bool simulateBold = false, bool simulateItalic = false) + { + // Add the font as we get it. + AddFontHelper(familyName, style, data, false, false); + + // If the font is not bold and bold simulation is requested, add that, too. + if (simulateBold && (style & XFontStyle.Bold) == 0) + { + AddFontHelper(familyName, style | XFontStyle.Bold, data, true, false); + } + + // Same for italic. + if (simulateItalic && (style & XFontStyle.Italic) == 0) + { + AddFontHelper(familyName, style | XFontStyle.Italic, data, false, true); + } + + // Same for bold and italic. + if (simulateBold && (style & XFontStyle.Bold) == 0 && + simulateItalic && (style & XFontStyle.Italic) == 0) + { + AddFontHelper(familyName, style | XFontStyle.BoldItalic, data, true, true); + } + } + + void AddFontHelper(string familyName, XFontStyle style, byte[] data, bool simulateBold, bool simulateItalic) + { + // Currently we do not need FamilyName and Style. + // FaceName is a combination of FamilyName and Style. + var fi = new EZFontInfo + { + //FamilyName = familyName, + FaceName = familyName.ToLower(), + //Style = style, + Data = data, + SimulateBold = simulateBold, + SimulateItalic = simulateItalic + }; + if ((style & XFontStyle.Bold) != 0) + { + // TODO Create helper method to prevent having duplicate string literals? + fi.FaceName += "|b"; + } + if ((style & XFontStyle.Italic) != 0) + { + fi.FaceName += "|i"; + } + + // Check if we already have this font. + var test = GetFont(fi.FaceName); + if (test != null) + throw new Exception("Font " + familyName + " with this style was already registered."); + + _fonts.Add(fi.FaceName.ToLower(), fi); + } + + #region IFontResolver + public FontResolverInfo ResolveTypeface(string familyName, bool isBold, bool isItalic) + { + string faceName = familyName.ToLower() + + (isBold ? "|b" : "") + + (isItalic ? "|i" : ""); + EZFontInfo item; + if (_fonts.TryGetValue(faceName, out item)) + { + var result = new FontResolverInfo(item.FaceName, item.SimulateBold, item.SimulateItalic); + return result; + } + return null; + } + + public byte[] GetFont(string faceName) + { + EZFontInfo item; + if (_fonts.TryGetValue(faceName, out item)) + { + return item.Data; + } + return null; + } + #endregion + + private readonly Dictionary _fonts = new Dictionary(); + + struct EZFontInfo + { + //internal string FamilyName; + internal string FaceName; + //internal XFontStyle Style; + internal byte[] Data; + internal bool SimulateBold; + internal bool SimulateItalic; + } + } +} diff --git a/Mailing/bin/Debug/netcoreapp3.1/DataClients.dll b/Mailing/bin/Debug/netcoreapp3.1/DataClients.dll new file mode 100644 index 0000000..5c663b8 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/DataClients.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/DataClients.pdb b/Mailing/bin/Debug/netcoreapp3.1/DataClients.pdb new file mode 100644 index 0000000..74fb79f Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/DataClients.pdb differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/ICSharpCode.SharpZipLib.dll b/Mailing/bin/Debug/netcoreapp3.1/ICSharpCode.SharpZipLib.dll new file mode 100644 index 0000000..58893ba Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/ICSharpCode.SharpZipLib.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/Mailing.deps.json b/Mailing/bin/Debug/netcoreapp3.1/Mailing.deps.json new file mode 100644 index 0000000..ffaeb51 --- /dev/null +++ b/Mailing/bin/Debug/netcoreapp3.1/Mailing.deps.json @@ -0,0 +1,213 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v3.1", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v3.1": { + "Mailing/1.0.0": { + "dependencies": { + "DataClients": "1.0.0", + "MigraDoc.DocumentObjectModel": "3.0.0", + "MigraDoc.Rendering": "3.0.0", + "PdfSharp": "3.0.0", + "SharpZipLib": "1.2.0" + }, + "runtime": { + "Mailing.dll": {} + } + }, + "Microsoft.NETCore.Platforms/3.1.1": {}, + "Microsoft.Win32.SystemEvents/4.5.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "3.1.1" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Win32.SystemEvents.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "SharpZipLib/1.2.0": { + "runtime": { + "lib/netstandard2.0/ICSharpCode.SharpZipLib.dll": { + "assemblyVersion": "1.2.0.246", + "fileVersion": "1.2.0.246" + } + } + }, + "System.Drawing.Common/4.5.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "3.1.1", + "Microsoft.Win32.SystemEvents": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/System.Drawing.Common.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + } + }, + "runtimeTargets": { + "runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll": { + "rid": "unix", + "assetType": "runtime", + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + }, + "runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Text.Encoding.CodePages/4.7.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "3.1.1" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encoding.CodePages.dll": { + "assemblyVersion": "4.1.3.0", + "fileVersion": "4.700.20.21406" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "4.1.3.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "DataClients/1.0.0": { + "dependencies": { + "SharpZipLib": "1.2.0", + "System.Text.Encoding.CodePages": "4.7.1" + }, + "runtime": { + "DataClients.dll": {} + } + }, + "MigraDoc.DocumentObjectModel/3.0.0": { + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "MigraDoc.DocumentObjectModel.dll": {} + } + }, + "MigraDoc.Rendering/3.0.0": { + "dependencies": { + "MigraDoc.DocumentObjectModel": "3.0.0", + "PdfSharp": "3.0.0", + "PdfSharp.Charting": "3.0.0", + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "MigraDoc.Rendering.dll": {} + }, + "resources": { + "de/MigraDoc.Rendering.resources.dll": { + "locale": "de" + } + } + }, + "PdfSharp/3.0.0": { + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "PdfSharp.dll": {} + } + }, + "PdfSharp.Charting/3.0.0": { + "dependencies": { + "PdfSharp": "3.0.0", + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "PdfSharp.Charting.dll": {} + } + } + } + }, + "libraries": { + "Mailing/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.NETCore.Platforms/3.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RmINcaqiEkawM9C8oxFMN/CZmn1fGKWVsosbSY/8ARUNdHqV47hqhPVbrG3qUqLaRQI5w4HuqFOqrbhoSWcH6w==", + "path": "microsoft.netcore.platforms/3.1.1", + "hashPath": "microsoft.netcore.platforms.3.1.1.nupkg.sha512" + }, + "Microsoft.Win32.SystemEvents/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LuI1oG+24TUj1ZRQQjM5Ew73BKnZE5NZ/7eAdh1o8ST5dPhUnJvIkiIn2re3MwnkRy6ELRnvEbBxHP8uALKhJw==", + "path": "microsoft.win32.systemevents/4.5.0", + "hashPath": "microsoft.win32.systemevents.4.5.0.nupkg.sha512" + }, + "SharpZipLib/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zvWa/L02JHNatdtjya6Swpudb2YEHaOLHL1eRrqpjm71iGRNUNONO5adUF/9CHbSJbzhELW1UoH4NGy7n7+3bQ==", + "path": "sharpziplib/1.2.0", + "hashPath": "sharpziplib.1.2.0.nupkg.sha512" + }, + "System.Drawing.Common/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AiJFxxVPdeITstiRS5aAu8+8Dpf5NawTMoapZ53Gfirml24p7HIfhjmCRxdXnmmf3IUA3AX3CcW7G73CjWxW/Q==", + "path": "system.drawing.common/4.5.0", + "hashPath": "system.drawing.common.4.5.0.nupkg.sha512" + }, + "System.Text.Encoding.CodePages/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i2fOvznVVgOOTLUz8FgSap/MsR98I4Iaoz99VXcOW/e7Y2OdY42zhYpBYpZyivk5alYY/UsOWAVswhtjxceodA==", + "path": "system.text.encoding.codepages/4.7.1", + "hashPath": "system.text.encoding.codepages.4.7.1.nupkg.sha512" + }, + "DataClients/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "MigraDoc.DocumentObjectModel/3.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "MigraDoc.Rendering/3.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "PdfSharp/3.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "PdfSharp.Charting/3.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Mailing/bin/Debug/netcoreapp3.1/Mailing.dll b/Mailing/bin/Debug/netcoreapp3.1/Mailing.dll new file mode 100644 index 0000000..d232fb0 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/Mailing.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/Mailing.exe b/Mailing/bin/Debug/netcoreapp3.1/Mailing.exe new file mode 100644 index 0000000..c22b907 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/Mailing.exe differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/Mailing.pdb b/Mailing/bin/Debug/netcoreapp3.1/Mailing.pdb new file mode 100644 index 0000000..4c29921 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/Mailing.pdb differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/Mailing.runtimeconfig.dev.json b/Mailing/bin/Debug/netcoreapp3.1/Mailing.runtimeconfig.dev.json new file mode 100644 index 0000000..7b6758a --- /dev/null +++ b/Mailing/bin/Debug/netcoreapp3.1/Mailing.runtimeconfig.dev.json @@ -0,0 +1,10 @@ +{ + "runtimeOptions": { + "additionalProbingPaths": [ + "C:\\Users\\google\\.dotnet\\store\\|arch|\\|tfm|", + "C:\\Users\\google\\.nuget\\packages", + "C:\\Microsoft\\Xamarin\\NuGet", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ] + } +} \ No newline at end of file diff --git a/Mailing/bin/Debug/netcoreapp3.1/Mailing.runtimeconfig.json b/Mailing/bin/Debug/netcoreapp3.1/Mailing.runtimeconfig.json new file mode 100644 index 0000000..bc456d7 --- /dev/null +++ b/Mailing/bin/Debug/netcoreapp3.1/Mailing.runtimeconfig.json @@ -0,0 +1,9 @@ +{ + "runtimeOptions": { + "tfm": "netcoreapp3.1", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "3.1.0" + } + } +} \ No newline at end of file diff --git a/Mailing/bin/Debug/netcoreapp3.1/Microsoft.Win32.SystemEvents.dll b/Mailing/bin/Debug/netcoreapp3.1/Microsoft.Win32.SystemEvents.dll new file mode 100644 index 0000000..d271945 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/Microsoft.Win32.SystemEvents.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/MigraDoc.DocumentObjectModel.dll b/Mailing/bin/Debug/netcoreapp3.1/MigraDoc.DocumentObjectModel.dll new file mode 100644 index 0000000..5ed2823 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/MigraDoc.DocumentObjectModel.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/MigraDoc.DocumentObjectModel.pdb b/Mailing/bin/Debug/netcoreapp3.1/MigraDoc.DocumentObjectModel.pdb new file mode 100644 index 0000000..e9915bc Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/MigraDoc.DocumentObjectModel.pdb differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/MigraDoc.Rendering.dll b/Mailing/bin/Debug/netcoreapp3.1/MigraDoc.Rendering.dll new file mode 100644 index 0000000..48c51a1 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/MigraDoc.Rendering.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/MigraDoc.Rendering.pdb b/Mailing/bin/Debug/netcoreapp3.1/MigraDoc.Rendering.pdb new file mode 100644 index 0000000..9d9973e Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/MigraDoc.Rendering.pdb differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/PdfSharp.Charting.dll b/Mailing/bin/Debug/netcoreapp3.1/PdfSharp.Charting.dll new file mode 100644 index 0000000..af1412c Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/PdfSharp.Charting.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/PdfSharp.Charting.pdb b/Mailing/bin/Debug/netcoreapp3.1/PdfSharp.Charting.pdb new file mode 100644 index 0000000..f6365b7 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/PdfSharp.Charting.pdb differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/PdfSharp.dll b/Mailing/bin/Debug/netcoreapp3.1/PdfSharp.dll new file mode 100644 index 0000000..4050264 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/PdfSharp.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/PdfSharp.pdb b/Mailing/bin/Debug/netcoreapp3.1/PdfSharp.pdb new file mode 100644 index 0000000..f3c0d1d Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/PdfSharp.pdb differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/STPClient.dll b/Mailing/bin/Debug/netcoreapp3.1/STPClient.dll new file mode 100644 index 0000000..d7d2bbd Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/STPClient.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/STPClient.pdb b/Mailing/bin/Debug/netcoreapp3.1/STPClient.pdb new file mode 100644 index 0000000..bf53ed2 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/STPClient.pdb differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/System.Drawing.Common.dll b/Mailing/bin/Debug/netcoreapp3.1/System.Drawing.Common.dll new file mode 100644 index 0000000..3011aaf Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/System.Drawing.Common.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/System.Text.Encoding.CodePages.dll b/Mailing/bin/Debug/netcoreapp3.1/System.Text.Encoding.CodePages.dll new file mode 100644 index 0000000..2f0a76d Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/System.Text.Encoding.CodePages.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/de/MigraDoc.Rendering.resources.dll b/Mailing/bin/Debug/netcoreapp3.1/de/MigraDoc.Rendering.resources.dll new file mode 100644 index 0000000..08b0229 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/de/MigraDoc.Rendering.resources.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/mailing_SZO.list b/Mailing/bin/Debug/netcoreapp3.1/mailing_SZO.list new file mode 100644 index 0000000..002aaae --- /dev/null +++ b/Mailing/bin/Debug/netcoreapp3.1/mailing_SZO.list @@ -0,0 +1,3 @@ +hatuncev_gd@vsmpo.ru +usov@vsmpo.ru +chervyakov_ds@it.ivc.vsmpo.ru diff --git a/Mailing/bin/Debug/netcoreapp3.1/runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll b/Mailing/bin/Debug/netcoreapp3.1/runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll new file mode 100644 index 0000000..311c7f3 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll b/Mailing/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll new file mode 100644 index 0000000..bb47b68 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll b/Mailing/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll new file mode 100644 index 0000000..dcf5a77 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll b/Mailing/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll new file mode 100644 index 0000000..5b0542c Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/times.ttf b/Mailing/bin/Debug/netcoreapp3.1/times.ttf new file mode 100644 index 0000000..f71d84a Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/times.ttf differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/timesbd.ttf b/Mailing/bin/Debug/netcoreapp3.1/timesbd.ttf new file mode 100644 index 0000000..43259eb Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/timesbd.ttf differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/timesbi.ttf b/Mailing/bin/Debug/netcoreapp3.1/timesbi.ttf new file mode 100644 index 0000000..c0b27d2 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/timesbi.ttf differ diff --git a/Mailing/bin/Debug/netcoreapp3.1/timesi.ttf b/Mailing/bin/Debug/netcoreapp3.1/timesi.ttf new file mode 100644 index 0000000..4bcad69 Binary files /dev/null and b/Mailing/bin/Debug/netcoreapp3.1/timesi.ttf differ diff --git a/Mailing/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs b/Mailing/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs new file mode 100644 index 0000000..ad8dfe1 --- /dev/null +++ b/Mailing/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")] diff --git a/Mailing/obj/Debug/netcoreapp3.1/Mailing.AssemblyInfo.cs b/Mailing/obj/Debug/netcoreapp3.1/Mailing.AssemblyInfo.cs new file mode 100644 index 0000000..5230e1a --- /dev/null +++ b/Mailing/obj/Debug/netcoreapp3.1/Mailing.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Mailing")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("Mailing")] +[assembly: System.Reflection.AssemblyTitleAttribute("Mailing")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Создано классом WriteCodeFragment MSBuild. + diff --git a/Mailing/obj/Debug/netcoreapp3.1/Mailing.AssemblyInfoInputs.cache b/Mailing/obj/Debug/netcoreapp3.1/Mailing.AssemblyInfoInputs.cache new file mode 100644 index 0000000..f3e709f --- /dev/null +++ b/Mailing/obj/Debug/netcoreapp3.1/Mailing.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +da822a2b7e37e50e0046e7261fe40de2f5b3ef2f diff --git a/Mailing/obj/Debug/netcoreapp3.1/Mailing.assets.cache b/Mailing/obj/Debug/netcoreapp3.1/Mailing.assets.cache new file mode 100644 index 0000000..24627e4 Binary files /dev/null and b/Mailing/obj/Debug/netcoreapp3.1/Mailing.assets.cache differ diff --git a/Mailing/obj/Debug/netcoreapp3.1/Mailing.csproj.CopyComplete b/Mailing/obj/Debug/netcoreapp3.1/Mailing.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/Mailing/obj/Debug/netcoreapp3.1/Mailing.csproj.CoreCompileInputs.cache b/Mailing/obj/Debug/netcoreapp3.1/Mailing.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..d7bfdfc --- /dev/null +++ b/Mailing/obj/Debug/netcoreapp3.1/Mailing.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +ab8cb3630227757ea2e8c0fc8b7e12edbab2074e diff --git a/Mailing/obj/Debug/netcoreapp3.1/Mailing.csproj.FileListAbsolute.txt b/Mailing/obj/Debug/netcoreapp3.1/Mailing.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..5e0db80 --- /dev/null +++ b/Mailing/obj/Debug/netcoreapp3.1/Mailing.csproj.FileListAbsolute.txt @@ -0,0 +1,50 @@ +D:\Projects\Mailing\bin\Debug\netcoreapp3.1\Mailing.exe +D:\Projects\Mailing\obj\Debug\netcoreapp3.1\Mailing.csprojAssemblyReference.cache +D:\Projects\Mailing\obj\Debug\netcoreapp3.1\Mailing.AssemblyInfoInputs.cache +D:\Projects\Mailing\obj\Debug\netcoreapp3.1\Mailing.AssemblyInfo.cs +D:\Projects\Mailing\bin\Debug\netcoreapp3.1\Mailing.deps.json +D:\Projects\Mailing\bin\Debug\netcoreapp3.1\Mailing.runtimeconfig.json +D:\Projects\Mailing\bin\Debug\netcoreapp3.1\Mailing.runtimeconfig.dev.json +D:\Projects\Mailing\bin\Debug\netcoreapp3.1\Mailing.dll +D:\Projects\Mailing\bin\Debug\netcoreapp3.1\Mailing.pdb +D:\Projects\Mailing\bin\Debug\netcoreapp3.1\ICSharpCode.SharpZipLib.dll +D:\Projects\Mailing\bin\Debug\netcoreapp3.1\STPClient.dll +D:\Projects\Mailing\bin\Debug\netcoreapp3.1\STPClient.pdb +D:\Projects\Mailing\obj\Debug\netcoreapp3.1\Mailing.csproj.CoreCompileInputs.cache +D:\Projects\Mailing\obj\Debug\netcoreapp3.1\Mailing.csproj.CopyComplete +D:\Projects\Mailing\obj\Debug\netcoreapp3.1\Mailing.dll +D:\Projects\Mailing\obj\Debug\netcoreapp3.1\Mailing.pdb +D:\Projects\Mailing\obj\Debug\netcoreapp3.1\Mailing.genruntimeconfig.cache +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\Mailing.exe +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\Mailing.deps.json +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\Mailing.runtimeconfig.json +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\Mailing.runtimeconfig.dev.json +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\Mailing.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\Mailing.pdb +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\ICSharpCode.SharpZipLib.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\System.Text.Encoding.CodePages.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.0\System.Text.Encoding.CodePages.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\DataClients.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\DataClients.pdb +F:\Projects1\Mailing\obj\Debug\netcoreapp3.1\Mailing.csprojAssemblyReference.cache +F:\Projects1\Mailing\obj\Debug\netcoreapp3.1\Mailing.AssemblyInfoInputs.cache +F:\Projects1\Mailing\obj\Debug\netcoreapp3.1\Mailing.AssemblyInfo.cs +F:\Projects1\Mailing\obj\Debug\netcoreapp3.1\Mailing.csproj.CopyComplete +F:\Projects1\Mailing\obj\Debug\netcoreapp3.1\Mailing.dll +F:\Projects1\Mailing\obj\Debug\netcoreapp3.1\Mailing.pdb +F:\Projects1\Mailing\obj\Debug\netcoreapp3.1\Mailing.genruntimeconfig.cache +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\Microsoft.Win32.SystemEvents.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\System.Drawing.Common.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.0\Microsoft.Win32.SystemEvents.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\runtimes\unix\lib\netcoreapp2.0\System.Drawing.Common.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.0\System.Drawing.Common.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\MigraDoc.DocumentObjectModel.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\MigraDoc.Rendering.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\PdfSharp.Charting.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\PdfSharp.dll +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\MigraDoc.DocumentObjectModel.pdb +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\MigraDoc.Rendering.pdb +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\PdfSharp.pdb +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\PdfSharp.Charting.pdb +F:\Projects1\Mailing\bin\Debug\netcoreapp3.1\de\MigraDoc.Rendering.resources.dll +F:\Projects1\Mailing\obj\Debug\netcoreapp3.1\Mailing.csproj.CoreCompileInputs.cache diff --git a/Mailing/obj/Debug/netcoreapp3.1/Mailing.csprojAssemblyReference.cache b/Mailing/obj/Debug/netcoreapp3.1/Mailing.csprojAssemblyReference.cache new file mode 100644 index 0000000..770a717 Binary files /dev/null and b/Mailing/obj/Debug/netcoreapp3.1/Mailing.csprojAssemblyReference.cache differ diff --git a/Mailing/obj/Debug/netcoreapp3.1/Mailing.dll b/Mailing/obj/Debug/netcoreapp3.1/Mailing.dll new file mode 100644 index 0000000..d232fb0 Binary files /dev/null and b/Mailing/obj/Debug/netcoreapp3.1/Mailing.dll differ diff --git a/Mailing/obj/Debug/netcoreapp3.1/Mailing.exe b/Mailing/obj/Debug/netcoreapp3.1/Mailing.exe new file mode 100644 index 0000000..c22b907 Binary files /dev/null and b/Mailing/obj/Debug/netcoreapp3.1/Mailing.exe differ diff --git a/Mailing/obj/Debug/netcoreapp3.1/Mailing.genruntimeconfig.cache b/Mailing/obj/Debug/netcoreapp3.1/Mailing.genruntimeconfig.cache new file mode 100644 index 0000000..34bedab --- /dev/null +++ b/Mailing/obj/Debug/netcoreapp3.1/Mailing.genruntimeconfig.cache @@ -0,0 +1 @@ +86c8e15dd33445635927cfaf398408205fd11473 diff --git a/Mailing/obj/Debug/netcoreapp3.1/Mailing.pdb b/Mailing/obj/Debug/netcoreapp3.1/Mailing.pdb new file mode 100644 index 0000000..4c29921 Binary files /dev/null and b/Mailing/obj/Debug/netcoreapp3.1/Mailing.pdb differ diff --git a/Mailing/obj/Mailing.csproj.nuget.dgspec.json b/Mailing/obj/Mailing.csproj.nuget.dgspec.json new file mode 100644 index 0000000..521d1e5 --- /dev/null +++ b/Mailing/obj/Mailing.csproj.nuget.dgspec.json @@ -0,0 +1,422 @@ +{ + "format": 1, + "restore": { + "F:\\Projects1\\Mailing\\Mailing.csproj": {} + }, + "projects": { + "F:\\Projects1\\DataClients\\DataClients.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\DataClients\\DataClients.csproj", + "projectName": "DataClients", + "projectPath": "F:\\Projects1\\DataClients\\DataClients.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\DataClients\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "SharpZipLib": { + "target": "Package", + "version": "[1.2.0, )" + }, + "System.Text.Encoding.CodePages": { + "target": "Package", + "version": "[4.7.1, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\Mailing\\Mailing.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\Mailing\\Mailing.csproj", + "projectName": "Mailing", + "projectPath": "F:\\Projects1\\Mailing\\Mailing.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\Mailing\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": { + "F:\\Projects1\\DataClients\\DataClients.csproj": { + "projectPath": "F:\\Projects1\\DataClients\\DataClients.csproj" + }, + "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj": { + "projectPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj" + }, + "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj": { + "projectPath": "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj" + }, + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "dependencies": { + "SharpZipLib": { + "target": "Package", + "version": "[1.2.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj", + "projectName": "MigraDoc.DocumentObjectModel", + "projectPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj", + "projectName": "MigraDoc.Rendering", + "projectPath": "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\MigraDoc.Rendering\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": { + "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj": { + "projectPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj" + }, + "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj" + }, + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj", + "projectName": "PdfSharp.Charting", + "projectPath": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\PdfSharp.Charting\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": { + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj", + "projectName": "PdfSharp", + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\PdfSharp\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/Mailing/obj/Mailing.csproj.nuget.g.props b/Mailing/obj/Mailing.csproj.nuget.g.props new file mode 100644 index 0000000..1771934 --- /dev/null +++ b/Mailing/obj/Mailing.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\google\.nuget\packages\;C:\Microsoft\Xamarin\NuGet\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder + PackageReference + 5.6.0 + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/Mailing/obj/Mailing.csproj.nuget.g.targets b/Mailing/obj/Mailing.csproj.nuget.g.targets new file mode 100644 index 0000000..53cfaa1 --- /dev/null +++ b/Mailing/obj/Mailing.csproj.nuget.g.targets @@ -0,0 +1,6 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/Mailing/obj/project.assets.json b/Mailing/obj/project.assets.json new file mode 100644 index 0000000..43b3e5e --- /dev/null +++ b/Mailing/obj/project.assets.json @@ -0,0 +1,400 @@ +{ + "version": 3, + "targets": { + ".NETCoreApp,Version=v3.1": { + "Microsoft.NETCore.Platforms/3.1.1": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.Win32.SystemEvents/4.5.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "2.0.0" + }, + "compile": { + "ref/netstandard2.0/_._": {} + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Win32.SystemEvents.dll": {} + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "SharpZipLib/1.2.0": { + "type": "package", + "compile": { + "lib/netstandard2.0/ICSharpCode.SharpZipLib.dll": {} + }, + "runtime": { + "lib/netstandard2.0/ICSharpCode.SharpZipLib.dll": {} + } + }, + "System.Drawing.Common/4.5.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "2.0.0", + "Microsoft.Win32.SystemEvents": "4.5.0" + }, + "compile": { + "ref/netstandard2.0/System.Drawing.Common.dll": {} + }, + "runtime": { + "lib/netstandard2.0/System.Drawing.Common.dll": {} + }, + "runtimeTargets": { + "runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll": { + "assetType": "runtime", + "rid": "unix" + }, + "runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Text.Encoding.CodePages/4.7.1": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "3.1.1" + }, + "compile": { + "lib/netstandard2.0/System.Text.Encoding.CodePages.dll": {} + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encoding.CodePages.dll": {} + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "DataClients/1.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "SharpZipLib": "1.2.0", + "System.Text.Encoding.CodePages": "4.7.1" + }, + "compile": { + "bin/placeholder/DataClients.dll": {} + }, + "runtime": { + "bin/placeholder/DataClients.dll": {} + } + }, + "MigraDoc.DocumentObjectModel/3.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "compile": { + "bin/placeholder/MigraDoc.DocumentObjectModel.dll": {} + }, + "runtime": { + "bin/placeholder/MigraDoc.DocumentObjectModel.dll": {} + } + }, + "MigraDoc.Rendering/3.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "MigraDoc.DocumentObjectModel": "3.0.0", + "PdfSharp": "3.0.0", + "PdfSharp.Charting": "3.0.0", + "System.Drawing.Common": "4.5.0" + }, + "compile": { + "bin/placeholder/MigraDoc.Rendering.dll": {} + }, + "runtime": { + "bin/placeholder/MigraDoc.Rendering.dll": {} + } + }, + "PdfSharp/3.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "compile": { + "bin/placeholder/PdfSharp.dll": {} + }, + "runtime": { + "bin/placeholder/PdfSharp.dll": {} + } + }, + "PdfSharp.Charting/3.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "PdfSharp": "3.0.0", + "System.Drawing.Common": "4.5.0" + }, + "compile": { + "bin/placeholder/PdfSharp.Charting.dll": {} + }, + "runtime": { + "bin/placeholder/PdfSharp.Charting.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.NETCore.Platforms/3.1.1": { + "sha512": "RmINcaqiEkawM9C8oxFMN/CZmn1fGKWVsosbSY/8ARUNdHqV47hqhPVbrG3qUqLaRQI5w4HuqFOqrbhoSWcH6w==", + "type": "package", + "path": "microsoft.netcore.platforms/3.1.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.3.1.1.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "Microsoft.Win32.SystemEvents/4.5.0": { + "sha512": "LuI1oG+24TUj1ZRQQjM5Ew73BKnZE5NZ/7eAdh1o8ST5dPhUnJvIkiIn2re3MwnkRy6ELRnvEbBxHP8uALKhJw==", + "type": "package", + "path": "microsoft.win32.systemevents/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/Microsoft.Win32.SystemEvents.dll", + "lib/netstandard2.0/Microsoft.Win32.SystemEvents.dll", + "microsoft.win32.systemevents.4.5.0.nupkg.sha512", + "microsoft.win32.systemevents.nuspec", + "ref/net461/Microsoft.Win32.SystemEvents.dll", + "ref/netstandard2.0/Microsoft.Win32.SystemEvents.dll", + "runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "SharpZipLib/1.2.0": { + "sha512": "zvWa/L02JHNatdtjya6Swpudb2YEHaOLHL1eRrqpjm71iGRNUNONO5adUF/9CHbSJbzhELW1UoH4NGy7n7+3bQ==", + "type": "package", + "path": "sharpziplib/1.2.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net45/ICSharpCode.SharpZipLib.dll", + "lib/net45/ICSharpCode.SharpZipLib.pdb", + "lib/net45/ICSharpCode.SharpZipLib.xml", + "lib/netstandard2.0/ICSharpCode.SharpZipLib.dll", + "lib/netstandard2.0/ICSharpCode.SharpZipLib.pdb", + "lib/netstandard2.0/ICSharpCode.SharpZipLib.xml", + "sharpziplib.1.2.0.nupkg.sha512", + "sharpziplib.nuspec" + ] + }, + "System.Drawing.Common/4.5.0": { + "sha512": "AiJFxxVPdeITstiRS5aAu8+8Dpf5NawTMoapZ53Gfirml24p7HIfhjmCRxdXnmmf3IUA3AX3CcW7G73CjWxW/Q==", + "type": "package", + "path": "system.drawing.common/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net461/System.Drawing.Common.dll", + "lib/netstandard2.0/System.Drawing.Common.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net461/System.Drawing.Common.dll", + "ref/netstandard2.0/System.Drawing.Common.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll", + "runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll", + "system.drawing.common.4.5.0.nupkg.sha512", + "system.drawing.common.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Text.Encoding.CodePages/4.7.1": { + "sha512": "i2fOvznVVgOOTLUz8FgSap/MsR98I4Iaoz99VXcOW/e7Y2OdY42zhYpBYpZyivk5alYY/UsOWAVswhtjxceodA==", + "type": "package", + "path": "system.text.encoding.codepages/4.7.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Text.Encoding.CodePages.dll", + "lib/net461/System.Text.Encoding.CodePages.dll", + "lib/net461/System.Text.Encoding.CodePages.xml", + "lib/netstandard1.3/System.Text.Encoding.CodePages.dll", + "lib/netstandard2.0/System.Text.Encoding.CodePages.dll", + "lib/netstandard2.0/System.Text.Encoding.CodePages.xml", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/win/lib/net461/System.Text.Encoding.CodePages.dll", + "runtimes/win/lib/net461/System.Text.Encoding.CodePages.xml", + "runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll", + "runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.xml", + "runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll", + "runtimes/win/lib/netstandard2.0/System.Text.Encoding.CodePages.dll", + "runtimes/win/lib/netstandard2.0/System.Text.Encoding.CodePages.xml", + "system.text.encoding.codepages.4.7.1.nupkg.sha512", + "system.text.encoding.codepages.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "DataClients/1.0.0": { + "type": "project", + "path": "../DataClients/DataClients.csproj", + "msbuildProject": "../DataClients/DataClients.csproj" + }, + "MigraDoc.DocumentObjectModel/3.0.0": { + "type": "project", + "path": "../MigraDoc.DocumentObjectModel/MigraDoc.DocumentObjectModel.csproj", + "msbuildProject": "../MigraDoc.DocumentObjectModel/MigraDoc.DocumentObjectModel.csproj" + }, + "MigraDoc.Rendering/3.0.0": { + "type": "project", + "path": "../MigraDoc.Rendering/MigraDoc.Rendering.csproj", + "msbuildProject": "../MigraDoc.Rendering/MigraDoc.Rendering.csproj" + }, + "PdfSharp/3.0.0": { + "type": "project", + "path": "../PdfSharp/PdfSharp.csproj", + "msbuildProject": "../PdfSharp/PdfSharp.csproj" + }, + "PdfSharp.Charting/3.0.0": { + "type": "project", + "path": "../PdfSharp.Charting/PdfSharp.Charting.csproj", + "msbuildProject": "../PdfSharp.Charting/PdfSharp.Charting.csproj" + } + }, + "projectFileDependencyGroups": { + ".NETCoreApp,Version=v3.1": [ + "DataClients >= 1.0.0", + "MigraDoc.DocumentObjectModel >= 3.0.0", + "MigraDoc.Rendering >= 3.0.0", + "PdfSharp >= 3.0.0", + "SharpZipLib >= 1.2.0" + ] + }, + "packageFolders": { + "C:\\Users\\google\\.nuget\\packages\\": {}, + "C:\\Microsoft\\Xamarin\\NuGet\\": {}, + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\Mailing\\Mailing.csproj", + "projectName": "Mailing", + "projectPath": "F:\\Projects1\\Mailing\\Mailing.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\Mailing\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": { + "F:\\Projects1\\DataClients\\DataClients.csproj": { + "projectPath": "F:\\Projects1\\DataClients\\DataClients.csproj" + }, + "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj": { + "projectPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj" + }, + "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj": { + "projectPath": "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj" + }, + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "dependencies": { + "SharpZipLib": { + "target": "Package", + "version": "[1.2.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/Mailing/obj/project.nuget.cache b/Mailing/obj/project.nuget.cache new file mode 100644 index 0000000..27d9382 --- /dev/null +++ b/Mailing/obj/project.nuget.cache @@ -0,0 +1,14 @@ +{ + "version": 2, + "dgSpecHash": "mYZ0+lgFNvjdtstd498fzqCueb79WJUPV7cKbZiNr7U5DOvhqaxanZo4lE1YNRKjI9hSd7/W0qrifHxA/A4ftg==", + "success": true, + "projectFilePath": "F:\\Projects1\\Mailing\\Mailing.csproj", + "expectedPackageFiles": [ + "C:\\Users\\google\\.nuget\\packages\\microsoft.netcore.platforms\\3.1.1\\microsoft.netcore.platforms.3.1.1.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\microsoft.win32.systemevents\\4.5.0\\microsoft.win32.systemevents.4.5.0.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\sharpziplib\\1.2.0\\sharpziplib.1.2.0.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\system.drawing.common\\4.5.0\\system.drawing.common.4.5.0.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\system.text.encoding.codepages\\4.7.1\\system.text.encoding.codepages.4.7.1.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/Mailing/times.ttf b/Mailing/times.ttf new file mode 100644 index 0000000..f71d84a Binary files /dev/null and b/Mailing/times.ttf differ diff --git a/Mailing/timesbd.ttf b/Mailing/timesbd.ttf new file mode 100644 index 0000000..43259eb Binary files /dev/null and b/Mailing/timesbd.ttf differ diff --git a/Mailing/timesbi.ttf b/Mailing/timesbi.ttf new file mode 100644 index 0000000..c0b27d2 Binary files /dev/null and b/Mailing/timesbi.ttf differ diff --git a/Mailing/timesi.ttf b/Mailing/timesi.ttf new file mode 100644 index 0000000..4bcad69 Binary files /dev/null and b/Mailing/timesi.ttf differ diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/BookmarkField.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/BookmarkField.cs new file mode 100644 index 0000000..f8aa25a --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/BookmarkField.cs @@ -0,0 +1,117 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Fields +{ + /// + /// BookmarkField is used as target for Hyperlinks or PageRefs. + /// + public class BookmarkField : DocumentObject + { + /// + /// Initializes a new instance of the BookmarkField class. + /// + public BookmarkField() + { } + + /// + /// Initializes a new instance of the BookmarkField class with the specified parent. + /// + public BookmarkField(DocumentObject parent) : base(parent) { } + + /// + /// Initializes a new instance of the BookmarkField class with the necessary bookmark name. + /// + public BookmarkField(string name) + : this() + { + Name = name; + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new BookmarkField Clone() + { + return (BookmarkField)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets the name of the bookmark. + /// Used to reference the bookmark from a Hyperlink or PageRef. + /// + public string Name + { + get { return _name.Value; } + set { _name.Value = value; } + } + [DV] + public NString _name = NString.NullValue; + #endregion + + #region public + /// + /// Converts BookmarkField into DDL. + /// + public override void Serialize(Serializer serializer) + { + if (_name.Value == string.Empty) + throw new InvalidOperationException(DomSR.MissingObligatoryProperty("Name", "BookmarkField")); + + serializer.Write("\\field(Bookmark)[Name = \"" + Name.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\"]"); + } + + /// + /// Determines whether this instance is null (not set). + /// + public override bool IsNull() + { + return false; + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(BookmarkField))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/DateField.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/DateField.cs new file mode 100644 index 0000000..bed0ccc --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/DateField.cs @@ -0,0 +1,109 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Fields +{ + /// + /// DateField is used to reference the date and time the printing starts. + /// + public class DateField : DocumentObject + { + /// + /// Initializes a new instance of the DateField class. + /// + public DateField() + { } + + /// + /// Initializes a new instance of the DateField class with the specified parent. + /// + public DateField(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new DateField Clone() + { + return (DateField)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets the format of the date. + /// + public string Format + { + get { return _format.Value; } + set { _format.Value = value; } + } + [DV] + public NString _format = NString.NullValue; + #endregion + + #region public + /// + /// Converts DateField into DDL. + /// + public override void Serialize(Serializer serializer) + { + string str = "\\field(Date)"; + if (_format.Value != string.Empty) + str += "[Format = \"" + Format + "\"]"; + else + str += "[]"; //Has to be appended to avoid confusion with '[' in immediatly following text. + + serializer.Write(str); + } + + /// + /// Determines whether this instance is null (not set). + /// + public override bool IsNull() + { + return false; + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(DateField))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/InfoField.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/InfoField.cs new file mode 100644 index 0000000..d9ffba1 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/InfoField.cs @@ -0,0 +1,145 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Fields +{ + /// + /// InfoField is used to reference one of the DocumentInfo fields in the document. + /// + public class InfoField : DocumentObject + { + /// + /// Initializes a new instance of the InfoField class. + /// + public InfoField() + { } + + /// + /// Initializes a new instance of the InfoField class with the specified parent. + /// + public InfoField(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new InfoField Clone() + { + return (InfoField)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets the name of the information to be shown in the field. + /// + public string Name + { + get { return _name.Value; } + set + { + if (IsValidName(value)) + _name.Value = value; + else + throw new ArgumentException(DomSR.InvalidInfoFieldName(value)); + } + } + [DV] + public NString _name = NString.NullValue; + #endregion + + /// + /// Determines whether the name is a valid InfoFieldType. + /// + private bool IsValidName(string name) + { + // Check using a way that never throws an exception +#if SILVERLIGHT + if (validNames == null) + { + validNames = new string[4]; + validNames[0] = "Title"; + validNames[1] = "Author"; + validNames[2] = "Keywords"; + validNames[3] = "Subject"; + } +#endif + + foreach (string validName in validNames) + { + if (String.Compare(validName, name, StringComparison.OrdinalIgnoreCase) == 0) + return true; + } + return false; + } + +#if SILVERLIGHT + private static string[] validNames; +#else + private static string[] validNames = Enum.GetNames(typeof(InfoFieldType)); +#endif + + /// + /// Determines whether this instance is null (not set). + /// + public override bool IsNull() + { + return false; + } + #region public + /// + /// Converts InfoField into DDL. + /// + public override void Serialize(Serializer serializer) + { + string str = "\\field(Info)"; + if (Name == "") + throw new InvalidOperationException(DomSR.MissingObligatoryProperty("Name", "InfoField")); + str += "[Name = \"" + Name + "\"]"; + + serializer.Write(str); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(InfoField))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/NumPagesField.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/NumPagesField.cs new file mode 100644 index 0000000..68d9626 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/NumPagesField.cs @@ -0,0 +1,89 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Fields +{ + /// + /// NumPagesField is used to reference the number of all pages in the document. + /// + public class NumPagesField : NumericFieldBase + { + /// + /// Initializes a new instance of the NumPagesField class. + /// + public NumPagesField() + { } + + /// + /// Initializes a new instance of the NumPagesField class with the specified parent. + /// + public NumPagesField(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new NumPagesField Clone() + { + return (NumPagesField)DeepCopy(); + } + #endregion + + #region public + /// + /// Converts NumPagesField into DDL. + /// + public override void Serialize(Serializer serializer) + { + string str = "\\field(NumPages)"; + + if (_format.Value != "") + str += "[Format = \"" + Format + "\"]"; + else + str += "[]"; // Has to be appended to avoid confusion with '[' in directly following text. + + serializer.Write(str); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(NumPagesField))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/NumericFieldBase.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/NumericFieldBase.cs new file mode 100644 index 0000000..c68c451 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/NumericFieldBase.cs @@ -0,0 +1,126 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Fields +{ + /// + /// NumericFieldBase serves as a base for Numeric fields, which are: + /// NumPagesField, PageField, PageRefField, SectionField, SectionPagesField + /// + public abstract class NumericFieldBase : DocumentObject + { + /// + /// The valid format strings for the supported numeric types. + /// + protected static string[] ValidFormatStrings = + { + "", + "ROMAN", + "roman", + "ALPHABETIC", + "alphabetic" + }; + + /// + /// Initializes a new instance of the NumericFieldBase class. + /// + public NumericFieldBase() + { } + + /// + /// Initializes a new instance of the NumericFieldBase class with the specified parent. + /// + public NumericFieldBase(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new NumericFieldBase Clone() + { + return (NumericFieldBase)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + NumericFieldBase numericFieldBase = (NumericFieldBase)base.DeepCopy(); + return numericFieldBase; + } + #endregion + + #region Properties + /// + /// Gets or sets the format of the number. + /// + public string Format + { + get { return _format.Value; } + set + { + if (IsValidFormat(value)) + _format.Value = value; + else + throw new ArgumentException(DomSR.InvalidFieldFormat(value)); + } + } + [DV] + public NString _format = NString.NullValue; + #endregion + + /// + /// Determines whether the format is valid for numeric fields. + /// + protected bool IsValidFormat(string format) + { + foreach (string name in ValidFormatStrings) + { + if (name == Format) + return true; + } + return false; + } + + /// + /// Determines whether this instance is null (not set). + /// + public override bool IsNull() + { + return false; + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/PageField.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/PageField.cs new file mode 100644 index 0000000..921188a --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/PageField.cs @@ -0,0 +1,89 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Fields +{ + /// + /// PageField is used to reference the number of the current page. + /// + public class PageField : NumericFieldBase + { + /// + /// Initializes a new instance of the PageField class. + /// + public PageField() + { } + + /// + /// Initializes a new instance of the PageField class with the specified parent. + /// + public PageField(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new PageField Clone() + { + return (PageField)DeepCopy(); + } + #endregion + + #region public + /// + /// Converts PageField into DDL. + /// + public override void Serialize(Serializer serializer) + { + string str = "\\field(Page)"; + + if (_format.Value != "") + str += "[Format = \"" + Format + "\"]"; + else + str += "[]"; //Has to be appended to avoid confusion with '[' in immediatly following text. + + serializer.Write(str); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(PageField))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/PageRefField.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/PageRefField.cs new file mode 100644 index 0000000..96bf982 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/PageRefField.cs @@ -0,0 +1,111 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Fields +{ + /// + /// PageRefField is used to reference the page number of a bookmark in the document. + /// + public class PageRefField : NumericFieldBase + { + /// + /// Initializes a new instance of the PageRefField class. + /// + public PageRefField() + { } + + /// + /// Initializes a new instance of the PageRefField class with the necessary bookmark name. + /// + public PageRefField(string name) + : this() + { + Name = name; + } + + /// + /// Initializes a new instance of the PageRefField class with the specified parent. + /// + public PageRefField(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new PageRefField Clone() + { + return (PageRefField)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets the bookmark name whose page is to be shown. + /// + public string Name + { + get { return _name.Value; } + set { _name.Value = value; } + } + [DV] + public NString _name = NString.NullValue; + #endregion + + #region public + /// + /// Converts PageRefField into DDL. + /// + public override void Serialize(Serializer serializer) + { + string str = "\\field(PageRef)"; + str += "[Name = \"" + Name + "\""; + + if (_format.Value != "") + str += " Format = \"" + Format + "\""; + str += "]"; + + serializer.Write(str); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(PageRefField))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/SectionField.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/SectionField.cs new file mode 100644 index 0000000..e0999c4 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/SectionField.cs @@ -0,0 +1,89 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Fields +{ + /// + /// SectionField is used to reference the number of the current section. + /// + public class SectionField : NumericFieldBase + { + /// + /// Initializes a new instance of the SectionField class. + /// + public SectionField() + { } + + /// + /// Initializes a new instance of the SectionField class with the specified parent. + /// + public SectionField(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new SectionField Clone() + { + return (SectionField)DeepCopy(); + } + #endregion + + #region public + /// + /// Converts SectionField into DDL. + /// + public override void Serialize(Serializer serializer) + { + string str = "\\field(Section)"; + + if (_format.Value != "") + str += "[Format = \"" + Format + "\"]"; + else + str += "[]"; //Has to be appended to avoid confusion with '[' in directly following text. + + serializer.Write(str); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(SectionField))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/SectionPagesField.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/SectionPagesField.cs new file mode 100644 index 0000000..75d8e90 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/SectionPagesField.cs @@ -0,0 +1,89 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Fields +{ + /// + /// SectionPagesField is used to reference the number of all pages of the current section. + /// + public class SectionPagesField : NumericFieldBase + { + /// + /// Initializes a new instance of the SectionPagesField class. + /// + public SectionPagesField() + { } + + /// + /// Initializes a new instance of the SectionPagesField class with the specified parent. + /// + public SectionPagesField(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new SectionPagesField Clone() + { + return (SectionPagesField)DeepCopy(); + } + #endregion + + #region public + /// + /// Converts SectionPagesField into DDL. + /// + public override void Serialize(Serializer serializer) + { + string str = "\\field(SectionPages)"; + + if (_format.Value != "") + str += "[Format = \"" + Format + "\"]"; + else + str += "[]"; //Has to be appended to avoid confusion with '[' in directly following text. + + serializer.Write(str); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(SectionPagesField))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/enums/InfoFieldType.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/enums/InfoFieldType.cs new file mode 100644 index 0000000..c301882 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Fields/enums/InfoFieldType.cs @@ -0,0 +1,60 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Fields +{ + /// + /// Specifies the information to be shown in the field. + /// + public enum InfoFieldType + { + /// + /// Specifies the title for the document. + /// + Title, + + /// + /// Specifies the author for the document. + /// + Author, + + /// + /// Specifies the keywords for the document. + /// + Keywords, + + /// + /// Specifies the subject for the document. + /// + Subject + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlParser.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlParser.cs new file mode 100644 index 0000000..e25432b --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlParser.cs @@ -0,0 +1,2722 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Tables; +using MigraDoc.DocumentObjectModel.Shapes; +using MigraDoc.DocumentObjectModel.Shapes.Charts; + +namespace MigraDoc.DocumentObjectModel.IO +{ + /// + /// A simple hand-coded parser for MigraDoc DDL. + /// + public class DdlParser + { + /// + /// Initializes a new instance of the DdlParser class. + /// + public DdlParser(string ddl, DdlReaderErrors errors) + : this(String.Empty, ddl, errors) + { } + + /// + /// Initializes a new instance of the DdlParser class. + /// + public DdlParser(string fileName, string ddl, DdlReaderErrors errors) + { + _errors = errors ?? new DdlReaderErrors(); + _scanner = new DdlScanner(fileName, ddl, errors); + } + + /// + /// Parses the keyword \document. + /// + public Document ParseDocument(Document document) + { + if (document == null) + document = new Document(); + + MoveToCode(); + AssertSymbol(Symbol.Document); + ReadCode(); + if (Symbol == Symbol.BracketLeft) + ParseAttributes(document); + + AssertSymbol(Symbol.BraceLeft); + + // Styles come first + ReadCode(); + if (Symbol == Symbol.Styles) + ParseStyles(document.Styles); + + // A document with no sections is valid and has zero pages. + while (Symbol == Symbol.Section) + ParseSection(document.Sections); + + AssertSymbol(Symbol.BraceRight); + ReadCode(); + AssertCondition(Symbol == Symbol.Eof, DomMsgID.EndOfFileExpected); + + return document; + } + + /// + /// Parses one of the keywords \document, \styles, \section, \table, \textframe, \chart + /// and \paragraph and returns the corresponding DocumentObject or DocumentObjectCollection. + /// + public DocumentObject ParseDocumentObject() + { + DocumentObject obj = null; + + MoveToCode(); + switch (Symbol) + { + case Symbol.Document: + obj = ParseDocument(null); + break; + + case Symbol.Styles: + obj = ParseStyles(new Styles()); + break; + + case Symbol.Section: + obj = ParseSection(new Sections()); + break; + + case Symbol.Table: + obj = new Table(); + ParseTable(null, (Table)obj); + break; + + case Symbol.TextFrame: + DocumentElements elems = new DocumentElements(); + ParseTextFrame(elems); + obj = elems[0]; + break; + + case Symbol.Chart: + throw new NotImplementedException(); + + case Symbol.Paragraph: + obj = new DocumentElements(); + ParseParagraph((DocumentElements)obj); + break; + + default: + ThrowParserException(DomMsgID.UnexpectedSymbol); + break; + } + ReadCode(); + AssertCondition(Symbol == Symbol.Eof, DomMsgID.EndOfFileExpected); + + return obj; + } + + /// + /// Parses the keyword \styles. + /// + private Styles ParseStyles(Styles styles) + { + MoveToCode(); + AssertSymbol(Symbol.Styles); + + ReadCode(); // read '{' + AssertSymbol(Symbol.BraceLeft); + + ReadCode(); // read first style name + // An empty \styles block is valid. + while (Symbol == Symbol.Identifier || Symbol == Symbol.StringLiteral) + ParseStyleDefinition(styles); + + AssertSymbol(Symbol.BraceRight); + ReadCode(); // read beyond '}' + + return styles; + } + + /// + /// Parses a style definition block within the keyword \styles. + /// + private Style ParseStyleDefinition(Styles styles) + { + // StyleName [: BaseStyleName] + // { + // ... + // } + Style style = null; + try + { + string styleName = _scanner.Token; + string baseStyleName = null; + + if (Symbol != Symbol.Identifier && Symbol != Symbol.StringLiteral) + ThrowParserException(DomMsgID.StyleNameExpected, styleName); + + ReadCode(); + + if (Symbol == Symbol.Colon) + { + ReadCode(); + if (Symbol != Symbol.Identifier && Symbol != Symbol.StringLiteral) + ThrowParserException(DomMsgID.StyleNameExpected, styleName); + + // If baseStyle is not valid, choose InvalidStyleName by default. + baseStyleName = _scanner.Token; + if (styles.GetIndex(baseStyleName) == -1) + { + ReportParserInfo(DdlErrorLevel.Warning, DomMsgID.UseOfUndefinedBaseStyle, baseStyleName); + baseStyleName = StyleNames.InvalidStyleName; + } + + ReadCode(); + } + + // Get or create style. + style = styles[styleName]; + if (style != null) + { + // Reset base style. + if (baseStyleName != null) + style.BaseStyle = baseStyleName; + } + else + { + // Style does not exist and no base style is given, choose InvalidStyleName by default. + if (String.IsNullOrEmpty(baseStyleName)) + { + baseStyleName = StyleNames.InvalidStyleName; + ReportParserInfo(DdlErrorLevel.Warning, DomMsgID.UseOfUndefinedStyle, styleName); + } + + style = styles.AddStyle(styleName, baseStyleName); + } + + // Parse definition (if any). + + if (Symbol == Symbol.BraceLeft) + { + ParseAttributeBlock(style); + } + } + catch (DdlParserException ex) + { + ReportParserException(ex); + AdjustToNextBlock(); + } + return style; + } + + /// + /// Determines if the current symbol is a header or footer. + /// + private bool IsHeaderFooter() + { + Symbol sym = Symbol; + return (sym == Symbol.Header || sym == Symbol.Footer || + sym == Symbol.PrimaryHeader || sym == Symbol.PrimaryFooter || + sym == Symbol.EvenPageHeader || sym == Symbol.EvenPageFooter || + sym == Symbol.FirstPageHeader || sym == Symbol.FirstPageFooter); + } + + /// + /// Parses the keyword \section. + /// + private Section ParseSection(Sections sections) + { + Debug.Assert(sections != null); + + MoveToCode(); + AssertSymbol(Symbol.Section); + + Section section = null; + try + { + section = sections.AddSection(); + + ReadCode(); // read '[' or '{' + if (Symbol == Symbol.BracketLeft) + ParseAttributes(section); + + AssertSymbol(Symbol.BraceLeft); + + // Consider the case that the keyword \paragraph can be omitted. + if (IsParagraphContent()) + { + Paragraph paragraph = section.Elements.AddParagraph(); + ParseParagraphContent(section.Elements, paragraph); + } + else + { + ReadCode(); // read beyond '{' + + // 1st parse headers and footers + while (IsHeaderFooter()) + ParseHeaderFooter(section); + + // 2nd parse all other stuff + ParseDocumentElements(section.Elements, Symbol.Section); + } + AssertSymbol(Symbol.BraceRight); + ReadCode(); // read beyond '}' + } + catch (DdlParserException ex) + { + ReportParserException(ex); + AdjustToNextBlock(); + } + return section; + } + + /// + /// Parses the keywords \header. + /// + private void ParseHeaderFooter(Section section) + { + if (section == null) + throw new ArgumentNullException("section"); + + try + { + Symbol hdrFtrSym = Symbol; + bool isHeader = hdrFtrSym == Symbol.Header || + hdrFtrSym == Symbol.PrimaryHeader || + hdrFtrSym == Symbol.FirstPageHeader || + hdrFtrSym == Symbol.EvenPageHeader; + + // Recall that the styles "Header" resp. "Footer" are used as default if + // no other style was given. But this belongs to the rendering process, + // not to the DDL parser. Therefore no code here belongs to that. + HeaderFooter headerFooter = new HeaderFooter(); + ReadCode(); // read '[' or '{' + if (Symbol == Symbol.BracketLeft) + ParseAttributes(headerFooter); + + AssertSymbol(Symbol.BraceLeft); + if (IsParagraphContent()) + { + Paragraph paragraph = headerFooter.Elements.AddParagraph(); + ParseParagraphContent(headerFooter.Elements, paragraph); + } + else + { + ReadCode(); // parse '{' + ParseDocumentElements(headerFooter.Elements, Symbol.HeaderOrFooter); + } + AssertSymbol(Symbol.BraceRight); + ReadCode(); // parse beyond '{' + + HeadersFooters headersFooters = isHeader ? section.Headers : section.Footers; + if (hdrFtrSym == Symbol.Header || hdrFtrSym == Symbol.Footer) + { + headersFooters.Primary = headerFooter.Clone(); + headersFooters.EvenPage = headerFooter.Clone(); + headersFooters.FirstPage = headerFooter.Clone(); + } + else + { + switch (hdrFtrSym) + { + case Symbol.PrimaryHeader: + case Symbol.PrimaryFooter: + headersFooters.Primary = headerFooter; + break; + + case Symbol.EvenPageHeader: + case Symbol.EvenPageFooter: + headersFooters.EvenPage = headerFooter; + break; + + case Symbol.FirstPageHeader: + case Symbol.FirstPageFooter: + headersFooters.FirstPage = headerFooter; + break; + } + } + } + catch (DdlParserException ex) + { + ReportParserException(ex); + AdjustToNextBlock(); + } + } + + /// + /// Determines whether the next text is paragraph content or document element. + /// + private bool IsParagraphContent() + { + if (MoveToParagraphContent()) + { + if (_scanner.Char == Chars.BackSlash) + { + Symbol symbol = _scanner.PeekKeyword(); + switch (symbol) + { + case Symbol.Bold: + case Symbol.Italic: + case Symbol.Underline: + case Symbol.Field: + case Symbol.Font: + case Symbol.FontColor: + case Symbol.FontSize: + case Symbol.Footnote: + case Symbol.Hyperlink: + case Symbol.Symbol: + case Symbol.Chr: + case Symbol.Tab: + case Symbol.LineBreak: + case Symbol.Space: + case Symbol.SoftHyphen: + return true; + } + return false; + } + return true; + } + return false; + } + + /// + /// Parses the document elements of a \paragraph, \cell or comparable. + /// + private DocumentElements ParseDocumentElements(DocumentElements elements, Symbol context) + { + // + // This is clear: + // \section { Hallo World! } + // All section content will be treated as paragraph content. + // + // but this is ambiguous: + // \section { \image(...) } + // It could be an image inside a paragraph or at the section level. + // In this case it will be treated as an image on section level. + // + // If this is not your intention it must be like this: + // \section { \paragraph { \image(...) } } + // + + while (TokenType == TokenType.KeyWord) + { + switch (Symbol) + { + case Symbol.Paragraph: + ParseParagraph(elements); + break; + + case Symbol.PageBreak: + ParsePageBreak(elements); + break; + + case Symbol.Table: + ParseTable(elements, null); + break; + + case Symbol.TextFrame: + ParseTextFrame(elements); + break; + + case Symbol.Image: + ParseImage(elements.AddImage(""), false); + break; + + case Symbol.Chart: + ParseChart(elements); + break; + + case Symbol.Barcode: + ParseBarcode(elements); + break; + + default: + ThrowParserException(DomMsgID.UnexpectedSymbol, _scanner.Token); + break; + } + } + return elements; + } + + /// + /// Parses the keyword \paragraph. + /// + private void ParseParagraph(DocumentElements elements) + { + MoveToCode(); + AssertSymbol(Symbol.Paragraph); + + Paragraph paragraph = elements.AddParagraph(); + try + { + ReadCode(); // read '[' or '{' + if (Symbol == Symbol.BracketLeft) + ParseAttributes(paragraph); + + // Empty paragraphs without braces are valid. + if (Symbol == Symbol.BraceLeft) + { + ParseParagraphContent(elements, paragraph); + AssertSymbol(Symbol.BraceRight); + ReadCode(); // read beyond '}' + } + } + catch (DdlParserException ex) + { + ReportParserException(ex); + AdjustToNextBlock(); + } + } + + /// + /// Parses the inner text of a paragraph, i.e. stops on BraceRight and treats empty + /// line as paragraph separator. + /// + private void ParseParagraphContent(DocumentElements elements, Paragraph paragraph) + { + Paragraph para = paragraph ?? elements.AddParagraph(); + + while (para != null) + { + ParseFormattedText(para.Elements, 0); + if (Symbol != Symbol.BraceRight && Symbol != Symbol.Eof) + { + para = elements.AddParagraph(); + } + else + para = null; + } + } + + /// + /// Removes the last blank from the text. Used before a tab, a linebreak or a space will be + /// added to the text. + /// + private void RemoveTrailingBlank(ParagraphElements elements) + { + DocumentObject dom = elements.LastObject; + Text text = dom as Text; + if (text != null) + { + if (text.Content.EndsWith(" ")) + text.Content = text.Content.Remove(text.Content.Length - 1, 1); + } + } + + /// + /// Parses the inner text of a paragraph. Parsing ends if '}' is reached or an empty + /// line occurs on nesting level 0. + /// + private void ParseFormattedText(ParagraphElements elements, int nestingLevel) + { + MoveToParagraphContent(); + + bool loop = true; + bool rootLevel = nestingLevel == 0; + ReadText(rootLevel); + while (loop) + { + switch (Symbol) + { + case Symbol.Eof: + ThrowParserException(DomMsgID.UnexpectedEndOfFile); + break; + + case Symbol.EmptyLine: + elements.AddCharacter(SymbolName.ParaBreak); + ReadText(rootLevel); + break; + + case Symbol.BraceRight: + loop = false; + break; + + case Symbol.Comment: + // Ignore comments. + ReadText(rootLevel); + break; + + case Symbol.Text: + elements.AddText(Token); + ReadText(rootLevel); + break; + + case Symbol.Tab: + RemoveTrailingBlank(elements); + elements.AddTab(); + _scanner.MoveToNonWhiteSpaceOrEol(); + ReadText(rootLevel); + break; + + case Symbol.LineBreak: + RemoveTrailingBlank(elements); + elements.AddLineBreak(); + _scanner.MoveToNonWhiteSpaceOrEol(); + ReadText(rootLevel); + break; + + case Symbol.Bold: + ParseBoldItalicEtc(elements.AddFormattedText(TextFormat.Bold), nestingLevel + 1); + ReadText(rootLevel); + break; + + case Symbol.Italic: + ParseBoldItalicEtc(elements.AddFormattedText(TextFormat.Italic), nestingLevel + 1); + ReadText(rootLevel); + break; + + case Symbol.Underline: + ParseBoldItalicEtc(elements.AddFormattedText(TextFormat.Underline), nestingLevel + 1); + ReadText(rootLevel); + break; + + case Symbol.Font: + ParseFont(elements.AddFormattedText(), nestingLevel + 1); + ReadText(rootLevel); + break; + + case Symbol.FontSize: + ParseFontSize(elements.AddFormattedText(), nestingLevel + 1); + ReadText(rootLevel); + break; + + case Symbol.FontColor: + ParseFontColor(elements.AddFormattedText(), nestingLevel + 1); + ReadText(rootLevel); + break; + + case Symbol.Image: + ParseImage(elements.AddImage(""), true); + ReadText(rootLevel); + break; + + case Symbol.Field: + ParseField(elements, nestingLevel + 1); + ReadText(rootLevel); + break; + + case Symbol.Footnote: + ParseFootnote(elements, nestingLevel + 1); + ReadText(rootLevel); + break; + + case Symbol.Hyperlink: + ParseHyperlink(elements, nestingLevel + 1); + ReadText(rootLevel); + break; + + case Symbol.Space: + RemoveTrailingBlank(elements); + ParseSpace(elements, nestingLevel + 1); + _scanner.MoveToNonWhiteSpaceOrEol(); + ReadText(rootLevel); + break; + + case Symbol.Symbol: + ParseSymbol(elements); + ReadText(rootLevel); + break; + + case Symbol.Chr: + ParseChr(elements); + ReadText(rootLevel); + break; + + default: + ThrowParserException(DomMsgID.UnexpectedSymbol, Token); + break; + } + } + } + + /// + /// Parses the keywords \bold, \italic, and \underline. + /// + private void ParseBoldItalicEtc(FormattedText formattedText, int nestingLevel) + { + ReadCode(); + AssertSymbol(Symbol.BraceLeft); + ParseFormattedText(formattedText.Elements, nestingLevel); + AssertSymbol(Symbol.BraceRight); + } + + /// + /// Parses the keyword \font. + /// + private void ParseFont(FormattedText formattedText, int nestingLevel) + { + AssertSymbol(Symbol.Font); + ReadCode(); + + if (Symbol == Symbol.ParenLeft) + { + formattedText.Style = ParseElementName(); + ReadCode(); + } + + if (Symbol == Symbol.BracketLeft) + ParseAttributes(formattedText); + + AssertSymbol(Symbol.BraceLeft); + ParseFormattedText(formattedText.Elements, nestingLevel); + AssertSymbol(Symbol.BraceRight); + } + + /// + /// Parses code like ("name"). + /// + private string ParseElementName() + { + AssertSymbol(Symbol.ParenLeft); + ReadCode(); + if (Symbol != Symbol.StringLiteral) + ThrowParserException(DomMsgID.StringExpected, Token); + + string name = Token; + ReadCode(); + AssertSymbol(Symbol.ParenRight); + + return name; + } + + /// + /// Parses the keyword \fontsize. + /// + private void ParseFontSize(FormattedText formattedText, int nestingLevel) + { + AssertSymbol(Symbol.FontSize); + ReadCode(); + + AssertSymbol(Symbol.ParenLeft); + ReadCode(); + //NYI: Check token for correct Unit format + formattedText.Font.Size = Token; + ReadCode(); + AssertSymbol(Symbol.ParenRight); + ReadCode(); + + AssertSymbol(Symbol.BraceLeft); + ParseFormattedText(formattedText.Elements, nestingLevel); + AssertSymbol(Symbol.BraceRight); + } + + /// + /// Parses the keyword \fontcolor. + /// + private void ParseFontColor(FormattedText formattedText, int nestingLevel) + { + AssertSymbol(Symbol.FontColor); + ReadCode(); // read '(' + + AssertSymbol(Symbol.ParenLeft); + ReadCode(); // read color token + Color color = ParseColor(); + formattedText.Font.Color = color; + AssertSymbol(Symbol.ParenRight); + ReadCode(); + AssertSymbol(Symbol.BraceLeft); + ParseFormattedText(formattedText.Elements, nestingLevel); + AssertSymbol(Symbol.BraceRight); + } + + /// + /// Parses the keyword \symbol resp. \(. + /// + private void ParseSymbol(ParagraphElements elements) + { + AssertSymbol(Symbol.Symbol); + + ReadCode(); // read '(' + AssertSymbol(Symbol.ParenLeft); + + const char ch = (char)0; + SymbolName symtype = 0; + int count = 1; + + ReadCode(); // read name + if (TokenType == TokenType.Identifier) + { + try + { + if (Enum.IsDefined(typeof(SymbolName), Token)) + { + AssertCondition(IsSymbolType(Token), DomMsgID.InvalidSymbolType, Token); + symtype = (SymbolName)Enum.Parse(typeof(SymbolName), Token, true); + } + } + catch (Exception ex) + { + ThrowParserException(ex, DomMsgID.InvalidEnum, Token); + } + } + else + { + ThrowParserException(DomMsgID.UnexpectedSymbol, Token); + } + + ReadCode(); // read integer or identifier + if (Symbol == Symbol.Comma) + { + ReadCode(); // read integer + if (TokenType == TokenType.IntegerLiteral) + count = _scanner.GetTokenValueAsInt(); + ReadCode(); + } + + AssertSymbol(Symbol.ParenRight); + + if (symtype != 0) + elements.AddCharacter(symtype, count); + else + elements.AddCharacter(ch, count); + } + + /// + /// Parses the keyword \chr. + /// + private void ParseChr(ParagraphElements elements) + { + AssertSymbol(Symbol.Chr); + + ReadCode(); // read '(' + AssertSymbol(Symbol.ParenLeft); + + char ch = (char)0; + SymbolName symtype = 0; + int count = 1; + + ReadCode(); // read integer + if (TokenType == TokenType.IntegerLiteral) + { + int val = _scanner.GetTokenValueAsInt(); + if (val >= 1 && val < 256) + ch = (char)val; + else + ThrowParserException(DomMsgID.OutOfRange, "1 - 255"); + } + else + { + ThrowParserException(DomMsgID.UnexpectedSymbol, Token); + } + + ReadCode(); // read integer or identifier + if (Symbol == Symbol.Comma) + { + ReadCode(); // read integer + if (TokenType == TokenType.IntegerLiteral) + count = _scanner.GetTokenValueAsInt(); + ReadCode(); + } + + AssertSymbol(Symbol.ParenRight); + + if (symtype != 0) + elements.AddCharacter(symtype, count); + else + elements.AddCharacter(ch, count); + } + + /// + /// Parses the keyword \field. + /// + private void ParseField(ParagraphElements elements, int nestingLevel) + { + AssertSymbol(Symbol.Field); + + ReadCode(); // read '(' + AssertSymbol(Symbol.ParenLeft); + + ReadCode(); // read identifier + AssertSymbol(Symbol.Identifier); + string fieldType = Token.ToLower(); + + ReadCode(); // read ')' + AssertSymbol(Symbol.ParenRight); + + DocumentObject field = null; + switch (fieldType) + { + case "date": + field = elements.AddDateField(); + break; + + case "page": + field = elements.AddPageField(); + break; + + case "numpages": + field = elements.AddNumPagesField(); + break; + + case "info": + field = elements.AddInfoField(0); + break; + + case "sectionpages": + field = elements.AddSectionPagesField(); + break; + + case "section": + field = elements.AddSectionField(); + break; + + case "bookmark": + field = elements.AddBookmark(""); + break; + + case "pageref": + field = elements.AddPageRefField(""); + break; + } + AssertCondition(field != null, DomMsgID.InvalidFieldType, Token); + + if (_scanner.PeekSymbol() == Symbol.BracketLeft) + { + ReadCode(); // read '[' + ParseAttributes(field, false); + } + } + + /// + /// Parses the keyword \footnote. + /// + private void ParseFootnote(ParagraphElements elements, int nestingLevel) + { + AssertSymbol(Symbol.Footnote); + ReadCode(); + + Footnote footnote = elements.AddFootnote(); + if (Symbol == Symbol.BracketLeft) + ParseAttributes(footnote); + + AssertSymbol(Symbol.BraceLeft); + + // The keyword \paragraph is typically omitted. + if (IsParagraphContent()) + { + Paragraph paragraph = footnote.Elements.AddParagraph(); + ParseParagraphContent(footnote.Elements, paragraph); + } + else + { + ReadCode(); // read beyond '{' + ParseDocumentElements(footnote.Elements, Symbol.Footnote); + } + AssertSymbol(Symbol.BraceRight); + } + + /// + /// Parses the keyword \hyperlink. + /// + private void ParseHyperlink(ParagraphElements elements, int nestingLevel) + { + AssertSymbol(Symbol.Hyperlink); + ReadCode(); + + Hyperlink hyperlink = elements.AddHyperlink(""); + //NYI: Without name and type the hyperlink is senseless, so attributes need to be checked + if (Symbol == Symbol.BracketLeft) + ParseAttributes(hyperlink); + + AssertSymbol(Symbol.BraceLeft); + ParseFormattedText(hyperlink.Elements, nestingLevel); + AssertSymbol(Symbol.BraceRight); + } + + /// + /// Parses the keyword \space. + /// + private void ParseSpace(ParagraphElements elements, int nestingLevel) + { + // Samples + // \space + // \space(5) + // \space(em) + // \space(em,5) + AssertSymbol(Symbol.Space); + + Character space = elements.AddSpace(1); + + // \space can stand alone + if (_scanner.PeekSymbol() == Symbol.ParenLeft) + { + ReadCode(); // read '(' + AssertSymbol(Symbol.ParenLeft); + + ReadCode(); // read beyond '(' + if (Symbol == Symbol.Identifier) + { + string type = Token; + if (!IsSpaceType(type)) + ThrowParserException(DomMsgID.InvalidEnum, type); + + space.SymbolName = (SymbolName)Enum.Parse(typeof(SymbolName), type, true); + + ReadCode(); // read ',' or ')' + if (Symbol == Symbol.Comma) + { + ReadCode(); // read integer + AssertSymbol(Symbol.IntegerLiteral); + space.Count = _scanner.GetTokenValueAsInt(); + ReadCode(); // read ')' + } + } + else if (Symbol == Symbol.IntegerLiteral) + { + space.Count = _scanner.GetTokenValueAsInt(); + ReadCode(); + } + AssertSymbol(Symbol.ParenRight); + } + } + + /// + /// Parses a page break in a document elements container. + /// + private void ParsePageBreak(DocumentElements elements) + { + AssertSymbol(Symbol.PageBreak); + elements.AddPageBreak(); + ReadCode(); + } + + /// + /// Parses the keyword \table. + /// + private void ParseTable(DocumentElements elements, Table table) + { + Table tbl = table; + try + { + if (tbl == null) + tbl = elements.AddTable(); + + MoveToCode(); + AssertSymbol(Symbol.Table); + + ReadCode(); + if (_scanner.Symbol == Symbol.BracketLeft) + ParseAttributes(tbl); + + AssertSymbol(Symbol.BraceLeft); + ReadCode(); + + // Table must start with \columns... + AssertSymbol(Symbol.Columns); + ParseColumns(tbl); + + // ...followed by \rows. + AssertSymbol(Symbol.Rows); + ParseRows(tbl); + + AssertSymbol(Symbol.BraceRight); + ReadCode(); // read beyond '}' + } + catch (DdlParserException ex) + { + ReportParserException(ex); + AdjustToNextBlock(); + } + } + + /// + /// Parses the keyword \columns. + /// + private void ParseColumns(Table table) + { + Debug.Assert(table != null); + Debug.Assert(Symbol == Symbol.Columns); + + ReadCode(); + if (Symbol == Symbol.BracketLeft) + ParseAttributes(table.Columns); + + AssertSymbol(Symbol.BraceLeft); + ReadCode(); + + bool loop = true; + while (loop) + { + switch (Symbol) + { + case Symbol.Eof: + ThrowParserException(DomMsgID.UnexpectedEndOfFile); + break; + + case Symbol.BraceRight: + loop = false; + ReadCode(); + break; + + case Symbol.Column: + ParseColumn(table.AddColumn()); + break; + + default: + AssertSymbol(Symbol.Column); + break; + } + } + } + + /// + /// Parses the keyword \column. + /// + private void ParseColumn(Column column) + { + Debug.Assert(column != null); + Debug.Assert(Symbol == Symbol.Column); + + ReadCode(); + if (Symbol == Symbol.BracketLeft) + ParseAttributes(column); + + // Read empty content + if (Symbol == Symbol.BraceLeft) + { + ReadCode(); + AssertSymbol(Symbol.BraceRight); + ReadCode(); + } + } + + /// + /// Parses the keyword \rows. + /// + private void ParseRows(Table table) + { + Debug.Assert(table != null); + Debug.Assert(Symbol == Symbol.Rows); + + ReadCode(); + if (Symbol == Symbol.BracketLeft) + ParseAttributes(table.Rows); + + AssertSymbol(Symbol.BraceLeft); + ReadCode(); + + bool loop = true; + while (loop) + { + switch (Symbol) + { + case Symbol.Eof: + ThrowParserException(DomMsgID.UnexpectedEndOfFile); + break; + + case Symbol.BraceRight: + ReadCode(); // read '}' + loop = false; + break; + + case Symbol.Row: + ParseRow(table.AddRow()); + break; + + default: + AssertSymbol(Symbol.Row); + break; + } + } + } + + /// + /// Parses the keyword \row. + /// + private void ParseRow(Row row) + { + Debug.Assert(row != null); + Debug.Assert(Symbol == Symbol.Row); + + ReadCode(); + if (Symbol == Symbol.BracketLeft) + ParseAttributes(row); + + if (Symbol == Symbol.BraceLeft) + { + ReadCode(); + + bool loop = true; + int idx = 0; + //int cells = row.Cells.Count; + while (loop) + { + switch (Symbol) + { + case Symbol.Eof: + ThrowParserException(DomMsgID.UnexpectedEndOfFile); + break; + + case Symbol.BraceRight: + loop = false; + ReadCode(); + break; + + case Symbol.Cell: + ParseCell(row[idx]); + idx++; + break; + + default: + ThrowParserException(DomMsgID.UnexpectedSymbol, Token); + break; + } + } + } + } + + /// + /// Parses the keyword \cell. + /// + private void ParseCell(Cell cell) + { + Debug.Assert(cell != null); + Debug.Assert(Symbol == Symbol.Cell); + + ReadCode(); + if (Symbol == Symbol.BracketLeft) + ParseAttributes(cell); + + // Empty cells without braces are valid. + if (Symbol == Symbol.BraceLeft) + { + if (IsParagraphContent()) + { + ParseParagraphContent(cell.Elements, null); + } + else + { + ReadCode(); + if (Symbol != Symbol.BraceRight) + ParseDocumentElements(cell.Elements, Symbol.Cell); + } + AssertSymbol(Symbol.BraceRight); + ReadCode(); // read '}' + } + } + + /// + /// Parses the keyword \image. + /// + private void ParseImage(Image image, bool paragraphContent) + { + // Future syntax by example + // \image("Name") + // \image("Name")[...] + // \image{base64...} //NYI + // \image[...]{base64...} //NYI + Debug.Assert(image != null); + + try + { + MoveToCode(); + AssertSymbol(Symbol.Image); + ReadCode(); + + if (_scanner.Symbol == Symbol.ParenLeft) + image.Name = ParseElementName(); + + if (_scanner.PeekSymbol() == Symbol.BracketLeft) + { + ReadCode(); + ParseAttributes(image, !paragraphContent); + } + else if (!paragraphContent) + ReadCode(); // We are a part of a section, cell etc.; read beyond ')'. + } + catch (DdlParserException ex) + { + ReportParserException(ex); + AdjustToNextBlock(); + } + } + + /// + /// Parses the keyword \textframe. + /// + private void ParseTextFrame(DocumentElements elements) + { + Debug.Assert(elements != null); + + TextFrame textFrame = elements.AddTextFrame(); + try + { + ReadCode(); + if (_scanner.Symbol == Symbol.BracketLeft) + ParseAttributes(textFrame); + + AssertSymbol(Symbol.BraceLeft); + if (IsParagraphContent()) + { + ParseParagraphContent(textFrame.Elements, null); + } + else + { + ReadCode(); // read '{' + ParseDocumentElements(textFrame.Elements, Symbol.TextFrame); + } + AssertSymbol(Symbol.BraceRight); + ReadCode(); // read beyond '}' + } + catch (DdlParserException ex) + { + ReportParserException(ex); + AdjustToNextBlock(); + } + } + + private void ParseBarcode(DocumentElements elements) + { + // Syntax: + // 1. \barcode(Code) + // 2. \barcode(Code)[...] + // 3. \barcode(Code, Type) + // 4. \barcode(Code, Type)[...] + + try + { + ReadCode(); + AssertSymbol(Symbol.ParenLeft, DomMsgID.MissingParenLeft, GetSymbolText(Symbol.Barcode)); + ReadCode(); + AssertSymbol(Symbol.StringLiteral, DomMsgID.UnexpectedSymbol); + + Barcode barcode = elements.AddBarcode(); + barcode.SetValue("Code", Token); + ReadCode(); + if (Symbol == Symbol.Comma) + { + ReadCode(); + AssertSymbol(Symbol.Identifier, DomMsgID.IdentifierExpected, Token); + BarcodeType barcodeType = (BarcodeType)Enum.Parse(typeof(BarcodeType), Token, true); + barcode.SetValue("type", barcodeType); + ReadCode(); + } + AssertSymbol(Symbol.ParenRight, DomMsgID.MissingParenRight, GetSymbolText(Symbol.Barcode)); + + ReadCode(); + if (Symbol == Symbol.BracketLeft) + ParseAttributes(barcode); + //barcode->ConsistencyCheck(mInfoHandler->Infos()); + } + catch (DdlParserException pe) + { + ReportParserException(pe); + AdjustToNextBlock(); + } + } + + /// + /// Parses the keyword \chart. + /// + private void ParseChart(DocumentElements elements) + { + // Syntax: + // 1. \chartarea(Type){...} + // 2. \chartarea(Type)[...]{...} + // + // Usage of header-, bottom-, footer-, left- and rightarea are similar. + + ChartType chartType = 0; + try + { + ReadCode(); // read '(' + AssertSymbol(Symbol.ParenLeft, DomMsgID.MissingParenLeft, GetSymbolText(Symbol.Chart)); + + ReadCode(); // ChartType name + AssertSymbol(Symbol.Identifier, DomMsgID.IdentifierExpected, Token); + string chartTypeName = Token; + + ReadCode(); // read ')' + AssertSymbol(Symbol.ParenRight, DomMsgID.MissingParenRight, GetSymbolText(Symbol.Chart)); + + try + { + chartType = (ChartType)Enum.Parse(typeof(ChartType), chartTypeName, true); + } + catch (Exception ex) + { + ThrowParserException(ex, DomMsgID.UnknownChartType, chartTypeName); + } + + Chart chart = elements.AddChart(chartType); + + ReadCode(); + if (Symbol == Symbol.BracketLeft) + ParseAttributes(chart); + + AssertSymbol(Symbol.BraceLeft, DomMsgID.MissingBraceLeft, GetSymbolText(Symbol.Chart)); + + ReadCode(); // read beyond '{' + + bool fContinue = true; + while (fContinue) + { + switch (Symbol) + { + case Symbol.Eof: + ThrowParserException(DomMsgID.UnexpectedEndOfFile); + break; + + case Symbol.BraceRight: + fContinue = false; + break; + + case Symbol.PlotArea: + ParseArea(chart.PlotArea); + break; + + case Symbol.HeaderArea: + ParseArea(chart.HeaderArea); + break; + + case Symbol.FooterArea: + ParseArea(chart.FooterArea); + break; + + case Symbol.TopArea: + ParseArea(chart.TopArea); + break; + + case Symbol.BottomArea: + ParseArea(chart.BottomArea); + break; + + case Symbol.LeftArea: + ParseArea(chart.LeftArea); + break; + + case Symbol.RightArea: + ParseArea(chart.RightArea); + break; + + case Symbol.XAxis: + ParseAxes(chart.XAxis, Symbol); + break; + + case Symbol.YAxis: + ParseAxes(chart.YAxis, Symbol); + break; + + case Symbol.ZAxis: + ParseAxes(chart.ZAxis, Symbol); + break; + + case Symbol.Series: + ParseSeries(chart.SeriesCollection.AddSeries()); + break; + + case Symbol.XValues: + ParseSeries(chart.XValues.AddXSeries()); + break; + + default: + ThrowParserException(DomMsgID.UnexpectedSymbol, Token); + break; + } + } + ReadCode(); // read beyond '}' + } + catch (DdlParserException pe) + { + ReportParserException(pe); + AdjustToNextBlock(); + } + } + + /// + /// Parses the keyword \plotarea inside a chart. + /// + private void ParseArea(PlotArea area) + { + // Syntax: + // 1. \plotarea{...} + // 2. \plotarea[...]{...} //??? + + try + { + ReadCode(); + if (Symbol == Symbol.BracketLeft) + { + ParseAttributes(area, false); + ReadCode(); + } + + if (Symbol != Symbol.BraceLeft) + return; + + bool fContinue = true; + while (fContinue) + { + ReadCode(); + switch (Symbol) + { + case Symbol.BraceRight: + fContinue = false; + break; + + default: + // Alles ignorieren? Warnung ausgeben? + break; + } + } + AssertSymbol(Symbol.BraceRight); + ReadCode(); // read beyond '}' + } + catch (DdlParserException pe) + { + ReportParserException(pe); + AdjustToNextBlock(); + } + } + + /// + /// Parses the keywords \headerarea, \toparea, \bottomarea, \footerarea, + /// \leftarea or \rightarea inside a chart. + /// + private void ParseArea(TextArea area) + { + // Syntax: + // 1. \toparea{...} + // 2. \toparea[...]{...} + // + // Usage of header-, bottom-, footer-, left- and rightarea are similar. + + try + { + ReadCode(); + if (Symbol == Symbol.BracketLeft) + { + ParseAttributes(area, false); + ReadCode(); + } + + if (Symbol != Symbol.BraceLeft) + return; + + if (IsParagraphContent()) + ParseParagraphContent(area.Elements, null); + else + { + ReadCode(); // read beyond '{' + bool fContinue = true; + while (fContinue) + { + switch (Symbol) + { + case Symbol.BraceRight: + fContinue = false; + break; + + case Symbol.Legend: + ParseLegend(area.AddLegend()); + break; + + case Symbol.Paragraph: + ParseParagraph(area.Elements); + break; + + case Symbol.Table: + ParseTable(null, area.AddTable()); + break; + + case Symbol.TextFrame: + ParseTextFrame(area.Elements); + break; + + case Symbol.Image: + Image image = new Image(); + ParseImage(image, false); + area.Elements.Add(image); + break; + + default: + ThrowParserException(DomMsgID.UnexpectedSymbol, Token); + break; + } + } + } + AssertSymbol(Symbol.BraceRight); + ReadCode(); // read beyond '}' + } + catch (DdlParserException pe) + { + ReportParserException(pe); + AdjustToNextBlock(); + } + } + + /// + /// Parses the keywords \xaxis, \yaxis or \zaxis inside a chart. + /// + private void ParseAxes(Axis axis, Symbol symbolAxis) + { + // Syntax: + // 1. \xaxis[...] + // 2. \xaxis[...]{...} //??? + // + // Usage of yaxis and zaxis are similar. + + try + { + ReadCode(); + if (Symbol == Symbol.BracketLeft) + { + ParseAttributes(axis, false); + ReadCode(); + } + + if (Symbol != Symbol.BraceLeft) + return; + + while (Symbol != Symbol.BraceRight) + ReadCode(); + + AssertSymbol(Symbol.BraceRight, DomMsgID.MissingBraceRight, GetSymbolText(symbolAxis)); + ReadCode(); // read beyond '}' + } + catch (DdlParserException pe) + { + ReportParserException(pe); + AdjustToNextBlock(); + } + } + + /// + /// Parses the keyword \series inside a chart. + /// + private void ParseSeries(Series series) + { + // Syntax: + // 1. \series{...} + // 2. \series[...]{...} + + try + { + ReadCode(); + if (Symbol == Symbol.BracketLeft) + ParseAttributes(series); + + AssertSymbol(Symbol.BraceLeft, DomMsgID.MissingBraceLeft, GetSymbolText(Symbol.Series)); + ReadCode(); // read beyond '{' + + bool fContinue = true; + bool fFoundComma = true; + while (fContinue) + { + switch (Symbol) + { + case Symbol.Eof: + ThrowParserException(DomMsgID.UnexpectedEndOfFile); + break; + + case Symbol.BraceRight: + fContinue = false; + break; + + case Symbol.Comma: + fFoundComma = true; + ReadCode(); + break; + + case Symbol.Point: + AssertCondition(fFoundComma, DomMsgID.MissingComma); + ParsePoint(series.Add(0.0)); + fFoundComma = false; + break; + + case Symbol.Null: + AssertCondition(fFoundComma, DomMsgID.MissingComma); + series.AddBlank(); + fFoundComma = false; + ReadCode(); + break; + + default: + AssertCondition(fFoundComma, DomMsgID.MissingComma); + series.Add(_scanner.GetTokenValueAsReal()); + fFoundComma = false; + ReadCode(); + break; + } + } + AssertSymbol(Symbol.BraceRight, DomMsgID.MissingBraceRight, GetSymbolText(Symbol.Series)); + ReadCode(); // read beyond '}' + } + catch (DdlParserException pe) + { + ReportParserException(pe); + AdjustToNextBlock(); + } + } + + /// + /// Parses the keyword \xvalues inside a chart. + /// + private void ParseSeries(XSeries series) + { + // Syntax: + // 1. \xvalues{...} + + try + { + ReadCode(); + AssertSymbol(Symbol.BraceLeft, DomMsgID.MissingBraceLeft, GetSymbolText(Symbol.Series)); + + bool fFoundComma = true; + bool fContinue = true; + while (fContinue) + { + ReadCode(); + switch (Symbol) + { + case Symbol.Eof: + ThrowParserException(DomMsgID.UnexpectedEndOfFile); + break; + + case Symbol.BraceRight: + fContinue = false; + break; + + case Symbol.Comma: + fFoundComma = true; + break; + + case Symbol.Null: + AssertCondition(fFoundComma, DomMsgID.MissingComma); + series.AddBlank(); + fFoundComma = false; + break; + + case Symbol.StringLiteral: + case Symbol.IntegerLiteral: + case Symbol.RealLiteral: + case Symbol.HexIntegerLiteral: + AssertCondition(fFoundComma, DomMsgID.MissingComma); + series.Add(Token); + fFoundComma = false; + break; + + default: + ThrowParserException(DomMsgID.UnexpectedSymbol, Token); + break; + } + } + AssertSymbol(Symbol.BraceRight, DomMsgID.MissingBraceRight, GetSymbolText(Symbol.Series)); + ReadCode(); // read beyond '}' + } + catch (DdlParserException pe) + { + ReportParserException(pe); + AdjustToNextBlock(); + } + } + + /// + /// Parses the keyword \point inside a series. + /// + private void ParsePoint(Point point) + { + // Syntax: + // 1. \point{...} + // 2. \point[...]{...} + + try + { + ReadCode(); + if (Symbol == Symbol.BracketLeft) + ParseAttributes(point); + + AssertSymbol(Symbol.BraceLeft, DomMsgID.MissingBraceLeft, GetSymbolText(Symbol.Point)); + ReadCode(); // read beyond '{' + point.Value = _scanner.GetTokenValueAsReal(); + + ReadCode(); // read '}' + AssertSymbol(Symbol.BraceRight, DomMsgID.MissingBraceRight, GetSymbolText(Symbol.Point)); + ReadCode(); // read beyond '}' + } + catch (DdlParserException pe) + { + ReportParserException(pe); + AdjustToNextBlock(); + } + } + + /// + /// Parses the keyword \legend inside a textarea. + /// + private void ParseLegend(Legend legend) + { + // Syntax: + // 1. \legend + // 2. \legend[...] + // 3. \legend[...]{...} + + try + { + ReadCode(); + if (Symbol == Symbol.BracketLeft) + { + ParseAttributes(legend, false); + ReadCode(); + } + + // Empty legends are allowed. + if (Symbol != Symbol.BraceLeft) + return; + + AdjustToNextBlock(); // consume/ignore all content + } + catch (DdlParserException pe) + { + ReportParserException(pe); + AdjustToNextBlock(); + } + } + + /// + /// Parses an attribute declaration block enclosed in brackets []. If readNextSymbol is + /// set to true, the closing bracket will be read. + /// + private void ParseAttributes(DocumentObject element, bool readNextSymbol) + { + AssertSymbol(Symbol.BracketLeft); + ReadCode(); // read beyond '[' + + while (Symbol == Symbol.Identifier) + ParseAttributeStatement(element); + + AssertSymbol(Symbol.BracketRight); + + // Do not read ']' when parsing in paragraph content. + if (readNextSymbol) + ReadCode(); // read beyond ']' + } + + /// + /// Parses an attribute declaration block enclosed in brackets []. + /// + private void ParseAttributes(DocumentObject element) + { + ParseAttributes(element, true); + } + + /// + /// Parses a single statement in an attribute declaration block. + /// + private void ParseAttributeStatement(DocumentObject doc) + { + // Syntax is easy + // identifier: xxxxx + // or + // sequence of identifiers: xxx.yyy.zzz + // + // followed by: =, +=, -=, or { + // + // Parser of rhs depends on the type of the l-value. + + if (doc == null) + throw new ArgumentNullException("doc"); + string valueName = ""; + try + { + valueName = _scanner.Token; + ReadCode(); + + // Resolve path, if it exists. + object val; + while (Symbol == Symbol.Dot) + { +#if DEBUG_ + if (valueName == "TabStops") + valueName.GetType(); +#endif + Debug.Assert(doc != null, "Make ReSharper happy."); + val = doc.GetValue(valueName); + if (val == null) + { + DocumentObject documentObject = doc; + val = documentObject.CreateValue(valueName); + doc.SetValue(valueName, val); + } + AssertCondition(val != null, DomMsgID.InvalidValueName, valueName); + doc = val as DocumentObject; + AssertCondition(doc != null, DomMsgID.SymbolIsNotAnObject, valueName); + + ReadCode(); + AssertCondition(Symbol == Symbol.Identifier, DomMsgID.InvalidValueName, _scanner.Token); + valueName = _scanner.Token; + AssertCondition(valueName[0] != '_', DomMsgID.NoAccess, _scanner.Token); + +#if DEBUG_ + if (valueName == "TabStops") + valueName.GetType(); +#endif + + ReadCode(); + } + + Debug.Assert(doc != null, "Make ReSharper happy."); + switch (Symbol) + { + case Symbol.Assign: + //DomValueDescriptor is needed from assignment routine. + ValueDescriptor pvd = doc.Meta[valueName]; + AssertCondition(pvd != null, DomMsgID.InvalidValueName, valueName); + ParseAssign(doc, pvd); + break; + + case Symbol.PlusAssign: + case Symbol.MinusAssign: + // Hard-coded for TabStops only... + if (!(doc is ParagraphFormat)) + ThrowParserException(DomMsgID.SymbolNotAllowed, _scanner.Token); + if (String.Compare(valueName, "TabStops", StringComparison.OrdinalIgnoreCase) != 0) + ThrowParserException(DomMsgID.InvalidValueForOperation, valueName, _scanner.Token); + + ParagraphFormat paragraphFormat = (ParagraphFormat)doc; + TabStops tabStops = paragraphFormat.TabStops; + + if (true) // HACK in ParseAttributeStatement + { + bool fAddItem = Symbol == Symbol.PlusAssign; + TabStop tabStop = new TabStop(); + + ReadCode(); + + if (Symbol == Symbol.BraceLeft) + { + ParseAttributeBlock(tabStop); + } + else if (Symbol == Symbol.StringLiteral || Symbol == Symbol.RealLiteral || Symbol == Symbol.IntegerLiteral) + { + // Special hack for tab stops... + Unit unit = Token; + tabStop.SetValue("Position", unit); + + ReadCode(); + } + else + ThrowParserException(DomMsgID.UnexpectedSymbol, Token); + + if (fAddItem) + tabStops.AddTabStop(tabStop); + else + tabStops.RemoveTabStop(tabStop.Position); + } + break; + + case Symbol.BraceLeft: + val = doc.GetValue(valueName); + AssertCondition(val != null, DomMsgID.InvalidValueName, valueName); + + DocumentObject doc2 = val as DocumentObject; + if (doc2 != null) + ParseAttributeBlock(doc2); + else + ThrowParserException(DomMsgID.SymbolIsNotAnObject, valueName); + break; + + default: + ThrowParserException(DomMsgID.SymbolNotAllowed, _scanner.Token); + return; + } + } + catch (DdlParserException ex) + { + ReportParserException(ex); + AdjustToNextBlock(); + } + catch (ArgumentException e) + { + ReportParserException(e, DomMsgID.InvalidAssignment, valueName); + } + } + + /// + /// Parses an attribute declaration block enclosed in braces {}. + /// + private void ParseAttributeBlock(DocumentObject element) + { + // Technically the same as ParseAttributes + + AssertSymbol(Symbol.BraceLeft); + ReadCode(); // move beyond '{' + + while (Symbol == Symbol.Identifier) + ParseAttributeStatement(element); + + AssertSymbol(Symbol.BraceRight); + ReadCode(); // move beyond '}' + } + + /// + /// Parses an assign statement in an attribute declaration block. + /// + private void ParseAssign(DocumentObject dom, ValueDescriptor vd) + { + if (dom == null) + throw new ArgumentNullException("dom"); + if (vd == null) + throw new ArgumentNullException("vd"); + + if (Symbol == Symbol.Assign) + ReadCode(); + + Type valType = vd.ValueType; + try + { + if (valType == typeof(string)) + ParseStringAssignment(dom, vd); + else if (valType == typeof(int)) + ParseIntegerAssignment(dom, vd); + else if (valType == typeof(Unit)) + ParseUnitAssignment(dom, vd); + else if (valType == typeof(double) || valType == typeof(float)) + ParseRealAssignment(dom, vd); + else if (valType == typeof(bool)) + ParseBoolAssignment(dom, vd); +#if !NETFX_CORE + else if (typeof(Enum).IsAssignableFrom(valType)) +#else + else if (typeof(Enum).GetTypeInfo().IsAssignableFrom(valType.GetTypeInfo())) +#endif + ParseEnumAssignment(dom, vd); + else if (valType == typeof(Color)) + ParseColorAssignment(dom, vd); +#if !NETFX_CORE + else if (typeof(ValueType).IsAssignableFrom(valType)) +#else + else if (typeof(ValueType).GetTypeInfo().IsAssignableFrom(valType.GetTypeInfo())) +#endif + { + ParseValueTypeAssignment(dom, vd); + } +#if !NETFX_CORE + else if (typeof(DocumentObject).IsAssignableFrom(valType)) +#else + else if (typeof(DocumentObject).GetTypeInfo().IsAssignableFrom(valType.GetTypeInfo())) +#endif + { + ParseDocumentObjectAssignment(dom, vd); + } + else + { + AdjustToNextStatement(); + ThrowParserException(DomMsgID.InvalidType, vd.ValueType.Name, vd.ValueName); + } + } + catch (Exception ex) + { + ReportParserException(ex, DomMsgID.InvalidAssignment, vd.ValueName); + } + } + + /// + /// Parses the assignment to a boolean l-value. + /// + private void ParseBoolAssignment(DocumentObject dom, ValueDescriptor vd) + { + AssertCondition(Symbol == Symbol.True || Symbol == Symbol.False, DomMsgID.BoolExpected, + _scanner.Token); + + dom.SetValue(vd.ValueName, Symbol == Symbol.True); + ReadCode(); + } + + /// + /// Parses the assignment to an integer l-value. + /// + private void ParseIntegerAssignment(DocumentObject dom, ValueDescriptor vd) + { + AssertCondition(Symbol == Symbol.IntegerLiteral || Symbol == Symbol.HexIntegerLiteral || Symbol == Symbol.StringLiteral, + DomMsgID.IntegerExpected, Token); + + int n = Int32.Parse(_scanner.Token, CultureInfo.InvariantCulture); + dom.SetValue(vd.ValueName, n); + + ReadCode(); + } + + /// + /// Parses the assignment to a floating point l-value. + /// + private void ParseRealAssignment(DocumentObject dom, ValueDescriptor vd) + { + AssertCondition(Symbol == Symbol.RealLiteral || Symbol == Symbol.IntegerLiteral || Symbol == Symbol.StringLiteral, + DomMsgID.RealExpected, _scanner.Token); + + double r = double.Parse(_scanner.Token, CultureInfo.InvariantCulture); + dom.SetValue(vd.ValueName, r); + + ReadCode(); + } + + /// + /// Parses the assignment to a Unit l-value. + /// + private void ParseUnitAssignment(DocumentObject dom, ValueDescriptor vd) + { + AssertCondition(Symbol == Symbol.RealLiteral || Symbol == Symbol.IntegerLiteral || Symbol == Symbol.StringLiteral, + DomMsgID.RealExpected, _scanner.Token); + + Unit unit = Token; + dom.SetValue(vd.ValueName, unit); + ReadCode(); + } + + /// + /// Parses the assignment to a string l-value. + /// + private void ParseStringAssignment(DocumentObject dom, ValueDescriptor vd) + { + AssertCondition(Symbol == Symbol.StringLiteral, DomMsgID.StringExpected, _scanner.Token); + + vd.SetValue(dom, Token); //dom.SetValue(vd.ValueName, scanner.Token); + + ReadCode(); // read next token + } + + /// + /// Parses the assignment to an enum l-value. + /// + private void ParseEnumAssignment(DocumentObject dom, ValueDescriptor vd) + { + AssertSymbol(Symbol.Identifier, DomMsgID.IdentifierExpected, _scanner.Token); + + try + { + object val = Enum.Parse(vd.ValueType, Token, true); + dom.SetValue(vd.ValueName, val); + } + catch (Exception ex) + { + ThrowParserException(ex, DomMsgID.InvalidEnum, _scanner.Token, vd.ValueName); + } + + ReadCode(); // read next token + } + + /// + /// Parses the assignment to a struct (i.e. LeftPosition) l-value. + /// + private void ParseValueTypeAssignment(DocumentObject dom, ValueDescriptor vd) + { + object val = vd.GetValue(dom, GV.ReadWrite); + try + { + INullableValue ival = (INullableValue)val; + ival.SetValue(Token); + dom.SetValue(vd.ValueName, val); + ReadCode(); + } + catch (Exception ex) + { + ReportParserException(ex, DomMsgID.InvalidAssignment, vd.ValueName); + } + } + + /// + /// Parses the assignment to a DocumentObject l-value. + /// + private void ParseDocumentObjectAssignment(DocumentObject dom, ValueDescriptor vd) + { + // Create value if it does not exist + object val = vd.GetValue(dom, GV.ReadWrite); + //DocumentObject docObj = (DocumentObject)val; + + try + { + if (Symbol == Symbol.Null) + { + //string name = vd.ValueName; + Type type = vd.ValueType; + if (typeof(Border) == type) + ((Border)val).Clear(); + else if (typeof(Borders) == type) + ((Borders)val).ClearAll(); + else if (typeof(Shading) == type) + ((Shading)val).Clear(); + else if (typeof(TabStops) == type) + { + TabStops tabStops = (TabStops)vd.GetValue(dom, GV.ReadWrite); + tabStops.ClearAll(); + } + else + ThrowParserException(DomMsgID.NullAssignmentNotSupported, vd.ValueName); + + ReadCode(); + } + else + { + throw new Exception("Case: TopPosition"); + //dom.SetValue(vd.ValueName, docObj); + } + } + catch (Exception ex) + { + ReportParserException(ex, DomMsgID.InvalidAssignment, vd.ValueName); + } + } + + /// + /// Parses the assignment to a Value l-value. + /// + private void ParseValueAssignment(DocumentObject dom, ValueDescriptor vd) + { + try + { + // What ever it is, send it to SetValue. + dom.SetValue(vd.ValueName, Token); + } + catch (Exception ex) + { + ThrowParserException(ex, DomMsgID.InvalidEnum, _scanner.Token, vd.ValueName); + } + + ReadCode(); // read next token + } + + /// + /// Parses the assignment to a Color l-value. + /// + private void ParseColorAssignment(DocumentObject dom, ValueDescriptor vd) + { + object val = vd.GetValue(dom, GV.ReadWrite); + Color color = ParseColor(); + dom.SetValue(vd.ValueName, color); + } + + /// + /// Parses a color. It can be green, 123456, 0xFFABCDEF, + /// RGB(r, g, b), CMYK(c, m, y, k), CMYK(a, c, m, y, k), GRAY(g), or "MyColor". + /// + private Color ParseColor() + { + MoveToCode(); + Color color = Color.Empty; + if (Symbol == Symbol.Identifier) + { + switch (Token) + { + case "RGB": + color = ParseRGB(); + break; + + case "CMYK": + color = ParseCMYK(); + break; + + case "HSB": + throw new NotImplementedException("ParseColor(HSB)"); + + case "Lab": + throw new NotImplementedException("ParseColor(Lab)"); + + case "GRAY": + color = ParseGray(); + break; + + default: // Must be color enum + try + { + color = Color.Parse(Token); + ReadCode(); // read token + } + catch (Exception ex) + { + ThrowParserException(ex, DomMsgID.InvalidColor, _scanner.Token); + } + break; + } + } + else if (Symbol == Symbol.IntegerLiteral || Symbol == Symbol.HexIntegerLiteral) + { + color = new Color(_scanner.GetTokenValueAsUInt()); + ReadCode(); // read beyond literal + } + else if (Symbol == Symbol.StringLiteral) + { + throw new NotImplementedException("ParseColor(color-name)"); + } + else + ThrowParserException(DomMsgID.StringExpected, _scanner.Token); + return color; + } + + /// + /// Parses RGB(r, g, b). + /// + private Color ParseRGB() + { + uint r, g, b; + ReadCode(); // read '(' + AssertSymbol(Symbol.ParenLeft); + + ReadCode(); // read red value + AssertCondition(Symbol == Symbol.IntegerLiteral || Symbol == Symbol.HexIntegerLiteral, + DomMsgID.IntegerExpected, _scanner.Token); + r = _scanner.GetTokenValueAsUInt(); + AssertCondition(r >= 0 && r <= 255, DomMsgID.InvalidRange, "0 - 255"); + + ReadCode(); // read ',' + AssertSymbol(Symbol.Comma); + + ReadCode(); // read green value + AssertCondition(Symbol == Symbol.IntegerLiteral || Symbol == Symbol.HexIntegerLiteral, + DomMsgID.IntegerExpected, _scanner.Token); + g = _scanner.GetTokenValueAsUInt(); + AssertCondition(g >= 0 && g <= 255, DomMsgID.InvalidRange, "0 - 255"); + + ReadCode(); // read ',' + AssertSymbol(Symbol.Comma); + + ReadCode(); // read blue value + AssertCondition(Symbol == Symbol.IntegerLiteral || Symbol == Symbol.HexIntegerLiteral, + DomMsgID.IntegerExpected, _scanner.Token); + b = _scanner.GetTokenValueAsUInt(); + AssertCondition(b >= 0 && b <= 255, DomMsgID.InvalidRange, "0 - 255"); + + ReadCode(); // read ')' + AssertSymbol(Symbol.ParenRight); + + ReadCode(); // read next token + + return new Color(0xFF000000 | (r << 16) | (g << 8) | b); + } + + /// + /// Parses CMYK(c, m, y, k) or CMYK(a, c, m, y, k). + /// + private Color ParseCMYK() + { + ReadCode(); // read '(' + AssertSymbol(Symbol.ParenLeft); + + ReadCode(); // read v1 value + AssertCondition(Symbol == Symbol.IntegerLiteral || Symbol == Symbol.RealLiteral, + DomMsgID.NumberExpected, _scanner.Token); + double v1 = _scanner.GetTokenValueAsReal(); + AssertCondition(v1 >= 0.0f && v1 <= 100.0f, DomMsgID.InvalidRange, "0.0 - 100.0"); + + ReadCode(); // read ',' + AssertSymbol(Symbol.Comma); + + ReadCode(); // read v2 value + AssertCondition(Symbol == Symbol.IntegerLiteral || Symbol == Symbol.RealLiteral, + DomMsgID.NumberExpected, _scanner.Token); + double v2 = _scanner.GetTokenValueAsReal(); + AssertCondition(v2 >= 0.0f && v2 <= 100.0f, DomMsgID.InvalidRange, "0.0 - 100.0"); + + ReadCode(); // read ',' + AssertSymbol(Symbol.Comma); + + ReadCode(); // read v3 value + AssertCondition(Symbol == Symbol.IntegerLiteral || Symbol == Symbol.RealLiteral, + DomMsgID.NumberExpected, _scanner.Token); + double v3 = _scanner.GetTokenValueAsReal(); + AssertCondition(v3 >= 0.0f && v3 <= 100.0f, DomMsgID.InvalidRange, "0.0 - 100.0"); + + ReadCode(); // read ',' + AssertSymbol(Symbol.Comma); + + ReadCode(); // read v4 value + AssertCondition(Symbol == Symbol.IntegerLiteral || Symbol == Symbol.RealLiteral, + DomMsgID.NumberExpected, _scanner.Token); + double v4 = _scanner.GetTokenValueAsReal(); + AssertCondition(v4 >= 0.0f && v4 <= 100.0, DomMsgID.InvalidRange, "0.0 - 100.0"); + + ReadCode(); // read ')' or ',' + bool hasAlpha = false; + double v5 = 0; + if (Symbol == Symbol.Comma) + { + hasAlpha = true; + ReadCode(); // read v5 value + AssertCondition(Symbol == Symbol.IntegerLiteral || Symbol == Symbol.RealLiteral, + DomMsgID.NumberExpected, _scanner.Token); + v5 = _scanner.GetTokenValueAsReal(); + AssertCondition(v5 >= 0.0f && v5 <= 100.0, DomMsgID.InvalidRange, "0.0 - 100.0"); + + ReadCode(); // read ')' + } + AssertSymbol(Symbol.ParenRight); + + ReadCode(); // read next token + + double a, c, m, y, k; + if (hasAlpha) + { + a = v1; c = v2; m = v3; y = v4; k = v5; + } + else + { + a = 100.0; c = v1; m = v2; y = v3; k = v4; + } + return Color.FromCmyk(a, c, m, y, k); + } + + /// + /// Parses GRAY(g). + /// + private Color ParseGray() + { + ReadCode(); // read '(' + AssertSymbol(Symbol.ParenLeft); + + ReadCode(); // read gray value + AssertCondition(Symbol == Symbol.IntegerLiteral || Symbol == Symbol.HexIntegerLiteral, + DomMsgID.IntegerExpected, _scanner.Token); + double gray = _scanner.GetTokenValueAsReal(); + AssertCondition(gray >= 0.0f && gray <= 100.0f, DomMsgID.InvalidRange, "0.0 - 100.0"); + + ReadCode(); // read ')' + AssertSymbol(Symbol.ParenRight); + + ReadCode(); // read next token + + uint g = (uint)((1 - gray / 100.0) * 255 + 0.5); + return new Color(0xff000000 + (g << 16) + (g << 8) + g); + } + + /// + /// Determines the name/text of the given symbol. + /// + private string GetSymbolText(Symbol docSym) + { + return KeyWords.NameFromSymbol(docSym); + } + + /// + /// Returns whether the specified type is a valid SpaceType. + /// + private bool IsSpaceType(string type) + { + if (type == null) + throw new ArgumentNullException("type"); + if (type == "") + throw new ArgumentException("type"); + + if (Enum.IsDefined(typeof(SymbolName), type)) + { + SymbolName symbolName = (SymbolName)Enum.Parse(typeof(SymbolName), type, false); // symbols are case sensitive + switch (symbolName) + { + case SymbolName.Blank: + case SymbolName.Em: + //case SymbolName.Em4: // same as SymbolName.EmQuarter + case SymbolName.EmQuarter: + case SymbolName.En: + return true; + } + } + + return false; + } + + /// + /// Returns whether the specified type is a valid enum for \symbol. + /// + private bool IsSymbolType(string type) + { + if (type == null) + throw new ArgumentNullException("type"); + if (type == "") + throw new ArgumentException("type"); + + if (Enum.IsDefined(typeof(SymbolName), type)) + { + SymbolName symbolName = (SymbolName)Enum.Parse(typeof(SymbolName), type, false); // symbols are case sensitive + switch (symbolName) + { + case SymbolName.Euro: + case SymbolName.Copyright: + case SymbolName.Trademark: + case SymbolName.RegisteredTrademark: + case SymbolName.Bullet: + case SymbolName.Not: + case SymbolName.EmDash: + case SymbolName.EnDash: + case SymbolName.NonBreakableBlank: + //case SymbolName.HardBlank: //same as SymbolName.NonBreakableBlank: + return true; + } + } + + return false; + } + + /// + /// If cond is evaluated to false, a DdlParserException with the specified error will be thrown. + /// + private void AssertCondition(bool cond, DomMsgID error, params object[] args) + { + if (!cond) + ThrowParserException(error, args); + } + + /// + /// If current symbol is not equal symbol a DdlParserException will be thrown. + /// + private void AssertSymbol(Symbol symbol) + { + if (Symbol != symbol) + ThrowParserException(DomMsgID.SymbolExpected, KeyWords.NameFromSymbol(symbol), Token); + } + + /// + /// If current symbol is not equal symbol a DdlParserException with the specified message id + /// will be thrown. + /// + private void AssertSymbol(Symbol symbol, DomMsgID err) + { + if (Symbol != symbol) + ThrowParserException(err, KeyWords.NameFromSymbol(symbol), Token); + } + + /// + /// If current symbol is not equal symbol a DdlParserException with the specified message id + /// will be thrown. + /// + private void AssertSymbol(Symbol symbol, DomMsgID err, params object[] parms) + { + if (Symbol != symbol) + ThrowParserException(err, KeyWords.NameFromSymbol(symbol), parms); + } + + /// + /// Creates an ErrorInfo based on the given errorlevel, error and parms and adds it to the ErrorManager2. + /// + private void ReportParserInfo(DdlErrorLevel level, DomMsgID errorCode, params string[] parms) + { + string message = DomSR.FormatMessage(errorCode, parms); + DdlReaderError error = new DdlReaderError(level, message, (int)errorCode, + _scanner.DocumentFileName, _scanner.CurrentLine, _scanner.CurrentLinePos); + + _errors.AddError(error); + } + + /// + /// Creates an ErrorInfo based on the given error and parms and adds it to the ErrorManager2. + /// + private void ReportParserException(DomMsgID error, params string[] parms) + { + ReportParserException(null, error, parms); + } + + /// + /// Adds the ErrorInfo from the ErrorInfoException2 to the ErrorManager2. + /// + private void ReportParserException(DdlParserException ex) + { + _errors.AddError(ex.Error); + } + + /// + /// Creates an ErrorInfo based on the given inner exception, error and parms and adds it to the ErrorManager2. + /// + private void ReportParserException(Exception innerException, DomMsgID errorCode, params string[] parms) + { + string message = ""; + if (innerException != null) + message = ": " + innerException; + + message += DomSR.FormatMessage(errorCode, parms); + DdlReaderError error = new DdlReaderError(DdlErrorLevel.Error, message, (int)errorCode, + _scanner.DocumentFileName, _scanner.CurrentLine, _scanner.CurrentLinePos); + + _errors.AddError(error); + } + + /// + /// Creates an ErrorInfo based on the DomMsgID and the specified parameters. + /// Throws a DdlParserException with that ErrorInfo. + /// + private void ThrowParserException(DomMsgID errorCode, params object[] parms) + { + string message = DomSR.FormatMessage(errorCode, parms); + DdlReaderError error = new DdlReaderError(DdlErrorLevel.Error, message, (int)errorCode, + _scanner.DocumentFileName, _scanner.CurrentLine, _scanner.CurrentLinePos); + + throw new DdlParserException(error); + } + + /// + /// Determines the error message based on the DomMsgID and the parameters. + /// Throws a DdlParserException with that error message and the Exception as the inner exception. + /// + private void ThrowParserException(Exception innerException, DomMsgID errorCode, params object[] parms) + { + string message = DomSR.FormatMessage(errorCode, parms); + throw new DdlParserException(message, innerException); + } + + /// + /// Used for exception handling. Sets the DDL stream to the next valid position behind + /// the current block. + /// + private void AdjustToNextBlock() + { + bool skipClosingBraceOrBracket = (Symbol == Symbol.BraceLeft || Symbol == Symbol.BracketLeft); + ReadCode(); + + bool finish = false; + while (!finish) + { + switch (Symbol) + { + case Symbol.BraceLeft: + case Symbol.BracketLeft: + AdjustToNextBlock(); + break; + + case Symbol.BraceRight: + case Symbol.BracketRight: + if (skipClosingBraceOrBracket) + ReadCode(); + finish = true; + break; + + case Symbol.Eof: + ThrowParserException(DomMsgID.UnexpectedEndOfFile); + break; + + default: + AdjustToNextStatement(); + break; + } + } + } + + /// + /// Used for exception handling. Sets the DDL stream to the next valid position behind + /// the current statement. + /// + private void AdjustToNextStatement() + { + bool finish = false; + while (!finish) + { + switch (Symbol) + { + case Symbol.Assign: + //read one more symbol + ReadCode(); + break; + + default: + ReadCode(); + finish = true; + break; + } + } + } + + /// + /// Shortcut for scanner.ReadCode(). + /// Reads the next DDL token. Comments are ignored. + /// + private Symbol ReadCode() + { + return _scanner.ReadCode(); + } + + /// + /// Shortcut for scanner.ReadText(). + /// Reads either text or \keyword from current position. + /// + private Symbol ReadText(bool rootLevel) + { + return _scanner.ReadText(rootLevel); + } + + /// + /// Shortcut for scanner.MoveToCode(). + /// Moves to the next DDL token if Symbol is not set to a valid position. + /// + private void MoveToCode() + { + _scanner.MoveToCode(); + } + + /// + /// Shortcut for scanner.MoveToParagraphContent(). + /// Moves to the first character the content of a paragraph starts with. Empty lines + /// and comments are skipped. Returns true if such a character exists, and false if the + /// paragraph ends without content. + /// + public bool MoveToParagraphContent() + { + return _scanner.MoveToParagraphContent(); + } + + /// + /// Shortcut for scanner.MoveToNextParagraphContentLine(). + /// Moves to the first character of the content of a paragraph beyond an EOL. + /// Returns true if such a character exists and belongs to the current paragraph. + /// Returns false if a new line (at root level) or '}' occurs. If a new line caused + /// the end of the paragraph, the DDL cursor is moved to the next valid content + /// character or '}' respectively. + /// + public bool MoveToNextParagraphContentLine(bool rootLevel) + { + return _scanner.MoveToNextParagraphContentLine(rootLevel); + } + + /// + /// Gets the current symbol from the scanner. + /// + private Symbol Symbol + { + get { return _scanner.Symbol; } + } + + /// + /// Gets the current token from the scanner. + /// + private string Token + { + get { return _scanner.Token; } + } + + /// + /// Gets the current token type from the scanner. + /// + private TokenType TokenType + { + get { return _scanner.TokenType; } + } + + private readonly DdlScanner _scanner; + private readonly DdlReaderErrors _errors; + } +} \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlParserException.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlParserException.cs new file mode 100644 index 0000000..e74c50e --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlParserException.cs @@ -0,0 +1,91 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace MigraDoc.DocumentObjectModel.IO +{ + /// + /// Represents an exception used by the DDL parser. This exception will always be caught inside + /// the DDL parser. + /// + public class DdlParserException : Exception + { + /// + /// Initializes a new instance of the DdlParserException class with the specified message. + /// + public DdlParserException(string message) + : base(message) + { + _error = new DdlReaderError(DdlErrorLevel.Error, message, 0); + } + + /// + /// Initializes a new instance of the DdlParserException class with the specified message and the + /// inner exception. + /// + public DdlParserException(string message, Exception innerException) + : base(message, innerException) + { + _error = new DdlReaderError(DdlErrorLevel.Error, message, 0); + } + + /// + /// Initializes a new instance of the DdlParserException class with the specified error level, name, + /// error code and message. + /// + public DdlParserException(DdlErrorLevel level, string message, DomMsgID errorCode) + : base(message) + { + _error = new DdlReaderError(level, message, (int)errorCode); + } + + /// + /// Initializes a new instance of the DdlParserException class with the DdlReaderError. + /// + public DdlParserException(DdlReaderError error) + : base(error.ErrorMessage) + { + _error = error; + } + + /// + /// Gets the DdlReaderError. + /// + public DdlReaderError Error + { + get { return _error; } + } + + readonly DdlReaderError _error; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlReader.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlReader.cs new file mode 100644 index 0000000..14606ac --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlReader.cs @@ -0,0 +1,278 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.IO; +using System.Text; + +namespace MigraDoc.DocumentObjectModel.IO +{ + /// + /// Represents a reader that provides access to DDL data. + /// + public class DdlReader + { + /// + /// Initializes a new instance of the DdlReader class with the specified Stream. + /// + public DdlReader(Stream stream) + : this(stream, null) + { } + + /// + /// Initializes a new instance of the DdlReader class with the specified Stream and ErrorManager2. + /// + public DdlReader(Stream stream, DdlReaderErrors errors) + { + _errorManager = errors; + _reader = new StreamReader(stream); + } + + /// + /// Initializes a new instance of the DdlReader class with the specified filename. + /// + public DdlReader(string filename) + : this(filename, null) + { } + + /// + /// Initializes a new instance of the DdlReader class with the specified filename and ErrorManager2. + /// + public DdlReader(string filename, DdlReaderErrors errors) + { + _fileName = filename; + _errorManager = errors; +#if !NETFX_CORE + _reader = new StreamReader(filename, Encoding.UTF8); +#else + _reader = new StreamReader(null, Encoding.UTF8); +#endif + //#if SILVERLIGHT + // _reader = new StreamReader(filename, Encoding.UTF8); + //#else + // _reader = new StreamReader(filename, Encoding.Default); + //#endif + } + + /// + /// Initializes a new instance of the DdlReader class with the specified TextReader. + /// + public DdlReader(TextReader reader) + : this(reader, null) + { } + + /// + /// Initializes a new instance of the DdlReader class with the specified TextReader and ErrorManager2. + /// + public DdlReader(TextReader reader, DdlReaderErrors errors) + { + _doClose = false; + _errorManager = errors; + _reader = reader; + } + + /// + /// Closes the underlying stream or text writer. + /// + public void Close() + { + if (_doClose && _reader != null) + { +#if !NETFX_CORE + _reader.Close(); +#else + _reader.Dispose(); +#endif + _reader = null; + } + } + + /// + /// Reads and returns a Document from a file or a DDL string. + /// + public Document ReadDocument() + { + string ddl = _reader.ReadToEnd(); + + Document document; + if (!String.IsNullOrEmpty(_fileName)) + { + DdlParser parser = new DdlParser(_fileName, ddl, _errorManager); + document = parser.ParseDocument(null); + document._ddlFile = _fileName; + } + else + { + DdlParser parser = new DdlParser(ddl, _errorManager); + document = parser.ParseDocument(null); + } + + return document; + } + + /// + /// Reads and returns a DocumentObject from a file or a DDL string. + /// + public DocumentObject ReadObject() + { + string ddl = _reader.ReadToEnd(); + DdlParser parser = !String.IsNullOrEmpty(_fileName) ? + new DdlParser(_fileName, ddl, _errorManager) : + new DdlParser(ddl, _errorManager); + return parser.ParseDocumentObject(); + } + + /// + /// Reads and returns a Document from the specified file. + /// + public static Document DocumentFromFile(string documentFileName) //, ErrorManager2 _errorManager) + { + Document document; + DdlReader reader = null; + try + { + reader = new DdlReader(documentFileName); //, _errorManager); + document = reader.ReadDocument(); + } + finally + { + if (reader != null) + reader.Close(); + } + return document; + } + + /// + /// Reads and returns a Document from the specified DDL string. + /// + public static Document DocumentFromString(string ddl) + { + StringReader stringReader = null; + Document document; + DdlReader reader = null; + try + { + stringReader = new StringReader(ddl); + + reader = new DdlReader(stringReader); + document = reader.ReadDocument(); + } + finally + { + if (stringReader != null) + { +#if !NETFX_CORE + stringReader.Close(); +#else + stringReader.Dispose(); +#endif + } + + if (reader != null) + reader.Close(); + } + return document; + } + + /// + /// Reads and returns a domain object from the specified file. + /// + public static DocumentObject ObjectFromFile(string documentFileName, DdlReaderErrors errors) + { + DdlReader reader = null; + DocumentObject domObj; + try + { + reader = new DdlReader(documentFileName, errors); + domObj = reader.ReadObject(); + } + finally + { + if (reader != null) + reader.Close(); + } + return domObj; + } + + /// + /// Reads and returns a domain object from the specified file. + /// + public static DocumentObject ObjectFromFile(string documentFileName) + { + return ObjectFromFile(documentFileName, null); + } + + /// + /// Reads and returns a domain object from the specified DDL string. + /// + public static DocumentObject ObjectFromString(string ddl, DdlReaderErrors errors) + { + StringReader stringReader = null; + DocumentObject domObj; + DdlReader reader = null; + try + { + stringReader = new StringReader(ddl); + + reader = new DdlReader(stringReader); + domObj = reader.ReadObject(); + } + finally + { + if (stringReader != null) + { +#if !NETFX_CORE + stringReader.Close(); +#else + stringReader.Dispose(); +#endif + } + if (reader != null) + reader.Close(); + } + return domObj; + } + + /// + /// Reads and returns a domain object from the specified DDL string. + /// + public static DocumentObject ObjectFromString(string ddl) + { + return ObjectFromString(ddl, null); + } + + readonly bool _doClose = true; + TextReader _reader; + readonly DdlReaderErrors _errorManager; + readonly string _fileName; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlReaderError.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlReaderError.cs new file mode 100644 index 0000000..b166d19 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlReaderError.cs @@ -0,0 +1,130 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace MigraDoc.DocumentObjectModel.IO +{ + /// + /// Represents an error or diagnostic message reported by the DDL reader. + /// + public class DdlReaderError + { + /// + /// Initializes a new instance of the DdlReaderError class. + /// + public DdlReaderError(DdlErrorLevel errorLevel, string errorMessage, int errorNumber, + string sourceFile, int sourceLine, int sourceColumn) + { + ErrorLevel = errorLevel; + ErrorMessage = errorMessage; + ErrorNumber = errorNumber; + SourceFile = sourceFile; + SourceLine = sourceLine; + SourceColumn = sourceColumn; + } + + /// + /// Initializes a new instance of the class. + /// + public DdlReaderError(DdlErrorLevel errorLevel, string errorMessage, int errorNumber) + { + ErrorLevel = errorLevel; + ErrorMessage = errorMessage; + ErrorNumber = errorNumber; + } + + // public DdlReaderError(string errorName, DdlReaderError _level, DomMsgID _error, string message, string msg2, + // string DocumentFileName, int CurrentLine, int CurrentLinePos) + // { + // } + // + // public DdlReaderError(string errorName, int _level, string _error, string message, string adf, + // string DocumentFileName, int CurrentLine, int CurrentLinePos) + // { + // } + // + // public DdlReaderError(string errorName, DdlErrorLevel errorInfo , string _error, string message, string adf, + // string DocumentFileName, int CurrentLine, int CurrentLinePos) + // { + // } + // + // public DdlReaderError(string errorName, DdlErrorLevel errorInfo , DomMsgID _error, string message, string adf, + // string DocumentFileName, int CurrentLine, int CurrentLinePos) + // { + // } + + //public const int NoErrorNumber = -1; + + /// + /// Returns a String that represents the current DdlReaderError. + /// + public override string ToString() + { + return String.Format("[{0}({1},{2}):] {3} DDL{4}: {5}", + SourceFile, SourceLine, SourceColumn, "xxx", ErrorNumber, ErrorMessage); + } + + /// + /// Specifies the severity of this diagnostic. + /// + public readonly DdlErrorLevel ErrorLevel; + + /// + /// Specifies the diagnostic message text. + /// + public readonly string ErrorMessage; + + /// + /// Specifies the diagnostic number. + /// + public readonly int ErrorNumber; + + /// + /// Specifies the filename of the DDL text that caused the diagnostic, + /// or an empty string (""). + /// + public readonly string SourceFile; + + /// + /// Specifies the line of the DDL text that caused the diagnostic (1 based), + /// or 0 if there is no line information. + /// + public readonly int SourceLine; + + /// + /// Specifies the column of the source text that caused the diagnostic (1 based), + /// or 0 if there is no column information. + /// + public readonly int SourceColumn; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlReaderErrors.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlReaderErrors.cs new file mode 100644 index 0000000..b4fb949 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlReaderErrors.cs @@ -0,0 +1,84 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; +using System.Collections; + +namespace MigraDoc.DocumentObjectModel.IO +{ + /// + /// Used to collect errors reported by the DDL parser. + /// + public class DdlReaderErrors : IEnumerable + { + /// + /// Adds the specified DdlReaderError at the end of the error list. + /// + public void AddError(DdlReaderError error) + { + _errors.Add(error); + } + + /// + /// Gets the DdlReaderError at the specified position. + /// + public DdlReaderError this[int index] + { + get { return _errors[index]; } + } + + /// + /// Gets the number of messages that are errors. + /// + public int ErrorCount + { + get + { + int count = 0; + for (int idx = 0; idx < _errors.Count; idx++) + if (_errors[idx].ErrorLevel == DdlErrorLevel.Error) + count++; + return count; + } + } + + private readonly List _errors = new List(); + + /// + /// Returns an enumerator that iterates through the error collection. + /// + public IEnumerator GetEnumerator() + { + return _errors.GetEnumerator(); + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlScanner.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlScanner.cs new file mode 100644 index 0000000..6f240d0 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlScanner.cs @@ -0,0 +1,1565 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using System.Text; + +/* + ddl = | + + table-element: + \table attributesopt { columns-element rows-element } + + table-element: + \table attributesopt { columns-element rows-element } +*/ + +namespace MigraDoc.DocumentObjectModel.IO +{ + /// + /// DdlScanner + /// + public class DdlScanner + { + /// + /// Initializes a new instance of the DdlScanner class. + /// + public DdlScanner(string documentFileName, string ddl, DdlReaderErrors errors) + { + _errors = errors; + Init(ddl, documentFileName); + } + + /// + /// Initializes a new instance of the DdlScanner class. + /// + public DdlScanner(string ddl, DdlReaderErrors errors) + : this("", ddl, errors) + { } + + /// + /// Initializes all members and prepares the scanner. + /// + public bool Init(string document, string documentFileName) + { + _documentPath = documentFileName; + _strDocument = document; + _ddlLength = _strDocument.Length; + _idx = 0; + _idxLine = 1; + _idxLinePos = 0; + + _documentFileName = documentFileName; + + _nCurDocumentIndex = _idx; + _nCurDocumentLine = _idxLine; + _nCurDocumentLinePos = _idxLinePos; + + ScanNextChar(); + + return true; + } + + /// + /// Reads to the next DDL token. Comments are ignored. + /// + /// + /// Returns the current symbol. + /// It is Symbol.Eof if the end of the DDL string is reached. + /// + public Symbol ReadCode() + { + Again: + _symbol = Symbol.None; + TokenType = TokenType.None; + _token = ""; + + MoveToNonWhiteSpace(); + SaveCurDocumentPos(); + + if (_currChar == Chars.Null) + { + _symbol = Symbol.Eof; + return Symbol.Eof; + } + + if (IsIdentifierChar(_currChar, true)) + { + // Token is identifier. + _symbol = ScanIdentifier(); + TokenType = TokenType.Identifier; + // Some keywords do not start with a backslash: true, false, and null. + Symbol sym = KeyWords.SymbolFromName(_token); + if (sym != Symbol.None) + { + _symbol = sym; + TokenType = TokenType.KeyWord; + } + } + else if (_currChar == '"') + { + // Token is string literal. + _token += ScanStringLiteral(); + _symbol = Symbol.StringLiteral; + TokenType = TokenType.StringLiteral; + } + //NYI: else if (IsNumber()) + // symbol = ScanNumber(false); + else if (IsDigit(_currChar) || + _currChar == '-' && IsDigit(_nextChar) || + _currChar == '+' && IsDigit(_nextChar)) + { + // Token is number literal. + _symbol = ScanNumber(false); + TokenType = _symbol == Symbol.RealLiteral ? TokenType.RealLiteral : TokenType.IntegerLiteral; + } + else if (_currChar == '.' && IsDigit(_nextChar)) + { + // Token is real literal. + _symbol = ScanNumber(true); + TokenType = TokenType.RealLiteral; + } + else if (_currChar == '\\') + { + // Token is keyword. + _token = "\\"; + _symbol = ScanKeyword(); + TokenType = _symbol != Symbol.None ? TokenType.KeyWord : TokenType.None; + } + else if (_currChar == '/' && _nextChar == '/') + { + // Token is comment. In code comments are ignored. + ScanSingleLineComment(); + goto Again; + } + else if (_currChar == '@' && _nextChar == '"') + { + // Token is verbatim string literal. + ScanNextChar(); + _token += ScanVerbatimStringLiteral(); + _symbol = Symbol.StringLiteral; + TokenType = _symbol != Symbol.None ? TokenType.StringLiteral : TokenType.None; + } + else + { + // Punctuator or syntax error. + _symbol = ScanPunctuator(); + } + return _symbol; + } + + /// + /// Gets the next keyword at the current position without touching the DDL cursor. + /// + public Symbol PeekKeyword() + { + Debug.Assert(_currChar == Chars.BackSlash); + + return PeekKeyword(_idx); + } + + /// + /// Gets the next keyword without touching the DDL cursor. + /// + public Symbol PeekKeyword(int index) + { + // Check special keywords + switch (_strDocument[index]) + { + case '{': + case '}': + case '\\': + case '-': + case '(': + return Symbol.Character; + } + + string token = "\\"; + int idx = index; + int length = _ddlLength - idx; + while (length > 0) + { + char ch = _strDocument[idx++]; + if (IsLetter(ch)) + { + token += ch; + length--; + } + else + break; + } + return KeyWords.SymbolFromName(token); + } + + /// + /// Gets the next punctuator terminal symbol without touching the DDL cursor. + /// + protected Symbol PeekPunctuator(int index) + { + Symbol sym = Symbol.None; + char ch = _strDocument[index]; + switch (ch) + { + case '{': + sym = Symbol.BraceLeft; + break; + + case '}': + sym = Symbol.BraceRight; + break; + + case '[': + sym = Symbol.BracketLeft; + break; + + case ']': + sym = Symbol.BracketRight; + break; + + case '(': + sym = Symbol.ParenLeft; + break; + + case ')': + sym = Symbol.ParenRight; + break; + + case ':': + sym = Symbol.Colon; + break; + + case ';': + sym = Symbol.Semicolon; + break; + + case '.': + sym = Symbol.Dot; + break; + + case ',': + sym = Symbol.Comma; + break; + + case '%': + sym = Symbol.Percent; + break; + + case '$': + sym = Symbol.Dollar; + break; + + case '@': + sym = Symbol.At; + break; + + case '#': + sym = Symbol.Hash; + break; + + //case '?': + // sym = Symbol.Question; + // break; + + case '': + sym = Symbol.Currency; //??? used in DDL? + break; + + //case '|': + // sym = Symbol.Bar; + // break; + + case '=': + sym = Symbol.Assign; + break; + + case '/': + sym = Symbol.Slash; + break; + + case '\\': + sym = Symbol.BackSlash; + break; + + case '+': + if (_ddlLength >= index + 1 && _strDocument[index + 1] == '=') + sym = Symbol.PlusAssign; + else + sym = Symbol.Plus; + break; + + case '-': + if (_ddlLength >= index + 1 && _strDocument[index + 1] == '=') + sym = Symbol.MinusAssign; + else + sym = Symbol.Minus; + break; + + case Chars.CR: + sym = Symbol.CR; + break; + + case Chars.LF: + sym = Symbol.LF; + break; + + case Chars.Space: + sym = Symbol.Blank; + break; + + case Chars.Null: + sym = Symbol.Eof; + break; + } + return sym; + } + + /// + /// Gets the next symbol without touching the DDL cursor. + /// + public Symbol PeekSymbol() + { + int idx = _idx - 1; + int length = _ddlLength - idx; + + // Move to first non whitespace + char ch = char.MinValue; + while (length > 0) + { + ch = _strDocument[idx++]; + if (!IsWhiteSpace(ch)) + break; + length--; + } + + if (IsLetter(ch)) + return Symbol.Text; + if (ch == '\\') + return PeekKeyword(idx); + return PeekPunctuator(idx - 1); + } + + /// + /// Reads either text or \keyword from current position. + /// + public Symbol ReadText(bool rootLevel) + { + // Previous call encountered an empty line. + if (_emptyLine) + { + _emptyLine = false; + _symbol = Symbol.EmptyLine; + TokenType = TokenType.None; + _token = ""; + return Symbol.EmptyLine; + } + + // Init for scanning. + _prevSymbol = _symbol; + _symbol = Symbol.None; + TokenType = TokenType.None; + _token = ""; + + // Save where we are + SaveCurDocumentPos(); + + // Check for EOF. + if (_currChar == Chars.Null) + { + _symbol = Symbol.Eof; + return Symbol.Eof; + } + + // Check for keyword or escaped character. + if (_currChar == '\\') + { + switch (_nextChar) + { + case '\\': + case '{': + case '}': + case '/': + case '-': + return ReadPlainText(rootLevel); + } + // Either key word or syntax error. + _token = "\\"; + return ScanKeyword(); + } + + // Check for reserved terminal symbols in text. + switch (_currChar) + { + case '{': + AppendAndScanNextChar(); + _symbol = Symbol.BraceLeft; + TokenType = TokenType.OperatorOrPunctuator; + return Symbol.BraceLeft; // Syntax error in any case. + + case '}': + AppendAndScanNextChar(); + _symbol = Symbol.BraceRight; + TokenType = TokenType.OperatorOrPunctuator; + return Symbol.BraceRight; + } + + // Check for end of line. + if (_currChar == Chars.LF) + { + // The line ends here. See if the paragraph continues in the next line. + if (MoveToNextParagraphContentLine(rootLevel)) + { + // Paragraph continues in next line. Simulate the read of a blank to separate words. + _token = " "; + if (IgnoreLineBreak()) + _token = ""; + _symbol = Symbol.Text; + return Symbol.Text; + } + else + { + // Paragraph ends here. Return NewLine or BraceRight. + if (_currChar != Chars.BraceRight) + { + _symbol = Symbol.EmptyLine; + TokenType = TokenType.None; //??? + return Symbol.EmptyLine; + } + else + { + AppendAndScanNextChar(); + _symbol = Symbol.BraceRight; + TokenType = TokenType.OperatorOrPunctuator; + return Symbol.BraceRight; + } + } + } + return ReadPlainText(rootLevel); + } + + /// + /// Returns whether the linebreak should be ignored, because the previous symbol is already a whitespace. + /// + bool IgnoreLineBreak() + { + switch (_prevSymbol) + { + case Symbol.LineBreak: + case Symbol.Space: + case Symbol.Tab: + return true; + } + return false; + } + + /// + /// Read text from current position until block ends or \keyword occurs. + /// + Symbol ReadPlainText(bool rootLevel) + { + bool foundSpace = false; + bool loop = true; + while (loop && _currChar != Chars.Null) + { + // Check for escaped character or keyword. + if (_currChar == '\\') + { + switch (_nextChar) + { + case '\\': + case '{': + case '}': + case '/': + ScanNextChar(); + AppendAndScanNextChar(); + break; + + case '-': + // Treat \- as soft hyphen. + ScanNextChar(); + // Fake soft hyphen and go on as usual. + _currChar = Chars.SoftHyphen; + break; + + // Keyword + default: + loop = false; + break; + } + continue; + } + + // Check for reserved terminal symbols in text + switch (_currChar) + { + case '{': + // Syntax error any way + loop = false; + continue; + + case '}': + // Block end + loop = false; + continue; + + case '/': + if (_nextChar != '/') + goto ValidCharacter; + ScanToEol(); + break; + } + + // Check for end of line. + if (_currChar == Chars.LF) + { + // The line ends here. See if the paragraph continues in the next line. + if (MoveToNextParagraphContentLine(rootLevel)) + { + // Paragraph continues in next line. Add a blank to separate words. + if (!_token.EndsWith(" ")) + _token += ' '; + continue; + } + else + { + // Paragraph ends here. Remember that for next call except the reason + // for end is '}' + _emptyLine = _currChar != Chars.BraceRight; + break; + } + } + + ValidCharacter: + // Compress multiple blanks to one + if (_currChar == ' ') + { + if (foundSpace) + { + ScanNextChar(); + continue; + } + foundSpace = true; + } + else + foundSpace = false; + + AppendAndScanNextChar(); + } + + _symbol = Symbol.Text; + TokenType = TokenType.Text; + return Symbol.Text; + } + + /// + /// Moves to the next DDL token if Symbol is not set to a valid position. + /// + public Symbol MoveToCode() + { + if (_symbol == Symbol.None || _symbol == Symbol.CR /*|| this .symbol == Symbol.comment*/) + ReadCode(); + return _symbol; + } + + /// + /// Moves to the first character the content of a paragraph starts with. Empty lines + /// and comments are skipped. Returns true if such a character exists, and false if the + /// paragraph ends without content. + /// + public bool MoveToParagraphContent() + { + Again: + MoveToNonWhiteSpace(); + if (_currChar == Chars.Slash && _nextChar == Chars.Slash) + { + MoveBeyondEol(); + goto Again; + } + return _currChar != Chars.BraceRight; + } + + /// + /// Moves to the first character of the content of a paragraph beyond an EOL. + /// Returns true if such a character exists and belongs to the current paragraph. + /// Returns false if a new line (at root level) or '}' occurs. If a new line caused + /// the end of the paragraph, the DDL cursor is moved to the next valid content + /// character or '}' respectively. + /// + public bool MoveToNextParagraphContentLine(bool rootLevel) + { + Debug.Assert(_currChar == Chars.LF); + bool loop = true; + ScanNextChar(); + while (loop) + { + // Scan to next EOL and ignore any white space. + MoveToNonWhiteSpaceOrEol(); + switch (_currChar) + { + case Chars.Null: + loop = false; + break; + + case Chars.LF: + ScanNextChar(); // read beyond EOL + if (rootLevel) + { + // At nesting level 0 (root level) a new line ends the paragraph content. + // Move to next content block or '}' respectively. + MoveToParagraphContent(); + return false; + } + else + { + // Skip new lines at the end of the paragraph. + if (PeekSymbol() == Symbol.BraceRight) + { + MoveToNonWhiteSpace(); + return false; + } + + //TODO NiSc + //NYI + //Check.NotImplemented("empty line at non-root level"); + } + break; + + case Chars.Slash: + if (_nextChar == Chars.Slash) + { + // A line with comment is not treated as empty. + // Skip this line. + MoveBeyondEol(); + } + else + { + // Current character is a slash. + return true; + } + break; + + case Chars.BraceRight: + return false; + + default: + return true; + } + } + return false; + } + + /// + /// If the current character is not a white space, the function immediately returns it. + /// Otherwise the DDL cursor is moved forward to the first non-white space or EOF. + /// White spaces are SPACE, HT, VT, CR, and LF.??? + /// + public char MoveToNonWhiteSpaceOrEol() + { + while (_currChar != Chars.Null) + { + switch (_currChar) + { + case Chars.Space: + case Chars.HT: + case Chars.VT: + ScanNextChar(); + break; + + default: + return _currChar; + } + } + return _currChar; + } + + /// + /// If the current character is not a white space, the function immediately returns it. + /// Otherwise the DDL cursor is moved forward to the first non-white space or EOF. + /// White spaces are SPACE, HT, VT, CR, and LF. + /// + public char MoveToNonWhiteSpace() + { + while (_currChar != Chars.Null) + { + switch (_currChar) + { + case Chars.Space: + case Chars.HT: + case Chars.VT: + case Chars.CR: + case Chars.LF: + ScanNextChar(); + break; + + default: + return _currChar; + } + } + return _currChar; + } + + /// + /// Moves to the first character beyond the next EOL. + /// + public void MoveBeyondEol() + { + // Similar to ScanSingleLineComment but do not scan the token. + ScanNextChar(); + while (_currChar != Chars.Null && _currChar != Chars.LF) + ScanNextChar(); + ScanNextChar(); // read beyond EOL + } + + /// + /// Reads a single line comment. + /// + public Symbol ScanSingleLineComment() + { + char ch = ScanNextChar(); + while (ch != Chars.Null && ch != Chars.LF) + { + _token += _currChar; + ch = ScanNextChar(); + } + ScanNextChar(); // read beyond EOL + return Symbol.Comment; + } + + + /// + /// Gets the current symbol. + /// + public Symbol Symbol + { + get { return _symbol; } + } + + /// + /// Gets the current token type. + /// + public TokenType TokenType { get; private set; } = TokenType.None; + + /// + /// Gets the current token. + /// + public string Token + { + get { return _token; } + } + + /// + /// Interpret current token as integer literal. + /// + /// + public int GetTokenValueAsInt() + { + if (_symbol == Symbol.IntegerLiteral) + return Int32.Parse(_token, CultureInfo.InvariantCulture); + + if (_symbol == Symbol.HexIntegerLiteral) + { + string number = _token.Substring(2); + return Int32.Parse(number, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); + } + //TODO NiSc + //Check.Assert(false); + return 0; + } + + /// + /// Interpret current token as unsigned integer literal. + /// + /// + public uint GetTokenValueAsUInt() + { + if (_symbol == Symbol.IntegerLiteral) + return UInt32.Parse(_token, CultureInfo.InvariantCulture); + + if (_symbol == Symbol.HexIntegerLiteral) + { + string number = _token.Substring(2); + return UInt32.Parse(number, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); + } + //TODO NiSc + //Check.Assert(false); + return 0; + } + + /// + /// Interpret current token as real literal. + /// + /// + public double GetTokenValueAsReal() + { + return Double.Parse(_token, CultureInfo.InvariantCulture); + } + + /// + /// Gets the current character or EOF. + /// + public char Char + { + get { return _currChar; } + } + + /// + /// Gets the character after the current character or EOF. + /// + public char NextChar + { + get { return _nextChar; } + } + + /// + /// Move DDL cursor one character further. + /// + public char ScanNextChar() + { + if (_ddlLength <= _idx) + { + _currChar = Chars.Null; + _nextChar = Chars.Null; + } + else + { + SkipChar: + _currChar = _strDocument[_idx++]; + _nextChar = _ddlLength <= _idx ? Chars.Null : _strDocument[_idx]; + + ++_idxLinePos; + switch (_currChar) + { + case Chars.Null: //??? + ++_idxLine; + _idxLinePos = 0; + break; + + // ignore CR + case Chars.CR: + if (_nextChar == Chars.LF) + { + goto SkipChar; + } + //else + //{ + // //TODO NiSc + // //NYI: MacOS uses CR only + // //Check.NotImplemented(); + //} + break; + + case Chars.LF: + //NYI: Unix uses LF only + _idxLine++; + _idxLinePos = 0; + break; + } + } + return _currChar; + } + + /// + /// Move DDL cursor to the next EOL (or EOF). + /// + public void ScanToEol() + { + while (!IsEof(_currChar) && _currChar != Chars.LF) + ScanNextChar(); + } + + /// + /// Appends current character to the token and reads next character. + /// + public char AppendAndScanNextChar() + { + _token += _currChar; + return ScanNextChar(); + } + + /// + /// Appends all next characters to current token until end of line or end of file is reached. + /// CR/LF or EOF is not part of the token. + /// + public void AppendAndScanToEol() + { + char ch = ScanNextChar(); + while (ch != Chars.Null && ch != Chars.CR && ch != Chars.LF) //BUG Chars.Null == CharLF + { + _token += _currChar; + ch = ScanNextChar(); + } + } + + /// + /// Is character in '0' ... '9'. + /// + public static bool IsDigit(char ch) + { + return char.IsDigit(ch); + } + + /// + /// Is character a hexadecimal digit. + /// + public static bool IsHexDigit(char ch) + { + return Char.IsDigit(ch) || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f'); + } + + /// + /// Is character an octal digit. + /// + public static bool IsOctDigit(char ch) + { + return Char.IsDigit(ch) && ch < '8'; + } + + /// + /// Is character an alphabetic letter. + /// + public static bool IsLetter(char ch) + { + return Char.IsLetter(ch); + } + + /// + /// Is character a white space. + /// + public static bool IsWhiteSpace(char ch) + { + return Char.IsWhiteSpace(ch); + } + + /// + /// Is character an identifier character. First character can be letter or underscore, following + /// letters, digits or underscores. + /// + public static bool IsIdentifierChar(char ch, bool firstChar) //IsId..Char + { + if (firstChar) + return Char.IsLetter(ch) | ch == '_'; + + return Char.IsLetterOrDigit(ch) | ch == '_'; + } + + /// + /// Is character the end of file character. + /// + public static bool IsEof(char ch) + { + return ch == Chars.Null; + } + + //public bool IsNumber(); + //public bool IsFormat(); + //public bool IsParagraphFormat(Symbol* _docSym /*= null*/); + //public bool IsField(); + //public bool IsFieldSpecifier(); + //public bool IsSymbol(); + ////bool IsSymbolSpecifier(); + //public bool IsFootnote(); + //public bool IsComment(); + //public bool IsInlineShape(); + // + //public bool IsValueSymbole(); + //public bool IsScriptSymbole(Symbol _docSym); + //public bool IsParagraphToken(); + //public bool IsExtendedParagraphToken(); + //public bool IsParagraphElement(); + //public bool IsHardHyphen(); + //public bool IsNewLine(); + //public bool IsWhiteSpace(Symbol _docSym); + + /// + /// Determines whether the given symbol is a valid keyword for a document element. + /// + public static bool IsDocumentElement(Symbol symbol) + { + switch (symbol) + { + case Symbol.Paragraph: + case Symbol.Table: + case Symbol.Image: + case Symbol.TextFrame: + case Symbol.Chart: + case Symbol.PageBreak: + case Symbol.Barcode: + return true; + } + return false; + } + + /// + /// Determines whether the given symbol is a valid keyword for a section element. + /// + public static bool IsSectionElement(Symbol symbol) + { + switch (symbol) + { + case Symbol.Paragraph: + case Symbol.Table: + case Symbol.Image: + case Symbol.TextFrame: + case Symbol.Chart: + case Symbol.PageBreak: + case Symbol.Barcode: + case Symbol.Header: + case Symbol.PrimaryHeader: + case Symbol.FirstPageHeader: + case Symbol.EvenPageHeader: + case Symbol.Footer: + case Symbol.PrimaryFooter: + case Symbol.FirstPageFooter: + case Symbol.EvenPageFooter: + return true; + } + return false; + } + + /// + /// Determines whether the given symbol is a valid keyword for a paragraph element. + /// + public static bool IsParagraphElement(Symbol symbol) + { + switch (symbol) + { + case Symbol.Blank: + case Symbol.Bold: + case Symbol.Italic: + case Symbol.Underline: + case Symbol.Font: + case Symbol.FontColor: + case Symbol.FontSize: + case Symbol.Field: + case Symbol.Hyperlink: + case Symbol.Footnote: + case Symbol.Image: + case Symbol.Tab: + case Symbol.SoftHyphen: + case Symbol.Space: + case Symbol.Symbol: + case Symbol.Chr: + case Symbol.LineBreak: + case Symbol.Text: + return true; + } + return false; + } + + /// + /// Determines whether the given symbol is a valid keyword for a header or footer element. + /// + public static bool IsHeaderFooterElement(Symbol symbol) + { + // All paragraph elements. + if (IsParagraphElement(symbol)) + return true; + + // All document elements except pagebreak. + if (IsDocumentElement(symbol)) + { + if (symbol == Symbol.PageBreak) + return false; + return true; + } + + return false; + } + + /// + /// Determines whether the given symbol is a valid keyword for a footnote element. + /// + public static bool IsFootnoteElement(Symbol symbol) + { + // All paragraph elements except footnote. + if (IsParagraphElement(symbol)) + { + if (symbol == Symbol.Footnote) + return false; // BUG: ??? RETURN TRUE + return true; + } + return false; + } + + /// + /// Gets the current filename of the document. + /// + public string DocumentFileName + { + get { return _documentFileName; } + } + + /// + /// Gets the current path of the document. + /// + public string DocumentPath + { + get { return _documentPath; } + } + + /// + /// Gets the current scanner line in the document. + /// + public int CurrentLine + { + get { return _nCurDocumentLine; } + } + + /// + /// Gets the current scanner column in the document. + /// + public int CurrentLinePos + { + get { return _nCurDocumentLinePos; } + } + + /// + /// Scans an identifier. + /// + protected Symbol ScanIdentifier() + { + char ch = AppendAndScanNextChar(); + while (IsIdentifierChar(ch, false)) + ch = AppendAndScanNextChar(); + + return Symbol.Identifier; + } + + /// + /// Scans an integer or real literal. + /// + protected Symbol ScanNumber(bool mantissa) + { + char ch = _currChar; + _token += _currChar; + + ScanNextChar(); + if (!mantissa && ch == '0' && (_currChar == 'x' || _currChar == 'X')) + return ReadHexNumber(); + + while (_currChar != Chars.Null) + { + if (IsDigit(_currChar)) + AppendAndScanNextChar(); + else if (!mantissa && _currChar == Chars.Period) + { + //token += currChar; + return ScanNumber(true); + } + else //if (!IsIdentifierChar(currChar)) + break; + //else + // THROW_COMPILER_ERROR (COMPERR_LEX_NUMBER); + } + return mantissa ? Symbol.RealLiteral : Symbol.IntegerLiteral; + } + + /// + /// Scans an hexadecimal literal. + /// + protected Symbol ReadHexNumber() + { + _token = "0x"; + ScanNextChar(); + while (_currChar != Chars.Null) + { + if (IsHexDigit(_currChar)) + AppendAndScanNextChar(); + else if (!IsIdentifierChar(_currChar, false)) //??? + break; + else + //THROW_COMPILER_ERROR (COMPERR_LEX_NUMBER); + AppendAndScanNextChar(); + } + return Symbol.HexIntegerLiteral; + } + + /// + /// Scans a DDL keyword that starts with a backslash. + /// + Symbol ScanKeyword() + { + char ch = ScanNextChar(); + + // \- is a soft hyphen == char(173). + if (ch == '-') + { + _token += "-"; + ScanNextChar(); + return Symbol.SoftHyphen; + } + + // \( is a short cut for symbol. + if (ch == '(') + { + _token += "("; + _symbol = Symbol.Chr; + return Symbol.Chr; // Short cut for \chr( + } + + while (!IsEof(ch) && IsIdentifierChar(ch, false)) + ch = AppendAndScanNextChar(); + + _symbol = KeyWords.SymbolFromName(_token); + return _symbol; + } + + /// + /// Scans punctuator terminal symbols. + /// + protected Symbol ScanPunctuator() + { + Symbol sym = Symbol.None; + switch (_currChar) + { + case '{': + sym = Symbol.BraceLeft; + break; + + case '}': + sym = Symbol.BraceRight; + break; + + case '[': + sym = Symbol.BracketLeft; + break; + + case ']': + sym = Symbol.BracketRight; + break; + + case '(': + sym = Symbol.ParenLeft; + break; + + case ')': + sym = Symbol.ParenRight; + break; + + case ':': + sym = Symbol.Colon; + break; + + case ';': + sym = Symbol.Semicolon; + break; + + case '.': + sym = Symbol.Dot; + break; + + case ',': + sym = Symbol.Comma; + break; + + case '%': + sym = Symbol.Percent; + break; + + case '$': + sym = Symbol.Dollar; + break; + + case '@': + sym = Symbol.At; + break; + + case '#': + sym = Symbol.Hash; + break; + + //case '?': + // sym = Symbol.Question; + // break; + + case '': + sym = Symbol.Currency; //??? used in DDL? + break; + + //case '|': + // sym = Symbol.Bar; + // break; + + case '=': + sym = Symbol.Assign; + break; + + case '/': + sym = Symbol.Slash; + break; + + case '\\': + sym = Symbol.BackSlash; + break; + + case '+': + if (_nextChar == '=') + { + _token += _currChar; + ScanNextChar(); + sym = Symbol.PlusAssign; + } + else + sym = Symbol.Plus; + break; + + case '-': + if (_nextChar == '=') + { + _token += _currChar; + ScanNextChar(); + sym = Symbol.MinusAssign; + } + else + sym = Symbol.Minus; + break; + + case Chars.CR: + sym = Symbol.CR; + break; + + case Chars.LF: + sym = Symbol.LF; + break; + + case Chars.Space: + sym = Symbol.Blank; + break; + + case Chars.Null: + sym = Symbol.Eof; + return sym; + } + _token += _currChar; + ScanNextChar(); + return sym; + } + + // protected Symbol ReadValueIdentifier(); + ///// + ///// Scans string literals used as identifiers. + ///// + ///// + //protected string ReadRawString() //ScanStringLiteralIdentifier + //{ + // string str = ""; + // char ch = ScanNextChar(); + // while (!IsEof(ch)) + // { + // if (ch == Chars.QuoteDbl) + // { + // if (nextChar == Chars.QuoteDbl) + // { + // str += ch; + // ch = ScanNextChar(); + // } + // else + // break; + // } + // + // str += ch; + // ch = ScanNextChar(); + // } + // + // ScanNextChar(); + // return str; + //} + + + /// + /// Scans verbatim strings like @"String with ""quoted"" text". + /// + protected string ScanVerbatimStringLiteral() + { + string str = ""; + char ch = ScanNextChar(); + while (!IsEof(ch)) + { + if (ch == Chars.QuoteDbl) + { + if (_nextChar == Chars.QuoteDbl) + ch = ScanNextChar(); + else + break; + } + + str += ch; + ch = ScanNextChar(); + } + + ScanNextChar(); + return str; + } + + /// + /// Scans regular string literals like "String with \"escaped\" text". + /// + protected string ScanStringLiteral() + { + Debug.Assert(Char == '\"'); + StringBuilder str = new StringBuilder(); + ScanNextChar(); + while (_currChar != Chars.QuoteDbl && !IsEof(_currChar)) + { + if (_currChar == '\\') + { + ScanNextChar(); // read escaped characters + switch (_currChar) + { + case 'a': + str.Append('\a'); + break; + + case 'b': + str.Append('\b'); + break; + + case 'f': + str.Append('\f'); + break; + + case 'n': + str.Append('\n'); + break; + + case 'r': + str.Append('\r'); + break; + + case 't': + str.Append('\t'); + break; + + case 'v': + str.Append('\v'); + break; + + case '\'': + str.Append('\''); + break; + + case '\"': + str.Append('\"'); + break; + + case '\\': + str.Append('\\'); + break; + + case 'x': + { + ScanNextChar(); + int hexNrCount = 0; + //string hexString = "0x"; + while (IsHexDigit(_currChar)) + { + ++hexNrCount; + //hexString += _currChar; + ScanNextChar(); + } + if (hexNrCount <= 2) + str.Append("?????"); //(char)AscULongFromHexString(hexString); + else + throw new DdlParserException(DdlErrorLevel.Error, + DomSR.GetString(DomMsgID.EscapeSequenceNotAllowed), DomMsgID.EscapeSequenceNotAllowed); + } + break; + + //NYI: octal numbers + //case '0': + //{ + // ScanNextChar(); + // int hexNrCount = 0; + // string hexString = "0x"; + // while (IsOctDigit(currChar)) + // { + // ++hexNrCount; + // hexString += currChar; + // ScanNextChar(); + // } + // if (hexNrCount <=2) + // str += "?????"; //(char)AscULongFromHexString(hexString); + // else + // throw new DdlParserException(DdlErrorLevel.Error, "DdlScanner",DomMsgID.EscapeSequenceNotAllowed, null); + //} + // break; + + default: + throw new DdlParserException(DdlErrorLevel.Error, + DomSR.GetString(DomMsgID.EscapeSequenceNotAllowed), DomMsgID.EscapeSequenceNotAllowed); + } + } + else if (_currChar == Chars.Null || _currChar == Chars.CR || _currChar == Chars.LF) + throw new DdlParserException(DdlErrorLevel.Error, + DomSR.GetString(DomMsgID.NewlineInString), DomMsgID.NewlineInString); + else + str.Append(_currChar); + + ScanNextChar(); + } + ScanNextChar(); // read '"' + return str.ToString(); + } + + /// + /// Save the current scanner location in the document for error handling. + /// + void SaveCurDocumentPos() + { + _nCurDocumentIndex = _idx - 1; + _nCurDocumentLine = _idxLine; + _nCurDocumentLinePos = _idxLinePos; + } + + int _nCurDocumentIndex; + int _nCurDocumentLine; + int _nCurDocumentLinePos; + + string _documentFileName; + string _documentPath; + string _strDocument; + int _ddlLength; + int _idx; + int _idxLine; + int _idxLinePos; + + char _currChar; + char _nextChar; + string _token = ""; + Symbol _symbol = Symbol.None; + Symbol _prevSymbol = Symbol.None; + bool _emptyLine; + + DdlReaderErrors _errors; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlWriter.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlWriter.cs new file mode 100644 index 0000000..b707174 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlWriter.cs @@ -0,0 +1,311 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.IO; +using System.Text; + +namespace MigraDoc.DocumentObjectModel.IO +{ + /// + /// Represents the MigraDoc DDL writer. + /// + public class DdlWriter + { + /// + /// Initializes a new instance of the DdlWriter class with the specified Stream. + /// + public DdlWriter(Stream stream) + { + _writer = new StreamWriter(stream); + _serializer = new Serializer(_writer); + } + +#if !NETFX_CORE + /// + /// Initializes a new instance of the DdlWriter class with the specified filename. + /// + public DdlWriter(string filename) + { + _writer = new StreamWriter(filename, false, Encoding.UTF8); + _serializer = new Serializer(_writer); + } +#endif + + /// + /// Initializes a new instance of the DdlWriter class with the specified TextWriter. + /// + public DdlWriter(TextWriter writer) + { + _serializer = new Serializer(writer); + } + + /// + /// Closes the underlying serializer and text writer. + /// + public void Close() + { + _serializer = null; + + if (_writer != null) + { + _writer.Close(); + _writer = null; + } + } + + /// + /// Flushes the underlying TextWriter. + /// + public void Flush() + { + _serializer.Flush(); + } + + /// + /// Gets or sets the indentation for the DDL file. + /// + public int Indent + { + get { return _serializer.Indent; } + set { _serializer.Indent = value; } + } + + /// + /// Gets or sets the initial indentation for the DDL file. + /// + public int InitialIndent + { + get { return _serializer.InitialIndent; } + set { _serializer.InitialIndent = value; } + } + + /// + /// Writes the specified DocumentObject to DDL. + /// + public void WriteDocument(DocumentObject documentObject) + { + documentObject.Serialize(_serializer); + _serializer.Flush(); + } + + /// + /// Writes the specified DocumentObjectCollection to DDL. + /// + public void WriteDocument(DocumentObjectCollection documentObjectContainer) + { + documentObjectContainer.Serialize(_serializer); + _serializer.Flush(); + } + + /// + /// Writes a DocumentObject type object to string. + /// + public static string WriteToString(DocumentObject docObject) + { + return WriteToString(docObject, 2, 0); + } + + /// + /// Writes a DocumentObject type object to string. Indent a new block by indent characters. + /// + public static string WriteToString(DocumentObject docObject, int indent) + { + return WriteToString(docObject, indent, 0); + } + + /// + /// Writes a DocumentObject type object to string. Indent a new block by indent + initialIndent characters. + /// + public static string WriteToString(DocumentObject docObject, int indent, int initialIndent) + { + StringBuilder strBuilder = new StringBuilder(); + StringWriter writer = null; + DdlWriter wrt = null; + try + { + writer = new StringWriter(strBuilder); + + wrt = new DdlWriter(writer); + wrt.Indent = indent; + wrt.InitialIndent = initialIndent; + + wrt.WriteDocument(docObject); + wrt.Close(); + } + finally + { + if (wrt != null) + wrt.Close(); + if (writer != null) + { +#if !NETFX_CORE + writer.Close(); +#else + writer.Dispose(); +#endif + } + } + return strBuilder.ToString(); + } + + /// + /// Writes a DocumentObjectCollection type object to string. + /// + public static string WriteToString(DocumentObjectCollection docObjectContainer) + { + return WriteToString(docObjectContainer, 2, 0); + } + + /// + /// Writes a DocumentObjectCollection type object to string. Indent a new block by _indent characters. + /// + public static string WriteToString(DocumentObjectCollection docObjectContainer, int indent) + { + return WriteToString(docObjectContainer, indent, 0); + } + + /// + /// Writes a DocumentObjectCollection type object to string. Indent a new block by + /// indent + initialIndent characters. + /// + public static string WriteToString(DocumentObjectCollection docObjectContainer, int indent, int initialIndent) + { + StringBuilder strBuilder = new StringBuilder(); + StringWriter writer = null; + DdlWriter wrt = null; + try + { + writer = new StringWriter(strBuilder); + + wrt = new DdlWriter(writer); + wrt.Indent = indent; + wrt.InitialIndent = initialIndent; + + wrt.WriteDocument(docObjectContainer); + wrt.Close(); + } + finally + { + if (wrt != null) + wrt.Close(); + if (writer != null) + { +#if !NETFX_CORE + writer.Close(); +#else + writer.Dispose(); +#endif + } + } + return strBuilder.ToString(); + } + + /// + /// Writes a document object to a DDL file. + /// + public static void WriteToFile(DocumentObject docObject, string filename) + { + WriteToFile(docObject, filename, 2, 0); + } + + /// + /// Writes a document object to a DDL file. Indent a new block by the specified number of characters. + /// + public static void WriteToFile(DocumentObject docObject, string filename, int indent) + { + WriteToFile(docObject, filename, indent, 0); + } + + /// + /// Writes a DocumentObject type object to a DDL file. Indent a new block by indent + initialIndent characters. + /// + public static void WriteToFile(DocumentObject docObject, string filename, int indent, int initialIndent) + { + DdlWriter wrt = null; + try + { + wrt = new DdlWriter(filename); + wrt.Indent = indent; + wrt.InitialIndent = initialIndent; + + wrt.WriteDocument(docObject); + } + finally + { + if (wrt != null) + wrt.Close(); + } + } + + /// + /// Writes a DocumentObjectCollection type object to a DDL file. + /// + public static void WriteToFile(DocumentObjectCollection docObjectContainer, string filename) + { + WriteToFile(docObjectContainer, filename, 2, 0); + } + + /// + /// Writes a DocumentObjectCollection type object to a DDL file. Indent a new block by + /// indent + initialIndent characters. + /// + public static void WriteToFile(DocumentObjectCollection docObjectContainer, string filename, int indent) + { + WriteToFile(docObjectContainer, filename, indent, 0); + } + + /// + /// Writes a DocumentObjectCollection type object to a DDL file. Indent a new block by + /// indent + initialIndent characters. + /// + public static void WriteToFile(DocumentObjectCollection docObjectContainer, string filename, int indent, int initialIndent) + { + DdlWriter wrt = null; + try + { + wrt = new DdlWriter(filename); + wrt.Indent = indent; + wrt.InitialIndent = initialIndent; + + wrt.WriteDocument(docObjectContainer); + } + finally + { + if (wrt != null) + wrt.Close(); + } + } + + StreamWriter _writer; + Serializer _serializer; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/Symbols.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/Symbols.cs new file mode 100644 index 0000000..7a1e0f6 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/Symbols.cs @@ -0,0 +1,229 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; + +namespace MigraDoc.DocumentObjectModel.IO +{ + public class KeyWords + { + static KeyWords() + { + EnumToName.Add(Symbol.True, "true"); + EnumToName.Add(Symbol.False, "false"); + EnumToName.Add(Symbol.Null, "null"); + + EnumToName.Add(Symbol.Styles, @"\styles"); + EnumToName.Add(Symbol.Document, @"\document"); + EnumToName.Add(Symbol.Section, @"\section"); + EnumToName.Add(Symbol.Paragraph, @"\paragraph"); + EnumToName.Add(Symbol.Header, @"\header"); + EnumToName.Add(Symbol.Footer, @"\footer"); + EnumToName.Add(Symbol.PrimaryHeader, @"\primaryheader"); + EnumToName.Add(Symbol.PrimaryFooter, @"\primaryfooter"); + EnumToName.Add(Symbol.FirstPageHeader, @"\firstpageheader"); + EnumToName.Add(Symbol.FirstPageFooter, @"\firstpagefooter"); + EnumToName.Add(Symbol.EvenPageHeader, @"\evenpageheader"); + EnumToName.Add(Symbol.EvenPageFooter, @"\evenpagefooter"); + EnumToName.Add(Symbol.Table, @"\table"); + EnumToName.Add(Symbol.Columns, @"\columns"); + EnumToName.Add(Symbol.Column, @"\column"); + EnumToName.Add(Symbol.Rows, @"\rows"); + EnumToName.Add(Symbol.Row, @"\row"); + EnumToName.Add(Symbol.Cell, @"\cell"); + EnumToName.Add(Symbol.Image, @"\image"); + EnumToName.Add(Symbol.TextFrame, @"\textframe"); + EnumToName.Add(Symbol.PageBreak, @"\pagebreak"); + EnumToName.Add(Symbol.Barcode, @"\barcode"); + EnumToName.Add(Symbol.Chart, @"\chart"); + EnumToName.Add(Symbol.HeaderArea, @"\headerarea"); + EnumToName.Add(Symbol.FooterArea, @"\footerarea"); + EnumToName.Add(Symbol.TopArea, @"\toparea"); + EnumToName.Add(Symbol.BottomArea, @"\bottomarea"); + EnumToName.Add(Symbol.LeftArea, @"\leftarea"); + EnumToName.Add(Symbol.RightArea, @"\rightarea"); + EnumToName.Add(Symbol.PlotArea, @"\plotarea"); + EnumToName.Add(Symbol.Legend, @"\legend"); + EnumToName.Add(Symbol.XAxis, @"\xaxis"); + EnumToName.Add(Symbol.YAxis, @"\yaxis"); + EnumToName.Add(Symbol.ZAxis, @"\zaxis"); + EnumToName.Add(Symbol.Series, @"\series"); + EnumToName.Add(Symbol.XValues, @"\xvalues"); + EnumToName.Add(Symbol.Point, @"\point"); + + EnumToName.Add(Symbol.Bold, @"\bold"); + EnumToName.Add(Symbol.Italic, @"\italic"); + EnumToName.Add(Symbol.Underline, @"\underline"); + EnumToName.Add(Symbol.FontSize, @"\fontsize"); + EnumToName.Add(Symbol.FontColor, @"\fontcolor"); + EnumToName.Add(Symbol.Font, @"\font"); + // + EnumToName.Add(Symbol.Field, @"\field"); + EnumToName.Add(Symbol.Symbol, @"\symbol"); + EnumToName.Add(Symbol.Chr, @"\chr"); + // + EnumToName.Add(Symbol.Footnote, @"\footnote"); + EnumToName.Add(Symbol.Hyperlink, @"\hyperlink"); + // + EnumToName.Add(Symbol.SoftHyphen, @"\-"); + EnumToName.Add(Symbol.Tab, @"\tab"); + EnumToName.Add(Symbol.LineBreak, @"\linebreak"); + EnumToName.Add(Symbol.Space, @"\space"); + EnumToName.Add(Symbol.NoSpace, @"\nospace"); + + // + // + EnumToName.Add(Symbol.BraceLeft, "{"); + EnumToName.Add(Symbol.BraceRight, "}"); + EnumToName.Add(Symbol.BracketLeft, "["); + EnumToName.Add(Symbol.BracketRight, "]"); + EnumToName.Add(Symbol.ParenLeft, "("); + EnumToName.Add(Symbol.ParenRight, ")"); + EnumToName.Add(Symbol.Colon, ":"); + EnumToName.Add(Symbol.Semicolon, ";"); //??? id DDL? + EnumToName.Add(Symbol.Dot, "."); + EnumToName.Add(Symbol.Comma, ","); + EnumToName.Add(Symbol.Percent, "%"); //??? id DDL? + EnumToName.Add(Symbol.Dollar, "$"); //??? id DDL? + //enumToName.Add(Symbol.At, "@"); + EnumToName.Add(Symbol.Hash, "#"); //??? id DDL? + //enumToName.Add(Symbol.Question, "?"); //??? id DDL? + //enumToName.Add(Symbol.Bar, "|"); //??? id DDL? + EnumToName.Add(Symbol.Assign, "="); + EnumToName.Add(Symbol.Slash, "/"); //??? id DDL? + EnumToName.Add(Symbol.BackSlash, "\\"); + EnumToName.Add(Symbol.Plus, "+"); //??? id DDL? + EnumToName.Add(Symbol.PlusAssign, "+="); + EnumToName.Add(Symbol.Minus, "-"); //??? id DDL? + EnumToName.Add(Symbol.MinusAssign, "-="); + EnumToName.Add(Symbol.Blank, " "); + + //--------------------------------------------------------------- + //--------------------------------------------------------------- + //--------------------------------------------------------------- + + NameToEnum.Add("true", Symbol.True); + NameToEnum.Add("false", Symbol.False); + NameToEnum.Add("null", Symbol.Null); + // + NameToEnum.Add(@"\styles", Symbol.Styles); + NameToEnum.Add(@"\document", Symbol.Document); + NameToEnum.Add(@"\section", Symbol.Section); + NameToEnum.Add(@"\paragraph", Symbol.Paragraph); + NameToEnum.Add(@"\header", Symbol.Header); + NameToEnum.Add(@"\footer", Symbol.Footer); + NameToEnum.Add(@"\primaryheader", Symbol.PrimaryHeader); + NameToEnum.Add(@"\primaryfooter", Symbol.PrimaryFooter); + NameToEnum.Add(@"\firstpageheader", Symbol.FirstPageHeader); + NameToEnum.Add(@"\firstpagefooter", Symbol.FirstPageFooter); + NameToEnum.Add(@"\evenpageheader", Symbol.EvenPageHeader); + NameToEnum.Add(@"\evenpagefooter", Symbol.EvenPageFooter); + NameToEnum.Add(@"\table", Symbol.Table); + NameToEnum.Add(@"\columns", Symbol.Columns); + NameToEnum.Add(@"\column", Symbol.Column); + NameToEnum.Add(@"\rows", Symbol.Rows); + NameToEnum.Add(@"\row", Symbol.Row); + NameToEnum.Add(@"\cell", Symbol.Cell); + NameToEnum.Add(@"\image", Symbol.Image); + NameToEnum.Add(@"\textframe", Symbol.TextFrame); + NameToEnum.Add(@"\pagebreak", Symbol.PageBreak); + NameToEnum.Add(@"\barcode", Symbol.Barcode); + NameToEnum.Add(@"\chart", Symbol.Chart); + NameToEnum.Add(@"\headerarea", Symbol.HeaderArea); + NameToEnum.Add(@"\footerarea", Symbol.FooterArea); + NameToEnum.Add(@"\toparea", Symbol.TopArea); + NameToEnum.Add(@"\bottomarea", Symbol.BottomArea); + NameToEnum.Add(@"\leftarea", Symbol.LeftArea); + NameToEnum.Add(@"\rightarea", Symbol.RightArea); + NameToEnum.Add(@"\plotarea", Symbol.PlotArea); + NameToEnum.Add(@"\legend", Symbol.Legend); + NameToEnum.Add(@"\xaxis", Symbol.XAxis); + NameToEnum.Add(@"\yaxis", Symbol.YAxis); + NameToEnum.Add(@"\zaxis", Symbol.ZAxis); + NameToEnum.Add(@"\series", Symbol.Series); + NameToEnum.Add(@"\xvalues", Symbol.XValues); + NameToEnum.Add(@"\point", Symbol.Point); + NameToEnum.Add(@"\bold", Symbol.Bold); + NameToEnum.Add(@"\italic", Symbol.Italic); + NameToEnum.Add(@"\underline", Symbol.Underline); + NameToEnum.Add(@"\fontsize", Symbol.FontSize); + NameToEnum.Add(@"\fontcolor", Symbol.FontColor); + NameToEnum.Add(@"\font", Symbol.Font); + // + NameToEnum.Add(@"\field", Symbol.Field); + NameToEnum.Add(@"\symbol", Symbol.Symbol); + NameToEnum.Add(@"\chr", Symbol.Chr); + // + NameToEnum.Add(@"\footnote", Symbol.Footnote); + NameToEnum.Add(@"\hyperlink", Symbol.Hyperlink); + // + NameToEnum.Add(@"\-", Symbol.SoftHyphen); //??? \( is another special case. + NameToEnum.Add(@"\tab", Symbol.Tab); + NameToEnum.Add(@"\linebreak", Symbol.LineBreak); + NameToEnum.Add(@"\space", Symbol.Space); + NameToEnum.Add(@"\nospace", Symbol.NoSpace); + } + + /// + /// Returns Symbol value from name, or Symbol.None if no such Symbol exists. + /// + public static Symbol SymbolFromName(string name) + { + Symbol symbol; + if (!NameToEnum.TryGetValue(name, out symbol)) + { + // Check for case sensitive keywords. Allow first character upper case only. + if (string.Compare(name, "True", StringComparison.OrdinalIgnoreCase) == 0) + symbol = Symbol.True; + else if (string.Compare(name, "False", StringComparison.OrdinalIgnoreCase) == 0) + symbol = Symbol.False; + else if (string.Compare(name, "Null", StringComparison.OrdinalIgnoreCase) == 0) + symbol = Symbol.Null; + else + symbol = Symbol.None; + } + return symbol; + } + + /// + /// Returns string from Symbol value. + /// + public static string NameFromSymbol(Symbol symbol) + { + return EnumToName[symbol]; + } + + static readonly Dictionary EnumToName = new Dictionary(); + static readonly Dictionary NameToEnum = new Dictionary(); + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/enums/DdlErrorLevel.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/enums/DdlErrorLevel.cs new file mode 100644 index 0000000..8734a82 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/enums/DdlErrorLevel.cs @@ -0,0 +1,60 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.IO +{ + /// + /// Specifies the severity of a DDL reader diagnostic. + /// + public enum DdlErrorLevel + { + /// + /// An unknown severity. + /// + None, + + /// + /// An information diagnostic. + /// + Info, + + /// + /// A warning or suggestive diagnostic. + /// + Warning, + + /// + /// An error diagnostic. + /// + Error, + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/enums/Symbol.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/enums/Symbol.cs new file mode 100644 index 0000000..eab59de --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/enums/Symbol.cs @@ -0,0 +1,177 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.IO +{ + /// + /// The symbols used by DdlScanner/DdlParser. + /// + public enum Symbol + { + // TokenType.None + None, + Eof, + Eol, // End of line + // TokenType.Keyword + True, + False, + Null, + + // TokenType.Identifier + Identifier, + Comment, + + // TokenType.IntegerLiteral + IntegerLiteral, + HexIntegerLiteral, + OctIntegerLiteral, + + // TokenType.StringLiteral + StringLiteral, + + // TokenType.RealLiteral + RealLiteral, + + // TokenType.OperatorOrPunctuator + Slash, // / + BackSlash, // \ + ParenLeft, // ( + ParenRight, // ) + BraceLeft, // { + BraceRight, // } + BracketLeft, // [ + BracketRight, // ] + EmptyLine, //CR LF CR LF + Colon, // : + Semicolon, // ; + Assign, // = + Plus, // + + Minus, // - + Dot, // . + Comma, // , + Percent, // % + Dollar, // $ + Hash, // # + Currency, // + //Questionmark, // ? + Quotationmark, // " + At, // @ + //Bar, // | + PlusAssign, // += + MinusAssign, // -= + CR, // 0x0D + LF, // 0x0A + + // TokenType.Keyword + Styles, + Document, + Section, + TableTemplates, + TableTemplate, + Paragraph, + HeaderOrFooter, // Only used as context in ParseDocumentElements + Header, + PrimaryHeader, + FirstPageHeader, + EvenPageHeader, + Footer, + PrimaryFooter, + FirstPageFooter, + EvenPageFooter, + Table, + Columns, + Column, + Rows, + Row, + Cell, + Image, + TextFrame, + Chart, + Footnote, + PageBreak, + Barcode, + + // Diagramms + HeaderArea, + FooterArea, + TopArea, + BottomArea, + LeftArea, + RightArea, + PlotArea, + Legend, + XAxis, + YAxis, + ZAxis, + Series, + XValues, + Point, + + // paragraph formats + Bold, + Italic, + Underline, + FontSize, + FontColor, + Font, + + // Hyperlink used by ParagraphParser + Hyperlink, + + // Token used by ParagraphParser + Text, // Plain text in a paragraph. + Blank, + Tab, + NonBreakeableBlank, + SoftHyphen, + LineBreak, + Space, + NoSpace, + + // Field used by ParagraphParser + Field, + + // Field types used by ParagraphParser + DateField, + PageField, + NumPagesField, + InfoField, + SectionField, + SectionPagesField, + BookmarkField, + PageRefField, + + Character, //??? + Symbol, + Chr + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/enums/TokenType.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/enums/TokenType.cs new file mode 100644 index 0000000..0ab2d81 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/enums/TokenType.cs @@ -0,0 +1,85 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.IO +{ + /// + /// The tokens used by DdlScanner/DdlParser. + /// + public enum TokenType + { + /// + /// White space or comment. + /// + None, + + /// + /// Same as identifiers in C#, but not case sensitive. + /// + Identifier, + + /// + /// Both true and \bold are keywords, case sensitive. + /// + KeyWord, + + /// + /// Sample: 42 + /// + IntegerLiteral, + + /// + /// Samples: 42.0, 42., .42,... + /// + RealLiteral, + + /// + /// Not used. + /// + CharacterLiteral, + + /// + /// Both "text" and @"text with ""quotes""". + /// + StringLiteral, + + /// + /// Samples: ., {, +=,... + /// + OperatorOrPunctuator, + + /// + /// Plain text. Possible after ReadText. + /// + Text, + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/DVAttribute.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/DVAttribute.cs new file mode 100644 index 0000000..32e703e --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/DVAttribute.cs @@ -0,0 +1,75 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +// ReSharper disable InconsistentNaming + +namespace MigraDoc.DocumentObjectModel.publics +{ + /// + /// Indicates that this field can be accessed via SetValue and GetValue. + /// + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class DVAttribute : Attribute + { + /// + /// Initializes a new instance of the DVAttribute class. + /// + public DVAttribute() + { + RefOnly = false; + ItemType = null; + } + + /// + /// Gets or sets the type of the reflected value. Must be specified by NEnum. + /// + public Type Type + { + get { return _type; } + set { _type = value; } + } + Type _type; + + /// + /// Determines whether the field is RefOnly and should be excluded from recursive operations. + /// + public bool RefOnly; + + // TODO: Check type in value descriptor + /// + /// Describes the type of the elements a collection contains. + /// + public Type ItemType; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/DomValueDescriptorCollection.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/DomValueDescriptorCollection.cs new file mode 100644 index 0000000..bb902d4 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/DomValueDescriptorCollection.cs @@ -0,0 +1,91 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace MigraDoc.DocumentObjectModel.publics +{ + /// + /// A collection that manages ValueDescriptors. + /// + public class ValueDescriptorCollection : IEnumerable + { + /// + /// Gets the count of ValueDescriptors. + /// + public int Count + { + get { return _list.Count; } + } + + /// + /// Adds the specified ValueDescriptor. + /// + public void Add(ValueDescriptor vd) + { + _dictionary.Add(vd.ValueName, vd); + _list.Add(vd); + } + + /// + /// Gets the at the specified index. + /// + public ValueDescriptor this[int index] + { + get { return _list[index]; } + } + + /// + /// Gets the with the specified name. + /// + public ValueDescriptor this[string name] + { + get { return _dictionary[name]; } + } + + /// + /// Returns an enumerator that iterates through a collection. + /// + /// + /// An object that can be used to iterate through the collection. + /// + public IEnumerator GetEnumerator() + { + return _list.GetEnumerator(); + } + + readonly List _list = new List(); + readonly Dictionary _dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase); + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/INullableValue.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/INullableValue.cs new file mode 100644 index 0000000..08fd974 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/INullableValue.cs @@ -0,0 +1,45 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.publics +{ + /// + /// Interface for simple nullable values like NInt, NString etc. + /// + public interface INullableValue + { + object GetValue(); + void SetValue(object value); + void SetNull(); + bool IsNull { get; } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/Meta.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/Meta.cs new file mode 100644 index 0000000..97460e7 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/Meta.cs @@ -0,0 +1,282 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Reflection; + +namespace MigraDoc.DocumentObjectModel.publics +{ + /// + /// Meta class for document objects. + /// + public sealed class Meta + { + /// + /// Initializes a new instance of the DomMeta class. + /// + public Meta(Type documentObjectType) + { + AddValueDescriptors(this, documentObjectType); + } + + /// + /// Gets the meta object of the specified document object. + /// + /// The document object the meta is returned for. + public static Meta GetMeta(DocumentObject documentObject) + { + return documentObject.Meta; + } + + /// + /// Gets the object specified by name from dom. + /// + public object GetValue(DocumentObject dom, string name, GV flags) + { + int dot = name.IndexOf('.'); + if (dot == 0) + throw new ArgumentException(DomSR.InvalidValueName(name)); + string trail = null; + if (dot > 0) + { + trail = name.Substring(dot + 1); + name = name.Substring(0, dot); + } + ValueDescriptor vd = _vds[name]; + if (vd == null) + throw new ArgumentException(DomSR.InvalidValueName(name)); + + object value = vd.GetValue(dom, flags); + if (value == null && flags == GV.GetNull) //??? also for GV.ReadOnly? + return null; + + //REVIEW DaSt: Create object in case of GV.ReadWrite? + if (trail != null) + { + if (value == null || trail == "") + throw new ArgumentException(DomSR.InvalidValueName(name)); + DocumentObject doc = value as DocumentObject; + if (doc == null) + throw new ArgumentException(DomSR.InvalidValueName(name)); + value = doc.GetValue(trail, flags); + } + return value; + } + + /// + /// Sets the member of dom specified by name to val. + /// If a member with the specified name does not exist an ArgumentException will be thrown. + /// + public void SetValue(DocumentObject dom, string name, object val) + { + int dot = name.IndexOf('.'); + if (dot == 0) + throw new ArgumentException(DomSR.InvalidValueName(name)); + string trail = null; + if (dot > 0) + { + trail = name.Substring(dot + 1); + name = name.Substring(0, dot); + } + ValueDescriptor vd = _vds[name]; + if (vd == null) + throw new ArgumentException(DomSR.InvalidValueName(name)); + + if (trail != null) + { + //REVIEW DaSt: dom.GetValue(name) and call SetValue recursively, + // or dom.GetValue(name.BisVorletzteElement) and then call SetValue? + DocumentObject doc = (DocumentObject)dom.GetValue(name); + doc.SetValue(trail, val); + } + else + vd.SetValue(dom, val); + } + + /// + /// Determines whether this meta contains a value with the specified name. + /// + public bool HasValue(string name) + { + ValueDescriptor vd = _vds[name]; + return vd != null; + } + + /// + /// Sets the member of dom specified by name to null. + /// If a member with the specified name does not exist an ArgumentException will be thrown. + /// + public void SetNull(DocumentObject dom, string name) + { + ValueDescriptor vd = _vds[name]; + if (vd == null) + throw new ArgumentException(DomSR.InvalidValueName(name)); + + vd.SetNull(dom); + } + + /// + /// Determines whether the member of dom specified by name is null. + /// If a member with the specified name does not exist an ArgumentException will be thrown. + /// + public /* not virtual */ bool IsNull(DocumentObject dom, string name) + { + //bool isNull = false; + int dot = name.IndexOf('.'); + if (dot == 0) + throw new ArgumentException(DomSR.InvalidValueName(name)); + string trail = null; + if (dot > 0) + { + trail = name.Substring(dot + 1); + name = name.Substring(0, dot); + } + ValueDescriptor vd = _vds[name]; + if (vd == null) + throw new ArgumentException(DomSR.InvalidValueName(name)); + + if (vd is NullableDescriptor || vd is ValueTypeDescriptor) + { + if (trail != null) + throw new ArgumentException(DomSR.InvalidValueName(name)); + return vd.IsNull(dom); + } + DocumentObject docObj = (DocumentObject)vd.GetValue(dom, GV.ReadOnly); + if (docObj == null) + return true; + if (trail != null) + return docObj.IsNull(trail); + return docObj.IsNull(); + + // DomValueDescriptor vd = vds[name]; + // if (vd == null) + // throw new ArgumentException(DomSR.InvalidValueName(name)); + // + // return vd.IsNull(dom); + } + + /// + /// Sets all members of the specified dom to null. + /// + public /*virtual*/ void SetNull(DocumentObject dom) + { + int count = _vds.Count; + for (int index = 0; index < count; index++) + { + if (!_vds[index].IsRefOnly) + _vds[index].SetNull(dom); + } + } + + /// + /// Determines whether all members of the specified dom are null. If dom contains no members IsNull + /// returns true. + /// + public bool IsNull(DocumentObject dom) + { + int count = _vds.Count; + for (int index = 0; index < count; index++) + { + ValueDescriptor vd = _vds[index]; + if (vd.IsRefOnly) + continue; + if (!vd.IsNull(dom)) + return false; + } + return true; + } + + /// + /// Gets the DomValueDescriptor of the member specified by name from the DocumentObject. + /// + public ValueDescriptor this[string name] + { + get { return _vds[name]; } + } + + /// + /// Gets the DomValueDescriptorCollection of the DocumentObject. + /// + public ValueDescriptorCollection ValueDescriptors + { + get { return _vds; } + } + + readonly ValueDescriptorCollection _vds = new ValueDescriptorCollection(); + + /// + /// Adds a value descriptor for each field and property found in type to meta. + /// + static void AddValueDescriptors(Meta meta, Type type) + { +#if !NETFX_CORE + FieldInfo[] fieldInfos = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); +#else + var fieldInfos = type.GetTypeInfo().DeclaredFields; +#endif + foreach (FieldInfo fieldInfo in fieldInfos) + { +#if DEBUG_ + string name = fieldInfo.Name; + if (name == "parent") + name.GetType(); +#endif + DVAttribute[] dvs = (DVAttribute[])fieldInfo.GetCustomAttributes(typeof(DVAttribute), false); + if (dvs.Length == 1) + { + ValueDescriptor vd = ValueDescriptor.CreateValueDescriptor(fieldInfo, dvs[0]); + meta.ValueDescriptors.Add(vd); + } + } + +#if !NETFX_CORE + PropertyInfo[] propInfos = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); +#else + var propInfos = type.GetTypeInfo().DeclaredProperties; +#endif + foreach (PropertyInfo propInfo in propInfos) + { +#if DEBUG_ + string name = propInfo.Name; + if (name == "Font") + name.GetType(); +#endif + DVAttribute[] dvs = (DVAttribute[])propInfo.GetCustomAttributes(typeof(DVAttribute), false); + if (dvs.Length == 1) + { + ValueDescriptor vd = ValueDescriptor.CreateValueDescriptor(propInfo, dvs[0]); + meta.ValueDescriptors.Add(vd); + } + } + } + } +} \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NBool.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NBool.cs new file mode 100644 index 0000000..1deffc1 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NBool.cs @@ -0,0 +1,128 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.publics +{ + /// + /// Represents a nullable boolean value. + /// + public struct NBool : INullableValue + { + public NBool(bool value) + { + _value = value ? (sbyte)1 : (sbyte)0; + } + + NBool(sbyte value) + { + _value = value; + } + + /// + /// Gets or sets the value of the instance. + /// + public bool Value + { + get { return _value == 1; } + set { _value = value ? (sbyte)1 : (sbyte)0; } + } + + /// + /// Gets the value of the instance. + /// + object INullableValue.GetValue() + { + return Value; + } + + /// + /// Sets the value of the instance. + /// + void INullableValue.SetValue(object value) + { + _value = (bool)value ? (sbyte)1 : (sbyte)0; + } + + /// + /// Resets this instance, + /// i.e. IsNull() will return true afterwards. + /// + public void SetNull() + { + _value = -1; + } + + /// + /// Determines whether this instance is null (not set). + /// + public bool IsNull + { + get { return _value == -1; } + } + + /// + /// Returns a value indicating whether this instance is equal to the specified object. + /// + public override bool Equals(object value) + { + if (value is NBool) + return this == (NBool)value; + return false; + } + + public override int GetHashCode() + { + return _value.GetHashCode(); + } + + public static bool operator ==(NBool l, NBool r) + { + if (l.IsNull) + return r.IsNull; + if (r.IsNull) + return false; + return l.Value == r.Value; + } + + public static bool operator !=(NBool l, NBool r) + { + return !(l == r); + } + + public static readonly NBool NullValue = new NBool(-1); + + /// + /// -1 (undefined), 0 (false), or 1 (true). + /// + sbyte _value; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NDouble.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NDouble.cs new file mode 100644 index 0000000..bff7872 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NDouble.cs @@ -0,0 +1,120 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.publics +{ + /// + /// Represents a nullable double value. + /// + public struct NDouble : INullableValue + { + public NDouble(double value) + { + _value = value; + } + + /// + /// Gets or sets the value of the instance. + /// + public double Value + { + get { return double.IsNaN(_value) ? 0 : _value; } + set { _value = value; } + } + + /// + /// Gets the value of the instance. + /// + object INullableValue.GetValue() + { + return Value; + } + + /// + /// Sets the value of the instance. + /// + void INullableValue.SetValue(object value) + { + _value = (double)value; + } + + /// + /// Resets this instance, + /// i.e. IsNull() will return true afterwards. + /// + public void SetNull() + { + _value = double.NaN; + } + + /// + /// Determines whether this instance is null (not set). + /// + public bool IsNull + { + get { return double.IsNaN(_value); } + } + + /// + /// Returns a value indicating whether this instance is equal to the specified object. + /// + public override bool Equals(object value) + { + if (value is NDouble) + return this == (NDouble)value; + return false; + } + + public override int GetHashCode() + { + return _value.GetHashCode(); + } + + public static bool operator ==(NDouble l, NDouble r) + { + if (l.IsNull) + return r.IsNull; + if (r.IsNull) + return false; + return l.Value == r.Value; + } + + public static bool operator !=(NDouble l, NDouble r) + { + return !(l == r); + } + + public static readonly NDouble NullValue = new NDouble(double.NaN); + + double _value; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NEnum.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NEnum.cs new file mode 100644 index 0000000..d97bb70 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NEnum.cs @@ -0,0 +1,158 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace MigraDoc.DocumentObjectModel.publics +{ + /// + /// Represents a nullable Enum value. + /// + public struct NEnum : INullableValue + { + public NEnum(int val, Type type) + { + _type = type; + _value = val; + } + + NEnum(int value) + { + _type = null; + _value = value; + } + + public Type Type + { + get { return _type; } + set { _type = value; } + } + Type _type; + + public int Value + { + get { return _value != int.MinValue ? _value : 0; } + set + { + // TODO Remove German remarks! + //TODO: Klasse Character so ndern, dass symbolName und char in unterschiedlichen Feldern gespeichert werden. + //Diese Spezialbehandlung entfllt dann. + if (_type == typeof(SymbolName)) + { + // if (Enum.IsDefined(this .type, (uint)value)) + _value = value; + // else + // throw new ArgumentOutOfRangeException("value"); + } + else + { + if (Enum.IsDefined(_type, value)) + _value = value; + else + throw new /*InvalidEnum*/ArgumentException(DomSR.InvalidEnumValue(value), "value"); + + } + } + } + + object INullableValue.GetValue() + { + return ToObject(); + } + + void INullableValue.SetValue(object value) + { + _value = (int)value; + } + + public void SetNull() + { + _value = int.MinValue; + } + + /// + /// Determines whether this instance is null (not set). + /// + public bool IsNull + { + get { return _value == int.MinValue; } + } + + public object ToObject() + { + if (_value != int.MinValue) + return Enum.ToObject(_type, _value); + // BUG Have all enum 0 as valid value? + return Enum.ToObject(_type, 0); + } + + //public static readonly NEnum NullValue = new NEnum(int.MinValue); + + /// + /// Returns a value indicating whether this instance is equal to the specified object. + /// + public override bool Equals(object value) + { + if (value is NEnum) + return this == (NEnum)value; + return false; + } + + public override int GetHashCode() + { + return _value.GetHashCode(); + } + + public static bool operator ==(NEnum l, NEnum r) + { + if (l.IsNull) + return r.IsNull; + if (r.IsNull) + return false; + if (l._type == r._type) + return l.Value == r.Value; + return false; + } + + public static bool operator !=(NEnum l, NEnum r) + { + return !(l == r); + } + + public static NEnum NullValue(Type fieldType) + { + return new NEnum(int.MinValue, fieldType); + } + + int _value; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NInt.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NInt.cs new file mode 100644 index 0000000..720f82a --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NInt.cs @@ -0,0 +1,130 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.publics +{ + /// + /// Represents a nullable integer value. + /// + public struct NInt : INullableValue + { + public NInt(int val) + { + _value = val; + } + + /// + /// Gets or sets the value of the instance. + /// + public int Value + { + get { return _value != int.MinValue ? _value : 0; } + set { _value = value; } + } + + /// + /// Gets the value of the instance. + /// + object INullableValue.GetValue() + { + return Value; + } + + /// + /// Sets the value of the instance. + /// + void INullableValue.SetValue(object value) + { + _value = (int)value; + } + + /// + /// Resets this instance, + /// i.e. IsNull() will return true afterwards. + /// + public void SetNull() + { + _value = int.MinValue; + } + + /// + /// Determines whether this instance is null (not set). + /// + public bool IsNull + { + get { return _value == int.MinValue; } + } + + public static implicit operator NInt(int val) + { + return new NInt(val); + } + + public static implicit operator int(NInt val) + { + return val.Value; + } + + /// + /// Returns a value indicating whether this instance is equal to the specified object. + /// + public override bool Equals(object value) + { + if (value is NInt) + return this == (NInt)value; + return false; + } + + public override int GetHashCode() + { + return _value.GetHashCode(); + } + + public static bool operator ==(NInt l, NInt r) + { + if (l.IsNull) + return r.IsNull; + if (r.IsNull) + return false; + return l.Value == r.Value; + } + + public static bool operator !=(NInt l, NInt r) + { + return !(l == r); + } + + public static readonly NInt NullValue = new NInt(int.MinValue); + + int _value; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NString.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NString.cs new file mode 100644 index 0000000..4d316ae --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/NString.cs @@ -0,0 +1,117 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace MigraDoc.DocumentObjectModel.publics +{ + /// + /// Represents a nullable string value. + /// + public struct NString : INullableValue + { + /// + /// Gets or sets the value of the instance. + /// + public string Value + { + get { return _value ?? String.Empty; } + set { _value = value; } + } + + /// + /// Returns the value of the instance. + /// + object INullableValue.GetValue() + { + return Value; + } + + /// + /// Sets the value of the instance. + /// + void INullableValue.SetValue(object value) + { + _value = (String)value; + } + + /// + /// Resets this instance, + /// i.e. IsNull() will return true afterwards. + /// + public void SetNull() + { + _value = null; + } + + /// + /// Determines whether this instance is null (not set). + /// + public bool IsNull + { + get { return _value == null; } + } + + /// + /// Returns a value indicating whether this instance is equal to the specified object. + /// + public override bool Equals(object value) + { + if (value is NString) + return this == (NString)value; + return false; + } + + public override int GetHashCode() + { + return _value == null ? 0 : _value.GetHashCode(); + } + + public static bool operator ==(NString l, NString r) + { + if (l.IsNull) + return r.IsNull; + if (r.IsNull) + return false; + return l.Value == r.Value; + } + + public static bool operator !=(NString l, NString r) + { + return !(l == r); + } + + public static readonly NString NullValue = new NString(); + + string _value; + } +} \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/ValueDescriptor.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/ValueDescriptor.cs new file mode 100644 index 0000000..2f21e09 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/ValueDescriptor.cs @@ -0,0 +1,521 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Reflection; + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel.publics +{ + /// + /// Base class of all value descriptor classes. + /// + public abstract class ValueDescriptor + { + public ValueDescriptor(string valueName, Type valueType, Type memberType, MemberInfo memberInfo, VDFlags flags) + { + // Take new naming convention into account. + if (valueName.StartsWith("_")) + valueName = valueName.Substring(1); + + ValueName = valueName; + ValueType = valueType; + MemberType = memberType; + MemberInfo = memberInfo; + _flags = flags; + } + + public object CreateValue() + { +#if !NETFX_CORE + ConstructorInfo constructorInfo = ValueType.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); +#else + var constructorInfos = ValueType.GetTypeInfo().DeclaredConstructors; + ConstructorInfo constructorInfo = null; + foreach (var info in constructorInfos) + { + if (info.GetParameters().Length == 0) + constructorInfo = info; + } +#endif + Debug.Assert(constructorInfo != null); + return constructorInfo.Invoke(null); + } + + public abstract object GetValue(DocumentObject dom, GV flags); + public abstract void SetValue(DocumentObject dom, object val); + public abstract void SetNull(DocumentObject dom); + public abstract bool IsNull(DocumentObject dom); + + public static ValueDescriptor CreateValueDescriptor(MemberInfo memberInfo, DVAttribute attr) + { + VDFlags flags = VDFlags.None; + if (attr.RefOnly) + flags |= VDFlags.RefOnly; + + string name = memberInfo.Name; + + FieldInfo fieldInfo = memberInfo as FieldInfo; + Type type = fieldInfo != null ? fieldInfo.FieldType : ((PropertyInfo)memberInfo).PropertyType; + + if (type == typeof(NBool)) + return new NullableDescriptor(name, typeof(Boolean), type, memberInfo, flags); + + if (type == typeof(NInt)) + return new NullableDescriptor(name, typeof(Int32), type, memberInfo, flags); + + if (type == typeof(NDouble)) + return new NullableDescriptor(name, typeof(Double), type, memberInfo, flags); + + if (type == typeof(NString)) + return new NullableDescriptor(name, typeof(String), type, memberInfo, flags); + + if (type == typeof(String)) + return new ValueTypeDescriptor(name, typeof(String), type, memberInfo, flags); + + if (type == typeof(NEnum)) + { + Type valueType = attr.Type; +#if !NETFX_CORE + Debug.Assert(valueType.IsSubclassOf(typeof(Enum)), "NEnum must have 'Type' attribute with the underlying type"); +#else + Debug.Assert(valueType.GetTypeInfo().IsSubclassOf(typeof(Enum)), "NEnum must have 'Type' attribute with the underlying type"); +#endif + return new NullableDescriptor(name, valueType, type, memberInfo, flags); + } + +#if !NETFX_CORE + if (type.IsSubclassOf(typeof(ValueType))) +#else + if (type.GetTypeInfo().IsSubclassOf(typeof(ValueType))) +#endif + return new ValueTypeDescriptor(name, type, type, memberInfo, flags); + +#if !NETFX_CORE + if (typeof(DocumentObjectCollection).IsAssignableFrom(type)) +#else + if (typeof(DocumentObjectCollection).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())) +#endif + return new DocumentObjectCollectionDescriptor(name, type, type, memberInfo, flags); + +#if !NETFX_CORE + if (typeof(DocumentObject).IsAssignableFrom(type)) +#else + if (typeof(DocumentObject).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())) +#endif + return new DocumentObjectDescriptor(name, type, type, memberInfo, flags); + + Debug.Assert(false, type.FullName); + return null; + } + + public bool IsRefOnly + { + get { return (_flags & VDFlags.RefOnly) == VDFlags.RefOnly; } + } + + public FieldInfo FieldInfo + { + get { return MemberInfo as FieldInfo; } + } + + public PropertyInfo PropertyInfo + { + get { return MemberInfo as PropertyInfo; } + } + + /// + /// Name of the value. + /// + public readonly string ValueName; + + /// + /// Type of the described value, e.g. typeof(Int32) for an NInt. + /// + public readonly Type ValueType; + + /// + /// Type of the described field or property, e.g. typeof(NInt) for an NInt. + /// + public readonly Type MemberType; + + /// + /// FieldInfo of the described field. + /// + public readonly MemberInfo MemberInfo; + + /// + /// Flags of the described field, e.g. RefOnly. + /// + readonly VDFlags _flags; + } + + /// + /// Value descriptor of all nullable types. + /// + public class NullableDescriptor : ValueDescriptor + { + public NullableDescriptor(string valueName, Type valueType, Type fieldType, MemberInfo memberInfo, VDFlags flags) + : base(valueName, valueType, fieldType, memberInfo, flags) + { } + + public override object GetValue(DocumentObject dom, GV flags) + { + if (!Enum.IsDefined(typeof(GV), flags)) + throw new /*InvalidEnum*/ArgumentException(DomSR.InvalidEnumValue(flags), "flags"); + +#if !NETFX_CORE + object val = FieldInfo != null ? FieldInfo.GetValue(dom) : PropertyInfo.GetGetMethod(true).Invoke(dom, null); +#else + object val = FieldInfo != null ? FieldInfo.GetValue(dom) : PropertyInfo.GetValue(dom); +#endif + INullableValue ival = (INullableValue)val; + if (ival.IsNull && flags == GV.GetNull) + return null; + return ival.GetValue(); + } + + public override void SetValue(DocumentObject dom, object value) + { + object val; + INullableValue ival; + if (FieldInfo != null) + { + val = FieldInfo.GetValue(dom); + ival = (INullableValue)val; + ival.SetValue(value); + FieldInfo.SetValue(dom, ival); + } + else + { +#if !NETFX_CORE + val = PropertyInfo.GetGetMethod(true).Invoke(dom, null); +#else + val = PropertyInfo.GetValue(dom); +#endif + ival = (INullableValue)val; + ival.SetValue(value); +#if !NETFX_CORE + PropertyInfo.GetSetMethod(true).Invoke(dom, new object[] { ival }); +#else + PropertyInfo.SetValue(dom, ival); +#endif + } + } + + public override void SetNull(DocumentObject dom) + { + object val; + INullableValue ival; + if (FieldInfo != null) + { + val = FieldInfo.GetValue(dom); + ival = (INullableValue)val; + ival.SetNull(); + FieldInfo.SetValue(dom, ival); + } + else + { +#if !NETFX_CORE + val = PropertyInfo.GetGetMethod(true).Invoke(dom, null); +#else + val = PropertyInfo.GetValue(dom); +#endif + ival = (INullableValue)val; + ival.SetNull(); +#if !NETFX_CORE + PropertyInfo.GetSetMethod(true).Invoke(dom, new object[] { ival }); +#else + PropertyInfo.SetValue(dom, ival); +#endif + } + } + + /// + /// Determines whether the given DocumentObject is null (not set). + /// + public override bool IsNull(DocumentObject dom) + { +#if !NETFX_CORE + object val = FieldInfo != null ? FieldInfo.GetValue(dom) : PropertyInfo.GetGetMethod(true).Invoke(dom, null); +#else + object val = FieldInfo != null ? FieldInfo.GetValue(dom) : PropertyInfo.GetValue(dom); +#endif + return ((INullableValue)val).IsNull; + } + } + + /// + /// Value descriptor of value types. + /// + public class ValueTypeDescriptor : ValueDescriptor + { + public ValueTypeDescriptor(string valueName, Type valueType, Type fieldType, MemberInfo memberInfo, VDFlags flags) + : base(valueName, valueType, fieldType, memberInfo, flags) + { } + + public override object GetValue(DocumentObject dom, GV flags) + { + if (!Enum.IsDefined(typeof(GV), flags)) + throw new /*InvalidEnum*/ArgumentException(DomSR.InvalidEnumValue(flags), "flags"); + +#if !NETFX_CORE + object val = FieldInfo != null ? FieldInfo.GetValue(dom) : PropertyInfo.GetGetMethod(true).Invoke(dom, null); +#else + object val = FieldInfo != null ? FieldInfo.GetValue(dom) : PropertyInfo.GetValue(dom); +#endif + INullableValue ival = val as INullableValue; + if (ival != null && ival.IsNull && flags == GV.GetNull) + return null; + return val; + } + + public override void SetValue(DocumentObject dom, object value) + { + if (FieldInfo != null) + FieldInfo.SetValue(dom, value); + else +#if !NETFX_CORE + PropertyInfo.GetSetMethod(true).Invoke(dom, new object[] { value }); +#else + PropertyInfo.SetValue(dom, value); +#endif + } + + public override void SetNull(DocumentObject dom) + { + object val; + INullableValue ival; + if (FieldInfo != null) + { + val = FieldInfo.GetValue(dom); + ival = (INullableValue)val; + ival.SetNull(); + FieldInfo.SetValue(dom, ival); + } + else + { +#if !NETFX_CORE + val = PropertyInfo.GetGetMethod(true).Invoke(dom, null); +#else + val = PropertyInfo.GetValue(dom); +#endif + ival = (INullableValue)val; + ival.SetNull(); +#if !NETFX_CORE + PropertyInfo.GetSetMethod(true).Invoke(dom, new object[] { ival }); +#else + PropertyInfo.SetValue(dom, ival); +#endif + } + } + + /// + /// Determines whether the given DocumentObject is null (not set). + /// + public override bool IsNull(DocumentObject dom) + { +#if !NETFX_CORE + object val = FieldInfo != null ? FieldInfo.GetValue(dom) : PropertyInfo.GetGetMethod(true).Invoke(dom, null); +#else + object val = FieldInfo != null ? FieldInfo.GetValue(dom) : PropertyInfo.GetValue(dom); +#endif + INullableValue ival = val as INullableValue; + if (ival != null) + return ival.IsNull; + return false; + } + } + + /// + /// Value descriptor of DocumentObject. + /// + public class DocumentObjectDescriptor : ValueDescriptor + { + public DocumentObjectDescriptor(string valueName, Type valueType, Type fieldType, MemberInfo memberInfo, VDFlags flags) + : base(valueName, valueType, fieldType, memberInfo, flags) + { } + + public override object GetValue(DocumentObject dom, GV flags) + { + if (!Enum.IsDefined(typeof(GV), flags)) + throw new /*InvalidEnum*/ArgumentException(DomSR.InvalidEnumValue(flags), "flags"); + + FieldInfo fieldInfo = FieldInfo; + DocumentObject val; + if (fieldInfo != null) + { + // Member is a field + val = FieldInfo.GetValue(dom) as DocumentObject; + if (val == null && flags == GV.ReadWrite) + { + val = (DocumentObject)CreateValue(); + val._parent = dom; + FieldInfo.SetValue(dom, val); + return val; + } + } + else + { + // Member is a property +#if !NETFX_CORE + val = PropertyInfo.GetGetMethod(true).Invoke(dom, null) as DocumentObject; +#else + val = PropertyInfo.GetValue(dom) as DocumentObject; +#endif + } + if (val != null && (val.IsNull() && flags == GV.GetNull)) + return null; + + return val; + } + + public override void SetValue(DocumentObject dom, object val) + { + FieldInfo fieldInfo = FieldInfo; + // Member is a field + if (fieldInfo != null) + { + fieldInfo.SetValue(dom, val); + return; + } + throw new InvalidOperationException("This value cannot be set."); + } + + public override void SetNull(DocumentObject dom) + { + FieldInfo fieldInfo = FieldInfo; + DocumentObject val; + // Member is a field. + if (fieldInfo != null) + { + val = FieldInfo.GetValue(dom) as DocumentObject; + if (val != null) + val.SetNull(); + } + + // Member is a property. + if (PropertyInfo != null) + { + PropertyInfo propInfo = PropertyInfo; +#if !NETFX_CORE + val = propInfo.GetGetMethod(true).Invoke(dom, null) as DocumentObject; +#else + val = propInfo.GetValue(dom) as DocumentObject; +#endif + if (val != null) + val.SetNull(); + } + } + + /// + /// Determines whether the given DocumentObject is null (not set). + /// + public override bool IsNull(DocumentObject dom) + { + FieldInfo fieldInfo = FieldInfo; + DocumentObject val; + // Member is a field + if (fieldInfo != null) + { + val = FieldInfo.GetValue(dom) as DocumentObject; + if (val == null) + return true; + return val.IsNull(); + } + // Member is a property + PropertyInfo propInfo = PropertyInfo; +#if !NETFX_CORE + val = propInfo.GetGetMethod(true).Invoke(dom, null) as DocumentObject; +#else + val = propInfo.GetValue(dom) as DocumentObject; +#endif + if (val != null) + val.IsNull(); + return true; + } + } + + /// + /// Value descriptor of DocumentObjectCollection. + /// + public class DocumentObjectCollectionDescriptor : ValueDescriptor + { + public DocumentObjectCollectionDescriptor(string valueName, Type valueType, Type fieldType, MemberInfo memberInfo, VDFlags flags) + : base(valueName, valueType, fieldType, memberInfo, flags) + { } + + public override object GetValue(DocumentObject dom, GV flags) + { + if (!Enum.IsDefined(typeof(GV), flags)) + throw new /*InvalidEnum*/ArgumentException(DomSR.InvalidEnumValue(flags), "flags"); + + Debug.Assert(MemberInfo is FieldInfo, "Properties of DocumentObjectCollection not allowed."); + DocumentObjectCollection val = FieldInfo.GetValue(dom) as DocumentObjectCollection; + if (val == null && flags == GV.ReadWrite) + { + val = (DocumentObjectCollection)CreateValue(); + val._parent = dom; + FieldInfo.SetValue(dom, val); + return val; + } + if (val != null && val.IsNull() && flags == GV.GetNull) + return null; + return val; + } + + public override void SetValue(DocumentObject dom, object val) + { + FieldInfo.SetValue(dom, val); + } + + public override void SetNull(DocumentObject dom) + { + DocumentObjectCollection val = FieldInfo.GetValue(dom) as DocumentObjectCollection; + if (val != null) + val.SetNull(); + } + + /// + /// Determines whether the given DocumentObject is null (not set). + /// + public override bool IsNull(DocumentObject dom) + { + DocumentObjectCollection val = FieldInfo.GetValue(dom) as DocumentObjectCollection; + if (val == null) + return true; + return val.IsNull(); + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/enums/GV.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/enums/GV.cs new file mode 100644 index 0000000..0ec45a0 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/enums/GV.cs @@ -0,0 +1,57 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// ReSharper disable InconsistentNaming + +namespace MigraDoc.DocumentObjectModel.publics +{ + /// + /// Indicates how to retrieve a value from a DocumentObject. + /// + public enum GV + { + /// + /// Gets the value for reading and writing. If the value does not exist, it is created. + /// + ReadWrite = 0, + + /// + /// Gets the value for reading. If the value does not exist, it is not created. + /// + ReadOnly = 1, + + /// + /// Returns null if value is Null or does not exist. + /// + GetNull = 2, + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/enums/VDFlags.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/enums/VDFlags.cs new file mode 100644 index 0000000..1e09014 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/enums/VDFlags.cs @@ -0,0 +1,45 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +// ReSharper disable InconsistentNaming + +namespace MigraDoc.DocumentObjectModel.publics +{ + [Flags] + public enum VDFlags + { + None = 0, + RefOnly = 0x0001 + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Resources/Messages.de.restext b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Resources/Messages.de.restext new file mode 100644 index 0000000..aaa55a2 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Resources/Messages.de.restext @@ -0,0 +1,71 @@ +; ----- German (de) Messages --------------------------------------------------- +; Messages for German language +; that differ from the default messages. +; +; Must be saved with encoding UTF8. Otherwise German umlauts get not processed correctly. +; +; ------------------------------------------------------------------------------ + +StyleExpected = Der übergebene Wert muss vom Typ MigraDoc.DocumentObjectModel.Style sein. +BaseStyleRequired = Es muss eine Basis-Formatvorlage definiert werden. +EmptyBaseStyle = Die Basis-Formatvorlage darf nicht leer sein. +InvalidFieldFormat = '{0}' ist kein gültiges Format für ein numerisches Feld. +InvalidInfoFieldName = Die Eigenschaft 'Name' an 'InfoField' hat den ungültigen Wert '{0}'. +UndefinedBaseStyle = Die Basis-Formatvorlage '{0}' ist nicht definiert. +InvalidUnitValue = '{0}' ist keine gültige Zeichenkette für ein 'Unit'-Objekt. +InvalidUnitType = '{0}' ist ein unbekannter Maß für ein 'Unit'-Objekt. +InvalidEnumValue = Der Wert '{0:X}' ist für den enum-Type '{1}' nicht gültig. +InvalidEnumForLeftPosition = ShapePosition muss einer der Werte 'Left', 'Center', oder 'Right' sein. +InvalidEnumForTopPosition = ShapePosition einer der Werte 'Top', 'Center', oder 'Bottom' sein. +InvalidColorString = Aus der Zeichenkette '{0}' konnte keine Farbe eingelesen werden. +InvalidFontSize = Die Fontgröße '{0}' is ausserhalb des erlaubten Bereichs. +InsertNullNotAllowed = In ein Collection-Objekt darf keine null eingefügt werden. +ParentAlreadySet = Wert vom Typ '{0}' muss geklont werden, bevor we an '{1}' gesetzt werden kann. +MissingObligatoryProperty = Obigatorische Eigenschaft '{0}' wurde an '{1}' nicht gesetzt. +InvalidDocumentObjectType = Das übergebene Dokumentobjekt ist in diesem Zusammenhang nicht gültig. + +; ----- DdlReader Messages ------------------------------------------------------------------------ + +;DomMsgID +SymbolExpected = Symbol '{0}' erwartet, '{1}' vorgefunden. +SymbolsExpected = Eines der folgenden Symbole {0} erwartet. +OperatorExpected = Syntaxfehler: Operator '{0}' erwartet. +KeyWordExpected = Schlüsselwort '{1}' - '{0}' erwartet. +EndOfFileExpected = Ende der Datei erwartet. +UnexpectedEndOfFile = Unerwartetes Dateiende. +StyleNameExpected = '{0}' ist kein gültiger Name für eine Formatvorlage. +UnexpectedSymbol = Unerwartetes Symbol '{0}'. +IdentifierExpected = Bezeichner erwartet: '{0}'. +BoolExpected = Boolescher Wert erwartet: '{0}'. +RealExpected = Fließkomma-Wert erwartet: '{0}'. +IntegerExpected = Ganze Zahl erwartet: '{0}'. +StringExpected = Zeichenkette erwartet: '{0}'. +NullExpected = Null erwartet: '{0}'. +NumberExpected = Zahl erwartet: '{0}'. +InvalidEnum = '{0}' '{1}'. +InvalidType = Variablentyp '{0}' wird von '{1}' nicht unterstützt. +InvalidAssignment = Ungültige Zuweisung an '{0}'. +InvalidValueName = '{0}' ist ein ungültiger Wertname. +InvalidRange = Ungültiger Bereich: '{0}'. +InvalidColor = Ungültiger Farbwert: '{0}'. +InvalidFieldType = Ungültiger Feldtyp: '{0}'. +InvalidValueForOperation = Operation '{1}' ist für den Wert '{0}' nicht gültig. +InvalidSymbolType = Ungültiges Symbol '{0}'. +MissingBraceLeft = Öffnende geschweifte Klammer nach '{0}' fehlt. +MissingBraceRight = Schließende geschweifte Klammer nach '{0}' fehlt. +MissingBracketLeft = Öffnende eckige Klammer nach '{0}' fehlt. +MissingBracketRight = Schließende eckige Klammer nach '{0}' fehlt. +MissingParenLeft = Öffnende runde Klammer nach '{0}' fehlt. +MissingParenRight = Schließende runde Klammer nach '{0}' fehlt. +MissingComma = Komma fehlt. +SymbolNotAllowed = Symbol '{0}' ist in diesem Zusammenhang nichterlaubt. +SymbolIsNotAnObject = Symbol '{0}' ist kein Objekt. +UnknownChartType = Unbekannter Diagrammtyp: '{0}' +NoAccess = Zugriff verweigert: '{0}' existiert nur für den internen Gebrauch. +NewlineInString = Zeilenumbruch in Zeichenkette nicht erlaubt. +EscapeSequenceNotAllowed = Ungültige Escapesequenz. +NullAssignmentNotSupported = Zuweisung von 'null' an '{0}' ist nicht erlaubt. +OutOfRange = Der gültige Bereich liegt innerhalb von '{0}'. + +UseOfUndefinedBaseStyle = Die unbekannte Basis-Formatvorlage '{0}' wurde verwendet. +UseOfUndefinedStyle = Die unbekannte Formatvorlage '{0}' wurde verwendet. \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Resources/Messages.restext b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Resources/Messages.restext new file mode 100644 index 0000000..5ca1139 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Resources/Messages.restext @@ -0,0 +1,70 @@ +; ----- Default Messages ------------------------------------------------------- +; Each Message will be shown for any language +; that does not override it in its specific .txt-file. +; ------------------------------------------------------------------------------ + +; ----- General Messages -------------------------------------------------------------------------- + +StyleExpected = The value must be of type MigraDoc.DocumentObjectModel.Style. +BaseStyleRequired = Base style name must be defined. +EmptyBaseStyle = Attempt to set empty base style is invalid. +InvalidFieldFormat = '{0}' is not a valid numeric field format. +InvalidInfoFieldName = Property 'Name' of 'InfoField' has invalid value '{0}'. +UndefinedBaseStyle = Base style name '{0}' is undefined. +InvalidUnitValue = String '{0}' is not a valid value for structure 'Unit'. +InvalidUnitType = '{0}' is an unknown unit type. +InvalidEnumValue = The value '{0:X}' is not valid for enum type '{1}'. +InvalidEnumForLeftPosition = ShapePosition must be Left, Center, or Right. +InvalidEnumForTopPosition = ShapePosition must be Top, Center, or Bottom. +InvalidColorString = Color could not be parsed from string '{0}'. +InvalidFontSize = The font size '{0}' is out of range. +InsertNullNotAllowed = Inserting null into a collection is not allowed. +ParentAlreadySet = Value of type '{0}' must be cloned before set into '{1}'. +MissingObligatoryProperty = Obigatory property '{0}' not set in '{1}'. +InvalidDocumentObjectType = The given document object is not valid in this context. + +; ----- DdlReader Messages ------------------------------------------------------------------------ + +;DomMsgID +SymbolExpected = '{0}' expected, found '{1}'. +SymbolsExpected = One of the following symbols {0} is expected. +OperatorExpected = Syntax error: Operator '{0}' is expected. +KeyWordExpected = '{1}' - '{0}' expected. +EndOfFileExpected = End of file expected. +UnexpectedEndOfFile = Unexpected end of file. +StyleNameExpected = Invalid style name '{0}'. +UnexpectedSymbol = Unexpected symbol '{0}'. +IdentifierExpected = Identifier expected: '{0}'. +BoolExpected = Bool expected: '{0}'. +RealExpected = Real expected: '{0}'. +IntegerExpected = Integer expected: '{0}'. +StringExpected = String expected: '{0}'. +NullExpected = Null expected: '{0}'. +NumberExpected = Number expected: '{0}'. +InvalidEnum = '{0}' '{1}'. +InvalidType = Variable type '{0}' not supported by '{1}'. +InvalidAssignment = Invalid assignment to '{0}'. +InvalidValueName = Invalid value name: '{0}'. +InvalidRange = Invalid range: '{0}'. +InvalidColor = Invalid color: '{0}'. +InvalidFieldType = Invalid field type: '{0}'. +InvalidValueForOperation = Operation '{1}' not valid for Value '{0}'. +InvalidSymbolType = Symbol not valid '{0}'. +MissingBraceLeft = Missing left brace after '{0}'. +MissingBraceRight = Missing right brace after '{0}'. +MissingBracketLeft = Missing left bracket after '{0}'. +MissingBracketRight = Missing right bracket after '{0}'. +MissingParenLeft = Missing left parenthesis after '{0}'. +MissingParenRight = Missing right parenthesis after '{0}'. +MissingComma = Missing comma. +SymbolNotAllowed = Symbol '{0}' in this context not allowed. +SymbolIsNotAnObject = Symbol '{0}' is not an object. +UnknownChartType = Unknown chart type: '{0}' +NoAccess = Access denied: '{0}' for public use only. +NewlineInString = Newline in string not allowed. +EscapeSequenceNotAllowed = Invalid escape sequence. +NullAssignmentNotSupported = Assign 'null' to '{0}' not allowed. +OutOfRange = Valid range only within '{0}'. + +UseOfUndefinedBaseStyle = Use of undefined base style '{0}'. +UseOfUndefinedStyle = Use of undefined style '{0}'. diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Axis.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Axis.cs new file mode 100644 index 0000000..c99c9d9 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Axis.cs @@ -0,0 +1,331 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// This class represents an axis in a chart. + /// + public class Axis : ChartObject + { + /// + /// Initializes a new instance of the Axis class. + /// + public Axis() + { } + + /// + /// Initializes a new instance of the Axis class with the specified parent. + /// + public Axis(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Axis Clone() + { + return (Axis)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Axis axis = (Axis)base.DeepCopy(); + if (axis._title != null) + { + axis._title = axis._title.Clone(); + axis._title._parent = axis; + } + if (axis._tickLabels != null) + { + axis._tickLabels = axis._tickLabels.Clone(); + axis._tickLabels._parent = axis; + } + if (axis._lineFormat != null) + { + axis._lineFormat = axis._lineFormat.Clone(); + axis._lineFormat._parent = axis; + } + if (axis._majorGridlines != null) + { + axis._majorGridlines = axis._majorGridlines.Clone(); + axis._majorGridlines._parent = axis; + } + if (axis._minorGridlines != null) + { + axis._minorGridlines = axis._minorGridlines.Clone(); + axis._minorGridlines._parent = axis; + } + return axis; + } + #endregion + + #region Properties + /// + /// Gets the title of the axis. + /// + public AxisTitle Title + { + get { return _title ?? (_title = new AxisTitle(this)); } + set + { + SetParent(value); + _title = value; + } + } + [DV] + public AxisTitle _title; + + /// + /// Gets or sets the minimum value of the axis. + /// + public double MinimumScale + { + get { return _minimumScale.Value; } + set { _minimumScale.Value = value; } + } + [DV] + public NDouble _minimumScale = NDouble.NullValue; + + /// + /// Gets or sets the maximum value of the axis. + /// + public double MaximumScale + { + get { return _maximumScale.Value; } + set { _maximumScale.Value = value; } + } + [DV] + public NDouble _maximumScale = NDouble.NullValue; + + /// + /// Gets or sets the interval of the primary tick. + /// + public double MajorTick + { + get { return _majorTick.Value; } + set { _majorTick.Value = value; } + } + [DV] + public NDouble _majorTick = NDouble.NullValue; + + /// + /// Gets or sets the interval of the secondary tick. + /// + public double MinorTick + { + get { return _minorTick.Value; } + set { _minorTick.Value = value; } + } + [DV] + public NDouble _minorTick = NDouble.NullValue; + + /// + /// Gets or sets the type of the primary tick mark. + /// + public TickMarkType MajorTickMark + { + get { return (TickMarkType)_majorTickMark.Value; } + set { _majorTickMark.Value = (int)value; } + } + [DV(Type = typeof(TickMarkType))] + public NEnum _majorTickMark = NEnum.NullValue(typeof(TickMarkType)); + + /// + /// Gets or sets the type of the secondary tick mark. + /// + public TickMarkType MinorTickMark + { + get { return (TickMarkType)_minorTickMark.Value; } + set { _minorTickMark.Value = (int)value; } + } + [DV(Type = typeof(TickMarkType))] + public NEnum _minorTickMark = NEnum.NullValue(typeof(TickMarkType)); + + /// + /// Gets the label of the primary tick. + /// + public TickLabels TickLabels + { + get { return _tickLabels ?? (_tickLabels = new TickLabels(this)); } + set + { + SetParent(value); + _tickLabels = value; + } + } + [DV] + public TickLabels _tickLabels; + + /// + /// Gets the format of the axis line. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + set + { + SetParent(value); + _lineFormat = value; + } + } + [DV] + public LineFormat _lineFormat; + + /// + /// Gets the primary gridline object. + /// + public Gridlines MajorGridlines + { + get { return _majorGridlines ?? (_majorGridlines = new Gridlines(this)); } + set + { + SetParent(value); + _majorGridlines = value; + } + } + [DV] + public Gridlines _majorGridlines; + + /// + /// Gets the secondary gridline object. + /// + public Gridlines MinorGridlines + { + get { return _minorGridlines ?? (_minorGridlines = new Gridlines(this)); } + set + { + SetParent(value); + _minorGridlines = value; + } + } + [DV] + public Gridlines _minorGridlines; + + /// + /// Gets or sets, whether the axis has a primary gridline object. + /// + public bool HasMajorGridlines + { + get { return _hasMajorGridlines.Value; } + set { _hasMajorGridlines.Value = value; } + } + [DV] + public NBool _hasMajorGridlines = NBool.NullValue; + + /// + /// Gets or sets, whether the axis has a secondary gridline object. + /// + public bool HasMinorGridlines + { + get { return _hasMinorGridlines.Value; } + set { _hasMinorGridlines.Value = value; } + } + [DV] + public NBool _hasMinorGridlines = NBool.NullValue; + #endregion + + /// + /// Determines whether the specified gridlines object is a MajorGridlines or an MinorGridlines. + /// + public string CheckGridlines(Gridlines gridlines) + { + if ((_majorGridlines != null) && (gridlines == _majorGridlines)) + return "MajorGridlines"; + if ((_minorGridlines != null) && (gridlines == _minorGridlines)) + return "MinorGridlines"; + + return ""; + } + + #region public + /// + /// Converts Axis into DDL. + /// + public override void Serialize(Serializer serializer) + { + Chart chartObject = _parent as Chart; + + serializer.WriteLine("\\" + chartObject.CheckAxis(this)); + int pos = serializer.BeginAttributes(); + + if (!_minimumScale.IsNull) + serializer.WriteSimpleAttribute("MinimumScale", MinimumScale); + if (!_maximumScale.IsNull) + serializer.WriteSimpleAttribute("MaximumScale", MaximumScale); + if (!_majorTick.IsNull) + serializer.WriteSimpleAttribute("MajorTick", MajorTick); + if (!_minorTick.IsNull) + serializer.WriteSimpleAttribute("MinorTick", MinorTick); + if (!_hasMajorGridlines.IsNull) + serializer.WriteSimpleAttribute("HasMajorGridLines", HasMajorGridlines); + if (!_hasMinorGridlines.IsNull) + serializer.WriteSimpleAttribute("HasMinorGridLines", HasMinorGridlines); + if (!_majorTickMark.IsNull) + serializer.WriteSimpleAttribute("MajorTickMark", MajorTickMark); + if (!_minorTickMark.IsNull) + serializer.WriteSimpleAttribute("MinorTickMark", MinorTickMark); + + if (!IsNull("Title")) + _title.Serialize(serializer); + + if (!IsNull("LineFormat")) + _lineFormat.Serialize(serializer); + + if (!IsNull("MajorGridlines")) + _majorGridlines.Serialize(serializer); + + if (!IsNull("MinorGridlines")) + _minorGridlines.Serialize(serializer); + + if (!IsNull("TickLabels")) + _tickLabels.Serialize(serializer); + + serializer.EndAttributes(pos); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Axis))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/AxisTitle.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/AxisTitle.cs new file mode 100644 index 0000000..ff2fd38 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/AxisTitle.cs @@ -0,0 +1,190 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Tables; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents the title of an axis. + /// + public class AxisTitle : ChartObject + { + /// + /// Initializes a new instance of the AxisTitle class. + /// + public AxisTitle() + { + } + + /// + /// Initializes a new instance of the AxisTitle class with the specified parent. + /// + public AxisTitle(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new AxisTitle Clone() + { + return (AxisTitle)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + AxisTitle axisTitle = (AxisTitle)base.DeepCopy(); + if (axisTitle._font != null) + { + axisTitle._font = axisTitle._font.Clone(); + axisTitle._font._parent = axisTitle; + } + return axisTitle; + } + #endregion + + #region Properties + /// + /// Gets or sets the style name of the axis. + /// + public string Style + { + get { return _style.Value; } + set { _style.Value = value; } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets or sets the caption of the title. + /// + public string Caption + { + get { return _caption.Value; } + set { _caption.Value = value; } + } + [DV] + public NString _caption = NString.NullValue; + + /// + /// Gets the font object of the title. + /// + public Font Font + { + get { return _font ?? (_font = new Font(this)); } + set + { + SetParent(value); + _font = value; + } + } + [DV] + public Font _font; + + /// + /// Gets or sets the orientation of the caption. + /// + public Unit Orientation + { + get { return _orientation; } + set { _orientation = value; } + } + [DV] + public Unit _orientation = Unit.NullValue; + + /// + /// Gets or sets the alignment of the caption. + /// + public HorizontalAlignment Alignment + { + get { return (HorizontalAlignment)_alignment.Value; } + set { _alignment.Value = (int)value; } + } + [DV(Type = typeof(HorizontalAlignment))] + public NEnum _alignment = NEnum.NullValue(typeof(HorizontalAlignment)); + + /// + /// Gets or sets the alignment of the caption. + /// + public VerticalAlignment VerticalAlignment + { + get { return (VerticalAlignment)_verticalAlignment.Value; } + set { _verticalAlignment.Value = (int)value; } + } + [DV(Type = typeof(VerticalAlignment))] + public NEnum _verticalAlignment = NEnum.NullValue(typeof(VerticalAlignment)); + #endregion + + #region public + /// + /// Converts AxisTitle into DDL. + /// + public override void Serialize(Serializer serializer) + { + int pos = serializer.BeginContent("Title"); + + if (!_style.IsNull) + serializer.WriteSimpleAttribute("Style", Style); + + if (!IsNull("Font")) + _font.Serialize(serializer); + + if (!_orientation.IsNull) + serializer.WriteSimpleAttribute("Orientation", Orientation); + + if (!_alignment.IsNull) + serializer.WriteSimpleAttribute("Alignment", Alignment); + + if (!_verticalAlignment.IsNull) + serializer.WriteSimpleAttribute("VerticalAlignment", VerticalAlignment); + + if (!_caption.IsNull) + serializer.WriteSimpleAttribute("Caption", Caption); + + serializer.EndContent(); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(AxisTitle))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Chart.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Chart.cs new file mode 100644 index 0000000..9cdbbe5 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Chart.cs @@ -0,0 +1,552 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents charts with different types. + /// + public class Chart : Shape, IVisitable + { + /// + /// Initializes a new instance of the Chart class. + /// + public Chart() + { + } + + /// + /// Initializes a new instance of the Chart class with the specified parent. + /// + public Chart(DocumentObject parent) : base(parent) { } + + /// + /// Initializes a new instance of the Chart class with the specified chart type. + /// + public Chart(ChartType type) + : this() + { + Type = type; + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Chart Clone() + { + return (Chart)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Chart chart = (Chart)base.DeepCopy(); + if (chart._format != null) + { + chart._format = chart._format.Clone(); + chart._format._parent = chart; + } + if (chart._xAxis != null) + { + chart._xAxis = chart._xAxis.Clone(); + chart._xAxis._parent = chart; + } + if (chart._yAxis != null) + { + chart._yAxis = chart._yAxis.Clone(); + chart._yAxis._parent = chart; + } + if (chart._zAxis != null) + { + chart._zAxis = chart._zAxis.Clone(); + chart._zAxis._parent = chart; + } + if (chart._seriesCollection != null) + { + chart._seriesCollection = chart._seriesCollection.Clone(); + chart._seriesCollection._parent = chart; + } + if (chart._xValues != null) + { + chart._xValues = chart._xValues.Clone(); + chart._xValues._parent = chart; + } + if (chart._headerArea != null) + { + chart._headerArea = chart._headerArea.Clone(); + chart._headerArea._parent = chart; + } + if (chart._bottomArea != null) + { + chart._bottomArea = chart._bottomArea.Clone(); + chart._bottomArea._parent = chart; + } + if (chart._topArea != null) + { + chart._topArea = chart._topArea.Clone(); + chart._topArea._parent = chart; + } + if (chart._footerArea != null) + { + chart._footerArea = chart._footerArea.Clone(); + chart._footerArea._parent = chart; + } + if (chart._leftArea != null) + { + chart._leftArea = chart._leftArea.Clone(); + chart._leftArea._parent = chart; + } + if (chart._rightArea != null) + { + chart._rightArea = chart._rightArea.Clone(); + chart._rightArea._parent = chart; + } + if (chart._plotArea != null) + { + chart._plotArea = chart._plotArea.Clone(); + chart._plotArea._parent = chart; + } + if (chart._dataLabel != null) + { + chart._dataLabel = chart._dataLabel.Clone(); + chart._dataLabel._parent = chart; + } + return chart; + } + #endregion + + #region Properties + /// + /// Gets or sets the base type of the chart. + /// ChartType of the series can be overwritten. + /// + public ChartType Type + { + get { return (ChartType)_type.Value; } + set { _type.Value = (int)value; } + } + [DV(Type = typeof(ChartType))] + public NEnum _type = NEnum.NullValue(typeof(ChartType)); + + /// + /// Gets or sets the default style name of the whole chart. + /// + public string Style + { + get { return _style.Value; } + set { _style.Value = value; } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets the default paragraph format of the whole chart. + /// + public ParagraphFormat Format + { + get { return _format ?? (_format = new ParagraphFormat(this)); } + set + { + SetParent(value); + _format = value; + } + } + [DV] + public ParagraphFormat _format; + + /// + /// Gets the X-Axis of the Chart. + /// + public Axis XAxis + { + get { return _xAxis ?? (_xAxis = new Axis(this)); } + set + { + SetParent(value); + _xAxis = value; + } + } + [DV] + public Axis _xAxis; + + /// + /// Gets the Y-Axis of the Chart. + /// + public Axis YAxis + { + get { return _yAxis ?? (_yAxis = new Axis(this)); } + set + { + SetParent(value); + _yAxis = value; + } + } + [DV] + public Axis _yAxis; + + /// + /// Gets the Z-Axis of the Chart. + /// + public Axis ZAxis + { + get { return _zAxis ?? (_zAxis = new Axis(this)); } + set + { + SetParent(value); + _zAxis = value; + } + } + [DV] + public Axis _zAxis; + + /// + /// Gets the collection of the data series. + /// + public SeriesCollection SeriesCollection + { + get { return _seriesCollection ?? (_seriesCollection = new SeriesCollection(this)); } + set + { + SetParent(value); + _seriesCollection = value; + } + } + [DV(ItemType = typeof(Series))] + public SeriesCollection _seriesCollection; + + /// + /// Gets the collection of the values written on the X-Axis. + /// + public XValues XValues + { + get { return _xValues ?? (_xValues = new XValues(this)); } + set + { + SetParent(value); + _xValues = value; + } + } + [DV(ItemType = typeof(Series))] + public XValues _xValues; + + /// + /// Gets the header area of the chart. + /// + public TextArea HeaderArea + { + get { return _headerArea ?? (_headerArea = new TextArea(this)); } + set + { + SetParent(value); + _headerArea = value; + } + } + [DV] + public TextArea _headerArea; + + /// + /// Gets the bottom area of the chart. + /// + public TextArea BottomArea + { + get { return _bottomArea ?? (_bottomArea = new TextArea(this)); } + set + { + SetParent(value); + _bottomArea = value; + } + } + [DV] + public TextArea _bottomArea; + + /// + /// Gets the top area of the chart. + /// + public TextArea TopArea + { + get { return _topArea ?? (_topArea = new TextArea(this)); } + set + { + SetParent(value); + _topArea = value; + } + } + [DV] + public TextArea _topArea; + + /// + /// Gets the footer area of the chart. + /// + public TextArea FooterArea + { + get { return _footerArea ?? (_footerArea = new TextArea(this)); } + set + { + SetParent(value); + _footerArea = value; + } + } + [DV] + public TextArea _footerArea; + + /// + /// Gets the left area of the chart. + /// + public TextArea LeftArea + { + get { return _leftArea ?? (_leftArea = new TextArea(this)); } + set + { + SetParent(value); + _leftArea = value; + } + } + [DV] + public TextArea _leftArea; + + /// + /// Gets the right area of the chart. + /// + public TextArea RightArea + { + get { return _rightArea ?? (_rightArea = new TextArea(this)); } + set + { + SetParent(value); + _rightArea = value; + } + } + [DV] + public TextArea _rightArea; + + /// + /// Gets the plot (drawing) area of the chart. + /// + public PlotArea PlotArea + { + get { return _plotArea ?? (_plotArea = new PlotArea(this)); } + set + { + SetParent(value); + _plotArea = value; + } + } + [DV] + public PlotArea _plotArea; + + /// + /// Gets or sets a value defining how blanks in the data series should be shown. + /// + public BlankType DisplayBlanksAs + { + get { return (BlankType)_displayBlanksAs.Value; } + set { _displayBlanksAs.Value = (int)value; } + } + [DV(Type = typeof(BlankType))] + public NEnum _displayBlanksAs = NEnum.NullValue(typeof(BlankType)); + + /// + /// Gets or sets whether XAxis Labels should be merged. + /// + public bool PivotChart + { + get { return _pivotChart.Value; } + set { _pivotChart.Value = value; } + } + [DV] + public NBool _pivotChart = NBool.NullValue; + + /// + /// Gets the DataLabel of the chart. + /// + public DataLabel DataLabel + { + get { return _dataLabel ?? (_dataLabel = new DataLabel(this)); } + set + { + SetParent(value); + _dataLabel = value; + } + } + [DV] + public DataLabel _dataLabel; + + /// + /// Gets or sets whether the chart has a DataLabel. + /// + public bool HasDataLabel + { + get { return _hasDataLabel.Value; } + set { _hasDataLabel.Value = value; } + } + [DV] + public NBool _hasDataLabel = NBool.NullValue; + #endregion + + /// + /// Determines the type of the given axis. + /// + public string CheckAxis(Axis axis) + { + if ((_xAxis != null) && (axis == _xAxis)) + return "xaxis"; + if ((_yAxis != null) && (axis == _yAxis)) + return "yaxis"; + if ((_zAxis != null) && (axis == _zAxis)) + return "zaxis"; + + return ""; + } + + /// + /// Determines the type of the given textarea. + /// + public string CheckTextArea(TextArea textArea) + { + if ((_headerArea != null) && (textArea == _headerArea)) + return "headerarea"; + if ((_footerArea != null) && (textArea == _footerArea)) + return "footerarea"; + if ((_leftArea != null) && (textArea == _leftArea)) + return "leftarea"; + if ((_rightArea != null) && (textArea == _rightArea)) + return "rightarea"; + if ((_topArea != null) && (textArea == _topArea)) + return "toparea"; + if ((_bottomArea != null) && (textArea == _bottomArea)) + return "bottomarea"; + + return ""; + } + + #region public + /// + /// Converts Chart into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteLine("\\chart(" + Type + ")"); + int pos = serializer.BeginAttributes(); + + base.Serialize(serializer); + if (!_displayBlanksAs.IsNull) + serializer.WriteSimpleAttribute("DisplayBlanksAs", DisplayBlanksAs); + if (!_pivotChart.IsNull) + serializer.WriteSimpleAttribute("PivotChart", PivotChart); + if (!_hasDataLabel.IsNull) + serializer.WriteSimpleAttribute("HasDataLabel", HasDataLabel); + + if (!_style.IsNull) + serializer.WriteSimpleAttribute("Style", Style); + if (!IsNull("Format")) + _format.Serialize(serializer, "Format", null); + if (!IsNull("DataLabel")) + _dataLabel.Serialize(serializer); + serializer.EndAttributes(pos); + + serializer.BeginContent(); + + if (!IsNull("PlotArea")) + _plotArea.Serialize(serializer); + if (!IsNull("HeaderArea")) + _headerArea.Serialize(serializer); + if (!IsNull("FooterArea")) + _footerArea.Serialize(serializer); + if (!IsNull("TopArea")) + _topArea.Serialize(serializer); + if (!IsNull("BottomArea")) + _bottomArea.Serialize(serializer); + if (!IsNull("LeftArea")) + _leftArea.Serialize(serializer); + if (!IsNull("RightArea")) + _rightArea.Serialize(serializer); + + if (!IsNull("XAxis")) + _xAxis.Serialize(serializer); + if (!IsNull("YAxis")) + _yAxis.Serialize(serializer); + if (!IsNull("ZAxis")) + _zAxis.Serialize(serializer); + + if (!IsNull("SeriesCollection")) + _seriesCollection.Serialize(serializer); + if (!IsNull("XValues")) + _xValues.Serialize(serializer); + + serializer.EndContent(); + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitChart(this); + if (visitChildren) + { + if (_bottomArea != null) + ((IVisitable)_bottomArea).AcceptVisitor(visitor, true); + + if (_footerArea != null) + ((IVisitable)_footerArea).AcceptVisitor(visitor, true); + + if (_headerArea != null) + ((IVisitable)_headerArea).AcceptVisitor(visitor, true); + + if (_leftArea != null) + ((IVisitable)_leftArea).AcceptVisitor(visitor, true); + + if (_rightArea != null) + ((IVisitable)_rightArea).AcceptVisitor(visitor, true); + + if (_topArea != null) + ((IVisitable)_topArea).AcceptVisitor(visitor, true); + } + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Chart))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/ChartObject.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/ChartObject.cs new file mode 100644 index 0000000..fdb1df8 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/ChartObject.cs @@ -0,0 +1,73 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Base class for all chart classes. + /// + public class ChartObject : DocumentObject + { + /// + /// Initializes a new instance of the ChartObject class. + /// + public ChartObject() + { + } + + /// + /// Initializes a new instance of the ChartObject class with the specified parent. + /// + public ChartObject(DocumentObject parent) : base(parent) { } + + #region public + /// + /// Converts ChartObject into DDL. + /// + public override void Serialize(Serializer _serializer) + { + // Nothing to do + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(ChartObject))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/DataLabel.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/DataLabel.cs new file mode 100644 index 0000000..af8f5bc --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/DataLabel.cs @@ -0,0 +1,172 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents a DataLabel of a Series + /// + public class DataLabel : DocumentObject + { + /// + /// Initializes a new instance of the DataLabel class. + /// + public DataLabel() + { + } + + /// + /// Initializes a new instance of the DataLabel class with the specified parent. + /// + public DataLabel(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new DataLabel Clone() + { + return (DataLabel)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + DataLabel dataLabel = (DataLabel)base.DeepCopy(); + if (dataLabel._font != null) + { + dataLabel._font = dataLabel._font.Clone(); + dataLabel._font._parent = dataLabel; + } + return dataLabel; + } + #endregion + + #region Properties + /// + /// Gets or sets a numeric format string for the DataLabel. + /// + public string Format + { + get { return _format.Value; } + set { _format.Value = value; } + } + [DV] + public NString _format = NString.NullValue; + + /// + /// Gets the Font for the DataLabel. + /// + public Font Font + { + get { return _font ?? (_font = new Font(this)); } + set + { + SetParent(value); + _font = value; + } + } + [DV] + public Font _font; + + /// + /// Gets or sets the Style for the DataLabel. + /// Only the Font-associated part of the Style's ParagraphFormat is used. + /// + public string Style + { + get { return _style.Value; } + set { _style.Value = value; } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets or sets the position of the DataLabel. + /// + public DataLabelPosition Position + { + get { return (DataLabelPosition)_position.Value; } + set { _position.Value = (int)value; } + } + [DV(Type = typeof(DataLabelPosition))] + public NEnum _position = NEnum.NullValue(typeof(DataLabelPosition)); + + /// + /// Gets or sets the type of the DataLabel. + /// + public DataLabelType Type + { + get { return (DataLabelType)_type.Value; } + set { _type.Value = (int)value; } + } + [DV(Type = typeof(DataLabelType))] + public NEnum _type = NEnum.NullValue(typeof(DataLabelType)); + #endregion + + #region public + /// + /// Converts DataLabel into DDL. + /// + public override void Serialize(Serializer serializer) + { + int pos = serializer.BeginContent("DataLabel"); + + if (Style != string.Empty) + serializer.WriteSimpleAttribute("Style", Style); + if (Format != string.Empty) + serializer.WriteSimpleAttribute("Format", Format); + if (!_position.IsNull) + serializer.WriteSimpleAttribute("Position", Position); + if (!_type.IsNull) + serializer.WriteSimpleAttribute("Type", Type); + if (!IsNull("Font")) + _font.Serialize(serializer); + + serializer.EndContent(pos); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(DataLabel))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Gridlines.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Gridlines.cs new file mode 100644 index 0000000..5303e73 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Gridlines.cs @@ -0,0 +1,121 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents the gridlines on the axes. + /// + public class Gridlines : ChartObject + { + /// + /// Initializes a new instance of the Gridlines class. + /// + public Gridlines() + { + } + + /// + /// Initializes a new instance of the Gridlines class with the specified parent. + /// + public Gridlines(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Gridlines Clone() + { + return (Gridlines)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Gridlines gridlines = (Gridlines)base.DeepCopy(); + if (gridlines._lineFormat != null) + { + gridlines._lineFormat = gridlines._lineFormat.Clone(); + gridlines._lineFormat._parent = gridlines; + } + return gridlines; + } + #endregion + + #region Properties + /// + /// Gets the line format of the grid. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + set + { + SetParent(value); + _lineFormat = value; + } + } + [DV] + public LineFormat _lineFormat; + #endregion + + #region public + /// + /// Converts Gridlines into DDL. + /// + public override void Serialize(Serializer serializer) + { + Axis axisObject = _parent as Axis; + + int pos = serializer.BeginContent(axisObject.CheckGridlines(this)); + + if (!IsNull("LineFormat")) + _lineFormat.Serialize(serializer); + + serializer.EndContent(); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Gridlines))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Legend.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Legend.cs new file mode 100644 index 0000000..ca1eae5 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Legend.cs @@ -0,0 +1,171 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents a legend of a chart. + /// + public class Legend : ChartObject, IVisitable + { + /// + /// Initializes a new instance of the Legend class. + /// + public Legend() + { } + + /// + /// Initializes a new instance of the Legend class with the specified parent. + /// + public Legend(DocumentObject parent) : base(parent) { } + + #region Serialization + /// + /// Creates a deep copy of this object. + /// + public new Legend Clone() + { + return (Legend)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Legend legend = (Legend)base.DeepCopy(); + if (legend._format != null) + { + legend._format = legend._format.Clone(); + legend._format._parent = legend; + } + if (legend._lineFormat != null) + { + legend._lineFormat = legend._lineFormat.Clone(); + legend._lineFormat._parent = legend; + } + return legend; + } + #endregion + + #region Properties + /// + /// Gets or sets the style name of the legend's text. + /// + public string Style + { + get { return _style.Value; } + set { _style.Value = value; } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets the paragraph format of the legend's text. + /// + public ParagraphFormat Format + { + get { return _format ?? (_format = new ParagraphFormat(this)); } + set + { + SetParent(value); + _format = value; + } + } + [DV] + public ParagraphFormat _format; + + /// + /// Gets the line format of the legend's border. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + set + { + SetParent(value); + _lineFormat = value; + } + } + [DV] + public LineFormat _lineFormat; + #endregion + + #region public + /// + /// Converts Legend into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteLine("\\legend"); + int pos = serializer.BeginAttributes(); + + if (!_style.IsNull) + serializer.WriteSimpleAttribute("Style", Style); + + if (!IsNull("Format")) + _format.Serialize(serializer, "Format", null); + + if (!IsNull("LineFormat")) + _lineFormat.Serialize(serializer); + + serializer.EndAttributes(pos); + } + + /// + /// Determines whether this instance is null (not set). + /// + public override bool IsNull() + { + // legend objects are never null, i.e. the presence of this object is meaningful. + return false; + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Legend))); } + } + static Meta _meta; + #endregion + + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitLegend(this); + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/PlotArea.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/PlotArea.cs new file mode 100644 index 0000000..6f3bc14 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/PlotArea.cs @@ -0,0 +1,198 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents the area where the actual chart is drawn. + /// + public class PlotArea : ChartObject + { + /// + /// Initializes a new instance of the PlotArea class. + /// + public PlotArea() + { + } + + /// + /// Initializes a new instance of the PlotArea class with the specified parent. + /// + public PlotArea(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new PlotArea Clone() + { + return (PlotArea)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + PlotArea plotArea = (PlotArea)base.DeepCopy(); + if (plotArea._lineFormat != null) + { + plotArea._lineFormat = plotArea._lineFormat.Clone(); + plotArea._lineFormat._parent = plotArea; + } + if (plotArea._fillFormat != null) + { + plotArea._fillFormat = plotArea._fillFormat.Clone(); + plotArea._fillFormat._parent = plotArea; + } + return plotArea; + } + #endregion + + #region Properties + /// + /// Gets the line format of the plot area's border. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + set + { + SetParent(value); + _lineFormat = value; + } + } + [DV] + public LineFormat _lineFormat; + + /// + /// Gets the background filling of the plot area. + /// + public FillFormat FillFormat + { + get { return _fillFormat ?? (_fillFormat = new FillFormat(this)); } + set + { + SetParent(value); + _fillFormat = value; + } + } + [DV] + public FillFormat _fillFormat; + + /// + /// Gets or sets the left padding of the area. + /// + public Unit LeftPadding + { + get { return _leftPadding; } + set { _leftPadding = value; } + } + [DV] + public Unit _leftPadding = Unit.NullValue; + + /// + /// Gets or sets the right padding of the area. + /// + public Unit RightPadding + { + get { return _rightPadding; } + set { _rightPadding = value; } + } + [DV] + public Unit _rightPadding = Unit.NullValue; + + /// + /// Gets or sets the top padding of the area. + /// + public Unit TopPadding + { + get { return _topPadding; } + set { _topPadding = value; } + } + [DV] + public Unit _topPadding = Unit.NullValue; + + /// + /// Gets or sets the bottom padding of the area. + /// + public Unit BottomPadding + { + get { return _bottomPadding; } + set { _bottomPadding = value; } + } + [DV] + public Unit _bottomPadding = Unit.NullValue; + #endregion + + #region public + /// + /// Converts PlotArea into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteLine("\\plotarea"); + int pos = serializer.BeginAttributes(); + + if (!_topPadding.IsNull) + serializer.WriteSimpleAttribute("TopPadding", TopPadding); + if (!_leftPadding.IsNull) + serializer.WriteSimpleAttribute("LeftPadding", LeftPadding); + if (!_rightPadding.IsNull) + serializer.WriteSimpleAttribute("RightPadding", RightPadding); + if (!_bottomPadding.IsNull) + serializer.WriteSimpleAttribute("BottomPadding", BottomPadding); + + if (!IsNull("LineFormat")) + _lineFormat.Serialize(serializer); + if (!IsNull("FillFormat")) + _fillFormat.Serialize(serializer); + + serializer.EndAttributes(pos); + + serializer.BeginContent(); + serializer.EndContent(); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(PlotArea))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Point.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Point.cs new file mode 100644 index 0000000..a2dfd6b --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Point.cs @@ -0,0 +1,167 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents a formatted value on the data series. + /// + public class Point : ChartObject + { + /// + /// Initializes a new instance of the Point class. + /// + public Point() + { } + + /// + /// Initializes a new instance of the Point class with a real value. + /// + public Point(double value) + : this() + { + Value = value; + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Point Clone() + { + return (Point)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Point point = (Point)base.DeepCopy(); + if (point._lineFormat != null) + { + point._lineFormat = point._lineFormat.Clone(); + point._lineFormat._parent = point; + } + if (point._fillFormat != null) + { + point._fillFormat = point._fillFormat.Clone(); + point._fillFormat._parent = point; + } + return point; + } + #endregion + + #region Properties + /// + /// Gets the line format of the data point's border. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + set + { + SetParent(value); + _lineFormat = value; + } + } + [DV] + public LineFormat _lineFormat; + + /// + /// Gets the filling format of the data point. + /// + public FillFormat FillFormat + { + get { return _fillFormat ?? (_fillFormat = new FillFormat(this)); } + set + { + SetParent(value); + _fillFormat = value; + } + } + [DV] + public FillFormat _fillFormat; + + /// + /// The actual value of the data point. + /// + public double Value + { + get { return _value.Value; } + set { _value.Value = value; } + } + [DV] + public NDouble _value = NDouble.NullValue; + #endregion + + #region public + /// + /// Converts Point into DDL. + /// + public override void Serialize(Serializer serializer) + { + if (!IsNull("LineFormat") || !IsNull("FillFormat")) + { + serializer.WriteLine(""); + serializer.WriteLine("\\point"); + int pos = serializer.BeginAttributes(); + + if (!IsNull("LineFormat")) + _lineFormat.Serialize(serializer); + if (!IsNull("FillFormat")) + _fillFormat.Serialize(serializer); + + serializer.EndAttributes(pos); + serializer.BeginContent(); + serializer.WriteLine(Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); + serializer.EndContent(); + } + else + serializer.Write(Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); + + serializer.Write(", "); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Point))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Series.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Series.cs new file mode 100644 index 0000000..09bc6eb --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Series.cs @@ -0,0 +1,318 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents a series of data on the chart. + /// + public class Series : ChartObject + { + /// + /// Initializes a new instance of the Series class. + /// + public Series() + { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Series Clone() + { + return (Series)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Series series = (Series)base.DeepCopy(); + if (series._seriesElements != null) + { + series._seriesElements = series._seriesElements.Clone(); + series._seriesElements._parent = series; + } + if (series._lineFormat != null) + { + series._lineFormat = series._lineFormat.Clone(); + series._lineFormat._parent = series; + } + if (series._fillFormat != null) + { + series._fillFormat = series._fillFormat.Clone(); + series._fillFormat._parent = series; + } + if (series._dataLabel != null) + { + series._dataLabel = series._dataLabel.Clone(); + series._dataLabel._parent = series; + } + return series; + } + + /// + /// Adds a blank to the series. + /// + public void AddBlank() + { + Elements.AddBlank(); + } + + /// + /// Adds a real value to the series. + /// + public Point Add(double value) + { + return Elements.Add(value); + } + + /// + /// Adds an array of real values to the series. + /// + public void Add(params double[] values) + { + Elements.Add(values); + } + #endregion + + #region Properties + /// + /// The actual value container of the series. + /// + public SeriesElements Elements + { + get { return _seriesElements ?? (_seriesElements = new SeriesElements(this)); } + set + { + SetParent(value); + _seriesElements = value; + } + } + [DV] + public SeriesElements _seriesElements; + + /// + /// Gets or sets the name of the series which will be used in the legend. + /// + public string Name + { + get { return _name.Value; } + set { _name.Value = value; } + } + [DV] + public NString _name = NString.NullValue; + + /// + /// Gets the line format of the border of each data. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + set + { + SetParent(value); + _lineFormat = value; + } + } + [DV] + public LineFormat _lineFormat; + + /// + /// Gets the background filling of the data. + /// + public FillFormat FillFormat + { + get { return _fillFormat ?? (_fillFormat = new FillFormat(this)); } + set + { + SetParent(value); + _fillFormat = value; + } + } + [DV] + public FillFormat _fillFormat; + + /// + /// Gets or sets the size of the marker in a line chart. + /// + public Unit MarkerSize + { + get { return _markerSize; } + set { _markerSize = value; } + } + [DV] + public Unit _markerSize = Unit.NullValue; + + /// + /// Gets or sets the style of the marker in a line chart. + /// + public MarkerStyle MarkerStyle + { + get { return (MarkerStyle)_markerStyle.Value; } + set { _markerStyle.Value = (int)value; } + } + [DV(Type = typeof(MarkerStyle))] + public NEnum _markerStyle = NEnum.NullValue(typeof(MarkerStyle)); + + /// + /// Gets or sets the foreground color of the marker in a line chart. + /// + public Color MarkerForegroundColor + { + get { return _markerForegroundColor; } + set { _markerForegroundColor = value; } + } + [DV] + public Color _markerForegroundColor = Color.Empty; + + /// + /// Gets or sets the background color of the marker in a line chart. + /// + public Color MarkerBackgroundColor + { + get { return _markerBackgroundColor; } + set { _markerBackgroundColor = value; } + } + [DV] + public Color _markerBackgroundColor = Color.Empty; + + /// + /// Gets or sets the chart type of the series if it's intended to be different than the global chart type. + /// + public ChartType ChartType + { + get { return (ChartType)_chartType.Value; } + set { _chartType.Value = (int)value; } + } + [DV(Type = typeof(ChartType))] + public NEnum _chartType = NEnum.NullValue(typeof(ChartType)); + + /// + /// Gets the DataLabel of the series. + /// + public DataLabel DataLabel + { + get { return _dataLabel ?? (_dataLabel = new DataLabel(this)); } + set + { + SetParent(value); + _dataLabel = value; + } + } + [DV] + public DataLabel _dataLabel; + + /// + /// Gets or sets whether the series has a DataLabel. + /// + public bool HasDataLabel + { + get { return _hasDataLabel.Value; } + set { _hasDataLabel.Value = value; } + } + [DV] + public NBool _hasDataLabel = NBool.NullValue; + + /// + /// Gets the elementcount of the series. + /// + public int Count + { + get + { + if (_seriesElements != null) + return _seriesElements.Count; + + return 0; + } + } + #endregion + + #region public + /// + /// Converts Series into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteLine("\\series"); + + int pos = serializer.BeginAttributes(); + + if (!_name.IsNull) + serializer.WriteSimpleAttribute("Name", Name); + + if (!_markerSize.IsNull) + serializer.WriteSimpleAttribute("MarkerSize", MarkerSize); + if (!_markerStyle.IsNull) + serializer.WriteSimpleAttribute("MarkerStyle", MarkerStyle); + + if (!_markerBackgroundColor.IsNull) + serializer.WriteSimpleAttribute("MarkerBackgroundColor", MarkerBackgroundColor); + if (!_markerForegroundColor.IsNull) + serializer.WriteSimpleAttribute("MarkerForegroundColor", MarkerForegroundColor); + + if (!_chartType.IsNull) + serializer.WriteSimpleAttribute("ChartType", ChartType); + + if (!_hasDataLabel.IsNull) + serializer.WriteSimpleAttribute("HasDataLabel", HasDataLabel); + + if (!IsNull("LineFormat")) + _lineFormat.Serialize(serializer); + if (!IsNull("FillFormat")) + _fillFormat.Serialize(serializer); + if (!IsNull("DataLabel")) + _dataLabel.Serialize(serializer); + + serializer.EndAttributes(pos); + + serializer.BeginContent(); + _seriesElements.Serialize(serializer); + serializer.WriteLine(""); + serializer.EndContent(); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Series))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/SeriesCollection.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/SeriesCollection.cs new file mode 100644 index 0000000..78d6fb3 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/SeriesCollection.cs @@ -0,0 +1,106 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// The collection of data series. + /// + public class SeriesCollection : DocumentObjectCollection + { + /// + /// Initializes a new instance of the SeriesCollection class. + /// + public SeriesCollection() + { + } + + /// + /// Initializes a new instance of the SeriesCollection class with the specified parent. + /// + public SeriesCollection(DocumentObject parent) : base(parent) { } + + /// + /// Gets a series by its index. + /// + public new Series this[int index] + { + get { return base[index] as Series; } + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new SeriesCollection Clone() + { + return (SeriesCollection)DeepCopy(); + } + + /// + /// Adds a new series to the collection. + /// + public Series AddSeries() + { + Series series = new Series(); + Add(series); + return series; + } + #endregion + + #region public + /// + /// Converts SeriesCollection into DDL. + /// + public override void Serialize(Serializer serializer) + { + int count = Count; + for (int index = 0; index < count; ++index) + { + Series series = this[index]; + series.Serialize(serializer); + } + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(SeriesCollection))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/SeriesElements.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/SeriesElements.cs new file mode 100644 index 0000000..9496114 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/SeriesElements.cs @@ -0,0 +1,117 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents the collection of the values in a data series. + /// + public class SeriesElements : DocumentObjectCollection + { + /// + /// Initializes a new instance of the SeriesElements class. + /// + public SeriesElements() + { } + + /// + /// Initializes a new instance of the SeriesElements class with the specified parent. + /// + public SeriesElements(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new SeriesElements Clone() + { + return (SeriesElements)DeepCopy(); + } + + /// + /// Adds a blank to the series. + /// + public void AddBlank() + { + base.Add(null); + } + + /// + /// Adds a new point with a real value to the series. + /// + public Point Add(double value) + { + Point point = new Point(value); + Add(point); + return point; + } + + /// + /// Adds an array of new points with real values to the series. + /// + public void Add(params double[] values) + { + foreach (double val in values) + Add(val); + } + #endregion + + #region public + /// + /// Converts SeriesElements into DDL. + /// + public override void Serialize(Serializer serializer) + { + int count = Count; + for (int index = 0; index < count; ++index) + { + Point point = this[index] as Point; + if (point == null) + serializer.Write("null, "); + else + point.Serialize(serializer); + } + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(SeriesElements))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/TextArea.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/TextArea.cs new file mode 100644 index 0000000..60797a8 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/TextArea.cs @@ -0,0 +1,379 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Tables; +using MigraDoc.DocumentObjectModel.Visitors; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// An area object in the chart which contain text or legend. + /// + public class TextArea : ChartObject, IVisitable + { + /// + /// Initializes a new instance of the TextArea class. + /// + public TextArea() + { } + + /// + /// Initializes a new instance of the TextArea class with the specified parent. + /// + public TextArea(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new TextArea Clone() + { + return (TextArea)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + TextArea textArea = (TextArea)base.DeepCopy(); + if (textArea._format != null) + { + textArea._format = textArea._format.Clone(); + textArea._format._parent = textArea; + } + if (textArea._lineFormat != null) + { + textArea._lineFormat = textArea._lineFormat.Clone(); + textArea._lineFormat._parent = textArea; + } + if (textArea._fillFormat != null) + { + textArea._fillFormat = textArea._fillFormat.Clone(); + textArea._fillFormat._parent = textArea; + } + if (textArea._elements != null) + { + textArea._elements = textArea._elements.Clone(); + textArea._elements._parent = textArea; + } + return textArea; + } + + /// + /// Adds a new paragraph to the text area. + /// + public Paragraph AddParagraph() + { + return Elements.AddParagraph(); + } + + /// + /// Adds a new paragraph with the specified text to the text area. + /// + public Paragraph AddParagraph(string paragraphText) + { + return Elements.AddParagraph(paragraphText); + } + + /// + /// Adds a new table to the text area. + /// + public Table AddTable() + { + return Elements.AddTable(); + } + + /// + /// Adds a new Image to the text area. + /// + public Image AddImage(string fileName) + { + return Elements.AddImage(fileName); + } + + /// + /// Adds a new legend to the text area. + /// + public Legend AddLegend() + { + return Elements.AddLegend(); + } + + /// + /// Adds a new paragraph to the text area. + /// + public void Add(Paragraph paragraph) + { + Elements.Add(paragraph); + } + + /// + /// Adds a new table to the text area. + /// + public void Add(Table table) + { + Elements.Add(table); + } + + /// + /// Adds a new image to the text area. + /// + public void Add(Image image) + { + Elements.Add(image); + } + + /// + /// Adds a new legend to the text area. + /// + public void Add(Legend legend) + { + Elements.Add(legend); + } + #endregion + + #region Properties + /// + /// Gets or sets the height of the area. + /// + public Unit Height + { + get { return _height; } + set { _height = value; } + } + [DV] + public Unit _height = Unit.NullValue; + + /// + /// Gets or sets the width of the area. + /// + public Unit Width + { + get { return _width; } + set { _width = value; } + } + [DV] + public Unit _width = Unit.NullValue; + + /// + /// Gets or sets the default style name of the area. + /// + public string Style + { + get { return _style.Value; } + set { _style.Value = value; } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets or sets the default paragraph format of the area. + /// + public ParagraphFormat Format + { + get { return _format ?? (_format = new ParagraphFormat(this)); } + set + { + SetParent(value); + _format = value; + } + } + [DV] + public ParagraphFormat _format; + + /// + /// Gets the line format of the area's border. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + set + { + SetParent(value); + _lineFormat = value; + } + } + [DV] + public LineFormat _lineFormat; + + /// + /// Gets the background filling of the area. + /// + public FillFormat FillFormat + { + get { return _fillFormat ?? (_fillFormat = new FillFormat(this)); } + set + { + SetParent(value); + _fillFormat = value; + } + } + [DV] + public FillFormat _fillFormat; + + /// + /// Gets or sets the left padding of the area. + /// + public Unit LeftPadding + { + get { return _leftPadding; } + set { _leftPadding = value; } + } + [DV] + public Unit _leftPadding = Unit.NullValue; + + /// + /// Gets or sets the right padding of the area. + /// + public Unit RightPadding + { + get { return _rightPadding; } + set { _rightPadding = value; } + } + [DV] + public Unit _rightPadding = Unit.NullValue; + + /// + /// Gets or sets the top padding of the area. + /// + public Unit TopPadding + { + get { return _topPadding; } + set { _topPadding = value; } + } + [DV] + public Unit _topPadding = Unit.NullValue; + + /// + /// Gets or sets the bottom padding of the area. + /// + public Unit BottomPadding + { + get { return _bottomPadding; } + set { _bottomPadding = value; } + } + [DV] + public Unit _bottomPadding = Unit.NullValue; + + /// + /// Gets or sets the Vertical alignment of the area. + /// + public VerticalAlignment VerticalAlignment + { + get { return (VerticalAlignment)_verticalAlignment.Value; } + set { _verticalAlignment.Value = (int)value; } + } + [DV(Type = typeof(VerticalAlignment))] + public NEnum _verticalAlignment = NEnum.NullValue(typeof(VerticalAlignment)); + + /// + /// Gets the document objects that creates the text area. + /// + public DocumentElements Elements + { + get { return _elements ?? (_elements = new DocumentElements(this)); } + set + { + SetParent(value); + _elements = value; + } + } + [DV(ItemType = typeof(DocumentObject))] + public DocumentElements _elements; + #endregion + + #region public + /// + /// Converts TextArea into DDL. + /// + public override void Serialize(Serializer serializer) + { + Chart chartObject = _parent as Chart; + + serializer.WriteLine("\\" + chartObject.CheckTextArea(this)); + int pos = serializer.BeginAttributes(); + + if (!_style.IsNull) + serializer.WriteSimpleAttribute("Style", Style); + if (!IsNull("Format")) + _format.Serialize(serializer, "Format", null); + + if (!_topPadding.IsNull) + serializer.WriteSimpleAttribute("TopPadding", TopPadding); + if (!_leftPadding.IsNull) + serializer.WriteSimpleAttribute("LeftPadding", LeftPadding); + if (!_rightPadding.IsNull) + serializer.WriteSimpleAttribute("RightPadding", RightPadding); + if (!_bottomPadding.IsNull) + serializer.WriteSimpleAttribute("BottomPadding", BottomPadding); + + if (!_width.IsNull) + serializer.WriteSimpleAttribute("Width", Width); + if (!_height.IsNull) + serializer.WriteSimpleAttribute("Height", Height); + + if (!_verticalAlignment.IsNull) + serializer.WriteSimpleAttribute("VerticalAlignment", VerticalAlignment); + + if (!IsNull("LineFormat")) + _lineFormat.Serialize(serializer); + if (!IsNull("FillFormat")) + _fillFormat.Serialize(serializer); + + serializer.EndAttributes(pos); + + serializer.BeginContent(); + if (_elements != null) + _elements.Serialize(serializer); + serializer.EndContent(); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(TextArea))); } + } + static Meta _meta; + #endregion + + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitTextArea(this); + if (_elements != null && visitChildren) + ((IVisitable)_elements).AcceptVisitor(visitor, visitChildren); + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/TickLabels.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/TickLabels.cs new file mode 100644 index 0000000..88f6432 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/TickLabels.cs @@ -0,0 +1,146 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents the format of the label of each value on the axis. + /// + public class TickLabels : ChartObject + { + /// + /// Initializes a new instance of the TickLabels class. + /// + public TickLabels() + { } + + /// + /// Initializes a new instance of the TickLabels class with the specified parent. + /// + public TickLabels(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new TickLabels Clone() + { + return (TickLabels)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + TickLabels tickLabels = (TickLabels)base.DeepCopy(); + if (tickLabels._font != null) + { + tickLabels._font = tickLabels._font.Clone(); + tickLabels._font._parent = tickLabels; + } + return tickLabels; + } + #endregion + + #region Properties + /// + /// Gets or sets the style name of the label. + /// + public string Style + { + get { return _style.Value; } + set { _style.Value = value; } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets or sets the label's number format. + /// + public string Format + { + get { return _format.Value; } + set { _format.Value = value; } + } + [DV] + public NString _format = NString.NullValue; + + /// + /// Gets the font of the label. + /// + public Font Font + { + get { return _font ?? (_font = new Font(this)); } + set + { + SetParent(value); + _font = value; + } + } + [DV] + public Font _font; + #endregion + + #region public + /// + /// Converts TickLabels into DDL. + /// + public override void Serialize(Serializer serializer) + { + int pos = serializer.BeginContent("TickLabels"); + + if (!_style.IsNull) + serializer.WriteSimpleAttribute("Style", Style); + + if (_font != null) + _font.Serialize(serializer); + + if (!_format.IsNull) + serializer.WriteSimpleAttribute("Format", Format); + + serializer.EndContent(); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(TickLabels))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/XSeries.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/XSeries.cs new file mode 100644 index 0000000..7bfab8a --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/XSeries.cs @@ -0,0 +1,128 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents a series of data on the X-Axis. + /// + public class XSeries : ChartObject + { + /// + /// Initializes a new instance of the XSeries class. + /// + public XSeries() + { + _xSeriesElements = new XSeriesElements(); + } + + /// + /// The actual value container of the XSeries. + /// + [DV] + public XSeriesElements _xSeriesElements; + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new XSeries Clone() + { + return (XSeries)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + XSeries xSeries = (XSeries)base.DeepCopy(); + if (xSeries._xSeriesElements != null) + { + xSeries._xSeriesElements = xSeries._xSeriesElements.Clone(); + xSeries._xSeriesElements._parent = xSeries; + } + return xSeries; + } + + /// + /// Adds a blank to the XSeries. + /// + public void AddBlank() + { + _xSeriesElements.AddBlank(); + } + + /// + /// Adds a value to the XSeries. + /// + public XValue Add(string value) + { + return _xSeriesElements.Add(value); + } + + /// + /// Adds an array of values to the XSeries. + /// + public void Add(params string[] values) + { + _xSeriesElements.Add(values); + } + #endregion + + #region public + /// + /// Converts XSeries into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteLine("\\xvalues"); + + serializer.BeginContent(); + _xSeriesElements.Serialize(serializer); + serializer.WriteLine(""); + serializer.EndContent(); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(XSeries))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/XSeriesElements.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/XSeriesElements.cs new file mode 100644 index 0000000..ce254db --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/XSeriesElements.cs @@ -0,0 +1,112 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents the collection of the value in an XSeries. + /// + public class XSeriesElements : DocumentObjectCollection + { + /// + /// Initializes a new instance of the XSeriesElements class. + /// + public XSeriesElements() + { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new XSeriesElements Clone() + { + return (XSeriesElements)base.DeepCopy(); + } + + /// + /// Adds a blank to the XSeries. + /// + public void AddBlank() + { + base.Add(null); + } + + /// + /// Adds a value to the XSeries. + /// + public XValue Add(string value) + { + XValue xValue = new XValue(value); + Add(xValue); + return xValue; + } + + /// + /// Adds an array of values to the XSeries. + /// + public void Add(params string[] values) + { + foreach (string val in values) + Add(val); + } + #endregion + + #region public + /// + /// Converts XSeriesElements into DDL. + /// + public override void Serialize(Serializer serializer) + { + int count = Count; + for (int index = 0; index < count; index++) + { + XValue xValue = this[index] as XValue; + if (xValue == null) + serializer.Write("null, "); + else + xValue.Serialize(serializer); + } + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(XSeriesElements))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/XValue.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/XValue.cs new file mode 100644 index 0000000..0bb72f1 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/XValue.cs @@ -0,0 +1,96 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents the actual value on the XSeries. + /// + public class XValue : ChartObject + { + /// + /// Initializes a new instance of the XValue class. + /// + public XValue() + { } + + /// + /// Initializes a new instance of the XValue class with the specified value. + /// + public XValue(string value) + : this() + { + if (value == null) + throw new ArgumentNullException("value"); + + Value = value; + } + + /// + /// The actual value of the XValue. + /// + [DV] // No Get- and Set -Property. + public string Value; + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new XValue Clone() + { + return (XValue)DeepCopy(); + } + #endregion + + #region public + /// + /// Converts XValue into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.Write("\"" + Value + "\", "); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(XValue))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/XValues.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/XValues.cs new file mode 100644 index 0000000..ad90d5e --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/XValues.cs @@ -0,0 +1,106 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Represents the collection of values on the X-Axis. + /// + public class XValues : DocumentObjectCollection + { + /// + /// Initializes a new instance of the XValues class. + /// + public XValues() + { + } + + /// + /// Initializes a new instance of the XValues class with the specified parent. + /// + public XValues(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new XValues Clone() + { + return (XValues)DeepCopy(); + } + + /// + /// Gets an XSeries by its index. + /// + public new XSeries this[int index] + { + get { return base[index] as XSeries; } + } + + /// + /// Adds a new XSeries to the collection. + /// + public XSeries AddXSeries() + { + XSeries xSeries = new XSeries(); + Add(xSeries); + return xSeries; + } + #endregion + + #region public + /// + /// Converts XValues into DDL. + /// + public override void Serialize(Serializer serializer) + { + int count = Count; + for (int index = 0; index < count; ++index) + { + XSeries xSeries = this[index] as XSeries; + xSeries.Serialize(serializer); + } + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(XValues))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/BlankType.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/BlankType.cs new file mode 100644 index 0000000..a91eb10 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/BlankType.cs @@ -0,0 +1,55 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Determines how null values will be handled in a chart. + /// + public enum BlankType + { + /// + /// Null value is not plotted. + /// + NotPlotted, + + /// + /// Null value will be interpolated. + /// + Interpolated, + + /// + /// Null value will be handled as zero. + /// + Zero + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/ChartType.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/ChartType.cs new file mode 100644 index 0000000..4a69127 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/ChartType.cs @@ -0,0 +1,80 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Specifies with type of chart will be drawn. + /// + public enum ChartType + { + /// + /// A line chart. + /// + Line, + + /// + /// A clustered 2d column chart. + /// + Column2D, + + /// + /// A stacked 2d column chart. + /// + ColumnStacked2D, + + /// + /// A 2d area chart. + /// + Area2D, + + /// + /// A clustered 2d bar chart. + /// + Bar2D, + + /// + /// A stacked 2d bar chart. + /// + BarStacked2D, + + /// + /// A 2d pie chart. + /// + Pie2D, + + /// + /// An exploded 2d pie chart. + /// + PieExploded2D, + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/DataLabelPosition.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/DataLabelPosition.cs new file mode 100644 index 0000000..90d361c --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/DataLabelPosition.cs @@ -0,0 +1,60 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Determines where the data label will be positioned. + /// + public enum DataLabelPosition + { + /// + /// DataLabel will be centered inside the bar or pie. + /// + Center, + + /// + /// Inside the bar or pie at the origin. + /// + InsideBase, + + /// + /// Inside the bar or pie at the edge. + /// + InsideEnd, + + /// + /// Outside the bar or pie. + /// + OutsideEnd + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/DataLabelType.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/DataLabelType.cs new file mode 100644 index 0000000..31a15c2 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/DataLabelType.cs @@ -0,0 +1,55 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Determines the type of the data label. + /// + public enum DataLabelType + { + /// + /// No DataLabel. + /// + None, + + /// + /// Percentage of the data. For pie charts only. + /// + Percent, + + /// + /// Value of the data. + /// + Value + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/HorizontalAlignment.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/HorizontalAlignment.cs new file mode 100644 index 0000000..20f0c9b --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/HorizontalAlignment.cs @@ -0,0 +1,53 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Used to determine the horizontal alignment of the axis title. + /// + public enum HorizontalAlignment + { + /// + /// Axis title will be left aligned. + /// + Left, + /// + /// Axis title will be right aligned. + /// + Right, + /// + /// Axis title will be centered. + /// + Center + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/MarkerStyle.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/MarkerStyle.cs new file mode 100644 index 0000000..077150f --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/MarkerStyle.cs @@ -0,0 +1,53 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Symbols of a data point in a line chart. + /// + public enum MarkerStyle + { + None, + Circle, + Dash, + Diamond, + Dot, + Plus, + Square, + Star, + Triangle, + X + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/TickMarkType.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/TickMarkType.cs new file mode 100644 index 0000000..f0959c9 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/enums/TickMarkType.cs @@ -0,0 +1,60 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Shapes.Charts +{ + /// + /// Determines the position where the Tickmarks will be rendered. + /// + public enum TickMarkType + { + /// + /// Tickmarks are not rendered. + /// + None, + + /// + /// Tickmarks are rendered inside the plot area. + /// + Inside, + + /// + /// Tickmarks are rendered outside the plot area. + /// + Outside, + + /// + /// Tickmarks are rendered inside and outside the plot area. + /// + Cross + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/Barcode.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/Barcode.cs new file mode 100644 index 0000000..9f00dff --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/Barcode.cs @@ -0,0 +1,197 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Represents a barcode in the document or paragraph. !!!Still under Construction!!! + /// + public class Barcode : Shape + { + /// + /// Initializes a new instance of the Barcode class. + /// + public Barcode() + { } + + /// + /// Initializes a new instance of the Barcode class with the specified parent. + /// + public Barcode(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Barcode Clone() + { + return (Barcode)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets the text orientation for the barcode content. + /// + public TextOrientation Orientation + { + get { return (TextOrientation)_orientation.Value; } + set { _orientation.Value = (int)value; } + } + [DV(Type = typeof(TextOrientation))] + public NEnum _orientation = NEnum.NullValue(typeof(TextOrientation)); + + /// + /// Gets or sets the type of the barcode. + /// + public BarcodeType Type + { + get { return (BarcodeType)_type.Value; } + set { _type.Value = (int)value; } + } + [DV(Type = typeof(BarcodeType))] + public NEnum _type = NEnum.NullValue(typeof(BarcodeType)); + + /// + /// Gets or sets a value indicating whether bars shall appear beside the barcode + /// + public bool BearerBars + { + get { return _bearerBars.Value; } + set { _bearerBars.Value = value; } + } + [DV] + public NBool _bearerBars = NBool.NullValue; + + /// + /// Gets or sets the a value indicating whether the barcode's code is rendered. + /// + public bool Text + { + get { return _text.Value; } + set { _text.Value = value; } + } + [DV] + public NBool _text = NBool.NullValue; + + /// + /// Gets or sets code the barcode represents. + /// + public string Code + { + get { return _code.Value; } + set { _code.Value = value; } + } + [DV] + public NString _code = NString.NullValue; + + /// + /// ??? + /// + public double LineRatio + { + get { return _lineRatio.Value; } + set { _lineRatio.Value = value; } + } + [DV] + public NDouble _lineRatio = NDouble.NullValue; + + /// + /// ??? + /// + public double LineHeight + { + get { return _lineHeight.Value; } + set { _lineHeight.Value = value; } + } + [DV] + public NDouble _lineHeight = NDouble.NullValue; + + /// + /// ??? + /// + public double NarrowLineWidth + { + get { return _narrowLineWidth.Value; } + set { _narrowLineWidth.Value = value; } + } + [DV] + public NDouble _narrowLineWidth = NDouble.NullValue; + #endregion + + #region public + /// + /// Converts Barcode into DDL. + /// + public override void Serialize(Serializer serializer) + { + if (_code.Value == "") + throw new InvalidOperationException(DomSR.MissingObligatoryProperty("Name", "BookmarkField")); + + serializer.WriteLine("\\barcode(\"" + Code + "\")"); + + int pos = serializer.BeginAttributes(); + + base.Serialize(serializer); + + if (!_orientation.IsNull) + serializer.WriteSimpleAttribute("Orientation", Orientation); + if (!_bearerBars.IsNull) + serializer.WriteSimpleAttribute("BearerBars", BearerBars); + if (!_text.IsNull) + serializer.WriteSimpleAttribute("Text", Text); + if (!_type.IsNull) + serializer.WriteSimpleAttribute("Type", Type); + if (!_lineRatio.IsNull) + serializer.WriteSimpleAttribute("LineRatio", LineRatio); + if (!_lineHeight.IsNull) + serializer.WriteSimpleAttribute("LineHeight", LineHeight); + if (!_narrowLineWidth.IsNull) + serializer.WriteSimpleAttribute("NarrowLineWidth", NarrowLineWidth); + + serializer.EndAttributes(pos); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Barcode))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/FillFormat.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/FillFormat.cs new file mode 100644 index 0000000..3976351 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/FillFormat.cs @@ -0,0 +1,111 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Defines the background filling of the shape. + /// + public class FillFormat : DocumentObject + { + /// + /// Initializes a new instance of the FillFormat class. + /// + public FillFormat() + { } + + /// + /// Initializes a new instance of the FillFormat class with the specified parent. + /// + public FillFormat(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new FillFormat Clone() + { + return (FillFormat)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets the color of the filling. + /// + public Color Color + { + get { return _color; } + set { _color = value; } + } + [DV] + public Color _color = Color.Empty; + + /// + /// Gets or sets a value indicating whether the background color should be visible. + /// + public bool Visible + { + get { return _visible.Value; } + set { _visible.Value = value; } + } + [DV] + public NBool _visible = NBool.NullValue; + #endregion + + #region public + /// + /// Converts FillFormat into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.BeginContent("FillFormat"); + if (!_visible.IsNull) + serializer.WriteSimpleAttribute("Visible", Visible); + if (!_color.IsNull) + serializer.WriteSimpleAttribute("Color", Color); + serializer.EndContent(); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(FillFormat))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/Image.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/Image.cs new file mode 100644 index 0000000..939decd --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/Image.cs @@ -0,0 +1,236 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.IO; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Represents an image in the document or paragraph. + /// + public class Image : Shape + { + /// + /// Initializes a new instance of the Image class. + /// + public Image() + { } + + /// + /// Initializes a new instance of the Image class with the specified parent. + /// + public Image(DocumentObject parent) : base(parent) { } + + /// + /// Initializes a new instance of the Image class from the specified (file) name. + /// + public Image(string name) + : this() + { + Name = name; + } + + //#region Methods + /// + /// Creates a deep copy of this object. + /// + public new Image Clone() + { + return (Image)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Image image = (Image)base.DeepCopy(); + if (image._pictureFormat != null) + { + image._pictureFormat = image._pictureFormat.Clone(); + image._pictureFormat._parent = image; + } + return image; + } + //#endregion + + //#region Properties + /// + /// Gets or sets the name of the image. + /// + public string Name + { + get { return _name.Value; } + set { _name.Value = value; } + } + [DV] + public NString _name = NString.NullValue; + + /// + /// Gets or sets the ScaleWidth of the image. + /// If the Width is set to, the resulting image width is ScaleWidth * Width. + /// + public double ScaleWidth + { + get { return _scaleWidth.Value; } + set { _scaleWidth.Value = value; } + } + [DV] + public NDouble _scaleWidth = NDouble.NullValue; + + /// + /// Gets or sets the ScaleHeight of the image. + /// If the Height is set too, the resulting image height is ScaleHeight * Height. + /// + public double ScaleHeight + { + get { return _scaleHeight.Value; } + set { _scaleHeight.Value = value; } + } + [DV] + public NDouble _scaleHeight = NDouble.NullValue; + + /// + /// Gets or sets whether the AspectRatio of the image is kept unchanged. + /// If both Width and Height are set, this property is ignored. + /// + public bool LockAspectRatio + { + get { return _lockAspectRatio.Value; } + set { _lockAspectRatio.Value = value; } + } + [DV] + public NBool _lockAspectRatio = NBool.NullValue; + + /// + /// Gets or sets the PictureFormat for the image + /// + public PictureFormat PictureFormat + { + get { return _pictureFormat ?? (_pictureFormat = new PictureFormat(this)); } + set + { + SetParent(value); + _pictureFormat = value; + } + } + [DV] + public PictureFormat _pictureFormat; + + /// + /// Gets or sets a user defined resolution for the image in dots per inch. + /// + public double Resolution + { + get { return _resolution.Value; } + set { _resolution.Value = value; } + } + [DV] + public NDouble _resolution = NDouble.NullValue; + //#endregion + + #region public + /// + /// Converts Image into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteLine("\\image(\"" + _name.Value.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\")"); + + int pos = serializer.BeginAttributes(); + + base.Serialize(serializer); + if (!_scaleWidth.IsNull) + serializer.WriteSimpleAttribute("ScaleWidth", ScaleWidth); + if (!_scaleHeight.IsNull) + serializer.WriteSimpleAttribute("ScaleHeight", ScaleHeight); + if (!_lockAspectRatio.IsNull) + serializer.WriteSimpleAttribute("LockAspectRatio", LockAspectRatio); + if (!_resolution.IsNull) + serializer.WriteSimpleAttribute("Resolution", Resolution); + if (!IsNull("PictureFormat")) + _pictureFormat.Serialize(serializer); + + serializer.EndAttributes(pos); + } + + /// + /// Gets the concrete image path, taking into account the DOM document's DdlFile and + /// ImagePath properties as well as the given working directory (which can be null). + /// + public string GetFilePath(string workingDir) + { + if (Name.StartsWith("base64:")) // The file is stored in the string here, so we don't have to add a path. + return Name; + + string filePath; + +#if !NETFX_CORE + if (!String.IsNullOrEmpty(workingDir)) + filePath = workingDir; + else + filePath = Directory.GetCurrentDirectory() + "\\"; +#else + throw new NotImplementedException(); + //if (!String.IsNullOrEmpty(workingDir)) + // filePath = workingDir; + //else + // filePath = Directory.GetCurrentDirectory() + "\\"; +#endif + + if (!Document.IsNull("ImagePath")) + { + string foundfile = ImageHelper.GetImageName(filePath, Name, Document.ImagePath); + if (foundfile != null) + filePath = foundfile; + else + filePath = Path.Combine(filePath, Name); + } + else + filePath = Path.Combine(filePath, Name); + + return filePath; + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Image))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/LeftPosition.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/LeftPosition.cs new file mode 100644 index 0000000..60ea9cc --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/LeftPosition.cs @@ -0,0 +1,244 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Represents the left position in a shape. + /// + public struct LeftPosition : INullableValue + { + /// + /// Initializes a new instance of the LeftPosition class from Unit. + /// + private LeftPosition(Unit value) + { + _shapePosition = ShapePosition.Undefined; + _position = value; + _notNull = !value.IsNull; + } + + /// + /// Initializes a new instance of the LeftPosition class from ShapePosition. + /// + private LeftPosition(ShapePosition value) + { + if (!(value == ShapePosition.Undefined || IsValid(value))) + throw new ArgumentException(DomSR.InvalidEnumForLeftPosition); + + _shapePosition = value; + _position = Unit.NullValue; + _notNull = (value != ShapePosition.Undefined); + } + + /// + /// Sets shapeposition enum and resets position. + /// + private void SetFromEnum(ShapePosition shapePosition) + { + if (!IsValid(shapePosition)) + throw new ArgumentException(DomSR.InvalidEnumForLeftPosition); + + _shapePosition = shapePosition; + _position = Unit.NullValue; + } + + /// + /// Sets the Position from a Unit. + /// + private void SetFromUnit(Unit unit) + { + _shapePosition = ShapePosition.Undefined; + _position = unit; + } + + /// + /// Sets the Position from an object. + /// + void INullableValue.SetValue(object value) + { + //REVIEW: Same code in TopPosition/LeftPosition. + if (value == null) + throw new ArgumentNullException("value"); + + if (value is ShapePosition) + SetFromEnum((ShapePosition)value); + + else if (value is string && Enum.IsDefined(typeof(ShapePosition), value)) + SetFromEnum((ShapePosition)Enum.Parse(typeof(ShapePosition), (string)value, true)); + else + SetFromUnit(value.ToString()); + + _notNull = true; + } + + /// + /// Gets the value of the position. + /// + object INullableValue.GetValue() + { + if (_shapePosition == ShapePosition.Undefined) + return _position; + + return _shapePosition; + } + + /// + /// Resets this instance, i.e. IsNull() will return true afterwards. + /// + void INullableValue.SetNull() + { + this = new LeftPosition(); + } + + /// + /// Determines whether this instance is null (not set). + /// + bool INullableValue.IsNull + { + get { return !_notNull; } + } + private bool _notNull; + + /// + /// Gets the value of the position in unit. + /// + public Unit Position + { + get { return _position; } + } + public Unit _position; + + /// + /// Gets the value of the position. + /// + public ShapePosition ShapePosition + { + get { return _shapePosition; } + } + public ShapePosition _shapePosition; + + /// + /// Indicates the given shapePosition is valid for LeftPosition. + /// + private static bool IsValid(ShapePosition shapePosition) + { + return shapePosition == ShapePosition.Left || + shapePosition == ShapePosition.Center || + shapePosition == ShapePosition.Right || + shapePosition == ShapePosition.Inside || + shapePosition == ShapePosition.Outside; + } + + /// + /// Converts a ShapePosition to a LeftPosition. + /// + public static implicit operator LeftPosition(ShapePosition value) + { + return new LeftPosition(value); + } + + /// + /// Converts a Unit to a LeftPosition. + /// + public static implicit operator LeftPosition(Unit value) + { + return new LeftPosition(value); + } + + /// + /// Converts a string to a LeftPosition. + /// The string is interpreted as a Unit. + /// + public static implicit operator LeftPosition(string value) + { + Unit unit = value; + return new LeftPosition(unit); + } + + /// + /// Converts a double to a LeftPosition. + /// The double is interpreted as a Unit in Point. + /// + public static implicit operator LeftPosition(double value) + { + Unit unit = value; + return new LeftPosition(unit); + } + + /// + /// Converts an integer to a LeftPosition. + /// The integer is interpreted as a Unit in Point. + /// + public static implicit operator LeftPosition(int value) + { + Unit unit = value; + return new LeftPosition(unit); + } + + /// + /// Parses the specified value. + /// + public static LeftPosition Parse(string value) + { + if (String.IsNullOrEmpty(value)) + throw new ArgumentNullException("value"); + + value = value.Trim(); + char ch = value[0]; + if (ch == '+' || ch == '-' || Char.IsNumber(ch)) + return Unit.Parse(value); + return (ShapePosition)Enum.Parse(typeof(ShapePosition), value, true); + } + + #region public + /// + /// Converts LeftPosition into DDL. + /// + public void Serialize(Serializer serializer) + { + if (_shapePosition == ShapePosition.Undefined) + serializer.WriteSimpleAttribute("Left", Position); + else + serializer.WriteSimpleAttribute("Left", ShapePosition); + } + #endregion + + /// + /// Returns the uninitialized LeftPosition object. + /// + public static readonly LeftPosition NullValue = new LeftPosition(); + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/LineFormat.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/LineFormat.cs new file mode 100644 index 0000000..da6bca1 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/LineFormat.cs @@ -0,0 +1,150 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Defines the format of a line in a shape object. + /// + public class LineFormat : DocumentObject + { + /// + /// Initializes a new instance of the LineFormat class. + /// + public LineFormat() + { } + + /// + /// Initializes a new instance of the Lineformat class with the specified parent. + /// + public LineFormat(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new LineFormat Clone() + { + return (LineFormat)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets a value indicating whether the line should be visible. + /// + public bool Visible + { + get { return _visible.Value; } + set { _visible.Value = value; } + } + [DV] + public NBool _visible = NBool.NullValue; + + /// + /// Gets or sets the width of the line in Unit. + /// + public Unit Width + { + get { return _width; } + set { _width = value; } + } + [DV] + public Unit _width = Unit.NullValue; + + /// + /// Gets or sets the color of the line. + /// + public Color Color + { + get { return _color; } + set { _color = value; } + } + [DV] + public Color _color = Color.Empty; + + /// + /// Gets or sets the dash style of the line. + /// + public DashStyle DashStyle + { + get { return (DashStyle)_dashStyle.Value; } + set { _dashStyle.Value = (int)value; } + } + [DV(Type = typeof(DashStyle))] + public NEnum _dashStyle = NEnum.NullValue(typeof(DashStyle)); + + /// + /// Gets or sets the style of the line. + /// + public LineStyle Style + { + get { return (LineStyle)_style.Value; } + set { _style.Value = (int)value; } + } + [DV(Type = typeof(LineStyle))] + public NEnum _style = NEnum.NullValue(typeof(LineStyle)); + #endregion + + #region public + /// + /// Converts LineFormat into DDL. + /// + public override void Serialize(Serializer serializer) + { + int pos = serializer.BeginContent("LineFormat"); + if (!_visible.IsNull) + serializer.WriteSimpleAttribute("Visible", Visible); + if (!_style.IsNull) + serializer.WriteSimpleAttribute("Style", Style); + if (!_dashStyle.IsNull) + serializer.WriteSimpleAttribute("DashStyle", DashStyle); + if (!_width.IsNull) + serializer.WriteSimpleAttribute("Width", Width); + if (!_color.IsNull) + serializer.WriteSimpleAttribute("Color", Color); + serializer.EndContent(); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(LineFormat))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/PictureFormat.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/PictureFormat.cs new file mode 100644 index 0000000..43c17ca --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/PictureFormat.cs @@ -0,0 +1,140 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// A PictureFormat object. + /// Used to set more detailed image attributes + /// + public class PictureFormat : DocumentObject + { + /// + /// Initializes a new instance of the PictureFormat class. + /// + public PictureFormat() + { } + + /// + /// Initializes a new instance of the PictureFormat class with the specified parent. + /// + public PictureFormat(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new PictureFormat Clone() + { + return (PictureFormat)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets the part cropped from the left of the image. + /// + public Unit CropLeft + { + get { return _cropLeft; } + set { _cropLeft = value; } + } + [DV] + protected Unit _cropLeft = Unit.NullValue; + + /// + /// Gets or sets the part cropped from the right of the image. + /// + public Unit CropRight + { + get { return _cropRight; } + set { _cropRight = value; } + } + [DV] + protected Unit _cropRight = Unit.NullValue; + + /// + /// Gets or sets the part cropped from the top of the image. + /// + public Unit CropTop + { + get { return _cropTop; } + set { _cropTop = value; } + } + [DV] + protected Unit _cropTop = Unit.NullValue; + + /// + /// Gets or sets the part cropped from the bottom of the image. + /// + public Unit CropBottom + { + get { return _cropBottom; } + set { _cropBottom = value; } + } + [DV] + protected Unit _cropBottom = Unit.NullValue; + #endregion + + #region public + /// + /// Converts PictureFormat into DDL + /// + public override void Serialize(Serializer serializer) + { + serializer.BeginContent("PictureFormat"); + if (!_cropLeft.IsNull) + serializer.WriteSimpleAttribute("CropLeft", CropLeft); + if (!_cropRight.IsNull) + serializer.WriteSimpleAttribute("CropRight", CropRight); + if (!_cropTop.IsNull) + serializer.WriteSimpleAttribute("CropTop", CropTop); + if (!_cropBottom.IsNull) + serializer.WriteSimpleAttribute("CropBottom", CropBottom); + serializer.EndContent(); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(PictureFormat))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/Shape.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/Shape.cs new file mode 100644 index 0000000..50874fc --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/Shape.cs @@ -0,0 +1,236 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Base Class for all positionable Classes. + /// + public class Shape : DocumentObject + { + /// + /// Initializes a new instance of the Shape class. + /// + public Shape() + { } + + /// + /// Initializes a new instance of the Shape class with the specified parent. + /// + public Shape(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Shape Clone() + { + return (Shape)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Shape shape = (Shape)base.DeepCopy(); + if (shape._wrapFormat != null) + { + shape._wrapFormat = shape._wrapFormat.Clone(); + shape._wrapFormat._parent = shape; + } + if (shape._lineFormat != null) + { + shape._lineFormat = shape._lineFormat.Clone(); + shape._lineFormat._parent = shape; + } + if (shape._fillFormat != null) + { + shape._fillFormat = shape._fillFormat.Clone(); + shape._fillFormat._parent = shape; + } + return shape; + } + #endregion + + #region Properties + /// + /// Gets or sets the wrapping format of the shape. + /// + public WrapFormat WrapFormat + { + get { return _wrapFormat ?? (_wrapFormat = new WrapFormat(this)); } + set + { + SetParent(value); + _wrapFormat = value; + } + } + [DV] + public WrapFormat _wrapFormat; + + /// + /// Gets or sets the reference point of the Top property. + /// + public RelativeVertical RelativeVertical + { + get { return (RelativeVertical)_relativeVertical.Value; } + set { _relativeVertical.Value = (int)value; } + } + [DV(Type = typeof(RelativeVertical))] + public NEnum _relativeVertical = NEnum.NullValue(typeof(RelativeVertical)); + + /// + /// Gets or sets the reference point of the Left property. + /// + public RelativeHorizontal RelativeHorizontal + { + get { return (RelativeHorizontal)_relativeHorizontal.Value; } + set { _relativeHorizontal.Value = (int)value; } + } + [DV(Type = typeof(RelativeHorizontal))] + public NEnum _relativeHorizontal = NEnum.NullValue(typeof(RelativeHorizontal)); + + /// + /// Gets or sets the position of the top side of the shape. + /// + public TopPosition Top + { + get { return _top; } + set { _top = value; } + } + [DV] + public TopPosition _top = TopPosition.NullValue; + + /// + /// Gets or sets the position of the left side of the shape. + /// + public LeftPosition Left + { + get { return _left; } + set { _left = value; } + } + [DV] + public LeftPosition _left = LeftPosition.NullValue; + + /// + /// Gets the line format of the shape's border. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + set + { + SetParent(value); + _lineFormat = value; + } + } + [DV] + public LineFormat _lineFormat; + + /// + /// Gets the background filling format of the shape. + /// + public FillFormat FillFormat + { + get { return _fillFormat ?? (_fillFormat = new FillFormat(this)); } + set + { + SetParent(value); + _fillFormat = value; + } + } + [DV] + public FillFormat _fillFormat; + + /// + /// Gets or sets the height of the shape. + /// + public Unit Height + { + get { return _height; } + set { _height = value; } + } + [DV] + public Unit _height = Unit.NullValue; + + /// + /// Gets or sets the width of the shape. + /// + public Unit Width + { + get { return _width; } + set { _width = value; } + } + [DV] + public Unit _width = Unit.NullValue; + #endregion + + #region public + /// + /// Converts Shape into DDL. + /// + public override void Serialize(Serializer serializer) + { + if (!_height.IsNull) + serializer.WriteSimpleAttribute("Height", Height); + if (!_width.IsNull) + serializer.WriteSimpleAttribute("Width", Width); + if (!_relativeHorizontal.IsNull) + serializer.WriteSimpleAttribute("RelativeHorizontal", RelativeHorizontal); + if (!_relativeVertical.IsNull) + serializer.WriteSimpleAttribute("RelativeVertical", RelativeVertical); + if (!IsNull("Left")) + _left.Serialize(serializer); + if (!IsNull("Top")) + _top.Serialize(serializer); + if (!IsNull("WrapFormat")) + _wrapFormat.Serialize(serializer); + if (!IsNull("LineFormat")) + _lineFormat.Serialize(serializer); + if (!IsNull("FillFormat")) + _fillFormat.Serialize(serializer); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Shape))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/TextFrame.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/TextFrame.cs new file mode 100644 index 0000000..60e1c10 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/TextFrame.cs @@ -0,0 +1,294 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; +using MigraDoc.DocumentObjectModel.Shapes.Charts; +using MigraDoc.DocumentObjectModel.Tables; + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Represents a text frame that can be freely placed. + /// + public class TextFrame : Shape, IVisitable + { + /// + /// Initializes a new instance of the TextFrame class. + /// + public TextFrame() + { } + + /// + /// Initializes a new instance of the TextFrame class with the specified parent. + /// + public TextFrame(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new TextFrame Clone() + { + return (TextFrame)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + TextFrame textFrame = (TextFrame)base.DeepCopy(); + if (textFrame._elements != null) + { + textFrame._elements = textFrame._elements.Clone(); + textFrame._elements._parent = textFrame; + } + return textFrame; + } + + /// + /// Adds a new paragraph to the text frame. + /// + public Paragraph AddParagraph() + { + return Elements.AddParagraph(); + } + + /// + /// Adds a new paragraph with the specified text to the text frame. + /// + public Paragraph AddParagraph(string _paragraphText) + { + return Elements.AddParagraph(_paragraphText); + } + + /// + /// Adds a new chart with the specified type to the text frame. + /// + public Chart AddChart(ChartType _type) + { + return Elements.AddChart(_type); + } + + /// + /// Adds a new chart to the text frame. + /// + public Chart AddChart() + { + return Elements.AddChart(); + } + + /// + /// Adds a new table to the text frame. + /// + public Table AddTable() + { + return Elements.AddTable(); + } + + /// + /// Adds a new Image to the text frame. + /// + public Image AddImage(string _fileName) + { + return Elements.AddImage(_fileName); + } + + /// + /// Adds a new paragraph to the text frame. + /// + public void Add(Paragraph paragraph) + { + Elements.Add(paragraph); + } + + /// + /// Adds a new chart to the text frame. + /// + public void Add(Chart chart) + { + Elements.Add(chart); + } + + /// + /// Adds a new table to the text frame. + /// + public void Add(Table table) + { + Elements.Add(table); + } + + /// + /// Adds a new image to the text frame. + /// + public void Add(Image image) + { + Elements.Add(image); + } + #endregion + + #region Properties + /// + /// Gets or sets the Margin between the textframes content and its left edge. + /// + public Unit MarginLeft + { + get { return _marginLeft; } + set { _marginLeft = value; } + } + [DV] + public Unit _marginLeft = Unit.NullValue; + + /// + /// Gets or sets the Margin between the textframes content and its right edge. + /// + public Unit MarginRight + { + get { return _marginRight; } + set { _marginRight = value; } + } + [DV] + public Unit _marginRight = Unit.NullValue; + + /// + /// Gets or sets the Margin between the textframes content and its top edge. + /// + public Unit MarginTop + { + get { return _marginTop; } + set { _marginTop = value; } + } + [DV] + public Unit _marginTop = Unit.NullValue; + + /// + /// Gets or sets the Margin between the textframes content and its bottom edge. + /// + public Unit MarginBottom + { + get { return _marginBottom; } + set { _marginBottom = value; } + } + [DV] + public Unit _marginBottom = Unit.NullValue; + + /// + /// Sets all margins in one step with the same value. + /// + public Unit Margin + { + set + { + _marginLeft = value; + _marginRight = value; + _marginTop = value; + _marginBottom = value; + } + } + + /// + /// Gets or sets the text orientation for the texframe content. + /// + public TextOrientation Orientation + { + get { return (TextOrientation)_orientation.Value; } + set { _orientation.Value = (int)value; } + } + [DV(Type = typeof(TextOrientation))] + public NEnum _orientation = NEnum.NullValue(typeof(TextOrientation)); + + /// + /// The document elements that build the textframe's content. + /// + public DocumentElements Elements + { + get { return _elements ?? (_elements = new DocumentElements(this)); } + set + { + SetParent(value); + _elements = value; + } + } + [DV(ItemType = typeof(DocumentObject))] + private DocumentElements _elements; + #endregion + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitTextFrame(this); + + if (visitChildren && _elements != null) + ((IVisitable)_elements).AcceptVisitor(visitor, true); + } + + #region public + /// + /// Converts TextFrame into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteLine("\\textframe"); + int pos = serializer.BeginAttributes(); + base.Serialize(serializer); + if (!_marginLeft.IsNull) + serializer.WriteSimpleAttribute("MarginLeft", MarginLeft); + if (!_marginRight.IsNull) + serializer.WriteSimpleAttribute("MarginRight", MarginRight); + if (!_marginTop.IsNull) + serializer.WriteSimpleAttribute("MarginTop", MarginTop); + if (!_marginBottom.IsNull) + serializer.WriteSimpleAttribute("MarginBottom", MarginBottom); + if (!_orientation.IsNull) + serializer.WriteSimpleAttribute("Orientation", Orientation); + serializer.EndAttributes(pos); + + serializer.BeginContent(); + if (_elements != null) + _elements.Serialize(serializer); + serializer.EndContent(); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(TextFrame))); } + } + static Meta _meta; + #endregion + } +} \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/TopPosition.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/TopPosition.cs new file mode 100644 index 0000000..c543cd4 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/TopPosition.cs @@ -0,0 +1,240 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Represents the top position in a shape. + /// + public struct TopPosition : INullableValue + { + /// + /// Initializes a new instance of TopPosition from Unit. + /// + private TopPosition(Unit value) + { + _shapePosition = ShapePosition.Undefined; + _position = value; + _notNull = !value.IsNull; + } + + /// + /// Initializes a new instance of TopPosition from ShapePosition. + /// + private TopPosition(ShapePosition value) + { + if (!(IsValid(value) || value == ShapePosition.Undefined)) + throw new ArgumentException(DomSR.InvalidEnumForTopPosition); + + _shapePosition = value; + _position = Unit.NullValue; + _notNull = (value != ShapePosition.Undefined); + } + + /// + /// Indicates the given shapePosition is valid for TopPosition. + /// + private static bool IsValid(ShapePosition shapePosition) + { + return shapePosition == ShapePosition.Bottom || + shapePosition == ShapePosition.Top || + shapePosition == ShapePosition.Center; + } + + /// + /// Converts a ShapePosition to a TopPosition. + /// + public static implicit operator TopPosition(ShapePosition value) + { + return new TopPosition(value); + } + + /// + /// Converts a Unit to a TopPosition. + /// + public static implicit operator TopPosition(Unit val) + { + return new TopPosition(val); + } + + /// + /// Converts a string to a TopPosition. + /// The string is interpreted as a Unit. + /// + public static implicit operator TopPosition(string value) + { + Unit unit = value; + return new TopPosition(unit); + } + + /// + /// Converts a double to a TopPosition. + /// The double is interpreted as a Unit in Point. + /// + public static implicit operator TopPosition(double value) + { + Unit unit = value; + return new TopPosition(unit); + } + + /// + /// Converts an integer to a TopPosition. + /// The integer is interpreted as a Unit in Point. + /// + public static implicit operator TopPosition(int value) + { + Unit unit = value; + return new TopPosition(unit); + } + + /// + /// Sets shapeposition enum and resets position. + /// + private void SetFromEnum(ShapePosition shapePosition) + { + if (!IsValid(shapePosition)) + throw new ArgumentException(DomSR.InvalidEnumForTopPosition); + + _shapePosition = shapePosition; + _position = Unit.NullValue; + } + + /// + /// Sets the Position from a Unit. + /// + private void SetFromUnit(Unit unit) + { + _shapePosition = ShapePosition.Undefined; + _position = unit; + } + + /// + /// Sets the Position from an object. + /// + void INullableValue.SetValue(object value) + { + if (value == null) + throw new ArgumentNullException("value"); + + if (value is ShapePosition) + SetFromEnum((ShapePosition)value); + else if (value is string && Enum.IsDefined(typeof(ShapePosition), value)) + SetFromEnum((ShapePosition)Enum.Parse(typeof(ShapePosition), (string)value, true)); + else + SetFromUnit(value.ToString()); + + _notNull = true; + } + + /// + /// Gets the Position as Unit or ShapePosition. + /// + object INullableValue.GetValue() + { + if (_shapePosition == ShapePosition.Undefined) + return _position; + + return _shapePosition; + } + + /// + /// Resets this instance, i.e. IsNull() will return true afterwards. + /// + void INullableValue.SetNull() + { + this = new TopPosition(); + } + + /// + /// Determines whether this instance is null (not set). + /// + bool INullableValue.IsNull + { + get { return !_notNull; } + } + bool _notNull; + + /// + /// Gets the value of the position in unit. + /// + public Unit Position + { + get { return _position; } + } + public Unit _position; + + /// + /// Gets the value of the position. + /// + public ShapePosition ShapePosition + { + get { return _shapePosition; } + } + public ShapePosition _shapePosition; + + /// + /// Parses the specified value. + /// + public static TopPosition Parse(string value) + { + if (String.IsNullOrEmpty(value)) + throw new ArgumentNullException("value"); + + value = value.Trim(); + char ch = value[0]; + if (ch == '+' || ch == '-' || Char.IsNumber(ch)) + return Unit.Parse(value); + return (ShapePosition)Enum.Parse(typeof(ShapePosition), value, true); + } + + #region public + /// + /// Converts TopPosition into DDL. + /// + public void Serialize(Serializer serializer) + { + if (_shapePosition == ShapePosition.Undefined) + serializer.WriteSimpleAttribute("Top", Position); + else + serializer.WriteSimpleAttribute("Top", ShapePosition); + } + #endregion + + /// + /// Represents the unitialized TopPosition object. + /// + public static readonly TopPosition NullValue = new TopPosition(); + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/WrapFormat.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/WrapFormat.cs new file mode 100644 index 0000000..472c770 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/WrapFormat.cs @@ -0,0 +1,150 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Define how the shape should be wrapped between the texts. + /// + public class WrapFormat : DocumentObject + { + /// + /// Initializes a new instance of the WrapFormat class. + /// + public WrapFormat() + { } + + /// + /// Initializes a new instance of the WrapFormat class with the specified parent. + /// + public WrapFormat(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new WrapFormat Clone() + { + return (WrapFormat)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets the wrapping style. + /// + public WrapStyle Style + { + get { return (WrapStyle)_style.Value; } + set { _style.Value = (int)value; } + } + [DV(Type = typeof(WrapStyle))] + public NEnum _style = NEnum.NullValue(typeof(WrapStyle)); + + /// + /// Gets or sets the distance between the top side of the shape with the adjacent text. + /// + public Unit DistanceTop + { + get { return _distanceTop; } + set { _distanceTop = value; } + } + [DV] + Unit _distanceTop = Unit.NullValue; + + /// + /// Gets or sets the distance between the bottom side of the shape with the adjacent text. + /// + public Unit DistanceBottom + { + get { return _distanceBottom; } + set { _distanceBottom = value; } + } + [DV] + Unit _distanceBottom = Unit.NullValue; + + /// + /// Gets or sets the distance between the left side of the shape with the adjacent text. + /// + public Unit DistanceLeft + { + get { return _distanceLeft; } + set { _distanceLeft = value; } + } + [DV] + Unit _distanceLeft = Unit.NullValue; + + /// + /// Gets or sets the distance between the right side of the shape with the adjacent text. + /// + public Unit DistanceRight + { + get { return _distanceRight; } + set { _distanceRight = value; } + } + [DV] + Unit _distanceRight = Unit.NullValue; + #endregion + + #region public + /// + /// Converts WrapFormat into DDL. + /// + public override void Serialize(Serializer serializer) + { + int pos = serializer.BeginContent("WrapFormat"); + if (!_style.IsNull) + serializer.WriteSimpleAttribute("Style", Style); + if (!_distanceTop.IsNull) + serializer.WriteSimpleAttribute("DistanceTop", DistanceTop); + if (!_distanceLeft.IsNull) + serializer.WriteSimpleAttribute("DistanceLeft", DistanceLeft); + if (!_distanceRight.IsNull) + serializer.WriteSimpleAttribute("DistanceRight", DistanceRight); + if (!_distanceBottom.IsNull) + serializer.WriteSimpleAttribute("DistanceBottom", DistanceBottom); + serializer.EndContent(); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(WrapFormat))); } + } + static Meta _meta; + #endregion + } +} \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/BarcodeType.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/BarcodeType.cs new file mode 100644 index 0000000..41487ca --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/BarcodeType.cs @@ -0,0 +1,57 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// ReSharper disable InconsistentNaming + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Specifies the type of the barcode. + /// + public enum BarcodeType + { + /// + /// Barcode "Interleaved 2 of 5" + /// + Barcode25i, + + /// + /// Barcode "3 of 9" + /// + Barcode39, + + /// + /// Barcode "Code 128" + /// + Barcode128 + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/DashStyle.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/DashStyle.cs new file mode 100644 index 0000000..b8cd702 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/DashStyle.cs @@ -0,0 +1,65 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Specifies the dash style of the LineFormat object. + /// + public enum DashStyle + { + /// + /// A solid line. + /// + Solid, + + /// + /// A dashed line. + /// + Dash, + + /// + /// Alternating dashes and dots. + /// + DashDot, + + /// + /// A dash followed by two dots. + /// + DashDotDot, + + /// + /// Square dots. + /// + SquareDot + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/LineStyle.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/LineStyle.cs new file mode 100644 index 0000000..4db4a4f --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/LineStyle.cs @@ -0,0 +1,45 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Specifies the line style of the LineFormat object. + /// + public enum LineStyle + { + /// + /// A solid line. + /// + Single + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/RelativeHorizontal.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/RelativeHorizontal.cs new file mode 100644 index 0000000..e7cc2fd --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/RelativeHorizontal.cs @@ -0,0 +1,60 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Reference point of the Left attribute. + /// + public enum RelativeHorizontal + { + /// + /// Alignment relative to the right side of the previous element. + /// + Character, + + /// + /// Alignment relative to the right side of the previous element. + /// + Column, + + /// + /// Alignment relative to page margin. + /// + Margin, + + /// + /// Alignment relative to page edge. + /// + Page + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/RelativeVertical.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/RelativeVertical.cs new file mode 100644 index 0000000..294a8bc --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/RelativeVertical.cs @@ -0,0 +1,60 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Reference point of the Top attribute. + /// + public enum RelativeVertical + { + /// + /// Alignment relative to the bottom side of the previous element. + /// + Line, + + /// + /// Alignment relative to page margin. + /// + Margin, + + /// + /// Alignment relative to page edge. + /// + Page, + + /// + /// Alignment relative to the bottom line of the previous element. + /// + Paragraph + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/ShapePosition.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/ShapePosition.cs new file mode 100644 index 0000000..8cc5904 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/ShapePosition.cs @@ -0,0 +1,80 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Specifies the position of a shape. Values are used for both LeftPositon and TopPosition. + /// + public enum ShapePosition + { + /// + /// Undefined position. + /// + Undefined, + + /// + /// Left-aligned position. + /// + Left, + + /// + /// Right-aligned position. + /// + Right, + + /// + /// Centered position. + /// + Center, + + /// + /// Top-aligned position. + /// + Top, + + /// + /// Bottom-aligned position. + /// + Bottom, + + /// + /// Used with mirrored margins: left-aligned on right page and right-aligned on left page. + /// + Inside, + + /// + /// Used with mirrored margins: left-aligned on left page and right-aligned on right page. + /// + Outside + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/TextOrientation.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/TextOrientation.cs new file mode 100644 index 0000000..cc3fbc6 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/TextOrientation.cs @@ -0,0 +1,70 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Specifies the orientation of the text in the TextFrame. + /// + public enum TextOrientation + { + /// + /// Horizontal orientation. + /// + Horizontal, + + /// + /// Horizontal orientation. + /// + HorizontalRotatedFarEast, + + /// + /// Vertical orientation (upward). + /// + Upward, + + /// + /// Vertical orientation (downward). + /// + Vertical, + + /// + /// Vertical orientation (downward). + /// + VerticalFarEast, + + /// + /// Vertical orientation (downward). + /// + Downward + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/WrapStyle.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/WrapStyle.cs new file mode 100644 index 0000000..2c183dc --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/enums/WrapStyle.cs @@ -0,0 +1,55 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Shapes +{ + /// + /// Specifies how the shape object should be placed between the other elements. + /// + public enum WrapStyle + { + /// + /// The object will be placed between its predecessor and its successor. + /// + TopBottom, + + /// + /// The object will be ignored when the other elements are placed. + /// + None, + + /// + /// The object will be ignored when the other elements are placed. + /// + Through, + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Cell.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Cell.cs new file mode 100644 index 0000000..35bee4c --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Cell.cs @@ -0,0 +1,450 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; +using MigraDoc.DocumentObjectModel.Shapes; +using MigraDoc.DocumentObjectModel.Shapes.Charts; + +namespace MigraDoc.DocumentObjectModel.Tables +{ + /// + /// Represents a cell of a table. + /// + public class Cell : DocumentObject, IVisitable + { + /// + /// Initializes a new instance of the Cell class. + /// + public Cell() + { } + + /// + /// Initializes a new instance of the Cell class with the specified parent. + /// + public Cell(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Cell Clone() + { + return (Cell)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Cell cell = (Cell)base.DeepCopy(); + // Remove all references to the original object hierarchy. + cell.ResetCachedValues(); + // TODO Call ResetCachedValues() for all classes where this is needed! + if (cell._format != null) + { + cell._format = cell._format.Clone(); + cell._format._parent = cell; + } + if (cell._borders != null) + { + cell._borders = cell._borders.Clone(); + cell._borders._parent = cell; + } + if (cell._shading != null) + { + cell._shading = cell._shading.Clone(); + cell._shading._parent = cell; + } + if (cell._elements != null) + { + cell._elements = cell._elements.Clone(); + cell._elements._parent = cell; + } + return cell; + } + + /// + /// Resets the cached values. + /// + public override void ResetCachedValues() + { + base.ResetCachedValues(); + _row = null; + _clm = null; + _table = null; + } + + /// + /// Adds a new paragraph to the cell. + /// + public Paragraph AddParagraph() + { + return Elements.AddParagraph(); + } + + /// + /// Adds a new paragraph with the specified text to the cell. + /// + public Paragraph AddParagraph(string paragraphText) + { + return Elements.AddParagraph(paragraphText); + } + + /// + /// Adds a new chart with the specified type to the cell. + /// + public Chart AddChart(ChartType type) + { + return Elements.AddChart(type); + } + + /// + /// Adds a new chart to the cell. + /// + public Chart AddChart() + { + return Elements.AddChart(); + } + + /// + /// Adds a new Image to the cell. + /// + public Image AddImage(string fileName) + { + return Elements.AddImage(fileName); + } + + /// + /// Adds a new textframe to the cell. + /// + public TextFrame AddTextFrame() + { + return Elements.AddTextFrame(); + } + + /// + /// Adds a new paragraph to the cell. + /// + public void Add(Paragraph paragraph) + { + Elements.Add(paragraph); + } + + /// + /// Adds a new chart to the cell. + /// + public void Add(Chart chart) + { + Elements.Add(chart); + } + + /// + /// Adds a new image to the cell. + /// + public void Add(Image image) + { + Elements.Add(image); + } + + /// + /// Adds a new text frame to the cell. + /// + public void Add(TextFrame textFrame) + { + Elements.Add(textFrame); + } + #endregion + + #region Properties + /// + /// Gets the table the cell belongs to. + /// + public Table Table + { + get + { + if (_table == null) + { + Cells cls = Parent as Cells; + if (cls != null) + _table = cls.Table; + } + return _table; + } + } + Table _table; + + /// + /// Gets the column the cell belongs to. + /// + public Column Column + { + get + { + if (_clm == null) + { + Cells cells = Parent as Cells; + for (int index = 0; index < cells.Count; ++index) + { + if (cells[index] == this) + _clm = Table.Columns[index]; + } + } + return _clm; + } + } + Column _clm; + + /// + /// Gets the row the cell belongs to. + /// + public Row Row + { + get + { + if (_row == null) + { + Cells cells = Parent as Cells; + _row = cells.Row; + } + return _row; + } + } + Row _row; + + /// + /// Sets or gets the style name. + /// + public string Style + { + get { return _style.Value; } + set { _style.Value = value; } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets the ParagraphFormat object of the paragraph. + /// + public ParagraphFormat Format + { + get { return _format ?? (_format = new ParagraphFormat(this)); } + set + { + SetParent(value); + _format = value; + } + } + [DV] + public ParagraphFormat _format; + + /// + /// Gets or sets the vertical alignment of the cell. + /// + public VerticalAlignment VerticalAlignment + { + get { return (VerticalAlignment)_verticalAlignment.Value; } + set { _verticalAlignment.Value = (int)value; } + } + [DV(Type = typeof(VerticalAlignment))] + public NEnum _verticalAlignment = NEnum.NullValue(typeof(VerticalAlignment)); + + /// + /// Gets the Borders object. + /// + public Borders Borders + { + get + { + if (_borders == null) + { + if (Document == null) // BUG CMYK + GetType(); + _borders = new Borders(this); + } + return _borders; + } + set + { + SetParent(value); + _borders = value; + } + } + [DV] + public Borders _borders; + + /// + /// Gets the shading object. + /// + public Shading Shading + { + get { return _shading ?? (_shading = new Shading(this)); } + set + { + SetParent(value); + _shading = value; + } + } + [DV] + public Shading _shading; + + /// + /// Specifies if the Cell should be rendered as a rounded corner. + /// + public RoundedCorner RoundedCorner + { + get { return _roundedCorner; } + set + { + _roundedCorner = value; + } + } + [DV] + public RoundedCorner _roundedCorner; + + /// + /// Gets or sets the number of cells to be merged right. + /// + public int MergeRight + { + get { return _mergeRight.Value; } + set { _mergeRight.Value = value; } + } + [DV] + public NInt _mergeRight = NInt.NullValue; + + /// + /// Gets or sets the number of cells to be merged down. + /// + public int MergeDown + { + get { return _mergeDown.Value; } + set { _mergeDown.Value = value; } + } + [DV] + public NInt _mergeDown = NInt.NullValue; + + /// + /// Gets the collection of document objects that defines the cell. + /// + public DocumentElements Elements + { + get { return _elements ?? (_elements = new DocumentElements(this)); } + set + { + SetParent(value); + _elements = value; + } + } + [DV(ItemType = typeof(DocumentObject))] + public DocumentElements _elements; + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + #endregion + + #region public + /// + /// Converts Cell into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteComment(_comment.Value); + serializer.WriteLine("\\cell"); + + int pos = serializer.BeginAttributes(); + + if (_style.Value != String.Empty) + serializer.WriteSimpleAttribute("Style", Style); + + if (!IsNull("Format")) + _format.Serialize(serializer, "Format", null); + + if (!_mergeDown.IsNull) + serializer.WriteSimpleAttribute("MergeDown", MergeDown); + + if (!_mergeRight.IsNull) + serializer.WriteSimpleAttribute("MergeRight", MergeRight); + + if (!_verticalAlignment.IsNull) + serializer.WriteSimpleAttribute("VerticalAlignment", VerticalAlignment); + + if (!IsNull("Borders")) + _borders.Serialize(serializer, null); + + if (!IsNull("Shading")) + _shading.Serialize(serializer); + + if (_roundedCorner != RoundedCorner.None) + serializer.WriteSimpleAttribute("RoundedCorner", RoundedCorner); + + serializer.EndAttributes(pos); + + pos = serializer.BeginContent(); + if (!IsNull("Elements")) + _elements.Serialize(serializer); + serializer.EndContent(pos); + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitCell(this); + + if (visitChildren && _elements != null) + ((IVisitable)_elements).AcceptVisitor(visitor, visitChildren); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Cell))); } + } + static Meta _meta; + #endregion + } +} \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Cells.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Cells.cs new file mode 100644 index 0000000..ccf3f77 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Cells.cs @@ -0,0 +1,150 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Tables +{ + /// + /// Represents the collection of all cells of a row. + /// + public class Cells : DocumentObjectCollection + { + /// + /// Initializes a new instance of the Cells class. + /// + public Cells() + { } + + /// + /// Initializes a new instance of the Cells class with the specified parent. + /// + public Cells(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Cells Clone() + { + Cells cells = (Cells)base.DeepCopy(); + cells.ResetCachedValues(); + return cells; + } + + /// + /// Resets the cached values. + /// + public override void ResetCachedValues() + { + base.ResetCachedValues(); + _row = null; + _table = null; + } + #endregion + + #region Properties + /// + /// Gets the table the cells collection belongs to. + /// + public Table Table + { + get + { + if (_table == null) + { + Row rw = Parent as Row; + if (rw != null) + _table = rw.Table; + } + return _table; + } + } + Table _table; + + /// + /// Gets the row the cells collection belongs to. + /// + public Row Row + { + get { return _row ?? (_row = Parent as Row); } + } + Row _row; + + /// + /// Gets a cell by its index. The first cell has the index 0. + /// + public new Cell this[int index] + { + get + { + if (index < 0 || (Table != null && index >= Table.Columns.Count)) + throw new ArgumentOutOfRangeException("index"); + + Resize(index); + return base[index] as Cell; + } + } + #endregion + + /// + /// Resizes this cells' list if necessary. + /// + private void Resize(int index) + { + for (int currentIndex = Count; currentIndex <= index; currentIndex++) + Add(new Cell()); + } + + #region public + /// + /// Converts Cells into DDL. + /// + public override void Serialize(Serializer serializer) + { + int cells = Count; + for (int cell = 0; cell < cells; cell++) + this[cell].Serialize(serializer); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Cells))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Column.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Column.cs new file mode 100644 index 0000000..f8b8a03 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Column.cs @@ -0,0 +1,329 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Tables +{ + /// + /// Represents a column of a table. + /// + public class Column : DocumentObject + { + /// + /// Initializes a new instance of the Column class. + /// + public Column() + { } + + /// + /// Initializes a new instance of the Column class with the specified parent. + /// + public Column(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Column Clone() + { + return (Column)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Column column = (Column)base.DeepCopy(); + column.ResetCachedValues(); + if (column._format != null) + { + column._format = column._format.Clone(); + column._format._parent = column; + } + if (column._borders != null) + { + column._borders = column._borders.Clone(); + column._borders._parent = column; + } + if (column._shading != null) + { + column._shading = column._shading.Clone(); + column._shading._parent = column; + } + return column; + } + + /// + /// Resets the cached values. + /// + public override void ResetCachedValues() + { + base.ResetCachedValues(); + _table = null; + _index = NInt.NullValue; + } + #endregion + + #region Properties + /// + /// Gets the table the Column belongs to. + /// + public Table Table + { + get + { + if (_table == null) + { + Columns clms = Parent as Columns; + if (clms != null) + _table = clms.Parent as Table; + } + return _table; + } + } + Table _table; + + /// + /// Gets the index of the column. First column has index 0. + /// + public int Index + { + get + { + if (_index == NInt.NullValue /*IsNull("Index")*/) + { + Columns clms = (Columns)Parent; + // One for all and all for one. + for (int i = 0; i < clms.Count; ++i) + { + clms[i]._index = i; + } + } + return _index; + } + } + [DV] + public NInt _index = NInt.NullValue; + + /// + /// Gets a cell by its row index. The first cell has index 0. + /// + public Cell this[int index] + { + get + { + //Check.ArgumentOutOfRange(index >= 0 && index < table.Rows.Count, "index"); + return Table.Rows[index][_index]; + } + } + + /// + /// Sets or gets the default style name for all cells of the column. + /// + public string Style + { + get { return _style.Value; } + set { _style.Value = value; } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets the default ParagraphFormat for all cells of the column. + /// + public ParagraphFormat Format + { + get { return _format ?? (_format = new ParagraphFormat(this)); } + set + { + SetParent(value); + _format = value; + } + } + [DV] + public ParagraphFormat _format; + + /// + /// Gets or sets the width of a column. + /// + public Unit Width + { + get { return _width; } + set { _width = value; } + } + [DV] + public Unit _width = Unit.NullValue; + + /// + /// Gets or sets the default left padding for all cells of the column. + /// + public Unit LeftPadding + { + get { return _leftPadding; } + set { _leftPadding = value; } + } + [DV] + public Unit _leftPadding = Unit.NullValue; + + /// + /// Gets or sets the default right padding for all cells of the column. + /// + public Unit RightPadding + { + get { return _rightPadding; } + set { _rightPadding = value; } + } + [DV] + public Unit _rightPadding = Unit.NullValue; + + /// + /// Gets the default Borders object for all cells of the column. + /// + public Borders Borders + { + get { return _borders ?? (_borders = new Borders(this)); } + set + { + SetParent(value); + _borders = value; + } + } + [DV] + public Borders _borders; + + /// + /// Gets or sets the number of columns that should be kept together with + /// current column in case of a page break. + /// + public int KeepWith + { + get { return _keepWith.Value; } + set { _keepWith.Value = value; } + } + [DV] + public NInt _keepWith = NInt.NullValue; + + /// + /// Gets or sets a value which define whether the column is a header. + /// + public bool HeadingFormat + { + get { return _headingFormat.Value; } + set { _headingFormat.Value = value; } + } + [DV] + public NBool _headingFormat = NBool.NullValue; + + /// + /// Gets the default Shading object for all cells of the column. + /// + public Shading Shading + { + get { return _shading ?? (_shading = new Shading(this)); } + set + { + SetParent(value); + _shading = value; + } + } + [DV] + public Shading _shading; + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + #endregion + + #region public + /// + /// Converts Column into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteComment(_comment.Value); + serializer.WriteLine("\\column"); + + int pos = serializer.BeginAttributes(); + + if (_style.Value != String.Empty) + serializer.WriteSimpleAttribute("Style", Style); + + if (!IsNull("Format")) + _format.Serialize(serializer, "Format", null); + + if (!_headingFormat.IsNull) + serializer.WriteSimpleAttribute("HeadingFormat", HeadingFormat); + + if (!_leftPadding.IsNull) + serializer.WriteSimpleAttribute("LeftPadding", LeftPadding); + + if (!_rightPadding.IsNull) + serializer.WriteSimpleAttribute("RightPadding", RightPadding); + + if (!_width.IsNull) + serializer.WriteSimpleAttribute("Width", Width); + + if (!_keepWith.IsNull) + serializer.WriteSimpleAttribute("KeepWith", KeepWith); + + if (!IsNull("Borders")) + _borders.Serialize(serializer, null); + + if (!IsNull("Shading")) + _shading.Serialize(serializer); + + serializer.EndAttributes(pos); + + // columns has no content + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Column))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Columns.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Columns.cs new file mode 100644 index 0000000..d62d1d2 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Columns.cs @@ -0,0 +1,177 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; + +namespace MigraDoc.DocumentObjectModel.Tables +{ + /// + /// Represents the columns of a table. + /// + public class Columns : DocumentObjectCollection, IVisitable + { + /// + /// Initializes a new instance of the Columns class. + /// + public Columns() + { } + + /// + /// Initializes a new instance of the Columns class containing columns of the specified widths. + /// + public Columns(params Unit[] widths) + { + foreach (Unit width in widths) + { + Column clm = new Column(); + clm.Width = width; + Add(clm); + } + } + + /// + /// Initializes a new instance of the Columns class with the specified parent. + /// + public Columns(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Columns Clone() + { + return (Columns)base.DeepCopy(); + } + + /// + /// Adds a new column to the columns collection. Allowed only before any row was added. + /// + public Column AddColumn() + { + if (Table.Rows.Count > 0) + throw new InvalidOperationException("Cannot add column because rows collection is not empty."); + + Column column = new Column(); + Add(column); + return column; + } + #endregion + + #region Properties + /// + /// Gets the table the columns collection belongs to. + /// + public Table Table + { + get { return _parent as Table; } + } + + /// + /// Gets a column by its index. + /// + public new Column this[int index] + { + get { return base[index] as Column; } + } + + /// + /// Gets or sets the default width of all columns. + /// + public Unit Width + { + get { return _width; } + set { _width = value; } + } + [DV] + public Unit _width = Unit.NullValue; + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + #endregion + + #region public + /// + /// Converts Columns into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteComment(_comment.Value); + serializer.WriteLine("\\columns"); + + int pos = serializer.BeginAttributes(); + + if (!_width.IsNull) + serializer.WriteSimpleAttribute("Width", Width); + + serializer.EndAttributes(pos); + + serializer.BeginContent(); + int clms = Count; + if (clms > 0) + { + for (int clm = 0; clm < clms; clm++) + this[clm].Serialize(serializer); + } + else + serializer.WriteComment("Invalid - no columns defined. Table will not render."); + serializer.EndContent(); + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitColumns(this); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Columns))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Row.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Row.cs new file mode 100644 index 0000000..af75d6f --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Row.cs @@ -0,0 +1,389 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; + +namespace MigraDoc.DocumentObjectModel.Tables +{ + /// + /// Represents a row of a table. + /// + public class Row : DocumentObject, IVisitable + { + /// + /// Initializes a new instance of the Row class. + /// + public Row() + { } + + /// + /// Initializes a new instance of the Row class with the specified parent. + /// + public Row(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Row Clone() + { + return (Row)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Row row = (Row)base.DeepCopy(); + row.ResetCachedValues(); + if (row._format != null) + { + row._format = row._format.Clone(); + row._format._parent = row; + } + if (row._borders != null) + { + row._borders = row._borders.Clone(); + row._borders._parent = row; + } + if (row._shading != null) + { + row._shading = row._shading.Clone(); + row._shading._parent = row; + } + if (row._cells != null) + { + row._cells = row._cells.Clone(); + row._cells._parent = row; + } + return row; + } + + /// + /// Resets the cached values. + /// + public override void ResetCachedValues() + { + base.ResetCachedValues(); + _table = null; + index = NInt.NullValue; + } + #endregion + + #region Properties + /// + /// Gets the table the row belongs to. + /// + public Table Table + { + get + { + if (_table == null) + { + Rows rws = Parent as Rows; + if (rws != null) + _table = rws.Table; + } + return _table; + } + } + Table _table; + + /// + /// Gets the index of the row. First row has index 0. + /// + public int Index + { + get + { + if (index == NInt.NullValue /*IsNull("index")*/) + { + Rows rws = (Rows)_parent; + // One for all and all for one. + for (int i = 0; i < rws.Count; ++i) + { + rws[i].index = i; + } + } + return index; + } + } + [DV] + public NInt index = NInt.NullValue; + + /// + /// Gets a cell by its column index. The first cell has index 0. + /// + public Cell this[int index] + { + get { return Cells[index]; } + } + + /// + /// Gets or sets the default style name for all cells of the row. + /// + public string Style + { + get { return _style.Value; } + set { _style.Value = value; } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets the default ParagraphFormat for all cells of the row. + /// + public ParagraphFormat Format + { + get { return _format ?? (_format = new ParagraphFormat(this)); } + set + { + SetParent(value); + _format = value; + } + } + [DV] + public ParagraphFormat _format; + + /// + /// Gets or sets the default vertical alignment for all cells of the row. + /// + public VerticalAlignment VerticalAlignment + { + get { return (VerticalAlignment)_verticalAlignment.Value; } + set { _verticalAlignment.Value = (int)value; } + } + [DV(Type = typeof(VerticalAlignment))] + public NEnum _verticalAlignment = NEnum.NullValue(typeof(VerticalAlignment)); + + /// + /// Gets or sets the height of the row. + /// + public Unit Height + { + get { return _height; } + set { _height = value; } + } + [DV] + public Unit _height = Unit.NullValue; + + /// + /// Gets or sets the rule which is used to determine the height of the row. + /// + public RowHeightRule HeightRule + { + get { return (RowHeightRule)_heightRule.Value; } + set { _heightRule.Value = (int)value; } + } + [DV(Type = typeof(RowHeightRule))] + public NEnum _heightRule = NEnum.NullValue(typeof(RowHeightRule)); + + /// + /// Gets or sets the default value for all cells of the row. + /// + public Unit TopPadding + { + get { return _topPadding; } + set { _topPadding = value; } + } + [DV] + public Unit _topPadding = Unit.NullValue; + + /// + /// Gets or sets the default value for all cells of the row. + /// + public Unit BottomPadding + { + get { return _bottomPadding; } + set { _bottomPadding = value; } + } + [DV] + public Unit _bottomPadding = Unit.NullValue; + + /// + /// Gets or sets a value which define whether the row is a header. + /// + public bool HeadingFormat + { + get { return _headingFormat.Value; } + set { _headingFormat.Value = value; } + } + [DV] + public NBool _headingFormat = NBool.NullValue; + + /// + /// Gets the default Borders object for all cells of the row. + /// + public Borders Borders + { + get { return _borders ?? (_borders = new Borders(this)); } + set + { + SetParent(value); + _borders = value; + } + } + [DV] + public Borders _borders; + + /// + /// Gets the default Shading object for all cells of the row. + /// + public Shading Shading + { + get { return _shading ?? (_shading = new Shading(this)); } + set + { + SetParent(value); + _shading = value; + } + } + [DV] + public Shading _shading; + + /// + /// Gets or sets the number of rows that should be + /// kept together with the current row in case of a page break. + /// + public int KeepWith + { + get { return _keepWith.Value; } + set { _keepWith.Value = value; } + } + [DV] + public NInt _keepWith = NInt.NullValue; + + /// + /// Gets the Cells collection of the table. + /// + public Cells Cells + { + get { return _cells ?? (_cells = new Cells(this)); } + set + { + SetParent(value); + _cells = value; + } + } + [DV] + public Cells _cells; + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + #endregion + + #region public + /// + /// Converts Row into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteComment(_comment.Value); + serializer.WriteLine("\\row"); + + int pos = serializer.BeginAttributes(); + + if (_style.Value != String.Empty) + serializer.WriteSimpleAttribute("Style", Style); + + if (!IsNull("Format")) + _format.Serialize(serializer, "Format", null); + + if (!_height.IsNull) + serializer.WriteSimpleAttribute("Height", Height); + + if (!_heightRule.IsNull) + serializer.WriteSimpleAttribute("HeightRule", HeightRule); + + if (!_topPadding.IsNull) + serializer.WriteSimpleAttribute("TopPadding", TopPadding); + + if (!_bottomPadding.IsNull) + serializer.WriteSimpleAttribute("BottomPadding", BottomPadding); + + if (!_headingFormat.IsNull) + serializer.WriteSimpleAttribute("HeadingFormat", HeadingFormat); + + if (!_verticalAlignment.IsNull) + serializer.WriteSimpleAttribute("VerticalAlignment", VerticalAlignment); + + if (!_keepWith.IsNull) + serializer.WriteSimpleAttribute("KeepWith", KeepWith); + + //Borders & Shading + if (!IsNull("Borders")) + _borders.Serialize(serializer, null); + + if (!IsNull("Shading")) + _shading.Serialize(serializer); + + serializer.EndAttributes(pos); + + serializer.BeginContent(); + if (!IsNull("Cells")) + _cells.Serialize(serializer); + serializer.EndContent(); + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitRow(this); + + foreach (Cell cell in _cells) + ((IVisitable)cell).AcceptVisitor(visitor, visitChildren); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Row))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Rows.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Rows.cs new file mode 100644 index 0000000..7f2eab8 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Rows.cs @@ -0,0 +1,224 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; + +namespace MigraDoc.DocumentObjectModel.Tables +{ + /// + /// Represents the collection of all rows of a table. + /// + public class Rows : DocumentObjectCollection, IVisitable + { + /// + /// Initializes a new instance of the Rows class. + /// + public Rows() + { } + + /// + /// Initializes a new instance of the Rows class with the specified parent. + /// + public Rows(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Rows Clone() + { + return (Rows)base.DeepCopy(); + } + + /// + /// Adds a new row to the rows collection. Allowed only if at least one column exists. + /// + public Row AddRow() + { + if (Table.Columns.Count == 0) + throw new InvalidOperationException("Cannot add row, because no columns exists."); + + Row row = new Row(); + Add(row); + return row; + } + #endregion + + #region Properties + /// + /// Gets the table the rows collection belongs to. + /// + public Table Table + { + get { return _parent as Table; } + } + + /// + /// Gets a row by its index. + /// + public new Row this[int index] + { + get { return base[index] as Row; } + } + + /// + /// Gets or sets the row alignment of the table. + /// + public RowAlignment Alignment + { + get { return (RowAlignment)_alignment.Value; } + set { _alignment.Value = (int)value; } + } + [DV(Type = typeof(RowAlignment))] + public NEnum _alignment = NEnum.NullValue(typeof(RowAlignment)); + + /// + /// Gets or sets the left indent of the table. If row alignment is not Left, + /// the value is ignored. + /// + public Unit LeftIndent + { + get { return _leftIndent; } + set { _leftIndent = value; } + } + [DV] + public Unit _leftIndent = Unit.NullValue; + + /// + /// Gets or sets the default vertical alignment for all rows. + /// + public VerticalAlignment VerticalAlignment + { + get { return (VerticalAlignment)_verticalAlignment.Value; } + set { _verticalAlignment.Value = (int)value; } + } + [DV(Type = typeof(VerticalAlignment))] + public NEnum _verticalAlignment = NEnum.NullValue(typeof(VerticalAlignment)); + + /// + /// Gets or sets the height of the rows. + /// + public Unit Height + { + get { return _height; } + set { _height = value; } + } + [DV] + public Unit _height = Unit.NullValue; + + /// + /// Gets or sets the rule which is used to determine the height of the rows. + /// + public RowHeightRule HeightRule + { + get { return (RowHeightRule)_heightRule.Value; } + set { _heightRule.Value = (int)value; } + } + [DV(Type = typeof(RowHeightRule))] + public NEnum _heightRule = NEnum.NullValue(typeof(RowHeightRule)); + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + #endregion + + #region public + /// + /// Converts Rows into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteComment(_comment.Value); + serializer.WriteLine("\\rows"); + + int pos = serializer.BeginAttributes(); + + if (!_alignment.IsNull) + serializer.WriteSimpleAttribute("Alignment", Alignment); + + if (!_height.IsNull) + serializer.WriteSimpleAttribute("Height", Height); + + if (!_heightRule.IsNull) + serializer.WriteSimpleAttribute("HeightRule", HeightRule); + + if (!_leftIndent.IsNull) + serializer.WriteSimpleAttribute("LeftIndent", LeftIndent); + + if (!_verticalAlignment.IsNull) + serializer.WriteSimpleAttribute("VerticalAlignment", VerticalAlignment); + + serializer.EndAttributes(pos); + + serializer.BeginContent(); + int rows = Count; + if (rows > 0) + { + for (int row = 0; row < rows; row++) + this[row].Serialize(serializer); + } + else + serializer.WriteComment("Invalid - no rows defined. Table will not render."); + serializer.EndContent(); + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitRows(this); + + foreach (Row row in this) + ((IVisitable)row).AcceptVisitor(visitor, visitChildren); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Rows))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Table.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Table.cs new file mode 100644 index 0000000..ed01691 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Table.cs @@ -0,0 +1,483 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; + +namespace MigraDoc.DocumentObjectModel.Tables +{ + /// + /// Represents a table in a document. + /// + public class Table : DocumentObject, IVisitable + { + /// + /// Initializes a new instance of the Table class. + /// + public Table() + { } + + /// + /// Initializes a new instance of the Table class with the specified parent. + /// + public Table(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Table Clone() + { + return (Table)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Table table = (Table)base.DeepCopy(); + if (table._columns != null) + { + table._columns = table._columns.Clone(); + table._columns._parent = table; + } + if (table._rows != null) + { + table._rows = table._rows.Clone(); + table._rows._parent = table; + } + if (table._format != null) + { + table._format = table._format.Clone(); + table._format._parent = table; + } + if (table._borders != null) + { + table._borders = table._borders.Clone(); + table._borders._parent = table; + } + if (table._shading != null) + { + table._shading = table._shading.Clone(); + table._shading._parent = table; + } + return table; + } + + /// + /// Adds a new column to the table. Allowed only before any row was added. + /// + public Column AddColumn() + { + return Columns.AddColumn(); + } + + /// + /// Adds a new column of the specified width to the table. Allowed only before any row was added. + /// + public Column AddColumn(Unit width) + { + Column clm = Columns.AddColumn(); + clm.Width = width; + return clm; + } + + /// + /// Adds a new row to the table. Allowed only if at least one column was added. + /// + public Row AddRow() + { + return _rows.AddRow(); + } + + /// + /// Returns true if no cell exists in the table. + /// + public bool IsEmpty + { + get { return Rows.Count == 0 || Columns.Count == 0; } + } + + /// + /// Sets a shading of the specified Color in the specified Tablerange. + /// + public void SetShading(int clm, int row, int clms, int rows, Color clr) + { + int rowsCount = _rows.Count; + int clmsCount = _columns.Count; + + if (row < 0 || row >= rowsCount) + throw new ArgumentOutOfRangeException("row", "Invalid row index."); + + if (clm < 0 || clm >= clmsCount) + throw new ArgumentOutOfRangeException("clm", "Invalid column index."); + + if (rows <= 0 || row + rows > rowsCount) + throw new ArgumentOutOfRangeException("rows", "Invalid row count."); + + if (clms <= 0 || clm + clms > clmsCount) + throw new ArgumentOutOfRangeException("clms", "Invalid column count."); + + int maxRow = row + rows - 1; + int maxClm = clm + clms - 1; + for (int r = row; r <= maxRow; r++) + { + Row currentRow = _rows[r]; + for (int c = clm; c <= maxClm; c++) + currentRow[c].Shading.Color = clr; + } + } + + /// + /// Sets the borders surrounding the specified range of the table. + /// + public void SetEdge(int clm, int row, int clms, int rows, + Edge edge, BorderStyle style, Unit width, Color clr) + { + Border border; + int maxRow = row + rows - 1; + int maxClm = clm + clms - 1; + for (int r = row; r <= maxRow; r++) + { + Row currentRow = _rows[r]; + for (int c = clm; c <= maxClm; c++) + { + Cell currentCell = currentRow[c]; + if ((edge & Edge.Top) == Edge.Top && r == row) + { + border = currentCell.Borders.Top; + border.Style = style; + border.Width = width; + if (clr != Color.Empty) + border.Color = clr; + } + if ((edge & Edge.Left) == Edge.Left && c == clm) + { + border = currentCell.Borders.Left; + border.Style = style; + border.Width = width; + if (clr != Color.Empty) + border.Color = clr; + } + if ((edge & Edge.Bottom) == Edge.Bottom && r == maxRow) + { + border = currentCell.Borders.Bottom; + border.Style = style; + border.Width = width; + if (clr != Color.Empty) + border.Color = clr; + } + if ((edge & Edge.Right) == Edge.Right && c == maxClm) + { + border = currentCell.Borders.Right; + border.Style = style; + border.Width = width; + if (clr != Color.Empty) + border.Color = clr; + } + if ((edge & Edge.Horizontal) == Edge.Horizontal && r < maxRow) + { + border = currentCell.Borders.Bottom; + border.Style = style; + border.Width = width; + if (clr != Color.Empty) + border.Color = clr; + } + if ((edge & Edge.Vertical) == Edge.Vertical && c < maxClm) + { + border = currentCell.Borders.Right; + border.Style = style; + border.Width = width; + if (clr != Color.Empty) + border.Color = clr; + } + if ((edge & Edge.DiagonalDown) == Edge.DiagonalDown) + { + border = currentCell.Borders.DiagonalDown; + border.Style = style; + border.Width = width; + if (clr != Color.Empty) + border.Color = clr; + } + if ((edge & Edge.DiagonalUp) == Edge.DiagonalUp) + { + border = currentCell.Borders.DiagonalUp; + border.Style = style; + border.Width = width; + if (clr != Color.Empty) + border.Color = clr; + } + } + } + } + + /// + /// Sets the borders surrounding the specified range of the table. + /// + public void SetEdge(int clm, int row, int clms, int rows, Edge edge, BorderStyle style, Unit width) + { + SetEdge(clm, row, clms, rows, edge, style, width, Color.Empty); + } + + #endregion + + #region Properties + /// + /// Gets or sets the Columns collection of the table. + /// + public Columns Columns + { + get { return _columns ?? (_columns = new Columns(this)); } + set + { + SetParent(value); + _columns = value; + } + } + [DV] + public Columns _columns; + + /// + /// Gets the Rows collection of the table. + /// + public Rows Rows + { + get { return _rows ?? (_rows = new Rows(this)); } + set + { + SetParent(value); + _rows = value; + } + } + [DV] + public Rows _rows; + + /// + /// Sets or gets the default style name for all rows and columns of the table. + /// + public string Style + { + get { return _style.Value; } + set { _style.Value = value; } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets the default ParagraphFormat for all rows and columns of the table. + /// + public ParagraphFormat Format + { + get { return _format ?? (_format = new ParagraphFormat(this)); } + set + { + SetParent(value); + _format = value; + } + } + [DV] + public ParagraphFormat _format; + + /// + /// Gets or sets the default top padding for all cells of the table. + /// + public Unit TopPadding + { + get { return _topPadding; } + set { _topPadding = value; } + } + [DV] + public Unit _topPadding = Unit.NullValue; + + /// + /// Gets or sets the default bottom padding for all cells of the table. + /// + public Unit BottomPadding + { + get { return _bottomPadding; } + set { _bottomPadding = value; } + } + [DV] + public Unit _bottomPadding = Unit.NullValue; + + /// + /// Gets or sets the default left padding for all cells of the table. + /// + public Unit LeftPadding + { + get { return _leftPadding; } + set { _leftPadding = value; } + } + [DV] + public Unit _leftPadding = Unit.NullValue; + + /// + /// Gets or sets the default right padding for all cells of the table. + /// + public Unit RightPadding + { + get { return _rightPadding; } + set { _rightPadding = value; } + } + [DV] + public Unit _rightPadding = Unit.NullValue; + + /// + /// Gets the default Borders object for all cells of the column. + /// + public Borders Borders + { + get { return _borders ?? (_borders = new Borders(this)); } + set + { + SetParent(value); + _borders = value; + } + } + [DV] + public Borders _borders; + + /// + /// Gets the default Shading object for all cells of the column. + /// + public Shading Shading + { + get { return _shading ?? (_shading = new Shading(this)); } + set + { + SetParent(value); + _shading = value; + } + } + [DV] + public Shading _shading; + + /// + /// Gets or sets a value indicating whether + /// to keep all the table rows on the same page. + /// + public bool KeepTogether + { + get { return _keepTogether.Value; } + set { _keepTogether.Value = value; } + } + [DV] + public NBool _keepTogether = NBool.NullValue; + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + #endregion + + #region public + /// + /// Converts Table into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteComment(_comment.Value); + + serializer.WriteLine("\\table"); + + int pos = serializer.BeginAttributes(); + + if (_style.Value != String.Empty) + serializer.WriteSimpleAttribute("Style", Style); + + if (!IsNull("Format")) + _format.Serialize(serializer, "Format", null); + + if (!_topPadding.IsNull) + serializer.WriteSimpleAttribute("TopPadding", TopPadding); + + if (!_leftPadding.IsNull) + serializer.WriteSimpleAttribute("LeftPadding", LeftPadding); + + if (!_rightPadding.IsNull) + serializer.WriteSimpleAttribute("RightPadding", RightPadding); + + if (!_bottomPadding.IsNull) + serializer.WriteSimpleAttribute("BottomPadding", BottomPadding); + + if (!IsNull("Borders")) + _borders.Serialize(serializer, null); + + if (!IsNull("Shading")) + _shading.Serialize(serializer); + + serializer.EndAttributes(pos); + + serializer.BeginContent(); + Columns.Serialize(serializer); + Rows.Serialize(serializer); + serializer.EndContent(); + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitTable(this); + + ((IVisitable)_columns).AcceptVisitor(visitor, visitChildren); + ((IVisitable)_rows).AcceptVisitor(visitor, visitChildren); + } + + /// + /// Gets the cell with the given row and column indices. + /// + public Cell this[int rwIdx, int clmIdx] + { + get { return Rows[rwIdx].Cells[clmIdx]; } + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Table))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/TableFormatter.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/TableFormatter.cs new file mode 100644 index 0000000..b7d649e --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/TableFormatter.cs @@ -0,0 +1,248 @@ +using System.Diagnostics; + +namespace MigraDoc.DocumentObjectModel.Tables +{ + /// + /// Contains methods to simplify table formatting. + /// + public static class TableFormatter + { + /// + /// Adds one variable count of rows and columns to the top, right, bottom and left of the table. + /// + /// + /// + public static void ExpandTable(Table table, int newSurroundingCells) + { + ExpandTable(table, newSurroundingCells, newSurroundingCells, newSurroundingCells, newSurroundingCells); + } + + /// + /// Adds one variable count of rows and one of columns to the right and the bottom of the table. + /// + /// + /// + /// + public static void ExpandTable(Table table, int newColsRight, int newRowsBottom) + { + ExpandTable(table, 0, newColsRight, newRowsBottom, 0); + } + + /// + /// Adds variable counts of rows and columns to the top, right, bottom and of left of the table. + /// + /// + /// + /// + /// + /// + public static void ExpandTable(Table table, int newRowsTop, int newColsRight, int newRowsBottom, int newColsLeft) + { + for (int i = 0; i < newRowsTop; i++) + table.Rows.InsertObject(0, new Row()); + + for (int i = 0; i < newColsLeft; i++) + { + table.Columns.InsertObject(0, new Column()); + foreach (Row row in table.Rows) + row.Cells.InsertObject(0, new Cell()); + } + + for (int i = 0; i < newRowsBottom; i++) + table.Rows.Add(new Row()); + + for (int i = 0; i < newColsRight; i++) + table.Columns.Add(new Column()); + } + + /// + /// Sets the corner cells of the table to rounded corners. + /// + /// + public static void SetRoundedCorners(Table table) + { + int rowCount = table.Rows.Count; + int colCount = table.Columns.Count; + + if (rowCount < 2 || colCount < 2) + return; + + table.Rows[0].Cells[0].RoundedCorner = RoundedCorner.TopLeft; + table.Rows[0].Cells[colCount - 1].RoundedCorner = RoundedCorner.TopRight; + table.Rows[rowCount - 1].Cells[colCount - 1].RoundedCorner = RoundedCorner.BottomRight; + table.Rows[rowCount - 1].Cells[0].RoundedCorner = RoundedCorner.BottomLeft; + } + + /// + /// Sets the width/height of the outer columns/rows to one value. + /// + /// + /// + public static void SetOuterCellsWidth(Table table, Unit width) + { + SetOuterCellsWidth(table, width, width); + } + + /// + /// Sets each the width of the outer columns and the height of the outer rows to a value. + /// + /// + /// + /// + public static void SetOuterCellsWidth(Table table, Unit width, Unit height) + { + int rowCount = table.Rows.Count; + int colCount = table.Columns.Count; + + if (rowCount < 2 || colCount < 2) + return; + + table.Columns[0].Width = width; + table.Columns[colCount - 1].Width = width; + + table.Rows[0].Height = height; + table.Rows[0].HeightRule = RowHeightRule.Exactly; + table.Rows[rowCount - 1].Height = height; + table.Rows[rowCount - 1].HeightRule = RowHeightRule.Exactly; + } + + /// + /// Get the Shading of the first "targetRowCount" Rows from the Row below. + /// + /// + /// + public static void CopyNeighbouringRowShadingToTop(Table table, int targetRowCount) + { + if (table.Rows.Count <= targetRowCount) + return; + + Row source = table.Rows[targetRowCount]; + for (int i = 0; i < targetRowCount; i++) + table.Rows[i].Shading = source.Shading.Clone(); + } + + /// + /// Get the Shading of the last "targetRowCount" Rows from the Row above. + /// + /// + /// + public static void CopyNeighbouringRowShadingToBottom(Table table, int targetRowCount) + { + int lastIndex = table.Rows.Count - 1; + if (lastIndex - targetRowCount < 0) + return; + + Row source = table.Rows[lastIndex - targetRowCount]; + for (int i = 0; i < targetRowCount; i++) + table.Rows[lastIndex - i].Shading = source.Shading.Clone(); + } + + /// + /// Removes all inner horizontal Borders between "start" index and the next "count" Rows. + /// + /// + /// + /// + public static void RemoveInnerHorizontalBorders(Table table, int start, int count) + { + int end = start + count; + for (int i = start; i < end - 1; i++) + { + if (i + 1 >= table.Rows.Count) + break; + table.Rows[i].Borders.Bottom.Visible = false; + table.Rows[i + 1].Borders.Top.Visible = false; + } + } + + /// + /// Removes all inner vertical Borders between "start" index and the next "count" Columns. + /// + /// + /// + /// + public static void RemoveInnerVerticalBorders(Table table, int start, int count) + { + int end = start + count; + for (int i = start; i < end - 1; i++) + { + if (i + 1 >= table.Columns.Count) + break; + table.Columns[i].Borders.Right.Visible = false; + table.Columns[i + 1].Borders.Left.Visible = false; + } + } + + /// + /// Inserts a magic glue column to avoid PageBreaks at the first "rowCountTop" and the last "rowCountBottom" of a Table. + /// + /// + /// + /// For example 3 for rounded corners Row, Header Row and first content Row. + /// For example 2 for last content Row and rounded corners Row. + public static void InsertGlueColumn(Table table, int insertAtIndex, int rowCountTop, int rowCountBottom) + { + if (table.Columns.Count == 0) + return; + + int glueColumnIndex = insertAtIndex + 1; + Unit glueColumnWidth = Unit.FromPoint(0.1); + + Column glueColumn = new Column(); + glueColumn.Width = glueColumnWidth; + + if (table.Columns[insertAtIndex].Width > glueColumnWidth) + table.Columns[insertAtIndex].Width -= glueColumnWidth; + table.Columns.InsertObject(glueColumnIndex, glueColumn); + + foreach (Row row in table.Rows) + { + if (row.Cells.Count > glueColumnIndex) + row.Cells.InsertObject(glueColumnIndex, new Cell()); + } + + int mergeTop = rowCountTop - 1; + if (mergeTop < table.Rows.Count) + table.Rows[0].Cells[glueColumnIndex].MergeDown = mergeTop; + + int mergeBottom = rowCountBottom - 1; + if (table.Rows.Count - 1 - mergeBottom >= 0) + table.Rows[table.Rows.Count - 1 - mergeBottom].Cells[glueColumnIndex].MergeDown = mergeBottom; + } + + /// + /// Surrounds "count" Elements beginning with index "start" with a one-Column Table of the specified width, where each row contains one of the paragraphs. + /// + /// + /// + /// + /// + public static Table SurroundContentWithTable(Section section, int start, int count, Unit columnWidth) + { + Table table = new Table(); + table.Columns.AddColumn(); + + table.Borders.Width = 0; + table.Columns[0].Width = columnWidth; + + while (count-- > 0) + { + Row row = table.AddRow(); + row.Cells.Add(new Cell()); + + Paragraph paragraph = section.Elements[start].Clone() as Paragraph; + + if (paragraph != null) + { + row.Cells[0].Add(paragraph); + section.Elements.RemoveObjectAt(start); + } + else + Debug.Assert(false); + } + + section.Elements.InsertObject(start, table); + return table; + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/Edge.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/Edge.cs new file mode 100644 index 0000000..1460133 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/Edge.cs @@ -0,0 +1,57 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel.Tables +{ + /// + /// Combinable flags to set Borders using the SetEdge function. + /// + [Flags] + public enum Edge + { + Top = 0x0001, + Left = 0x0002, + Bottom = 0x0004, + Right = 0x0008, + Horizontal = 0x0010, + Vertical = 0x0020, + DiagonalDown = 0x0040, + DiagonalUp = 0x0080, + Box = Top | Left | Bottom | Right, + Interior = Horizontal | Vertical, + Cross = DiagonalDown | DiagonalUp, + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/RoundedCorner.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/RoundedCorner.cs new file mode 100644 index 0000000..8e4a96a --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/RoundedCorner.cs @@ -0,0 +1,48 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel.Tables +{ + /// + /// Specifies if the Cell should be rendered as a rounded corner. + /// + public enum RoundedCorner + { + None, + TopLeft, + TopRight, + BottomLeft, + BottomRight + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/RowAlignment.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/RowAlignment.cs new file mode 100644 index 0000000..673dba6 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/RowAlignment.cs @@ -0,0 +1,46 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel.Tables +{ + /// + /// Specifies the horizontal alignment of the table. + /// + public enum RowAlignment + { + Left, + Center, + Right + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/RowHeightRule.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/RowHeightRule.cs new file mode 100644 index 0000000..8579569 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/RowHeightRule.cs @@ -0,0 +1,46 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel.Tables +{ + /// + /// Specifies the calculation rule of the row height. + /// + public enum RowHeightRule + { + AtLeast, + Auto, + Exactly + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/VerticalAlignment.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/VerticalAlignment.cs new file mode 100644 index 0000000..1445244 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/enums/VerticalAlignment.cs @@ -0,0 +1,46 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel.Tables +{ + /// + /// Specifies the vertical alignment of the cell's content. + /// + public enum VerticalAlignment + { + Top, + Center, + Bottom + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/CellComparer.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/CellComparer.cs new file mode 100644 index 0000000..3b30c12 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/CellComparer.cs @@ -0,0 +1,93 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel.Tables; + +namespace MigraDoc.DocumentObjectModel.Visitors +{ + /// + /// Comparer for the cell positions within a table. + /// It compares the cell positions from top to bottom and left to right. + /// + public class CellComparer : IComparer + { + // AG_HACK + //public int Compare(object lhs, object rhs) + //{ + // if (!(lhs is Cell)) + // throw new ArgumentException(DomSR.CompareJustCells, "lhs"); + + // if (!(rhs is Cell)) + // throw new ArgumentException(DomSR.CompareJustCells, "rhs"); + + // Cell cellLhs = lhs as Cell; + // Cell cellRhs = rhs as Cell; + // int rowCmpr = cellLhs.Row.Index - cellRhs.Row.Index; + // if (rowCmpr != 0) + // return rowCmpr; + + // return cellLhs.Column.Index - cellRhs.Column.Index; + //} + + //int IComparer.Compare(object lhs, object rhs) + //{ + // if (!(lhs is Cell)) + // throw new ArgumentException(DomSR.CompareJustCells, "lhs"); + + // if (!(rhs is Cell)) + // throw new ArgumentException(DomSR.CompareJustCells, "rhs"); + + // Cell cellLhs = lhs as Cell; + // Cell cellRhs = rhs as Cell; + // int rowCmpr = cellLhs.Row.Index - cellRhs.Row.Index; + // if (rowCmpr != 0) + // return rowCmpr; + + // return cellLhs.Column.Index - cellRhs.Column.Index; + //} + + + /// + /// Compares the specified cells. + /// + /// + public int Compare(Cell cellLhs, Cell cellRhs) + { + int rowCmpr = cellLhs.Row.Index - cellRhs.Row.Index; + if (rowCmpr != 0) + return rowCmpr; + + return cellLhs.Column.Index - cellRhs.Column.Index; + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/DocumentObjectVisitor.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/DocumentObjectVisitor.cs new file mode 100644 index 0000000..9ee8f8b --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/DocumentObjectVisitor.cs @@ -0,0 +1,91 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.Shapes; +using MigraDoc.DocumentObjectModel.Shapes.Charts; +using MigraDoc.DocumentObjectModel.Tables; + +namespace MigraDoc.DocumentObjectModel.Visitors +{ + /// + /// Represents the base visitor for the DocumentObject. + /// + public abstract class DocumentObjectVisitor + { + /// + /// Visits the specified document object. + /// + public abstract void Visit(DocumentObject documentObject); + + // Chart + public virtual void VisitChart(Chart chart) { } + public virtual void VisitTextArea(TextArea textArea) { } + public virtual void VisitLegend(Legend legend) { } + + // Document + public virtual void VisitDocument(Document document) { } + public virtual void VisitDocumentElements(DocumentElements elements) { } + public virtual void VisitDocumentObjectCollection(DocumentObjectCollection elements) { } + + // Fields + + // Format + public virtual void VisitFont(Font font) { } + public virtual void VisitParagraphFormat(ParagraphFormat paragraphFormat) { } + public virtual void VisitShading(Shading shading) { } + public virtual void VisitStyle(Style style) { } + public virtual void VisitStyles(Styles styles) { } + + // Paragraph + public virtual void VisitFootnote(Footnote footnote) { } + public virtual void VisitHyperlink(Hyperlink hyperlink) { } + public virtual void VisitFormattedText(FormattedText formattedText) { } + public virtual void VisitParagraph(Paragraph paragraph) { } + + // Section + public virtual void VisitHeaderFooter(HeaderFooter headerFooter) { } + public virtual void VisitHeadersFooters(HeadersFooters headersFooters) { } + public virtual void VisitSection(Section section) { } + public virtual void VisitSections(Sections sections) { } + + // Shape + public virtual void VisitImage(Image image) { } + public virtual void VisitTextFrame(TextFrame textFrame) { } + + // Table + public virtual void VisitCell(Cell cell) { } + public virtual void VisitColumns(Columns columns) { } + public virtual void VisitRow(Row row) { } + public virtual void VisitRows(Rows rows) { } + public virtual void VisitTable(Table table) { } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/IDomVisitable.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/IDomVisitable.cs new file mode 100644 index 0000000..e4d9601 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/IDomVisitable.cs @@ -0,0 +1,42 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Visitors +{ + public interface IVisitable + { + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren); + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/MergedCellList.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/MergedCellList.cs new file mode 100644 index 0000000..b63d932 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/MergedCellList.cs @@ -0,0 +1,357 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel.Tables; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel.Visitors +{ + /// + /// Represents a merged list of cells of a table. + /// + public class MergedCellList : List + { + /// + /// Enumeration of neighbor positions of cells in a table. + /// + enum NeighborPosition + { + Top, + Left, + Right, + Bottom + } + + /// + /// Initializes a new instance of the MergedCellList class. + /// + public MergedCellList(Table table) + { + Init(table); + } + + /// + /// Initializes this instance from a table. + /// + private void Init(Table table) + { + for (int rwIdx = 0; rwIdx < table.Rows.Count; ++rwIdx) + { + for (int clmIdx = 0; clmIdx < table.Columns.Count; ++clmIdx) + { + Cell cell = table[rwIdx, clmIdx]; + if (!IsAlreadyCovered(cell)) + Add(cell); + } + } + } + + /// + /// Returns whether the given cell is already covered by a preceding cell in this instance. + /// + /// + /// Help function for Init(). + /// + private bool IsAlreadyCovered(Cell cell) + { + for (int index = Count - 1; index >= 0; --index) + { + + Cell currentCell = this[index]; + if (currentCell.Column.Index <= cell.Column.Index && currentCell.Column.Index + currentCell.MergeRight >= cell.Column.Index) + { + if (currentCell.Row.Index <= cell.Row.Index && currentCell.Row.Index + currentCell.MergeDown >= cell.Row.Index) + return true; + + if (currentCell.Row.Index + currentCell.MergeDown == cell.Row.Index - 1) + return false; + } + } + return false; + } + + /// + /// Gets the cell at the specified position. + /// + public new Cell this[int index] + { + get { return base[index]; } + } + + /// + /// Gets a borders object that should be used for rendering. + /// + /// + /// Thrown when the cell is not in this list. + /// This situation occurs if the given cell is merged "away" by a previous one. + /// + public Borders GetEffectiveBorders(Cell cell) + { + //Borders borders = cell.GetValue("Borders", GV.ReadOnly) as Borders; + Borders borders = cell._borders; + if (borders != null) + { + //Document doc = borders.Document; + borders = borders.Clone(); + borders._parent = cell; + //doc = borders.Document; + } + else + borders = new Borders(cell._parent); + + int cellIdx = BinarySearch(cell, new CellComparer()); + if (!(cellIdx >= 0 && cellIdx < Count)) + throw new ArgumentException("cell is not a relevant cell", "cell"); + + if (cell._mergeRight > 0) + { + Cell rightBorderCell = cell.Table[cell.Row.Index, cell.Column.Index + cell._mergeRight]; + if (rightBorderCell._borders != null && rightBorderCell._borders._right != null) + borders.Right = rightBorderCell._borders._right.Clone(); + else + borders._right = null; + } + + if (cell._mergeDown > 0) + { + Cell bottomBorderCell = cell.Table[cell.Row.Index + cell._mergeDown, cell.Column.Index]; + if (bottomBorderCell._borders != null && bottomBorderCell._borders._bottom != null) + borders.Bottom = bottomBorderCell._borders._bottom.Clone(); + else + borders._bottom = null; + } + + // For BorderTypes Top, Right, Bottom and Left update the width with the neighbours touching border where required. + // In case of rounded corners this should not be done. + + Cell leftNeighbor = GetNeighbor(cellIdx, NeighborPosition.Left); + if (leftNeighbor != null && leftNeighbor.RoundedCorner != RoundedCorner.TopRight && leftNeighbor.RoundedCorner != RoundedCorner.BottomRight) + { + Borders nbrBrdrs = leftNeighbor.GetValue("Borders", GV.ReadWrite) as Borders; + if (nbrBrdrs != null && GetEffectiveBorderWidth(nbrBrdrs, BorderType.Right) >= GetEffectiveBorderWidth(borders, BorderType.Left)) + borders.SetValue("Left", GetBorderFromBorders(nbrBrdrs, BorderType.Right)); + } + + Cell rightNeighbor = GetNeighbor(cellIdx, NeighborPosition.Right); + if (rightNeighbor != null && rightNeighbor.RoundedCorner != RoundedCorner.TopLeft && rightNeighbor.RoundedCorner != RoundedCorner.BottomLeft) + { + Borders nbrBrdrs = rightNeighbor.GetValue("Borders", GV.ReadWrite) as Borders; + if (nbrBrdrs != null && GetEffectiveBorderWidth(nbrBrdrs, BorderType.Left) > GetEffectiveBorderWidth(borders, BorderType.Right)) + borders.SetValue("Right", GetBorderFromBorders(nbrBrdrs, BorderType.Left)); + } + + Cell topNeighbor = GetNeighbor(cellIdx, NeighborPosition.Top); + if (topNeighbor != null && topNeighbor.RoundedCorner != RoundedCorner.BottomLeft && topNeighbor.RoundedCorner != RoundedCorner.BottomRight) + { + Borders nbrBrdrs = topNeighbor.GetValue("Borders", GV.ReadWrite) as Borders; + if (nbrBrdrs != null && GetEffectiveBorderWidth(nbrBrdrs, BorderType.Bottom) >= GetEffectiveBorderWidth(borders, BorderType.Top)) + borders.SetValue("Top", GetBorderFromBorders(nbrBrdrs, BorderType.Bottom)); + } + + Cell bottomNeighbor = GetNeighbor(cellIdx, NeighborPosition.Bottom); + if (bottomNeighbor != null && bottomNeighbor.RoundedCorner != RoundedCorner.TopLeft && bottomNeighbor.RoundedCorner != RoundedCorner.TopRight) + { + Borders nbrBrdrs = bottomNeighbor.GetValue("Borders", GV.ReadWrite) as Borders; + if (nbrBrdrs != null && GetEffectiveBorderWidth(nbrBrdrs, BorderType.Top) > GetEffectiveBorderWidth(borders, BorderType.Bottom)) + borders.SetValue("Bottom", GetBorderFromBorders(nbrBrdrs, BorderType.Top)); + } + return borders; + } + + /// + /// Gets the cell that covers the given cell by merging. Usually the cell itself if not merged. + /// + public Cell GetCoveringCell(Cell cell) + { + int cellIdx = BinarySearch(cell, new CellComparer()); + if (cellIdx >= 0 && cellIdx < Count) + return this[cellIdx]; + + // Binary Search returns the complement of the next value, therefore, "~cellIdx - 1" is the previous cell. + cellIdx = ~cellIdx - 1; + + for (int index = cellIdx; index >= 0; --index) + { + Cell currCell = this[index]; + if (currCell.Column.Index <= cell.Column.Index && + currCell.Column.Index + currCell.MergeRight >= cell.Column.Index && + currCell.Row.Index <= cell.Row.Index && + currCell.Row.Index + currCell.MergeDown >= cell.Row.Index) + return currCell; + } + return null; + } + + /// + /// Returns the border of the given borders-object of the specified type (top, bottom, ...). + /// If that border doesn't exist, it returns a new border object that inherits all properties from the given borders object + /// + private static Border GetBorderFromBorders(Borders borders, BorderType type) + { + Border returnBorder = borders.GetBorderReadOnly(type); + if (returnBorder == null) + { + returnBorder = new Border(); + returnBorder._style = borders._style; + returnBorder._width = borders._width; + returnBorder._color = borders._color; + returnBorder._visible = borders._visible; + } + return returnBorder; + } + + /// + /// Returns the width of the border at the specified position. + /// + private static Unit GetEffectiveBorderWidth(Borders borders, BorderType type) + { + if (borders == null) + return 0; + + Border border = borders.GetBorderReadOnly(type); + + DocumentObject relevantDocObj = border; + if (relevantDocObj == null || relevantDocObj.IsNull("Width")) + relevantDocObj = borders; + + // Avoid unnecessary GetValue calls. + object visible = relevantDocObj.GetValue("visible", GV.GetNull); + if (visible != null && !(bool)visible) + return 0; + + object width = relevantDocObj.GetValue("width", GV.GetNull); + if (width != null) + return (Unit)width; + + object color = relevantDocObj.GetValue("color", GV.GetNull); + if (color != null) + return 0.5; + + object style = relevantDocObj.GetValue("style", GV.GetNull); + if (style != null) + return 0.5; + return 0; + } + + /// + /// Gets the specified cell's uppermost neighbor at the specified position. + /// + private Cell GetNeighbor(int cellIdx, NeighborPosition position) + { + Cell cell = this[cellIdx]; + if (cell.Column.Index == 0 && position == NeighborPosition.Left || + cell.Row.Index == 0 && position == NeighborPosition.Top || + cell.Row.Index + cell.MergeDown == cell.Table.Rows.Count - 1 && position == NeighborPosition.Bottom || + cell.Column.Index + cell.MergeRight == cell.Table.Columns.Count - 1 && position == NeighborPosition.Right) + return null; + + switch (position) + { + case NeighborPosition.Top: + case NeighborPosition.Left: + for (int index = cellIdx - 1; index >= 0; --index) + { + Cell currCell = this[index]; + if (IsNeighbor(cell, currCell, position)) + return currCell; + } + break; + + case NeighborPosition.Right: + if (cellIdx + 1 < Count) + { + Cell cell2 = this[cellIdx + 1]; + if (cell2.Row.Index == cell.Row.Index) + return cell2; + } + for (int index = cellIdx - 1; index >= 0; --index) + { + Cell currCell = this[index]; + if (IsNeighbor(cell, currCell, position)) + return currCell; + } + break; + + case NeighborPosition.Bottom: + for (int index = cellIdx + 1; index < Count; ++index) + { + Cell currCell = this[index]; + if (IsNeighbor(cell, currCell, position)) + return currCell; + } + break; + } + return null; + } + + /// + /// Returns whether cell2 is a neighbor of cell1 at the specified position. + /// + private bool IsNeighbor(Cell cell1, Cell cell2, NeighborPosition position) + { + bool isNeighbor = false; + switch (position) + { + case NeighborPosition.Bottom: + int bottomRowIdx = cell1.Row.Index + cell1.MergeDown + 1; + isNeighbor = cell2.Row.Index == bottomRowIdx && + cell2.Column.Index <= cell1.Column.Index && + cell2.Column.Index + cell2.MergeRight >= cell1.Column.Index; + break; + + case NeighborPosition.Left: + int leftClmIdx = cell1.Column.Index - 1; + isNeighbor = cell2.Row.Index <= cell1.Row.Index && + cell2.Row.Index + cell2.MergeDown >= cell1.Row.Index && + cell2.Column.Index + cell2.MergeRight == leftClmIdx; + break; + + case NeighborPosition.Right: + int rightClmIdx = cell1.Column.Index + cell1.MergeRight + 1; + isNeighbor = cell2.Row.Index <= cell1.Row.Index && + cell2.Row.Index + cell2.MergeDown >= cell1.Row.Index && + cell2.Column.Index == rightClmIdx; + break; + + case NeighborPosition.Top: + int topRowIdx = cell1.Row.Index - 1; + isNeighbor = cell2.Row.Index + cell2.MergeDown == topRowIdx && + cell2.Column.Index + cell2.MergeRight >= cell1.Column.Index && + cell2.Column.Index <= cell1.Column.Index; + break; + } + return isNeighbor; + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/PdfFlattenVisitor.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/PdfFlattenVisitor.cs new file mode 100644 index 0000000..5027431 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/PdfFlattenVisitor.cs @@ -0,0 +1,243 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; + +namespace MigraDoc.DocumentObjectModel.Visitors +{ + /// + /// Flattens a document for PDF rendering. + /// + public class PdfFlattenVisitor : VisitorBase + { + /// + /// Initializes a new instance of the PdfFlattenVisitor class. + /// + public PdfFlattenVisitor() + { + //this .docObject = documentObject; + } + + public override void VisitDocumentElements(DocumentElements elements) + { +#if true + // New version without sorted list + int count = elements.Count; + for (int idx = 0; idx < count; ++idx) + { + Paragraph paragraph = elements[idx] as Paragraph; + if (paragraph != null) + { + Paragraph[] paragraphs = paragraph.SplitOnParaBreak(); + if (paragraphs != null) + { + foreach (Paragraph para in paragraphs) + { + elements.InsertObject(idx++, para); + ++count; + } + elements.RemoveObjectAt(idx--); + --count; + } + } + } +#else + SortedList splitParaList = new SortedList(); + + for (int idx = 0; idx < elements.Count; ++idx) + { + Paragraph paragraph = elements[idx] as Paragraph; + if (paragraph != null) + { + Paragraph[] paragraphs = paragraph.SplitOnParaBreak(); + if (paragraphs != null) + splitParaList.Add(idx, paragraphs); + } + } + + int insertedObjects = 0; + for (int idx = 0; idx < splitParaList.Count; ++idx) + { + int insertPosition = (int)splitParaList.GetKey(idx); + Paragraph[] paragraphs = (Paragraph[])splitParaList.GetByIndex(idx); + foreach (Paragraph paragraph in paragraphs) + { + elements.InsertObject(insertPosition + insertedObjects, paragraph); + ++insertedObjects; + } + elements.RemoveObjectAt(insertPosition + insertedObjects); + --insertedObjects; + } +#endif + } + + public override void VisitDocumentObjectCollection(DocumentObjectCollection elements) + { + List textIndices = new List(); + if (elements is ParagraphElements) + { + for (int idx = 0; idx < elements.Count; ++idx) + { + if (elements[idx] is Text) + textIndices.Add(idx); + } + } + + int[] indices = (int[])textIndices.ToArray(); + if (indices != null) + { + int insertedObjects = 0; + foreach (int idx in indices) + { + Text text = (Text)elements[idx + insertedObjects]; + string currentString = ""; + foreach (char ch in text.Content) + { + // TODO Add support for other breaking spaces (en space, em space, &c.). + switch (ch) + { + case ' ': + case '\r': + case '\n': + case '\t': + if (currentString != "") + { + elements.InsertObject(idx + insertedObjects, new Text(currentString)); + ++insertedObjects; + currentString = ""; + } + elements.InsertObject(idx + insertedObjects, new Text(" ")); + ++insertedObjects; + break; + + case '-': // minus. + elements.InsertObject(idx + insertedObjects, new Text(currentString + ch)); + ++insertedObjects; + currentString = ""; + break; + + // Characters that allow line breaks without indication. + case '\u200B': // zero width space. + case '\u200C': // zero width non-joiner. + if (currentString != "") + { + elements.InsertObject(idx + insertedObjects, new Text(currentString)); + ++insertedObjects; + currentString = ""; + } + break; + + case '': // soft hyphen. + if (currentString != "") + { + elements.InsertObject(idx + insertedObjects, new Text(currentString)); + ++insertedObjects; + currentString = ""; + } + elements.InsertObject(idx + insertedObjects, new Text("")); + ++insertedObjects; + //currentString = ""; + break; + + default: + currentString += ch; + break; + } + } + if (currentString != "") + { + elements.InsertObject(idx + insertedObjects, new Text(currentString)); + ++insertedObjects; + } + elements.RemoveObjectAt(idx + insertedObjects); + --insertedObjects; + } + } + } + + public override void VisitFormattedText(FormattedText formattedText) + { + Document document = formattedText.Document; + ParagraphFormat format = null; + + Style style = document._styles[formattedText._style.Value]; + if (style != null) + format = style._paragraphFormat; + else if (formattedText._style.Value != "") + format = document._styles[StyleNames.InvalidStyleName]._paragraphFormat; + + if (format != null) + { + if (formattedText._font == null) + formattedText.Font = format._font.Clone(); + else if (format._font != null) + FlattenFont(formattedText._font, format._font); + } + + Font parentFont = GetParentFont(formattedText); + + if (formattedText._font == null) + formattedText.Font = parentFont.Clone(); + else if (parentFont != null) + FlattenFont(formattedText._font, parentFont); + } + + public override void VisitHyperlink(Hyperlink hyperlink) + { + Font styleFont = hyperlink.Document.Styles[StyleNames.Hyperlink].Font; + if (hyperlink._font == null) + hyperlink.Font = styleFont.Clone(); + else + FlattenFont(hyperlink._font, styleFont); + + FlattenFont(hyperlink._font, GetParentFont(hyperlink)); + } + + protected Font GetParentFont(DocumentObject obj) + { + DocumentObject parentElements = DocumentRelations.GetParent(obj); + DocumentObject parentObject = DocumentRelations.GetParent(parentElements); + Font parentFont; + Paragraph paragraph = parentObject as Paragraph; + if (paragraph != null) + { + ParagraphFormat format = paragraph.Format; + parentFont = format._font; + } + else // Hyperlink or FormattedText + { + parentFont = parentObject.GetValue("Font") as Font; + } + return parentFont; + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/RtfFlattenVisitor.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/RtfFlattenVisitor.cs new file mode 100644 index 0000000..49c5b2b --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/RtfFlattenVisitor.cs @@ -0,0 +1,69 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel.Visitors +{ + /// + /// Represents the visitor for flattening the DocumentObject to be used in the RtfRenderer. + /// + public class RtfFlattenVisitor : VisitorBase + { + public override void VisitFormattedText(FormattedText formattedText) + { + Document document = formattedText.Document; + ParagraphFormat format = null; + + Style style = document._styles[formattedText._style.Value]; + if (style != null) + format = style._paragraphFormat; + else if (formattedText._style.Value != "") + format = document._styles[StyleNames.InvalidStyleName]._paragraphFormat; + + if (format != null) + { + if (formattedText._font == null) + formattedText.Font = format._font.Clone(); + else if (format._font != null) + FlattenFont(formattedText._font, format._font); + } + } + + public override void VisitHyperlink(Hyperlink hyperlink) + { + Font styleFont = hyperlink.Document.Styles[StyleNames.Hyperlink].Font; + if (hyperlink._font == null) + hyperlink.Font = styleFont.Clone(); + else + FlattenFont(hyperlink._font, styleFont); + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/VisitorBase.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/VisitorBase.cs new file mode 100644 index 0000000..fc84906 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/VisitorBase.cs @@ -0,0 +1,897 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.Tables; +using MigraDoc.DocumentObjectModel.Shapes; +using MigraDoc.DocumentObjectModel.Shapes.Charts; + +namespace MigraDoc.DocumentObjectModel.Visitors +{ + /// + /// Summary description for VisitorBase. + /// + public abstract class VisitorBase : DocumentObjectVisitor + { + public override void Visit(DocumentObject documentObject) + { + IVisitable visitable = documentObject as IVisitable; + if (visitable != null) + visitable.AcceptVisitor(this, true); + } + + protected void FlattenParagraphFormat(ParagraphFormat format, ParagraphFormat refFormat) + { + if (format._alignment.IsNull) + format._alignment = refFormat._alignment; + + if (format._firstLineIndent.IsNull) + format._firstLineIndent = refFormat._firstLineIndent; + + if (format._leftIndent.IsNull) + format._leftIndent = refFormat._leftIndent; + + if (format._rightIndent.IsNull) + format._rightIndent = refFormat._rightIndent; + + if (format._spaceBefore.IsNull) + format._spaceBefore = refFormat._spaceBefore; + + if (format._spaceAfter.IsNull) + format._spaceAfter = refFormat._spaceAfter; + + if (format._lineSpacingRule.IsNull) + format._lineSpacingRule = refFormat._lineSpacingRule; + if (format._lineSpacing.IsNull) + format._lineSpacing = refFormat._lineSpacing; + + if (format._widowControl.IsNull) + format._widowControl = refFormat._widowControl; + + if (format._keepTogether.IsNull) + format._keepTogether = refFormat._keepTogether; + + if (format._keepWithNext.IsNull) + format._keepWithNext = refFormat._keepWithNext; + + if (format._pageBreakBefore.IsNull) + format._pageBreakBefore = refFormat._pageBreakBefore; + + if (format._outlineLevel.IsNull) + format._outlineLevel = refFormat._outlineLevel; + + if (format._font == null) + { + if (refFormat._font != null) + { + //The font is cloned here to avoid parent problems + format._font = refFormat._font.Clone(); + format._font._parent = format; + } + } + else if (refFormat._font != null) + FlattenFont(format._font, refFormat._font); + + if (format._shading == null) + { + if (refFormat._shading != null) + { + format._shading = refFormat._shading.Clone(); + format._shading._parent = format; + } + //format.shading = refFormat.shading; + } + else if (refFormat._shading != null) + FlattenShading(format._shading, refFormat._shading); + + if (format._borders == null) + format._borders = refFormat._borders; + else if (refFormat._borders != null) + FlattenBorders(format._borders, refFormat._borders); + + //if (format.tabStops == null) + // format.tabStops = refFormat.tabStops; + if (refFormat._tabStops != null) + FlattenTabStops(format.TabStops, refFormat._tabStops); + + if (refFormat._listInfo != null) + FlattenListInfo(format.ListInfo, refFormat._listInfo); + } + + protected void FlattenListInfo(ListInfo listInfo, ListInfo refListInfo) + { + if (listInfo._continuePreviousList.IsNull) + listInfo._continuePreviousList = refListInfo._continuePreviousList; + if (listInfo._listType.IsNull) + listInfo._listType = refListInfo._listType; + if (listInfo._numberPosition.IsNull) + listInfo._numberPosition = refListInfo._numberPosition; + } + + protected void FlattenFont(Font font, Font refFont) + { + if (font._name.IsNull) + font._name = refFont._name; + if (font._size.IsNull) + font._size = refFont._size; + if (font._color.IsNull) + font._color = refFont._color; + if (font._underline.IsNull) + font._underline = refFont._underline; + if (font._bold.IsNull) + font._bold = refFont._bold; + if (font._italic.IsNull) + font._italic = refFont._italic; + if (font._superscript.IsNull) + font._superscript = refFont._superscript; + if (font._subscript.IsNull) + font._subscript = refFont._subscript; + } + + protected void FlattenShading(Shading shading, Shading refShading) + { + //fClear? + if (shading._visible.IsNull) + shading._visible = refShading._visible; + if (shading._color.IsNull) + shading._color = refShading._color; + } + + protected Border FlattenedBorderFromBorders(Border border, Borders parentBorders) + { + if (border == null) + border = new Border(parentBorders); + + if (border._visible.IsNull) + border._visible = parentBorders._visible; + + if (border._style.IsNull) + border._style = parentBorders._style; + + if (border._width.IsNull) + border._width = parentBorders._width; + + if (border._color.IsNull) + border._color = parentBorders._color; + + return border; + } + + protected void FlattenBorders(Borders borders, Borders refBorders) + { + if (borders._visible.IsNull) + borders._visible = refBorders._visible; + if (borders._width.IsNull) + borders._width = refBorders._width; + if (borders._style.IsNull) + borders._style = refBorders._style; + if (borders._color.IsNull) + borders._color = refBorders._color; + + if (borders._distanceFromBottom.IsNull) + borders._distanceFromBottom = refBorders._distanceFromBottom; + if (borders._distanceFromRight.IsNull) + borders._distanceFromRight = refBorders._distanceFromRight; + if (borders._distanceFromLeft.IsNull) + borders._distanceFromLeft = refBorders._distanceFromLeft; + if (borders._distanceFromTop.IsNull) + borders._distanceFromTop = refBorders._distanceFromTop; + + if (refBorders._left != null) + { + FlattenBorder(borders.Left, refBorders._left); + FlattenedBorderFromBorders(borders._left, borders); + } + if (refBorders._right != null) + { + FlattenBorder(borders.Right, refBorders._right); + FlattenedBorderFromBorders(borders._right, borders); + } + if (refBorders._top != null) + { + FlattenBorder(borders.Top, refBorders._top); + FlattenedBorderFromBorders(borders._top, borders); + } + if (refBorders._bottom != null) + { + FlattenBorder(borders.Bottom, refBorders._bottom); + FlattenedBorderFromBorders(borders._bottom, borders); + } + } + + protected void FlattenBorder(Border border, Border refBorder) + { + if (border._visible.IsNull) + border._visible = refBorder._visible; + if (border._width.IsNull) + border._width = refBorder._width; + if (border._style.IsNull) + border._style = refBorder._style; + if (border._color.IsNull) + border._color = refBorder._color; + } + + protected void FlattenTabStops(TabStops tabStops, TabStops refTabStops) + { + if (!tabStops._fClearAll) + { + foreach (TabStop refTabStop in refTabStops) + { + if (tabStops.GetTabStopAt(refTabStop.Position) == null && refTabStop.AddTab) + tabStops.AddTabStop(refTabStop.Position, refTabStop.Alignment, refTabStop.Leader); + } + } + + for (int i = 0; i < tabStops.Count; i++) + { + TabStop tabStop = tabStops[i]; + if (!tabStop.AddTab) + tabStops.RemoveObjectAt(i); + } + // The TabStopCollection is complete now. + // Prevent inheritence of tab stops. + tabStops._fClearAll = true; + } + + protected void FlattenPageSetup(PageSetup pageSetup, PageSetup refPageSetup) + { + if (pageSetup._pageWidth.IsNull && pageSetup._pageHeight.IsNull) + { + if (pageSetup._pageFormat.IsNull) + { + pageSetup._pageWidth = refPageSetup._pageWidth; + pageSetup._pageHeight = refPageSetup._pageHeight; + pageSetup._pageFormat = refPageSetup._pageFormat; + } + else + PageSetup.GetPageSize(pageSetup.PageFormat, out pageSetup._pageWidth, out pageSetup._pageHeight); + } + else + { + Unit dummyUnit; + if (pageSetup._pageWidth.IsNull) + { + if (pageSetup._pageFormat.IsNull) + pageSetup._pageHeight = refPageSetup._pageHeight; + else + PageSetup.GetPageSize(pageSetup.PageFormat, out dummyUnit, out pageSetup._pageHeight); + } + else if (pageSetup._pageHeight.IsNull) + { + if (pageSetup._pageFormat.IsNull) + pageSetup._pageWidth = refPageSetup._pageWidth; + else + PageSetup.GetPageSize(pageSetup.PageFormat, out pageSetup._pageWidth, out dummyUnit); + } + } + // if (pageSetup.pageWidth.IsNull) + // pageSetup.pageWidth = refPageSetup.pageWidth; + // if (pageSetup.pageHeight.IsNull) + // pageSetup.pageHeight = refPageSetup.pageHeight; + // if (pageSetup.pageFormat.IsNull) + // pageSetup.pageFormat = refPageSetup.pageFormat; + if (pageSetup._sectionStart.IsNull) + pageSetup._sectionStart = refPageSetup._sectionStart; + if (pageSetup._orientation.IsNull) + pageSetup._orientation = refPageSetup._orientation; + if (pageSetup._topMargin.IsNull) + pageSetup._topMargin = refPageSetup._topMargin; + if (pageSetup._bottomMargin.IsNull) + pageSetup._bottomMargin = refPageSetup._bottomMargin; + if (pageSetup._leftMargin.IsNull) + pageSetup._leftMargin = refPageSetup._leftMargin; + if (pageSetup._rightMargin.IsNull) + pageSetup._rightMargin = refPageSetup._rightMargin; + if (pageSetup._headerDistance.IsNull) + pageSetup._headerDistance = refPageSetup._headerDistance; + if (pageSetup._footerDistance.IsNull) + pageSetup._footerDistance = refPageSetup._footerDistance; + if (pageSetup._oddAndEvenPagesHeaderFooter.IsNull) + pageSetup._oddAndEvenPagesHeaderFooter = refPageSetup._oddAndEvenPagesHeaderFooter; + if (pageSetup._differentFirstPageHeaderFooter.IsNull) + pageSetup._differentFirstPageHeaderFooter = refPageSetup._differentFirstPageHeaderFooter; + if (pageSetup._mirrorMargins.IsNull) + pageSetup._mirrorMargins = refPageSetup._mirrorMargins; + if (pageSetup._horizontalPageBreak.IsNull) + pageSetup._horizontalPageBreak = refPageSetup._horizontalPageBreak; + } + + protected void FlattenHeaderFooter(HeaderFooter headerFooter, bool isHeader) + { } + + protected void FlattenFillFormat(FillFormat fillFormat) + { } + + protected void FlattenLineFormat(LineFormat lineFormat, LineFormat refLineFormat) + { + if (refLineFormat != null) + { + if (lineFormat._width.IsNull) + lineFormat._width = refLineFormat._width; + } + } + + protected void FlattenAxis(Axis axis) + { + if (axis == null) + return; + + LineFormat refLineFormat = new LineFormat(); + refLineFormat._width = 0.15; + if (axis._hasMajorGridlines.Value && axis._majorGridlines != null) + FlattenLineFormat(axis._majorGridlines._lineFormat, refLineFormat); + if (axis._hasMinorGridlines.Value && axis._minorGridlines != null) + FlattenLineFormat(axis._minorGridlines._lineFormat, refLineFormat); + + refLineFormat._width = 0.4; + if (axis._lineFormat != null) + FlattenLineFormat(axis._lineFormat, refLineFormat); + + // axis.majorTick; + // axis.majorTickMark; + // axis.minorTick; + // axis.minorTickMark; + + // axis.maximumScale; + // axis.minimumScale; + + // axis.tickLabels; + // axis.title; + } + + protected void FlattenPlotArea(PlotArea plotArea) + { } + + protected void FlattenDataLabel(DataLabel dataLabel) + { } + + + #region Chart + public override void VisitChart(Chart chart) + { + Document document = chart.Document; + if (chart._style.IsNull) + chart._style.Value = Style.DefaultParagraphName; + Style style = document.Styles[chart._style.Value]; + if (chart._format == null) + { + chart._format = style._paragraphFormat.Clone(); + chart._format._parent = chart; + } + else + FlattenParagraphFormat(chart._format, style._paragraphFormat); + + + FlattenLineFormat(chart._lineFormat, null); + FlattenFillFormat(chart._fillFormat); + + FlattenAxis(chart._xAxis); + FlattenAxis(chart._yAxis); + FlattenAxis(chart._zAxis); + + FlattenPlotArea(chart._plotArea); + + // if (this .hasDataLabel.Value) + FlattenDataLabel(chart._dataLabel); + + } + #endregion + + #region Document + public override void VisitDocument(Document document) + { + } + + public override void VisitDocumentElements(DocumentElements elements) + { + } + #endregion + + #region Format + public override void VisitStyle(Style style) + { + Style baseStyle = style.GetBaseStyle(); + if (baseStyle != null && baseStyle._paragraphFormat != null) + { + if (style._paragraphFormat == null) + style._paragraphFormat = baseStyle._paragraphFormat; + else + FlattenParagraphFormat(style._paragraphFormat, baseStyle._paragraphFormat); + } + } + + public override void VisitStyles(Styles styles) + { + } + #endregion + + #region Paragraph + public override void VisitFootnote(Footnote footnote) + { + Document document = footnote.Document; + + ParagraphFormat format = null; + + Style style = document._styles[footnote._style.Value]; + if (style != null) + format = ParagraphFormatFromStyle(style); + else + { + footnote.Style = StyleNames.Footnote; + format = document._styles[StyleNames.Footnote]._paragraphFormat; + } + + if (footnote._format == null) + { + footnote._format = format.Clone(); + footnote._format._parent = footnote; + } + else + FlattenParagraphFormat(footnote._format, format); + + } + + public override void VisitParagraph(Paragraph paragraph) + { + Document document = paragraph.Document; + + ParagraphFormat format; + + DocumentObject currentElementHolder = GetDocumentElementHolder(paragraph); + Style style = document._styles[paragraph._style.Value]; + if (style != null) + format = ParagraphFormatFromStyle(style); + + else if (currentElementHolder is Cell) + { + paragraph._style = ((Cell)currentElementHolder)._style; + format = ((Cell)currentElementHolder)._format; + } + else if (currentElementHolder is HeaderFooter) + { + HeaderFooter currHeaderFooter = ((HeaderFooter)currentElementHolder); + if (currHeaderFooter.IsHeader) + { + paragraph.Style = StyleNames.Header; + format = document._styles[StyleNames.Header]._paragraphFormat; + } + else + { + paragraph.Style = StyleNames.Footer; + format = document._styles[StyleNames.Footer]._paragraphFormat; + } + + if (currHeaderFooter._format != null) + FlattenParagraphFormat(paragraph.Format, currHeaderFooter._format); + } + else if (currentElementHolder is Footnote) + { + paragraph.Style = StyleNames.Footnote; + format = document._styles[StyleNames.Footnote]._paragraphFormat; + } + else if (currentElementHolder is TextArea) + { + paragraph._style = ((TextArea)currentElementHolder)._style; + format = ((TextArea)currentElementHolder)._format; + } + else + { + if (paragraph._style.Value != "") + paragraph.Style = StyleNames.InvalidStyleName; + else + paragraph.Style = StyleNames.Normal; + format = document._styles[paragraph.Style]._paragraphFormat; + } + + if (paragraph._format == null) + { + paragraph._format = format.Clone(); + paragraph._format._parent = paragraph; + } + else + FlattenParagraphFormat(paragraph._format, format); + } + #endregion + + #region Section + public override void VisitHeaderFooter(HeaderFooter headerFooter) + { + Document document = headerFooter.Document; + string styleString; + if (headerFooter.IsHeader) + styleString = StyleNames.Header; + else + styleString = StyleNames.Footer; + + ParagraphFormat format; + Style style = document._styles[headerFooter._style.Value]; + if (style != null) + format = ParagraphFormatFromStyle(style); + else + { + format = document._styles[styleString]._paragraphFormat; + headerFooter.Style = styleString; + } + + if (headerFooter._format == null) + { + headerFooter._format = format.Clone(); + headerFooter._format._parent = headerFooter; + } + else + FlattenParagraphFormat(headerFooter._format, format); + } + + public override void VisitHeadersFooters(HeadersFooters headersFooters) + { + } + + public override void VisitSection(Section section) + { + Section prevSec = section.PreviousSection(); + PageSetup prevPageSetup = PageSetup.DefaultPageSetup; + if (prevSec != null) + { + prevPageSetup = prevSec._pageSetup; + + if (!section.Headers.HasHeaderFooter(HeaderFooterIndex.Primary)) + section.Headers._primary = prevSec.Headers._primary; + if (!section.Headers.HasHeaderFooter(HeaderFooterIndex.EvenPage)) + section.Headers._evenPage = prevSec.Headers._evenPage; + if (!section.Headers.HasHeaderFooter(HeaderFooterIndex.FirstPage)) + section.Headers._firstPage = prevSec.Headers._firstPage; + + if (!section.Footers.HasHeaderFooter(HeaderFooterIndex.Primary)) + section.Footers._primary = prevSec.Footers._primary; + if (!section.Footers.HasHeaderFooter(HeaderFooterIndex.EvenPage)) + section.Footers._evenPage = prevSec.Footers._evenPage; + if (!section.Footers.HasHeaderFooter(HeaderFooterIndex.FirstPage)) + section.Footers._firstPage = prevSec.Footers._firstPage; + } + + if (section._pageSetup == null) + section._pageSetup = prevPageSetup; + else + FlattenPageSetup(section._pageSetup, prevPageSetup); + } + + public override void VisitSections(Sections sections) + { + } + #endregion + + #region Shape + public override void VisitTextFrame(TextFrame textFrame) + { + if (textFrame._height.IsNull) + textFrame._height = Unit.FromInch(1); + if (textFrame._width.IsNull) + textFrame._width = Unit.FromInch(1); + } + #endregion + + #region Table + public override void VisitCell(Cell cell) + { + // format, shading and borders are already processed. + } + + public override void VisitColumns(Columns columns) + { + foreach (Column col in columns) + { + if (col._width.IsNull) + col._width = columns._width; + + if (col._width.IsNull) + col._width = "2.5cm"; + } + } + + public override void VisitRow(Row row) + { + foreach (Cell cell in row.Cells) + { + if (cell._verticalAlignment.IsNull) + cell._verticalAlignment = row._verticalAlignment; + } + } + + public override void VisitRows(Rows rows) + { + foreach (Row row in rows) + { + if (row._height.IsNull) + row._height = rows._height; + if (row._heightRule.IsNull) + row._heightRule = rows._heightRule; + if (row._verticalAlignment.IsNull) + row._verticalAlignment = rows._verticalAlignment; + } + } + /// + /// Returns a paragraph format object initialized by the given style. + /// It differs from style.ParagraphFormat if style is a character style. + /// + ParagraphFormat ParagraphFormatFromStyle(Style style) + { + if (style.Type == StyleType.Character) + { + Document doc = style.Document; + ParagraphFormat format = style._paragraphFormat.Clone(); + FlattenParagraphFormat(format, doc.Styles.Normal.ParagraphFormat); + return format; + } + else + return style._paragraphFormat; + } + + public override void VisitTable(Table table) + { + Document document = table.Document; + + if (table._leftPadding.IsNull) + table._leftPadding = Unit.FromMillimeter(1.2); + if (table._rightPadding.IsNull) + table._rightPadding = Unit.FromMillimeter(1.2); + + ParagraphFormat format; + Style style = document._styles[table._style.Value]; + if (style != null) + format = ParagraphFormatFromStyle(style); + else + { + table.Style = "Normal"; + format = document._styles.Normal._paragraphFormat; + } + + if (table._format == null) + { + table._format = format.Clone(); + table._format._parent = table; + } + else + FlattenParagraphFormat(table._format, format); + + int rows = table.Rows.Count; + int clms = table.Columns.Count; + + for (int idxclm = 0; idxclm < clms; idxclm++) + { + Column column = table.Columns[idxclm]; + ParagraphFormat colFormat; + style = document._styles[column._style.Value]; + if (style != null) + colFormat = ParagraphFormatFromStyle(style); + else + { + column._style = table._style; + colFormat = table.Format; + } + + if (column._format == null) + { + column._format = colFormat.Clone(); + column._format._parent = column; + if (column._format._shading == null && table._format._shading != null) + column._format._shading = table._format._shading; + } + else + FlattenParagraphFormat(column._format, colFormat); + + if (column._leftPadding.IsNull) + column._leftPadding = table._leftPadding; + if (column._rightPadding.IsNull) + column._rightPadding = table._rightPadding; + + if (column._shading == null) + column._shading = table._shading; + + else if (table._shading != null) + FlattenShading(column._shading, table._shading); + + if (column._borders == null) + column._borders = table._borders; + else if (table._borders != null) + FlattenBorders(column._borders, table._borders); + } + + for (int idxrow = 0; idxrow < rows; idxrow++) + { + Row row = table.Rows[idxrow]; + + ParagraphFormat rowFormat; + style = document._styles[row._style.Value]; + if (style != null) + { + rowFormat = ParagraphFormatFromStyle(style); + } + else + { + row._style = table._style; + rowFormat = table.Format; + } + + for (int idxclm = 0; idxclm < clms; idxclm++) + { + Column column = table.Columns[idxclm]; + Cell cell = row[idxclm]; + + ParagraphFormat cellFormat; + Style cellStyle = document._styles[cell._style.Value]; + if (cellStyle != null) + { + cellFormat = ParagraphFormatFromStyle(cellStyle); + + if (cell._format == null) + cell._format = cellFormat; + else + FlattenParagraphFormat(cell._format, cellFormat); + } + else + { + if (row._format != null) + FlattenParagraphFormat(cell.Format, row._format); + + if (style != null) + { + cell._style = row._style; + FlattenParagraphFormat(cell.Format, rowFormat); + } + else + { + cell._style = column._style; + FlattenParagraphFormat(cell.Format, column._format); + } + } + + if (cell._format._shading == null && table._format._shading != null) + cell._format._shading = table._format._shading; + + if (cell._shading == null) + cell._shading = row._shading; + else if (row._shading != null) + FlattenShading(cell._shading, row._shading); + if (cell._shading == null) + cell._shading = column._shading; + else if (column._shading != null) + FlattenShading(cell._shading, column._shading); + if (cell._borders == null) + CloneHelper(ref cell._borders, row._borders); + else if (row._borders != null) + FlattenBorders(cell._borders, row._borders); + if (cell._borders == null) + cell._borders = column._borders; + else if (column._borders != null) + FlattenBorders(cell._borders, column._borders); + } + + if (row._format == null) + { + row._format = rowFormat.Clone(); + row._format._parent = row; + if (row._format._shading == null && table._format._shading != null) + row._format._shading = table._format._shading; + } + else + FlattenParagraphFormat(row._format, rowFormat); + + if (row._topPadding.IsNull) + row._topPadding = table._topPadding; + if (row._bottomPadding.IsNull) + row._bottomPadding = table._bottomPadding; + + if (row._shading == null) + row._shading = table._shading; + else if (table._shading != null) + FlattenShading(row._shading, table._shading); + + if (row._borders == null) + row._borders = table._borders; + else if (table._borders != null) + FlattenBorders(row._borders, table._borders); + } + } + + private void CloneHelper(ref Borders borders, Borders source) + { + if (source != null) + { + borders = source.Clone(); + borders._parent = source._parent; + } + } + + #endregion + + public override void VisitLegend(Legend legend) + { + ParagraphFormat parentFormat; + if (!legend._style.IsNull) + { + Style style = legend.Document.Styles[legend.Style]; + if (style == null) + style = legend.Document.Styles[StyleNames.InvalidStyleName]; + + parentFormat = style._paragraphFormat; + } + else + { + TextArea textArea = (TextArea)GetDocumentElementHolder(legend); + legend._style = textArea._style; + parentFormat = textArea._format; + } + if (legend._format == null) + legend.Format = parentFormat.Clone(); + else + FlattenParagraphFormat(legend._format, parentFormat); + } + + public override void VisitTextArea(TextArea textArea) + { + if (textArea == null || textArea._elements == null) + return; + + Document document = textArea.Document; + + ParagraphFormat parentFormat; + + if (!textArea._style.IsNull) + { + Style style = textArea.Document.Styles[textArea.Style]; + if (style == null) + style = textArea.Document.Styles[StyleNames.InvalidStyleName]; + + parentFormat = style._paragraphFormat; + } + else + { + Chart chart = (Chart)textArea._parent; + parentFormat = chart._format; + textArea._style = chart._style; + } + + if (textArea._format == null) + textArea.Format = parentFormat.Clone(); + else + FlattenParagraphFormat(textArea._format, parentFormat); + + FlattenFillFormat(textArea._fillFormat); + FlattenLineFormat(textArea._lineFormat, null); + } + + private DocumentObject GetDocumentElementHolder(DocumentObject docObj) + { + DocumentElements docEls = (DocumentElements)docObj._parent; + return docEls._parent; + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Border.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Border.cs new file mode 100644 index 0000000..8b00811 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Border.cs @@ -0,0 +1,182 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents one border in a borders collection. The type determines its position in a cell, + /// paragraph etc. + /// + public class Border : DocumentObject + { + /// + /// Initializes a new instance of the Border class. + /// + public Border() + { } + + /// + /// Initializes a new instance of the Border class with the specified parent. + /// + public Border(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Border Clone() + { + return (Border)DeepCopy(); + } + + /// + /// Clears the Border object. Additionally 'Border = null' + /// is written to the DDL stream when serialized. + /// + public void Clear() + { + _fClear.Value = true; + } + #endregion + + #region Properties + /// + /// Gets or sets a value indicating whether the border visible is. + /// + public bool Visible + { + get { return _visible.Value; } + set { _visible.Value = value; } + } + [DV] + public NBool _visible = NBool.NullValue; + + /// + /// Gets or sets the line style of the border. + /// + public BorderStyle Style + { + get { return (BorderStyle)_style.Value; } + set { _style.Value = (int)value; } + } + [DV(Type = typeof(BorderStyle))] + public NEnum _style = NEnum.NullValue(typeof(BorderStyle)); + + /// + /// Gets or sets the line width of the border. + /// + public Unit Width + { + get { return _width; } + set { _width = value; } + } + [DV] + public Unit _width = Unit.NullValue; + + /// + /// Gets or sets the color of the border. + /// + public Color Color + { + get { return _color; } + set { _color = value; } + } + [DV] + public Color _color = Color.Empty; + + /// + /// Gets the name of this border ("top", "bottom"....). + /// + public string Name + { + get { return ((Borders)_parent).GetMyName(this); } + } + + /// + /// Gets the information if the border is marked as cleared. Additionally 'xxx = null' + /// is written to the DDL stream when serialized. + /// + public bool BorderCleared + { + get { return _fClear.Value; } + } + public NBool _fClear = new NBool(false); + #endregion + + #region public + /// + /// Converts Border into DDL. + /// + public override void Serialize(Serializer serializer) + { + throw new Exception("A Border cannot be serialized alone."); + } + + /// + /// Converts Border into DDL. + /// + public void Serialize(Serializer serializer, string name, Border refBorder) + { + if (_fClear.Value) + serializer.WriteLine(name + " = null"); + + int pos = serializer.BeginContent(name); + + if (!_visible.IsNull && (refBorder == null || (Visible != refBorder.Visible))) + serializer.WriteSimpleAttribute("Visible", Visible); + + if (!_style.IsNull && (refBorder == null || (Style != refBorder.Style))) + serializer.WriteSimpleAttribute("Style", Style); + + if (!_width.IsNull && (refBorder == null || (Width != refBorder.Width))) + serializer.WriteSimpleAttribute("Width", Width); + + if (!_color.IsNull && (refBorder == null || (Color != refBorder.Color))) + serializer.WriteSimpleAttribute("Color", Color); + + serializer.EndContent(pos); + } + + /// + /// Returns the _meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Border))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Borders.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Borders.cs new file mode 100644 index 0000000..ca2b992 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Borders.cs @@ -0,0 +1,525 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Collections; +using MigraDoc.DocumentObjectModel.publics; + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// A Borders collection represents the eight border objects used for paragraphs, tables etc. + /// + public class Borders : DocumentObject, IEnumerable + { + /// + /// Initializes a new instance of the Borders class. + /// + public Borders() + { } + + /// + /// Initializes a new instance of the Borders class with the specified parent. + /// + public Borders(DocumentObject parent) : base(parent) { } + + /// + /// Determines whether a particular border exists. + /// + public bool HasBorder(BorderType type) + { + if (!Enum.IsDefined(typeof(BorderType), type)) + throw new /*InvalidEnum*/ArgumentException(DomSR.InvalidEnumValue(type), "type"); + + return GetBorderReadOnly(type) != null; + } + + public Border GetBorderReadOnly(BorderType type) + { + switch (type) + { + case BorderType.Bottom: + return _bottom; + case BorderType.DiagonalDown: + return _diagonalDown; + case BorderType.DiagonalUp: + return _diagonalUp; + case BorderType.Horizontal: + case BorderType.Vertical: + return (Border)GetValue(type.ToString(), GV.GetNull); + case BorderType.Left: + return _left; + case BorderType.Right: + return _right; + case BorderType.Top: + return _top; + } + if (!Enum.IsDefined(typeof(BorderType), type)) + throw new /*InvalidEnum*/ArgumentException(DomSR.InvalidEnumValue(type), "type"); + return null; + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Borders Clone() + { + return (Borders)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Borders borders = (Borders)base.DeepCopy(); + if (borders._top != null) + { + borders._top = borders._top.Clone(); + borders._top._parent = borders; + } + if (borders._left != null) + { + borders._left = borders._left.Clone(); + borders._left._parent = borders; + } + if (borders._right != null) + { + borders._right = borders._right.Clone(); + borders._right._parent = borders; + } + if (borders._bottom != null) + { + borders._bottom = borders._bottom.Clone(); + borders._bottom._parent = borders; + } + if (borders._diagonalUp != null) + { + borders._diagonalUp = borders._diagonalUp.Clone(); + borders._diagonalUp._parent = borders; + } + if (borders._diagonalDown != null) + { + borders._diagonalDown = borders._diagonalDown.Clone(); + borders._diagonalDown._parent = borders; + } + return borders; + } + + /// + /// Gets an enumerator for the borders object. + /// + IEnumerator IEnumerable.GetEnumerator() + { + Dictionary ht = new Dictionary(); + ht.Add("Top", _top); + ht.Add("Left", _left); + ht.Add("Bottom", _bottom); + ht.Add("Right", _right); + ht.Add("DiagonalUp", _diagonalUp); + ht.Add("DiagonalDown", _diagonalDown); + + return new BorderEnumerator(ht); + } + + /// + /// Clears all Border objects from the collection. Additionally 'Borders = null' + /// is written to the DDL stream when serialized. + /// + public void ClearAll() + { + _clearAll = true; + } + #endregion + + #region Properties + /// + /// Gets or sets the top border. + /// + public Border Top + { + get { return _top ?? (_top = new Border(this)); } + set + { + SetParent(value); + _top = value; + } + } + [DV] + public Border _top; + + /// + /// Gets or sets the left border. + /// + public Border Left + { + get { return _left ?? (_left = new Border(this)); } + set + { + SetParent(value); + _left = value; + } + } + [DV] + public Border _left; + + /// + /// Gets or sets the bottom border. + /// + public Border Bottom + { + get { return _bottom ?? (_bottom = new Border(this)); } + set + { + SetParent(value); + _bottom = value; + } + } + [DV] + public Border _bottom; + + /// + /// Gets or sets the right border. + /// + public Border Right + { + get { return _right ?? (_right = new Border(this)); } + set + { + SetParent(value); + _right = value; + } + } + [DV] + public Border _right; + + /// + /// Gets or sets the diagonalup border. + /// + public Border DiagonalUp + { + get { return _diagonalUp ?? (_diagonalUp = new Border(this)); } + set + { + SetParent(value); + _diagonalUp = value; + } + } + [DV] + public Border _diagonalUp; + + /// + /// Gets or sets the diagonaldown border. + /// + public Border DiagonalDown + { + get { return _diagonalDown ?? (_diagonalDown = new Border(this)); } + set + { + SetParent(value); + _diagonalDown = value; + } + } + [DV] + public Border _diagonalDown; + + /// + /// Gets or sets a value indicating whether the borders are visible. + /// + public bool Visible + { + get { return _visible.Value; } + set { _visible.Value = value; } + } + [DV] + public NBool _visible = NBool.NullValue; + + /// + /// Gets or sets the line style of the borders. + /// + public BorderStyle Style + { + get { return (BorderStyle)_style.Value; } + set { _style.Value = (int)value; } + } + [DV(Type = typeof(BorderStyle))] + public NEnum _style = NEnum.NullValue(typeof(BorderStyle)); + + /// + /// Gets or sets the standard width of the borders. + /// + public Unit Width + { + get { return _width; } + set { _width = value; } + } + [DV] + public Unit _width = Unit.NullValue; + + /// + /// Gets or sets the color of the borders. + /// + public Color Color + { + get { return _color; } + set { _color = value; } + } + [DV] + public Color _color = Color.Empty; + + /// + /// Gets or sets the distance between text and the top border. + /// + public Unit DistanceFromTop + { + get { return _distanceFromTop; } + set { _distanceFromTop = value; } + } + [DV] + public Unit _distanceFromTop = Unit.NullValue; + + /// + /// Gets or sets the distance between text and the bottom border. + /// + public Unit DistanceFromBottom + { + get { return _distanceFromBottom; } + set { _distanceFromBottom = value; } + } + [DV] + public Unit _distanceFromBottom = Unit.NullValue; + + /// + /// Gets or sets the distance between text and the left border. + /// + public Unit DistanceFromLeft + { + get { return _distanceFromLeft; } + set { _distanceFromLeft = value; } + } + [DV] + public Unit _distanceFromLeft = Unit.NullValue; + + /// + /// Gets or sets the distance between text and the right border. + /// + public Unit DistanceFromRight + { + get { return _distanceFromRight; } + set { _distanceFromRight = value; } + } + [DV] + public Unit _distanceFromRight = Unit.NullValue; + + /// + /// Sets the distance to all four borders to the specified value. + /// + public Unit Distance + { + set + { + DistanceFromTop = value; + DistanceFromBottom = value; + DistanceFromLeft = value; + DistanceFromRight = value; + } + } + + /// + /// Gets the information if the collection is marked as cleared. Additionally 'Borders = null' + /// is written to the DDL stream when serialized. + /// + public bool BordersCleared + { + get { return _clearAll; } + set { _clearAll = value; } + } + protected bool _clearAll; + #endregion + + #region public + /// + /// Converts Borders into DDL. + /// + public override void Serialize(Serializer serializer) + { + Serialize(serializer, null); + } + + /// + /// Converts Borders into DDL. + /// + public void Serialize(Serializer serializer, Borders refBorders) + { + if (_clearAll) + serializer.WriteLine("Borders = null"); + + int pos = serializer.BeginContent("Borders"); + + if (!_visible.IsNull && (refBorders == null || refBorders._visible.IsNull || (Visible != refBorders.Visible))) + serializer.WriteSimpleAttribute("Visible", Visible); + + if (!_style.IsNull && (refBorders == null || (Style != refBorders.Style))) + serializer.WriteSimpleAttribute("Style", Style); + + if (!_width.IsNull && (refBorders == null || (_width.Value != refBorders._width.Value))) + serializer.WriteSimpleAttribute("Width", Width); + + if (!_color.IsNull && (refBorders == null || ((Color.Argb != refBorders.Color.Argb)))) + serializer.WriteSimpleAttribute("Color", Color); + + if (!_distanceFromTop.IsNull && (refBorders == null || (DistanceFromTop.Point != refBorders.DistanceFromTop.Point))) + serializer.WriteSimpleAttribute("DistanceFromTop", DistanceFromTop); + + if (!_distanceFromBottom.IsNull && (refBorders == null || (DistanceFromBottom.Point != refBorders.DistanceFromBottom.Point))) + serializer.WriteSimpleAttribute("DistanceFromBottom", DistanceFromBottom); + + if (!_distanceFromLeft.IsNull && (refBorders == null || (DistanceFromLeft.Point != refBorders.DistanceFromLeft.Point))) + serializer.WriteSimpleAttribute("DistanceFromLeft", DistanceFromLeft); + + if (!_distanceFromRight.IsNull && (refBorders == null || (DistanceFromRight.Point != refBorders.DistanceFromRight.Point))) + serializer.WriteSimpleAttribute("DistanceFromRight", DistanceFromRight); + + if (!IsNull("Top")) + _top.Serialize(serializer, "Top", null); + + if (!IsNull("Left")) + _left.Serialize(serializer, "Left", null); + + if (!IsNull("Bottom")) + _bottom.Serialize(serializer, "Bottom", null); + + if (!IsNull("Right")) + _right.Serialize(serializer, "Right", null); + + if (!IsNull("DiagonalDown")) + _diagonalDown.Serialize(serializer, "DiagonalDown", null); + + if (!IsNull("DiagonalUp")) + _diagonalUp.Serialize(serializer, "DiagonalUp", null); + + serializer.EndContent(pos); + } + + /// + /// Gets a name of a border. + /// + public string GetMyName(Border border) + { + if (border == _top) + return "Top"; + if (border == _bottom) + return "Bottom"; + if (border == _left) + return "Left"; + if (border == _right) + return "Right"; + if (border == _diagonalUp) + return "DiagonalUp"; + if (border == _diagonalDown) + return "DiagonalDown"; + return null; + } + + /// + /// Returns an enumerator that can iterate through the Borders. + /// + public class BorderEnumerator : IEnumerator + { + int _index; + readonly Dictionary _ht; + + /// + /// Creates a new BorderEnumerator. + /// + public BorderEnumerator(Dictionary ht) + { + _ht = ht; + _index = -1; + } + + /// + /// Sets the enumerator to its initial position, which is before the first element in the border collection. + /// + public void Reset() + { + _index = -1; + } + + /// + /// Gets the current element in the border collection. + /// + public Border Current + { + get + { + IEnumerator enumerator = _ht.GetEnumerator(); + enumerator.Reset(); + for (int idx = 0; idx < _index + 1; idx++) + enumerator.MoveNext(); + return ((DictionaryEntry)enumerator.Current).Value as Border; + } + } + + /// + /// Gets the current element in the border collection. + /// + object IEnumerator.Current + { + get { return Current; } + } + + /// + /// Advances the enumerator to the next element of the border collection. + /// + public bool MoveNext() + { + _index++; + return (_index < _ht.Count); + } + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Borders))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Character.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Character.cs new file mode 100644 index 0000000..1edee3e --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Character.cs @@ -0,0 +1,199 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents a special character in paragraph text. + /// + // TODO: So ndern, dass symbolName und char in unterschiedlichen Feldern gespeichert werden. + // TODO Remove German remarks! + public class Character : DocumentObject + { + // \space + public static readonly Character Blank = new Character(SymbolName.Blank); + public static readonly Character En = new Character(SymbolName.En); + public static readonly Character Em = new Character(SymbolName.Em); + public static readonly Character EmQuarter = new Character(SymbolName.EmQuarter); + public static readonly Character Em4 = new Character(SymbolName.Em4); + + // used to serialize as \tab, \linebreak + public static readonly Character Tab = new Character(SymbolName.Tab); + public static readonly Character LineBreak = new Character(SymbolName.LineBreak); + //public static readonly Character MarginBreak = new Character(SymbolName.MarginBreak); + + // \symbol + public static readonly Character Euro = new Character(SymbolName.Euro); + public static readonly Character Copyright = new Character(SymbolName.Copyright); + public static readonly Character Trademark = new Character(SymbolName.Trademark); + public static readonly Character RegisteredTrademark = new Character(SymbolName.RegisteredTrademark); + public static readonly Character Bullet = new Character(SymbolName.Bullet); + public static readonly Character Not = new Character(SymbolName.Not); + public static readonly Character EmDash = new Character(SymbolName.EmDash); + public static readonly Character EnDash = new Character(SymbolName.EnDash); + public static readonly Character NonBreakableBlank = new Character(SymbolName.NonBreakableBlank); + public static readonly Character HardBlank = new Character(SymbolName.HardBlank); + + /// + /// Initializes a new instance of the Character class. + /// + public Character() + { } + + /// + /// Initializes a new instance of the Character class with the specified parent. + /// + public Character(DocumentObject parent) : base(parent) { } + + /// + /// Initializes a new instance of the Character class with the specified SymbolName. + /// + Character(SymbolName name) + : this() + { + // uint does not work, need cast to int. + //SetValue("SymbolName", (int)(uint)name); + _symbolName.Value = (int)name; + } + + #region Properties + /// + /// Gets or sets the SymbolName. Returns 0 if the type is defined by a character. + /// + public SymbolName SymbolName + { + get { return (SymbolName)_symbolName.Value; } + set { _symbolName.Value = (int)value; } + } + [DV(Type = typeof(SymbolName))] + public NEnum _symbolName = NEnum.NullValue(typeof(SymbolName)); + + /// + /// Gets or sets the SymbolName as character. Returns 0 if the type is defined via an enum. + /// + public char Char + { + get + { + if (((uint)_symbolName.Value & 0xF0000000) == 0) + return (char)_symbolName.Value; + return '\0'; + } + set { _symbolName.Value = value; } + } + + /// + /// Gets or sets the number of times the character is repeated. + /// + public int Count + { + get { return _count.Value; } + set { _count.Value = value; } + } + [DV] + public NInt _count = new NInt(1); + #endregion + + #region public + /// + /// Converts Character into DDL. + /// + public override void Serialize(Serializer serializer) + { + string text = String.Empty; + if (_count == 1) + { + if ((SymbolName)_symbolName.Value == SymbolName.Tab) + text = "\\tab "; + else if ((SymbolName)_symbolName.Value == SymbolName.LineBreak) + text = "\\linebreak\x0D\x0A"; + else if ((SymbolName)_symbolName.Value == SymbolName.ParaBreak) + text = "\x0D\x0A\x0D\x0A"; + //else if (symbolType == SymbolName.MarginBreak) + // text = "\\marginbreak "; + + if (text != "") + { + serializer.Write(text); + return; + } + } + + if (((uint)_symbolName.Value & 0xF0000000) == 0xF0000000) + { + // SymbolName == SpaceType? + if (((uint)_symbolName.Value & 0xF1000000) == 0xF1000000) + { + if ((SymbolName)_symbolName.Value == SymbolName.Blank) + { + //Note: Don't try to optimize it by leaving away the braces in case a single space is added. + //This would lead to confusion with '(' in directly following text. + text = "\\space(" + Count + ")"; + } + else + { + if (_count == 1) + text = "\\space(" + SymbolName + ")"; + else + text = "\\space(" + SymbolName + ", " + Count + ")"; + } + } + else + { + text = "\\symbol(" + SymbolName + ")"; + } + } + else + { + // symbolType is a (unicode) character + text = " \\chr(0x" + _symbolName.Value.ToString("X") + ")"; + } + + serializer.Write(text); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Character))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Chars.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Chars.cs new file mode 100644 index 0000000..fb69cac --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Chars.cs @@ -0,0 +1,83 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Character table by name. + /// + public sealed class Chars + { + // ReSharper disable InconsistentNaming + public const char Null = '\0'; // EOF + public const char CR = '\x0D'; // ignored by scanner + public const char LF = '\x0A'; + public const char BEL = '\a'; // Bell + public const char BS = '\b'; // Backspace + public const char FF = '\f'; // Formfeed + public const char HT = '\t'; // Horizontal tab + public const char VT = '\v'; // Vertical tab + public const char NonBreakableSpace = (char)160; // char(160) + // ReSharper restore InconsistentNaming + + // The following names come from "PDF Reference Third Edition" + // Appendix D.1, Latin Character Set and Encoding + public const char Space = ' '; + public const char QuoteDbl = '"'; + public const char QuoteSingle = '\''; + public const char ParenLeft = '('; + public const char ParenRight = ')'; + public const char BraceLeft = '{'; + public const char BraceRight = '}'; + public const char BracketLeft = '['; + public const char BracketRight = ']'; + public const char Less = '<'; + public const char Greater = '>'; + public const char Equal = '='; + public const char Period = '.'; + public const char Semicolon = ';'; + public const char Colon = ':'; + public const char Slash = '/'; + public const char Bar = '|'; + public const char BackSlash = '\\'; + public const char Percent = '%'; + public const char Dollar = '$'; + public const char At = '@'; + public const char NumberSign = '#'; + public const char Question = '?'; + public const char Hyphen = '-'; // char(45) + public const char SoftHyphen = ''; // char(173) + public const char Currency = ''; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Color.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Color.cs new file mode 100644 index 0000000..ce4145d --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Color.cs @@ -0,0 +1,697 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// The Color class represents an ARGB color value. + /// + [DebuggerDisplay("(A={A}, R={R}, G={G}, B={B} C={C}, M={M}, Y={Y}, K={K})")] + public struct Color : INullableValue + { + /// + /// Initializes a new instance of the Color class. + /// + public Color(uint argb) + { + _isCmyk = false; + _argb = argb; + _a = _c = _m = _y = _k = 0f; // Compiler enforces this line of code + InitCmykFromRgb(); + } + + /// + /// Initializes a new instance of the Color class. + /// + public Color(byte r, byte g, byte b) + { + _isCmyk = false; + _argb = 0xFF000000 | ((uint)r << 16) | ((uint)g << 8) | b; + _a = _c = _m = _y = _k = 0f; // Compiler enforces this line of code + InitCmykFromRgb(); + } + + /// + /// Initializes a new instance of the Color class. + /// + public Color(byte a, byte r, byte g, byte b) + { + _isCmyk = false; + _argb = ((uint)a << 24) | ((uint)r << 16) | ((uint)g << 8) | b; + _a = _c = _m = _y = _k = 0f; // Compiler enforces this line of code + InitCmykFromRgb(); + } + + /// + /// Initializes a new instance of the Color class with a CMYK color. + /// All values must be in a range between 0 to 100 percent. + /// + public Color(double alpha, double cyan, double magenta, double yellow, double black) + { + _isCmyk = true; + _a = (float)(alpha > 100 ? 100 : (alpha < 0 ? 0 : alpha)); + _c = (float)(cyan > 100 ? 100 : (cyan < 0 ? 0 : cyan)); + _m = (float)(magenta > 100 ? 100 : (magenta < 0 ? 0 : magenta)); + _y = (float)(yellow > 100 ? 100 : (yellow < 0 ? 0 : yellow)); + _k = (float)(black > 100 ? 100 : (black < 0 ? 0 : black)); + _argb = 0; // Compiler enforces this line of code + InitRgbFromCmyk(); + } + + /// + /// Initializes a new instance of the Color class with a CMYK color. + /// All values must be in a range between 0 to 100 percent. + /// + public Color(double cyan, double magenta, double yellow, double black) + : this(100, cyan, magenta, yellow, black) + { } + + void InitCmykFromRgb() + { + // Similar formula as in PDFsharp + _isCmyk = false; + int c = 255 - (int)R; + int m = 255 - (int)G; + int y = 255 - (int)B; + int k = Math.Min(c, Math.Min(m, y)); + if (k == 255) + _c = _m = _y = 0; + else + { + float black = 255f - k; + _c = 100f * (c - k) / black; + _m = 100f * (m - k) / black; + _y = 100f * (y - k) / black; + } + _k = 100f * k / 255f; + _a = A / 2.55f; + } + + void InitRgbFromCmyk() + { + // Similar formula as in PDFsharp + _isCmyk = true; + float black = _k * 2.55f + 0.5f; + float factor = (255f - black) / 100f; + byte a = (byte)(_a * 2.55 + 0.5); + byte r = (byte)(255 - Math.Min(255f, _c * factor + black)); + byte g = (byte)(255 - Math.Min(255f, _m * factor + black)); + byte b = (byte)(255 - Math.Min(255f, _y * factor + black)); + _argb = ((uint)a << 24) | ((uint)r << 16) | ((uint)g << 8) | b; + } + + /// + /// Gets a value indicating whether this instance is a CMYK color. + /// + public bool IsCmyk + { + get { return _isCmyk; } + } + + /// + /// Determines whether this color is empty. + /// + public bool IsEmpty + { + get { return this == Empty; } + } + + /// + /// Returns the value. + /// + object INullableValue.GetValue() + { + return this; + } + + /// + /// Sets the given value. + /// + void INullableValue.SetValue(object value) + { + if (value is uint) + _argb = (uint)value; + else + this = Parse(value.ToString()); + } + + /// + /// Resets this instance, i.e. IsNull() will return true afterwards. + /// + void INullableValue.SetNull() + { + this = Empty; + } + + /// + /// Determines whether this instance is null (not set). + /// + bool INullableValue.IsNull + { + get { return this == Empty; } + } + + /// + /// Determines whether this instance is null (not set). + /// + public bool IsNull + { + get { return this == Empty; } + } + + /// + /// Gets or sets the ARGB value. + /// + public uint Argb + { + get { return _argb; } + set + { + if (_isCmyk) + throw new InvalidOperationException("Cannot change a CMYK color."); + _argb = value; + InitCmykFromRgb(); + } + } + + /// + /// Gets or sets the RGB value. + /// + public uint RGB + { + get { return _argb; } + set + { + if (_isCmyk) + throw new InvalidOperationException("Cannot change a CMYK color."); + _argb = value; + InitCmykFromRgb(); + } + } + + /// + /// Calls base class Equals. + /// + public override bool Equals(Object obj) + { + if (obj is Color) + { + Color color = (Color)obj; + if (_isCmyk ^ color._isCmyk) + return false; + if (_isCmyk) + return _a == color._a && _c == color._c && _m == color._m && _y == color._y && _k == color._k; + return _argb == color._argb; + } + return false; + } + + /// + /// Gets the ARGB value that this Color instance represents. + /// + public override int GetHashCode() + { + return (int)_argb ^ _a.GetHashCode() ^ _c.GetHashCode() ^ _m.GetHashCode() ^ _y.GetHashCode() ^ _k.GetHashCode(); + } + + /// + /// Compares two color objects. True if both argb values are equal, false otherwise. + /// + public static bool operator ==(Color color1, Color color2) + { + if (color1._isCmyk ^ color2._isCmyk) + return false; + if (color1._isCmyk) + return color1._a == color2._a && color1._c == color2._c && color1._m == color2._m && color1._y == color2._y && color1._k == color2._k; + return color1._argb == color2._argb; + } + + /// + /// Compares two color objects. True if both argb values are not equal, false otherwise. + /// + public static bool operator !=(Color color1, Color color2) + { + return !(color1 == color2); + } + + /// + /// Parses the string and returns a color object. + /// Throws ArgumentException if color is invalid. + /// Supports four different formats for hex colors. + /// Format 1: uses prefix "0x", followed by as many hex digits as needed. Important: do not forget the opacity, so use 7 or 8 digits. + /// Format 2: uses prefix "#", followed by exactly 8 digits including opacity. + /// Format 3: uses prefix "#", followed by exactly 6 digits; opacity will be 0xff. + /// Format 4: uses prefix "#", followed by exactly 3 digits; opacity will be 0xff; "#ccc" will be treated as "#ffcccccc", "#d24" will be treated as "#ffdd2244". + /// + /// integer, hex or color name. + public static Color Parse(string color) + { + if (color == null) + throw new ArgumentNullException("color"); + if (color == "") + throw new ArgumentException("color"); + + try + { + uint clr; + // Must use Enum.Parse because Enum.IsDefined is case sensitive + try + { + object obj = Enum.Parse(typeof(ColorName), color, true); + clr = (uint)obj; + return new Color(clr); + } + catch + { + // Ignore exception because it's not a ColorName. + } + + NumberStyles numberStyle = NumberStyles.Integer; + string number = color.ToLower(); + if (number.StartsWith("0x")) + { + numberStyle = NumberStyles.HexNumber; + number = color.Substring(2); + } + else if (number.StartsWith("#")) + { + numberStyle = NumberStyles.HexNumber; + switch (color.Length) + { + case 9: + number = color.Substring(1); + break; + case 7: + number = "ff" + color.Substring(1); + break; + case 4: + number = "ff" + color.Substring(1,1) + color.Substring(1, 1) + + color.Substring(2, 1) + color.Substring(2, 1) + + color.Substring(3, 1) + color.Substring(3, 1); + break; + default: + throw new ArgumentException(DomSR.InvalidColorString(color), "color"); + } + } + clr = uint.Parse(number, numberStyle); + return new Color(clr); + } + catch (FormatException ex) + { + throw new ArgumentException(DomSR.InvalidColorString(color), ex); + } + } + + /// + /// Gets the alpha (transparency) part of the RGB Color. + /// The values is in the range between 0 to 255. + /// + public uint A + { + get { return (_argb & 0xFF000000) >> 24; } + } + + /// + /// Gets the red part of the Color. + /// The values is in the range between 0 to 255. + /// + public uint R + { + get { return (_argb & 0xFF0000) >> 16; } + } + + /// + /// Gets the green part of the Color. + /// The values is in the range between 0 to 255. + /// + public uint G + { + get { return (_argb & 0x00FF00) >> 8; } + } + + /// + /// Gets the blue part of the Color. + /// The values is in the range between 0 to 255. + /// + public uint B + { + get { return _argb & 0x0000FF; } + } + + /// + /// Gets the alpha (transparency) part of the CMYK Color. + /// The values is in the range between 0 (transparent) to 100 (opaque) percent. + /// + public double Alpha + { + get { return _a; } + } + + /// + /// Gets the cyan part of the Color. + /// The values is in the range between 0 to 100 percent. + /// + public double C + { + get { return _c; } + } + + /// + /// Gets the magenta part of the Color. + /// The values is in the range between 0 to 100 percent. + /// + public double M + { + get { return _m; } + } + + /// + /// Gets the yellow part of the Color. + /// The values is in the range between 0 to 100 percent. + /// + public double Y + { + get { return _y; } + } + + /// + /// Gets the key (black) part of the Color. + /// The values is in the range between 0 to 100 percent. + /// + public double K + { + get { return _k; } + } + + /// + /// Gets a non transparent color brightened in terms of transparency if any is given(A < 255), + /// otherwise this instance itself. + /// + public Color GetMixedTransparencyColor() + { + int alpha = (int)A; + if (alpha == 0xFF) + return this; + + int red = (int)R; + int green = (int)G; + int blue = (int)B; + + double whiteFactor = 1 - alpha / 255.0; + + red = (int)(red + (255 - red) * whiteFactor); + green = (int)(green + (255 - green) * whiteFactor); + blue = (int)(blue + (255 - blue) * whiteFactor); + return new Color((uint)(0xFF << 24 | (red << 16) | (green << 8) | blue)); + } + + /// + /// Writes the Color object in its hexadecimal value. + /// + public override string ToString() + { + if (_stdColors == null) + { +#if !SILVERLIGHT + Array colorNames = Enum.GetNames(typeof(ColorName)); + Array colorValues = Enum.GetValues(typeof(ColorName)); + int count = colorNames.GetLength(0); + _stdColors = new Dictionary(count); + for (int index = 0; index < count; index++) + { + string c = (string)colorNames.GetValue(index); + uint d = (uint)colorValues.GetValue(index); + // Some color are double named... + // Aqua == Cyan + // Fuchsia == Magenta + Style key = new Style(); + if (!_stdColors.ContainsKey(d)) + _stdColors.Add(d, c); + } +#else + _stdColors = new Dictionary(); + _stdColors.Add(0xFFF0F8FF, "AliceBlue"); + _stdColors.Add(0xFFFAEBD7, "AntiqueWhite"); + _stdColors.Add(0xFF00FFFF, "Aqua"); + _stdColors.Add(0xFF7FFFD4, "Aquamarine"); + _stdColors.Add(0xFFF0FFFF, "Azure"); + _stdColors.Add(0xFFF5F5DC, "Beige"); + _stdColors.Add(0xFFFFE4C4, "Bisque"); + _stdColors.Add(0xFF000000, "Black"); + _stdColors.Add(0xFFFFEBCD, "BlanchedAlmond"); + _stdColors.Add(0xFF0000FF, "Blue"); + _stdColors.Add(0xFF8A2BE2, "BlueViolet"); + _stdColors.Add(0xFFA52A2A, "Brown"); + _stdColors.Add(0xFFDEB887, "BurlyWood"); + _stdColors.Add(0xFF5F9EA0, "CadetBlue"); + _stdColors.Add(0xFF7FFF00, "Chartreuse"); + _stdColors.Add(0xFFD2691E, "Chocolate"); + _stdColors.Add(0xFFFF7F50, "Coral"); + _stdColors.Add(0xFF6495ED, "CornflowerBlue"); + _stdColors.Add(0xFFFFF8DC, "Cornsilk"); + _stdColors.Add(0xFFDC143C, "Crimson"); + //_stdColors.Add(0xFF00FFFF, "Cyan"); already added as "Aqua" + _stdColors.Add(0xFF00008B, "DarkBlue"); + _stdColors.Add(0xFF008B8B, "DarkCyan"); + _stdColors.Add(0xFFB8860B, "DarkGoldenrod"); + _stdColors.Add(0xFFA9A9A9, "DarkGray"); + _stdColors.Add(0xFF006400, "DarkGreen"); + _stdColors.Add(0xFFBDB76B, "DarkKhaki"); + _stdColors.Add(0xFF8B008B, "DarkMagenta"); + _stdColors.Add(0xFF556B2F, "DarkOliveGreen"); + _stdColors.Add(0xFFFF8C00, "DarkOrange"); + _stdColors.Add(0xFF9932CC, "DarkOrchid"); + _stdColors.Add(0xFF8B0000, "DarkRed"); + _stdColors.Add(0xFFE9967A, "DarkSalmon"); + _stdColors.Add(0xFF8FBC8B, "DarkSeaGreen"); + _stdColors.Add(0xFF483D8B, "DarkSlateBlue"); + _stdColors.Add(0xFF2F4F4F, "DarkSlateGray"); + _stdColors.Add(0xFF00CED1, "DarkTurquoise"); + _stdColors.Add(0xFF9400D3, "DarkViolet"); + _stdColors.Add(0xFFFF1493, "DeepPink"); + _stdColors.Add(0xFF00BFFF, "DeepSkyBlue"); + _stdColors.Add(0xFF696969, "DimGray"); + _stdColors.Add(0xFF1E90FF, "DodgerBlue"); + _stdColors.Add(0xFFB22222, "Firebrick"); + _stdColors.Add(0xFFFFFAF0, "FloralWhite"); + _stdColors.Add(0xFF228B22, "ForestGreen"); + _stdColors.Add(0xFFFF00FF, "Fuchsia"); + _stdColors.Add(0xFFDCDCDC, "Gainsboro"); + _stdColors.Add(0xFFF8F8FF, "GhostWhite"); + _stdColors.Add(0xFFFFD700, "Gold"); + _stdColors.Add(0xFFDAA520, "Goldenrod"); + _stdColors.Add(0xFF808080, "Gray"); + _stdColors.Add(0xFF008000, "Green"); + _stdColors.Add(0xFFADFF2F, "GreenYellow"); + _stdColors.Add(0xFFF0FFF0, "Honeydew"); + _stdColors.Add(0xFFFF69B4, "HotPink"); + _stdColors.Add(0xFFCD5C5C, "IndianRed"); + _stdColors.Add(0xFF4B0082, "Indigo"); + _stdColors.Add(0xFFFFFFF0, "Ivory"); + _stdColors.Add(0xFFF0E68C, "Khaki"); + _stdColors.Add(0xFFE6E6FA, "Lavender"); + _stdColors.Add(0xFFFFF0F5, "LavenderBlush"); + _stdColors.Add(0xFF7CFC00, "LawnGreen"); + _stdColors.Add(0xFFFFFACD, "LemonChiffon"); + _stdColors.Add(0xFFADD8E6, "LightBlue"); + _stdColors.Add(0xFFF08080, "LightCoral"); + _stdColors.Add(0xFFE0FFFF, "LightCyan"); + _stdColors.Add(0xFFFAFAD2, "LightGoldenrodYellow"); + _stdColors.Add(0xFFD3D3D3, "LightGray"); + _stdColors.Add(0xFF90EE90, "LightGreen"); + _stdColors.Add(0xFFFFB6C1, "LightPink"); + _stdColors.Add(0xFFFFA07A, "LightSalmon"); + _stdColors.Add(0xFF20B2AA, "LightSeaGreen"); + _stdColors.Add(0xFF87CEFA, "LightSkyBlue"); + _stdColors.Add(0xFF778899, "LightSlateGray"); + _stdColors.Add(0xFFB0C4DE, "LightSteelBlue"); + _stdColors.Add(0xFFFFFFE0, "LightYellow"); + _stdColors.Add(0xFF00FF00, "Lime"); + _stdColors.Add(0xFF32CD32, "LimeGreen"); + _stdColors.Add(0xFFFAF0E6, "Linen"); + // _stdColors.Add(0xFFFF00FF, "Magenta"); already added as "Fuchsia" + _stdColors.Add(0xFF800000, "Maroon"); + _stdColors.Add(0xFF66CDAA, "MediumAquamarine"); + _stdColors.Add(0xFF0000CD, "MediumBlue"); + _stdColors.Add(0xFFBA55D3, "MediumOrchid"); + _stdColors.Add(0xFF9370DB, "MediumPurple"); + _stdColors.Add(0xFF3CB371, "MediumSeaGreen"); + _stdColors.Add(0xFF7B68EE, "MediumSlateBlue"); + _stdColors.Add(0xFF00FA9A, "MediumSpringGreen"); + _stdColors.Add(0xFF48D1CC, "MediumTurquoise"); + _stdColors.Add(0xFFC71585, "MediumVioletRed"); + _stdColors.Add(0xFF191970, "MidnightBlue"); + _stdColors.Add(0xFFF5FFFA, "MintCream"); + _stdColors.Add(0xFFFFE4E1, "MistyRose"); + _stdColors.Add(0xFFFFE4B5, "Moccasin"); + _stdColors.Add(0xFFFFDEAD, "NavajoWhite"); + _stdColors.Add(0xFF000080, "Navy"); + _stdColors.Add(0xFFFDF5E6, "OldLace"); + _stdColors.Add(0xFF808000, "Olive"); + _stdColors.Add(0xFF6B8E23, "OliveDrab"); + _stdColors.Add(0xFFFFA500, "Orange"); + _stdColors.Add(0xFFFF4500, "OrangeRed"); + _stdColors.Add(0xFFDA70D6, "Orchid"); + _stdColors.Add(0xFFEEE8AA, "PaleGoldenrod"); + _stdColors.Add(0xFF98FB98, "PaleGreen"); + _stdColors.Add(0xFFAFEEEE, "PaleTurquoise"); + _stdColors.Add(0xFFDB7093, "PaleVioletRed"); + _stdColors.Add(0xFFFFEFD5, "PapayaWhip"); + _stdColors.Add(0xFFFFDAB9, "PeachPuff"); + _stdColors.Add(0xFFCD853F, "Peru"); + _stdColors.Add(0xFFFFC0CB, "Pink"); + _stdColors.Add(0xFFDDA0DD, "Plum"); + _stdColors.Add(0xFFB0E0E6, "PowderBlue"); + _stdColors.Add(0xFF800080, "Purple"); + _stdColors.Add(0xFFFF0000, "Red"); + _stdColors.Add(0xFFBC8F8F, "RosyBrown"); + _stdColors.Add(0xFF4169E1, "RoyalBlue"); + _stdColors.Add(0xFF8B4513, "SaddleBrown"); + _stdColors.Add(0xFFFA8072, "Salmon"); + _stdColors.Add(0xFFF4A460, "SandyBrown"); + _stdColors.Add(0xFF2E8B57, "SeaGreen"); + _stdColors.Add(0xFFFFF5EE, "SeaShell"); + _stdColors.Add(0xFFA0522D, "Sienna"); + _stdColors.Add(0xFFC0C0C0, "Silver"); + _stdColors.Add(0xFF87CEEB, "SkyBlue"); + _stdColors.Add(0xFF6A5ACD, "SlateBlue"); + _stdColors.Add(0xFF708090, "SlateGray"); + _stdColors.Add(0xFFFFFAFA, "Snow"); + _stdColors.Add(0xFF00FF7F, "SpringGreen"); + _stdColors.Add(0xFF4682B4, "SteelBlue"); + _stdColors.Add(0xFFD2B48C, "Tan"); + _stdColors.Add(0xFF008080, "Teal"); + _stdColors.Add(0xFFD8BFD8, "Thistle"); + _stdColors.Add(0xFFFF6347, "Tomato"); + _stdColors.Add(0x00FFFFFF, "Transparent"); + _stdColors.Add(0xFF40E0D0, "Turquoise"); + _stdColors.Add(0xFFEE82EE, "Violet"); + _stdColors.Add(0xFFF5DEB3, "Wheat"); + _stdColors.Add(0xFFFFFFFF, "White"); + _stdColors.Add(0xFFF5F5F5, "WhiteSmoke"); + _stdColors.Add(0xFFFFFF00, "Yellow"); + _stdColors.Add(0xFF9ACD32, "YellowGreen"); +#endif + } + if (_isCmyk) + { + string s; + if (Alpha == 100.0) + s = String.Format(CultureInfo.InvariantCulture, "CMYK({0:0.##},{1:0.##},{2:0.##},{3:0.##})", C, M, Y, K); + else + s = String.Format(CultureInfo.InvariantCulture, "CMYK({0:0.##},{1:0.##},{2:0.##},{3:0.##},{4:0.##})", Alpha, C, M, Y, K); + return s; + } + else + { + if (_stdColors.ContainsKey(_argb)) + return _stdColors[_argb]; + if ((_argb & 0xFF000000) == 0xFF000000) + return "RGB(" + + ((_argb & 0xFF0000) >> 16) + "," + + ((_argb & 0x00FF00) >> 8) + "," + + (_argb & 0x0000FF) + ")"; + return "0x" + _argb.ToString("X"); + } + } + static Dictionary _stdColors; + + /// + /// Creates an RGB color from an existing color with a new alpha (transparency) value. + /// + public static Color FromRgbColor(byte a, Color color) + { + return new Color(a, (byte)color.R, (byte)color.G, (byte)color.B); + } + + /// + /// Creates an RGB color from red, green, and blue. + /// + public static Color FromRgb(byte r, byte g, byte b) + { + return new Color(255, r, g, b); + } + + /// + /// Creates an RGB color from alpha, red, green, and blue. + /// + public static Color FromArgb(byte alpha, byte r, byte g, byte b) + { + return new Color(alpha, r, g, b); + } + + /// + /// Creates a Color structure from the specified CMYK values. + /// All values must be in a range between 0 to 100 percent. + /// + public static Color FromCmyk(double cyan, double magenta, double yellow, double black) + { + return new Color(cyan, magenta, yellow, black); + } + + /// + /// Creates a Color structure from the specified CMYK values. + /// All values must be in a range between 0 to 100 percent. + /// + public static Color FromCmyk(double alpha, double cyan, double magenta, double yellow, double black) + { + return new Color(alpha, cyan, magenta, yellow, black); + } + + /// + /// Creates a CMYK color from an existing color with a new alpha (transparency) value. + /// + public static Color FromCmykColor(double alpha, Color color) + { + return new Color(alpha, color.C, color.M, color.Y, color.K); + } + + uint _argb; // ARGB + bool _isCmyk; + private float _a; // \ + private float _c; // | + private float _m; // |--- alpha + CMYK + private float _y; // | + private float _k; // / + + /// + /// Represents a null color. + /// + public static readonly Color Empty = new Color(0); + } +} \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Colors.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Colors.cs new file mode 100644 index 0000000..ff81e15 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Colors.cs @@ -0,0 +1,745 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents 141 predefined colors. + /// + public static class Colors + { + /// + /// Gets the system-defined color that has the ARGB value of #FFF0F8FF. + /// + public static readonly Color AliceBlue = new Color(0xFFF0F8FF); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFAEBD7. + /// + public static readonly Color AntiqueWhite = new Color(0xFFFAEBD7); + + /// + /// Gets the system-defined color that has the ARGB value of #FF00FFFF. + /// + public static readonly Color Aqua = new Color(0xFF00FFFF); + + /// + /// Gets the system-defined color that has the ARGB value of #FF7FFFD4. + /// + public static readonly Color Aquamarine = new Color(0xFF7FFFD4); + + /// + /// Gets the system-defined color that has the ARGB value of #FFF0FFFF. + /// + public static readonly Color Azure = new Color(0xFFF0FFFF); + + /// + /// Gets the system-defined color that has the ARGB value of #FFF5F5DC. + /// + public static readonly Color Beige = new Color(0xFFF5F5DC); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFE4C4. + /// + public static readonly Color Bisque = new Color(0xFFFFE4C4); + + /// + /// Gets the system-defined color that has the ARGB value of #FF000000. + /// + public static readonly Color Black = new Color(0xFF000000); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFEBCD. + /// + public static readonly Color BlanchedAlmond = new Color(0xFFFFEBCD); + + /// + /// Gets the system-defined color that has the ARGB value of #FF0000FF. + /// + public static readonly Color Blue = new Color(0xFF0000FF); + + /// + /// Gets the system-defined color that has the ARGB value of #FF8A2BE2. + /// + public static readonly Color BlueViolet = new Color(0xFF8A2BE2); + + /// + /// Gets the system-defined color that has the ARGB value of #FFA52A2A. + /// + public static readonly Color Brown = new Color(0xFFA52A2A); + + /// + /// Gets the system-defined color that has the ARGB value of #FFDEB887. + /// + public static readonly Color BurlyWood = new Color(0xFFDEB887); + + /// + /// Gets the system-defined color that has the ARGB value of #FF5F9EA0. + /// + public static readonly Color CadetBlue = new Color(0xFF5F9EA0); + + /// + /// Gets the system-defined color that has the ARGB value of #FF7FFF00. + /// + public static readonly Color Chartreuse = new Color(0xFF7FFF00); + + /// + /// Gets the system-defined color that has the ARGB value of #FFD2691E. + /// + public static readonly Color Chocolate = new Color(0xFFD2691E); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFF7F50. + /// + public static readonly Color Coral = new Color(0xFFFF7F50); + + /// + /// Gets the system-defined color that has the ARGB value of #FF6495ED. + /// + public static readonly Color CornflowerBlue = new Color(0xFF6495ED); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFF8DC. + /// + public static readonly Color Cornsilk = new Color(0xFFFFF8DC); + + /// + /// Gets the system-defined color that has the ARGB value of #FFDC143C. + /// + public static readonly Color Crimson = new Color(0xFFDC143C); + + /// + /// Gets the system-defined color that has the ARGB value of #FF00FFFF. + /// + public static readonly Color Cyan = new Color(0xFF00FFFF); + + /// + /// Gets the system-defined color that has the ARGB value of #FF00008B. + /// + public static readonly Color DarkBlue = new Color(0xFF00008B); + + /// + /// Gets the system-defined color that has the ARGB value of #FF008B8B. + /// + public static readonly Color DarkCyan = new Color(0xFF008B8B); + + /// + /// Gets the system-defined color that has the ARGB value of #FFB8860B. + /// + public static readonly Color DarkGoldenrod = new Color(0xFFB8860B); + + /// + /// Gets the system-defined color that has the ARGB value of #FFA9A9A9. + /// + public static readonly Color DarkGray = new Color(0xFFA9A9A9); + + /// + /// Gets the system-defined color that has the ARGB value of #FF006400. + /// + public static readonly Color DarkGreen = new Color(0xFF006400); + + /// + /// Gets the system-defined color that has the ARGB value of #FFBDB76B. + /// + public static readonly Color DarkKhaki = new Color(0xFFBDB76B); + + /// + /// Gets the system-defined color that has the ARGB value of #FF8B008B. + /// + public static readonly Color DarkMagenta = new Color(0xFF8B008B); + + /// + /// Gets the system-defined color that has the ARGB value of #FF556B2F. + /// + public static readonly Color DarkOliveGreen = new Color(0xFF556B2F); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFF8C00. + /// + public static readonly Color DarkOrange = new Color(0xFFFF8C00); + + /// + /// Gets the system-defined color that has the ARGB value of #FF9932CC. + /// + public static readonly Color DarkOrchid = new Color(0xFF9932CC); + + /// + /// Gets the system-defined color that has the ARGB value of #FF8B0000. + /// + public static readonly Color DarkRed = new Color(0xFF8B0000); + + /// + /// Gets the system-defined color that has the ARGB value of #FFE9967A. + /// + public static readonly Color DarkSalmon = new Color(0xFFE9967A); + + /// + /// Gets the system-defined color that has the ARGB value of #FF8FBC8B. + /// + public static readonly Color DarkSeaGreen = new Color(0xFF8FBC8B); + + /// + /// Gets the system-defined color that has the ARGB value of #FF483D8B. + /// + public static readonly Color DarkSlateBlue = new Color(0xFF483D8B); + + /// + /// Gets the system-defined color that has the ARGB value of #FF2F4F4F. + /// + public static readonly Color DarkSlateGray = new Color(0xFF2F4F4F); + + /// + /// Gets the system-defined color that has the ARGB value of #FF00CED1. + /// + public static readonly Color DarkTurquoise = new Color(0xFF00CED1); + + /// + /// Gets the system-defined color that has the ARGB value of #FF9400D3. + /// + public static readonly Color DarkViolet = new Color(0xFF9400D3); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFF1493. + /// + public static readonly Color DeepPink = new Color(0xFFFF1493); + + /// + /// Gets the system-defined color that has the ARGB value of #FF00BFFF. + /// + public static readonly Color DeepSkyBlue = new Color(0xFF00BFFF); + + /// + /// Gets the system-defined color that has the ARGB value of #FF696969. + /// + public static readonly Color DimGray = new Color(0xFF696969); + + /// + /// Gets the system-defined color that has the ARGB value of #FF1E90FF. + /// + public static readonly Color DodgerBlue = new Color(0xFF1E90FF); + + /// + /// Gets the system-defined color that has the ARGB value of #FFB22222. + /// + public static readonly Color Firebrick = new Color(0xFFB22222); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFFAF0. + /// + public static readonly Color FloralWhite = new Color(0xFFFFFAF0); + + /// + /// Gets the system-defined color that has the ARGB value of #FF228B22. + /// + public static readonly Color ForestGreen = new Color(0xFF228B22); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFF00FF. + /// + public static readonly Color Fuchsia = new Color(0xFFFF00FF); + + /// + /// Gets the system-defined color that has the ARGB value of #FFDCDCDC. + /// + public static readonly Color Gainsboro = new Color(0xFFDCDCDC); + + /// + /// Gets the system-defined color that has the ARGB value of #FFF8F8FF. + /// + public static readonly Color GhostWhite = new Color(0xFFF8F8FF); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFD700. + /// + public static readonly Color Gold = new Color(0xFFFFD700); + + /// + /// Gets the system-defined color that has the ARGB value of #FFDAA520. + /// + public static readonly Color Goldenrod = new Color(0xFFDAA520); + + /// + /// Gets the system-defined color that has the ARGB value of #FF808080. + /// + public static readonly Color Gray = new Color(0xFF808080); + + /// + /// Gets the system-defined color that has the ARGB value of #FF008000. + /// + public static readonly Color Green = new Color(0xFF008000); + + /// + /// Gets the system-defined color that has the ARGB value of #FFADFF2F. + /// + public static readonly Color GreenYellow = new Color(0xFFADFF2F); + + /// + /// Gets the system-defined color that has the ARGB value of #FFF0FFF0. + /// + public static readonly Color Honeydew = new Color(0xFFF0FFF0); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFF69B4. + /// + public static readonly Color HotPink = new Color(0xFFFF69B4); + + /// + /// Gets the system-defined color that has the ARGB value of #FFCD5C5C. + /// + public static readonly Color IndianRed = new Color(0xFFCD5C5C); + + /// + /// Gets the system-defined color that has the ARGB value of #FF4B0082. + /// + public static readonly Color Indigo = new Color(0xFF4B0082); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFFFF0. + /// + public static readonly Color Ivory = new Color(0xFFFFFFF0); + + /// + /// Gets the system-defined color that has the ARGB value of #FFF0E68C. + /// + public static readonly Color Khaki = new Color(0xFFF0E68C); + + /// + /// Gets the system-defined color that has the ARGB value of #FFE6E6FA. + /// + public static readonly Color Lavender = new Color(0xFFE6E6FA); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFF0F5. + /// + public static readonly Color LavenderBlush = new Color(0xFFFFF0F5); + + /// + /// Gets the system-defined color that has the ARGB value of #FF7CFC00. + /// + public static readonly Color LawnGreen = new Color(0xFF7CFC00); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFFACD. + /// + public static readonly Color LemonChiffon = new Color(0xFFFFFACD); + + /// + /// Gets the system-defined color that has the ARGB value of #FFADD8E6. + /// + public static readonly Color LightBlue = new Color(0xFFADD8E6); + + /// + /// Gets the system-defined color that has the ARGB value of #FFF08080. + /// + public static readonly Color LightCoral = new Color(0xFFF08080); + + /// + /// Gets the system-defined color that has the ARGB value of #FFE0FFFF. + /// + public static readonly Color LightCyan = new Color(0xFFE0FFFF); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFAFAD2. + /// + public static readonly Color LightGoldenrodYellow = new Color(0xFFFAFAD2); + + /// + /// Gets the system-defined color that has the ARGB value of #FFD3D3D3. + /// + public static readonly Color LightGray = new Color(0xFFD3D3D3); + + /// + /// Gets the system-defined color that has the ARGB value of #FF90EE90. + /// + public static readonly Color LightGreen = new Color(0xFF90EE90); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFB6C1. + /// + public static readonly Color LightPink = new Color(0xFFFFB6C1); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFA07A. + /// + public static readonly Color LightSalmon = new Color(0xFFFFA07A); + + /// + /// Gets the system-defined color that has the ARGB value of #FF20B2AA. + /// + public static readonly Color LightSeaGreen = new Color(0xFF20B2AA); + + /// + /// Gets the system-defined color that has the ARGB value of #FF87CEFA. + /// + public static readonly Color LightSkyBlue = new Color(0xFF87CEFA); + + /// + /// Gets the system-defined color that has the ARGB value of #FF778899. + /// + public static readonly Color LightSlateGray = new Color(0xFF778899); + + /// + /// Gets the system-defined color that has the ARGB value of #FFB0C4DE. + /// + public static readonly Color LightSteelBlue = new Color(0xFFB0C4DE); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFFFE0. + /// + public static readonly Color LightYellow = new Color(0xFFFFFFE0); + + /// + /// Gets the system-defined color that has the ARGB value of #FF00FF00. + /// + public static readonly Color Lime = new Color(0xFF00FF00); + + /// + /// Gets the system-defined color that has the ARGB value of #FF32CD32. + /// + public static readonly Color LimeGreen = new Color(0xFF32CD32); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFAF0E6. + /// + public static readonly Color Linen = new Color(0xFFFAF0E6); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFF00FF. + /// + public static readonly Color Magenta = new Color(0xFFFF00FF); + + /// + /// Gets the system-defined color that has the ARGB value of #FF800000. + /// + public static readonly Color Maroon = new Color(0xFF800000); + + /// + /// Gets the system-defined color that has the ARGB value of #FF66CDAA. + /// + public static readonly Color MediumAquamarine = new Color(0xFF66CDAA); + + /// + /// Gets the system-defined color that has the ARGB value of #FF0000CD. + /// + public static readonly Color MediumBlue = new Color(0xFF0000CD); + + /// + /// Gets the system-defined color that has the ARGB value of #FFBA55D3. + /// + public static readonly Color MediumOrchid = new Color(0xFFBA55D3); + + /// + /// Gets the system-defined color that has the ARGB value of #FF9370DB. + /// + public static readonly Color MediumPurple = new Color(0xFF9370DB); + + /// + /// Gets the system-defined color that has the ARGB value of #FF3CB371. + /// + public static readonly Color MediumSeaGreen = new Color(0xFF3CB371); + + /// + /// Gets the system-defined color that has the ARGB value of #FF7B68EE. + /// + public static readonly Color MediumSlateBlue = new Color(0xFF7B68EE); + + /// + /// Gets the system-defined color that has the ARGB value of #FF00FA9A. + /// + public static readonly Color MediumSpringGreen = new Color(0xFF00FA9A); + + /// + /// Gets the system-defined color that has the ARGB value of #FF48D1CC. + /// + public static readonly Color MediumTurquoise = new Color(0xFF48D1CC); + + /// + /// Gets the system-defined color that has the ARGB value of #FFC71585. + /// + public static readonly Color MediumVioletRed = new Color(0xFFC71585); + + /// + /// Gets the system-defined color that has the ARGB value of #FF191970. + /// + public static readonly Color MidnightBlue = new Color(0xFF191970); + + /// + /// Gets the system-defined color that has the ARGB value of #FFF5FFFA. + /// + public static readonly Color MintCream = new Color(0xFFF5FFFA); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFE4E1. + /// + public static readonly Color MistyRose = new Color(0xFFFFE4E1); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFE4B5. + /// + public static readonly Color Moccasin = new Color(0xFFFFE4B5); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFDEAD. + /// + public static readonly Color NavajoWhite = new Color(0xFFFFDEAD); + + /// + /// Gets the system-defined color that has the ARGB value of #FF000080. + /// + public static readonly Color Navy = new Color(0xFF000080); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFDF5E6. + /// + public static readonly Color OldLace = new Color(0xFFFDF5E6); + + /// + /// Gets the system-defined color that has the ARGB value of #FF808000. + /// + public static readonly Color Olive = new Color(0xFF808000); + + /// + /// Gets the system-defined color that has the ARGB value of #FF6B8E23. + /// + public static readonly Color OliveDrab = new Color(0xFF6B8E23); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFA500. + /// + public static readonly Color Orange = new Color(0xFFFFA500); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFF4500. + /// + public static readonly Color OrangeRed = new Color(0xFFFF4500); + + /// + /// Gets the system-defined color that has the ARGB value of #FFDA70D6. + /// + public static readonly Color Orchid = new Color(0xFFDA70D6); + + /// + /// Gets the system-defined color that has the ARGB value of #FFEEE8AA. + /// + public static readonly Color PaleGoldenrod = new Color(0xFFEEE8AA); + + /// + /// Gets the system-defined color that has the ARGB value of #FF98FB98. + /// + public static readonly Color PaleGreen = new Color(0xFF98FB98); + + /// + /// Gets the system-defined color that has the ARGB value of #FFAFEEEE. + /// + public static readonly Color PaleTurquoise = new Color(0xFFAFEEEE); + + /// + /// Gets the system-defined color that has the ARGB value of #FFDB7093. + /// + public static readonly Color PaleVioletRed = new Color(0xFFDB7093); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFEFD5. + /// + public static readonly Color PapayaWhip = new Color(0xFFFFEFD5); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFDAB9. + /// + public static readonly Color PeachPuff = new Color(0xFFFFDAB9); + + /// + /// Gets the system-defined color that has the ARGB value of #FFCD853F. + /// + public static readonly Color Peru = new Color(0xFFCD853F); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFC0CB. + /// + public static readonly Color Pink = new Color(0xFFFFC0CB); + + /// + /// Gets the system-defined color that has the ARGB value of #FFDDA0DD. + /// + public static readonly Color Plum = new Color(0xFFDDA0DD); + + /// + /// Gets the system-defined color that has the ARGB value of #FFB0E0E6. + /// + public static readonly Color PowderBlue = new Color(0xFFB0E0E6); + + /// + /// Gets the system-defined color that has the ARGB value of #FF800080. + /// + public static readonly Color Purple = new Color(0xFF800080); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFF0000. + /// + public static readonly Color Red = new Color(0xFFFF0000); + + /// + /// Gets the system-defined color that has the ARGB value of #FFBC8F8F. + /// + public static readonly Color RosyBrown = new Color(0xFFBC8F8F); + + /// + /// Gets the system-defined color that has the ARGB value of #FF4169E1. + /// + public static readonly Color RoyalBlue = new Color(0xFF4169E1); + + /// + /// Gets the system-defined color that has the ARGB value of #FF8B4513. + /// + public static readonly Color SaddleBrown = new Color(0xFF8B4513); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFA8072. + /// + public static readonly Color Salmon = new Color(0xFFFA8072); + + /// + /// Gets the system-defined color that has the ARGB value of #FFF4A460. + /// + public static readonly Color SandyBrown = new Color(0xFFF4A460); + + /// + /// Gets the system-defined color that has the ARGB value of #FF2E8B57. + /// + public static readonly Color SeaGreen = new Color(0xFF2E8B57); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFF5EE. + /// + public static readonly Color SeaShell = new Color(0xFFFFF5EE); + + /// + /// Gets the system-defined color that has the ARGB value of #FFA0522D. + /// + public static readonly Color Sienna = new Color(0xFFA0522D); + + /// + /// Gets the system-defined color that has the ARGB value of #FFC0C0C0. + /// + public static readonly Color Silver = new Color(0xFFC0C0C0); + + /// + /// Gets the system-defined color that has the ARGB value of #FF87CEEB. + /// + public static readonly Color SkyBlue = new Color(0xFF87CEEB); + + /// + /// Gets the system-defined color that has the ARGB value of #FF6A5ACD. + /// + public static readonly Color SlateBlue = new Color(0xFF6A5ACD); + + /// + /// Gets the system-defined color that has the ARGB value of #FF708090. + /// + public static readonly Color SlateGray = new Color(0xFF708090); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFFAFA. + /// + public static readonly Color Snow = new Color(0xFFFFFAFA); + + /// + /// Gets the system-defined color that has the ARGB value of #FF00FF7F. + /// + public static readonly Color SpringGreen = new Color(0xFF00FF7F); + + /// + /// Gets the system-defined color that has the ARGB value of #FF4682B4. + /// + public static readonly Color SteelBlue = new Color(0xFF4682B4); + + /// + /// Gets the system-defined color that has the ARGB value of #FFD2B48C. + /// + public static readonly Color Tan = new Color(0xFFD2B48C); + + /// + /// Gets the system-defined color that has the ARGB value of #FF008080. + /// + public static readonly Color Teal = new Color(0xFF008080); + + /// + /// Gets the system-defined color that has the ARGB value of #FFD8BFD8. + /// + public static readonly Color Thistle = new Color(0xFFD8BFD8); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFF6347. + /// + public static readonly Color Tomato = new Color(0xFFFF6347); + + /// + /// Gets the system-defined color that has the ARGB value of #00FFFFFF. + /// + public static readonly Color Transparent = new Color(0x00FFFFFF); + + /// + /// Gets the system-defined color that has the ARGB value of #FF40E0D0. + /// + public static readonly Color Turquoise = new Color(0xFF40E0D0); + + /// + /// Gets the system-defined color that has the ARGB value of #FFEE82EE. + /// + public static readonly Color Violet = new Color(0xFFEE82EE); + + /// + /// Gets the system-defined color that has the ARGB value of #FFF5DEB3. + /// + public static readonly Color Wheat = new Color(0xFFF5DEB3); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFFFFF. + /// + public static readonly Color White = new Color(0xFFFFFFFF); + + /// + /// Gets the system-defined color that has the ARGB value of #FFF5F5F5. + /// + public static readonly Color WhiteSmoke = new Color(0xFFF5F5F5); + + /// + /// Gets the system-defined color that has the ARGB value of #FFFFFF00. + /// + public static readonly Color Yellow = new Color(0xFFFFFF00); + + /// + /// Gets the system-defined color that has the ARGB value of #FF9ACD32. + /// + public static readonly Color YellowGreen = new Color(0xFF9ACD32); + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/DdlEncoder.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DdlEncoder.cs new file mode 100644 index 0000000..b7810f5 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DdlEncoder.cs @@ -0,0 +1,173 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Text; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Provides functions for encoding and decoding of DDL text. + /// + public sealed class DdlEncoder + { + /// + /// Initializes a new instance of the DdlEncoder class. + /// + DdlEncoder() + { } + + /// + /// Converts a string into a text phrase. + /// + public static string StringToText(string str) + { + if (str == null) + return null; + + int length = str.Length; + StringBuilder strb = new StringBuilder(length + (length >> 2)); + for (int index = 0; index < length; ++index) + { + // Don't convert characters into DDL. + char ch = str[index]; + switch (ch) + { + case '\\': + strb.Append("\\\\"); + break; + + case '{': + strb.Append("\\{"); + break; + + case '}': + strb.Append("\\}"); + break; + + // escape comments + case '/': + if (index < length - 1 && str[index + 1] == '/') + { + strb.Append("\\//"); + ++index; + } + else + strb.Append("/"); + break; + + default: + strb.Append(ch); + break; + } + } + return strb.ToString(); + } + + /// + /// Converts a string into a string literal (a quoted string). + /// + public static string StringToLiteral(string str) + { + int length = 0; + if (str == null || (length = str.Length) == 0) + return "\"\""; + + StringBuilder strb = new StringBuilder(length + (int)(length >> 2)); + strb.Append("\""); + for (int index = 0; index < length; ++index) + { + char ch = str[index]; + switch (ch) + { + case '\\': + strb.Append("\\\\"); + break; + + case '"': + strb.Append("\\\""); + break; + + default: + strb.Append(ch); + break; + } + } + strb.Append("\""); + + return strb.ToString(); + } + + /// + /// Scans the given string for characters which are invalid for identifiers. + /// Strings are limited to 64 characters. + /// + public static bool IsDdeIdentifier(string name) + { + if (String.IsNullOrEmpty(name)) + return false; + + int len = name.Length; + if (len > 64) + return false; + + for (int index = 0; index < len; index++) + { + char ch = name[index]; + if (ch == ' ') + return false; + + if (index == 0) + { + if (!Char.IsLetter(ch) && ch != '_') + return false; + } + else + { + if (!Char.IsLetterOrDigit(ch) && ch != '_') + return false; + } + } + return true; + } + + /// + /// Quotes the given name, if it contains characters which are invalid for identifiers. + /// + public static string QuoteIfNameContainsBlanks(string name) + { + if (IsDdeIdentifier(name)) + return name; + return "\"" + name + "\""; + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/DdlVisibleAttribute.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DdlVisibleAttribute.cs new file mode 100644 index 0000000..ce489ca --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DdlVisibleAttribute.cs @@ -0,0 +1,83 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Under Construction. + /// + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class DdlVisibleAttribute : Attribute + { + /// + /// Initializes a new instance of the DdlVisibleAttribute class. + /// + public DdlVisibleAttribute() + { + _visible = true; + } + + /// + /// Initializes a new instance of the DdlVisibleAttribute class with the specified visibility. + /// + public DdlVisibleAttribute(bool visible) + { + _visible = visible; + } + + /// + /// Gets or sets the visibility. + /// + public bool Visible + { + get { return _visible; } + set { _visible = value; } + } + bool _visible; + + public bool CanAddValue + { + get { return _canAddValue; } + set { _canAddValue = value; } + } + bool _canAddValue; + + public bool CanRemoveValue + { + get { return _canRemoveValue; } + set { _canRemoveValue = value; } + } + bool _canRemoveValue; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Document.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Document.cs new file mode 100644 index 0000000..aa3d1d9 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Document.cs @@ -0,0 +1,375 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents a MigraDoc document. + /// + public sealed class Document : DocumentObject, IVisitable + { + /// + /// Initializes a new instance of the Document class. + /// + public Document() + { + _styles = new Styles(this); + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Document Clone() + { + return (Document)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Document document = (Document)base.DeepCopy(); + if (document._info != null) + { + document._info = document._info.Clone(); + document._info._parent = document; + } + if (document._styles != null) + { + document._styles = document._styles.Clone(); + document._styles._parent = document; + } + if (document._sections != null) + { + document._sections = document._sections.Clone(); + document._sections._parent = document; + } + return document; + } + + /// + /// public function used by renderers to bind this instance to it. + /// + public void BindToRenderer(object renderer) + { + if (_renderer != null && renderer != null && !ReferenceEquals(_renderer, renderer)) + { + throw new InvalidOperationException("The document is already bound to another renderer. " + + "A MigraDoc document can be rendered by only one renderer, because the rendering process " + + "modifies its public structure. If you want to render a MigraDoc document on different renderers, " + + "you must create a copy of it using the Clone function."); + } + _renderer = renderer; + } + object _renderer; + + /// + /// Indicates whether the document is bound to a renderer. A bound document must not be modified anymore. + /// Modifying it leads to undefined results of the rendering process. + /// + public bool IsBoundToRenderer + { + get { return _renderer != null; } + } + + /// + /// Adds a new section to the document. + /// + public Section AddSection() + { + return Sections.AddSection(); + } + + /// + /// Adds a new style to the document styles. + /// + /// Name of the style. + /// Name of the base style. + public Style AddStyle(string name, string baseStyle) + { + if (name == null || baseStyle == null) + throw new ArgumentNullException(name == null ? "name" : "baseStyle"); + if (name == "" || baseStyle == "") + throw new ArgumentException(name == "" ? "name" : "baseStyle"); + + return Styles.AddStyle(name, baseStyle); + } + + /// + /// Adds a new section to the document. + /// + public void Add(Section section) + { + Sections.Add(section); + } + + /// + /// Adds a new style to the document styles. + /// + public void Add(Style style) + { + Styles.Add(style); + } + #endregion + + #region Properties + + /// + /// Gets the last section of the document, or null, if the document has no sections. + /// + public Section LastSection + { + get + { + return (_sections != null && _sections.Count > 0) ? + _sections.LastObject as Section : null; + } + } + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + + /// + /// Gets the document info. + /// + public DocumentInfo Info + { + get { return _info ?? (_info = new DocumentInfo(this)); } + set + { + SetParent(value); + _info = value; + } + } + [DV] + public DocumentInfo _info; + + /// + /// Gets or sets the styles of the document. + /// + public Styles Styles + { + get { return _styles ?? (_styles = new Styles(this)); } + set + { + SetParent(value); + _styles = value; + } + } + [DV] + public Styles _styles; + + /// + /// Gets or sets the default tab stop position. + /// + public Unit DefaultTabStop + { + get { return _defaultTabStop; } + set { _defaultTabStop = value; } + } + [DV] + public Unit _defaultTabStop = Unit.NullValue; + + /// + /// Gets the default page setup. + /// + public PageSetup DefaultPageSetup + { + get { return PageSetup.DefaultPageSetup; } + } + + /// + /// Gets or sets the location of the Footnote. + /// + public FootnoteLocation FootnoteLocation + { + get { return (FootnoteLocation)_footnoteLocation.Value; } + set { _footnoteLocation.Value = (int)value; } + } + [DV(Type = typeof(FootnoteLocation))] + public NEnum _footnoteLocation = NEnum.NullValue(typeof(FootnoteLocation)); + + /// + /// Gets or sets the rule which is used to determine the footnote number on a new page. + /// + public FootnoteNumberingRule FootnoteNumberingRule + { + get { return (FootnoteNumberingRule)_footnoteNumberingRule.Value; } + set { _footnoteNumberingRule.Value = (int)value; } + } + [DV(Type = typeof(FootnoteNumberingRule))] + public NEnum _footnoteNumberingRule = NEnum.NullValue(typeof(FootnoteNumberingRule)); + + /// + /// Gets or sets the type of number which is used for the footnote. + /// + public FootnoteNumberStyle FootnoteNumberStyle + { + get { return (FootnoteNumberStyle)_footnoteNumberStyle.Value; } + set { _footnoteNumberStyle.Value = (int)value; } + } + [DV(Type = typeof(FootnoteNumberStyle))] + public NEnum _footnoteNumberStyle = NEnum.NullValue(typeof(FootnoteNumberStyle)); + + /// + /// Gets or sets the starting number of the footnote. + /// + public int FootnoteStartingNumber + { + get { return _footnoteStartingNumber.Value; } + set { _footnoteStartingNumber.Value = value; } + } + [DV] + public NInt _footnoteStartingNumber = NInt.NullValue; + + /// + /// Gets or sets the path for images used by the document. + /// + public string ImagePath + { + get { return _imagePath.Value; } + set { _imagePath.Value = value; } + } + [DV] + public NString _imagePath = NString.NullValue; + + /// + /// Gets or sets a value indicating whether to use the CMYK color model when rendered as PDF. + /// + public bool UseCmykColor + { + get { return _useCmykColor.Value; } + set { _useCmykColor.Value = value; } + } + [DV] + public NBool _useCmykColor = NBool.NullValue; + + /// + /// Gets the sections of the document. + /// + public Sections Sections + { + get { return _sections ?? (_sections = new Sections(this)); } + set + { + SetParent(value); + _sections = value; + } + } + [DV] + public Sections _sections; + #endregion + + /// + /// Gets the DDL file name. + /// + public string DdlFile + { + get { return _ddlFile; } + } + public string _ddlFile = ""; + + #region public + /// + /// Converts Document into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteComment(_comment.Value); + serializer.WriteLine("\\document"); + + int pos = serializer.BeginAttributes(); + if (!IsNull("Info")) + Info.Serialize(serializer); + if (!_defaultTabStop.IsNull) + serializer.WriteSimpleAttribute("DefaultTabStop", DefaultTabStop); + if (!_footnoteLocation.IsNull) + serializer.WriteSimpleAttribute("FootnoteLocation", FootnoteLocation); + if (!_footnoteNumberingRule.IsNull) + serializer.WriteSimpleAttribute("FootnoteNumberingRule", FootnoteNumberingRule); + if (!_footnoteNumberStyle.IsNull) + serializer.WriteSimpleAttribute("FootnoteNumberStyle", FootnoteNumberStyle); + if (!_footnoteStartingNumber.IsNull) + serializer.WriteSimpleAttribute("FootnoteStartingNumber", FootnoteStartingNumber); + if (!_imagePath.IsNull) + serializer.WriteSimpleAttribute("ImagePath", ImagePath); + if (!_useCmykColor.IsNull) + serializer.WriteSimpleAttribute("UseCmykColor", UseCmykColor); + serializer.EndAttributes(pos); + + serializer.BeginContent(); + Styles.Serialize(serializer); + + if (!IsNull("Sections")) + Sections.Serialize(serializer); + serializer.EndContent(); + serializer.Flush(); + } + + /// + /// Allows the visitor object to visit the document object and all its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitDocument(this); + if (visitChildren) + { + ((IVisitable)Styles).AcceptVisitor(visitor, true); + ((IVisitable)Sections).AcceptVisitor(visitor, true); + } + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Document))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentElements.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentElements.cs new file mode 100644 index 0000000..0805287 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentElements.cs @@ -0,0 +1,239 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; +using MigraDoc.DocumentObjectModel.Tables; +using MigraDoc.DocumentObjectModel.Shapes.Charts; +using MigraDoc.DocumentObjectModel.Shapes; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents a collection of document elements. + /// + public class DocumentElements : DocumentObjectCollection, IVisitable + { + /// + /// Initializes a new instance of the DocumentElements class. + /// + public DocumentElements() + { } + + /// + /// Initializes a new instance of the DocumentElements class with the specified parent. + /// + public DocumentElements(DocumentObject parent) : base(parent) { } + + /// + /// Gets a document object by its index. + /// + public new DocumentObject this[int index] + { + get { return base[index]; } + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new DocumentElements Clone() + { + return (DocumentElements)DeepCopy(); + } + + /// + /// Adds a new paragraph to the collection. + /// + public Paragraph AddParagraph() + { + Paragraph paragraph = new Paragraph(); + Add(paragraph); + return paragraph; + } + + /// + /// Adds a new paragraph with the specified text to the collection. + /// + public Paragraph AddParagraph(string text) + { + Paragraph paragraph = new Paragraph(); + paragraph.AddText(text); + Add(paragraph); + return paragraph; + } + + /// + /// Adds a new paragraph with the specified text and style to the collection. + /// + public Paragraph AddParagraph(string text, string style) + { + Paragraph paragraph = new Paragraph(); + paragraph.AddText(text); + paragraph.Style = style; + Add(paragraph); + return paragraph; + } + + /// + /// Adds a new table to the collection. + /// + public Table AddTable() + { + Table tbl = new Table(); + Add(tbl); + return tbl; + } + + /// + /// Adds a new legend to the collection. + /// + public Legend AddLegend() + { + Legend legend = new Legend(); + Add(legend); + return legend; + } + + /// + /// Add a manual page break. + /// + public void AddPageBreak() + { + PageBreak pageBreak = new PageBreak(); + Add(pageBreak); + } + + /// + /// Adds a new barcode to the collection. + /// + public Barcode AddBarcode() + { + Barcode barcode = new Barcode(); + Add(barcode); + return barcode; + } + + /// + /// Adds a new chart with the specified type to the collection. + /// + public Chart AddChart(ChartType type) + { + Chart chart = AddChart(); + chart.Type = type; + return chart; + } + + /// + /// Adds a new chart with the specified type to the collection. + /// + public Chart AddChart() + { + Chart chart = new Chart(); + chart.Type = ChartType.Line; + Add(chart); + return chart; + } + + /// + /// Adds a new image to the collection. + /// + public Image AddImage(string name) + { + Image image = new Image(); + image.Name = name; + Add(image); + return image; + } + + /// + /// Adds a new text frame to the collection. + /// + public TextFrame AddTextFrame() + { + TextFrame textFrame = new TextFrame(); + Add(textFrame); + return textFrame; + } + #endregion + + #region public + /// + /// Converts DocumentElements into DDL. + /// + public override void Serialize(Serializer serializer) + { + int count = Count; + if (count == 1 && this[0] is Paragraph) + { + // Omit keyword if paragraph has no attributes set. + Paragraph paragraph = (Paragraph)this[0]; + if (paragraph.Style == "" && paragraph.IsNull("Format")) + { + paragraph.SerializeContentOnly = true; + paragraph.Serialize(serializer); + paragraph.SerializeContentOnly = false; + return; + } + } + for (int index = 0; index < count; index++) + { + DocumentObject documentElement = this[index]; + documentElement.Serialize(serializer); + } + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitDocumentElements(this); + + foreach (DocumentObject docObject in this) + { + if (docObject is IVisitable) + ((IVisitable)docObject).AcceptVisitor(visitor, visitChildren); + } + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(DocumentElements))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentInfo.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentInfo.cs new file mode 100644 index 0000000..d395f35 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentInfo.cs @@ -0,0 +1,155 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Contains information about document content, author etc. + /// + public class DocumentInfo : DocumentObject + { + /// + /// Initializes a new instance of the DocumentInfo class. + /// + public DocumentInfo() + { } + + /// + /// Initializes a new instance of the DocumentInfo class with the specified parent. + /// + public DocumentInfo(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new DocumentInfo Clone() + { + return (DocumentInfo)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets the document title. + /// + public string Title + { + get { return _title.Value; } + set { _title.Value = value; } + } + [DV] + public NString _title = NString.NullValue; + + /// + /// Gets or sets the document author. + /// + public string Author + { + get { return _author.Value; } + set { _author.Value = value; } + } + [DV] + public NString _author = NString.NullValue; + + /// + /// Gets or sets keywords related to the document. + /// + public string Keywords + { + get { return _keywords.Value; } + set { _keywords.Value = value; } + } + [DV] + public NString _keywords = NString.NullValue; + + /// + /// Gets or sets the subject of the document. + /// + public string Subject + { + get { return _subject.Value; } + set { _subject.Value = value; } + } + [DV] + public NString _subject = NString.NullValue; + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + #endregion + + #region public + /// + /// Converts DocumentInfo into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteComment(_comment.Value); + int pos = serializer.BeginContent("Info"); + + if (Title != String.Empty) + serializer.WriteSimpleAttribute("Title", Title); + + if (Subject != String.Empty) + serializer.WriteSimpleAttribute("Subject", Subject); + + if (Author != String.Empty) + serializer.WriteSimpleAttribute("Author", Author); + + if (Keywords != String.Empty) + serializer.WriteSimpleAttribute("Keywords", Keywords); + + serializer.EndContent(pos); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(DocumentInfo))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentObject.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentObject.cs new file mode 100644 index 0000000..19518c1 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentObject.cs @@ -0,0 +1,261 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Base class of all objects of the MigraDoc Document Object Model. + /// + public abstract class DocumentObject : ICloneable + { + /// + /// Initializes a new instance of the DocumentObject class. + /// + public DocumentObject() + { } + + /// + /// Initializes a new instance of the DocumentObject class with the specified parent. + /// + public DocumentObject(DocumentObject parent) + { + Debug.Assert(parent != null, "Parent must not be null."); + _parent = parent; + } + + /// + /// Creates a deep copy of the DocumentObject. The parent of the new object is null. + /// + public object Clone() + { + return DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected virtual object DeepCopy() + { + DocumentObject value = (DocumentObject)MemberwiseClone(); + value._parent = null; + return value; + } + + /// + /// Creates an object using the default constructor. + /// + public object CreateValue(string name) + { + ValueDescriptor vd = Meta[name]; + if (vd != null) + return vd.CreateValue(); + return null; + } + + /// + /// Gets the parent object. + /// + public DocumentObject Parent + { + get { return _parent; } + } + [DV(RefOnly = true)] + public DocumentObject _parent; + + /// + /// Gets the document of the object, or null, if the object is not associated with a document. + /// + public Document Document + { + // TODO Have to reset _document when _parent changes. + get + { + if (_document != null) + return _document; + DocumentObject doc = Parent; + Document document = doc as Document; + if (document != null) + return _document = document; + // Call document at the parent - recursive call instead of while loop - and all parent objects will also update their _document fields. + // Next call to Document from a sibbling will succeed without climbing all the way up. + if (doc != null) + return _document = doc.Document; + return null; + } + } + private Document _document; + + /// + /// Gets the section of the object, or null, if the object is not associated with a section. + /// + public Section Section + { + // TODO Have to reset _section when _parent changes. + get + { + if (_section != null) + return _section; + DocumentObject doc = Parent; + if (doc != null) + { + Section section = doc as Section; + if (section != null) + return _section = section; + return _section = doc.Section; + } + return null; + } + } + private Section _section; + + /// + /// Converts DocumentObject into DDL. + /// + public abstract void Serialize(Serializer serializer); + + /// + /// Returns the value with the specified name. + /// + public virtual object GetValue(string name) + { + return GetValue(name, GV.ReadWrite); + } + + /// + /// Returns the value with the specified name and value flags. + /// + public virtual object GetValue(string name, GV flags) + { + return Meta.GetValue(this, name, flags); + } + + /// + /// Sets the given value and sets its parent afterwards. + /// + public virtual void SetValue(string name, object val) + { + Meta.SetValue(this, name, val); + DocumentObject documentObject = val as DocumentObject; + if (documentObject != null) + (documentObject)._parent = this; + } + + /// + /// Determines whether this instance has a value of the given name. + /// + public virtual bool HasValue(string name) + { + return Meta.HasValue(name); + } + + /// + /// Determines whether the value of the given name is null. + /// + public virtual bool IsNull(string name) + { + return Meta.IsNull(this, name); + } + + /// + /// Resets the value of the given name, i.e. IsNull(name) will return true afterwards. + /// + public virtual void SetNull(string name) + { + Meta.SetNull(this, name); + } + + /// + /// Determines whether this instance is null (not set). + /// + public virtual bool IsNull() + { + return Meta.IsNull(this); + } + + /// + /// Resets this instance, i.e. IsNull() will return true afterwards. + /// + public virtual void SetNull() + { + Meta.SetNull(this); + } + + /// + /// Gets or sets a value that contains arbitrary information about this object. + /// + public object Tag + { + get { return _tag; } + set { _tag = value; } + } + object _tag; + + /// + /// Returns the meta object of this instance. + /// + public abstract Meta Meta + { + get; + } + + /// + /// Sets the parent of the specified value. + /// If a parent is already set, an ArgumentException will be thrown. + /// + protected void SetParent(DocumentObject val) + { + if (val != null) + { + if (val.Parent != null) + throw new ArgumentException(DomSR.ParentAlreadySet(val, this)); + + val._parent = this; + val._document = null; + val._section = null; + } + } + + /// + /// When overridden in a derived class resets cached values + /// (like column index). + /// + public virtual void ResetCachedValues() + { + _document = null; + _section = null; + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentObjectCollection.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentObjectCollection.cs new file mode 100644 index 0000000..7af069d --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentObjectCollection.cs @@ -0,0 +1,346 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections; +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel.Visitors; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Base class of all collections of the MigraDoc Document Object Model. + /// + public abstract class DocumentObjectCollection : DocumentObject, IList, IVisitable + { + /// + /// Initializes a new instance of the DocumentObjectCollection class. + /// + public DocumentObjectCollection() + { + _elements = new List(); + } + + /// + /// Initializes a new instance of the DocumentObjectCollection class with the specified parent. + /// + public DocumentObjectCollection(DocumentObject parent) + : base(parent) + { + _elements = new List(); + } + + /// + /// Gets the first value in the Collection, if there is any, otherwise null. + /// + public DocumentObject First + { + get + { + return Count > 0 ? this[0] : null; + } + } + + /// + /// Creates a deep copy of this object. + /// + public new DocumentObjectCollection Clone() + { + return (DocumentObjectCollection)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + DocumentObjectCollection coll = (DocumentObjectCollection)base.DeepCopy(); + + int count = Count; + coll._elements = new List(count); + for (int index = 0; index < count; ++index) + { + DocumentObject doc = this[index]; + if (doc != null) + { + doc = doc.Clone() as DocumentObject; + doc._parent = coll; + } + coll._elements.Add(doc); + } + return coll; + } + + /// + /// Copies the entire collection to a compatible one-dimensional System.Array, + /// starting at the specified index of the target array. + /// + public void CopyTo(Array array, int index) + { + throw new NotImplementedException("TODO"); + //this .elements.CopyTo(array, index); + } + + /// + /// Gets a value indicating whether the Collection is read-only. + /// + bool IList.IsReadOnly + { + get { return false; } + } + + /// + /// Gets a value indicating whether the Collection has a fixed size. + /// + bool IList.IsFixedSize + { + get { return false; } + } + + /// + /// Gets a value indicating whether access to the Collection is synchronized. + /// + bool ICollection.IsSynchronized + { + get { return false; } + } + + /// + /// Gets an object that can be used to synchronize access to the collection. + /// + object ICollection.SyncRoot + { + get { return null; } + } + + /// + /// Gets the number of elements actually contained in the collection. + /// + public int Count + { + get { return _elements.Count; } + } + + /// + /// Removes all elements from the collection. + /// + public void Clear() + { + ((IList)this).Clear(); + } + + /// + /// Inserts an object at the specified index. + /// + public virtual void InsertObject(int index, DocumentObject val) + { + SetParent(val); + ((IList)this).Insert(index, val); + // Call ResetCachedValues for all objects moved by the Insert operation. + int count = ((IList)this).Count; + for (int idx = index + 1; idx < count; ++idx) + { + DocumentObject obj = (DocumentObject)((IList)this)[idx]; + obj.ResetCachedValues(); + } + } + + /// + /// Determines the index of a specific item in the collection. + /// + public int IndexOf(DocumentObject val) + { + return ((IList)this).IndexOf(val); + } + + /// + /// Gets or sets the element at the specified index. + /// + public virtual DocumentObject this[int index] + { + get { return _elements[index] as DocumentObject; } + set + { + SetParent(value); + _elements[index] = value; + } + } + + /// + /// Gets the last element or null, if no such element exists. + /// + public DocumentObject LastObject + { + get + { + int count = _elements.Count; + if (count > 0) + return (DocumentObject)_elements[count - 1]; + return null; + } + } + + /// + /// Removes the element at the specified index. + /// + public void RemoveObjectAt(int index) + { + ((IList)this).RemoveAt(index); + // Call ResetCachedValues for all objects moved by the RemoveAt operation. + int count = ((IList)this).Count; + for (int idx = index; idx < count; ++idx) + { + DocumentObject obj = (DocumentObject)((IList)this)[idx]; + obj.ResetCachedValues(); + } + } + + /// + /// Inserts the object into the collection and sets its parent. + /// + public virtual void Add(DocumentObject value) + { + SetParent(value); + _elements.Add(value); + } + + /// + /// Determines whether this instance is null. + /// + public override bool IsNull() + { + if (!Meta.IsNull(this)) + return false; + if (_elements == null) + return true; + foreach (DocumentObject docObject in _elements) + { + if (docObject != null && !docObject.IsNull()) + return false; + } + return true; + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitDocumentObjectCollection(this); + + foreach (DocumentObject docobj in this) + { + IVisitable visitable = docobj as IVisitable; + if (visitable != null) + visitable.AcceptVisitor(visitor, visitChildren); + } + } + + /// + /// Returns an enumerator that can iterate through this collection. + /// + public IEnumerator GetEnumerator() + { + return _elements.GetEnumerator(); + } + + List _elements; + + #region IList Members + /// + /// Gets or sets the element at the specified index. + /// + object IList.this[int index] + { + get { return _elements[index]; } + set { _elements[index] = value; } + } + + /// + /// Removes the item at the specified index from the Collection. + /// + void IList.RemoveAt(int index) + { + _elements.RemoveAt(index); + } + + /// + /// Inserts an object at the specified index. + /// + void IList.Insert(int index, object value) + { + _elements.Insert(index, value); + } + + /// + /// Removes the first occurrence of the specific object. + /// + void IList.Remove(object value) + { + _elements.Remove(value); + } + + /// + /// Determines whether an element exists. + /// + bool IList.Contains(object value) + { + return _elements.Contains(value); + } + + /// + /// Determines the index of a specific item in the Collection. + /// + int IList.IndexOf(object value) + { + return _elements.IndexOf(value); + } + + /// + /// Adds an item to the Collection. + /// + int IList.Add(object value) + { + _elements.Add(value); + return _elements.Count - 1; + } + + /// + /// Removes all items from the Collection. + /// + void IList.Clear() + { + _elements.Clear(); + } + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentRelations.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentRelations.cs new file mode 100644 index 0000000..14602f3 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DocumentRelations.cs @@ -0,0 +1,94 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Provides relational information between document objects. + /// + public class DocumentRelations + { + /// + /// Determines whether the specified documentObject has a + /// parent of the given type somewhere within the document hierarchy. + /// + /// The document object to check. + /// The parent type to search for. + public static bool HasParentOfType(DocumentObject documentObject, Type type) + { + if (documentObject == null) + throw new ArgumentNullException("documentObject"); + + if (type == null) + throw new ArgumentNullException("type"); + + return GetParentOfType(documentObject, type) != null; + } + + /// + /// Gets the direct parent of the given document object. + /// + /// The document object the parent is searched for. + public static DocumentObject GetParent(DocumentObject documentObject) + { + if (documentObject == null) + throw new ArgumentNullException("documentObject"); + + return documentObject.Parent; + } + + /// + /// Gets a parent of the document object with the given type somewhere within the document hierarchy. + /// Returns null if none exists. + /// + /// The document object the parent is searched for. + /// The parent type to search for. + public static DocumentObject GetParentOfType(DocumentObject documentObject, Type type) + { + if (documentObject == null) + throw new ArgumentNullException("documentObject"); + + if (type == null) + throw new ArgumentNullException("type"); + + if (documentObject._parent != null) + { + if (documentObject._parent.GetType() == type) + return documentObject._parent; + return GetParentOfType(documentObject._parent, type); + } + return null; + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/DomSR.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DomSR.cs new file mode 100644 index 0000000..32acc91 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/DomSR.cs @@ -0,0 +1,277 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Reflection; +using System.Resources; +#if DEBUG +using System.Text.RegularExpressions; +#endif + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// String resources of MigraDoc.DocumentObjectModel. Provides all localized text strings + /// for this assembly. + /// + static class DomSR + { + /// + /// Loads the message from the resource associated with the enum type and formats it + /// using 'String.Format'. Because this function is intended to be used during error + /// handling it never raises an exception. + /// + /// The type of the parameter identifies the resource + /// and the name of the enum identifies the message in the resource. + /// Parameters passed through 'String.Format'. + /// The formatted message. + public static string FormatMessage(DomMsgID id, params object[] args) + { + string message; + try + { + message = GetString(id); + if (message != null) + { +#if DEBUG + if (Regex.Matches(message, @"\{[0-9]\}").Count > args.Length) + { + //TODO too many placeholders or too less args... + } +#endif + message = String.Format(message, args); + } + else + message = "<<>>"; + return message; + } + catch (Exception ex) + { + message = "public ERROR while formatting error message: " + ex; + } + return message; + } + + public static string CompareJustCells + { + get { return "Only cells can be compared by this Comparer."; } + } + + /// + /// Gets the localized message identified by the specified DomMsgID. + /// + public static string GetString(DomMsgID id) + { + return ResMngr.GetString(id.ToString()); + } + #region How to use +#if true_ + // Message with no parameter is property. + public static string SampleMessage1 + { + // In the first place English only + get { return "This is sample message 1."; } + } + + // Message with no parameter is property. + public static string SampleMessage2 + { + // Then localized: + get { return DomSR.GetString(DomMsgID.SampleMessage1); } + } + + // Message with parameters is function. + public static string SampleMessage3(string parm) + { + // In the first place English only + //return String.Format("This is sample message 2: {0}.", parm); + } + public static string SampleMessage4(string parm) + { + // Then localized: + return String.Format(GetString(DomMsgID.SampleMessage2), parm); + } +#endif + #endregion + + #region General Messages + + public static string StyleExpected + { + get { return GetString(DomMsgID.StyleExpected); } + } + + public static string BaseStyleRequired + { + get { return GetString(DomMsgID.BaseStyleRequired); } + } + + public static string EmptyBaseStyle + { + get { return GetString(DomMsgID.EmptyBaseStyle); } + } + + public static string InvalidFieldFormat(string format) + { + return FormatMessage(DomMsgID.InvalidFieldFormat, format); + } + + public static string InvalidInfoFieldName(string name) + { + return FormatMessage(DomMsgID.InvalidInfoFieldName, name); + } + + public static string UndefinedBaseStyle(string baseStyle) + { + return FormatMessage(DomMsgID.UndefinedBaseStyle, baseStyle); + } + + public static string InvalidValueName(string name) + { + return FormatMessage(DomMsgID.InvalidValueName, name); + } + + public static string InvalidUnitValue(string unitValue) + { + return FormatMessage(DomMsgID.InvalidUnitValue, unitValue); + } + + public static string InvalidUnitType(string unitType) + { + return FormatMessage(DomMsgID.InvalidUnitType, unitType); + } + + public static string InvalidEnumValue(T value) where T : struct + { + // ... where T : enum + // -or- + // ... where T : Enum + // is not implemented in C# because nobody has done this. + // See Eric Lippert on this topic: http://stackoverflow.com/questions/1331739/enum-type-constraints-in-c-sharp +#if !NETFX_CORE + Debug.Assert(typeof (T).IsSubclassOf(typeof(Enum))); +#else + Debug.Assert(typeof(T).GetTypeInfo().IsSubclassOf(typeof(Enum))); +#endif + return FormatMessage(DomMsgID.InvalidEnumValue, value, typeof(T).Name); + } + + public static string InvalidEnumForLeftPosition + { + get { return GetString(DomMsgID.InvalidEnumForLeftPosition); } + } + + public static string InvalidEnumForTopPosition + { + get { return GetString(DomMsgID.InvalidEnumForTopPosition); } + } + + public static string InvalidColorString(string colorString) + { + return FormatMessage(DomMsgID.InvalidColorString, colorString); + } + + public static string InvalidFontSize(double value) + { + return FormatMessage(DomMsgID.InvalidFontSize, value); + } + + public static string InsertNullNotAllowed() + { + return "Insert null not allowed."; + } + + public static string ParentAlreadySet(DocumentObject value, DocumentObject docObject) + { + return String.Format("Value of type '{0}' must be cloned before set into '{1}'.", + value.GetType(), docObject.GetType()); + } + + public static string MissingObligatoryProperty(string propertyName, string className) + { + return String.Format("ObigatoryProperty '{0}' not set in '{1}'.", propertyName, className); + } + + public static string InvalidDocumentObjectType + { + get + { + return "The given document object is not valid in this context."; + } + } + #endregion + + #region DdlReader Messages + + #endregion + + #region Resource Manager + + public static ResourceManager ResMngr + { + // ReSharper disable ConvertIfStatementToNullCoalescingExpression + get + { + if (_resmngr == null) + { +#if !NETFX_CORE + _resmngr = new ResourceManager("MigraDoc.DocumentObjectModel.Resources.Messages", Assembly.GetExecutingAssembly()); +#else + _resmngr = new ResourceManager("MigraDoc.DocumentObjectModel.Resources.Messages", typeof(DomSR).GetTypeInfo().Assembly); +#endif + } + return _resmngr; + } + // ReSharper restore ConvertIfStatementToNullCoalescingExpression + } + +#if !SILVERLIGHT + /// + /// Writes all messages defined by DomMsgID. + /// + [Conditional("DEBUG")] + public static void TestResourceMessages() + { + string[] names = Enum.GetNames(typeof(DomMsgID)); + foreach (string name in names) + { + string message = String.Format("{0}: '{1}'", name, ResMngr.GetString(name)); + Debug.WriteLine(message); + } + } +#endif + static ResourceManager _resmngr; + + #endregion + } +} \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Font.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Font.cs new file mode 100644 index 0000000..abb5df7 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Font.cs @@ -0,0 +1,464 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Font represents the formatting of characters in a paragraph. + /// + public sealed class Font : DocumentObject + { + /// + /// Initializes a new instance of the Font class that can be used as a template. + /// + public Font() + { } + + /// + /// Initializes a new instance of the Font class with the specified parent. + /// + public Font(DocumentObject parent) : base(parent) { } + + /// + /// Initializes a new instance of the Font class with the specified name and size. + /// + public Font(string name, Unit size) + { + _name.Value = name; + _size.Value = size; + } + + /// + /// Initializes a new instance of the Font class with the specified name. + /// + public Font(string name) + { + _name.Value = name; + } + + #region Methods + /// + /// Creates a copy of the Font. + /// + public new Font Clone() + { + return (Font)DeepCopy(); + } + + /// + /// Applies all non-null properties of a font to this font if the given font's property is different from the given refFont's property. + /// + public void ApplyFont(Font font, Font refFont) + { + if (font == null) + throw new ArgumentNullException("font"); + + if ((!font._name.IsNull && font._name.Value != "") && (refFont == null || font.Name != refFont.Name)) + Name = font.Name; + + if (!font._size.IsNull && (refFont == null || font.Size != refFont.Size)) + Size = font.Size; + + if (!font._bold.IsNull && (refFont == null || font.Bold != refFont.Bold)) + Bold = font.Bold; + + if (!font._italic.IsNull && (refFont == null || font.Italic != refFont.Italic)) + Italic = font.Italic; + + if (!font._subscript.IsNull && (refFont == null || font.Subscript != refFont.Subscript)) + Subscript = font.Subscript; + else if (!font._superscript.IsNull && (refFont == null || font.Superscript != refFont.Superscript)) + Superscript = font.Superscript; + + if (!font._underline.IsNull && (refFont == null || font.Underline != refFont.Underline)) + Underline = font.Underline; + + if (!font._color.IsNull && (refFont == null || font.Color.Argb != refFont.Color.Argb)) + Color = font.Color; + } + + /// + /// Applies all non-null properties of a font to this font. + /// + public void ApplyFont(Font font) + { + if (font == null) + throw new ArgumentNullException("font"); + + if (!font._name.IsNull && font._name.Value != "") + Name = font.Name; + + if (!font._size.IsNull) + Size = font.Size; + + if (!font._bold.IsNull) + Bold = font.Bold; + + if (!font._italic.IsNull) + Italic = font.Italic; + + if (!font._subscript.IsNull) + Subscript = font.Subscript; + else if (!font._superscript.IsNull) + Superscript = font.Superscript; + + if (!font._underline.IsNull) + Underline = font.Underline; + + if (!font._color.IsNull) + Color = font.Color; + } + #endregion + + #region Properties + /// + /// Gets or sets the name of the font. + /// + public string Name + { + get { return _name.Value; } + set { _name.Value = value; } + } + [DV] + public NString _name = NString.NullValue; + + /// + /// Gets or sets the size of the font. + /// + public Unit Size + { + get { return _size; } + set { _size = value; } + } + [DV] + public Unit _size = Unit.NullValue; + + /// + /// Gets or sets the bold property. + /// + public bool Bold + { + get { return _bold.Value; } + set { _bold.Value = value; } + } + [DV] + public NBool _bold = NBool.NullValue; + + /// + /// Gets or sets the italic property. + /// + public bool Italic + { + get { return _italic.Value; } + set { _italic.Value = value; } + } + [DV] + public NBool _italic = NBool.NullValue; + + // THHO4STLA Implementation for Strikethrough in the forum: http://forum.pdfsharp.net/viewtopic.php?p=4636#p4636 + /// + /// Gets or sets the underline property. + /// + public Underline Underline + { + get { return (Underline)_underline.Value; } + set { _underline.Value = (int)value; } + } + [DV(Type = typeof(Underline))] + public NEnum _underline = NEnum.NullValue(typeof(Underline)); + + /// + /// Gets or sets the color property. + /// + public Color Color + { + get { return _color; } + set { _color = value; } + } + [DV] + public Color _color = Color.Empty; + + /// + /// Gets or sets the superscript property. + /// + public bool Superscript + { + get { return _superscript.Value; } + set + { + _superscript.Value = value; + _subscript.SetNull(); + } + } + [DV] + public NBool _superscript = NBool.NullValue; + + /// + /// Gets or sets the subscript property. + /// + public bool Subscript + { + get { return _subscript.Value; } + set + { + _subscript.Value = value; + _superscript.SetNull(); + } + } + [DV] + public NBool _subscript = NBool.NullValue; + + // + .Name = "Arial" + // + .Size = 8 + // + .Bold = False + // + .Italic = False + // + .Underline = wdUnderlineDouble + // * .UnderlineColor = wdColorOrange + // .StrikeThrough = False + // .DoubleStrikeThrough = False + // .Outline = False + // .Emboss = False + // .Shadow = False + // .Hidden = False + // * .SmallCaps = False + // * .AllCaps = False + // + .Color = wdColorAutomatic + // .Engrave = False + // + .Superscript = False + // + .Subscript = False + // * .Spacing = 0 + // * .Scaling = 100 + // * .Position = 0 + // .Kerning = 0 + // .Animation = wdAnimationNone + #endregion + + /// + /// Gets a value indicating whether the specified font exists. + /// + [Obsolete("This function is removed from DocumentObjectModel and always returns false.")] + public static bool Exists(string fontName) + { + //System.Drawing.FontFamily[] families = System.Drawing.FontFamily.Families; + //foreach (System.Drawing.FontFamily family in families) + //{ + // if (String.Compare(family.Name, fontName, true) == 0) + // return true; + //} + return false; + } + + #region public + /// + /// Get a bitmask of all non-null properties. + /// + private FontProperties CheckWhatIsNotNull() + { + FontProperties fp = FontProperties.None; + if (!_name.IsNull) + fp |= FontProperties.Name; + if (!_size.IsNull) + fp |= FontProperties.Size; + if (!_bold.IsNull) + fp |= FontProperties.Bold; + if (!_italic.IsNull) + fp |= FontProperties.Italic; + if (!_underline.IsNull) + fp |= FontProperties.Underline; + if (!_color.IsNull) + fp |= FontProperties.Color; + if (!_superscript.IsNull) + fp |= FontProperties.Superscript; + if (!_subscript.IsNull) + fp |= FontProperties.Subscript; + return fp; + } + + /// + /// Converts Font into DDL. + /// + public override void Serialize(Serializer serializer) + { + Serialize(serializer, null); + } + + /// + /// Converts Font into DDL. Properties with the same value as in an optionally given + /// font are not serialized. + /// + public void Serialize(Serializer serializer, Font font) + { + if (Parent is FormattedText) + { + string fontStyle = ""; + if (((FormattedText)Parent)._style.IsNull) + { + // Check if we can use a DDL keyword. + FontProperties notNull = CheckWhatIsNotNull(); + if (notNull == FontProperties.Size) + { + serializer.Write("\\fontsize(" + _size + ")"); + return; + } + if (notNull == FontProperties.Bold && _bold.Value) + { + serializer.Write("\\bold"); + return; + } + if (notNull == FontProperties.Italic && _italic.Value) + { + serializer.Write("\\italic"); + return; + } + if (notNull == FontProperties.Color) + { + serializer.Write("\\fontcolor(" + _color + ")"); + return; + } + } + else + fontStyle = "(\"" + ((FormattedText)Parent).Style + "\")"; + + //bool needBlank = false; // nice, but later... + serializer.Write("\\font" + fontStyle + "["); + + if (!_name.IsNull && _name.Value != "") + serializer.WriteSimpleAttribute("Name", Name); + +#if DEBUG_ // Test + if (!_size.IsNull && Size != 0 && Size.Point == 0) + GetType(); +#endif + if ((!_size.IsNull)) + serializer.WriteSimpleAttribute("Size", Size); + + if (!_bold.IsNull) + serializer.WriteSimpleAttribute("Bold", Bold); + + if (!_italic.IsNull) + serializer.WriteSimpleAttribute("Italic", Italic); + + if (!_underline.IsNull) + serializer.WriteSimpleAttribute("Underline", Underline); + + if (!_superscript.IsNull) + serializer.WriteSimpleAttribute("Superscript", Superscript); + + if (!_subscript.IsNull) + serializer.WriteSimpleAttribute("Subscript", Subscript); + + if (!_color.IsNull) + serializer.WriteSimpleAttribute("Color", Color); + + serializer.Write("]"); + } + else + { + int pos = serializer.BeginContent("Font"); + +#if true + // Don't write null values if font is null. + // Do write null values if font is not null! + if ((!_name.IsNull && Name != String.Empty && font == null) || + (font != null && !_name.IsNull && Name != String.Empty && Name != font.Name)) + serializer.WriteSimpleAttribute("Name", Name); + +#if DEBUG_ + // Test + if (!_size.IsNull && Size != 0 && Size.Point == 0) + GetType(); +#endif + + if (!_size.IsNull && + (font == null || Size != font.Size)) + serializer.WriteSimpleAttribute("Size", Size); + // NBool and NEnum have to be compared directly to check whether the value Null is. + if (!_bold.IsNull && (font == null || Bold != font.Bold || font._bold.IsNull)) + serializer.WriteSimpleAttribute("Bold", Bold); + + if (!_italic.IsNull && (font == null || Italic != font.Italic || font._italic.IsNull)) + serializer.WriteSimpleAttribute("Italic", Italic); + + if (!_underline.IsNull && (font == null || Underline != font.Underline || font._underline.IsNull)) + serializer.WriteSimpleAttribute("Underline", Underline); + + if (!_superscript.IsNull && (font == null || Superscript != font.Superscript || font._superscript.IsNull)) + serializer.WriteSimpleAttribute("Superscript", Superscript); + + if (!_subscript.IsNull && (font == null || Subscript != font.Subscript || font._subscript.IsNull)) + serializer.WriteSimpleAttribute("Subscript", Subscript); + + if (!_color.IsNull && (font == null || Color.Argb != font.Color.Argb))// && Color.RGB != Color.Transparent.RGB) + serializer.WriteSimpleAttribute("Color", Color); +#else + if ((!this .name.IsNull && Name != String.Empty) && (font == null || Name != font.Name)) + serializer.WriteSimpleAttribute("Name", Name); + + if (!this .size.IsNull && (font == null || Size != font.Size)) + serializer.WriteSimpleAttribute("Size", Size); + //NBool and NEnum have to be compared directly to check whether the value Null is + if (!this .bold.IsNull && (font == null || Bold != font.Bold)) + serializer.WriteSimpleAttribute("Bold", Bold); + + if (!this .italic.IsNull && (font == null || Italic != font.Italic)) + serializer.WriteSimpleAttribute("Italic", Italic); + + if (!this .underline.IsNull && (font == null || Underline != font.Underline)) + serializer.WriteSimpleAttribute("Underline", Underline); + + if (!this .superscript.IsNull && (font == null || Superscript != font.Superscript)) + serializer.WriteSimpleAttribute("Superscript", Superscript); + + if (!this .subscript.IsNull && (font == null || Subscript != font.Subscript)) + serializer.WriteSimpleAttribute("Subscript", Subscript); + + if (!this .color.IsNull && (font == null || Color.Argb != font.Color.Argb))// && Color.RGB != Color.Transparent.RGB) + serializer.WriteSimpleAttribute("Color", Color); +#endif + serializer.EndContent(pos); + } + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Font))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Footnote.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Footnote.cs new file mode 100644 index 0000000..d842dc4 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Footnote.cs @@ -0,0 +1,252 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; +using MigraDoc.DocumentObjectModel.Tables; +using MigraDoc.DocumentObjectModel.Shapes; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents a footnote in a paragraph. + /// + public class Footnote : DocumentObject, IVisitable + { + /// + /// Initializes a new instance of the Footnote class. + /// + public Footnote() + { + //NYI: Nested footnote check! + } + + /// + /// Initializes a new instance of the Footnote class with the specified parent. + /// + public Footnote(DocumentObject parent) : base(parent) { } + + /// + /// Initializes a new instance of the Footnote class with a text the Footnote shall content. + /// + public Footnote(string content) + : this() + { + Elements.AddParagraph(content); + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Footnote Clone() + { + return (Footnote)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Footnote footnote = (Footnote)base.DeepCopy(); + if (footnote._elements != null) + { + footnote._elements = footnote._elements.Clone(); + footnote._elements._parent = footnote; + } + if (footnote._format != null) + { + footnote._format = footnote._format.Clone(); + footnote._format._parent = footnote; + } + return footnote; + } + + /// + /// Adds a new paragraph to the footnote. + /// + public Paragraph AddParagraph() + { + return Elements.AddParagraph(); + } + + /// + /// Adds a new paragraph with the specified text to the footnote. + /// + public Paragraph AddParagraph(string text) + { + return Elements.AddParagraph(text); + } + + /// + /// Adds a new table to the footnote. + /// + public Table AddTable() + { + return Elements.AddTable(); + } + + /// + /// Adds a new image to the footnote. + /// + public Image AddImage(string name) + { + return Elements.AddImage(name); + } + + /// + /// Adds a new paragraph to the footnote. + /// + public void Add(Paragraph paragraph) + { + Elements.Add(paragraph); + } + + /// + /// Adds a new table to the footnote. + /// + public void Add(Table table) + { + Elements.Add(table); + } + + /// + /// Adds a new image to the footnote. + /// + public void Add(Image image) + { + Elements.Add(image); + } + #endregion + + #region Properties + /// + /// Gets the collection of paragraph elements that defines the footnote. + /// + public DocumentElements Elements + { + get { return _elements ?? (_elements = new DocumentElements(this)); } + set + { + SetParent(value); + _elements = value; + } + } + [DV(ItemType = typeof(DocumentObject))] + public DocumentElements _elements; + + /// + /// Gets or sets the character to be used to mark the footnote. + /// + public string Reference + { + get { return _reference.Value; } + set { _reference.Value = value; } + } + [DV] + public NString _reference = NString.NullValue; + + /// + /// Gets or sets the style name of the footnote. + /// + public string Style + { + get { return _style.Value; } + set { _style.Value = value; } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets the format of the footnote. + /// + public ParagraphFormat Format + { + get { return _format ?? (_format = new ParagraphFormat(this)); } + set + { + SetParent(value); + _format = value; + } + } + [DV] + public ParagraphFormat _format; + #endregion + + #region public + /// + /// Converts Footnote into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteLine("\\footnote"); + + int pos = serializer.BeginAttributes(); + if (_reference.Value != string.Empty) + serializer.WriteSimpleAttribute("Reference", Reference); + if (_style.Value != string.Empty) + serializer.WriteSimpleAttribute("Style", Style); + + if (!IsNull("Format")) + _format.Serialize(serializer, "Format", null); + + serializer.EndAttributes(pos); + + pos = serializer.BeginContent(); + if (!IsNull("Elements")) + _elements.Serialize(serializer); + serializer.EndContent(pos); + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitFootnote(this); + + if (visitChildren && _elements != null) + ((IVisitable)_elements).AcceptVisitor(visitor, true); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Footnote))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/FormattedText.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/FormattedText.cs new file mode 100644 index 0000000..916f221 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/FormattedText.cs @@ -0,0 +1,634 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; +using MigraDoc.DocumentObjectModel.Fields; +using MigraDoc.DocumentObjectModel.Shapes; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents the format of a text. + /// + public class FormattedText : DocumentObject, IVisitable + { + /// + /// Initializes a new instance of the FormattedText class. + /// + public FormattedText() + { } + + /// + /// Initializes a new instance of the FormattedText class with the specified parent. + /// + public FormattedText(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new FormattedText Clone() + { + return (FormattedText)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + FormattedText formattedText = (FormattedText)base.DeepCopy(); + if (formattedText._font != null) + { + formattedText._font = formattedText._font.Clone(); + formattedText._font._parent = formattedText; + } + if (formattedText._elements != null) + { + formattedText._elements = formattedText._elements.Clone(); + formattedText._elements._parent = formattedText; + } + return formattedText; + } + + /// + /// Adds a new Bookmark. + /// + public BookmarkField AddBookmark(string name) + { + return Elements.AddBookmark(name); + } + + /// + /// Adds a single character repeated the specified number of times to the formatted text. + /// + public Text AddChar(char ch, int count) + { + return Elements.AddChar(ch, count); + } + + /// + /// Adds a single character to the formatted text. + /// + public Text AddChar(char ch) + { + return Elements.AddChar(ch); + } + + /// + /// Adds a new PageField. + /// + public PageField AddPageField() + { + return Elements.AddPageField(); + } + + /// + /// Adds a new PageRefField. + /// + public PageRefField AddPageRefField(string name) + { + return Elements.AddPageRefField(name); + } + + /// + /// Adds a new NumPagesField. + /// + public NumPagesField AddNumPagesField() + { + return Elements.AddNumPagesField(); + } + + /// + /// Adds a new SectionField. + /// + public SectionField AddSectionField() + { + return Elements.AddSectionField(); + } + + /// + /// Adds a new SectionPagesField. + /// + public SectionPagesField AddSectionPagesField() + { + return Elements.AddSectionPagesField(); + } + + /// + /// Adds a new DateField. + /// + public DateField AddDateField() + { + return Elements.AddDateField(); + } + + /// + /// Adds a new DateField. + /// + public DateField AddDateField(string format) + { + return Elements.AddDateField(format); + } + + /// + /// Adds a new InfoField. + /// + public InfoField AddInfoField(InfoFieldType iType) + { + return Elements.AddInfoField(iType); + } + + /// + /// Adds a new Footnote with the specified text. + /// + public Footnote AddFootnote(string text) + { + return Elements.AddFootnote(text); + } + + /// + /// Adds a new Footnote. + /// + public Footnote AddFootnote() + { + return Elements.AddFootnote(); + } + + /// + /// Adds a text phrase to the formatted text. + /// + /// Content of the new text object. + /// Returns a new Text object. + public Text AddText(string text) + { + return Elements.AddText(text); + } + + /// + /// Adds a new FormattedText. + /// + public FormattedText AddFormattedText() + { + return Elements.AddFormattedText(); + } + + /// + /// Adds a new FormattedText object with the given format. + /// + public FormattedText AddFormattedText(TextFormat textFormat) + { + return Elements.AddFormattedText(textFormat); + } + + /// + /// Adds a new FormattedText with the given Font. + /// + public FormattedText AddFormattedText(Font font) + { + return Elements.AddFormattedText(font); + } + + /// + /// Adds a new FormattedText with the given text. + /// + public FormattedText AddFormattedText(string text) + { + return Elements.AddFormattedText(text); + } + + /// + /// Adds a new FormattedText object with the given text and format. + /// + public FormattedText AddFormattedText(string text, TextFormat textFormat) + { + return Elements.AddFormattedText(text, textFormat); + } + + /// + /// Adds a new FormattedText object with the given text and font. + /// + public FormattedText AddFormattedText(string text, Font font) + { + return Elements.AddFormattedText(text, font); + } + + /// + /// Adds a new FormattedText object with the given text and style. + /// + public FormattedText AddFormattedText(string text, string style) + { + return Elements.AddFormattedText(text, style); + } + + /// + /// Adds a new Hyperlink of Type "Local", + /// i.e. the target is a Bookmark within the Document + /// + public Hyperlink AddHyperlink(string name) + { + return Elements.AddHyperlink(name); + } + + /// + /// Adds a new Hyperlink + /// + public Hyperlink AddHyperlink(string name, HyperlinkType type) + { + return Elements.AddHyperlink(name, type); + } + + /// + /// Adds a new Image object + /// + public Image AddImage(string fileName) + { + return Elements.AddImage(fileName); + } + + /// + /// Adds a Symbol object. + /// + public Character AddCharacter(SymbolName symbolType) + { + return Elements.AddCharacter(symbolType); + } + + /// + /// Adds one or more Symbol objects. + /// + public Character AddCharacter(SymbolName symbolType, int count) + { + return Elements.AddCharacter(symbolType, count); + } + + /// + /// Adds a Symbol object defined by a character. + /// + public Character AddCharacter(char ch) + { + return Elements.AddCharacter(ch); + } + + /// + /// Adds one or more Symbol objects defined by a character. + /// + public Character AddCharacter(char ch, int count) + { + return Elements.AddCharacter(ch, count); + } + + /// + /// Adds one or more Symbol objects defined by a character. + /// + public Character AddSpace(int count) + { + return Elements.AddSpace(count); + } + + /// + /// Adds a horizontal tab. + /// + public void AddTab() + { + Elements.AddTab(); + } + + /// + /// Adds a line break. + /// + public void AddLineBreak() + { + Elements.AddLineBreak(); + } + + /// + /// Adds a new Bookmark + /// + public void Add(BookmarkField bookmark) + { + Elements.Add(bookmark); + } + + /// + /// Adds a new PageField + /// + public void Add(PageField pageField) + { + Elements.Add(pageField); + } + + /// + /// Adds a new PageRefField + /// + public void Add(PageRefField pageRefField) + { + Elements.Add(pageRefField); + } + + /// + /// Adds a new NumPagesField + /// + public void Add(NumPagesField numPagesField) + { + Elements.Add(numPagesField); + } + + /// + /// Adds a new SectionField + /// + public void Add(SectionField sectionField) + { + Elements.Add(sectionField); + } + + /// + /// Adds a new SectionPagesField + /// + public void Add(SectionPagesField sectionPagesField) + { + Elements.Add(sectionPagesField); + } + + /// + /// Adds a new DateField + /// + public void Add(DateField dateField) + { + Elements.Add(dateField); + } + + /// + /// Adds a new InfoField + /// + public void Add(InfoField infoField) + { + Elements.Add(infoField); + } + + /// + /// Adds a new Footnote + /// + public void Add(Footnote footnote) + { + Elements.Add(footnote); + } + + /// + /// Adds a new Text + /// + public void Add(Text text) + { + Elements.Add(text); + } + + /// + /// Adds a new FormattedText + /// + public void Add(FormattedText formattedText) + { + Elements.Add(formattedText); + } + + /// + /// Adds a new Hyperlink + /// + public void Add(Hyperlink hyperlink) + { + Elements.Add(hyperlink); + } + + /// + /// Adds a new Image + /// + public void Add(Image image) + { + Elements.Add(image); + } + + /// + /// Adds a new Character + /// + public void Add(Character character) + { + Elements.Add(character); + } + #endregion + + #region Properties + /// + /// Gets or sets the font object. + /// + public Font Font + { + get { return _font ?? (_font = new Font(this)); } + set + { + SetParent(value); + _font = value; + } + } + [DV] + public Font _font; + + /// + /// Gets or sets the style name. + /// + public string Style + { + get { return _style.Value; } + set { _style.Value = value; } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets or sets the name of the font. + /// + [DV] + public string FontName + { + get { return Font.Name; } + set { Font.Name = value; } + } + + /// + /// Gets or sets the name of the font. + /// For public use only. + /// + [DV] + public string Name + { + get { return Font.Name; } + set { Font.Name = value; } + } + + /// + /// Gets or sets the size in point. + /// + [DV] + public Unit Size + { + get { return Font.Size; } + set { Font.Size = value; } + } + + /// + /// Gets or sets the bold property. + /// + [DV] + public bool Bold + { + get { return Font.Bold; } + set { Font.Bold = value; } + } + + /// + /// Gets or sets the italic property. + /// + [DV] + public bool Italic + { + get { return Font.Italic; } + set { Font.Italic = value; } + } + + /// + /// Gets or sets the underline property. + /// + [DV] + public Underline Underline + { + get { return Font.Underline; } + set { Font.Underline = value; } + } + + /// + /// Gets or sets the color property. + /// + [DV] + public Color Color + { + get { return Font.Color; } + set { Font.Color = value; } + } + + /// + /// Gets or sets the superscript property. + /// + [DV] + public bool Superscript + { + get { return Font.Superscript; } + set { Font.Superscript = value; } + } + + /// + /// Gets or sets the subscript property. + /// + [DV] + public bool Subscript + { + get { return Font.Subscript; } + set { Font.Subscript = value; } + } + + /// + /// Gets the collection of paragraph elements that defines the FormattedText. + /// + public ParagraphElements Elements + { + get { return _elements ?? (_elements = new ParagraphElements(this)); } + set + { + SetParent(value); + _elements = value; + } + } + [DV(ItemType = typeof(DocumentObject))] + public ParagraphElements _elements; + #endregion + + #region public + /// + /// Converts FormattedText into DDL. + /// + public override void Serialize(Serializer serializer) + { + bool isFormatted = false; + if (!IsNull("Font")) + { + Font.Serialize(serializer); + isFormatted = true; + } + else + { + if (!_style.IsNull) + { + serializer.Write("\\font(\"" + Style + "\")"); + isFormatted = true; + } + } + + if (isFormatted) + serializer.Write("{"); + + if (!IsNull("Elements")) + Elements.Serialize(serializer); + + if (isFormatted) + serializer.Write("}"); + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitFormattedText(this); + + if (visitChildren && _elements != null) + ((IVisitable)_elements).AcceptVisitor(visitor, true); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(FormattedText))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/HeaderFooter.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/HeaderFooter.cs new file mode 100644 index 0000000..cdfe66a --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/HeaderFooter.cs @@ -0,0 +1,348 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; +using MigraDoc.DocumentObjectModel.Shapes.Charts; +using MigraDoc.DocumentObjectModel.Tables; +using MigraDoc.DocumentObjectModel.Shapes; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents a header or footer object in a section. + /// + public class HeaderFooter : DocumentObject, IVisitable + { + /// + /// Initializes a new instance of the HeaderFooter class. + /// + public HeaderFooter() + { } + + /// + /// Initializes a new instance of the HeaderFooter class with the specified parent. + /// + public HeaderFooter(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new HeaderFooter Clone() + { + return (HeaderFooter)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + HeaderFooter headerFooter = (HeaderFooter)base.DeepCopy(); + if (headerFooter._format != null) + { + headerFooter._format = headerFooter._format.Clone(); + headerFooter._format._parent = headerFooter; + } + if (headerFooter._elements != null) + { + headerFooter._elements = headerFooter._elements.Clone(); + headerFooter._elements._parent = headerFooter; + } + return headerFooter; + } + + /// + /// Adds a new paragraph to the header or footer. + /// + public Paragraph AddParagraph() + { + return Elements.AddParagraph(); + } + + /// + /// Adds a new paragraph with the specified text to the header or footer. + /// + public Paragraph AddParagraph(string paragraphText) + { + return Elements.AddParagraph(paragraphText); + } + + /// + /// Adds a new chart with the specified type to the header or footer. + /// + public Chart AddChart(ChartType type) + { + return Elements.AddChart(type); + } + + /// + /// Adds a new chart to the header or footer. + /// + public Chart AddChart() + { + return Elements.AddChart(); + } + + /// + /// Adds a new table to the header or footer. + /// + public Table AddTable() + { + return Elements.AddTable(); + } + + /// + /// Adds a new Image to the header or footer. + /// + public Image AddImage(string fileName) + { + return Elements.AddImage(fileName); + } + + /// + /// Adds a new textframe to the header or footer. + /// + public TextFrame AddTextFrame() + { + return Elements.AddTextFrame(); + } + + /// + /// Adds a new paragraph to the header or footer. + /// + public void Add(Paragraph paragraph) + { + Elements.Add(paragraph); + } + + /// + /// Adds a new chart to the header or footer. + /// + public void Add(Chart chart) + { + Elements.Add(chart); + } + + /// + /// Adds a new table to the header or footer. + /// + public void Add(Table table) + { + Elements.Add(table); + } + + /// + /// Adds a new image to the header or footer. + /// + public void Add(Image image) + { + Elements.Add(image); + } + + /// + /// Adds a new text frame to the header or footer. + /// + public void Add(TextFrame textFrame) + { + Elements.Add(textFrame); + } + #endregion + + #region Properties + /// + /// Returns true if this is a headers, false otherwise. + /// + public bool IsHeader + { + get { return ((HeadersFooters)_parent).IsHeader; } + } + + /// + /// Returns true if this is a footer, false otherwise. + /// + public bool IsFooter + { + get { return ((HeadersFooters)_parent).IsFooter; } + } + + /// + /// Returns true if this is a first page header or footer, false otherwise. + /// + public bool IsFirstPage + { + get { return ((HeadersFooters)_parent)._firstPage == this; } + } + + /// + /// Returns true if this is an even page header or footer, false otherwise. + /// + public bool IsEvenPage + { + get { return ((HeadersFooters)_parent)._evenPage == this; } + } + + /// + /// Returns true if this is a primary header or footer, false otherwise. + /// + public bool IsPrimary + { + get { return ((HeadersFooters)_parent)._primary == this; } + } + + /// + /// Gets or sets the style name. + /// + public string Style + { + get { return _style.Value; } + set + { + // Just save style name. + Style style = Document.Styles[value]; + if (style != null) + _style.Value = value; + else + throw new ArgumentException("Invalid style name '" + value + "'."); + } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets or sets the paragraph format. + /// + public ParagraphFormat Format + { + get { return _format ?? (_format = new ParagraphFormat(this)); } + set + { + SetParent(value); + _format = value; + } + } + [DV] + public ParagraphFormat _format; + + /// + /// Gets the collection of document objects that defines the header or footer. + /// + public DocumentElements Elements + { + get { return _elements ?? (_elements = new DocumentElements(this)); } + set + { + SetParent(value); + _elements = value; + } + } + [DV(ItemType = typeof(DocumentObject))] + public DocumentElements _elements; + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + #endregion + + #region public + /// + /// Converts HeaderFooter into DDL. + /// + public override void Serialize(Serializer serializer) + { + HeadersFooters headersfooters = (HeadersFooters)_parent; + if (headersfooters.Primary == this) + Serialize(serializer, "primary"); + else if (headersfooters.EvenPage == this) + Serialize(serializer, "evenpage"); + else if (headersfooters.FirstPage == this) + Serialize(serializer, "firstpage"); + } + + /// + /// Converts HeaderFooter into DDL. + /// + public void Serialize(Serializer serializer, string prefix) + { + serializer.WriteComment(_comment.Value); + serializer.WriteLine("\\" + prefix + (IsHeader ? "header" : "footer")); + + int pos = serializer.BeginAttributes(); + if (!IsNull("Format")) + _format.Serialize(serializer, "Format", null); + serializer.EndAttributes(pos); + + serializer.BeginContent(); + if (!IsNull("Elements")) + _elements.Serialize(serializer); + serializer.EndContent(); + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitHeaderFooter(this); + + if (visitChildren && _elements != null) + ((IVisitable)_elements).AcceptVisitor(visitor, true); + } + + /// + /// Determines whether this instance is null (not set). + /// + public override bool IsNull() + { + return false; + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(HeaderFooter))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/HeadersFooters.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/HeadersFooters.cs new file mode 100644 index 0000000..f888701 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/HeadersFooters.cs @@ -0,0 +1,214 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents the collection of HeaderFooter objects. + /// + public class HeadersFooters : DocumentObject, IVisitable + { + /// + /// Initializes a new instance of the HeadersFooters class. + /// + public HeadersFooters() + { } + + /// + /// Initializes a new instance of the HeadersFooters class with the specified parent. + /// + public HeadersFooters(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new HeadersFooters Clone() + { + return (HeadersFooters)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + HeadersFooters headersFooters = (HeadersFooters)base.DeepCopy(); + if (headersFooters._evenPage != null) + { + headersFooters._evenPage = headersFooters._evenPage.Clone(); + headersFooters._evenPage._parent = headersFooters; + } + if (headersFooters._firstPage != null) + { + headersFooters._firstPage = headersFooters._firstPage.Clone(); + headersFooters._firstPage._parent = headersFooters; + } + if (headersFooters._primary != null) + { + headersFooters._primary = headersFooters._primary.Clone(); + headersFooters._primary._parent = headersFooters; + } + return headersFooters; + } + #endregion + + #region Properties + /// + /// Returns true if this collection contains headers, false otherwise. + /// + public bool IsHeader + { + get + { + Section sec = (Section)_parent; + return sec._headers == this; + } + } + + /// + /// Returns true if this collection contains footers, false otherwise. + /// + public bool IsFooter + { + get { return !IsHeader; } + } + + /// + /// Determines whether a particular header or footer exists. + /// + public bool HasHeaderFooter(HeaderFooterIndex index) + { + return !IsNull(index.ToString()); + } + + /// + /// Gets or sets the even page HeaderFooter of the HeadersFooters object. + /// + public HeaderFooter EvenPage + { + get { return _evenPage ?? (_evenPage = new HeaderFooter(this)); } + set + { + SetParent(value); + _evenPage = value; + } + } + [DV] + public HeaderFooter _evenPage; + + /// + /// Gets or sets the first page HeaderFooter of the HeadersFooters object. + /// + public HeaderFooter FirstPage + { + get { return _firstPage ?? (_firstPage = new HeaderFooter(this)); } + set + { + SetParent(value); + _firstPage = value; + } + } + [DV] + public HeaderFooter _firstPage; + + /// + /// Gets or sets the primary HeaderFooter of the HeadersFooters object. + /// + public HeaderFooter Primary + { + get { return _primary ?? (_primary = new HeaderFooter(this)); } + set + { + SetParent(value); + _primary = value; + } + } + [DV] + public HeaderFooter _primary; + #endregion + + #region public + /// + /// Converts HeadersFooters into DDL. + /// + public override void Serialize(Serializer serializer) + { + bool hasPrimary = HasHeaderFooter(HeaderFooterIndex.Primary); + bool hasEvenPage = HasHeaderFooter(HeaderFooterIndex.EvenPage); + bool hasFirstPage = HasHeaderFooter(HeaderFooterIndex.FirstPage); + + // \primary... + if (hasPrimary) + Primary.Serialize(serializer, "primary"); + + // \even... + if (hasEvenPage) + EvenPage.Serialize(serializer, "evenpage"); + + // \firstpage... + if (hasFirstPage) + FirstPage.Serialize(serializer, "firstpage"); + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitHeadersFooters(this); + + if (visitChildren) + { + if (HasHeaderFooter(HeaderFooterIndex.Primary)) + ((IVisitable)_primary).AcceptVisitor(visitor, true); + if (HasHeaderFooter(HeaderFooterIndex.EvenPage)) + ((IVisitable)_evenPage).AcceptVisitor(visitor, true); + if (HasHeaderFooter(HeaderFooterIndex.FirstPage)) + ((IVisitable)_firstPage).AcceptVisitor(visitor, true); + } + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(HeadersFooters))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Hyperlink.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Hyperlink.cs new file mode 100644 index 0000000..3c986be --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Hyperlink.cs @@ -0,0 +1,529 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; +using MigraDoc.DocumentObjectModel.Fields; +using MigraDoc.DocumentObjectModel.Shapes; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// A Hyperlink is used to reference targets in the document (Local), on a drive (File) or a network (Web). + /// + public class Hyperlink : DocumentObject, IVisitable + { + /// + /// Initializes a new instance of the Hyperlink class. + /// + public Hyperlink() + { } + + /// + /// Initializes a new instance of the Hyperlink class with the specified parent. + /// + public Hyperlink(DocumentObject parent) : base(parent) { } + + /// + /// Initializes a new instance of the Hyperlink class with the text the hyperlink shall content. + /// The type will be treated as Local by default. + /// + public Hyperlink(string name, string text) + : this() + { + Name = name; + Elements.AddText(text); + } + + /// + /// Initializes a new instance of the Hyperlink class with the type and text the hyperlink shall + /// represent. + /// + public Hyperlink(string name, HyperlinkType type, string text) + : this() + { + Name = name; + Type = type; + Elements.AddText(text); + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Hyperlink Clone() + { + return (Hyperlink)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Hyperlink hyperlink = (Hyperlink)base.DeepCopy(); + if (hyperlink._elements != null) + { + hyperlink._elements = hyperlink._elements.Clone(); + hyperlink._elements._parent = hyperlink; + } + return hyperlink; + } + + /// + /// Adds a text phrase to the hyperlink. + /// + public Text AddText(String text) + { + return Elements.AddText(text); + } + + /// + /// Adds a single character repeated the specified number of times to the hyperlink. + /// + public Text AddChar(char ch, int count) + { + return Elements.AddChar(ch, count); + } + + /// + /// Adds a single character to the hyperlink. + /// + public Text AddChar(char ch) + { + return Elements.AddChar(ch); + } + + /// + /// Adds one or more Symbol objects. + /// + public Character AddCharacter(SymbolName symbolType, int count) + { + return Elements.AddCharacter(symbolType, count); + } + + /// + /// Adds a Symbol object. + /// + public Character AddCharacter(SymbolName symbolType) + { + return Elements.AddCharacter(symbolType); + } + + /// + /// Adds one or more Symbol objects defined by a character. + /// + public Character AddCharacter(char ch, int count) + { + return Elements.AddCharacter(ch, count); + } + + /// + /// Adds a Symbol object defined by a character. + /// + public Character AddCharacter(char ch) + { + return Elements.AddCharacter(ch); + } + + /// + /// Adds a space character as many as count. + /// + public Character AddSpace(int count) + { + return Elements.AddSpace(count); + } + + /// + /// Adds a horizontal tab. + /// + public void AddTab() + { + Elements.AddTab(); + } + + /// + /// Adds a new FormattedText. + /// + public FormattedText AddFormattedText() + { + return Elements.AddFormattedText(); + } + + /// + /// Adds a new FormattedText object with the given format. + /// + public FormattedText AddFormattedText(TextFormat textFormat) + { + return Elements.AddFormattedText(textFormat); + } + + /// + /// Adds a new FormattedText with the given Font. + /// + public FormattedText AddFormattedText(Font font) + { + return Elements.AddFormattedText(font); + } + + /// + /// Adds a new FormattedText with the given text. + /// + public FormattedText AddFormattedText(string text) + { + return Elements.AddFormattedText(text); + } + + /// + /// Adds a new FormattedText object with the given text and format. + /// + public FormattedText AddFormattedText(string text, TextFormat textFormat) + { + return Elements.AddFormattedText(text, textFormat); + } + + /// + /// Adds a new FormattedText object with the given text and font. + /// + public FormattedText AddFormattedText(string text, Font font) + { + return Elements.AddFormattedText(text, font); + } + + /// + /// Adds a new FormattedText object with the given text and style. + /// + public FormattedText AddFormattedText(string text, string style) + { + return Elements.AddFormattedText(text, style); + } + + /// + /// Adds a new Bookmark. + /// + public BookmarkField AddBookmark(string name) + { + return Elements.AddBookmark(name); + } + + /// + /// Adds a new PageField. + /// + public PageField AddPageField() + { + return Elements.AddPageField(); + } + + /// + /// Adds a new PageRefField. + /// + public PageRefField AddPageRefField(string name) + { + return Elements.AddPageRefField(name); + } + + /// + /// Adds a new NumPagesField. + /// + public NumPagesField AddNumPagesField() + { + return Elements.AddNumPagesField(); + } + + /// + /// Adds a new SectionField. + /// + public SectionField AddSectionField() + { + return Elements.AddSectionField(); + } + + /// + /// Adds a new SectionPagesField. + /// + public SectionPagesField AddSectionPagesField() + { + return Elements.AddSectionPagesField(); + } + + /// + /// Adds a new DateField. + /// + public DateField AddDateField() + { + return Elements.AddDateField(); + } + + /// + /// Adds a new DateField. + /// + public DateField AddDateField(string format) + { + return Elements.AddDateField(format); + } + + /// + /// Adds a new InfoField. + /// + public InfoField AddInfoField(InfoFieldType iType) + { + return Elements.AddInfoField(iType); + } + + /// + /// Adds a new Footnote with the specified text. + /// + public Footnote AddFootnote(string text) + { + return Elements.AddFootnote(text); + } + + /// + /// Adds a new Footnote. + /// + public Footnote AddFootnote() + { + return Elements.AddFootnote(); + } + + /// + /// Adds a new Image object + /// + public Image AddImage(string fileName) + { + return Elements.AddImage(fileName); + } + /// + /// Adds a new Bookmark + /// + public void Add(BookmarkField bookmark) + { + Elements.Add(bookmark); + } + + /// + /// Adds a new PageField + /// + public void Add(PageField pageField) + { + Elements.Add(pageField); + } + + /// + /// Adds a new PageRefField + /// + public void Add(PageRefField pageRefField) + { + Elements.Add(pageRefField); + } + + /// + /// Adds a new NumPagesField + /// + public void Add(NumPagesField numPagesField) + { + Elements.Add(numPagesField); + } + + /// + /// Adds a new SectionField + /// + public void Add(SectionField sectionField) + { + Elements.Add(sectionField); + } + + /// + /// Adds a new SectionPagesField + /// + public void Add(SectionPagesField sectionPagesField) + { + Elements.Add(sectionPagesField); + } + + /// + /// Adds a new DateField + /// + public void Add(DateField dateField) + { + Elements.Add(dateField); + } + + /// + /// Adds a new InfoField + /// + public void Add(InfoField infoField) + { + Elements.Add(infoField); + } + + /// + /// Adds a new Footnote + /// + public void Add(Footnote footnote) + { + Elements.Add(footnote); + } + + /// + /// Adds a new Text + /// + public void Add(Text text) + { + Elements.Add(text); + } + + /// + /// Adds a new FormattedText + /// + public void Add(FormattedText formattedText) + { + Elements.Add(formattedText); + } + + /// + /// Adds a new Image + /// + public void Add(Image image) + { + Elements.Add(image); + } + + /// + /// Adds a new Character + /// + public void Add(Character character) + { + Elements.Add(character); + } + #endregion + + #region Properties + /// + /// Gets or sets the font object. + /// + public Font Font + { + get { return _font ?? (_font = new Font(this)); } + set + { + SetParent(value); + _font = value; + } + } + [DV] + public Font _font; + + /// + /// Gets or sets the target name of the Hyperlink, e.g. an URL or a bookmark's name. + /// + public string Name + { + get { return _name.Value; } + set { _name.Value = value; } + } + [DV] + public NString _name = NString.NullValue; + + /// + /// Gets or sets the target type of the Hyperlink. + /// + public HyperlinkType Type + { + get { return (HyperlinkType)_type.Value; } + set { _type.Value = (int)value; } + } + [DV(Type = typeof(HyperlinkType))] + public NEnum _type = NEnum.NullValue(typeof(HyperlinkType)); + + /// + /// Gets the ParagraphElements of the Hyperlink specifying its 'clickable area'. + /// + public ParagraphElements Elements + { + get { return _elements ?? (_elements = new ParagraphElements(this)); } + set + { + SetParent(value); + _elements = value; + } + } + [DV(ItemType = typeof(DocumentObject))] + public ParagraphElements _elements; + #endregion + + #region public + /// + /// Converts Hyperlink into DDL. + /// + public override void Serialize(Serializer serializer) + { + if (_name.Value == string.Empty) + throw new InvalidOperationException(DomSR.MissingObligatoryProperty("Name", "Hyperlink")); + serializer.Write("\\hyperlink"); + string str = "[Name = \"" + Name.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\""; + if (!_type.IsNull) + str += " Type = " + Type; + str += "]"; + serializer.Write(str); + serializer.Write("{"); + if (_elements != null) + _elements.Serialize(serializer); + serializer.Write("}"); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Hyperlink))); } + } + static Meta _meta; + #endregion + + #region IDomVisitable Members + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + public void AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitHyperlink(this); + if (visitChildren && _elements != null) + { + ((IVisitable)_elements).AcceptVisitor(visitor, true); + } + } + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/ImageHelper.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/ImageHelper.cs new file mode 100644 index 0000000..446570b --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/ImageHelper.cs @@ -0,0 +1,128 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Deals with image file names, searches along the image path, checks if images exist etc. + /// + public class ImageHelper + { + /// + /// Gets the first existing image from the subfolders. + /// + public static string GetImageName(string root, string filename, string imagePath) + { + List subfolders = new List(imagePath.Split(new [] { ';' }, StringSplitOptions.RemoveEmptyEntries)); + subfolders.Add(""); + + foreach (string subfolder in subfolders) + { + string fullname = System.IO.Path.Combine(System.IO.Path.Combine(root, subfolder), filename); + int pageNumber; + string realFile = ExtractPageNumber(fullname, out pageNumber); + +#if !NETFX_CORE + if (System.IO.File.Exists(realFile)) + return fullname; +#else + throw new NotImplementedException(); + //if (System.IO.File.Exists(realFile)) + // return fullname; +#endif + } + return null; + } + + /// + /// Gets a value indicating whether the filename given in the referenceFilename exists in the subfolders. + /// + public static bool InSubfolder(string root, string filename, string imagePath, string referenceFilename) + { + List subfolders = new List(imagePath.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)); + subfolders.Add(""); + + foreach (string subfolder in subfolders) + { + string fullname = System.IO.Path.Combine(System.IO.Path.Combine(root, subfolder), filename); + int pageNumber; + string realFile = ExtractPageNumber(fullname, out pageNumber); +#if !NETFX_CORE + if (System.IO.File.Exists(realFile)) + { + if (fullname == referenceFilename) + return true; + } +#else + throw new NotImplementedException(); +#endif + } + return false; + } + + /// + /// Extracts the page number if the path has the form 'MyFile.pdf#123' and returns + /// the actual path without the number sign and the following digits. + /// + public static string ExtractPageNumber(string path, out int pageNumber) + { + // Note: duplicated from class XPdfForm + if (path == null) + throw new ArgumentNullException("path"); + + pageNumber = 0; + int length = path.Length; + if (length != 0) + { + length--; + if (Char.IsDigit(path, length)) + { + while (Char.IsDigit(path, length) && length >= 0) + length--; + if (length > 0 && path[length] == '#') + { + // must have at least one dot left of colon to distinguish from e.g. '#123' + if (path.IndexOf('.') != -1) + { + pageNumber = Int32.Parse(path.Substring(length + 1)); + path = path.Substring(0, length); + } + } + } + } + return path; + } + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/ListInfo.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/ListInfo.cs new file mode 100644 index 0000000..f6a646a --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/ListInfo.cs @@ -0,0 +1,123 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// A ListInfo is the representation of a series of paragraphs as a list. + /// + public class ListInfo : DocumentObject + { + /// + /// Initializes a new instance of the ListInfo class. + /// + public ListInfo() + { } + + /// + /// Initializes a new instance of the ListInfo class with the specified parent. + /// + public ListInfo(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new ListInfo Clone() + { + return (ListInfo)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets the type of the list. + /// + public ListType ListType + { + get { return (ListType)_listType.Value; } + set { _listType.Value = (int)value; } + } + [DV(Type = typeof(ListType))] + public NEnum _listType = NEnum.NullValue(typeof(ListType)); + + /// + /// Gets or sets the left indent of the list symbol. + /// + public Unit NumberPosition + { + get { return _numberPosition; } + set { _numberPosition = value; } + } + [DV] + public Unit _numberPosition = Unit.NullValue; + + /// + /// Gets or sets a value indicating whether + /// the previous list numbering should be continued. + /// + public bool ContinuePreviousList + { + get { return _continuePreviousList.Value; } + set { _continuePreviousList.Value = value; } + } + [DV] + public NBool _continuePreviousList = NBool.NullValue; + #endregion + + #region public + /// + /// Converts ListInfo into DDL. + /// + public override void Serialize(Serializer serializer) + { + if (!_listType.IsNull) + serializer.WriteSimpleAttribute("ListInfo.ListType", ListType); + if (!_numberPosition.IsNull) + serializer.WriteSimpleAttribute("ListInfo.NumberPosition", NumberPosition); + if (!_continuePreviousList.IsNull) + serializer.WriteSimpleAttribute("ListInfo.ContinuePreviousList", ContinuePreviousList); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(ListInfo))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/PageBreak.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/PageBreak.cs new file mode 100644 index 0000000..f5bfe0a --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/PageBreak.cs @@ -0,0 +1,78 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// A PageBreak is used to put following elements on a new page. + /// + public class PageBreak : DocumentObject + { + /// + /// Initializes a new instance of the PageBreak class. + /// + public PageBreak() + { } + + /// + /// Initializes a new instance of the PageBreak class with the specified parent. + /// + public PageBreak(DocumentObject parent) : base(parent) { } + + /// + /// Creates a deep copy of this object. + /// + public new PageBreak Clone() + { + return (PageBreak)DeepCopy(); + } + + /// + /// Converts PageBreak into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteLine("\\pagebreak"); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(PageBreak))); } + } + static Meta _meta; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/PageSetup.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/PageSetup.cs new file mode 100644 index 0000000..6238eea --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/PageSetup.cs @@ -0,0 +1,467 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents the page setup of a section. + /// + public class PageSetup : DocumentObject + { + /// + /// Initializes a new instance of the PageSetup class. + /// + public PageSetup() + { } + + /// + /// Initializes a new instance of the PageSetup class with the specified parent. + /// + public PageSetup(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new PageSetup Clone() + { + return (PageSetup)DeepCopy(); + } + + /// + /// Gets the page's size and height for the given PageFormat. + /// + public static void GetPageSize(PageFormat pageFormat, out Unit pageWidth, out Unit pageHeight) + { + //Sizes in mm: + pageWidth = 0; + pageHeight = 0; + const int A0Height = 1189; + const int A0Width = 841; + int height = 0; + int width = 0; + switch (pageFormat) + { + case PageFormat.A0: + height = A0Height; + width = A0Width; + break; + case PageFormat.A1: + height = A0Width; + width = A0Height / 2; + break; + case PageFormat.A2: + height = A0Height / 2; + width = A0Width / 2; + break; + case PageFormat.A3: + height = A0Width / 2; + width = A0Height / 4; + break; + case PageFormat.A4: + height = A0Height / 4; + width = A0Width / 4; + break; + case PageFormat.A5: + height = A0Width / 4; + width = A0Height / 8; + break; + case PageFormat.A6: + height = A0Height / 8; + width = A0Width / 8; + break; + case PageFormat.B5: + height = 257; + width = 182; + break; + case PageFormat.Letter: + pageWidth = Unit.FromPoint(612); + pageHeight = Unit.FromPoint(792); + break; + case PageFormat.Legal: + pageWidth = Unit.FromPoint(612); + pageHeight = Unit.FromPoint(1008); + break; + case PageFormat.Ledger: + pageWidth = Unit.FromPoint(1224); + pageHeight = Unit.FromPoint(792); + break; + case PageFormat.P11x17: + pageWidth = Unit.FromPoint(792); + pageHeight = Unit.FromPoint(1224); + break; + } + if (height > 0) + pageHeight = Unit.FromMillimeter(height); + if (width > 0) + pageWidth = Unit.FromMillimeter(width); + } + #endregion + + #region Properties + /// + /// Gets or sets a value which defines whether the section starts on next, odd or even page. + /// + public BreakType SectionStart + { + get { return (BreakType)_sectionStart.Value; } + set { _sectionStart.Value = (int)value; } + } + [DV(Type = typeof(BreakType))] + public NEnum _sectionStart = NEnum.NullValue(typeof(BreakType)); + + /// + /// Gets or sets the page orientation of the section. + /// + public Orientation Orientation + { + get { return (Orientation)_orientation.Value; } + set { _orientation.Value = (int)value; } + } + [DV(Type = typeof(Orientation))] + public NEnum _orientation = NEnum.NullValue(typeof(Orientation)); + + private bool IsLandscape + { + get { return Orientation == Orientation.Landscape; } + } + + // TODO To be compatible with Word, PageWidth should always return the actual width (e.g. 21 cm for DIN A 4 portrait and 29.7 cm for DIN A 4 landscape). + // TODO Pagemargins are also "moving": portrait-left becomes landscape-top + /// + /// Gets or sets the page width. If Orientation is set to Landscape, the PageWidth specifies the height of the page. + /// + public Unit PageWidth + { + get { return _pageWidth; } + set { _pageWidth = value; } + } + [DV] + public Unit _pageWidth = Unit.NullValue; + + /// + /// Gets the effective page width, depending on the Orientation this will either be the height or the width. + /// + public Unit EffectivePageWidth + { + get { return IsLandscape ? PageHeight : PageWidth; } + } + + /// + /// Gets or sets the starting number for the first section page. + /// + public int StartingNumber + { + get { return _startingNumber.Value; } + set { _startingNumber.Value = value; } + } + [DV] + public NInt _startingNumber = NInt.NullValue; + + /// + /// Gets or sets the page height. If Orientation is set to Landscape, the PageHeight specifies the width of the page. + /// + public Unit PageHeight + { + get { return _pageHeight; } + set { _pageHeight = value; } + } + [DV] + public Unit _pageHeight = Unit.NullValue; + + /// + /// Gets the effective page height, depending on the Orientation this will either be the height or the width. + /// + public Unit EffectivePageHeight + { + get { return IsLandscape ? PageWidth : PageHeight; } + } + + /// + /// Gets or sets the top margin of the pages in the section. + /// + public Unit TopMargin + { + get { return _topMargin; } + set { _topMargin = value; } + } + [DV] + public Unit _topMargin = Unit.NullValue; + + /// + /// Gets or sets the bottom margin of the pages in the section. + /// + public Unit BottomMargin + { + get { return _bottomMargin; } + set { _bottomMargin = value; } + } + [DV] + public Unit _bottomMargin = Unit.NullValue; + + /// + /// Gets or sets the left margin of the pages in the section. + /// + public Unit LeftMargin + { + get { return _leftMargin; } + set { _leftMargin = value; } + } + [DV] + public Unit _leftMargin = Unit.NullValue; + + /// + /// Gets or sets the right margin of the pages in the section. + /// + public Unit RightMargin + { + get { return _rightMargin; } + set { _rightMargin = value; } + } + [DV] + public Unit _rightMargin = Unit.NullValue; + + /// + /// Gets or sets a value which defines whether the odd and even pages + /// of the section have different header and footer. + /// + public bool OddAndEvenPagesHeaderFooter + { + get { return _oddAndEvenPagesHeaderFooter.Value; } + set { _oddAndEvenPagesHeaderFooter.Value = value; } + } + [DV] + public NBool _oddAndEvenPagesHeaderFooter = NBool.NullValue; + + /// + /// Gets or sets a value which define whether the section has a different + /// first page header and footer. + /// + public bool DifferentFirstPageHeaderFooter + { + get { return _differentFirstPageHeaderFooter.Value; } + set { _differentFirstPageHeaderFooter.Value = value; } + } + [DV] + public NBool _differentFirstPageHeaderFooter = NBool.NullValue; + + /// + /// Gets or sets the distance between the header and the page top + /// of the pages in the section. + /// + public Unit HeaderDistance + { + get { return _headerDistance; } + set { _headerDistance = value; } + } + [DV] + public Unit _headerDistance = Unit.NullValue; + + /// + /// Gets or sets the distance between the footer and the page bottom + /// of the pages in the section. + /// + public Unit FooterDistance + { + get { return _footerDistance; } + set { _footerDistance = value; } + } + [DV] + public Unit _footerDistance = Unit.NullValue; + + /// + /// Gets or sets a value which defines whether the odd and even pages + /// of the section should change left and right margin. + /// + public bool MirrorMargins + { + get { return _mirrorMargins.Value; } + set { _mirrorMargins.Value = value; } + } + [DV] + public NBool _mirrorMargins = NBool.NullValue; + + /// + /// Gets or sets a value which defines whether a page should break horizontally. + /// Currently only tables are supported. + /// + public bool HorizontalPageBreak + { + get { return _horizontalPageBreak.Value; } + set { _horizontalPageBreak.Value = value; } + } + [DV] + public NBool _horizontalPageBreak = NBool.NullValue; + + /// + /// Gets or sets the page format of the section. + /// + public PageFormat PageFormat + { + get { return (PageFormat)_pageFormat.Value; } + set { _pageFormat.Value = (int)value; } + } + [DV(Type = typeof(PageFormat))] + public NEnum _pageFormat = NEnum.NullValue(typeof(PageFormat)); + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + #endregion + + /// + /// Gets the PageSetup of the previous section, or null, if the page setup belongs + /// to the first section. + /// + public PageSetup PreviousPageSetup() + { + Section section = Parent as Section; + if (section != null) + { + section = section.PreviousSection(); + if (section != null) + return section.PageSetup; + } + return null; + } + + /// + /// Gets a PageSetup object with default values for all properties. + /// + public static PageSetup DefaultPageSetup + { + get + { + if (_defaultPageSetup == null) + { + _defaultPageSetup = new PageSetup(); + _defaultPageSetup.PageFormat = PageFormat.A4; + _defaultPageSetup.SectionStart = BreakType.BreakNextPage; + _defaultPageSetup.Orientation = Orientation.Portrait; + _defaultPageSetup.PageWidth = "21cm"; + _defaultPageSetup.PageHeight = "29.7cm"; + _defaultPageSetup.TopMargin = "2.5cm"; + _defaultPageSetup.BottomMargin = "2cm"; + _defaultPageSetup.LeftMargin = "2.5cm"; + _defaultPageSetup.RightMargin = "2.5cm"; + _defaultPageSetup.HeaderDistance = "1.25cm"; + _defaultPageSetup.FooterDistance = "1.25cm"; + _defaultPageSetup.OddAndEvenPagesHeaderFooter = false; + _defaultPageSetup.DifferentFirstPageHeaderFooter = false; + _defaultPageSetup.MirrorMargins = false; + _defaultPageSetup.HorizontalPageBreak = false; + } + return _defaultPageSetup; + } + } + static PageSetup _defaultPageSetup; + + #region public + /// + /// Converts PageSetup into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteComment(_comment.Value); + int pos = serializer.BeginContent("PageSetup"); + + if (!_pageHeight.IsNull) + serializer.WriteSimpleAttribute("PageHeight", PageHeight); + + if (!_pageWidth.IsNull) + serializer.WriteSimpleAttribute("PageWidth", PageWidth); + + if (!_orientation.IsNull) + serializer.WriteSimpleAttribute("Orientation", Orientation); + + if (!_leftMargin.IsNull) + serializer.WriteSimpleAttribute("LeftMargin", LeftMargin); + + if (!_rightMargin.IsNull) + serializer.WriteSimpleAttribute("RightMargin", RightMargin); + + if (!_topMargin.IsNull) + serializer.WriteSimpleAttribute("TopMargin", TopMargin); + + if (!_bottomMargin.IsNull) + serializer.WriteSimpleAttribute("BottomMargin", BottomMargin); + + if (!_footerDistance.IsNull) + serializer.WriteSimpleAttribute("FooterDistance", FooterDistance); + + if (!_headerDistance.IsNull) + serializer.WriteSimpleAttribute("HeaderDistance", HeaderDistance); + + if (!_oddAndEvenPagesHeaderFooter.IsNull) + serializer.WriteSimpleAttribute("OddAndEvenPagesHeaderFooter", OddAndEvenPagesHeaderFooter); + + if (!_differentFirstPageHeaderFooter.IsNull) + serializer.WriteSimpleAttribute("DifferentFirstPageHeaderFooter", DifferentFirstPageHeaderFooter); + + if (!_sectionStart.IsNull) + serializer.WriteSimpleAttribute("SectionStart", SectionStart); + + if (!_pageFormat.IsNull) + serializer.WriteSimpleAttribute("PageFormat", PageFormat); + + if (!_mirrorMargins.IsNull) + serializer.WriteSimpleAttribute("MirrorMargins", MirrorMargins); + + if (!_horizontalPageBreak.IsNull) + serializer.WriteSimpleAttribute("HorizontalPageBreak", HorizontalPageBreak); + + if (!_startingNumber.IsNull) + serializer.WriteSimpleAttribute("StartingNumber", StartingNumber); + + serializer.EndContent(pos); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(PageSetup))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Paragraph.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Paragraph.cs new file mode 100644 index 0000000..212d8e3 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Paragraph.cs @@ -0,0 +1,622 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; +using MigraDoc.DocumentObjectModel.Fields; +using MigraDoc.DocumentObjectModel.Shapes; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents a paragraph which is used to build up a document with text. + /// + public class Paragraph : DocumentObject, IVisitable + { + /// + /// Initializes a new instance of the Paragraph class. + /// + public Paragraph() + { } + + /// + /// Initializes a new instance of the Paragraph class with the specified parent. + /// + public Paragraph(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Paragraph Clone() + { + return (Paragraph)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Paragraph paragraph = (Paragraph)base.DeepCopy(); + if (paragraph._format != null) + { + paragraph._format = paragraph._format.Clone(); + paragraph._format._parent = paragraph; + } + if (paragraph._elements != null) + { + paragraph._elements = paragraph._elements.Clone(); + paragraph._elements._parent = paragraph; + } + return paragraph; + } + + /// + /// Adds a text phrase to the paragraph. + /// + public Text AddText(String text) + { + return Elements.AddText(text); + } + + /// + /// Adds a single character repeated the specified number of times to the paragraph. + /// + public Text AddChar(char ch, int count) + { + return Elements.AddChar(ch, count); + } + + /// + /// Adds a single character to the paragraph. + /// + public Text AddChar(char ch) + { + return Elements.AddChar(ch); + } + + /// + /// Adds one or more Symbol objects. + /// + public Character AddCharacter(SymbolName symbolType, int count) + { + return Elements.AddCharacter(symbolType, count); + } + + /// + /// Adds a Symbol object. + /// + public Character AddCharacter(SymbolName symbolType) + { + return Elements.AddCharacter(symbolType); + } + + /// + /// Adds one or more Symbol objects defined by a character. + /// + public Character AddCharacter(char ch, int count) + { + return Elements.AddCharacter(ch, count); + } + + /// + /// Adds a Symbol object defined by a character. + /// + public Character AddCharacter(char ch) + { + return Elements.AddCharacter(ch); + } + + /// + /// Adds a space character as many as count. + /// + public Character AddSpace(int count) + { + return Elements.AddSpace(count); + } + + /// + /// Adds a horizontal tab. + /// + public void AddTab() + { + Elements.AddTab(); + } + + /// + /// Adds a line break. + /// + public void AddLineBreak() + { + Elements.AddLineBreak(); + } + + /// + /// Adds a new FormattedText. + /// + public FormattedText AddFormattedText() + { + return Elements.AddFormattedText(); + } + + /// + /// Adds a new FormattedText object with the given format. + /// + public FormattedText AddFormattedText(TextFormat textFormat) + { + return Elements.AddFormattedText(textFormat); + } + + /// + /// Adds a new FormattedText with the given Font. + /// + public FormattedText AddFormattedText(Font font) + { + return Elements.AddFormattedText(font); + } + + /// + /// Adds a new FormattedText with the given text. + /// + public FormattedText AddFormattedText(string text) + { + return Elements.AddFormattedText(text); + } + + /// + /// Adds a new FormattedText object with the given text and format. + /// + public FormattedText AddFormattedText(string text, TextFormat textFormat) + { + return Elements.AddFormattedText(text, textFormat); + } + + /// + /// Adds a new FormattedText object with the given text and font. + /// + public FormattedText AddFormattedText(string text, Font font) + { + return Elements.AddFormattedText(text, font); + } + + /// + /// Adds a new FormattedText object with the given text and style. + /// + public FormattedText AddFormattedText(string text, string style) + { + return Elements.AddFormattedText(text, style); + } + + /// + /// Adds a new Hyperlink of Type "Local", + /// i.e. the Target is a Bookmark within the Document + /// + public Hyperlink AddHyperlink(string name) + { + return Elements.AddHyperlink(name); + } + + /// + /// Adds a new Hyperlink + /// + public Hyperlink AddHyperlink(string name, HyperlinkType type) + { + return Elements.AddHyperlink(name, type); + } + + /// + /// Adds a new Bookmark. + /// + public BookmarkField AddBookmark(string name) + { + return Elements.AddBookmark(name); + } + + /// + /// Adds a new PageField. + /// + public PageField AddPageField() + { + return Elements.AddPageField(); + } + + /// + /// Adds a new PageRefField. + /// + public PageRefField AddPageRefField(string name) + { + return Elements.AddPageRefField(name); + } + + /// + /// Adds a new NumPagesField. + /// + public NumPagesField AddNumPagesField() + { + return Elements.AddNumPagesField(); + } + + /// + /// Adds a new SectionField. + /// + public SectionField AddSectionField() + { + return Elements.AddSectionField(); + } + + /// + /// Adds a new SectionPagesField. + /// + public SectionPagesField AddSectionPagesField() + { + return Elements.AddSectionPagesField(); + } + + /// + /// Adds a new DateField. + /// + public DateField AddDateField() + { + return Elements.AddDateField(); + } + + /// + /// Adds a new DateField. + /// + public DateField AddDateField(string format) + { + return Elements.AddDateField(format); + } + + /// + /// Adds a new InfoField. + /// + public InfoField AddInfoField(InfoFieldType iType) + { + return Elements.AddInfoField(iType); + } + + /// + /// Adds a new Footnote with the specified text. + /// + public Footnote AddFootnote(string text) + { + return Elements.AddFootnote(text); + } + + /// + /// Adds a new Footnote. + /// + public Footnote AddFootnote() + { + return Elements.AddFootnote(); + } + + /// + /// Adds a new Image object + /// + public Image AddImage(string fileName) + { + return Elements.AddImage(fileName); + } + + /// + /// Adds a new Bookmark + /// + public void Add(BookmarkField bookmark) + { + Elements.Add(bookmark); + } + + /// + /// Adds a new PageField + /// + public void Add(PageField pageField) + { + Elements.Add(pageField); + } + + /// + /// Adds a new PageRefField + /// + public void Add(PageRefField pageRefField) + { + Elements.Add(pageRefField); + } + + /// + /// Adds a new NumPagesField + /// + public void Add(NumPagesField numPagesField) + { + Elements.Add(numPagesField); + } + + /// + /// Adds a new SectionField + /// + public void Add(SectionField sectionField) + { + Elements.Add(sectionField); + } + + /// + /// Adds a new SectionPagesField + /// + public void Add(SectionPagesField sectionPagesField) + { + Elements.Add(sectionPagesField); + } + + /// + /// Adds a new DateField + /// + public void Add(DateField dateField) + { + Elements.Add(dateField); + } + + /// + /// Adds a new InfoField + /// + public void Add(InfoField infoField) + { + Elements.Add(infoField); + } + + /// + /// Adds a new Footnote + /// + public void Add(Footnote footnote) + { + Elements.Add(footnote); + } + + /// + /// Adds a new Text + /// + public void Add(Text text) + { + Elements.Add(text); + } + + /// + /// Adds a new FormattedText + /// + public void Add(FormattedText formattedText) + { + Elements.Add(formattedText); + } + + /// + /// Adds a new Hyperlink + /// + public void Add(Hyperlink hyperlink) + { + Elements.Add(hyperlink); + } + + /// + /// Adds a new Image + /// + public void Add(Image image) + { + Elements.Add(image); + } + + /// + /// Adds a new Character + /// + public void Add(Character character) + { + Elements.Add(character); + } + #endregion + + #region Properties + /// + /// Gets or sets the style name. + /// + public string Style + { + get { return _style.Value; } + set { _style.Value = value; } + } + [DV] + public NString _style = NString.NullValue; + + /// + /// Gets or sets the ParagraphFormat object of the paragraph. + /// + public ParagraphFormat Format + { + get { return _format ?? (_format = new ParagraphFormat(this)); } + set + { + SetParent(value); + _format = value; + } + } + [DV] + public ParagraphFormat _format; + + /// + /// Gets the collection of document objects that defines the paragraph. + /// + public ParagraphElements Elements + { + get { return _elements ?? (_elements = new ParagraphElements(this)); } + set + { + SetParent(value); + _elements = value; + } + } + [DV] + public ParagraphElements _elements; + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + #endregion + + #region public + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitParagraph(this); + + if (visitChildren && _elements != null) + ((IVisitable)_elements).AcceptVisitor(visitor, true); + } + + /// + /// For public use only. + /// + public bool SerializeContentOnly + { + get { return _serializeContentOnly; } + set { _serializeContentOnly = value; } + } + bool _serializeContentOnly; + + /// + /// Converts Paragraph into DDL. + /// + public override void Serialize(Serializer serializer) + { + if (!_serializeContentOnly) + { + serializer.WriteComment(_comment.Value); + serializer.WriteLine("\\paragraph"); + + int pos = serializer.BeginAttributes(); + + if (_style.Value != "") + serializer.WriteLine("Style = \"" + _style.Value + "\""); + + if (!IsNull("Format")) + _format.Serialize(serializer, "Format", null); + + serializer.EndAttributes(pos); + + serializer.BeginContent(); + if (!IsNull("Elements")) + Elements.Serialize(serializer); + serializer.CloseUpLine(); + serializer.EndContent(); + } + else + { + Elements.Serialize(serializer); + serializer.CloseUpLine(); + } + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Paragraph))); } + } + + /// + /// Returns an array of Paragraphs that are separated by parabreaks. Null if no parabreak is found. + /// + public Paragraph[] SplitOnParaBreak() + { + if (_elements == null) + return null; + + int startIdx = 0; + List paragraphs = new List(); + for (int idx = 0; idx < Elements.Count; ++idx) + { + DocumentObject element = Elements[idx]; + if (element is Character) + { + Character character = (Character)element; + if (character.SymbolName == SymbolName.ParaBreak) + { + Paragraph paragraph = new Paragraph(); + paragraph.Format = Format.Clone(); + paragraph.Style = Style; + paragraph.Elements = SubsetElements(startIdx, idx - 1); + startIdx = idx + 1; + paragraphs.Add(paragraph); + } + } + } + if (startIdx == 0) //No paragraph breaks given. + return null; + else + { + Paragraph paragraph = new Paragraph(); + paragraph.Format = Format.Clone(); + paragraph.Style = Style; + paragraph.Elements = SubsetElements(startIdx, _elements.Count - 1); + paragraphs.Add(paragraph); + + return paragraphs.ToArray(); + } + } + + /// + /// Gets a subset of the paragraphs elements. + /// + /// Start index of the required subset. + /// End index of the required subset. + /// A ParagraphElements object with cloned elements. + private ParagraphElements SubsetElements(int startIdx, int endIdx) + { + ParagraphElements paragraphElements = new ParagraphElements(); + for (int idx = startIdx; idx <= endIdx; ++idx) + paragraphElements.Add((DocumentObject)_elements[idx].Clone()); + return paragraphElements; + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/ParagraphElements.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/ParagraphElements.cs new file mode 100644 index 0000000..185a564 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/ParagraphElements.cs @@ -0,0 +1,457 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Fields; +using MigraDoc.DocumentObjectModel.Shapes; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// A ParagraphElements collection contains the individual objects of a paragraph. + /// + public class ParagraphElements : DocumentObjectCollection + { + /// + /// Initializes a new instance of the ParagraphElements class. + /// + public ParagraphElements() + { } + + /// + /// Initializes a new instance of the ParagraphElements class with the specified parent. + /// + public ParagraphElements(DocumentObject parent) : base(parent) { } + + /// + /// Gets a ParagraphElement by its index. + /// + public new DocumentObject this[int index] + { + get { return base[index] as DocumentObject; } + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new ParagraphElements Clone() + { + return (ParagraphElements)DeepCopy(); + } + + /// + /// Adds a Text object. + /// + /// Content of the new Text object. + /// Returns a new Text object. + public Text AddText(string text) + { + if (text == null) + throw new ArgumentNullException("text"); +#if true + Text txt = null; + string[] lines = text.Split('\n'); + int lineCount = lines.Length; + for (int line = 0; line < lineCount; line++) + { + string[] tabParts = lines[line].Split('\t'); + int count = tabParts.Length; + for (int idx = 0; idx < count; idx++) + { + if (tabParts[idx].Length != 0) + { + txt = new Text(tabParts[idx]); + Add(txt); + } + if (idx < count - 1) + AddTab(); + } + if (line < lineCount - 1) + AddLineBreak(); + } + return txt; +#else + Text txt = new Text(); + txt.Content = text; + Add(txt); + return txt; +#endif + } + + /// + /// Adds a single character repeated the specified number of times to the paragraph. + /// + public Text AddChar(char ch, int count) + { + return AddText(new string(ch, count)); + } + + /// + /// Adds a single character to the paragraph. + /// + public Text AddChar(char ch) + { + return AddText(new string(ch, 1)); + } + + /// + /// Adds a Character object. + /// + public Character AddCharacter(SymbolName symbolType) + { + return AddCharacter(symbolType, 1); + } + + /// + /// Adds one or more Character objects. + /// + public Character AddCharacter(SymbolName symbolType, int count) + { + Character character = new Character(); + Add(character); + character.SymbolName = symbolType; + character.Count = count; + return character; + } + + /// + /// Adds a Character object defined by a character. + /// + public Character AddCharacter(char ch) + { + return AddCharacter((SymbolName)ch, 1); + } + + /// + /// Adds one or more Character objects defined by a character. + /// + public Character AddCharacter(char ch, int count) + { + return AddCharacter((SymbolName)ch, count); + } + + /// + /// Adds a space character as many as count. + /// + public Character AddSpace(int count) + { + return AddCharacter(SymbolName.Blank, count); + } + + /// + /// Adds a horizontal tab. + /// + public Character AddTab() + { + return AddCharacter(SymbolName.Tab, 1); + } + + /// + /// Adds a line break. + /// + public Character AddLineBreak() + { + return AddCharacter(SymbolName.LineBreak, 1); + } + + /// + /// Adds a new FormattedText. + /// + public FormattedText AddFormattedText() + { + FormattedText formattedText = new FormattedText(); + Add(formattedText); + return formattedText; + } + + /// + /// Adds a new FormattedText object with the given format. + /// + public FormattedText AddFormattedText(TextFormat textFormat) + { + FormattedText formattedText = AddFormattedText(); + + if ((textFormat & TextFormat.Bold) == TextFormat.Bold) + formattedText.Bold = true; + if ((textFormat & TextFormat.NotBold) == TextFormat.NotBold) + formattedText.Bold = false; + if ((textFormat & TextFormat.Italic) == TextFormat.Italic) + formattedText.Italic = true; + if ((textFormat & TextFormat.NotItalic) == TextFormat.NotItalic) + formattedText.Italic = false; + if ((textFormat & TextFormat.Underline) == TextFormat.Underline) + formattedText.Underline = Underline.Single; + if ((textFormat & TextFormat.NoUnderline) == TextFormat.NoUnderline) + formattedText.Underline = Underline.None; + + return formattedText; + } + + /// + /// Adds a new FormattedText with the given Font. + /// + public FormattedText AddFormattedText(Font font) + { + FormattedText formattedText = new FormattedText(); + formattedText.Font.ApplyFont(font); + Add(formattedText); + return formattedText; + } + + /// + /// Adds a new FormattedText with the given text. + /// + public FormattedText AddFormattedText(string text) + { + FormattedText formattedText = new FormattedText(); + formattedText.AddText(text); + Add(formattedText); + return formattedText; + } + + /// + /// Adds a new FormattedText object with the given text and format. + /// + public FormattedText AddFormattedText(string text, TextFormat textFormat) + { + FormattedText formattedText = AddFormattedText(textFormat); + formattedText.AddText(text); + return formattedText; + } + + /// + /// Adds a new FormattedText object with the given text and font. + /// + public FormattedText AddFormattedText(string text, Font font) + { + FormattedText formattedText = AddFormattedText(font); + formattedText.AddText(text); + return formattedText; + } + + /// + /// Adds a new FormattedText object with the given text and style. + /// + public FormattedText AddFormattedText(string text, string style) + { + FormattedText formattedText = AddFormattedText(text); + formattedText.Style = style; + return formattedText; + } + + /// + /// Adds a new Hyperlink of Type "Local", i.e. the Target is a Bookmark within the Document + /// + public Hyperlink AddHyperlink(string name) + { + Hyperlink hyperlink = new Hyperlink(); + hyperlink.Name = name; + Add(hyperlink); + return hyperlink; + } + + /// + /// Adds a new Hyperlink + /// + public Hyperlink AddHyperlink(string name, HyperlinkType type) + { + Hyperlink hyperlink = new Hyperlink(); + hyperlink.Name = name; + hyperlink.Type = type; + Add(hyperlink); + return hyperlink; + } + + /// + /// Adds a new Bookmark. + /// + public BookmarkField AddBookmark(string name) + { + BookmarkField fieldBookmark = new BookmarkField(); + fieldBookmark.Name = name; + Add(fieldBookmark); + return fieldBookmark; + } + + /// + /// Adds a new PageField. + /// + public PageField AddPageField() + { + PageField fieldPage = new PageField(); + Add(fieldPage); + return fieldPage; + } + + /// + /// Adds a new RefFieldPage. + /// + public PageRefField AddPageRefField(string name) + { + PageRefField fieldPageRef = new PageRefField(); + fieldPageRef.Name = name; + Add(fieldPageRef); + return fieldPageRef; + } + + /// + /// Adds a new NumPagesField. + /// + public NumPagesField AddNumPagesField() + { + NumPagesField fieldNumPages = new NumPagesField(); + Add(fieldNumPages); + return fieldNumPages; + } + + /// + /// Adds a new SectionField. + /// + public SectionField AddSectionField() + { + SectionField fieldSection = new SectionField(); + Add(fieldSection); + return fieldSection; + } + + /// + /// Adds a new SectionPagesField. + /// + public SectionPagesField AddSectionPagesField() + { + SectionPagesField fieldSectionPages = new SectionPagesField(); + Add(fieldSectionPages); + return fieldSectionPages; + } + + /// + /// Adds a new DateField. + /// + /// + public DateField AddDateField() + { + DateField fieldDate = new DateField(); + Add(fieldDate); + return fieldDate; + } + + /// + /// Adds a new DateField with the given format. + /// + public DateField AddDateField(string format) + { + DateField fieldDate = new DateField(); + fieldDate.Format = format; + Add(fieldDate); + return fieldDate; + } + + /// + /// Adds a new InfoField with the given type. + /// + public InfoField AddInfoField(InfoFieldType iType) + { + InfoField fieldInfo = new InfoField(); + fieldInfo.Name = iType.ToString(); + Add(fieldInfo); + return fieldInfo; + } + + /// + /// Adds a new Footnote with the specified Text. + /// + public Footnote AddFootnote(string text) + { + Footnote footnote = new Footnote(); + Paragraph par = footnote.Elements.AddParagraph(); + par.AddText(text); + Add(footnote); + return footnote; + } + + /// + /// Adds a new Footnote. + /// + public Footnote AddFootnote() + { + Footnote footnote = new Footnote(); + Add(footnote); + return footnote; + } + + /// + /// Adds a new Image. + /// + public Image AddImage(string name) + { + Image image = new Image(); + image.Name = name; + Add(image); + return image; + } + + /// + /// + /// + public override void Add(DocumentObject docObj) + { + base.Add(docObj); + } + #endregion + + #region public + /// + /// Converts ParagraphElements into DDL. + /// + public override void Serialize(Serializer serializer) + { + int count = Count; + for (int index = 0; index < count; ++index) + { + DocumentObject element = this[index]; + element.Serialize(serializer); + } + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(ParagraphElements))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/ParagraphFormat.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/ParagraphFormat.cs new file mode 100644 index 0000000..dcfa1b6 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/ParagraphFormat.cs @@ -0,0 +1,479 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// A ParagraphFormat represents the formatting of a paragraph. + /// + public class ParagraphFormat : DocumentObject + { + /// + /// Initializes a new instance of the ParagraphFormat class that can be used as a template. + /// + public ParagraphFormat() + { } + + /// + /// Initializes a new instance of the ParagraphFormat class with the specified parent. + /// + public ParagraphFormat(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new ParagraphFormat Clone() + { + return (ParagraphFormat)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + ParagraphFormat format = (ParagraphFormat)base.DeepCopy(); + if (format._font != null) + { + format._font = format._font.Clone(); + format._font._parent = format; + } + if (format._shading != null) + { + format._shading = format._shading.Clone(); + format._shading._parent = format; + } + if (format._borders != null) + { + format._borders = format._borders.Clone(); + format._borders._parent = format; + } + if (format._tabStops != null) + { + format._tabStops = format._tabStops.Clone(); + format._tabStops._parent = format; + } + if (format._listInfo != null) + { + format._listInfo = format._listInfo.Clone(); + format._listInfo._parent = format; + } + return format; + } + + /// + /// Adds a TabStop object to the collection. + /// + public TabStop AddTabStop(Unit position) + { + return TabStops.AddTabStop(position); + } + + /// + /// Adds a TabStop object to the collection and sets its alignment and leader. + /// + public TabStop AddTabStop(Unit position, TabAlignment alignment, TabLeader leader) + { + return TabStops.AddTabStop(position, alignment, leader); + } + + /// + /// Adds a TabStop object to the collection and sets its leader. + /// + public TabStop AddTabStop(Unit position, TabLeader leader) + { + return TabStops.AddTabStop(position, leader); + } + + /// + /// Adds a TabStop object to the collection and sets its alignment. + /// + public TabStop AddTabStop(Unit position, TabAlignment alignment) + { + return TabStops.AddTabStop(position, alignment); + } + + /// + /// Adds a TabStop object to the collection marked to remove the tab stop at + /// the given position. + /// + public void RemoveTabStop(Unit position) + { + TabStops.RemoveTabStop(position); + } + + /// + /// Adds a TabStop object to the collection. + /// + public void Add(TabStop tabStop) + { + TabStops.AddTabStop(tabStop); + } + + /// + /// Clears all TapStop objects from the collection. Additionally 'TabStops = null' + /// is written to the DDL stream when serialized. + /// + public void ClearAll() + { + TabStops.ClearAll(); + } + #endregion + + #region Properties + /// + /// Gets or sets the Alignment of the paragraph. + /// + public ParagraphAlignment Alignment + { + get { return (ParagraphAlignment)_alignment.Value; } + set { _alignment.Value = (int)value; } + } + [DV(Type = typeof(ParagraphAlignment))] + public NEnum _alignment = NEnum.NullValue(typeof(ParagraphAlignment)); + + /// + /// Gets the Borders object. + /// + public Borders Borders + { + get { return _borders ?? (_borders = new Borders(this)); } + set + { + SetParent(value); + _borders = value; + } + } + [DV] + public Borders _borders; + + /// + /// Gets or sets the indent of the first line in the paragraph. + /// + public Unit FirstLineIndent + { + get { return _firstLineIndent; } + set { _firstLineIndent = value; } + } + [DV] + public Unit _firstLineIndent = Unit.NullValue; + + /// + /// Gets or sets the Font object. + /// + public Font Font + { + get { return _font ?? (_font = new Font(this)); } + set + { + SetParent(value); + _font = value; + } + } + [DV] + public Font _font; + + /// + /// Gets or sets a value indicating whether to keep all the paragraph's lines on the same page. + /// + public bool KeepTogether + { + get { return _keepTogether.Value; } + set { _keepTogether.Value = value; } + } + [DV] + public NBool _keepTogether = NBool.NullValue; + + /// + /// Gets or sets a value indicating whether this and the next paragraph stay on the same page. + /// + public bool KeepWithNext + { + get { return _keepWithNext.Value; } + set { _keepWithNext.Value = value; } + } + [DV] + public NBool _keepWithNext = NBool.NullValue; + + /// + /// Gets or sets the left indent of the paragraph. + /// + public Unit LeftIndent + { + get { return _leftIndent; } + set { _leftIndent = value; } + } + [DV] + public Unit _leftIndent = Unit.NullValue; + + /// + /// Gets or sets the space between lines on the paragraph. + /// + public Unit LineSpacing + { + get { return _lineSpacing; } + set { _lineSpacing = value; } + } + [DV] + public Unit _lineSpacing = Unit.NullValue; + + /// + /// Gets or sets the rule which is used to define the line spacing. + /// + public LineSpacingRule LineSpacingRule + { + get { return (LineSpacingRule)_lineSpacingRule.Value; } + set { _lineSpacingRule.Value = (int)value; } + } + [DV(Type = typeof(LineSpacingRule))] + public NEnum _lineSpacingRule = NEnum.NullValue(typeof(LineSpacingRule)); + + /// + /// Gets or sets the ListInfo object of the paragraph. + /// + public ListInfo ListInfo + { + get { return _listInfo ?? (_listInfo = new ListInfo(this)); } + set + { + SetParent(value); + _listInfo = value; + } + } + [DV] + public ListInfo _listInfo; + + /// + /// Gets or sets the out line level of the paragraph. + /// + public OutlineLevel OutlineLevel + { + get { return (OutlineLevel)_outlineLevel.Value; } + set { _outlineLevel.Value = (int)value; } + } + [DV(Type = typeof(OutlineLevel))] + public NEnum _outlineLevel = NEnum.NullValue(typeof(OutlineLevel)); + + /// + /// Gets or sets a value indicating whether a page break is inserted before the paragraph. + /// + public bool PageBreakBefore + { + get { return _pageBreakBefore.Value; } + set { _pageBreakBefore.Value = value; } + } + [DV] + public NBool _pageBreakBefore = NBool.NullValue; + + /// + /// Gets or sets the right indent of the paragraph. + /// + public Unit RightIndent + { + get { return _rightIndent; } + set { _rightIndent = value; } + } + [DV] + public Unit _rightIndent = Unit.NullValue; + + /// + /// Gets the shading object. + /// + public Shading Shading + { + get { return _shading ?? (_shading = new Shading(this)); } + set + { + SetParent(value); + _shading = value; + } + } + [DV] + public Shading _shading; + + /// + /// Gets or sets the space that's inserted after the paragraph. + /// + public Unit SpaceAfter + { + get { return _spaceAfter; } + set { _spaceAfter = value; } + } + [DV] + public Unit _spaceAfter = Unit.NullValue; + + /// + /// Gets or sets the space that's inserted before the paragraph. + /// + public Unit SpaceBefore + { + get { return _spaceBefore; } + set { _spaceBefore = value; } + } + [DV] + public Unit _spaceBefore = Unit.NullValue; + + /// + /// Indicates whether the ParagraphFormat has a TabStops collection. + /// + public bool HasTabStops + { + get { return _tabStops != null; } + } + + /// + /// Get the TabStops collection. + /// + public TabStops TabStops + { + get { return _tabStops ?? (_tabStops = new TabStops(this)); } + set + { + SetParent(value); + _tabStops = value; + } + } + [DV] + public TabStops _tabStops; + + /// + /// Gets or sets a value indicating whether a line from the paragraph stays alone in a page. + /// + public bool WidowControl + { + get { return _widowControl.Value; } + set { _widowControl.Value = value; } + } + [DV] + public NBool _widowControl = NBool.NullValue; + #endregion + + #region public + /// + /// Converts ParagraphFormat into DDL. + /// + public override void Serialize(Serializer serializer) + { + if (_parent is Style) + Serialize(serializer, "ParagraphFormat", null); + else + Serialize(serializer, "Format", null); + } + + /// + /// Converts ParagraphFormat into DDL. + /// + public void Serialize(Serializer serializer, string name, ParagraphFormat refFormat) + { + int pos = serializer.BeginContent(name); + + if (!IsNull("Font") && Parent.GetType() != typeof(Style)) + Font.Serialize(serializer); + + // If a refFormat is specified, it is important to compare the fields and not the properties. + // Only the fields holds the public information whether a value is NULL. In contrast to the + // Efw.Application framework the nullable values and all the meta stuff is kept public to + // give the user the illusion of simplicity. + + if (!_alignment.IsNull && (refFormat == null || (_alignment != refFormat._alignment))) + serializer.WriteSimpleAttribute("Alignment", Alignment); + + if (!_leftIndent.IsNull && (refFormat == null || (_leftIndent != refFormat._leftIndent))) + serializer.WriteSimpleAttribute("LeftIndent", LeftIndent); + + if (!_firstLineIndent.IsNull && (refFormat == null || _firstLineIndent != refFormat._firstLineIndent)) + serializer.WriteSimpleAttribute("FirstLineIndent", FirstLineIndent); + + if (!_rightIndent.IsNull && (refFormat == null || _rightIndent != refFormat._rightIndent)) + serializer.WriteSimpleAttribute("RightIndent", RightIndent); + + if (!_spaceBefore.IsNull && (refFormat == null || _spaceBefore != refFormat._spaceBefore)) + serializer.WriteSimpleAttribute("SpaceBefore", SpaceBefore); + + if (!_spaceAfter.IsNull && (refFormat == null || _spaceAfter != refFormat._spaceAfter)) + serializer.WriteSimpleAttribute("SpaceAfter", SpaceAfter); + + if (!_lineSpacingRule.IsNull && (refFormat == null || _lineSpacingRule != refFormat._lineSpacingRule)) + serializer.WriteSimpleAttribute("LineSpacingRule", LineSpacingRule); + + if (!_lineSpacing.IsNull && (refFormat == null || _lineSpacing != refFormat._lineSpacing)) + serializer.WriteSimpleAttribute("LineSpacing", LineSpacing); + + if (!_keepTogether.IsNull && (refFormat == null || _keepTogether != refFormat._keepTogether)) + serializer.WriteSimpleAttribute("KeepTogether", KeepTogether); + + if (!_keepWithNext.IsNull && (refFormat == null || _keepWithNext != refFormat._keepWithNext)) + serializer.WriteSimpleAttribute("KeepWithNext", KeepWithNext); + + if (!_widowControl.IsNull && (refFormat == null || _widowControl != refFormat._widowControl)) + serializer.WriteSimpleAttribute("WidowControl", WidowControl); + + if (!_pageBreakBefore.IsNull && (refFormat == null || _pageBreakBefore != refFormat._pageBreakBefore)) + serializer.WriteSimpleAttribute("PageBreakBefore", PageBreakBefore); + + if (!_outlineLevel.IsNull && (refFormat == null || _outlineLevel != refFormat._outlineLevel)) + serializer.WriteSimpleAttribute("OutlineLevel", OutlineLevel); + + if (!IsNull("ListInfo")) + ListInfo.Serialize(serializer); + + if (!IsNull("TabStops")) + _tabStops.Serialize(serializer); + + if (!IsNull("Borders")) + { + if (refFormat != null) + _borders.Serialize(serializer, refFormat.Borders); + else + _borders.Serialize(serializer, null); + } + + if (!IsNull("Shading")) + _shading.Serialize(serializer); + + serializer.EndContent(pos); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(ParagraphFormat))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Section.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Section.cs new file mode 100644 index 0000000..a7fbc24 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Section.cs @@ -0,0 +1,378 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; +using MigraDoc.DocumentObjectModel.Shapes.Charts; +using MigraDoc.DocumentObjectModel.Tables; +using MigraDoc.DocumentObjectModel.Shapes; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// A Section is a collection of document objects sharing the same header, footer, + /// and page setup. + /// + public class Section : DocumentObject, IVisitable + { + /// + /// Initializes a new instance of the Section class. + /// + public Section() + { } + + /// + /// Initializes a new instance of the Section class with the specified parent. + /// + public Section(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Section Clone() + { + return (Section)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Section section = (Section)base.DeepCopy(); + if (section._pageSetup != null) + { + section._pageSetup = section._pageSetup.Clone(); + section._pageSetup._parent = section; + } + if (section._headers != null) + { + section._headers = section._headers.Clone(); + section._headers._parent = section; + } + if (section._footers != null) + { + section._footers = section._footers.Clone(); + section._footers._parent = section; + } + if (section._elements != null) + { + section._elements = section._elements.Clone(); + section._elements._parent = section; + } + return section; + } + + /// + /// Gets the previous section. + /// + public Section PreviousSection() + { + Sections sections = Parent as Sections; + int index = sections.IndexOf(this); + if (index > 0) + return sections[index - 1]; + return null; + } + + /// + /// Adds a new paragraph to the section. + /// + public Paragraph AddParagraph() + { + return Elements.AddParagraph(); + } + + /// + /// Adds a new paragraph with the specified text to the section. + /// + public Paragraph AddParagraph(string paragraphText) + { + return Elements.AddParagraph(paragraphText); + } + + /// + /// Adds a new paragraph with the specified text and style to the section. + /// + public Paragraph AddParagraph(string paragraphText, string style) + { + return Elements.AddParagraph(paragraphText, style); + } + + /// + /// Adds a new chart with the specified type to the section. + /// + public Chart AddChart(ChartType type) + { + return Elements.AddChart(type); + } + + /// + /// Adds a new chart to the section. + /// + public Chart AddChart() + { + return Elements.AddChart(); + } + + /// + /// Adds a new table to the section. + /// + public Table AddTable() + { + return Elements.AddTable(); + } + + /// + /// Adds a manual page break. + /// + public void AddPageBreak() + { + Elements.AddPageBreak(); + } + + /// + /// Adds a new Image to the section. + /// + public Image AddImage(string fileName) + { + return Elements.AddImage(fileName); + } + + /// + /// Adds a new textframe to the section. + /// + public TextFrame AddTextFrame() + { + return Elements.AddTextFrame(); + } + + /// + /// Adds a new paragraph to the section. + /// + public void Add(Paragraph paragraph) + { + Elements.Add(paragraph); + } + + /// + /// Adds a new chart to the section. + /// + public void Add(Chart chart) + { + Elements.Add(chart); + } + + /// + /// Adds a new table to the section. + /// + public void Add(Table table) + { + Elements.Add(table); + } + + /// + /// Adds a new image to the section. + /// + public void Add(Image image) + { + Elements.Add(image); + } + + /// + /// Adds a new text frame to the section. + /// + public void Add(TextFrame textFrame) + { + Elements.Add(textFrame); + } + #endregion + + #region Properties + /// + /// Gets the PageSetup object + /// + public PageSetup PageSetup + { + get { return _pageSetup ?? (_pageSetup = new PageSetup(this)); } + set + { + SetParent(value); + _pageSetup = value; + } + } + [DV] + public PageSetup _pageSetup; + + /// + /// Gets the HeadersFooters collection containing the headers. + /// + public HeadersFooters Headers + { + get { return _headers ?? (_headers = new HeadersFooters(this)); } + set + { + SetParent(value); + _headers = value; + } + } + [DV] + public HeadersFooters _headers; + + /// + /// Gets the HeadersFooters collection containing the footers. + /// + public HeadersFooters Footers + { + get { return _footers ?? (_footers = new HeadersFooters(this)); } + set + { + SetParent(value); + _footers = value; + } + } + [DV] + public HeadersFooters _footers; + + /// + /// Gets the document elements that build the section's content. + /// + public DocumentElements Elements + { + get { return _elements ?? (_elements = new DocumentElements(this)); } + set + { + SetParent(value); + _elements = value; + } + } + [DV] + public DocumentElements _elements; + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + + /// + /// Gets the last paragraph of this section, or null, if no paragraph exists is this section. + /// + public Paragraph LastParagraph + { + get + { + int count = _elements.Count; + for (int idx = count - 1; idx >= 0; idx--) + { + if (_elements[idx] is Paragraph) + return (Paragraph)_elements[idx]; + } + return null; + } + } + + /// + /// Gets the last table of this section, or null, if no table exists is this section. + /// + public Table LastTable + { + get + { + int count = _elements.Count; + for (int idx = count - 1; idx >= 0; idx--) + { + if (_elements[idx] is Table) + return (Table)_elements[idx]; + } + return null; + } + } + #endregion + + #region public + /// + /// Converts Section into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteComment(_comment.Value); + serializer.WriteLine("\\section"); + + int pos = serializer.BeginAttributes(); + if (!IsNull("PageSetup")) + PageSetup.Serialize(serializer); + serializer.EndAttributes(pos); + + serializer.BeginContent(); + if (!IsNull("headers")) + _headers.Serialize(serializer); + if (!IsNull("footers")) + _footers.Serialize(serializer); + if (!IsNull("elements")) + _elements.Serialize(serializer); + + serializer.EndContent(); + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitSection(this); + + if (visitChildren && _headers != null) + ((IVisitable)_headers).AcceptVisitor(visitor, true); + if (visitChildren && _footers != null) + ((IVisitable)_footers).AcceptVisitor(visitor, true); + if (visitChildren && _elements != null) + ((IVisitable)_elements).AcceptVisitor(visitor, true); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Section))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Sections.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Sections.cs new file mode 100644 index 0000000..babc8df --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Sections.cs @@ -0,0 +1,116 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents the collection of document sections. + /// + public class Sections : DocumentObjectCollection, IVisitable + { + /// + /// Initializes a new instance of the Sections class. + /// + public Sections() + { } + + /// + /// Initializes a new instance of the Sections class with the specified parent. + /// + public Sections(DocumentObject parent) : base(parent) { } + + /// + /// Gets a section by its index. First section has index 0. + /// + public new Section this[int index] + { + get { return base[index] as Section; } + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Sections Clone() + { + return (Sections)DeepCopy(); + } + + /// + /// Adds a new section. + /// + public Section AddSection() + { + Section section = new Section(); + Add(section); + return section; + } + #endregion + + #region public + /// + /// Converts Sections into DDL. + /// + public override void Serialize(Serializer serializer) + { + int count = Count; + for (int index = 0; index < count; ++index) + { + Section section = this[index]; + section.Serialize(serializer); + } + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitSections(this); + foreach (Section section in this) + ((IVisitable)section).AcceptVisitor(visitor, visitChildren); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Sections))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Serializer.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Serializer.cs new file mode 100644 index 0000000..28c89c7 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Serializer.cs @@ -0,0 +1,605 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Text; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Object to be passed to the Serialize function of a DocumentObject to convert + /// it into DDL. + /// + public sealed class Serializer + { + /// + /// A Serializer object for converting MDDOM into DDL. + /// + /// A TextWriter to write DDL in. + /// Indent of a new block. Default is 2. + /// Initial indent to start with. + public Serializer(TextWriter textWriter, int indent, int initialIndent) + { + if (textWriter == null) + throw new ArgumentNullException("textWriter"); + + _textWriter = textWriter; + _indent = indent; + _writeIndent = initialIndent; + if (textWriter is StreamWriter) + WriteStamp(); + } + + /// + /// Initializes a new instance of the Serializer class with the specified TextWriter. + /// + public Serializer(TextWriter textWriter) : this(textWriter, 2, 0) { } + + /// + /// Initializes a new instance of the Serializer class with the specified TextWriter and indentation. + /// + public Serializer(TextWriter textWriter, int indent) : this(textWriter, indent, 0) { } + + readonly TextWriter _textWriter; + + /// + /// Gets or sets the indentation for a new indentation level. + /// + public int Indent + { + get { return _indent; } + set { _indent = value; } + } + int _indent = 2; + + /// + /// Gets or sets the initial indentation which precede every line. + /// + public int InitialIndent + { + get { return _writeIndent; } + set { _writeIndent = value; } + } + int _writeIndent; + + /// + /// Increases indent of DDL code. + /// + void IncreaseIndent() + { + _writeIndent += _indent; + } + + /// + /// Decreases indent of DDL code. + /// + void DecreaseIndent() + { + _writeIndent -= _indent; + } + + /// + /// Writes the header for a DDL file containing copyright and creation time information. + /// + public void WriteStamp() + { + if (_fWriteStamp) + { + WriteComment("Created by empira MigraDoc Document Object Model"); + WriteComment(String.Format("generated file created {0:d} at {0:t}", DateTime.Now)); + } + } + + /// + /// Appends a string indented without line feed. + /// + public void Write(string str) + { + string wrappedStr = DoWordWrap(str); + if (wrappedStr.Length < str.Length && wrappedStr != "") + { + WriteLineToStream(wrappedStr); + Write(str.Substring(wrappedStr.Length)); + } + else + WriteToStream(str); + CommitText(); + } + + /// + /// Writes a string indented with line feed. + /// + public void WriteLine(string str) + { + string wrappedStr = DoWordWrap(str); + if (wrappedStr.Length < str.Length) + { + WriteLineToStream(wrappedStr); + WriteLine(str.Substring(wrappedStr.Length)); + } + else + WriteLineToStream(wrappedStr); + CommitText(); + } + + /// + /// Returns the part of the string str that fits into the line (up to 80 chars). + /// If Wordwrap is impossible it returns the input-string str itself. + /// + string DoWordWrap(string str) + { + if (str.Length + _writeIndent < LineBreakBeyond) + return str; + + int idxCRLF = str.IndexOf("\x0D\x0A", StringComparison.Ordinal); + if (idxCRLF > 0 && idxCRLF + _writeIndent <= LineBreakBeyond) + return str.Substring(0, idxCRLF + 1); + + int splitIndexBlank = str.Substring(0, LineBreakBeyond - _writeIndent).LastIndexOf(" ", StringComparison.Ordinal); + int splitIndexCRLF = str.Substring(0, LineBreakBeyond - _writeIndent).LastIndexOf("\x0D\x0A", StringComparison.Ordinal); + int splitIndex = Math.Max(splitIndexBlank, splitIndexCRLF); + if (splitIndex == -1) + splitIndex = Math.Min(str.IndexOf(" ", LineBreakBeyond - _writeIndent + 1, StringComparison.Ordinal), + str.IndexOf("\x0D\x0A", LineBreakBeyond - _writeIndent + 1, StringComparison.Ordinal)); + return splitIndex > 0 ? str.Substring(0, splitIndex) : str; + + } + + /// + /// Writes an empty line. + /// + public void WriteLine() + { + WriteLine(String.Empty); + } + + /// + /// Write a line without committing (without marking the text as serialized). + /// + public void WriteLineNoCommit(string str) + { + WriteLineToStream(str); + } + + /// + /// Write a line without committing (without marking the text as serialized). + /// + public void WriteLineNoCommit() + { + WriteLineNoCommit(String.Empty); + } + + /// + /// Writes a text as comment and automatically word-wraps it. + /// + public void WriteComment(string comment) + { + if (String.IsNullOrEmpty(comment)) + return; + + // if string contains CR/LF, split up recursively + int crlf = comment.IndexOf("\x0D\x0A", StringComparison.Ordinal); + if (crlf != -1) + { + WriteComment(comment.Substring(0, crlf)); + WriteComment(comment.Substring(crlf + 2)); + return; + } + CloseUpLine(); + int len; + int chopBeyond = LineBreakBeyond - _indent - "// ".Length; + while ((len = comment.Length) > 0) + { + string wrt; + if (len <= chopBeyond) + { + wrt = "// " + comment; + comment = String.Empty; + } + else + { + int idxChop; + if ((idxChop = comment.LastIndexOf(' ', chopBeyond)) == -1 && + (idxChop = comment.IndexOf(' ', chopBeyond)) == -1) + { + wrt = "// " + comment; + comment = String.Empty; + } + else + { + wrt = "// " + comment.Substring(0, idxChop); + comment = comment.Substring(idxChop + 1); + } + } + WriteLineToStream(wrt); + CommitText(); + } + } + + /// + /// Writes a line break if the current position is not at the beginning + /// of a new line. + /// + public void CloseUpLine() + { + if (_linePos > 0) + WriteLine(); + } + + /// + /// Effectively writes text to the stream. The text is automatically indented and + /// word-wrapped. A given text gets never word-wrapped to keep comments or string + /// literals unbroken. + /// + void WriteToStream(string text, bool fLineBreak, bool fAutoIndent) + { + // if string contains CR/LF, split up recursively + int crlf = text.IndexOf("\x0D\x0A", StringComparison.Ordinal); + if (crlf != -1) + { + WriteToStream(text.Substring(0, crlf), true, fAutoIndent); + WriteToStream(text.Substring(crlf + 2), fLineBreak, fAutoIndent); + return; + } + + int len = text.Length; + if (len > 0) + { + if (_linePos > 0) + { + // does not work + // if (IsBlankRequired(this .lastChar, _text[0])) + // _text = "" + _text; + } + else + { + if (fAutoIndent) + { + text = Indentation + text; + len += _writeIndent; + } + } + _textWriter.Write(text); + _linePos += len; + // wordwrap required? + if (_linePos > LineBreakBeyond) + { + fLineBreak = true; + //this .textWriter.Write("//"); // for debugging only + } + else + _lastChar = text[len - 1]; + } + + if (fLineBreak) + { + _textWriter.WriteLine(String.Empty); // what a line break is may depend on encoding + _linePos = 0; + _lastChar = '\x0A'; + } + } + + /// + /// Write the text into the stream without breaking it and adds an indentation to it. + /// + void WriteToStream(string text) + { + WriteToStream(text, false, true); + } + + /// + /// Write a line to the stream. + /// + void WriteLineToStream(string text) + { + WriteToStream(text, true, true); + } + + ///// + ///// Mighty function to figure out if a blank is required as separator. + ///// // Does not work without context... + ///// + //bool IsBlankRequired(char left, char right) + //{ + // if (left == ' ' || right == ' ') + // return false; + + // // 1st try + // bool leftLetterOrDigit = Char.IsLetterOrDigit(left); + // bool rightLetterOrDigit = Char.IsLetterOrDigit(right); + + // if (leftLetterOrDigit && rightLetterOrDigit) + // return true; + + // return false; + //} + + /// + /// Start attribute part. + /// + public int BeginAttributes() + { + int pos = Position; + WriteLineNoCommit("["); + IncreaseIndent(); + BeginBlock(); + return pos; + } + + /// + /// Start attribute part. + /// + public int BeginAttributes(string str) + { + int pos = Position; + WriteLineNoCommit(str); + WriteLineNoCommit("["); + IncreaseIndent(); + BeginBlock(); + return pos; + } + + /// + /// End attribute part. + /// + public bool EndAttributes() + { + DecreaseIndent(); + WriteLineNoCommit("]"); + return EndBlock(); + } + + /// + /// End attribute part. + /// + public bool EndAttributes(int pos) + { + bool commit = EndAttributes(); + if (!commit) + Position = pos; + return commit; + } + + /// + /// Write attribute of type Unit, Color, int, float, double, bool, string or enum. + /// + public void WriteSimpleAttribute(string valueName, object value) + { + INullableValue ival = value as INullableValue; + if (ival != null) + value = ival.GetValue(); + + Type type = value.GetType(); + + if (type == typeof(Unit)) + { + string strUnit = value.ToString(); + if (((Unit)value).Type == UnitType.Point) + WriteLine(valueName + " = " + strUnit); + else + WriteLine(valueName + " = \"" + strUnit + "\""); + } + else if (type == typeof(float)) + { + WriteLine(valueName + " = " + ((float)value).ToString(CultureInfo.InvariantCulture)); + } + else if (type == typeof(double)) + { + WriteLine(valueName + " = " + ((double)value).ToString(CultureInfo.InvariantCulture)); + } + else if (type == typeof(bool)) + { + WriteLine(valueName + " = " + value.ToString().ToLower()); + } + else if (type == typeof(string)) + { + StringBuilder sb = new StringBuilder(value.ToString()); + sb.Replace("\\", "\\\\"); + sb.Replace("\"", "\\\""); + WriteLine(valueName + " = \"" + sb + "\""); + } +#if !NETFX_CORE + else if (type == typeof(int) || type.BaseType == typeof(Enum) || type == typeof(Color)) +#else + else if (type == typeof(int) || type.GetTypeInfo().BaseType == typeof(Enum) || type == typeof(Color)) +#endif + { + WriteLine(valueName + " = " + value); + } + else + { + string message = String.Format("Type '{0}' of value '{1}' not supported", type, valueName); + Debug.Assert(false, message); + } + } + + /// + /// Start content part. + /// + public int BeginContent() + { + int pos = Position; + WriteLineNoCommit("{"); + IncreaseIndent(); + BeginBlock(); + return pos; + } + + /// + /// Start content part. + /// + public int BeginContent(string str) + { + int pos = Position; + WriteLineNoCommit(str); + WriteLineNoCommit("{"); + IncreaseIndent(); + BeginBlock(); + return pos; + } + + /// + /// End content part. + /// + public bool EndContent() + { + DecreaseIndent(); + WriteLineNoCommit("}"); + return EndBlock(); + } + + /// + /// End content part. + /// + public bool EndContent(int pos) + { + bool commit = EndContent(); + if (!commit) + Position = pos; + return commit; + } + + /// + /// Starts a new nesting block. + /// + public int BeginBlock() + { + int pos = Position; + if (_stackIdx + 1 >= _commitTextStack.Length) + throw new ArgumentException("Block nesting level exhausted."); + _stackIdx += 1; + _commitTextStack[_stackIdx] = false; + return pos; + } + + /// + /// Ends a nesting block. + /// + public bool EndBlock() + { + if (_stackIdx <= 0) + throw new ArgumentException("Block nesting level underflow."); + _stackIdx -= 1; + if (_commitTextStack[_stackIdx + 1]) + _commitTextStack[_stackIdx] = _commitTextStack[_stackIdx + 1]; + return _commitTextStack[_stackIdx + 1]; + } + + /// + /// Ends a nesting block. + /// + public bool EndBlock(int pos) + { + bool commit = EndBlock(); + if (!commit) + Position = pos; + return commit; + } + + /// + /// Gets or sets the position within the underlying stream. + /// + int Position + { + get + { + _textWriter.Flush(); + StreamWriter streamWriter = _textWriter as StreamWriter; + if (streamWriter != null) + return (int)streamWriter.BaseStream.Position; + + StringWriter stringWriter = _textWriter as StringWriter; + if (stringWriter != null) + return stringWriter.GetStringBuilder().Length; + + return 0; + } + set + { + _textWriter.Flush(); + StreamWriter streamWriter = _textWriter as StreamWriter; + if (streamWriter != null) + streamWriter.BaseStream.SetLength(value); + else + { + StringWriter stringWriter = _textWriter as StringWriter; + if (stringWriter != null) + stringWriter.GetStringBuilder().Length = value; + } + } + } + + /// + /// Flushes the buffers of the underlying text writer. + /// + public void Flush() + { + _textWriter.Flush(); + } + + /// + /// Returns an indent string of blanks. + /// + static string Ind(int indent) + { + return new String(' ', indent); + } + + /// + /// Gets an indent string of current indent. + /// + string Indentation + { + get { return Ind(_writeIndent); } + } + + /// + /// Marks the current block as 'committed'. That means the block contains + /// serialized data. + /// + private void CommitText() + { + _commitTextStack[_stackIdx] = true; + } + int _stackIdx; + readonly bool[] _commitTextStack = new bool[32]; + + int _linePos; + const int LineBreakBeyond = 200; + char _lastChar; + bool _fWriteStamp = false; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Shading.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Shading.cs new file mode 100644 index 0000000..40370a7 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Shading.cs @@ -0,0 +1,136 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Shading represents the background color of a document object. + /// + public sealed class Shading : DocumentObject + { + /// + /// Initializes a new instance of the Shading class. + /// + public Shading() + { } + + /// + /// Initializes a new instance of the Shading class with the specified parent. + /// + public Shading(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Shading Clone() + { + return (Shading)DeepCopy(); + } + + /// + /// Clears the Shading object. Additionally 'Shading = null' + /// is written to the DDL stream when serialized. + /// + public void Clear() + { + _isCleared = true; + } + #endregion + + #region Properties + /// + /// Gets or sets a value indicating whether the shading is visible. + /// + public bool Visible + { + get { return _visible.Value; } + set { _visible.Value = value; } + } + [DV] + public NBool _visible = NBool.NullValue; + + /// + /// Gets or sets the shading color. + /// + public Color Color + { + get { return _color; } + set { _color = value; } + } + [DV] + public Color _color = Color.Empty; + + /// + /// Gets the information if the shading is marked as cleared. Additionally 'Shading = null' + /// is written to the DDL stream when serialized. + /// + public bool IsCleared + { + get { return _isCleared; } + } + public bool _isCleared = false; + #endregion + + #region public + /// + /// Converts Shading into DDL. + /// + public override void Serialize(Serializer serializer) + { + if (_isCleared) + serializer.WriteLine("Shading = null"); + + int pos = serializer.BeginContent("Shading"); + + if (!_visible.IsNull) + serializer.WriteSimpleAttribute("Visible", Visible); + + if (!_color.IsNull) + serializer.WriteSimpleAttribute("Color", Color); + + serializer.EndContent(pos); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Shading))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Style.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Style.cs new file mode 100644 index 0000000..b56a6fb --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Style.cs @@ -0,0 +1,452 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents style templates for paragraph or character formatting. + /// + public sealed class Style : DocumentObject, IVisitable + { + /// + /// Initializes a new instance of the Style class. + /// + public Style() + { } + + /// + /// Initializes a new instance of the Style class with the specified parent. + /// + public Style(DocumentObject parent) : base(parent) { } + + /// + /// Initializes a new instance of the Style class with name and base style name. + /// + public Style(string name, string baseStyleName) + : this() + { + // baseStyleName can be null or empty + if (name == null) + throw new ArgumentNullException("name"); + if (name == "") + throw new ArgumentException("name"); + + _name.Value = name; + _baseStyle.Value = baseStyleName; + } + + /// + /// Creates a deep copy of this object. + /// + public new Style Clone() + { + return (Style)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Style style = (Style)base.DeepCopy(); + if (style._paragraphFormat != null) + { + style._paragraphFormat = style._paragraphFormat.Clone(); + style._paragraphFormat._parent = style; + } + return style; + } + + /// + /// Returns the value with the specified name and value access. + /// + public override object GetValue(string name, GV flags) //newStL + { + if (name == null) + throw new ArgumentNullException("name"); + if (name == "") + throw new ArgumentException("name"); + + if (name.ToLower().StartsWith("font")) + return ParagraphFormat.GetValue(name); + return base.GetValue(name, flags); + } + + #region Properties + /// + /// Indicates whether the style is read-only. + /// + public bool IsReadOnly { get; set; } + + /// + /// Gets the font of ParagraphFormat. + /// Calling style.Font is just a shortcut to style.ParagraphFormat.Font. + /// + [DV] + public Font Font + { + get { return ParagraphFormat.Font; } + // SetParent will be called inside ParagraphFormat. + set { ParagraphFormat.Font = value; } + } + + /// + /// Gets the name of the style. + /// + public string Name + { + get { return _name.Value; } + } + [DV] + public NString _name = NString.NullValue; + + /// + /// Gets the ParagraphFormat. To prevent read-only styles from being modified, a copy of its ParagraphFormat + /// is returned in this case. + /// + public ParagraphFormat ParagraphFormat + { + get + { + if (_paragraphFormat == null) + _paragraphFormat = new ParagraphFormat(this); + if (IsReadOnly) + return _paragraphFormat.Clone(); + return _paragraphFormat; + } + set + { + SetParent(value); + _paragraphFormat = value; + } + } + [DV] + public ParagraphFormat _paragraphFormat; + + /// + /// Gets or sets the name of the base style. + /// + public string BaseStyle + { + get { return _baseStyle.Value; } + set + { + if (value == null || value == "" && _baseStyle.Value != "") + throw new ArgumentException(DomSR.EmptyBaseStyle); + + // Self assignment is allowed + if (String.Compare(_baseStyle.Value, value, StringComparison.OrdinalIgnoreCase) == 0) + { + _baseStyle.Value = value; // character case may change... + return; + } + + if (String.Compare(_name.Value, DefaultParagraphName, StringComparison.OrdinalIgnoreCase) == 0 || + String.Compare(_name.Value, DefaultParagraphFontName, StringComparison.OrdinalIgnoreCase) == 0) + { + string msg = String.Format("Style '{0}' has no base style and that cannot be altered.", _name); + throw new ArgumentException(msg); + } + + Styles styles = (Styles)_parent; + // The base style must exists + int idxBaseStyle = styles.GetIndex(value); + if (idxBaseStyle == -1) + { + string msg = String.Format("Base style '{0}' does not exist.", value); + throw new ArgumentException(msg); + } + if (idxBaseStyle > 1) + { + // Is this style in the base style chain of the new base style + Style style = styles[idxBaseStyle] as Style; + while (style != null) + { + if (style == this) + { + string msg = String.Format("Base style '{0}' leads to a circular dependency.", value); + throw new ArgumentException(msg); + } + style = styles[style.BaseStyle]; + } + } + + // Now setting new base style is safe + _baseStyle.Value = value; + } + } + [DV] + public NString _baseStyle = NString.NullValue; + + /// + /// Gets the StyleType of the style. + /// + public StyleType Type + { + get + { + //old + //if (IsNull("Type")) + //{ + // if (String.Compare (this .baseStyle.Value, DefaultParagraphFontName, true) == 0) + // SetValue("Type", StyleType.Character); + // else + // { + // Style bsStyle = GetBaseStyle(); + // if (bsStyle == null) + // throw new ArgumentException("User defined style has no valid base Style."); + // + // SetValue("Type", bsStyle.Type); + // } + //} + //return styleType; + + if (_styleType.IsNull) + { + if (String.Compare(_baseStyle.Value, DefaultParagraphFontName, StringComparison.OrdinalIgnoreCase) == 0) + _styleType.Value = (int)StyleType.Character; + else + { + Style baseStyle = GetBaseStyle(); + if (baseStyle == null) + throw new InvalidOperationException("User defined style has no valid base Style."); + + _styleType.Value = (int)baseStyle.Type; + } + } + return (StyleType)_styleType.Value; + } + } + [DV(Type = typeof(StyleType))] + public NEnum _styleType = NEnum.NullValue(typeof(StyleType)); + + /// + /// Determines whether the style is the style Normal or DefaultParagraphFont. + /// + public bool IsRootStyle + { + get + { + return String.Compare(Name, DefaultParagraphFontName, StringComparison.OrdinalIgnoreCase) == 0 || + String.Compare(Name, DefaultParagraphName, StringComparison.OrdinalIgnoreCase) == 0; + } + } + + /// + /// Get the BaseStyle of the current style. + /// + public Style GetBaseStyle() + { + if (IsRootStyle) + return null; + + Styles styles = Parent as Styles; + if (styles == null) + throw new InvalidOperationException("A parent object is required for this operation; access failed"); + if (_baseStyle.Value == "") + throw new ArgumentException("User defined Style defined without a BaseStyle"); + + // TODO Remove German remarks! + //REVIEW KlPo4StLa Spezialbehandlung fr den DefaultParagraphFont krppelig(DefaultParagraphFont wird bei Zugriff ber styles["name"] nicht zurckgeliefert). + if (_baseStyle.Value == DefaultParagraphFontName) + return styles[0]; + + return styles[_baseStyle.Value]; + } + + /// + /// Indicates whether the style is a predefined (build in) style. + /// + public bool BuildIn + { + get { return _buildIn.Value; } + } + [DV] + public NBool _buildIn = NBool.NullValue; + // TODO: rename to builtIn. + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + #endregion + + // Names of the root styles. Root styles have no BaseStyle. + + /// + /// Name of the default character style. + /// + public const string DefaultParagraphFontName = StyleNames.DefaultParagraphFont; + + /// + /// Name of the default paragraph style. + /// + public const string DefaultParagraphName = StyleNames.Normal; + + #region public + /// + /// Converts Style into DDL. + /// + public override void Serialize(Serializer serializer) + { +#if DEBUG_ // Test + if (Name == StyleNames.Heading1 || Name == StyleNames.Heading2) + Name.GetType(); +#endif + + // For build-in styles all properties that differ from their default values + // are serialized. + // For user-defined styles all non-null properties are serialized. + Styles buildInStyles = Styles.BuildInStyles; + Style refStyle = null; + Font refFont = null; + ParagraphFormat refFormat = null; + + serializer.WriteComment(_comment.Value); + if (_buildIn.Value) + { + // BaseStyle is never null, but empty only for "Normal" and "DefaultParagraphFont" + if (BaseStyle == "") + { + // case: style is "Normal" + if (String.Compare(_name.Value, DefaultParagraphName, StringComparison.OrdinalIgnoreCase) != 0) + throw new ArgumentException("public Error: BaseStyle not set."); + + refStyle = buildInStyles[buildInStyles.GetIndex(Name)]; + refFormat = refStyle.ParagraphFormat; + refFont = refFormat.Font; + string name = DdlEncoder.QuoteIfNameContainsBlanks(Name); + serializer.WriteLineNoCommit(name); + } + else + { + // case: any build-in style except "Normal" + refStyle = buildInStyles[buildInStyles.GetIndex(Name)]; + refFormat = refStyle.ParagraphFormat; + refFont = refFormat.Font; + if (String.Compare(BaseStyle, refStyle.BaseStyle, StringComparison.OrdinalIgnoreCase) == 0) + { + // case: build-in style with unmodified base style name + string name = DdlEncoder.QuoteIfNameContainsBlanks(Name); + serializer.WriteLineNoCommit(name); + // It's fine if we have the predefined base style, but ... + // ... the base style may have been modified or may even have a modified base style. + // Methinks it's wrong to compare with the built-in style, so let's compare with the + // real base style: + refStyle = Document.Styles[Document.Styles.GetIndex(_baseStyle.Value)]; + refFormat = refStyle.ParagraphFormat; + refFont = refFormat.Font; + // Note: we must write "Underline = none" if the base style has "Underline = single" - we cannot + // detect this if we compare with the built-in style that has no underline. + // Known problem: Default values like "OutlineLevel = Level1" will now be serialized + // TODO: optimize... + } + else + { + // case: build-in style with modified base style name + string name = DdlEncoder.QuoteIfNameContainsBlanks(Name); + string baseName = DdlEncoder.QuoteIfNameContainsBlanks(BaseStyle); + serializer.WriteLine(name + " : " + baseName); + refStyle = Document.Styles[Document.Styles.GetIndex(_baseStyle.Value)]; + refFormat = refStyle.ParagraphFormat; + refFont = refFormat.Font; + } + } + } + else + { + // case: user-defined style; base style always exists + + string name = DdlEncoder.QuoteIfNameContainsBlanks(Name); + string baseName = DdlEncoder.QuoteIfNameContainsBlanks(BaseStyle); + serializer.WriteLine(name + " : " + baseName); + +#if true + Style refStyle0 = Document.Styles[Document.Styles.GetIndex(_baseStyle.Value)]; + refStyle = Document.Styles[_baseStyle.Value]; + refFormat = refStyle != null ? refStyle.ParagraphFormat : null; +#else + refFormat = null; +#endif + } + + serializer.BeginContent(); + + if (!IsNull("ParagraphFormat")) + { + if (!ParagraphFormat.IsNull("Font")) + Font.Serialize(serializer, refFormat != null ? refFormat.Font : null); + + if (Type == StyleType.Paragraph) + ParagraphFormat.Serialize(serializer, "ParagraphFormat", refFormat); + } + + serializer.EndContent(); + } + + /// + /// Sets all properties to Null that have the same value as the base style. + /// + private void Optimize() + { + // just here as a reminder to do it... + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitStyle(this); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Style))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/StyleNames.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/StyleNames.cs new file mode 100644 index 0000000..19f484e --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/StyleNames.cs @@ -0,0 +1,61 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Enumerates the predefined style names. + /// + public class StyleNames + { + public const string DefaultParagraphFont = "DefaultParagraphFont"; + public const string Normal = "Normal"; + public const string Heading1 = "Heading1"; + public const string Heading2 = "Heading2"; + public const string Heading3 = "Heading3"; + public const string Heading4 = "Heading4"; + public const string Heading5 = "Heading5"; + public const string Heading6 = "Heading6"; + public const string Heading7 = "Heading7"; + public const string Heading8 = "Heading8"; + public const string Heading9 = "Heading9"; + // TODO Verify if "List" exists with Word. + public const string List = "List"; + public const string Footnote = "Footnote"; + public const string Header = "Header"; + public const string Footer = "Footer"; + public const string Hyperlink = "Hyperlink"; + public const string InvalidStyleName = "InvalidStyleName"; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Styles.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Styles.cs new file mode 100644 index 0000000..cd14803 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Styles.cs @@ -0,0 +1,447 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections; +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents the collection of all styles. + /// + public class Styles : DocumentObjectCollection, IVisitable + { + /// + /// Initializes a new instance of the Styles class. + /// + public Styles() + { + SetupStyles(); + } + + /// + /// Initializes a new instance of the Styles class with the specified parent. + /// + public Styles(DocumentObject parent) + : base(parent) + { + SetupStyles(); + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Styles Clone() + { + return (Styles)base.DeepCopy(); + } + + /// + /// Gets a style by its name. + /// + public Style this[string styleName] + { + get + { + int count = Count; + // index starts from 1; DefaultParagraphFont cannot be modified. + for (int index = 1; index < count; ++index) + { + Style style = this[index]; + if (String.Compare(style.Name, styleName, StringComparison.OrdinalIgnoreCase) == 0) + return style; + } + return null; + } + } + + /// + /// Gets a style by index. + /// + public new Style this[int index] + { + get { return (Style)base[index]; } + } + + /// + /// Gets the index of a style by name. + /// + /// Name of the style looking for. + /// Index or -1 if it does not exist. + public int GetIndex(string styleName) + { + if (styleName == null) + throw new ArgumentNullException("styleName"); + + int count = Count; + for (int index = 0; index < count; ++index) + { + Style style = this[index]; + if (String.Compare(style.Name, styleName, StringComparison.OrdinalIgnoreCase) == 0) + return index; + } + return -1; + } + + /// + /// Adds a new style to the styles collection. + /// + /// Name of the style. + /// Name of the base style. + public Style AddStyle(string name, string baseStyleName) + { + if (name == null || baseStyleName == null) + throw new ArgumentNullException(name == null ? "name" : "baseStyleName"); + if (name == "" || baseStyleName == "") + throw new ArgumentException(name == "" ? "name" : "baseStyleName"); + + Style style = new Style(); + style._name.Value = name; + style._baseStyle.Value = baseStyleName; + Add(style); + // Add(style) may add a clone of style, therefore we return the style by name. + return this[name]; + } + + /// + /// Adds a DocumentObject to the styles collection. Will sometimes add a clone of the DocumentObject, not the object passed as parameter. + /// + public override void Add(DocumentObject value) + { + if (value == null) + throw new ArgumentNullException("value"); + + Style style = value as Style; + if (style == null) + throw new InvalidOperationException(DomSR.StyleExpected); + + bool isRootStyle = style.IsRootStyle; + + if (style.BaseStyle == "" && !isRootStyle) + throw new ArgumentException(DomSR.UndefinedBaseStyle(style.BaseStyle)); + + Style baseStyle = null; + int styleIndex = GetIndex(style.BaseStyle); + + if (styleIndex != -1) + baseStyle = this[styleIndex] as Style; + else if (!isRootStyle) + throw new ArgumentException(DomSR.UndefinedBaseStyle(style.BaseStyle)); + + if (baseStyle != null) + style._styleType.Value = (int)baseStyle.Type; + + int index = GetIndex(style.Name); + + if (index >= 0) + { + // Here a clone of the object will be added to the list, not the original object. + style = style.Clone(); + style._parent = this; + ((IList)this)[index] = style; + } + else + base.Add(value); + } + #endregion + + #region Properties + /// + /// Gets the default paragraph style. + /// + public Style Normal + { + get { return this[Style.DefaultParagraphName]; } + } + + /// + /// Gets or sets a comment associated with this object. + /// + public string Comment + { + get { return _comment.Value; } + set { _comment.Value = value; } + } + [DV] + public NString _comment = NString.NullValue; + #endregion + + /// + /// Initialize the built-in styles. + /// + public void SetupStyles() + { + Style style; + + // First standard style. + style = new Style(Style.DefaultParagraphFontName, null); + style.IsReadOnly = true; + style._styleType.Value = (int)StyleType.Character; + style._buildIn.Value = true; + Add(style); + + // Normal 'Standard' (Paragraph Style). + style = new Style(Style.DefaultParagraphName, null); + style._styleType.Value = (int)StyleType.Paragraph; + style._buildIn.Value = true; + style.Font.Name = "Arial"; // Not "Verdana" anymore. + style.Font.Size = 10; + style.Font.Bold = false; + style.Font.Italic = false; + style.Font.Underline = Underline.None; + style.Font.Color = Colors.Black; + style.Font.Subscript = false; + style.Font.Superscript = false; + style.ParagraphFormat.Alignment = ParagraphAlignment.Left; + style.ParagraphFormat.FirstLineIndent = 0; + style.ParagraphFormat.LeftIndent = 0; + style.ParagraphFormat.RightIndent = 0; + style.ParagraphFormat.KeepTogether = false; + style.ParagraphFormat.KeepWithNext = false; + style.ParagraphFormat.SpaceBefore = 0; + style.ParagraphFormat.SpaceAfter = 0; + style.ParagraphFormat.LineSpacing = 10; + style.ParagraphFormat.LineSpacingRule = LineSpacingRule.Single; + style.ParagraphFormat.OutlineLevel = OutlineLevel.BodyText; + style.ParagraphFormat.PageBreakBefore = false; + style.ParagraphFormat.WidowControl = true; + Add(style); + + // Heading1 'berschrift 1' (Paragraph Style). + style = new Style(StyleNames.Heading1, StyleNames.Normal); + style._buildIn.Value = true; + style.ParagraphFormat.OutlineLevel = OutlineLevel.Level1; + Add(style); + + // Heading2 'berschrift 2' (Paragraph Style). + style = new Style(StyleNames.Heading2, StyleNames.Heading1); + style._buildIn.Value = true; + style.ParagraphFormat.OutlineLevel = OutlineLevel.Level2; + Add(style); + + // Heading3 'berschrift 3' (Paragraph Style). + style = new Style(StyleNames.Heading3, StyleNames.Heading2); + style._buildIn.Value = true; + style.ParagraphFormat.OutlineLevel = OutlineLevel.Level3; + Add(style); + + // Heading4 'berschrift 4' (Paragraph Style). + style = new Style(StyleNames.Heading4, StyleNames.Heading3); + style._buildIn.Value = true; + style.ParagraphFormat.OutlineLevel = OutlineLevel.Level4; + Add(style); + + // Heading5 'berschrift 5' (Paragraph Style). + style = new Style(StyleNames.Heading5, StyleNames.Heading4); + style._buildIn.Value = true; + style.ParagraphFormat.OutlineLevel = OutlineLevel.Level5; + Add(style); + + // Heading6 'berschrift 6' (Paragraph Style). + style = new Style(StyleNames.Heading6, StyleNames.Heading5); + style._buildIn.Value = true; + style.ParagraphFormat.OutlineLevel = OutlineLevel.Level6; + Add(style); + + // Heading7 'berschrift 7' (Paragraph Style). + style = new Style(StyleNames.Heading7, StyleNames.Heading6); + style._buildIn.Value = true; + style.ParagraphFormat.OutlineLevel = OutlineLevel.Level7; + Add(style); + + // Heading8 'berschrift 8' (Paragraph Style). + style = new Style(StyleNames.Heading8, StyleNames.Heading7); + style._buildIn.Value = true; + style.ParagraphFormat.OutlineLevel = OutlineLevel.Level8; + Add(style); + + // Heading9 'berschrift 9' (Paragraph Style). + style = new Style(StyleNames.Heading9, StyleNames.Heading8); + style._buildIn.Value = true; + style.ParagraphFormat.OutlineLevel = OutlineLevel.Level9; + Add(style); + + // List 'Liste' (Paragraph Style). + style = new Style(StyleNames.List, StyleNames.Normal); + style._buildIn.Value = true; + Add(style); + + // Footnote 'Funote' (Paragraph Style). + style = new Style(StyleNames.Footnote, StyleNames.Normal); + style._buildIn.Value = true; + Add(style); + + // Header 'Kopfzeile' (Paragraph Style). + style = new Style(StyleNames.Header, StyleNames.Normal); + style._buildIn.Value = true; + Add(style); + + // -33: Footer 'Fuzeile' (Paragraph Style). + style = new Style(StyleNames.Footer, StyleNames.Normal); + style._buildIn.Value = true; + Add(style); + + // Hyperlink 'Hyperlink' (Character Style). + style = new Style(StyleNames.Hyperlink, StyleNames.DefaultParagraphFont); + style._buildIn.Value = true; + Add(style); + + // InvalidStyleName 'Ungltiger Formatvorlagenname' (Paragraph Style). + style = new Style(StyleNames.InvalidStyleName, StyleNames.Normal); + style._buildIn.Value = true; + style.Font.Bold = true; + style.Font.Underline = Underline.Dash; + style.Font.Color = new Color(0xFF00FF00); + Add(style); + } + + #region public + /// + /// Converts Styles into DDL. + /// + public override void Serialize(Serializer serializer) + { + serializer.WriteComment(_comment.Value); + int pos = serializer.BeginContent("\\styles"); + + // A style can only be added to Styles if its base style exists. Therefore the + // styles collection is consistent at any one time by definition. But because it + // is possible to change the base style of a style, the sequence of the styles + // in the styles collection can be in an order that a style comes before its base + // style. The styles in an DDL file must be ordered such that each style appears + // after its base style. We cannot simply reorder the styles collection, because + // the predefined styles are expected at a fixed position. + // The solution is to reorder the styles during serialization. + int count = Count; + bool[] fSerialized = new bool[count]; // already serialized + fSerialized[0] = true; // consider DefaultParagraphFont as serialized + bool[] fSerializePending = new bool[count]; // currently serializing + bool newLine = false; // gets true if at least one style was written + //Start from 1 and do not serialize DefaultParagraphFont + for (int index = 1; index < count; index++) + { + if (!fSerialized[index]) + { + Style style = this[index]; + SerializeStyle(serializer, index, ref fSerialized, ref fSerializePending, ref newLine); + } + } + serializer.EndContent(pos); + } + + /// + /// Serialize a style, but serialize its base style first (if that was not yet done). + /// + void SerializeStyle(Serializer serializer, int index, ref bool[] fSerialized, ref bool[] fSerializePending, + ref bool newLine) + { + Style style = this[index]; + + // It is not possible to modify the default paragraph font + if (style.Name == Style.DefaultParagraphFontName) + return; + + // Circular dependencies cannot occur if changing the base style is implemented + // correctly. But before we proof that, we check it here. + if (fSerializePending[index]) + { + string message = String.Format("Circular dependency detected according to style '{0}'.", style.Name); + throw new InvalidOperationException(message); + } + + // Only style 'Normal' has no base style + if (style.BaseStyle != "") + { + int idxBaseStyle = GetIndex(style.BaseStyle); + if (idxBaseStyle != -1) + { + if (!fSerialized[idxBaseStyle]) + { + fSerializePending[index] = true; + SerializeStyle(serializer, idxBaseStyle, ref fSerialized, ref fSerializePending, ref newLine); + fSerializePending[index] = false; + } + } + } + int pos2 = serializer.BeginBlock(); + if (newLine) + serializer.WriteLineNoCommit(); + style.Serialize(serializer); + if (serializer.EndBlock(pos2)) + newLine = true; + fSerialized[index] = true; + } + + /// + /// Allows the visitor object to visit the document object and its child objects. + /// + void IVisitable.AcceptVisitor(DocumentObjectVisitor visitor, bool visitChildren) + { + visitor.VisitStyles(this); + + Dictionary visitedStyles = new Dictionary(); + foreach (Style style in this) + VisitStyle(visitedStyles, style, visitor, visitChildren); + } + + /// + /// Ensures that base styles are visited first. + /// + void VisitStyle(Dictionary visitedStyles, Style style, DocumentObjectVisitor visitor, bool visitChildren) + { + if (!visitedStyles.ContainsKey(style)) + { + Style baseStyle = style.GetBaseStyle(); + if (baseStyle != null && !visitedStyles.ContainsKey(baseStyle)) //baseStyle != "" + VisitStyle(visitedStyles, baseStyle, visitor, visitChildren); + ((IVisitable)style).AcceptVisitor(visitor, visitChildren); + visitedStyles.Add(style, null); + } + } + + public static readonly Styles BuildInStyles = new Styles(); + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Styles))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/TabStop.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/TabStop.cs new file mode 100644 index 0000000..7426723 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/TabStop.cs @@ -0,0 +1,143 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents a tab inside a paragraph. + /// + public class TabStop : DocumentObject + { + /// + /// Initializes a new instance of the TabStop class. + /// + public TabStop() + { } + + /// + /// Initializes a new instance of the TabStop class with the specified parent. + /// + public TabStop(DocumentObject parent) : base(parent) { } + + /// + /// Initializes a new instance of the TabStop class with the specified position. + /// + public TabStop(Unit position) + : this() + { + _position = position; + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new TabStop Clone() + { + return (TabStop)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets the tab stop position. + /// + public Unit Position + { + get { return _position; } + } + [DV] + public Unit _position = Unit.NullValue; // always defined + // useful enhancement: 'Position = Center' and 'Position = Right' + + /// + /// Gets or sets the alignment of the tabstop. + /// + public TabAlignment Alignment + { + get { return (TabAlignment)_alignment.Value; } + set { _alignment.Value = (int)value; } + } + [DV(Type = typeof(TabAlignment))] + public NEnum _alignment = NEnum.NullValue(typeof(TabAlignment)); + + /// + /// Gets or sets the character which is used as a leader for the tabstop. + /// + public TabLeader Leader + { + get { return (TabLeader)_leader.Value; } + set { _leader.Value = (int)value; } + } + [DV(Type = typeof(TabLeader))] + public NEnum _leader = NEnum.NullValue(typeof(TabLeader)); + + /// + /// Generates a '+=' in DDL if it is true, otherwise '-='. + /// + public bool AddTab = true; + #endregion + + #region public + /// + /// Converts TabStop into DDL. + /// + public override void Serialize(Serializer serializer) + { + if (AddTab) + { + serializer.WriteLine("TabStops +="); + serializer.BeginContent(); + serializer.WriteSimpleAttribute("Position", Position); + if (!_alignment.IsNull) + serializer.WriteSimpleAttribute("Alignment", Alignment); + if (!_leader.IsNull) + serializer.WriteSimpleAttribute("Leader", Leader); + serializer.EndContent(); + } + else + serializer.WriteLine("TabStops -= \"" + Position + "\""); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(TabStop))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/TabStops.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/TabStops.cs new file mode 100644 index 0000000..d7bf11c --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/TabStops.cs @@ -0,0 +1,247 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// A TabStops collection represents all TabStop objects in a paragraph. + /// + public class TabStops : DocumentObjectCollection + { + /// + /// Specifies the minimal spacing between two TabStop positions. + /// + public static readonly double TabStopPrecision = 1.5; + + /// + /// Initializes a new instance of the TabStops class. + /// + public TabStops() + { } + + /// + /// Initializes a new instance of the TabStops class with the specified parent. + /// + public TabStops(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new TabStops Clone() + { + return (TabStops)DeepCopy(); + } + + /// + /// Gets a TabStop by its index. + /// + public new TabStop this[int index] + { + get { return base[index] as TabStop; } + } + + /// + /// Gets a TabStop by its position. + /// Note that also Removed TabStops are taken into account. + /// + public TabStop GetTabStopAt(Unit position) + { + int count = Count; + for (int index = 0; index < count; index++) + { + TabStop tabStop = (TabStop)this[index]; + if (Math.Abs(tabStop.Position.Point - position.Point) < TabStopPrecision) + return tabStop; + } + return null; + } + + /// + /// Returns whether a TabStop exists at the given position. + /// Note that also Removed TabStops are taken into account + /// + public bool TabStopExists(Unit position) + { + return GetTabStopAt(position) != null; + } + + /// + /// Adds a TabStop object to the collection. If a TabStop with the same position + /// already exists, it is replaced by the new TabStop. + /// + public TabStop AddTabStop(TabStop tabStop) + { + if (tabStop == null) + throw new ArgumentNullException("tabStop"); + + if (TabStopExists(tabStop.Position)) + { + int index = IndexOf(GetTabStopAt(tabStop.Position)); + RemoveObjectAt(index); + InsertObject(index, tabStop); + } + else + { + int count = Count; + for (int index = 0; index < count; index++) + { + if (tabStop.Position.Point < ((TabStop)this[index]).Position.Point) + { + InsertObject(index, tabStop); + return tabStop; + } + } + Add(tabStop); + } + return tabStop; + } + + /// + /// Adds a TabStop object at the specified position to the collection. If a TabStop with the + /// same position already exists, it is replaced by the new TabStop. + /// + public TabStop AddTabStop(Unit position) + { + if (TabStopExists(position)) + return GetTabStopAt(position); + + TabStop tab = new TabStop(position); + return AddTabStop(tab); + } + + /// + /// Adds a TabStop object to the collection and sets its alignment and leader. + /// + public TabStop AddTabStop(Unit position, TabAlignment alignment, TabLeader leader) + { + TabStop tab = AddTabStop(position); + tab.Alignment = alignment; + tab.Leader = leader; + return tab; + } + + /// + /// Adds a TabStop object to the collection and sets its leader. + /// + public TabStop AddTabStop(Unit position, TabLeader leader) + { + TabStop tab = AddTabStop(position); + tab.Leader = leader; + return tab; + } + + /// + /// Adds a TabStop object to the collection and sets its alignment. + /// + public TabStop AddTabStop(Unit position, TabAlignment alignment) + { + TabStop tab = AddTabStop(position); + tab.Alignment = alignment; + return tab; + } + + /// + /// Adds a TabStop object to the collection marked to remove the tab stop at + /// the given position. + /// + public void RemoveTabStop(Unit position) + { + TabStop tab = AddTabStop(position); + tab.AddTab = false; + } + + /// + /// Clears all TabStop objects from the collection. Additionally 'TabStops = null' + /// is written to the DDL stream when serialized. + /// + public void ClearAll() + { + Clear(); + _fClearAll = true; + } + #endregion + + #region Properties + /// + /// Gets the information if the collection is marked as cleared. Additionally 'TabStops = null' + /// is written to the DDL stream when serialized. + /// + public bool TabsCleared + { + get { return _fClearAll; } + } + public bool _fClearAll = false; + #endregion + + #region public + /// + /// Converts TabStops into DDL. + /// + public override void Serialize(Serializer serializer) + { + if (_fClearAll) + serializer.WriteLine("TabStops = null"); + + int count = Count; + for (int index = 0; index < count; index++) + { + TabStop tabstop = this[index]; + tabstop.Serialize(serializer); + } + } + + /// + /// Determines whether this instance is null (not set). + /// + public override bool IsNull() + { + // Only non empty and not cleared tabstops (TabStops = null) are null. + if (base.IsNull()) + return !_fClearAll; + return false; + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(TabStops))); } + } + static Meta _meta; + #endregion + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Text.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Text.cs new file mode 100644 index 0000000..be2c071 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Text.cs @@ -0,0 +1,101 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents text in a paragraph. + /// + public class Text : DocumentObject + { + /// + /// Initializes a new instance of the Text class. + /// + public Text() + { } + + /// + /// Initializes a new instance of the Text class with the specified parent. + /// + public Text(DocumentObject parent) : base(parent) { } + + /// + /// Initializes a new instance of the Text class with a string as paragraph content. + /// + public Text(string content) + : this() + { + Content = content; + } + + /// + /// Creates a deep copy of this object. + /// + public new Text Clone() + { + return (Text)DeepCopy(); + } + + /// + /// Gets or sets the text content. + /// + public string Content + { + get { return _content.Value; } + set { _content.Value = value; } + } + [DV] + public NString _content = NString.NullValue; + + /// + /// Converts Text into DDL. + /// + public override void Serialize(Serializer serializer) + { + string text = DdlEncoder.StringToText(_content.Value); + // To make DDL more readable write soft hypens as keywords. + text = text.Replace(new string((char)173, 1), "\\-"); + serializer.Write(text); + } + + /// + /// Returns the meta object of this instance. + /// + public override Meta Meta + { + get { return _meta ?? (_meta = new Meta(typeof(Text))); } + } + static Meta _meta; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/TextMeasurement_delete.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/TextMeasurement_delete.cs new file mode 100644 index 0000000..bde5cdc --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/TextMeasurement_delete.cs @@ -0,0 +1,161 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2009 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if false +using System; +using System.Diagnostics; +using System.ComponentModel; +using System.Drawing; + +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Provides functionality to measure the width of text during document design time. + /// + public sealed class TextMeasurement + { + /// + /// Initializes a new instance of the TextMeasurement class with the specified font. + /// + public TextMeasurement(Font font) + { + if (font == null) + throw new ArgumentNullException("font"); + + this.font = font; + } + +#if !SILVERLIGHT + /// + /// Returns the size of the bounding box of the specified text. + /// + public System.Drawing.SizeF MeasureString(string text, UnitType unitType) + { + if (text == null) + throw new ArgumentNullException("text"); + + if (!Enum.IsDefined(typeof(UnitType), unitType)) + throw new InvalidEnumArgumentException(); + + System.Drawing.Graphics graphics = Realize(); + + SizeF size = graphics.MeasureString(text, this .gdiFont, new PointF(0, 0), System.Drawing.StringFormat.GenericTypographic); + switch (unitType) + { + case UnitType.Point: + break; + + case UnitType.Centimeter: + size.Width = (float)(size.Width * 2.54 / 72); + size.Height = (float)(size.Height * 2.54 / 72); + break; + + case UnitType.Inch: + size.Width = size.Width / 72; + size.Height = size.Height / 72; + break; + + case UnitType.Millimeter: + size.Width = (float)(size.Width * 25.4 / 72); + size.Height = (float)(size.Height * 25.4 / 72); + break; + + case UnitType.Pica: + size.Width = size.Width / 12; + size.Height = size.Height / 12; + break; + + default: + Debug.Assert(false, "Missing unit type"); + break; + } + return size; + } + + /// + /// Returns the size of the bounding box of the specified text in point. + /// + public SizeF MeasureString(string text) + { + return MeasureString(text, UnitType.Point); + } + + /// + /// Gets or sets the font used for measurement. + /// + public Font Font + { + get { return this .font; } + set + { + if (value == null) + throw new ArgumentNullException("value"); + if (this .font != value) + { + this .font = value; + this .gdiFont = null; + } + } + } + Font font; + + /// + /// Initializes appropriate GDI+ objects. + /// + Graphics Realize() + { + if (this .graphics == null) + this .graphics = Graphics.FromHwnd(IntPtr.Zero); + + this .graphics.PageUnit = GraphicsUnit.Point; + + if (this .gdiFont == null) + { + System.Drawing.FontStyle style = System.Drawing.FontStyle.Regular; + if (this .font.Bold) + style |= System.Drawing.FontStyle.Bold; + if (this .font.Italic) + style |= System.Drawing.FontStyle.Italic; + + this .gdiFont = new System.Drawing.Font(this.font.Name, this.font.Size, style, System.Drawing.GraphicsUnit.Point); + } + return this .graphics; + } + + System.Drawing.Font gdiFont; + System.Drawing.Graphics graphics; +#endif + } +} +#endif \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/Unit.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Unit.cs new file mode 100644 index 0000000..96a867c --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/Unit.cs @@ -0,0 +1,766 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// A Unit consists of a numerical value and a UnitType like Centimeter, Millimeter, or Inch. + /// Several conversions between different measures are supported. + /// + public struct Unit : IFormattable, INullableValue + { + /// + /// Initializes a new instance of the Unit class with type set to point. + /// + public Unit(double point) + { + _value = (float)point; + _type = UnitType.Point; + _initialized = true; + } + + /// + /// Initializes a new instance of the Unit class. + /// Throws System.ArgumentException if type is invalid. + /// + public Unit(double value, UnitType type) + { + if (!Enum.IsDefined(typeof(UnitType), type)) + throw new /*InvalidEnum*/ArgumentException(DomSR.InvalidEnumValue(type), "type"); + + _value = (float)value; + _type = type; + _initialized = true; + } + + /// + /// Determines whether this instance is empty. + /// + public bool IsEmpty + { + get { return IsNull; } + } + + /// + /// Gets the value of the unit. + /// + object INullableValue.GetValue() + { + return this; + } + + /// + /// Sets the unit to the given value. + /// + void INullableValue.SetValue(object value) + { + if (value == null) + throw new ArgumentNullException("value"); + + if (value is Unit) + this = (Unit)value; + else + this = value.ToString(); + } + + /// + /// Resets this instance, + /// i.e. IsNull() will return true afterwards. + /// + void INullableValue.SetNull() + { + _value = 0; + _type = UnitType.Point; + _initialized = false; + } + + // Explicit interface implementations cannot contain access specifiers, i.e. they are accessible by a + // cast operator only, e.g. ((IDomValue)obj).IsNull. + // Therefore the second IsNull-Property is used as a handy shortcut. + /// + /// Determines whether this instance is null (not set). + /// + bool INullableValue.IsNull + { + get { return IsNull; } + } + + /// + /// Determines whether this instance is null (not set). + /// + public bool IsNull + { + get { return !_initialized; } + } + + #region Properties + /// + /// Gets or sets the raw value of the object without any conversion. + /// To determine the UnitType use property Type. + /// + public double Value + { + get { return (IsNull ? 0 : _value); } + set + { + _value = (float)value; + _initialized = true; + } + } + + /// + /// Gets the UnitType of the object. + /// + public UnitType Type + { + get { return _type; } + set { _type = value; } + } + + /// + /// Gets or sets the value in point. + /// + public double Point + { + get + { + if (IsNull) + return 0; + + switch (_type) + { + case UnitType.Centimeter: + return _value * 72 / 2.54; + + case UnitType.Inch: + return _value * 72; + + case UnitType.Millimeter: + return _value * 72 / 25.4; + + case UnitType.Pica: + return _value * 12; + + case UnitType.Point: + return _value; + + default: + Debug.Assert(false, "Missing unit type."); + return 0; + } + } + set + { + _value = (float)value; + _type = UnitType.Point; + _initialized = true; + } + } + + //[Obsolete("Use Point")] + //public double Pt + //{ + // get { return Point; } + // set { Point = value; } + //} + + /// + /// Gets or sets the value in centimeter. + /// + public double Centimeter + { + get + { + if (IsNull) + return 0; + + switch (_type) + { + case UnitType.Centimeter: + return _value; + + case UnitType.Inch: + return _value * 2.54; + + case UnitType.Millimeter: + return _value / 10; + + case UnitType.Pica: + return _value * 12 * 2.54 / 72; + + case UnitType.Point: + return _value * 2.54 / 72; + + default: + Debug.Assert(false, "Missing unit type"); + return 0; + } + } + set + { + _value = (float)value; + _type = UnitType.Centimeter; + _initialized = true; + } + } + + //[Obsolete("Use Centimeter")] + //public double Cm + //{ + // get { return Centimeter; } + // set { Centimeter = value; } + //} + + /// + /// Gets or sets the value in inch. + /// + public double Inch + { + get + { + if (IsNull) + return 0; + + switch (_type) + { + case UnitType.Centimeter: + return _value / 2.54; + + case UnitType.Inch: + return _value; + + case UnitType.Millimeter: + return _value / 25.4; + + case UnitType.Pica: + return _value * 12 / 72; + + case UnitType.Point: + return _value / 72; + + default: + Debug.Assert(false, "Missing unit type"); + return 0; + } + } + set + { + _value = (float)value; + _type = UnitType.Inch; + _initialized = true; + } + } + + //[Obsolete("Use Inch")] + //public double In + //{ + // get { return Inch; } + // set { Inch = value; } + //} + + /// + /// Gets or sets the value in millimeter. + /// + public double Millimeter + { + get + { + if (IsNull) + return 0; + + switch (_type) + { + case UnitType.Centimeter: + return _value * 10; + + case UnitType.Inch: + return _value * 25.4; + + case UnitType.Millimeter: + return _value; + + case UnitType.Pica: + return _value * 12 * 25.4 / 72; + + case UnitType.Point: + return _value * 25.4 / 72; + + default: + Debug.Assert(false, "Missing unit type"); + return 0; + } + } + set + { + _value = (float)value; + _type = UnitType.Millimeter; + _initialized = true; + } + } + + //[Obsolete("Use Millimeter")] + //public double Mm + //{ + // get { return Millimeter; } + // set { Millimeter = value; } + //} + + /// + /// Gets or sets the value in pica. + /// + public double Pica + { + get + { + if (IsNull) + return 0; + + switch (_type) + { + case UnitType.Centimeter: + return _value * 72 / 2.54 / 12; + + case UnitType.Inch: + return _value * 72 / 12; + + case UnitType.Millimeter: + return _value * 72 / 25.4 / 12; + + case UnitType.Pica: + return _value; + + case UnitType.Point: + return _value / 12; + + default: + Debug.Assert(false, "Missing unit type"); + return 0; + } + } + set + { + _value = (float)value; + _type = UnitType.Pica; + _initialized = true; + } + } + + //[Obsolete("Use Pica")] + //public double Pc + //{ + // get { return Pica; } + // set { Pica = value; } + //} + #endregion + + #region Methods + /// + /// Returns the object as string using the format information. + /// Measure will be added to the end of the string. + /// + public string ToString(System.IFormatProvider formatProvider) + { + if (IsNull) + return 0.ToString(formatProvider); + + string valuestring = _value.ToString(formatProvider) + GetSuffix(); + return valuestring; + } + + /// + /// Returns the object as string using the format. + /// Measure will be added to the end of the string. + /// + public string ToString(string format) + { + if (IsNull) + return 0.ToString(format); + + string valuestring = _value.ToString(format) + GetSuffix(); + return valuestring; + } + + /// + /// Returns the object as string using the specified format and format information. + /// Measure will be added to the end of the string. + /// + string IFormattable.ToString(string format, IFormatProvider formatProvider) + { + if (IsNull) + return 0.ToString(format, formatProvider); + + string valuestring = _value.ToString(format, formatProvider) + GetSuffix(); + return valuestring; + } + + /// + /// Returns the object as string. Measure will be added to the end of the string. + /// + public override string ToString() + { + if (IsNull) + return 0.ToString(System.Globalization.CultureInfo.InvariantCulture); + + string valuestring = _value.ToString(System.Globalization.CultureInfo.InvariantCulture) + GetSuffix(); + return valuestring; + } + + /// + /// Returns the type of the object as a string like 'pc', 'cm', or 'in'. Empty string is equal to 'pt'. + /// + string GetSuffix() + { + switch (_type) + { + case UnitType.Centimeter: + return "cm"; + + case UnitType.Inch: + return "in"; + + case UnitType.Millimeter: + return "mm"; + + case UnitType.Pica: + return "pc"; + + case UnitType.Point: + //Point is default, so leave this blank. + return ""; + + default: + Debug.Assert(false, "Missing unit type"); + return ""; + } + } + + /// + /// Returns a Unit object. Sets type to centimeter. + /// + public static Unit FromCentimeter(double value) + { + Unit unit = Unit.Zero; + unit._value = (float)value; + unit._type = UnitType.Centimeter; + return unit; + } + + //[Obsolete("Use FromCentimer")] + //public static Unit FromCm(double value) + //{ + // return FromCentimeter(value); + //} + + /// + /// Returns a Unit object. Sets type to millimeter. + /// + public static Unit FromMillimeter(double value) + { + Unit unit = Unit.Zero; + unit._value = (float)value; + unit._type = UnitType.Millimeter; + return unit; + } + + ///// + ///// Returns a Unit object. Sets type to millimeter. + ///// + //[Obsolete("Use FromMillimeter")] + //public static Unit FromMm(double value) + //{ + // return FromMillimeter(value); + //} + + /// + /// Returns a Unit object. Sets type to point. + /// + public static Unit FromPoint(double value) + { + Unit unit = Unit.Zero; + unit._value = (float)value; + unit._type = UnitType.Point; + return unit; + } + + /// + /// Returns a Unit object. Sets type to inch. + /// + public static Unit FromInch(double value) + { + Unit unit = Unit.Zero; + unit._value = (float)value; + unit._type = UnitType.Inch; + return unit; + } + + /// + /// Returns a Unit object. Sets type to pica. + /// + public static Unit FromPica(double value) + { + Unit unit = Unit.Zero; + unit._value = (float)value; + unit._type = UnitType.Pica; + return unit; + } + #endregion + + /// + /// Converts a string to a Unit object. + /// If the string contains a suffix like 'cm' or 'in' the object will be converted + /// to the appropriate type, otherwise point is assumed. + /// + public static implicit operator Unit(string value) + { + Unit unit = Zero; + value = value.Trim(); + + // For Germans... + value = value.Replace(',', '.'); + + int count = value.Length; + int valLen = 0; + for (; valLen < count; ) + { + char ch = value[valLen]; + if (ch == '.' || ch == '-' || ch == '+' || Char.IsNumber(ch)) + valLen++; + else + break; + } + + unit._value = 1; + try + { + unit._value = float.Parse(value.Substring(0, valLen).Trim(), System.Globalization.CultureInfo.InvariantCulture); + } + catch (FormatException ex) + { + throw new ArgumentException(DomSR.InvalidUnitValue(value), ex); + } + + string typeStr = value.Substring(valLen).Trim().ToLower(); + unit._type = UnitType.Point; + switch (typeStr) + { + case "cm": + unit._type = UnitType.Centimeter; + break; + + case "in": + unit._type = UnitType.Inch; + break; + + case "mm": + unit._type = UnitType.Millimeter; + break; + + case "pc": + unit._type = UnitType.Pica; + break; + + case "": + case "pt": + unit._type = UnitType.Point; + break; + + default: + throw new ArgumentException(DomSR.InvalidUnitType(typeStr)); + } + + return unit; + } + + /// + /// Converts an int to a Unit object with type set to point. + /// + public static implicit operator Unit(int value) + { + Unit unit = Zero; + unit._value = value; + unit._type = UnitType.Point; + return unit; + } + + /// + /// Converts a float to a Unit object with type set to point. + /// + public static implicit operator Unit(float value) + { + Unit unit = Zero; + unit._value = value; + unit._type = UnitType.Point; + return unit; + } + + /// + /// Converts a double to a Unit object with type set to point. + /// + public static implicit operator Unit(double value) + { + Unit unit = Zero; + unit._value = (float)value; + unit._type = UnitType.Point; + return unit; + } + + /// + /// Returns a double value as point. + /// + public static implicit operator double(Unit value) + { + return value.Point; + } + + /// + /// Returns a float value as point. + /// + public static implicit operator float(Unit value) + { + return (float)value.Point; + } + + /// + /// Memberwise comparison. To compare by value, + /// use code like Math.Abs(a.Point - b.Point) < 1e-5. + /// + public static bool operator ==(Unit l, Unit r) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + return (l._initialized == r._initialized && l._type == r._type && l._value == r._value); + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Memberwise comparison. To compare by value, + /// use code like Math.Abs(a.Point - b.Point) < 1e-5. + /// + public static bool operator !=(Unit l, Unit r) + { + return !(l == r); + } + + /// + /// Calls base class Equals. + /// + public override bool Equals(Object obj) + { + return base.Equals(obj); + } + + /// + /// Calls base class GetHashCode. + /// + public override int GetHashCode() + { + return base.GetHashCode(); + } + + /// + /// This member is intended to be used by XmlDomainObjectReader only. + /// + public static Unit Parse(string value) + { + Unit unit = Zero; + unit = value; + return unit; + } + + /// + /// Converts an existing object from one unit into another unit type. + /// + public void ConvertType(UnitType type) + { + if (_type == type) + return; + + switch (type) + { + case UnitType.Centimeter: + _value = (float)Centimeter; + _type = UnitType.Centimeter; + break; + + case UnitType.Inch: + _value = (float)Inch; + _type = UnitType.Inch; + break; + + case UnitType.Millimeter: + _value = (float)Millimeter; + _type = UnitType.Millimeter; + break; + + case UnitType.Pica: + _value = (float)Pica; + _type = UnitType.Pica; + break; + + case UnitType.Point: + _value = (float)Point; + _type = UnitType.Point; + break; + + default: + if (!Enum.IsDefined(typeof(UnitType), type)) + throw new ArgumentException(DomSR.InvalidUnitType(type.ToString())); + + // Remember missing unit type. + Debug.Assert(false, "Missing unit type"); + break; + } + } + + /// + /// Represents the uninitialized Unit object. + /// + public static readonly Unit Empty = new Unit(); + + /// + /// Represents an initialized Unit object with value 0 and unit type point. + /// + public static readonly Unit Zero = new Unit(0); + + /// + /// Represents the uninitialized Unit object. Same as Unit.Empty. + /// + public static readonly Unit NullValue = Empty; + + bool _initialized; + float _value; + UnitType _type; + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/BorderStyle.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/BorderStyle.cs new file mode 100644 index 0000000..5375970 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/BorderStyle.cs @@ -0,0 +1,96 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Specifies the style of the line of the Border object. + /// + public enum BorderStyle + { + /// + /// No border. + /// + None, + + /// + /// A single solid line. + /// + Single, + + /// + /// A dotted line. + /// + Dot, + + /// + /// A dashed line (small gaps). + /// + DashSmallGap, + + /// + /// A dashed line (large gaps). + /// + DashLargeGap, + + /// + /// Alternating dashes and dots. + /// + DashDot, + + /// + /// A dash followed by two dots. + /// + DashDotDot, + + /* --- unsupported --- + Double = 7, + Triple = 8, + ThinThickSmallGap = 9, + ThickThinSmallGap = 10, + ThinThickThinSmallGap = 11, + ThinThickMedGap = 12, + ThickThinMedGap = 13, + ThinThickThinMedGap = 14, + ThinThickLargeGap = 15, + ThickThinLargeGap = 16, + ThinThickThinLargeGap = 17, + SingleWavy = 18, + DoubleWavy = 19, + DashDotStroked = 20, + Emboss3D = 21, + Engrave3D = 22, + LineStyleOutset = 23, //!!!newEG 02-07-22 + LineStyleInset = 24 //!!!newEG 02-07-22 + */ + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/BorderType.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/BorderType.cs new file mode 100644 index 0000000..e09c87d --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/BorderType.cs @@ -0,0 +1,51 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Specifies the type of the Border object and therefore its position. + /// + public enum BorderType + { + Top, + Left, + Bottom, + Right, + Horizontal, // not used in MigraDoc 1.2 + Vertical, // not used in MigraDoc 1.2 + DiagonalDown, + DiagonalUp + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/BreakType.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/BreakType.cs new file mode 100644 index 0000000..e1ad5ca --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/BreakType.cs @@ -0,0 +1,55 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Specifies the page break in a new section. + /// + public enum BreakType + { + /// + /// Breaks at the next page. + /// + BreakNextPage, + + /// + /// Breaks at the next even page. + /// + BreakEvenPage, + + /// + /// Breaks at the next odd page. + /// + BreakOddPage + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/ColorName.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/ColorName.cs new file mode 100644 index 0000000..62002f7 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/ColorName.cs @@ -0,0 +1,182 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// public color names. + /// + enum ColorName : uint + { + AliceBlue = 0xFFF0F8FF, + AntiqueWhite = 0xFFFAEBD7, + Aqua = 0xFF00FFFF, + Aquamarine = 0xFF7FFFD4, + Azure = 0xFFF0FFFF, + Beige = 0xFFF5F5DC, + Bisque = 0xFFFFE4C4, + Black = 0xFF000000, + BlanchedAlmond = 0xFFFFEBCD, + Blue = 0xFF0000FF, + BlueViolet = 0xFF8A2BE2, + Brown = 0xFFA52A2A, + BurlyWood = 0xFFDEB887, + CadetBlue = 0xFF5F9EA0, + Chartreuse = 0xFF7FFF00, + Chocolate = 0xFFD2691E, + Coral = 0xFFFF7F50, + CornflowerBlue = 0xFF6495ED, + Cornsilk = 0xFFFFF8DC, + Crimson = 0xFFDC143C, + Cyan = 0xFF00FFFF, + DarkBlue = 0xFF00008B, + DarkCyan = 0xFF008B8B, + DarkGoldenrod = 0xFFB8860B, + DarkGray = 0xFFA9A9A9, + DarkGreen = 0xFF006400, + DarkKhaki = 0xFFBDB76B, + DarkMagenta = 0xFF8B008B, + DarkOliveGreen = 0xFF556B2F, + DarkOrange = 0xFFFF8C00, + DarkOrchid = 0xFF9932CC, + DarkRed = 0xFF8B0000, + DarkSalmon = 0xFFE9967A, + DarkSeaGreen = 0xFF8FBC8B, + DarkSlateBlue = 0xFF483D8B, + DarkSlateGray = 0xFF2F4F4F, + DarkTurquoise = 0xFF00CED1, + DarkViolet = 0xFF9400D3, + DeepPink = 0xFFFF1493, + DeepSkyBlue = 0xFF00BFFF, + DimGray = 0xFF696969, + DodgerBlue = 0xFF1E90FF, + Firebrick = 0xFFB22222, + FloralWhite = 0xFFFFFAF0, + ForestGreen = 0xFF228B22, + Fuchsia = 0xFFFF00FF, + Gainsboro = 0xFFDCDCDC, + GhostWhite = 0xFFF8F8FF, + Gold = 0xFFFFD700, + Goldenrod = 0xFFDAA520, + Gray = 0xFF808080, + Green = 0xFF008000, + GreenYellow = 0xFFADFF2F, + Honeydew = 0xFFF0FFF0, + HotPink = 0xFFFF69B4, + IndianRed = 0xFFCD5C5C, + Indigo = 0xFF4B0082, + Ivory = 0xFFFFFFF0, + Khaki = 0xFFF0E68C, + Lavender = 0xFFE6E6FA, + LavenderBlush = 0xFFFFF0F5, + LawnGreen = 0xFF7CFC00, + LemonChiffon = 0xFFFFFACD, + LightBlue = 0xFFADD8E6, + LightCoral = 0xFFF08080, + LightCyan = 0xFFE0FFFF, + LightGoldenrodYellow = 0xFFFAFAD2, + LightGray = 0xFFD3D3D3, + LightGreen = 0xFF90EE90, + LightPink = 0xFFFFB6C1, + LightSalmon = 0xFFFFA07A, + LightSeaGreen = 0xFF20B2AA, + LightSkyBlue = 0xFF87CEFA, + LightSlateGray = 0xFF778899, + LightSteelBlue = 0xFFB0C4DE, + LightYellow = 0xFFFFFFE0, + Lime = 0xFF00FF00, + LimeGreen = 0xFF32CD32, + Linen = 0xFFFAF0E6, + Magenta = 0xFFFF00FF, + Maroon = 0xFF800000, + MediumAquamarine = 0xFF66CDAA, + MediumBlue = 0xFF0000CD, + MediumOrchid = 0xFFBA55D3, + MediumPurple = 0xFF9370DB, + MediumSeaGreen = 0xFF3CB371, + MediumSlateBlue = 0xFF7B68EE, + MediumSpringGreen = 0xFF00FA9A, + MediumTurquoise = 0xFF48D1CC, + MediumVioletRed = 0xFFC71585, + MidnightBlue = 0xFF191970, + MintCream = 0xFFF5FFFA, + MistyRose = 0xFFFFE4E1, + Moccasin = 0xFFFFE4B5, + NavajoWhite = 0xFFFFDEAD, + Navy = 0xFF000080, + OldLace = 0xFFFDF5E6, + Olive = 0xFF808000, + OliveDrab = 0xFF6B8E23, + Orange = 0xFFFFA500, + OrangeRed = 0xFFFF4500, + Orchid = 0xFFDA70D6, + PaleGoldenrod = 0xFFEEE8AA, + PaleGreen = 0xFF98FB98, + PaleTurquoise = 0xFFAFEEEE, + PaleVioletRed = 0xFFDB7093, + PapayaWhip = 0xFFFFEFD5, + PeachPuff = 0xFFFFDAB9, + Peru = 0xFFCD853F, + Pink = 0xFFFFC0CB, + Plum = 0xFFDDA0DD, + PowderBlue = 0xFFB0E0E6, + Purple = 0xFF800080, + Red = 0xFFFF0000, + RosyBrown = 0xFFBC8F8F, + RoyalBlue = 0xFF4169E1, + SaddleBrown = 0xFF8B4513, + Salmon = 0xFFFA8072, + SandyBrown = 0xFFF4A460, + SeaGreen = 0xFF2E8B57, + SeaShell = 0xFFFFF5EE, + Sienna = 0xFFA0522D, + Silver = 0xFFC0C0C0, + SkyBlue = 0xFF87CEEB, + SlateBlue = 0xFF6A5ACD, + SlateGray = 0xFF708090, + Snow = 0xFFFFFAFA, + SpringGreen = 0xFF00FF7F, + SteelBlue = 0xFF4682B4, + Tan = 0xFFD2B48C, + Teal = 0xFF008080, + Thistle = 0xFFD8BFD8, + Tomato = 0xFFFF6347, + Transparent = 0x00FFFFFF, + Turquoise = 0xFF40E0D0, + Violet = 0xFFEE82EE, + Wheat = 0xFFF5DEB3, + White = 0xFFFFFFFF, + WhiteSmoke = 0xFFF5F5F5, + Yellow = 0xFFFFFF00, + YellowGreen = 0xFF9ACD32 + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/DomMsgID.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/DomMsgID.cs new file mode 100644 index 0000000..d76233d --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/DomMsgID.cs @@ -0,0 +1,166 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents ids for error and diagnostic messages generated by the MigraDoc DOM. + /// + public enum DomMsgID + { + // ----- General Messages --------------------------------------------------------------------- + StyleExpected, + BaseStyleRequired, + EmptyBaseStyle, + InvalidFieldFormat, + InvalidInfoFieldName, + UndefinedBaseStyle, + InvalidUnitValue, + InvalidUnitType, + InvalidEnumValue, + InvalidEnumForLeftPosition, + InvalidEnumForTopPosition, + InvalidColorString, + InvalidFontSize, + InsertNullNotAllowed, + ParentAlreadySet, + MissingObligatoryProperty, + InvalidDocumentObjectType, + + // ----- DdlReader Messages ------------------------------------------------------------------- + + Success = 1000, + + SymbolExpected, + SymbolsExpected, + OperatorExpected, + KeyWordExpected, + EndOfFileExpected, + UnexpectedEndOfFile, + + StyleNameExpected, + + // --- old --- + // public, + + UnexpectedSymbol, + + IdentifierExpected, + BoolExpected, + RealExpected, + IntegerExpected, + // IntegerOrIdentifierExpected, + StringExpected, + NullExpected, + // SymboleExpected, + NumberExpected, + + InvalidEnum, + // InvalidFlag, + // InvalidStyle, + // InvalidStyleDefinition, + InvalidType, + InvalidAssignment, + InvalidValueName, + // InvalidOperation, + // InvalidFormat, + InvalidRange, + InvalidColor, + InvalidFieldType, + InvalidValueForOperation, + InvalidSymbolType, + + // ValueOutOfRange, + + MissingBraceLeft, + MissingBraceRight, + MissingBracketLeft, + MissingBracketRight, + MissingParenLeft, + MissingParenRight, + // MissingSemicolon, + MissingComma, + + // MissingDocumentPart, + // MissingEof, + // MissingIdentifier, + // MissingEndBuildingBlock, + // MissingSymbole, + // MissingParameter, + + SymbolNotAllowed, + SymbolIsNotAnObject, + // BlockcommentOutsideCodeBlock, + // EOFReachedMissingSymbole, + // UnexpectedEOFReached, + // StyleAlreadyDefined, + // MultipleDefaultInSwitch, + // UnexpectedNewlineInDirective, + // UnexpectedSymboleInDirective, + + // UnknownUnitOfMeasure, + // UnknownValueOperator, + // UnknownCodeSymbole, + // UnknownScriptSymbole, + // UnknownFieldSpecifier, + // UnknownFieldOption, + // UnknownValueType, + // UnknownEvaluationType, + // UnknownColorFunction, + // UnknownAxis, + UnknownChartType, + + // MisplacedCompilerSettings, + // MisplacedScopeType, + // TooMuchCells, + NoAccess, + + // FileNotFound, + // NotSupported, + + NewlineInString, + EscapeSequenceNotAllowed, + // SymboleNotAllowedInsideText, + NullAssignmentNotSupported, + OutOfRange, + + // Warning_StyleOverwrittenMoreThanOnce, + // Warning_StyleAndBaseStyleAreEqual, + // Warning_NestedParagraphInParagraphToken, + UseOfUndefinedBaseStyle, + UseOfUndefinedStyle, + + // NestedFootnote, + // ImageInFootnote, + // ShapeInFootnote + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/FontProperties.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/FontProperties.cs new file mode 100644 index 0000000..a0f3527 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/FontProperties.cs @@ -0,0 +1,55 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Specifies the properties for the font. + /// FOR public USE ONLY. + /// + [Flags] + enum FontProperties + { + None = 0x0000, + Name = 0x0001, + Size = 0x0002, + Bold = 0x0004, + Italic = 0x0008, + Underline = 0x0010, + Color = 0x0020, + Border = 0x0040, + Superscript = 0x0080, + Subscript = 0x0100, + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/FootnoteLocation.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/FootnoteLocation.cs new file mode 100644 index 0000000..a9a859c --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/FootnoteLocation.cs @@ -0,0 +1,50 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Determines the position of the footnote on the page. + /// + public enum FootnoteLocation + { + /// + /// Footnote will be rendered on the bottom of the page. + /// + BottomOfPage, + + /// + /// Footnote will be rendered immediately after the text. + /// + BeneathText + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/FootnoteNumberStyle.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/FootnoteNumberStyle.cs new file mode 100644 index 0000000..4f659d5 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/FootnoteNumberStyle.cs @@ -0,0 +1,65 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Determines the format of the footnote number. + /// + public enum FootnoteNumberStyle + { + /// + /// Numbering like: 1, 2, 3, 4. + /// + Arabic, + + /// + /// Lower case letters like: a, b, c, d. + /// + LowercaseLetter, + + /// + /// Upper case letters like: A, B, C, D. + /// + UppercaseLetter, + + /// + /// Lower case roman numbers: i, ii, iii, iv. + /// + LowercaseRoman, + + /// + /// Upper case roman numbers: I, II, III, IV. + /// + UppercaseRoman + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/FootnoteNumberingRule.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/FootnoteNumberingRule.cs new file mode 100644 index 0000000..84c3f75 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/FootnoteNumberingRule.cs @@ -0,0 +1,55 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Determines the behavior of the footnote numbering. + /// + public enum FootnoteNumberingRule + { + /// + /// Numbering of the footnote restarts on each page. + /// + RestartPage, + + /// + /// Numbering does not restart, each new footnote number will be incremented by 1. + /// + RestartContinuous, + + /// + /// Numbering of the footnote restarts on each section. + /// + RestartSection + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/HeaderFooterIndex.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/HeaderFooterIndex.cs new file mode 100644 index 0000000..142be19 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/HeaderFooterIndex.cs @@ -0,0 +1,55 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Index to the three HeaderFooter objects of a HeadersFooters collection. + /// + public enum HeaderFooterIndex + { + /// + /// Header or footer which is primarily used. + /// + Primary = 0, + + /// + /// Header or footer for the first page of the section. + /// + FirstPage = 1, + + /// + /// Header or footer for the even pages of the section. + /// + EvenPage = 2 + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/HyperlinkType.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/HyperlinkType.cs new file mode 100644 index 0000000..9ddd078 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/HyperlinkType.cs @@ -0,0 +1,65 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Specifies the target of the hyperlink. + /// + public enum HyperlinkType + { + /// + /// Targets a position in the document. Same as 'Bookmark'. + /// + Local = 0, + + /// + /// Targets a position in the document. Same as 'Local'. + /// + Bookmark = Local, + + /// + /// Targets a resource on the Internet or network. Same as 'Url'. + /// + Web, + + /// + /// Targets a resource on the Internet or network. Same as 'Web'. + /// + Url = Web, + + /// + /// Targets a physical file. + /// + File + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/LineSpacingRule.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/LineSpacingRule.cs new file mode 100644 index 0000000..889774a --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/LineSpacingRule.cs @@ -0,0 +1,49 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Specifies the space between lines in a paragraph. + /// + public enum LineSpacingRule + { + Single, + OnePtFive, + Double, + AtLeast, + Exactly, + Multiple + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/ListType.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/ListType.cs new file mode 100644 index 0000000..9718d83 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/ListType.cs @@ -0,0 +1,49 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Specifies the symbol or kind of numbering of the list. + /// + public enum ListType + { + BulletList1, + BulletList2, + BulletList3, + NumberList1, + NumberList2, + NumberList3 + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/Orientation.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/Orientation.cs new file mode 100644 index 0000000..4bffaf3 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/Orientation.cs @@ -0,0 +1,50 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Specifies the page orientation. + /// + public enum Orientation + { + /// + /// Page height is bigger than page width. + /// + Portrait, + + /// + /// Page width is bigger than page height. + /// + Landscape + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/OutlineLevel.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/OutlineLevel.cs new file mode 100644 index 0000000..64e6789 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/OutlineLevel.cs @@ -0,0 +1,53 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Specifies the level of a paragraph. + /// + public enum OutlineLevel + { + BodyText, + Level1, + Level2, + Level3, + Level4, + Level5, + Level6, + Level7, + Level8, + Level9, + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/PageFormat.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/PageFormat.cs new file mode 100644 index 0000000..70fe623 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/PageFormat.cs @@ -0,0 +1,55 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Standard page sizes. + /// + public enum PageFormat + { + A0, + A1, + A2, + A3, + A4, + A5, + A6, + B5, + Letter, + Legal, + Ledger, + P11x17 + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/ParagraphAlignment.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/ParagraphAlignment.cs new file mode 100644 index 0000000..cf774bb --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/ParagraphAlignment.cs @@ -0,0 +1,47 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Specifies the alignment of a paragraph. + /// + public enum ParagraphAlignment + { + Left, + Center, + Right, + Justify, + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/StyleType.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/StyleType.cs new file mode 100644 index 0000000..26c57c9 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/StyleType.cs @@ -0,0 +1,50 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Specifies the type of a Style object. + /// + public enum StyleType + { + /// + /// Style is a paragraph style. + /// + Paragraph, + + /// + /// Style is a character style. Contains font part only. + /// + Character + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/SymbolName.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/SymbolName.cs new file mode 100644 index 0000000..336651c --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/SymbolName.cs @@ -0,0 +1,69 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Represents the type of the special character. + /// + public enum SymbolName : uint + { + // \space(...) + Blank = 0xF1000001, + En = 0xF1000002, + Em = 0xF1000003, + EmQuarter = 0xF1000004, + Em4 = EmQuarter, + + // used to serialize as \tab, \linebreak + Tab = 0xF2000001, + LineBreak = 0xF4000001, + + // for public use only + ParaBreak = 0xF4000007, + //MarginBreak = 0xF4000002, + + // \symbol(...) + Euro = 0xF8000001, + Copyright = 0xF8000002, + Trademark = 0xF8000003, + RegisteredTrademark = 0xF8000004, + Bullet = 0xF8000005, + Not = 0xF8000006, + EmDash = 0xF8000007, + EnDash = 0xF8000008, + NonBreakableBlank = 0xF8000009, + HardBlank = NonBreakableBlank, + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/TabAlignment.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/TabAlignment.cs new file mode 100644 index 0000000..1492588 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/TabAlignment.cs @@ -0,0 +1,63 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Determines the alignment of the tab. + /// + public enum TabAlignment + { + /// + /// Tab will be left aligned. + /// + Left, + + /// + /// Tab will be centered. + /// + Center, + + /// + /// Tab will be right aligned. + /// + Right, + + /// + /// Positioned at the last dot or comma. + /// + Decimal, + + //Bar = 4, // MigraDoc 2.0 + //List = 6, // MigraDoc 2.0 + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/TabLeader.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/TabLeader.cs new file mode 100644 index 0000000..b9ecf18 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/TabLeader.cs @@ -0,0 +1,70 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Used to determine the leader for the tab. + /// + public enum TabLeader + { + /// + /// Blanks are used as leader. + /// + Spaces, + + /// + /// Dots at the baseline. + /// + Dots, + + /// + /// Dashes are used as leader. + /// + Dashes, + + /// + /// Same as Heavy. + /// + Lines, + + /// + /// Leader will be underlined. + /// + Heavy, + + /// + /// Dots in the middle (vertical) of the line. + /// + MiddleDot + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/TextFormat.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/TextFormat.cs new file mode 100644 index 0000000..5b1164d --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/TextFormat.cs @@ -0,0 +1,74 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Specifies the format of a text. + /// Bold, Italic, or Underline will be ignored if NotBold, NotItalic, or NoUnderline respectively are specified at the same time. + /// + [Flags] + public enum TextFormat + { + /// + /// Specifies bold text (heavy font weight). + /// + Bold = 0x000001, + + /// + /// Specifies normal font weight. + /// + NotBold = 0x000003, + + /// + /// Specifies italic text. + /// + Italic = 0x000004, + + /// + /// Specifies upright text. + /// + NotItalic = 0x00000C, + + /// + /// Specifies underlined text. + /// + Underline = 0x000010, + + /// + /// Specifies text without underline. + /// + NoUnderline = 0x000030 + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/Underline.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/Underline.cs new file mode 100644 index 0000000..79292e9 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/Underline.cs @@ -0,0 +1,64 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +namespace MigraDoc.DocumentObjectModel +{ + /// + /// Specifies the underline type for the font. + /// + public enum Underline + { + None, + Single, + Words, + Dotted, + Dash, + DotDash, + DotDotDash, + + /* --- unsupported --- + Double = 3, + Thick = 6, + Wavy = 11, + WavyHeavy = 27, + DottedHeavy = 20, + DashHeavy = 23, + DotDashHeavy = 25, + DotDotDashHeavy = 26, + DashLong = 39, + DashLongHeavy = 55, + WavyDouble = 43 + */ + } +} diff --git a/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/UnitType.cs b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/UnitType.cs new file mode 100644 index 0000000..cd89f0f --- /dev/null +++ b/MigraDoc.DocumentObjectModel/DocumentObjectModel/enums/UnitType.cs @@ -0,0 +1,66 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange +// Klaus Potzesny +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.DocumentObjectModel +{ + + /// + /// Specifies the measure of a Unit object. + /// + public enum UnitType + { + /// + /// Measure is in points. A point represents 1/72 of an inch. + /// + Point = 0, // Default for new Unit() is Point + + /// + /// Measure is in centimeter. + /// + Centimeter = 1, + + /// + /// Measure is in inch. + /// + Inch = 2, + + /// + /// Measure is in millimeter. + /// + Millimeter = 3, + + /// + /// Measure is in picas. A pica represents 12 points, i.e. 6 pica are one inch. + /// + Pica = 4, + } +} diff --git a/MigraDoc.DocumentObjectModel/MigraDoc.DocumentObjectModel.csproj b/MigraDoc.DocumentObjectModel/MigraDoc.DocumentObjectModel.csproj new file mode 100644 index 0000000..a722552 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/MigraDoc.DocumentObjectModel.csproj @@ -0,0 +1,27 @@ + + + + 3.0.0.0 + netstandard2.0 + $(DefineConstants);CORE;CORE_WITH_GDI + MigraDoc.DocumentObjectModel + MigraDoc.DocumentObjectModel + false + false + false + false + false + false + false + MigraDoc.DocumentObjectModel + + + + + + + + + + + diff --git a/MigraDoc.DocumentObjectModel/MigraDoc.DocumentObjectModel.csproj_orig b/MigraDoc.DocumentObjectModel/MigraDoc.DocumentObjectModel.csproj_orig new file mode 100644 index 0000000..9ad9496 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/MigraDoc.DocumentObjectModel.csproj_orig @@ -0,0 +1,225 @@ + + + + + Debug + AnyCPU + {6318A852-EF6B-486F-8547-3D7E736D7943} + Library + Properties + MigraDoc + MigraDoc.DocumentObjectModel + v2.0 + 512 + + + true + full + false + bin\Debug\ + TRACE;DEBUG;CORE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE;CORE + prompt + 4 + bin\Release\MigraDoc.DocumentObjectModel.xml + + + true + + + StrongnameKey.snk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.deps.json b/MigraDoc.DocumentObjectModel/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.deps.json new file mode 100644 index 0000000..1a0ba79 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.deps.json @@ -0,0 +1,63 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "MigraDoc.DocumentObjectModel/3.0.0.0": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "MigraDoc.DocumentObjectModel.dll": {} + } + }, + "Microsoft.NETCore.Platforms/1.1.0": {}, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "System.Drawing.Common/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Drawing.Common.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + } + } + } + } + }, + "libraries": { + "MigraDoc.DocumentObjectModel/3.0.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "path": "microsoft.netcore.platforms/1.1.0", + "hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "System.Drawing.Common/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AiJFxxVPdeITstiRS5aAu8+8Dpf5NawTMoapZ53Gfirml24p7HIfhjmCRxdXnmmf3IUA3AX3CcW7G73CjWxW/Q==", + "path": "system.drawing.common/4.5.0", + "hashPath": "system.drawing.common.4.5.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.dll b/MigraDoc.DocumentObjectModel/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.dll new file mode 100644 index 0000000..5ed2823 Binary files /dev/null and b/MigraDoc.DocumentObjectModel/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.dll differ diff --git a/MigraDoc.DocumentObjectModel/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.pdb b/MigraDoc.DocumentObjectModel/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.pdb new file mode 100644 index 0000000..e9915bc Binary files /dev/null and b/MigraDoc.DocumentObjectModel/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.pdb differ diff --git a/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs new file mode 100644 index 0000000..45b1ca0 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] diff --git a/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.AssemblyInfo.cs b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.AssemblyInfo.cs new file mode 100644 index 0000000..338aef5 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.AssemblyInfo.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("3.0.0.0")] + +// Создано классом WriteCodeFragment MSBuild. + diff --git a/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.AssemblyInfoInputs.cache b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.AssemblyInfoInputs.cache new file mode 100644 index 0000000..b902023 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +c9bbb4259b11bff14843734a92523ce79fd4d971 diff --git a/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.assets.cache b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.assets.cache new file mode 100644 index 0000000..8974935 Binary files /dev/null and b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.assets.cache differ diff --git a/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.csproj.CoreCompileInputs.cache b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..0a5c8ef --- /dev/null +++ b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +270afc19e1eed6b5944598d2cddee8c46a377f0a diff --git a/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.csproj.FileListAbsolute.txt b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..c64a410 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.csproj.FileListAbsolute.txt @@ -0,0 +1,9 @@ +F:\Projects1\MigraDoc.DocumentObjectModel\bin\Debug\netstandard2.0\MigraDoc.DocumentObjectModel.deps.json +F:\Projects1\MigraDoc.DocumentObjectModel\bin\Debug\netstandard2.0\MigraDoc.DocumentObjectModel.dll +F:\Projects1\MigraDoc.DocumentObjectModel\bin\Debug\netstandard2.0\MigraDoc.DocumentObjectModel.pdb +F:\Projects1\MigraDoc.DocumentObjectModel\obj\Debug\netstandard2.0\MigraDoc.DocumentObjectModel.AssemblyInfoInputs.cache +F:\Projects1\MigraDoc.DocumentObjectModel\obj\Debug\netstandard2.0\MigraDoc.DocumentObjectModel.AssemblyInfo.cs +F:\Projects1\MigraDoc.DocumentObjectModel\obj\Debug\netstandard2.0\MigraDoc.DocumentObjectModel.csproj.CoreCompileInputs.cache +F:\Projects1\MigraDoc.DocumentObjectModel\obj\Debug\netstandard2.0\MigraDoc.DocumentObjectModel.dll +F:\Projects1\MigraDoc.DocumentObjectModel\obj\Debug\netstandard2.0\MigraDoc.DocumentObjectModel.pdb +F:\Projects1\MigraDoc.DocumentObjectModel\obj\Debug\netstandard2.0\MigraDoc.DocumentObjectModel.csprojAssemblyReference.cache diff --git a/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.csprojAssemblyReference.cache b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.csprojAssemblyReference.cache new file mode 100644 index 0000000..ccc7cef Binary files /dev/null and b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.csprojAssemblyReference.cache differ diff --git a/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.dll b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.dll new file mode 100644 index 0000000..5ed2823 Binary files /dev/null and b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.dll differ diff --git a/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.pdb b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.pdb new file mode 100644 index 0000000..e9915bc Binary files /dev/null and b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.pdb differ diff --git a/MigraDoc.DocumentObjectModel/obj/MigraDoc.DocumentObjectModel.csproj.nuget.dgspec.json b/MigraDoc.DocumentObjectModel/obj/MigraDoc.DocumentObjectModel.csproj.nuget.dgspec.json new file mode 100644 index 0000000..6603258 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/obj/MigraDoc.DocumentObjectModel.csproj.nuget.dgspec.json @@ -0,0 +1,72 @@ +{ + "format": 1, + "restore": { + "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj": {} + }, + "projects": { + "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj", + "projectName": "MigraDoc.DocumentObjectModel", + "projectPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/obj/MigraDoc.DocumentObjectModel.csproj.nuget.g.props b/MigraDoc.DocumentObjectModel/obj/MigraDoc.DocumentObjectModel.csproj.nuget.g.props new file mode 100644 index 0000000..1771934 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/obj/MigraDoc.DocumentObjectModel.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\google\.nuget\packages\;C:\Microsoft\Xamarin\NuGet\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder + PackageReference + 5.6.0 + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/obj/MigraDoc.DocumentObjectModel.csproj.nuget.g.targets b/MigraDoc.DocumentObjectModel/obj/MigraDoc.DocumentObjectModel.csproj.nuget.g.targets new file mode 100644 index 0000000..f09823b --- /dev/null +++ b/MigraDoc.DocumentObjectModel/obj/MigraDoc.DocumentObjectModel.csproj.nuget.g.targets @@ -0,0 +1,9 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/obj/project.assets.json b/MigraDoc.DocumentObjectModel/obj/project.assets.json new file mode 100644 index 0000000..22a91b5 --- /dev/null +++ b/MigraDoc.DocumentObjectModel/obj/project.assets.json @@ -0,0 +1,293 @@ +{ + "version": 3, + "targets": { + ".NETStandard,Version=v2.0": { + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + }, + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + }, + "build": { + "build/netstandard2.0/NETStandard.Library.targets": {} + } + }, + "System.Drawing.Common/4.5.0": { + "type": "package", + "compile": { + "ref/netstandard2.0/System.Drawing.Common.dll": {} + }, + "runtime": { + "lib/netstandard2.0/System.Drawing.Common.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.NETCore.Platforms/1.1.0": { + "sha512": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "type": "package", + "path": "microsoft.netcore.platforms/1.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "ThirdPartyNotices.txt", + "dotnet_library_license.txt", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.1.1.0.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json" + ] + }, + "NETStandard.Library/2.0.3": { + "sha512": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "type": "package", + "path": "netstandard.library/2.0.3", + "files": [ + ".nupkg.metadata", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "build/netstandard2.0/NETStandard.Library.targets", + "build/netstandard2.0/ref/Microsoft.Win32.Primitives.dll", + "build/netstandard2.0/ref/System.AppContext.dll", + "build/netstandard2.0/ref/System.Collections.Concurrent.dll", + "build/netstandard2.0/ref/System.Collections.NonGeneric.dll", + "build/netstandard2.0/ref/System.Collections.Specialized.dll", + "build/netstandard2.0/ref/System.Collections.dll", + "build/netstandard2.0/ref/System.ComponentModel.Composition.dll", + "build/netstandard2.0/ref/System.ComponentModel.EventBasedAsync.dll", + "build/netstandard2.0/ref/System.ComponentModel.Primitives.dll", + "build/netstandard2.0/ref/System.ComponentModel.TypeConverter.dll", + "build/netstandard2.0/ref/System.ComponentModel.dll", + "build/netstandard2.0/ref/System.Console.dll", + "build/netstandard2.0/ref/System.Core.dll", + "build/netstandard2.0/ref/System.Data.Common.dll", + "build/netstandard2.0/ref/System.Data.dll", + "build/netstandard2.0/ref/System.Diagnostics.Contracts.dll", + "build/netstandard2.0/ref/System.Diagnostics.Debug.dll", + "build/netstandard2.0/ref/System.Diagnostics.FileVersionInfo.dll", + "build/netstandard2.0/ref/System.Diagnostics.Process.dll", + "build/netstandard2.0/ref/System.Diagnostics.StackTrace.dll", + "build/netstandard2.0/ref/System.Diagnostics.TextWriterTraceListener.dll", + "build/netstandard2.0/ref/System.Diagnostics.Tools.dll", + "build/netstandard2.0/ref/System.Diagnostics.TraceSource.dll", + "build/netstandard2.0/ref/System.Diagnostics.Tracing.dll", + "build/netstandard2.0/ref/System.Drawing.Primitives.dll", + "build/netstandard2.0/ref/System.Drawing.dll", + "build/netstandard2.0/ref/System.Dynamic.Runtime.dll", + "build/netstandard2.0/ref/System.Globalization.Calendars.dll", + "build/netstandard2.0/ref/System.Globalization.Extensions.dll", + "build/netstandard2.0/ref/System.Globalization.dll", + "build/netstandard2.0/ref/System.IO.Compression.FileSystem.dll", + "build/netstandard2.0/ref/System.IO.Compression.ZipFile.dll", + "build/netstandard2.0/ref/System.IO.Compression.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.DriveInfo.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.Primitives.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.Watcher.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.dll", + "build/netstandard2.0/ref/System.IO.IsolatedStorage.dll", + "build/netstandard2.0/ref/System.IO.MemoryMappedFiles.dll", + "build/netstandard2.0/ref/System.IO.Pipes.dll", + "build/netstandard2.0/ref/System.IO.UnmanagedMemoryStream.dll", + "build/netstandard2.0/ref/System.IO.dll", + "build/netstandard2.0/ref/System.Linq.Expressions.dll", + "build/netstandard2.0/ref/System.Linq.Parallel.dll", + "build/netstandard2.0/ref/System.Linq.Queryable.dll", + "build/netstandard2.0/ref/System.Linq.dll", + "build/netstandard2.0/ref/System.Net.Http.dll", + "build/netstandard2.0/ref/System.Net.NameResolution.dll", + "build/netstandard2.0/ref/System.Net.NetworkInformation.dll", + "build/netstandard2.0/ref/System.Net.Ping.dll", + "build/netstandard2.0/ref/System.Net.Primitives.dll", + "build/netstandard2.0/ref/System.Net.Requests.dll", + "build/netstandard2.0/ref/System.Net.Security.dll", + "build/netstandard2.0/ref/System.Net.Sockets.dll", + "build/netstandard2.0/ref/System.Net.WebHeaderCollection.dll", + "build/netstandard2.0/ref/System.Net.WebSockets.Client.dll", + "build/netstandard2.0/ref/System.Net.WebSockets.dll", + "build/netstandard2.0/ref/System.Net.dll", + "build/netstandard2.0/ref/System.Numerics.dll", + "build/netstandard2.0/ref/System.ObjectModel.dll", + "build/netstandard2.0/ref/System.Reflection.Extensions.dll", + "build/netstandard2.0/ref/System.Reflection.Primitives.dll", + "build/netstandard2.0/ref/System.Reflection.dll", + "build/netstandard2.0/ref/System.Resources.Reader.dll", + "build/netstandard2.0/ref/System.Resources.ResourceManager.dll", + "build/netstandard2.0/ref/System.Resources.Writer.dll", + "build/netstandard2.0/ref/System.Runtime.CompilerServices.VisualC.dll", + "build/netstandard2.0/ref/System.Runtime.Extensions.dll", + "build/netstandard2.0/ref/System.Runtime.Handles.dll", + "build/netstandard2.0/ref/System.Runtime.InteropServices.RuntimeInformation.dll", + "build/netstandard2.0/ref/System.Runtime.InteropServices.dll", + "build/netstandard2.0/ref/System.Runtime.Numerics.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Formatters.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Json.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Primitives.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Xml.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.dll", + "build/netstandard2.0/ref/System.Runtime.dll", + "build/netstandard2.0/ref/System.Security.Claims.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Algorithms.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Csp.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Encoding.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Primitives.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.X509Certificates.dll", + "build/netstandard2.0/ref/System.Security.Principal.dll", + "build/netstandard2.0/ref/System.Security.SecureString.dll", + "build/netstandard2.0/ref/System.ServiceModel.Web.dll", + "build/netstandard2.0/ref/System.Text.Encoding.Extensions.dll", + "build/netstandard2.0/ref/System.Text.Encoding.dll", + "build/netstandard2.0/ref/System.Text.RegularExpressions.dll", + "build/netstandard2.0/ref/System.Threading.Overlapped.dll", + "build/netstandard2.0/ref/System.Threading.Tasks.Parallel.dll", + "build/netstandard2.0/ref/System.Threading.Tasks.dll", + "build/netstandard2.0/ref/System.Threading.Thread.dll", + "build/netstandard2.0/ref/System.Threading.ThreadPool.dll", + "build/netstandard2.0/ref/System.Threading.Timer.dll", + "build/netstandard2.0/ref/System.Threading.dll", + "build/netstandard2.0/ref/System.Transactions.dll", + "build/netstandard2.0/ref/System.ValueTuple.dll", + "build/netstandard2.0/ref/System.Web.dll", + "build/netstandard2.0/ref/System.Windows.dll", + "build/netstandard2.0/ref/System.Xml.Linq.dll", + "build/netstandard2.0/ref/System.Xml.ReaderWriter.dll", + "build/netstandard2.0/ref/System.Xml.Serialization.dll", + "build/netstandard2.0/ref/System.Xml.XDocument.dll", + "build/netstandard2.0/ref/System.Xml.XPath.XDocument.dll", + "build/netstandard2.0/ref/System.Xml.XPath.dll", + "build/netstandard2.0/ref/System.Xml.XmlDocument.dll", + "build/netstandard2.0/ref/System.Xml.XmlSerializer.dll", + "build/netstandard2.0/ref/System.Xml.dll", + "build/netstandard2.0/ref/System.dll", + "build/netstandard2.0/ref/mscorlib.dll", + "build/netstandard2.0/ref/netstandard.dll", + "build/netstandard2.0/ref/netstandard.xml", + "lib/netstandard1.0/_._", + "netstandard.library.2.0.3.nupkg.sha512", + "netstandard.library.nuspec" + ] + }, + "System.Drawing.Common/4.5.0": { + "sha512": "AiJFxxVPdeITstiRS5aAu8+8Dpf5NawTMoapZ53Gfirml24p7HIfhjmCRxdXnmmf3IUA3AX3CcW7G73CjWxW/Q==", + "type": "package", + "path": "system.drawing.common/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net461/System.Drawing.Common.dll", + "lib/netstandard2.0/System.Drawing.Common.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net461/System.Drawing.Common.dll", + "ref/netstandard2.0/System.Drawing.Common.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll", + "runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll", + "system.drawing.common.4.5.0.nupkg.sha512", + "system.drawing.common.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + } + }, + "projectFileDependencyGroups": { + ".NETStandard,Version=v2.0": [ + "NETStandard.Library >= 2.0.3", + "System.Drawing.Common >= 4.5.0" + ] + }, + "packageFolders": { + "C:\\Users\\google\\.nuget\\packages\\": {}, + "C:\\Microsoft\\Xamarin\\NuGet\\": {}, + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {} + }, + "project": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj", + "projectName": "MigraDoc.DocumentObjectModel", + "projectPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/MigraDoc.DocumentObjectModel/obj/project.nuget.cache b/MigraDoc.DocumentObjectModel/obj/project.nuget.cache new file mode 100644 index 0000000..b65c25e --- /dev/null +++ b/MigraDoc.DocumentObjectModel/obj/project.nuget.cache @@ -0,0 +1,12 @@ +{ + "version": 2, + "dgSpecHash": "/sIPM6IZI40eTfx/hY4vm3ThyyKE16GQVuSR+k8hMIfM/NUjF5tfDZEQQYh+PHyYrSO7yMZ2Fhn6CIodxvUOhw==", + "success": true, + "projectFilePath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj", + "expectedPackageFiles": [ + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\netstandard.library\\2.0.3\\netstandard.library.2.0.3.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\system.drawing.common\\4.5.0\\system.drawing.common.4.5.0.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/MigraDoc.Rendering/MigraDoc.Rendering.csproj b/MigraDoc.Rendering/MigraDoc.Rendering.csproj new file mode 100644 index 0000000..fae12a3 --- /dev/null +++ b/MigraDoc.Rendering/MigraDoc.Rendering.csproj @@ -0,0 +1,33 @@ + + + + 3.0.0.0 + netstandard2.0 + $(DefineConstants);CORE;CORE_WITH_GDI + MigraDoc.Rendering + MigraDoc.Rendering + false + false + false + false + false + false + false + MigraDoc.Rendering + + + + + + + + + + + + + + + + + diff --git a/MigraDoc.Rendering/MigraDoc.Rendering.csproj.user b/MigraDoc.Rendering/MigraDoc.Rendering.csproj.user new file mode 100644 index 0000000..6e882b6 --- /dev/null +++ b/MigraDoc.Rendering/MigraDoc.Rendering.csproj.user @@ -0,0 +1,9 @@ + + + + + + Component + + + \ No newline at end of file diff --git a/MigraDoc.Rendering/MigraDoc.Rendering.csproj_orig b/MigraDoc.Rendering/MigraDoc.Rendering.csproj_orig new file mode 100644 index 0000000..f6c2489 --- /dev/null +++ b/MigraDoc.Rendering/MigraDoc.Rendering.csproj_orig @@ -0,0 +1,153 @@ + + + + + Debug + AnyCPU + {A0B7940A-0BFC-476D-A204-73F7C0F88FDE} + Library + Properties + MigraDoc + MigraDoc.Rendering + v2.0 + 512 + + + true + full + false + bin\Debug\ + TRACE;DEBUG;CORE;CORE_WITH_GDI + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE;CORE;CORE_WITH_GDI + prompt + 4 + bin\Release\MigraDoc.Rendering.xml + + + true + + + StrongnameKey.snk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {6f98a822-41b0-4c7a-85a6-e95c1d3e88ef} + PdfSharp.Charting + + + {5a6055bc-bf86-4fdd-9f62-0109db7a303b} + PDFsharp + + + {6318a852-ef6b-486f-8547-3d7e736d7943} + MigraDoc.DocumentObjectModel + + + + + + + + + + Messages2.cs + + + Messages2.cs + + + + + + \ No newline at end of file diff --git a/MigraDoc.Rendering/Rendering.ChartMapper/AxisMapper.cs b/MigraDoc.Rendering/Rendering.ChartMapper/AxisMapper.cs new file mode 100644 index 0000000..0a271b2 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.ChartMapper/AxisMapper.cs @@ -0,0 +1,100 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Charting; + +namespace MigraDoc.Rendering.ChartMapper +{ + /// + /// The AxisMapper class. + /// + public class AxisMapper + { + /// + /// Initializes a new instance of the class. + /// + public AxisMapper() + { } + + static void MapObject(Axis axis, DocumentObjectModel.Shapes.Charts.Axis domAxis) + { + if (!domAxis.IsNull("TickLabels.Format")) + axis.TickLabels.Format = domAxis.TickLabels.Format; + if (!domAxis.IsNull("TickLabels.Style")) + FontMapper.Map(axis.TickLabels.Font, domAxis.TickLabels.Document, domAxis.TickLabels.Style); + if (!domAxis.IsNull("TickLabels.Font")) + FontMapper.Map(axis.TickLabels.Font, domAxis.TickLabels.Font); + + if (!domAxis.IsNull("MajorTickMark")) + axis.MajorTickMark = (TickMarkType)domAxis.MajorTickMark; + if (!domAxis.IsNull("MinorTickMark")) + axis.MinorTickMark = (TickMarkType)domAxis.MinorTickMark; + + if (!domAxis.IsNull("MajorTick")) + axis.MajorTick = domAxis.MajorTick; + if (!domAxis.IsNull("MinorTick")) + axis.MinorTick = domAxis.MinorTick; + + if (!domAxis.IsNull("Title")) + { + axis.Title.Caption = domAxis.Title.Caption; + if (!domAxis.IsNull("Title.Style")) + FontMapper.Map(axis.Title.Font, domAxis.Title.Document, domAxis.Title.Style); + if (!domAxis.IsNull("Title.Font")) + FontMapper.Map(axis.Title.Font, domAxis.Title.Font); + axis.Title.Orientation = domAxis.Title.Orientation.Value; + axis.Title.Alignment = (HorizontalAlignment)domAxis.Title.Alignment; + axis.Title.VerticalAlignment = (VerticalAlignment)domAxis.Title.VerticalAlignment; + } + + axis.HasMajorGridlines = domAxis.HasMajorGridlines; + axis.HasMinorGridlines = domAxis.HasMinorGridlines; + + if (!domAxis.IsNull("MajorGridlines") && !domAxis.MajorGridlines.IsNull("LineFormat")) + LineFormatMapper.Map(axis.MajorGridlines.LineFormat, domAxis.MajorGridlines.LineFormat); + if (!domAxis.IsNull("MinorGridlines") && !domAxis.MinorGridlines.IsNull("LineFormat")) + LineFormatMapper.Map(axis.MinorGridlines.LineFormat, domAxis.MinorGridlines.LineFormat); + + if (!domAxis.IsNull("MaximumScale")) + axis.MaximumScale = domAxis.MaximumScale; + if (!domAxis.IsNull("MinimumScale")) + axis.MinimumScale = domAxis.MinimumScale; + + if (!domAxis.IsNull("LineFormat")) + LineFormatMapper.Map(axis.LineFormat, domAxis.LineFormat); + } + + public static void Map(Axis axis, DocumentObjectModel.Shapes.Charts.Axis domAxis) + { + AxisMapper mapper = new AxisMapper(); + MapObject(axis, domAxis); + } + } +} diff --git a/MigraDoc.Rendering/Rendering.ChartMapper/ChartMapper.cs b/MigraDoc.Rendering/Rendering.ChartMapper/ChartMapper.cs new file mode 100644 index 0000000..3577b92 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.ChartMapper/ChartMapper.cs @@ -0,0 +1,93 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Charting; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering.ChartMapper +{ + /// + /// Maps charts from the MigraDoc.DocumentObjectModel to charts from Pdf.Charting. + /// + public class ChartMapper + { + /// + /// Initializes a new instance of the chart mapper object. + /// + public ChartMapper() + { } + + private ChartFrame MapObject(DocumentObjectModel.Shapes.Charts.Chart domChart) + { + ChartFrame chartFrame = new ChartFrame(); + chartFrame.Size = new XSize(domChart.Width.Point, domChart.Height.Point); + chartFrame.Location = new XPoint(domChart.Left.Position.Point, domChart.Top.Position.Point); + + Chart chart = new Chart((ChartType)domChart.Type); + + if (!domChart.IsNull("XAxis")) + AxisMapper.Map(chart.XAxis, domChart.XAxis); + if (!domChart.IsNull("YAxis")) + AxisMapper.Map(chart.YAxis, domChart.YAxis); + + PlotAreaMapper.Map(chart.PlotArea, domChart.PlotArea); + + SeriesCollectionMapper.Map(chart.SeriesCollection, domChart.SeriesCollection); + + LegendMapper.Map(chart, domChart); + + chart.DisplayBlanksAs = (BlankType)domChart.DisplayBlanksAs; + chart.HasDataLabel = domChart.HasDataLabel; + if (!domChart.IsNull("DataLabel")) + DataLabelMapper.Map(chart.DataLabel, domChart.DataLabel); + + if (!domChart.IsNull("Style")) + FontMapper.Map(chart.Font, domChart.Document, domChart.Style); + if (!domChart.IsNull("Format.Font")) + FontMapper.Map(chart.Font, domChart.Format.Font); + if (!domChart.IsNull("XValues")) + XValuesMapper.Map(chart.XValues, domChart.XValues); + + chartFrame.Add(chart); + return chartFrame; + } + + /// + /// Maps the specified DOM chart. + /// + /// The DOM chart. + /// + public static ChartFrame Map(DocumentObjectModel.Shapes.Charts.Chart domChart) + { + ChartMapper mapper = new ChartMapper(); + return mapper.MapObject(domChart); + } + } +} diff --git a/MigraDoc.Rendering/Rendering.ChartMapper/DataLabelMapper.cs b/MigraDoc.Rendering/Rendering.ChartMapper/DataLabelMapper.cs new file mode 100644 index 0000000..10fab78 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.ChartMapper/DataLabelMapper.cs @@ -0,0 +1,59 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Charting; + +namespace MigraDoc.Rendering.ChartMapper +{ + public class DataLabelMapper + { + private DataLabelMapper() + { } + + void MapObject(DataLabel dataLabel, DocumentObjectModel.Shapes.Charts.DataLabel domDataLabel) + { + if (!domDataLabel.IsNull("Style")) + FontMapper.Map(dataLabel.Font, domDataLabel.Document, domDataLabel.Style); + if (!domDataLabel.IsNull("Font")) + FontMapper.Map(dataLabel.Font, domDataLabel.Font); + dataLabel.Format = domDataLabel.Format; + if (!domDataLabel.IsNull("Position")) + dataLabel.Position = (DataLabelPosition)domDataLabel.Position; + if (!domDataLabel.IsNull("Type")) + dataLabel.Type = (DataLabelType)domDataLabel.Type; + } + + public static void Map(DataLabel dataLabel, DocumentObjectModel.Shapes.Charts.DataLabel domDataLabel) + { + DataLabelMapper mapper = new DataLabelMapper(); + mapper.MapObject(dataLabel, domDataLabel); + } + } +} diff --git a/MigraDoc.Rendering/Rendering.ChartMapper/FillFormatMapper.cs b/MigraDoc.Rendering/Rendering.ChartMapper/FillFormatMapper.cs new file mode 100644 index 0000000..3374c3f --- /dev/null +++ b/MigraDoc.Rendering/Rendering.ChartMapper/FillFormatMapper.cs @@ -0,0 +1,62 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Charting; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering.ChartMapper +{ + public class FillFormatMapper + { + private FillFormatMapper() + { } + + void MapObject(FillFormat fillFormat, DocumentObjectModel.Shapes.FillFormat domFillFormat) + { + if (domFillFormat.Color.IsEmpty) + fillFormat.Color = XColor.Empty; + else + { +#if noCMYK + fillFormat.Color = XColor.FromArgb((int)domFillFormat.Color.Argb); +#else + fillFormat.Color = ColorHelper.ToXColor(domFillFormat.Color, domFillFormat.Document.UseCmykColor); +#endif + } + fillFormat.Visible = domFillFormat.Visible; + } + + public static void Map(FillFormat fillFormat, DocumentObjectModel.Shapes.FillFormat domFillFormat) + { + FillFormatMapper mapper = new FillFormatMapper(); + mapper.MapObject(fillFormat, domFillFormat); + } + } +} diff --git a/MigraDoc.Rendering/Rendering.ChartMapper/FontMapper.cs b/MigraDoc.Rendering/Rendering.ChartMapper/FontMapper.cs new file mode 100644 index 0000000..03deb94 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.ChartMapper/FontMapper.cs @@ -0,0 +1,80 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Charting; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering.ChartMapper +{ + public class FontMapper + { + private FontMapper() + { } + + void MapObject(Font font, DocumentObjectModel.Font domFont) + { + font.Bold = domFont.Bold; + if (domFont.Color.IsEmpty) + font.Color = XColor.Empty; + else + { +#if noCMYK + font.Color = XColor.FromArgb((int)domFont.Color.Argb); +#else + font.Color = ColorHelper.ToXColor(domFont.Color, domFont.Document.UseCmykColor); +#endif + } + font.Italic = domFont.Italic; + if (!domFont.IsNull("Name")) + font.Name = domFont.Name; + if (!domFont.IsNull("Size")) + font.Size = domFont.Size.Point; + font.Subscript = domFont.Subscript; + font.Superscript = domFont.Superscript; + font.Underline = (Underline)domFont.Underline; + } + + public static void Map(Font font, DocumentObjectModel.Document domDocument, string domStyleName) + { + DocumentObjectModel.Style domStyle = domDocument.Styles[domStyleName]; + if (domStyle != null) + { + FontMapper mapper = new FontMapper(); + mapper.MapObject(font, domStyle.Font); + } + } + + public static void Map(Font font, DocumentObjectModel.Font domFont) + { + FontMapper mapper = new FontMapper(); + mapper.MapObject(font, domFont); + } + } +} diff --git a/MigraDoc.Rendering/Rendering.ChartMapper/LegendMapper.cs b/MigraDoc.Rendering/Rendering.ChartMapper/LegendMapper.cs new file mode 100644 index 0000000..65bed69 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.ChartMapper/LegendMapper.cs @@ -0,0 +1,122 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Charting; + +namespace MigraDoc.Rendering.ChartMapper +{ + public class LegendMapper + { + private LegendMapper() + { } + + void MapObject(Chart chart, DocumentObjectModel.Shapes.Charts.Chart domChart) + { + DocumentObjectModel.Shapes.Charts.Legend domLegend = null; + DocumentObjectModel.Shapes.Charts.TextArea textArea = null; + + foreach (DocumentObjectModel.DocumentObject domObj in domChart.BottomArea.Elements) + { + if (domObj is DocumentObjectModel.Shapes.Charts.Legend) + { + chart.Legend.Docking = DockingType.Bottom; + domLegend = domObj as DocumentObjectModel.Shapes.Charts.Legend; + textArea = domChart.BottomArea; + } + } + + foreach (DocumentObjectModel.DocumentObject domObj in domChart.RightArea.Elements) + { + if (domObj is DocumentObjectModel.Shapes.Charts.Legend) + { + chart.Legend.Docking = DockingType.Right; + domLegend = domObj as DocumentObjectModel.Shapes.Charts.Legend; + textArea = domChart.RightArea; + } + } + + foreach (DocumentObjectModel.DocumentObject domObj in domChart.LeftArea.Elements) + { + if (domObj is DocumentObjectModel.Shapes.Charts.Legend) + { + chart.Legend.Docking = DockingType.Left; + domLegend = domObj as DocumentObjectModel.Shapes.Charts.Legend; + textArea = domChart.LeftArea; + } + } + + foreach (DocumentObjectModel.DocumentObject domObj in domChart.TopArea.Elements) + { + if (domObj is DocumentObjectModel.Shapes.Charts.Legend) + { + chart.Legend.Docking = DockingType.Top; + domLegend = domObj as DocumentObjectModel.Shapes.Charts.Legend; + textArea = domChart.TopArea; + } + } + + foreach (DocumentObjectModel.DocumentObject domObj in domChart.HeaderArea.Elements) + { + if (domObj is DocumentObjectModel.Shapes.Charts.Legend) + { + chart.Legend.Docking = DockingType.Top; + domLegend = domObj as DocumentObjectModel.Shapes.Charts.Legend; + textArea = domChart.HeaderArea; + } + } + + foreach (DocumentObjectModel.DocumentObject domObj in domChart.FooterArea.Elements) + { + if (domObj is DocumentObjectModel.Shapes.Charts.Legend) + { + chart.Legend.Docking = DockingType.Bottom; + domLegend = domObj as DocumentObjectModel.Shapes.Charts.Legend; + textArea = domChart.FooterArea; + } + } + + if (domLegend != null) + { + if (!domLegend.IsNull("LineFormat")) + LineFormatMapper.Map(chart.Legend.LineFormat, domLegend.LineFormat); + if (!textArea.IsNull("Style")) + FontMapper.Map(chart.Legend.Font, textArea.Document, textArea.Style); + if (!domLegend.IsNull("Format.Font")) + FontMapper.Map(chart.Legend.Font, domLegend.Format.Font); + } + } + + public static void Map(Chart chart, DocumentObjectModel.Shapes.Charts.Chart domChart) + { + LegendMapper mapper = new LegendMapper(); + mapper.MapObject(chart, domChart); + } + } +} diff --git a/MigraDoc.Rendering/Rendering.ChartMapper/LineFormatMapper.cs b/MigraDoc.Rendering/Rendering.ChartMapper/LineFormatMapper.cs new file mode 100644 index 0000000..f357e37 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.ChartMapper/LineFormatMapper.cs @@ -0,0 +1,98 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Charting; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering.ChartMapper +{ + /// + /// The LineFormatMapper class. + /// + public class LineFormatMapper + { + /// + /// Initializes a new instance of the class. + /// + public LineFormatMapper() + { } + + void MapObject(LineFormat lineFormat, DocumentObjectModel.Shapes.LineFormat domLineFormat) + { + if (domLineFormat.Color.IsEmpty) + lineFormat.Color = XColor.Empty; + else + { +#if noCMYK + lineFormat.Color = XColor.FromArgb(domLineFormat.Color.Argb); +#else + lineFormat.Color = ColorHelper.ToXColor(domLineFormat.Color, domLineFormat.Document.UseCmykColor); +#endif + } + switch (domLineFormat.DashStyle) + { + case DocumentObjectModel.Shapes.DashStyle.Dash: + lineFormat.DashStyle = XDashStyle.Dash; + break; + case DocumentObjectModel.Shapes.DashStyle.DashDot: + lineFormat.DashStyle = XDashStyle.DashDot; + break; + case DocumentObjectModel.Shapes.DashStyle.DashDotDot: + lineFormat.DashStyle = XDashStyle.DashDotDot; + break; + case DocumentObjectModel.Shapes.DashStyle.Solid: + lineFormat.DashStyle = XDashStyle.Solid; + break; + case DocumentObjectModel.Shapes.DashStyle.SquareDot: + lineFormat.DashStyle = XDashStyle.Dot; + break; + default: + lineFormat.DashStyle = XDashStyle.Solid; + break; + } + switch (domLineFormat.Style) + { + case DocumentObjectModel.Shapes.LineStyle.Single: + lineFormat.Style = LineStyle.Single; + break; + } + lineFormat.Visible = domLineFormat.Visible; + if (domLineFormat.IsNull("Visible")) + lineFormat.Visible = true; + lineFormat.Width = domLineFormat.Width.Point; + } + + public static void Map(LineFormat lineFormat, DocumentObjectModel.Shapes.LineFormat domLineFormat) + { + LineFormatMapper mapper = new LineFormatMapper(); + mapper.MapObject(lineFormat, domLineFormat); + } + } +} diff --git a/MigraDoc.Rendering/Rendering.ChartMapper/PlotAreaMapper.cs b/MigraDoc.Rendering/Rendering.ChartMapper/PlotAreaMapper.cs new file mode 100644 index 0000000..fafbff4 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.ChartMapper/PlotAreaMapper.cs @@ -0,0 +1,65 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Charting; + +namespace MigraDoc.Rendering.ChartMapper +{ + /// + /// The PlotAreaMapper class. + /// + public class PlotAreaMapper + { + /// + /// Initializes a new instance of the class. + /// + public PlotAreaMapper() + { } + + void MapObject(PlotArea plotArea, DocumentObjectModel.Shapes.Charts.PlotArea domPlotArea) + { + plotArea.BottomPadding = domPlotArea.BottomPadding.Point; + plotArea.RightPadding = domPlotArea.RightPadding.Point; + plotArea.LeftPadding = domPlotArea.LeftPadding.Point; + plotArea.TopPadding = domPlotArea.TopPadding.Point; + + if (!domPlotArea.IsNull("LineFormat")) + LineFormatMapper.Map(plotArea.LineFormat, domPlotArea.LineFormat); + if (!domPlotArea.IsNull("FillFormat")) + FillFormatMapper.Map(plotArea.FillFormat, domPlotArea.FillFormat); + } + + public static void Map(PlotArea plotArea, DocumentObjectModel.Shapes.Charts.PlotArea domPlotArea) + { + PlotAreaMapper mapper = new PlotAreaMapper(); + mapper.MapObject(plotArea, domPlotArea); + } + } +} diff --git a/MigraDoc.Rendering/Rendering.ChartMapper/SeriesCollectionMapper.cs b/MigraDoc.Rendering/Rendering.ChartMapper/SeriesCollectionMapper.cs new file mode 100644 index 0000000..865ff65 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.ChartMapper/SeriesCollectionMapper.cs @@ -0,0 +1,116 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; +using PdfSharp.Charting; + +namespace MigraDoc.Rendering.ChartMapper +{ + /// + /// The SeriesCollectionMapper class. + /// + public class SeriesCollectionMapper + { + /// + /// Initializes a new instance of the class. + /// + public SeriesCollectionMapper() + { } + + void MapObject(SeriesCollection seriesCollection, DocumentObjectModel.Shapes.Charts.SeriesCollection domSeriesCollection) + { + foreach (DocumentObjectModel.Shapes.Charts.Series domSeries in domSeriesCollection) + { + Series series = seriesCollection.AddSeries(); + series.Name = domSeries.Name; + + if (domSeries.IsNull("ChartType")) + { + DocumentObjectModel.Shapes.Charts.Chart chart = (DocumentObjectModel.Shapes.Charts.Chart)DocumentObjectModel.DocumentRelations.GetParentOfType(domSeries, typeof(DocumentObjectModel.Shapes.Charts.Chart)); + series.ChartType = (ChartType)chart.Type; + } + else + series.ChartType = (ChartType)domSeries.ChartType; + + if (!domSeries.IsNull("DataLabel")) + DataLabelMapper.Map(series.DataLabel, domSeries.DataLabel); + if (!domSeries.IsNull("LineFormat")) + LineFormatMapper.Map(series.LineFormat, domSeries.LineFormat); + if (!domSeries.IsNull("FillFormat")) + FillFormatMapper.Map(series.FillFormat, domSeries.FillFormat); + + series.HasDataLabel = domSeries.HasDataLabel; + if (domSeries.MarkerBackgroundColor.IsEmpty) + series.MarkerBackgroundColor = XColor.Empty; + else + { +#if noCMYK + series.MarkerBackgroundColor = XColor.FromArgb(domSeries.MarkerBackgroundColor.Argb); +#else + series.MarkerBackgroundColor = + ColorHelper.ToXColor(domSeries.MarkerBackgroundColor, domSeries.Document.UseCmykColor); +#endif + } + if (domSeries.MarkerForegroundColor.IsEmpty) + series.MarkerForegroundColor = XColor.Empty; + else + { +#if noCMYK + series.MarkerForegroundColor = XColor.FromArgb(domSeries.MarkerForegroundColor.Argb); +#else + series.MarkerForegroundColor = + ColorHelper.ToXColor(domSeries.MarkerForegroundColor, domSeries.Document.UseCmykColor); +#endif + } + series.MarkerSize = domSeries.MarkerSize.Point; + if (!domSeries.IsNull("MarkerStyle")) + series.MarkerStyle = (MarkerStyle)domSeries.MarkerStyle; + + foreach (DocumentObjectModel.Shapes.Charts.Point domPoint in domSeries.Elements) + { + if (domPoint != null) + { + Point point = series.Add(domPoint.Value); + FillFormatMapper.Map(point.FillFormat, domPoint.FillFormat); + LineFormatMapper.Map(point.LineFormat, domPoint.LineFormat); + } + else + series.Add(double.NaN); + } + } + } + + public static void Map(SeriesCollection seriesCollection, DocumentObjectModel.Shapes.Charts.SeriesCollection domSeriesCollection) + { + SeriesCollectionMapper mapper = new SeriesCollectionMapper(); + mapper.MapObject(seriesCollection, domSeriesCollection); + } + } +} diff --git a/MigraDoc.Rendering/Rendering.ChartMapper/XValuesMapper.cs b/MigraDoc.Rendering/Rendering.ChartMapper/XValuesMapper.cs new file mode 100644 index 0000000..31b0a48 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.ChartMapper/XValuesMapper.cs @@ -0,0 +1,68 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// David Stephensen +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Charting; + +namespace MigraDoc.Rendering.ChartMapper +{ + /// + /// The XValuesMapper class. + /// + public class XValuesMapper + { + /// + /// Initializes a new instance of the class. + /// + public XValuesMapper() + { } + + void MapObject(XValues xValues, DocumentObjectModel.Shapes.Charts.XValues domXValues) + { + foreach (DocumentObjectModel.Shapes.Charts.XSeries domXSeries in domXValues) + { + XSeries xSeries = xValues.AddXSeries(); + DocumentObjectModel.Shapes.Charts.XSeriesElements domXSeriesElements = domXSeries.GetValue("XSeriesElements") as DocumentObjectModel.Shapes.Charts.XSeriesElements; + foreach (DocumentObjectModel.Shapes.Charts.XValue domXValue in domXSeriesElements) + { + if (domXValue == null) + xSeries.AddBlank(); + else + xSeries.Add(domXValue.GetValue("Value").ToString()); + } + } + } + + public static void Map(XValues xValues, DocumentObjectModel.Shapes.Charts.XValues domXValues) + { + XValuesMapper mapper = new XValuesMapper(); + mapper.MapObject(xValues, domXValues); + } + } +} diff --git a/MigraDoc.Rendering/Rendering.Printing/MigraDocPrintDocument.cs b/MigraDoc.Rendering/Rendering.Printing/MigraDocPrintDocument.cs new file mode 100644 index 0000000..c404868 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.Printing/MigraDocPrintDocument.cs @@ -0,0 +1,197 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) +// +// Copyright (c) 2001-2013 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Drawing.Printing; +using PdfSharp; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Visitors; +using MigraDoc.DocumentObjectModel.IO; + +namespace MigraDoc.Rendering.Printing +{ + /// + /// Represents a specialized System.Drawing.Printing.PrintDocument for MigraDoc documents. + /// This component knows about MigraDoc and simplifies printing of MigraDoc documents. + /// + public class MigraDocPrintDocument : PrintDocument + { + /// + /// Initializes a new instance of the class. + /// + public MigraDocPrintDocument() + { + DefaultPageSettings.Margins = new Margins(0, 0, 0, 0); + OriginAtMargins = false; + } + + /// + /// Initializes a new instance of the class + /// with the specified object. + /// + public MigraDocPrintDocument(DocumentRenderer renderer) + { + _renderer = renderer; + DefaultPageSettings.Margins = new Margins(0, 0, 0, 0); + OriginAtMargins = false; + } + + /// + /// Gets or sets the DocumentRenderer that prints the pages of the document. + /// + public DocumentRenderer Renderer + { + get { return _renderer; } + set { _renderer = value; } + } + DocumentRenderer _renderer; + + /// + /// Gets or sets the page number that identifies the selected page. It it used on printing when + /// PrintRange.Selection is set. + /// + public int SelectedPage + { + get { return _selectedPage; } + set { _selectedPage = value; } + } + int _selectedPage; + + /// + /// Raises the event. It is called after the method is called and before the first page of the document prints. + /// + /// A that contains the event data. + protected override void OnBeginPrint(PrintEventArgs e) + { + Debug.Assert(_renderer != null, "Cannot print without a MigraDoc.Rendering.DocumentRenderer."); + + base.OnBeginPrint(e); + if (!e.Cancel) + { + switch (PrinterSettings.PrintRange) + { + case PrintRange.AllPages: + _pageNumber = 1; + _pageCount = _renderer.FormattedDocument.PageCount; + break; + + case PrintRange.SomePages: + _pageNumber = PrinterSettings.FromPage; + _pageCount = PrinterSettings.ToPage - PrinterSettings.FromPage + 1; + break; + + case PrintRange.Selection: + _pageNumber = _selectedPage; + _pageCount = 1; + break; + + default: + Debug.Assert(false, "Invalid PrinterRange."); + e.Cancel = true; + break; + } + } + } + int _pageNumber = -1; + int _pageCount; + + /// + /// Raises the event. It is called immediately before each event. + /// + /// A that contains the event data. + protected override void OnQueryPageSettings(QueryPageSettingsEventArgs e) + { + base.OnQueryPageSettings(e); + if (!e.Cancel) + { + PageSettings settings = e.PageSettings; + PageInfo pageInfo = _renderer.FormattedDocument.GetPageInfo(_pageNumber); + + // set portrait/landscape + settings.Landscape = pageInfo.Orientation == PageOrientation.Landscape; + } + } + + /// + /// Raises the event. It is called before a page prints. + /// + /// A that contains the event data. + protected override void OnPrintPage(PrintPageEventArgs e) + { + base.OnPrintPage(e); + if (!e.Cancel) + { + PageSettings settings = e.PageSettings; + try + { + Graphics graphics = e.Graphics; + IntPtr hdc = graphics.GetHdc(); + int xOffset = GetDeviceCaps(hdc, PHYSICALOFFSETX); + int yOffset = GetDeviceCaps(hdc, PHYSICALOFFSETY); + graphics.ReleaseHdc(hdc); + graphics.TranslateTransform(-xOffset * 100 / graphics.DpiX, -yOffset * 100 / graphics.DpiY); + // Recall: Width and Height are exchanged when settings.Landscape is true. + XSize size = new XSize(e.PageSettings.Bounds.Width / 100.0 * 72, e.PageSettings.Bounds.Height / 100.0 * 72); + const float scale = 100f / 72f; + graphics.ScaleTransform(scale, scale); + // draw line A4 portrait + //graphics.DrawLine(Pens.Red, 0, 0, 21f / 2.54f * 72, 29.7f / 2.54f * 72); + + } + catch + { + e.Cancel = true; + } + _pageNumber++; + _pageCount--; + e.HasMorePages = _pageCount > 0; + } + } + + /// + /// Raises the event. It is called when the last page of the document has printed. + /// + /// A that contains the event data. + protected override void OnEndPrint(PrintEventArgs e) + { + base.OnEndPrint(e); + _pageNumber = -1; + } + + [DllImport("gdi32.dll")] + static extern int GetDeviceCaps(IntPtr hdc, int capability); + const int PHYSICALOFFSETX = 112; // Physical Printable Area x margin + const int PHYSICALOFFSETY = 113; // Physical Printable Area y margin + } +} diff --git a/MigraDoc.Rendering/Rendering.Resources/Messages.de.restext b/MigraDoc.Rendering/Rendering.Resources/Messages.de.restext new file mode 100644 index 0000000..59f3dab --- /dev/null +++ b/MigraDoc.Rendering/Rendering.Resources/Messages.de.restext @@ -0,0 +1,47 @@ +; MigraDoc - Creating Documents on the Fly +; +; Authors: +; Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) +; +; Copyright (c) 2001-2014 empira Software GmbH, Cologne Area (Germany) +; +; http://www.pdfsharp.com +; http://www.migradoc.com +; http://sourceforge.net/projects/pdfsharp +; +; Permission is hereby granted, free of charge, to any person obtaining a +; copy of this software and associated documentation files (the "Software"), +; to deal in the Software without restriction, including without limitation +; the rights to use, copy, modify, merge, publish, distribute, sublicense, +; and/or sell copies of the Software, and to permit persons to whom the +; Software is furnished to do so, subject to the following conditions: +; +; The above copyright notice and this permission notice shall be included +; in all copies or substantial portions of the Software. +; +; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +; THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +; DEALINGS IN THE SOFTWARE. + +; ----- German (de) Messages --------------------------------------------------- +; Messages for German language +; that differ from the default messages. +; ------------------------------------------------------------------------------ + +PropertyNotSetBefore = '{0}' muss vor dem Aufruf von '{1}' gesetzt werden. +BookmarkNotDefined = Lesezeichen '{0}' ist innerhalb des Dokuments nicht definiert. +ImageNotFound = Bild '{0}' nicht gefunden. +InvalidImageType = Ungültiger Bildtyp: '{0}'. +ImageNotReadable = Bild '{0}' konnte nicht eingelesen werden. Es trat eine Ausnahme mit der folgenden Meldung auf:\n{1} +EmptyImageSize = Ihre Benutzereingaben führten zu einem leeren Bildbereich. +ObjectNotRenderable = Nur Bilder, Textrahmen, Diagramme und Absätze können frei gerendert werden. +NumberTooLargeForRoman = Die Zahl {0} ist zu groß für eine Darstellung in römischen Ziffern. +NumberTooLargeForLetters = Die Zahl {0} ist zu groß für eine Darstellung in Buchstaben. +DisplayEmptyImageSize = Leerer Bildbereich. +DisplayImageFileNotFound = Bild nicht gefunden. +DisplayInvalidImageType = Ungültiger Bildtyp. +DisplayImageNotRead = Bild nicht eingelesen. \ No newline at end of file diff --git a/MigraDoc.Rendering/Rendering.Resources/Messages.restext b/MigraDoc.Rendering/Rendering.Resources/Messages.restext new file mode 100644 index 0000000..4a43c43 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.Resources/Messages.restext @@ -0,0 +1,46 @@ +; MigraDoc - Creating Documents on the Fly +; +; Authors: +; Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) +; +; Copyright (c) 2001-2014 empira Software GmbH, Cologne Area (Germany) +; +; http://www.pdfsharp.com +; http://www.migradoc.com +; http://sourceforge.net/projects/pdfsharp +; +; Permission is hereby granted, free of charge, to any person obtaining a +; copy of this software and associated documentation files (the "Software"), +; to deal in the Software without restriction, including without limitation +; the rights to use, copy, modify, merge, publish, distribute, sublicense, +; and/or sell copies of the Software, and to permit persons to whom the +; Software is furnished to do so, subject to the following conditions: +; +; The above copyright notice and this permission notice shall be included +; in all copies or substantial portions of the Software. +; +; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +; THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +; DEALINGS IN THE SOFTWARE. + +; ----- Default Messages ------------------------------------------------------- +; Default Messages for any system culture. +; ------------------------------------------------------------------------------ + +PropertyNotSetBefore = '{0}' must be set before calling '{1}'. +BookmarkNotDefined = Bookmark '{0}' is not defined within the document. +ImageNotFound = Image '{0}' not found. +InvalidImageType = Invalid image type: '{0}'. +ImageNotReadable = Image {0} could not be read.\n Inner exception: {1} +EmptyImageSize = The specified image size is empty. +ObjectNotRenderable = Only images, textframes, charts and paragraphs can be rendered freely. +NumberTooLargeForRoman = The number {0} is to large to be displayed as roman. +NumberTooLargeForLetters = The number {0} is to large to be displayed as letters. +DisplayEmptyImageSize = Image has empty size. +DisplayImageFileNotFound = Image not found. +DisplayInvalidImageType = Image has no valid type. +DisplayImageNotRead = Image could not be read. diff --git a/MigraDoc.Rendering/Rendering.Resources/Messages2.cs b/MigraDoc.Rendering/Rendering.Resources/Messages2.cs new file mode 100644 index 0000000..4a10956 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.Resources/Messages2.cs @@ -0,0 +1,177 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Resources; +using System.Reflection; +#if DEBUG +using System.Text.RegularExpressions; +#endif + +namespace MigraDoc.Rendering.Resources +{ + /// + /// Provides diagnostic messages taken from the resources. + /// + public static class Messages2 + { + public static string NumberTooLargeForRoman(int number) + { + return FormatMessage(IDs.NumberTooLargeForRoman, number); + } + + public static string NumberTooLargeForLetters(int number) + { + return FormatMessage(IDs.NumberTooLargeForLetters, number); + } + + public static string DisplayEmptyImageSize + { + get { return FormatMessage(IDs.DisplayEmptyImageSize); } + } + + public static string DisplayImageFileNotFound + { + get { return FormatMessage(IDs.DisplayImageFileNotFound); } + } + + public static string DisplayInvalidImageType + { + get { return FormatMessage(IDs.DisplayInvalidImageType); } + } + + public static string DisplayImageNotRead + { + get { return FormatMessage(IDs.DisplayImageNotRead); } + } + + public static string PropertyNotSetBefore(string propertyName, string functionName) + { + return FormatMessage(IDs.PropertyNotSetBefore, propertyName, functionName); + } + + public static string BookmarkNotDefined(string bookmarkName) + { + return FormatMessage(IDs.BookmarkNotDefined, bookmarkName); + } + + public static string ImageNotFound(string imageName) + { + return FormatMessage(IDs.ImageNotFound, imageName); + } + + public static string InvalidImageType(string type) + { + return FormatMessage(IDs.InvalidImageType, type); + } + + public static string ImageNotReadable(string imageName, string innerException) + { + return FormatMessage(IDs.ImageNotReadable, imageName, innerException); + } + + public static string EmptyImageSize + { + get { return FormatMessage(IDs.EmptyImageSize); } + } + + public static string ObjectNotRenderable + { + get { return FormatMessage(IDs.ObjectNotRenderable); } + } + + + // ReSharper disable InconsistentNaming + private enum IDs + { + PropertyNotSetBefore, + BookmarkNotDefined, + ImageNotFound, + InvalidImageType, + ImageNotReadable, + EmptyImageSize, + ObjectNotRenderable, + NumberTooLargeForRoman, + NumberTooLargeForLetters, + DisplayEmptyImageSize, + DisplayImageFileNotFound, + DisplayInvalidImageType, + DisplayImageNotRead + } + // ReSharper restore InconsistentNaming + + private static ResourceManager ResourceManager + { + // ReSharper disable ConvertIfStatementToNullCoalescingExpression + get + { + if (_resourceManager == null) + { +#if !NETFX_CORE + _resourceManager = new ResourceManager("MigraDoc.Rendering.Resources.Messages", Assembly.GetExecutingAssembly()); +#else + _resourceManager = new ResourceManager("MigraDoc.Rendering.Resources.Messages", typeof(Messages2).GetTypeInfo().Assembly); +#endif + } + return _resourceManager; + } + // ReSharper restore ConvertIfStatementToNullCoalescingExpression + } + private static ResourceManager _resourceManager; + + + private static string FormatMessage(IDs id, params object[] args) + { + string message; + try + { + message = ResourceManager.GetString(id.ToString()); + if (message != null) + { +#if DEBUG + if (Regex.Matches(message, @"\{[0-9]\}").Count > args.Length) + { + //TODO too many placeholders or too few args... + } +#endif + message = String.Format(message, args); + } + else + message = "<<>>"; + return message; + } + catch (Exception ex) + { + message = "public ERROR while formatting error message: " + ex; + } + return message; + } + } +} diff --git a/MigraDoc.Rendering/Rendering.Resources/Messages2.de.resx b/MigraDoc.Rendering/Rendering.Resources/Messages2.de.resx new file mode 100644 index 0000000..7caa3d9 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.Resources/Messages2.de.resx @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Ihre Benutzereingaben führten zu einem leeren Bildbereich. + + + Bild nicht gefunden. + + + Bild nicht eingelesen. + + + Die Zahl {0} ist zu groß für eine Darstellung in Buchstaben. + + + Lesezeichen '{0}' ist innerhalb des Dokuments nicht definiert. + + + Ungültiger Bildtyp: '{0}'. + + + Die Zahl {0} ist zu groß für eine Darstellung in römischen Ziffern. + + + Bild '{0}' nicht gefunden. + + + '{0}' muss vor dem Aufruf von '{1}' gesetzt werden. + + + Leerer Bildbereich. + + + Ungültiger Bildtyp. + + + Nur Bilder, Textrahmen, Diagramme und Absätze können frei gerendert werden. + + + Bild '{0}' konnte nicht eingelesen werden. Es trat eine Ausnahme mit der folgenden Meldung auf: +{1} + + \ No newline at end of file diff --git a/MigraDoc.Rendering/Rendering.Resources/Messages2.resx b/MigraDoc.Rendering/Rendering.Resources/Messages2.resx new file mode 100644 index 0000000..388eb9e --- /dev/null +++ b/MigraDoc.Rendering/Rendering.Resources/Messages2.resx @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The specified image size is empty. + + + Image not found. + + + Image could not be read. + + + The number {0} is to large to be displayed as letters. + + + Bookmark '{0}' is not defined within the document. + + + Invalid image type: '{0}'. + + + The number {0} is to large to be displayed as roman. + + + Image '{0}' not found. + + + '{0}' must be set before calling '{1}'. + + + Image has empty size. + + + Image has no valid type. + + + Only images, textframes, charts and paragraphs can be rendered freely. + + + Image {0} could not be read. + Inner exception: {1} + + \ No newline at end of file diff --git a/MigraDoc.Rendering/Rendering.UnitTest/TestLayout.cs b/MigraDoc.Rendering/Rendering.UnitTest/TestLayout.cs new file mode 100644 index 0000000..588f050 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.UnitTest/TestLayout.cs @@ -0,0 +1,78 @@ +using MigraDoc.DocumentObjectModel; + +#pragma warning disable 1591 + +namespace MigraDoc.Rendering.UnitTest +{ + /// + /// Summary description for TestLayout. + /// + public class TestLayout + { + public static void TwoParagraphs(string outputFile) + { + Document doc = new Document(); + Section sec = doc.Sections.AddSection(); + + sec.PageSetup.TopMargin = 0; + sec.PageSetup.BottomMargin = 0; + + Paragraph par1 = sec.AddParagraph(); + TestParagraphRenderer.FillFormattedParagraph(par1); + TestParagraphRenderer.GiveBorders(par1); + par1.Format.SpaceAfter = "2cm"; + par1.Format.SpaceBefore = "3cm"; + Paragraph par2 = sec.AddParagraph(); + TestParagraphRenderer.FillFormattedParagraph(par2); + TestParagraphRenderer.GiveBorders(par2); + par2.Format.SpaceBefore = "3cm"; + + PdfDocumentRenderer renderer = new PdfDocumentRenderer(); + renderer.Document = doc; + renderer.RenderDocument(); + renderer.PdfDocument.Save(outputFile); + } + + public static void A1000Paragraphs(string outputFile) + { + Document doc = new Document(); + Section sec = doc.Sections.AddSection(); + + sec.PageSetup.TopMargin = 0; + sec.PageSetup.BottomMargin = 0; + + for (int idx = 1; idx <= 1000; ++idx) + { + Paragraph par = sec.AddParagraph(); + par.AddText("Paragraph " + idx + ": "); + TestParagraphRenderer.FillFormattedParagraph(par); + TestParagraphRenderer.GiveBorders(par); + } + PdfDocumentRenderer renderer = new PdfDocumentRenderer(); + renderer.Document = doc; + renderer.RenderDocument(); + renderer.PdfDocument.Save(outputFile); + } + + public static string DumpParagraph() + { + return ""; + // Document doc = new Document(); + // Paragraph par = doc.Sections.AddSection().AddParagraph(); + // par.Format.SpaceAfter = "3cm"; + // par.Format.SpaceBefore = "2cm"; + // TestParagraphRenderer.FillFormattedParagraph(par); + // PdfFlattenVisitor visitor = new PdfFlattenVisitor(doc); + // visitor.Visit(); + // + // XGraphics gfx = XGraphics.FromGraphics(Graphics.FromHwnd(IntPtr.Zero), new XSize(2000, 2000)); + // //Renderer rndrr = Renderer.Create(gfx, par, new FieldInfos(new Hashtable())); + // rndrr.Format(new Rectangle(0, 0, XUnit.FromCentimeter(21), XUnit.FromCentimeter(29)), null); + // string retVal = ValueDumper.DumpValues(rndrr.RenderInfo.LayoutInfo); + // retVal += "\r\n"; + // + // retVal += ValueDumper.DumpValues(rndrr.RenderInfo.LayoutInfo.ContentArea); + // return retVal; + } + } +} diff --git a/MigraDoc.Rendering/Rendering.UnitTest/TestParagraphIterator.cs b/MigraDoc.Rendering/Rendering.UnitTest/TestParagraphIterator.cs new file mode 100644 index 0000000..ad96335 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.UnitTest/TestParagraphIterator.cs @@ -0,0 +1,47 @@ +using MigraDoc.DocumentObjectModel; + +#pragma warning disable 1591 + +namespace MigraDoc.Rendering.UnitTest +{ + /// + /// Summary description for TestParagraphIterator. + /// + public class TestParagraphIterator + { + public TestParagraphIterator() + { } + + public static string GetIterators(Paragraph paragraph) + { + ParagraphIterator iter = new ParagraphIterator(paragraph.Elements); + iter = iter.GetFirstLeaf(); + string retString = ""; + while (iter != null) + { + retString += "[" + iter.Current.GetType().Name + ":]"; + if (iter.Current is Text) + retString += ((Text)iter.Current).Content; + + iter = iter.GetNextLeaf(); + } + return retString; + } + + public static string GetBackIterators(Paragraph paragraph) + { + ParagraphIterator iter = new ParagraphIterator(paragraph.Elements); + iter = iter.GetLastLeaf(); + string retString = ""; + while (iter != null) + { + retString += "[" + iter.Current.GetType().Name + ":]"; + if (iter.Current is Text) + retString += ((Text)iter.Current).Content; + + iter = iter.GetPreviousLeaf(); + } + return retString; + } + } +} diff --git a/MigraDoc.Rendering/Rendering.UnitTest/TestParagraphRenderer.cs b/MigraDoc.Rendering/Rendering.UnitTest/TestParagraphRenderer.cs new file mode 100644 index 0000000..8ce4c8e --- /dev/null +++ b/MigraDoc.Rendering/Rendering.UnitTest/TestParagraphRenderer.cs @@ -0,0 +1,211 @@ +using MigraDoc.DocumentObjectModel; + +namespace MigraDoc.Rendering.UnitTest +{ + /// + /// Summary description for ParagraphRenderer. + /// + public class TestParagraphRenderer + { + /// + /// Tests texts and blanks. + /// + public static void TextAndBlanks(string pdfOutputFile) + { + Document document = new Document(); + Section section = document.AddSection(); + Paragraph par = section.AddParagraph("Dies"); + for (int idx = 0; idx <= 40; ++idx) + { + par.AddCharacter(SymbolName.Blank); + par.AddText(idx.ToString()); + par.AddCharacter(SymbolName.Blank); + par.AddText((idx + 1).ToString()); + par.AddCharacter(SymbolName.Blank); + par.AddText((idx + 2).ToString()); + } + PdfDocumentRenderer renderer = new PdfDocumentRenderer(); + renderer.Document = document; + renderer.RenderDocument(); + renderer.PdfDocument.Save(pdfOutputFile); + } + + /// + /// Tests AddFormattedText. + /// + public static void Formatted(string pdfOutputFile) + { + Document document = new Document(); + Section section = document.AddSection(); + Paragraph par = section.AddParagraph(); + FillFormattedParagraph(par); + PdfDocumentRenderer printer = new PdfDocumentRenderer(); + printer.Document = document; + printer.RenderDocument(); + printer.PdfDocument.Save(pdfOutputFile); + } + + public static void FillFormattedParagraph(Paragraph par) + { + for (int idx = 0; idx <= 140; ++idx) + { + if (idx < 60) + { + FormattedText formText = par.AddFormattedText((idx).ToString(), TextFormat.Bold); + formText.Font.Size = 16; + formText.AddText(" "); + } + else if (idx < 100) + { + par.AddText((idx).ToString()); + par.AddText(" "); + } + else + { + FormattedText formText = par.AddFormattedText((idx).ToString(), TextFormat.Italic); + formText.Font.Size = 6; + formText.AddText(" "); + } + if (idx % 50 == 0) + par.AddLineBreak(); + } + par.AddText(" ...ready."); + } + + /// + /// Tests alignments. + /// + public static void Alignment(string pdfOutputFile) + { + Document document = new Document(); + Section section = document.AddSection(); + section.PageSetup.LeftMargin = 0; + section.PageSetup.RightMargin = 0; + Paragraph par = section.AddParagraph(); + // FillFormattedParagraph(par); + // par.Format.Alignment = ParagraphAlignment.Left; + + // par = section.AddParagraph(); + // FillFormattedParagraph(par); + // par.Format.Alignment = ParagraphAlignment.Right; + + // par = section.AddParagraph(); + FillFormattedParagraph(par); + par.Format.Alignment = ParagraphAlignment.Center; + // + // par = section.AddParagraph(); + // FillFormattedParagraph(par); + // par.Format.Alignment = ParagraphAlignment.Justify; + + par.Format.FirstLineIndent = "-2cm"; + par.Format.LeftIndent = "2cm"; + par.Format.RightIndent = "3cm"; + PdfDocumentRenderer renderer = new PdfDocumentRenderer(); + renderer.Document = document; + renderer.RenderDocument(); + renderer.PdfDocument.Save(pdfOutputFile); + } + + /// + /// Tests tab stops. + /// + public static void Tabs(string pdfOutputFile) + { + Document document = new Document(); + Section section = document.AddSection(); + section.PageSetup.LeftMargin = 0; + section.PageSetup.RightMargin = 0; + Paragraph par = section.AddParagraph(); + par.Format.TabStops.AddTabStop("20cm", TabAlignment.Right); + par.AddText(" text before tab bla bla bla. text before tab bla bla bla. text before tab bla bla bla. text before tab bla bla bla."); + //par.AddTab(); + par.AddText(" ............ after tab bla bla bla."); + PdfDocumentRenderer renderer = new PdfDocumentRenderer(); + renderer.Document = document; + renderer.RenderDocument(); + renderer.PdfDocument.Save(pdfOutputFile); + } + + public static void GiveBorders(Paragraph par) + { + Borders borders = par.Format.Borders; + borders.Top.Color = Colors.Gray; + borders.Top.Width = 4; + borders.Top.Style = BorderStyle.DashDot; + borders.Left.Color = Colors.Red; + borders.Left.Style = BorderStyle.Dot; + borders.Left.Width = 7; + borders.Bottom.Color = Colors.Red; + borders.Bottom.Width = 3; + borders.Bottom.Style = BorderStyle.DashLargeGap; + borders.Right.Style = BorderStyle.DashSmallGap; + borders.Right.Width = 3; + + borders.DistanceFromBottom = "1cm"; + borders.DistanceFromTop = "1.5cm"; + + borders.DistanceFromLeft = "0.5cm"; + borders.DistanceFromRight = "2cm"; + + par.Format.Shading.Color = Colors.LightBlue; + } + + /// + /// Tests borders. + /// + public static void Borders(string outputFile) + { + Document document = new Document(); + Section section = document.AddSection(); + Paragraph par = section.AddParagraph(); + FillFormattedParagraph(par); + GiveBorders(par); + + PdfDocumentRenderer renderer = new PdfDocumentRenderer(); + renderer.Document = document; + renderer.RenderDocument(); + renderer.PdfDocument.Save(outputFile); + } + + /// + /// Tests document fields. + /// + public static void Fields(string outputFile) + { + Document document = new Document(); + Section section = document.AddSection(); + Paragraph par = section.AddParagraph(); + par.AddText("Section: "); + par.AddSectionField().Format = "ALPHABETIC"; + par.AddLineBreak(); + + par.AddText("SectionPages: "); + par.AddSectionField().Format = "alphabetic"; + par.AddLineBreak(); + + par.AddText("Page: "); + par.AddPageField().Format = "ROMAN"; + par.AddLineBreak(); + + par.AddText("NumPages: "); + par.AddNumPagesField(); + par.AddLineBreak(); + + par.AddText("Date: "); + par.AddDateField(); + par.AddLineBreak(); + + par.AddText("Bookmark: "); + par.AddBookmark("Egal"); + par.AddLineBreak(); + + par.AddText("PageRef: "); + par.AddPageRefField("Egal"); + + PdfDocumentRenderer renderer = new PdfDocumentRenderer(); + renderer.Document = document; + renderer.RenderDocument(); + renderer.PdfDocument.Save(outputFile); + } + } +} \ No newline at end of file diff --git a/MigraDoc.Rendering/Rendering.UnitTest/TestTable.cs b/MigraDoc.Rendering/Rendering.UnitTest/TestTable.cs new file mode 100644 index 0000000..7424134 --- /dev/null +++ b/MigraDoc.Rendering/Rendering.UnitTest/TestTable.cs @@ -0,0 +1,99 @@ +using MigraDoc.DocumentObjectModel; +using MigraDoc.DocumentObjectModel.Tables; + +#pragma warning disable 1591 + +namespace MigraDoc.Rendering.UnitTest +{ + /// + /// Summary description for TestTable. + /// + public class TestTable + { + public static void Borders(string outputFile) + { + Document document = new Document(); + Section sec = document.Sections.AddSection(); + sec.AddParagraph("A paragraph before."); + Table table = sec.AddTable(); + table.Borders.Visible = true; + table.AddColumn(); + table.AddColumn(); + table.Rows.HeightRule = RowHeightRule.Exactly; + table.Rows.Height = 14; + Row row = table.AddRow(); + Cell cell = row.Cells[0]; + cell.Borders.Visible = true; + cell.Borders.Left.Width = 8; + cell.Borders.Right.Width = 2; + cell.AddParagraph("First Cell"); + + row = table.AddRow(); + cell = row.Cells[1]; + cell.AddParagraph("Last Cell within this table"); + cell.Borders.Bottom.Width = 15; + cell.Shading.Color = Colors.LightBlue; + sec.AddParagraph("A Paragraph afterwards"); + PdfDocumentRenderer renderer = new PdfDocumentRenderer(); + renderer.Document = document; + renderer.RenderDocument(); + renderer.PdfDocument.Save(outputFile); + } + + public static void CellMerge(string outputFile) + { + Document document = new Document(); + Section sec = document.Sections.AddSection(); + sec.AddParagraph("A paragraph before."); + Table table = sec.AddTable(); + table.Borders.Visible = true; + table.AddColumn(); + table.AddColumn(); + Row row = table.AddRow(); + Cell cell = row.Cells[0]; + cell.MergeRight = 1; + cell.Borders.Visible = true; + cell.Borders.Left.Width = 8; + cell.Borders.Right.Width = 2; + cell.AddParagraph("First Cell"); + + row = table.AddRow(); + cell = row.Cells[1]; + cell.AddParagraph("Last Cell within this row"); + cell.MergeDown = 1; + cell.Borders.Bottom.Width = 15; + cell.Borders.Right.Width = 30; + cell.Shading.Color = Colors.LightBlue; + row = table.AddRow(); + sec.AddParagraph("A Paragraph afterwards"); + PdfDocumentRenderer renderer = new PdfDocumentRenderer(); + renderer.Document = document; + renderer.RenderDocument(); + renderer.PdfDocument.Save(outputFile); + } + + public static void VerticalAlign(string outputFile) + { + Document document = new Document(); + Section sec = document.Sections.AddSection(); + sec.AddParagraph("A paragraph before."); + Table table = sec.AddTable(); + table.Borders.Visible = true; + table.AddColumn(); + table.AddColumn(); + Row row = table.AddRow(); + row.HeightRule = RowHeightRule.Exactly; + row.Height = 70; + row.VerticalAlignment = VerticalAlignment.Center; + row[0].AddParagraph("First Cell"); + row[1].AddParagraph("Second Cell"); + sec.AddParagraph("A Paragraph afterwards."); + + + PdfDocumentRenderer renderer = new PdfDocumentRenderer(); + renderer.Document = document; + renderer.RenderDocument(); + renderer.PdfDocument.Save(outputFile); + } + } +} diff --git a/MigraDoc.Rendering/Rendering.UnitTest/ValueDumper.cs b/MigraDoc.Rendering/Rendering.UnitTest/ValueDumper.cs new file mode 100644 index 0000000..f0ba2cb --- /dev/null +++ b/MigraDoc.Rendering/Rendering.UnitTest/ValueDumper.cs @@ -0,0 +1,26 @@ +using System.Reflection; + +namespace MigraDoc.Rendering.UnitTest +{ + /// + /// Summary description for ValueDumper. + /// + public class ValueDumper + { + public ValueDumper() + { } + + public static string DumpValues(object obj) + { + string dumpString = "[" + obj.GetType() + "]\r\n"; + foreach (FieldInfo fieldInfo in obj.GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) + { + if (fieldInfo.FieldType.IsValueType) + { + dumpString += " " + fieldInfo.Name + " = " + fieldInfo.GetValue(obj) + "\r\n"; + } + } + return dumpString; + } + } +} diff --git a/MigraDoc.Rendering/Rendering/Area.cs b/MigraDoc.Rendering/Rendering/Area.cs new file mode 100644 index 0000000..f0a9138 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/Area.cs @@ -0,0 +1,192 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering +{ + /// + /// Abstract base class for all areas to render in. + /// + public abstract class Area + { + /// + /// Gets the left boundary of the area. + /// + public abstract XUnit X { get; set; } + + /// + /// Gets the top boundary of the area. + /// + public abstract XUnit Y { get; set; } + + /// + /// Gets the largest fitting rect with the given y position and height. + /// + /// Top bound of the searched rectangle. + /// Height of the searched rectangle. + /// + /// The largest fitting rect with the given y position and height. + /// Null if yPosition exceeds the area. + /// + public abstract Rectangle GetFittingRect(XUnit yPosition, XUnit height); + + /// + /// Gets or sets the height of the smallest rectangle containing the area. + /// + public abstract XUnit Height { get; set; } + + /// + /// Gets or sets the width of the smallest rectangle containing the area. + /// + public abstract XUnit Width { get; set; } + + /// + /// Returns the union of this area snd the given one. + /// + /// The area to unite with. + /// The union of the two areas. + public abstract Area Unite(Area area); + + /// + /// Lowers the area and makes it smaller. + /// + /// The measure of lowering. + /// The lowered Area. + public abstract Area Lower(XUnit verticalOffset); + } + + public class Rectangle : Area + { + /// + /// Initializes a new rectangle object. + /// + /// Left bound of the rectangle. + /// Upper bound of the rectangle. + /// Width of the rectangle. + /// Height of the rectangle. + public Rectangle(XUnit x, XUnit y, XUnit width, XUnit height) + { + _x = x; + _y = y; + _width = width; + _height = height; + } + + /// + /// Initializes a new Rectangle by copying its values. + /// + /// The rectangle to copy. + public Rectangle(Rectangle rect) + { + _x = rect._x; + _y = rect._y; + _width = rect._width; + _height = rect._height; + } + + /// + /// Gets the largest fitting rect with the given y position and height. + /// + /// Top boundary of the requested rectangle. + /// Height of the requested rectangle. + /// The largest fitting rect with the given y position and height or NULL if the requested height does not fit. + public override Rectangle GetFittingRect(XUnit yPosition, XUnit height) + { + if (yPosition + height > _y + _height + Renderer.Tolerance) + return null; + + return new Rectangle(_x, yPosition, _width, height); + } + + /// + /// Gets or sets the left boundary of the rectangle. + /// + public override XUnit X + { + get { return _x; } + set { _x = value; } + } + XUnit _x; + + /// + /// Gets or sets the top boundary of the rectangle. + /// + public override XUnit Y + { + get { return _y; } + set { _y = value; } + } + XUnit _y; + + /// + /// Gets or sets the width of the rectangle. + /// + public override XUnit Width + { + get { return _width; } + set { _width = value; } + } + XUnit _width; + + /// + /// Gets or sets the height of the rectangle. + /// + public override XUnit Height + { + get { return _height; } + set { _height = value; } + } + XUnit _height; + + /// + /// Returns the union of the rectangle and the given area. + /// + /// The area to unite with. + /// The union of the two areas. + public override Area Unite(Area area) + { + if (area == null) + return this; + // This implementation is of course not correct, but it works for our purposes. + XUnit minTop = Math.Min(_y, area.Y); + XUnit minLeft = Math.Min(_x, area.X); + XUnit maxRight = Math.Max(_x + _width, area.X + area.Width); + XUnit maxBottom = Math.Max(_y + _height, area.Y + area.Height); + return new Rectangle(minLeft, minTop, maxRight - minLeft, maxBottom - minTop); + } + + public override Area Lower(XUnit verticalOffset) + { + return new Rectangle(_x, _y + verticalOffset, _width, _height - verticalOffset); + } + } +} diff --git a/MigraDoc.Rendering/Rendering/BordersRenderer.cs b/MigraDoc.Rendering/Rendering/BordersRenderer.cs new file mode 100644 index 0000000..b0e0ecc --- /dev/null +++ b/MigraDoc.Rendering/Rendering/BordersRenderer.cs @@ -0,0 +1,305 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using MigraDoc.DocumentObjectModel; +using MigraDoc.DocumentObjectModel.Tables; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering +{ + /// + /// Renders a single Border. + /// + public class BordersRenderer + { + public BordersRenderer(Borders borders, XGraphics gfx) + { + Debug.Assert(borders.Document != null); + _gfx = gfx; + _borders = borders; + } + + private Border GetBorder(BorderType type) + { + return _borders.GetBorderReadOnly(type); + } + + private XColor GetColor(BorderType type) + { + Color clr = Colors.Black; + + Border border = GetBorder(type); + if (border != null && !border.Color.IsEmpty) + clr = border.Color; + else if (!_borders.Color.IsEmpty) + clr = _borders.Color; + +#if noCMYK + return XColor.FromArgb((int)clr.Argb); +#else + // bool cmyk = false; // BUG CMYK + // if (_borders.Document != null) + // cmyk = _borders.Document.UseCmykColor; + //#if DEBUG + // else + // GetT ype(); + //#endif + return ColorHelper.ToXColor(clr, _borders.Document.UseCmykColor); +#endif + } + + private BorderStyle GetStyle(BorderType type) + { + BorderStyle style = BorderStyle.Single; + + Border border = GetBorder(type); + if (border != null && !border._style.IsNull) + style = border.Style; + else if (!_borders._style.IsNull) + style = _borders.Style; + return style; + } + + public XUnit GetWidth(BorderType type) + { + if (_borders == null) + return 0; + + Border border = GetBorder(type); + + if (border != null) + { + if (!border._visible.IsNull && !border.Visible) + return 0; + + if (!border._width.IsNull) + return border.Width.Point; + + if (!border._color.IsNull || !border._style.IsNull || border.Visible) + { + if (!_borders._width.IsNull) + return _borders.Width.Point; + + return 0.5; + } + } + else if (!(type == BorderType.DiagonalDown || type == BorderType.DiagonalUp)) + { + if (!_borders._visible.IsNull && !_borders.Visible) + return 0; + + if (!_borders._width.IsNull) + return _borders.Width.Point; + + if (!_borders._color.IsNull || !_borders._style.IsNull || _borders.Visible) + return 0.5; + } + return 0; + } + + /// + /// Renders the border top down. + /// + /// The type of the border. + /// The left position of the border. + /// The top position of the border. + /// The height on which to render the border. + public void RenderVertically(BorderType type, XUnit left, XUnit top, XUnit height) + { + XUnit borderWidth = GetWidth(type); + if (borderWidth == 0) + return; + + left += borderWidth / 2; + _gfx.DrawLine(GetPen(type), left, top + height, left, top); + } + + /// + /// Renders the border top down. + /// + /// The type of the border. + /// The left position of the border. + /// The top position of the border. + /// The width on which to render the border. + public void RenderHorizontally(BorderType type, XUnit left, XUnit top, XUnit width) + { + XUnit borderWidth = GetWidth(type); + if (borderWidth == 0) + return; + + top += borderWidth / 2; + _gfx.DrawLine(GetPen(type), left + width, top, left, top); + } + + + public void RenderDiagonally(BorderType type, XUnit left, XUnit top, XUnit width, XUnit height) + { + XUnit borderWidth = GetWidth(type); + if (borderWidth == 0) + return; + + XGraphicsState state = _gfx.Save(); + _gfx.IntersectClip(new XRect(left, top, width, height)); + + if (type == BorderType.DiagonalDown) + _gfx.DrawLine(GetPen(type), left, top, left + width, top + height); + else if (type == BorderType.DiagonalUp) + _gfx.DrawLine(GetPen(type), left, top + height, left + width, top); + + _gfx.Restore(state); + } + + public void RenderRounded(RoundedCorner roundedCorner, XUnit x, XUnit y, XUnit width, XUnit height) + { + if (roundedCorner == RoundedCorner.None) + return; + + // As source we use the vertical borders. + // If not set originally, they have been set to the horizontal border values in TableRenderer.EqualizeRoundedCornerBorders(). + BorderType borderType = BorderType.Top; + if (roundedCorner == RoundedCorner.TopLeft || roundedCorner == RoundedCorner.BottomLeft) + borderType = BorderType.Left; + if (roundedCorner == RoundedCorner.TopRight || roundedCorner == RoundedCorner.BottomRight) + borderType = BorderType.Right; + + XUnit borderWidth = GetWidth(borderType); + XPen borderPen = GetPen(borderType); + + if (borderWidth == 0) + return; + + + x -= borderWidth / 2; + y -= borderWidth / 2; + XUnit ellipseWidth = width * 2 + borderWidth; + XUnit ellipseHeight = height * 2 + borderWidth; + + switch (roundedCorner) + { + case RoundedCorner.TopLeft: + _gfx.DrawArc(borderPen, new XRect(x, y, ellipseWidth, ellipseHeight), 180, 90); + break; + case RoundedCorner.TopRight: + _gfx.DrawArc(borderPen, new XRect(x - width, y, ellipseWidth, ellipseHeight), 270, 90); + break; + case RoundedCorner.BottomRight: + _gfx.DrawArc(borderPen, new XRect(x - width, y - height, ellipseWidth, ellipseHeight), 0, 90); + break; + case RoundedCorner.BottomLeft: + _gfx.DrawArc(borderPen, new XRect(x, y - height, ellipseWidth, ellipseHeight), 90, 90); + break; + } + } + + private XPen GetPen(BorderType type) + { + XUnit borderWidth = GetWidth(type); + if (borderWidth == 0) + return null; + + XPen pen = new XPen(GetColor(type), borderWidth); + BorderStyle style = GetStyle(type); + switch (style) + { + case BorderStyle.DashDot: + pen.DashStyle = XDashStyle.DashDot; + break; + + case BorderStyle.DashDotDot: + pen.DashStyle = XDashStyle.DashDotDot; + break; + + case BorderStyle.DashLargeGap: + pen.DashPattern = new double[] { 3, 3 }; + break; + + case BorderStyle.DashSmallGap: + pen.DashPattern = new double[] { 5, 1 }; + break; + + case BorderStyle.Dot: + pen.DashStyle = XDashStyle.Dot; + break; + + case BorderStyle.Single: + default: + pen.DashStyle = XDashStyle.Solid; + break; + } + return pen; + } + + public bool IsRendered(BorderType borderType) + { + if (_borders == null) + return false; + + switch (borderType) + { + case BorderType.Left: + if (_borders._left == null || _borders._left.IsNull()) + return false; + return GetWidth(borderType) > 0; + + case BorderType.Right: + if (_borders._right == null || _borders._right.IsNull()) + return false; + return GetWidth(borderType) > 0; + + case BorderType.Top: + if (_borders._top == null || _borders._top.IsNull()) + return false; + return GetWidth(borderType) > 0; + + case BorderType.Bottom: + if (_borders._bottom == null || _borders._bottom.IsNull()) + return false; + + return GetWidth(borderType) > 0; + + case BorderType.DiagonalDown: + if (_borders._diagonalDown == null || _borders._diagonalDown.IsNull()) + return false; + return GetWidth(borderType) > 0; + + case BorderType.DiagonalUp: + if (_borders._diagonalUp == null || _borders._diagonalUp.IsNull()) + return false; + + return GetWidth(borderType) > 0; + } + return false; + } + + readonly XGraphics _gfx; + readonly Borders _borders; + } +} diff --git a/MigraDoc.Rendering/Rendering/ChartFormatInfo.cs b/MigraDoc.Rendering/Rendering/ChartFormatInfo.cs new file mode 100644 index 0000000..76af256 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ChartFormatInfo.cs @@ -0,0 +1,48 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Charting; + +namespace MigraDoc.Rendering +{ + /// + /// Formatting information for a chart. + /// + public sealed class ChartFormatInfo : ShapeFormatInfo + { + public ChartFrame ChartFrame; + public FormattedTextArea FormattedHeader; + public FormattedTextArea FormattedLeft; + public FormattedTextArea FormattedTop; + public FormattedTextArea FormattedBottom; + public FormattedTextArea FormattedRight; + public FormattedTextArea FormattedFooter; + } +} diff --git a/MigraDoc.Rendering/Rendering/ChartRenderInfo.cs b/MigraDoc.Rendering/Rendering/ChartRenderInfo.cs new file mode 100644 index 0000000..3280e2b --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ChartRenderInfo.cs @@ -0,0 +1,48 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.Rendering +{ + /// + /// Rendering information for charts. + /// + public sealed class ChartRenderInfo : ShapeRenderInfo + { + public ChartRenderInfo() + { } + + public override FormatInfo FormatInfo + { + get { return _formatInfo ?? (_formatInfo = new ChartFormatInfo()); } + set { _formatInfo = (ChartFormatInfo)value; } + } + ChartFormatInfo _formatInfo; + } +} diff --git a/MigraDoc.Rendering/Rendering/ChartRenderer.cs b/MigraDoc.Rendering/Rendering/ChartRenderer.cs new file mode 100644 index 0000000..0ceb3e1 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ChartRenderer.cs @@ -0,0 +1,368 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.publics; +using MigraDoc.DocumentObjectModel.Tables; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel.Shapes; +using MigraDoc.DocumentObjectModel.Shapes.Charts; + +namespace MigraDoc.Rendering +{ + /// + /// Renders a chart to an XGraphics object. + /// + public class ChartRenderer : ShapeRenderer + { + public ChartRenderer(XGraphics gfx, Chart chart, FieldInfos fieldInfos) + : base(gfx, chart, fieldInfos) + { + _chart = chart; + ChartRenderInfo renderInfo = new ChartRenderInfo(); + renderInfo.DocumentObject = _shape; + _renderInfo = renderInfo; + } + + public ChartRenderer(XGraphics gfx, RenderInfo renderInfo, FieldInfos fieldInfos) + : base(gfx, renderInfo, fieldInfos) + { + _chart = (Chart)renderInfo.DocumentObject; + } + + FormattedTextArea GetFormattedTextArea(TextArea area, XUnit width) + { + if (area == null) + return null; + + FormattedTextArea formattedTextArea = new FormattedTextArea(_documentRenderer, area, _fieldInfos); + + if (!double.IsNaN(width)) + formattedTextArea.InnerWidth = width; + + formattedTextArea.Format(_gfx); + return formattedTextArea; + } + + FormattedTextArea GetFormattedTextArea(TextArea area) + { + return GetFormattedTextArea(area, double.NaN); + } + + void GetLeftRightVerticalPosition(out XUnit top, out XUnit bottom) + { + //REM: Line width is still ignored while layouting charts. + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo; + top = contentArea.Y; + + if (formatInfo.FormattedHeader != null) + top += formatInfo.FormattedHeader.InnerHeight; + + bottom = contentArea.Y + contentArea.Height; + if (formatInfo.FormattedFooter != null) + bottom -= formatInfo.FormattedFooter.InnerHeight; + } + + Rectangle GetLeftRect() + { + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo; + XUnit top; + XUnit bottom; + GetLeftRightVerticalPosition(out top, out bottom); + + XUnit left = contentArea.X; + XUnit width = formatInfo.FormattedLeft.InnerWidth; + + return new Rectangle(left, top, width, bottom - top); + } + + Rectangle GetRightRect() + { + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo; + XUnit top; + XUnit bottom; + GetLeftRightVerticalPosition(out top, out bottom); + + XUnit left = contentArea.X + contentArea.Width - formatInfo.FormattedRight.InnerWidth; + XUnit width = formatInfo.FormattedRight.InnerWidth; + + return new Rectangle(left, top, width, bottom - top); + } + + Rectangle GetHeaderRect() + { + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo; + + XUnit left = contentArea.X; + XUnit top = contentArea.Y; + XUnit width = contentArea.Width; + XUnit height = formatInfo.FormattedHeader.InnerHeight; + + return new Rectangle(left, top, width, height); + } + + Rectangle GetFooterRect() + { + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo; + + XUnit left = contentArea.X; + XUnit top = contentArea.Y + contentArea.Height - formatInfo.FormattedFooter.InnerHeight; + XUnit width = contentArea.Width; + XUnit height = formatInfo.FormattedFooter.InnerHeight; + + return new Rectangle(left, top, width, height); + } + + Rectangle GetTopRect() + { + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo; + + XUnit left; + XUnit right; + GetTopBottomHorizontalPosition(out left, out right); + + XUnit top = contentArea.Y; + if (formatInfo.FormattedHeader != null) + top += formatInfo.FormattedHeader.InnerHeight; + + XUnit height = formatInfo.FormattedTop.InnerHeight; + + return new Rectangle(left, top, right - left, height); + } + + Rectangle GetBottomRect() + { + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo; + + XUnit left; + XUnit right; + GetTopBottomHorizontalPosition(out left, out right); + + XUnit top = contentArea.Y + contentArea.Height - formatInfo.FormattedBottom.InnerHeight; + if (formatInfo.FormattedFooter != null) + top -= formatInfo.FormattedFooter.InnerHeight; + + XUnit height = formatInfo.FormattedBottom.InnerHeight; + return new Rectangle(left, top, right - left, height); + } + + Rectangle GetPlotRect() + { + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo; + XUnit top = contentArea.Y; + if (formatInfo.FormattedHeader != null) + top += formatInfo.FormattedHeader.InnerHeight; + + if (formatInfo.FormattedTop != null) + top += formatInfo.FormattedTop.InnerHeight; + + XUnit bottom = contentArea.Y + contentArea.Height; + if (formatInfo.FormattedFooter != null) + bottom -= formatInfo.FormattedFooter.InnerHeight; + + if (formatInfo.FormattedBottom != null) + bottom -= formatInfo.FormattedBottom.InnerHeight; + + XUnit left = contentArea.X; + if (formatInfo.FormattedLeft != null) + left += formatInfo.FormattedLeft.InnerWidth; + + XUnit right = contentArea.X + contentArea.Width; + if (formatInfo.FormattedRight != null) + right -= formatInfo.FormattedRight.InnerWidth; + + return new Rectangle(left, top, right - left, bottom - top); + } + + public override void Format(Area area, FormatInfo previousFormatInfo) + { + ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo; + + TextArea textArea = (TextArea)_chart.GetValue("HeaderArea", GV.ReadOnly); + formatInfo.FormattedHeader = GetFormattedTextArea(textArea, _chart.Width.Point); + + textArea = (TextArea)_chart.GetValue("FooterArea", GV.ReadOnly); + formatInfo.FormattedFooter = GetFormattedTextArea(textArea, _chart.Width.Point); + + textArea = (TextArea)_chart.GetValue("LeftArea", GV.ReadOnly); + formatInfo.FormattedLeft = GetFormattedTextArea(textArea); + + textArea = (TextArea)_chart.GetValue("RightArea", GV.ReadOnly); + formatInfo.FormattedRight = GetFormattedTextArea(textArea); + + textArea = (TextArea)_chart.GetValue("TopArea", GV.ReadOnly); + formatInfo.FormattedTop = GetFormattedTextArea(textArea, GetTopBottomWidth()); + + textArea = (TextArea)_chart.GetValue("BottomArea", GV.ReadOnly); + formatInfo.FormattedBottom = GetFormattedTextArea(textArea, GetTopBottomWidth()); + + base.Format(area, previousFormatInfo); + formatInfo.ChartFrame = ChartMapper.ChartMapper.Map(_chart); + } + + + XUnit AlignVertically(VerticalAlignment vAlign, XUnit top, XUnit bottom, XUnit height) + { + switch (vAlign) + { + case VerticalAlignment.Bottom: + return bottom - height; + + case VerticalAlignment.Center: + return (top + bottom - height) / 2; + + default: + return top; + } + } + + /// + /// Gets the width of the top and bottom area. + /// Used while formatting. + /// + /// The width of the top and bottom area + private XUnit GetTopBottomWidth() + { + ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo; + XUnit width = _chart.Width.Point; + if (formatInfo.FormattedRight != null) + width -= formatInfo.FormattedRight.InnerWidth; + if (formatInfo.FormattedLeft != null) + width -= formatInfo.FormattedLeft.InnerWidth; + return width; + } + + /// + /// Gets the horizontal boundaries of the top and bottom area. + /// Used while rendering. + /// + /// The left boundary of the top and bottom area + /// The right boundary of the top and bottom area + private void GetTopBottomHorizontalPosition(out XUnit left, out XUnit right) + { + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo; + left = contentArea.X; + right = contentArea.X + contentArea.Width; + + if (formatInfo.FormattedRight != null) + right -= formatInfo.FormattedRight.InnerWidth; + if (formatInfo.FormattedLeft != null) + left += formatInfo.FormattedLeft.InnerWidth; + } + + void RenderArea(FormattedTextArea area, Rectangle rect) + { + if (area == null) + return; + + TextArea textArea = area.TextArea; + + FillFormatRenderer fillFormatRenderer = new FillFormatRenderer((FillFormat)textArea.GetValue("FillFormat", GV.ReadOnly), _gfx); + fillFormatRenderer.Render(rect.X, rect.Y, rect.Width, rect.Height); + + XUnit top = rect.Y; + top += textArea.TopPadding; + XUnit bottom = rect.Y + rect.Height; + bottom -= textArea.BottomPadding; + top = AlignVertically(textArea.VerticalAlignment, top, bottom, area.ContentHeight); + + XUnit left = rect.X; + left += textArea.LeftPadding; + + RenderInfo[] renderInfos = area.GetRenderInfos(); + RenderByInfos(left, top, renderInfos); + + LineFormatRenderer lineFormatRenderer = new LineFormatRenderer((LineFormat)textArea.GetValue("LineFormat", GV.ReadOnly), _gfx); + lineFormatRenderer.Render(rect.X, rect.Y, rect.Width, rect.Height); + } + + public override void Render() + { + RenderFilling(); + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + + ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo; + if (formatInfo.FormattedHeader != null) + RenderArea(formatInfo.FormattedHeader, GetHeaderRect()); + + if (formatInfo.FormattedFooter != null) + RenderArea(formatInfo.FormattedFooter, GetFooterRect()); + + if (formatInfo.FormattedTop != null) + RenderArea(formatInfo.FormattedTop, GetTopRect()); + + if (formatInfo.FormattedBottom != null) + RenderArea(formatInfo.FormattedBottom, GetBottomRect()); + + if (formatInfo.FormattedLeft != null) + RenderArea(formatInfo.FormattedLeft, GetLeftRect()); + + if (formatInfo.FormattedRight != null) + RenderArea(formatInfo.FormattedRight, GetRightRect()); + + PlotArea plotArea = (PlotArea)_chart.GetValue("PlotArea", GV.ReadOnly); + if (plotArea != null) + RenderPlotArea(plotArea, GetPlotRect()); + + RenderLine(); + } + + void RenderPlotArea(PlotArea area, Rectangle rect) + { + PdfSharp.Charting.ChartFrame chartFrame = ((ChartFormatInfo)_renderInfo.FormatInfo).ChartFrame; + + XUnit top = rect.Y; + top += area.TopPadding; + + XUnit bottom = rect.Y + rect.Height; + bottom -= area.BottomPadding; + + XUnit left = rect.X; + left += area.LeftPadding; + + XUnit right = rect.X + rect.Width; + right -= area.RightPadding; + + chartFrame.Location = new XPoint(left, top); + chartFrame.Size = new XSize(right - left, bottom - top); + chartFrame.DrawChart(_gfx); + } + + readonly Chart _chart; + } +} diff --git a/MigraDoc.Rendering/Rendering/ColorHelper.cs b/MigraDoc.Rendering/Rendering/ColorHelper.cs new file mode 100644 index 0000000..9191168 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ColorHelper.cs @@ -0,0 +1,51 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel; + +namespace MigraDoc.Rendering +{ + static class ColorHelper + { + /// + /// Converts Color to XColor. + /// + public static XColor ToXColor(Color color, bool cmyk) + { + if (color.IsEmpty) + return XColor.Empty; + + if (cmyk) + return XColor.FromCmyk(color.Alpha / 100.0, color.C / 100.0, color.M / 100.0, color.Y / 100.0, color.K / 100.0); + return XColor.FromArgb((int)color.Argb); + } + } +} \ No newline at end of file diff --git a/MigraDoc.Rendering/Rendering/DocumentRenderer.cs b/MigraDoc.Rendering/Rendering/DocumentRenderer.cs new file mode 100644 index 0000000..a09fac6 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/DocumentRenderer.cs @@ -0,0 +1,405 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel; +using PdfSharp.Pdf; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel.Visitors; +using MigraDoc.DocumentObjectModel.Shapes; +using MigraDoc.DocumentObjectModel.Tables; +using MigraDoc.Rendering.Resources; + +namespace MigraDoc.Rendering +{ + /// + /// Provides methods to render the document or single parts of it to a XGraphics object. + /// + /// + /// One prepared instance of this class can serve to render several output formats. + /// + public class DocumentRenderer + { + /// + /// Initializes a new instance of the DocumentRenderer class. + /// + /// The migradoc document to render. + public DocumentRenderer(Document document) + { + _document = document; + } + + /// + /// Prepares this instance for rendering. + /// + public void PrepareDocument() + { + PdfFlattenVisitor visitor = new PdfFlattenVisitor(); + visitor.Visit(_document); + _previousListNumbers = new Dictionary(3); + _previousListNumbers[ListType.NumberList1] = 0; + _previousListNumbers[ListType.NumberList2] = 0; + _previousListNumbers[ListType.NumberList3] = 0; + _formattedDocument = new FormattedDocument(_document, this); + //REM: Size should not be necessary in this case. +#if true + XGraphics gfx = XGraphics.CreateMeasureContext(new XSize(2000, 2000), XGraphicsUnit.Point, XPageDirection.Downwards); +#else +#if GDI + XGraphics gfx = XGraphics.FromGraphics(Graphics.FromHwnd(IntPtr.Zero), new XSize(2000, 2000)); +#endif +#if WPF + XGraphics gfx = XGraphics.FromDrawingContext(null, new XSize(2000, 2000), XGraphicsUnit.Point); +#endif +#endif + // _previousListNumber = int.MinValue; + //gfx.MUH = _unicode; + //gfx.MFEH = _fontEmbedding; + + _previousListInfo = null; + _formattedDocument.Format(gfx); + } + + /// + /// Occurs while the document is being prepared (can be used to show a progress bar). + /// + public event PrepareDocumentProgressEventHandler PrepareDocumentProgress; + + /// + /// Allows applications to display a progress indicator while PrepareDocument() is being executed. + /// + /// + /// + public virtual void OnPrepareDocumentProgress(int value, int maximum) + { + if (PrepareDocumentProgress != null) + { + // Invokes the delegates. + PrepareDocumentProgressEventArgs e = new PrepareDocumentProgressEventArgs(value, maximum); + PrepareDocumentProgress(this, e); + } + } + + /// + /// Gets a value indicating whether this instance supports PrepareDocumentProgress. + /// + public bool HasPrepareDocumentProgress + { + get { return PrepareDocumentProgress != null; } + } + + /// + /// Gets the formatted document of this instance. + /// + public FormattedDocument FormattedDocument + { + get { return _formattedDocument; } + } + FormattedDocument _formattedDocument; + + /// + /// Renders a MigraDoc document to the specified graphics object. + /// + public void RenderPage(XGraphics gfx, int page) + { + RenderPage(gfx, page, PageRenderOptions.All); + } + + /// + /// Renders a MigraDoc document to the specified graphics object. + /// + public void RenderPage(XGraphics gfx, int page, PageRenderOptions options) + { + if (_formattedDocument.IsEmptyPage(page)) + return; + + FieldInfos fieldInfos = _formattedDocument.GetFieldInfos(page); + + fieldInfos.Date = _printDate != DateTime.MinValue ? _printDate : DateTime.Now; + + if ((options & PageRenderOptions.RenderHeader) == PageRenderOptions.RenderHeader) + RenderHeader(gfx, page); + if ((options & PageRenderOptions.RenderFooter) == PageRenderOptions.RenderFooter) + RenderFooter(gfx, page); + + if ((options & PageRenderOptions.RenderContent) == PageRenderOptions.RenderContent) + { + RenderInfo[] renderInfos = _formattedDocument.GetRenderInfos(page); + //foreach (RenderInfo renderInfo in renderInfos) + int count = renderInfos.Length; + for (int idx = 0; idx < count; idx++) + { + RenderInfo renderInfo = renderInfos[idx]; + Renderer renderer = Renderer.Create(gfx, this, renderInfo, fieldInfos); + renderer.Render(); + } + } + } + + /// + /// Gets the document objects that get rendered on the specified page. + /// + public DocumentObject[] GetDocumentObjectsFromPage(int page) + { + RenderInfo[] renderInfos = _formattedDocument.GetRenderInfos(page); + int count = renderInfos != null ? renderInfos.Length : 0; + DocumentObject[] documentObjects = new DocumentObject[count]; + for (int idx = 0; idx < count; idx++) + documentObjects[idx] = renderInfos[idx].DocumentObject; + return documentObjects; + } + + /// + /// Gets the render information for document objects that get rendered on the specified page. + /// + public RenderInfo[] GetRenderInfoFromPage(int page) + { + return _formattedDocument.GetRenderInfos(page); + } + + /// + /// Renders a single object to the specified graphics object at the given point. + /// + /// The graphics object to render on. + /// The left position of the rendered object. + /// The top position of the rendered object. + /// The width. + /// The document object to render. Can be paragraph, table, or shape. + /// This function is still in an experimental state. + public void RenderObject(XGraphics graphics, XUnit xPosition, XUnit yPosition, XUnit width, DocumentObject documentObject) + { + if (graphics == null) + throw new ArgumentNullException("graphics"); + + if (documentObject == null) + throw new ArgumentNullException("documentObject"); + + if (!(documentObject is Shape) && !(documentObject is Table) && + !(documentObject is Paragraph)) + throw new ArgumentException(Messages2.ObjectNotRenderable, "documentObject"); + + Renderer renderer = Renderer.Create(graphics, this, documentObject, null); + renderer.Format(new Rectangle(xPosition, yPosition, width, double.MaxValue), null); + + RenderInfo renderInfo = renderer.RenderInfo; + renderInfo.LayoutInfo.ContentArea.X = xPosition; + renderInfo.LayoutInfo.ContentArea.Y = yPosition; + + renderer = Renderer.Create(graphics, this, renderer.RenderInfo, null); + renderer.Render(); + } + + /// + /// Gets or sets the working directory for rendering. + /// + public string WorkingDirectory + { + get { return _workingDirectory; } + set { _workingDirectory = value; } + } + string _workingDirectory; + + private void RenderHeader(XGraphics graphics, int page) + { + FormattedHeaderFooter formattedHeader = _formattedDocument.GetFormattedHeader(page); + if (formattedHeader == null) + return; + + Rectangle headerArea = _formattedDocument.GetHeaderArea(page); + RenderInfo[] renderInfos = formattedHeader.GetRenderInfos(); + FieldInfos fieldInfos = _formattedDocument.GetFieldInfos(page); + foreach (RenderInfo renderInfo in renderInfos) + { + Renderer renderer = Renderer.Create(graphics, this, renderInfo, fieldInfos); + renderer.Render(); + } + } + + private void RenderFooter(XGraphics graphics, int page) + { + FormattedHeaderFooter formattedFooter = _formattedDocument.GetFormattedFooter(page); + if (formattedFooter == null) + return; + + Rectangle footerArea = _formattedDocument.GetFooterArea(page); + RenderInfo[] renderInfos = formattedFooter.GetRenderInfos(); +#if true +#if true + // The footer is bottom-aligned and grows with its contents. topY specifies the Y position where the footer begins. + XUnit topY = footerArea.Y + footerArea.Height - RenderInfo.GetTotalHeight(renderInfos); + // Hack: The purpose of "topY" is unclear, but two paragraphs in the footer will use the same topY and will be rendered at the same position. + // offsetY specifies the offset (amount of movement) for all footer items. It's the difference between topY and the position calculated for the first item. + XUnit offsetY = 0; + bool notFirst = false; + + FieldInfos fieldInfos = _formattedDocument.GetFieldInfos(page); + foreach (RenderInfo renderInfo in renderInfos) + { + Renderer renderer = Renderer.Create(graphics, this, renderInfo, fieldInfos); + if (!notFirst) + { + offsetY = renderer.RenderInfo.LayoutInfo.ContentArea.Y - topY; + notFirst = true; + } + XUnit savedY = renderer.RenderInfo.LayoutInfo.ContentArea.Y; + // Apply offsetY only to items that do not have an absolute position. + if (renderer.RenderInfo.LayoutInfo.Floating != Floating.None) + renderer.RenderInfo.LayoutInfo.ContentArea.Y -= offsetY; + renderer.Render(); + renderer.RenderInfo.LayoutInfo.ContentArea.Y = savedY; + } +#else + // TODO Document the purpose of "topY". + XUnit topY = footerArea.Y + footerArea.Height - RenderInfo.GetTotalHeight(renderInfos); + // Hack: The purpose of "topY" is unclear, but two paragraphs in the footer will use the same topY and will be rendered at the same position. + XUnit offsetY = 0; + + FieldInfos fieldInfos = _formattedDocument.GetFieldInfos(page); + foreach (RenderInfo renderInfo in renderInfos) + { + Renderer renderer = Renderer.Create(graphics, this, renderInfo, fieldInfos); + XUnit savedY = renderer.RenderInfo.LayoutInfo.ContentArea.Y; + renderer.RenderInfo.LayoutInfo.ContentArea.Y = topY + offsetY; + renderer.Render(); + renderer.RenderInfo.LayoutInfo.ContentArea.Y = savedY; + offsetY += renderer.RenderInfo.LayoutInfo.ContentArea.Height; + } +#endif +#else + XUnit topY = footerArea.Y + footerArea.Height - RenderInfo.GetTotalHeight(renderInfos); + + FieldInfos fieldInfos = _formattedDocument.GetFieldInfos(page); + foreach (RenderInfo renderInfo in renderInfos) + { + Renderer renderer = Renderer.Create(graphics, this, renderInfo, fieldInfos); + XUnit savedY = renderer.RenderInfo.LayoutInfo.ContentArea.Y; + renderer.RenderInfo.LayoutInfo.ContentArea.Y = topY; + renderer.Render(); + renderer.RenderInfo.LayoutInfo.ContentArea.Y = savedY; + } +#endif + } + + public void AddOutline(int level, string title, PdfPage destinationPage) + { + if (level < 1 || destinationPage == null) + return; + + PdfDocument document = destinationPage.Owner; + + if (document == null) + return; + + PdfOutlineCollection outlines = document.Outlines; + while (--level > 0) + { + int count = outlines.Count; + if (count == 0) + { + // You cannot add empty bookmarks to PDF. So we use blank here. + PdfOutline outline = outlines.Add(" ", destinationPage, true); + outlines = outline.Outlines; + } + else + outlines = outlines[count - 1].Outlines; + } + outlines.Add(title, destinationPage, true); + } + + public int NextListNumber(ListInfo listInfo) + { + ListType listType = listInfo.ListType; + bool isNumberList = listType == ListType.NumberList1 || + listType == ListType.NumberList2 || + listType == ListType.NumberList3; + + int listNumber = int.MinValue; + if (listInfo == _previousListInfo) + { + if (isNumberList) + return _previousListNumbers[listType]; + return listNumber; + } + + //bool listTypeChanged = _previousListInfo == null || _previousListInfo.ListType != listType; + + if (isNumberList) + { + listNumber = 1; + if (/*!listTypeChanged &&*/ (listInfo._continuePreviousList.IsNull || listInfo.ContinuePreviousList)) + listNumber = _previousListNumbers[listType] + 1; + + _previousListNumbers[listType] = listNumber; + } + + _previousListInfo = listInfo; + return listNumber; + } + ListInfo _previousListInfo; + Dictionary _previousListNumbers; + private readonly Document _document; + public DateTime _printDate = DateTime.MinValue; + + /// + /// Arguments for the PrepareDocumentProgressEvent which is called while a document is being prepared (you can use this to display a progress bar). + /// + public class PrepareDocumentProgressEventArgs : EventArgs + { + /// + /// Indicates the current step reached in document preparation. + /// + public int Value; + /// + /// Indicates the final step in document preparation. The quitient of Value and Maximum can be used to calculate a percentage (e. g. for use in a progress bar). + /// + public int Maximum; + + /// + /// Initializes a new instance of the class. + /// + /// The current step in document preparation. + /// The latest step in document preparation. + public PrepareDocumentProgressEventArgs(int value, int maximum) + { + Value = value; + Maximum = maximum; + } + } + + /// + /// The event handler that is being called for the PrepareDocumentProgressEvent event. + /// + public delegate void PrepareDocumentProgressEventHandler(object sender, PrepareDocumentProgressEventArgs e); + + public int ProgressMaximum; + public int ProgressCompleted; + } +} diff --git a/MigraDoc.Rendering/Rendering/FieldInfos.cs b/MigraDoc.Rendering/Rendering/FieldInfos.cs new file mode 100644 index 0000000..2f11d20 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/FieldInfos.cs @@ -0,0 +1,98 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; + +namespace MigraDoc.Rendering +{ + /// + /// Field information used to fill fields when rendering or formatting. + /// + public class FieldInfos + { + public FieldInfos(Dictionary bookmarks) + { + _bookmarks = bookmarks; + } + + public void AddBookmark(string name) + { + if (PhysicalPageNr <= 0) + return; + + if (_bookmarks.ContainsKey(name)) + _bookmarks.Remove(name); + + if (PhysicalPageNr > 0) + _bookmarks.Add(name, new BookmarkInfo(PhysicalPageNr, DisplayPageNr)); + } + + public int GetShownPageNumber(string bookmarkName) + { + if (_bookmarks.ContainsKey(bookmarkName)) + { + BookmarkInfo bi = _bookmarks[bookmarkName]; + return bi.ShownPageNumber; + } + return -1; + } + + public int GetPhysicalPageNumber(string bookmarkName) + { + if (_bookmarks.ContainsKey(bookmarkName)) + { + BookmarkInfo bi = _bookmarks[bookmarkName]; + return bi.DisplayPageNumber; + } + return -1; + } + + public struct BookmarkInfo + { + public BookmarkInfo(int physicalPageNumber, int displayPageNumber) + { + DisplayPageNumber = physicalPageNumber; + ShownPageNumber = displayPageNumber; + } + + public readonly int DisplayPageNumber; + public readonly int ShownPageNumber; + } + + readonly Dictionary _bookmarks; + public int DisplayPageNr; + public int PhysicalPageNr; + public int Section; + public int SectionPages; + public int NumPages; + public DateTime Date; + } +} diff --git a/MigraDoc.Rendering/Rendering/FillFormatRenderer.cs b/MigraDoc.Rendering/Rendering/FillFormatRenderer.cs new file mode 100644 index 0000000..e189cc3 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/FillFormatRenderer.cs @@ -0,0 +1,79 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel.Shapes; + +namespace MigraDoc.Rendering +{ + /// + /// Renders fill formats. + /// + public class FillFormatRenderer + { + public FillFormatRenderer(FillFormat fillFormat, XGraphics gfx) + { + _gfx = gfx; + _fillFormat = fillFormat; + } + + public void Render(XUnit x, XUnit y, XUnit width, XUnit height) + { + XBrush brush = GetBrush(); + + if (brush == null) + return; + + _gfx.DrawRectangle(brush, x.Point, y.Point, width.Point, height.Point); + } + + private bool IsVisible() + { + if (!_fillFormat._visible.IsNull) + return _fillFormat.Visible; + return !_fillFormat._color.IsNull; + } + + private XBrush GetBrush() + { + if (_fillFormat == null || !IsVisible()) + return null; + +#if noCMYK + return new XSolidBrush(XColor.FromArgb(_fillFormat.Color.Argb)); +#else + return new XSolidBrush(ColorHelper.ToXColor(_fillFormat.Color, _fillFormat.Document.UseCmykColor)); +#endif + } + + readonly XGraphics _gfx; + readonly FillFormat _fillFormat; + } +} diff --git a/MigraDoc.Rendering/Rendering/FontHandler.cs b/MigraDoc.Rendering/Rendering/FontHandler.cs new file mode 100644 index 0000000..577e015 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/FontHandler.cs @@ -0,0 +1,141 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#define CACHE_FONTS_ + +using System; +using PdfSharp.Pdf; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel; + +namespace MigraDoc.Rendering +{ + /// + /// Helps measuring and handling fonts. + /// + public class FontHandler + { +#if DEBUG + public static int CreateFontCounter; +#endif + + /// + /// Converts a DOM Font to an XFont. + /// + public static XFont FontToXFont(Font font, PdfFontEncoding encoding) + { + XPdfFontOptions options = new XPdfFontOptions(encoding); + XFontStyle style = GetXStyle(font); + +#if DEBUG + if (StringComparer.OrdinalIgnoreCase.Compare(font.Name, "Segoe UI Semilight") == 0 + && (style & XFontStyle.BoldItalic) == XFontStyle.Italic) + font.GetType(); +#endif + XFont xFont = new XFont(font.Name, font.Size, style, options); +#if DEBUG + CreateFontCounter++; +#endif + return xFont; + } + + public static XFontStyle GetXStyle(Font font) + { + XFontStyle style = XFontStyle.Regular; + if (font.Bold) + style = font.Italic ? XFontStyle.BoldItalic : XFontStyle.Bold; + else if (font.Italic) + style = XFontStyle.Italic; + + return style; + } + + public static XUnit GetDescent(XFont font) + { + XUnit descent = font.Metrics.Descent; + descent *= font.Size; + descent /= font.FontFamily.GetEmHeight(font.Style); + return descent; + } + + public static XUnit GetAscent(XFont font) + { + XUnit ascent = font.Metrics.Ascent; + ascent *= font.Size; + ascent /= font.FontFamily.GetEmHeight(font.Style); + return ascent; + } + + public static double GetSubSuperScaling(XFont font) + { + return 0.8 * GetAscent(font) / font.GetHeight(); + } + + public static XFont ToSubSuperFont(XFont font) + { + double size = font.Size * GetSubSuperScaling(font); + + return new XFont(font.Name, size, font.Style, font.PdfOptions); + } + + public static XBrush FontColorToXBrush(Font font) + { +#if noCMYK + return new XSolidBrush(XColor.FromArgb((int)font.Color.A, (int)font.Color.R, (int)font.Color.G, (int)font.Color.B)); +#else + return new XSolidBrush(ColorHelper.ToXColor(font.Color, font.Document.UseCmykColor)); +#endif + } + +#if CACHE_FONTS + static XFont XFontFromCache(Font font, bool unicode, PdfFontEmbedding fontEmbedding) + { + XFont xFont = null; + + XPdfFontOptions options = null; + options = new XPdfFontOptions(fontEmbedding, unicode); + XFontStyle style = GetXStyle(font); + xFont = new XFont(font.Name, font.Size, style, options); + + return xFont; + } + + static string BuildSignature(Font font, bool unicode, PdfFontEmbedding fontEmbedding) + { + StringBuilder signature = new StringBuilder(128); + signature.Append(font.Name.ToLower()); + signature.Append(font.Size.Point.ToString("##0.0")); + return signature.ToString(); + } + + static Hash_table fontCache = new Hash_table(); +#endif + } +} diff --git a/MigraDoc.Rendering/Rendering/FormatInfo.cs b/MigraDoc.Rendering/Rendering/FormatInfo.cs new file mode 100644 index 0000000..d74daca --- /dev/null +++ b/MigraDoc.Rendering/Rendering/FormatInfo.cs @@ -0,0 +1,83 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.Rendering +{ + /// + /// Abstract base class for formatting information received by calling Format() on a renderer. + /// + public abstract class FormatInfo + { + /// + /// Indicates that the formatted object is starting. + /// + public abstract bool IsStarting + { + get; + } + + /// + /// Indicates that the formatted object is ending. + /// + public abstract bool IsEnding + { + get; + } + + /// + /// Indicates that the formatted object is complete. + /// + public abstract bool IsComplete + { + get; + } + + /// + /// Indicates that the starting of the element is completed + /// + public abstract bool StartingIsComplete + { + get; + } + + /// + /// Indicates that the ending of the element is completed + /// + public abstract bool EndingIsComplete + { + get; + } + + public abstract bool IsEmpty + { + get; + } + } +} diff --git a/MigraDoc.Rendering/Rendering/FormattedCell.cs b/MigraDoc.Rendering/Rendering/FormattedCell.cs new file mode 100644 index 0000000..d2033bd --- /dev/null +++ b/MigraDoc.Rendering/Rendering/FormattedCell.cs @@ -0,0 +1,201 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel.Tables; + +namespace MigraDoc.Rendering +{ + /// + /// Represents a formatted cell. + /// + public class FormattedCell : IAreaProvider + { + public FormattedCell(Cell cell, DocumentRenderer documentRenderer, Borders cellBorders, FieldInfos fieldInfos, XUnit xOffset, XUnit yOffset) + { + _cell = cell; + _fieldInfos = fieldInfos; + _yOffset = yOffset; + _xOffset = xOffset; + _bordersRenderer = new BordersRenderer(cellBorders, null); + _documentRenderer = documentRenderer; + } + + Area IAreaProvider.GetNextArea() + { + if (_isFirstArea) + { + Rectangle rect = CalcContentRect(); + _isFirstArea = false; + return rect; + } + return null; + } + bool _isFirstArea = true; + + Area IAreaProvider.ProbeNextArea() + { + return null; + } + + public void Format(XGraphics gfx) + { + _gfx = gfx; + _formatter = new TopDownFormatter(this, _documentRenderer, _cell.Elements); + _formatter.FormatOnAreas(gfx, false); + _contentHeight = CalcContentHeight(_documentRenderer); + } + + private Rectangle CalcContentRect() + { + Column column = _cell.Column; + XUnit width = InnerWidth; + width -= column.LeftPadding.Point; + Column rightColumn = _cell.Table.Columns[column.Index + _cell.MergeRight]; + width -= rightColumn.RightPadding.Point; + + XUnit height = double.MaxValue; + return new Rectangle(_xOffset, _yOffset, width, height); + } + + public XUnit ContentHeight + { + get { return _contentHeight; } + } + + public XUnit InnerHeight + { + get + { + Row row = _cell.Row; + XUnit verticalPadding = row.TopPadding.Point; + verticalPadding += row.BottomPadding.Point; + + switch (row.HeightRule) + { + case RowHeightRule.Exactly: + return row.Height.Point; + + case RowHeightRule.Auto: + return verticalPadding + _contentHeight; + + case RowHeightRule.AtLeast: + default: + return Math.Max(row.Height, verticalPadding + _contentHeight); + } + } + } + + public XUnit InnerWidth + { + get + { + XUnit width = 0; + int cellColumnIdx = _cell.Column.Index; + for (int toRight = 0; toRight <= _cell.MergeRight; ++toRight) + { + int columnIdx = cellColumnIdx + toRight; + width += _cell.Table.Columns[columnIdx].Width; + } + width -= _bordersRenderer.GetWidth(BorderType.Right); + + return width; + } + } + + FieldInfos IAreaProvider.AreaFieldInfos + { + get { return _fieldInfos; } + } + + void IAreaProvider.StoreRenderInfos(List renderInfos) + { + _renderInfos = renderInfos; + } + + bool IAreaProvider.IsAreaBreakBefore(LayoutInfo layoutInfo) + { + return false; + } + + bool IAreaProvider.PositionVertically(LayoutInfo layoutInfo) + { + return false; + } + + bool IAreaProvider.PositionHorizontally(LayoutInfo layoutInfo) + { + return false; + } + + private XUnit CalcContentHeight(DocumentRenderer documentRenderer) + { + XUnit height = RenderInfo.GetTotalHeight(GetRenderInfos()); + if (height == 0) + { + height = ParagraphRenderer.GetLineHeight(_cell.Format, _gfx, documentRenderer); + height += _cell.Format.SpaceBefore; + height += _cell.Format.SpaceAfter; + } + return height; + } + + XUnit _contentHeight = 0; + + public RenderInfo[] GetRenderInfos() + { + if (_renderInfos != null) + return _renderInfos.ToArray(); + + return null; + } + + readonly FieldInfos _fieldInfos; + List _renderInfos; + readonly XUnit _xOffset; + readonly XUnit _yOffset; + + /// + /// Gets the cell the formatting information refers to. + /// + public Cell Cell + { + get { return _cell;} + } + readonly Cell _cell; + TopDownFormatter _formatter; + readonly BordersRenderer _bordersRenderer; + XGraphics _gfx; + readonly DocumentRenderer _documentRenderer; + } +} diff --git a/MigraDoc.Rendering/Rendering/FormattedDocument.cs b/MigraDoc.Rendering/Rendering/FormattedDocument.cs new file mode 100644 index 0000000..2f70f98 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/FormattedDocument.cs @@ -0,0 +1,725 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Globalization; +using PdfSharp; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.Rendering +{ + /// + /// Represents a formatted document. + /// + public class FormattedDocument : IAreaProvider + { + enum PagePosition + { + First, + Odd, + Even + } + + private struct HeaderFooterPosition + { + public HeaderFooterPosition(int sectionNr, PagePosition pagePosition) + { + _sectionNr = sectionNr; + _pagePosition = pagePosition; + } + + public override bool Equals(object obj) + { + if (obj is HeaderFooterPosition) + { + HeaderFooterPosition hfp = (HeaderFooterPosition)obj; + return _sectionNr == hfp._sectionNr && _pagePosition == hfp._pagePosition; + } + return false; + } + + public override int GetHashCode() + { + return _sectionNr.GetHashCode() ^ _pagePosition.GetHashCode(); + } + + readonly int _sectionNr; + readonly PagePosition _pagePosition; + } + + public FormattedDocument(Document document, DocumentRenderer documentRenderer) + { + _document = document; + _documentRenderer = documentRenderer; + } + + /// + /// Formats the document by performing line breaks and page breaks. + /// + public void Format(XGraphics gfx) + { + _bookmarks = new Dictionary(); + _pageRenderInfos = new Dictionary>(); + _pageInfos = new Dictionary(); + _pageFieldInfos = new Dictionary(); + _formattedHeaders = new Dictionary(); + _formattedFooters = new Dictionary(); + _gfx = gfx; + _currentPage = 0; + _sectionNumber = 0; + _pageCount = 0; + _shownPageNumber = 0; + _documentRenderer.ProgressCompleted = 0; + _documentRenderer.ProgressMaximum = 0; + if (_documentRenderer.HasPrepareDocumentProgress) + { + foreach (Section section in _document.Sections) + _documentRenderer.ProgressMaximum += section.Elements.Count; + } + foreach (Section section in _document.Sections) + { + _isNewSection = true; + _currentSection = section; + ++_sectionNumber; + if (NeedsEmptyPage()) + InsertEmptyPage(); + + TopDownFormatter formatter = new TopDownFormatter(this, _documentRenderer, section.Elements); + formatter.FormatOnAreas(gfx, true); + FillSectionPagesInfo(); + _documentRenderer.ProgressCompleted += section.Elements.Count; + } + _pageCount = _currentPage; + FillNumPagesInfo(); + } + + PagePosition CurrentPagePosition + { + get + { + if (_isNewSection) + return PagePosition.First; + // Choose header and footer based on the shown page number, not the physical page number. + if (_shownPageNumber % 2 == 0) + return PagePosition.Even; + return PagePosition.Odd; + } + } + + void FormatHeadersFooters() + { + HeadersFooters headers = (HeadersFooters)_currentSection.GetValue("Headers", GV.ReadOnly); + if (headers != null) + { + PagePosition pagePos = CurrentPagePosition; + HeaderFooterPosition hfp = new HeaderFooterPosition(_sectionNumber, pagePos); + if (!_formattedHeaders.ContainsKey(hfp)) + FormatHeader(hfp, ChooseHeaderFooter(headers, pagePos)); + } + + HeadersFooters footers = (HeadersFooters)_currentSection.GetValue("Footers", GV.ReadOnly); + if (footers != null) + { + PagePosition pagePos = CurrentPagePosition; + HeaderFooterPosition hfp = new HeaderFooterPosition(_sectionNumber, pagePos); + if (!_formattedFooters.ContainsKey(hfp)) + FormatFooter(hfp, ChooseHeaderFooter(footers, pagePos)); + } + } + + + void FormatHeader(HeaderFooterPosition hfp, HeaderFooter header) + { + if (header != null && !_formattedHeaders.ContainsKey(hfp)) + { + FormattedHeaderFooter formattedHeaderFooter = new FormattedHeaderFooter(header, _documentRenderer, _currentFieldInfos); + formattedHeaderFooter.ContentRect = GetHeaderArea(_currentSection, _currentPage); + formattedHeaderFooter.Format(_gfx); + _formattedHeaders.Add(hfp, formattedHeaderFooter); + } + } + + + void FormatFooter(HeaderFooterPosition hfp, HeaderFooter footer) + { + if (footer != null && !_formattedFooters.ContainsKey(hfp)) + { + FormattedHeaderFooter formattedHeaderFooter = new FormattedHeaderFooter(footer, _documentRenderer, _currentFieldInfos); + formattedHeaderFooter.ContentRect = GetFooterArea(_currentSection, _currentPage); + formattedHeaderFooter.Format(_gfx); + _formattedFooters.Add(hfp, formattedHeaderFooter); + } + } + + /// + /// Fills the number pages information after formatting the document. + /// + void FillNumPagesInfo() + { + for (int page = 1; page <= _pageCount; ++page) + { + if (IsEmptyPage(page)) + continue; + + FieldInfos fieldInfos = _pageFieldInfos[page]; + fieldInfos.NumPages = _pageCount; + } + } + + /// + /// Fills the section pages information after formatting a section. + /// + void FillSectionPagesInfo() + { + for (int page = _currentPage; page > 0; --page) + { + if (IsEmptyPage(page)) + continue; + + FieldInfos fieldInfos = _pageFieldInfos[page]; + if (fieldInfos.Section != _sectionNumber) + break; + + fieldInfos.SectionPages = _sectionPages; + } + } + + Rectangle CalcContentRect(int page) + { + PageSetup pageSetup = _currentSection.PageSetup; + XUnit width = pageSetup.EffectivePageWidth.Point; + + width -= pageSetup.RightMargin.Point; + width -= pageSetup.LeftMargin.Point; + + XUnit height = pageSetup.EffectivePageHeight.Point; + + height -= pageSetup.TopMargin.Point; + height -= pageSetup.BottomMargin.Point; + XUnit x; + XUnit y = pageSetup.TopMargin.Point; + if (pageSetup.MirrorMargins) + x = page % 2 == 0 ? pageSetup.RightMargin.Point : pageSetup.LeftMargin.Point; + else + x = pageSetup.LeftMargin.Point; + return new Rectangle(x, y, width, height); + } + + /// + /// Gets the rendering informations for the page content. + /// + /// The page to render. + /// Rendering information for the page content. + public RenderInfo[] GetRenderInfos(int page) + { + if (_pageRenderInfos.ContainsKey(page)) + return (_pageRenderInfos[page]).ToArray(); + return null; + } + private Dictionary> _pageRenderInfos; + + /// + /// Gets a formatted headerfooter object for header of the given page. + /// + /// The physical page the header shall appear on. + /// The required header, null if none exists to render. + public FormattedHeaderFooter GetFormattedHeader(int page) + { + FieldInfos fieldInfos = _pageFieldInfos[page]; + int logicalPage = fieldInfos.DisplayPageNr; + + PagePosition pagePos = logicalPage % 2 == 0 ? PagePosition.Even : PagePosition.Odd; + + if (page == 1) + pagePos = PagePosition.First; + else //page > 1 + { + if (IsEmptyPage(page - 1)) // these empty pages only occur between sections. + pagePos = PagePosition.First; + else + { + FieldInfos prevFieldInfos = _pageFieldInfos[page - 1]; + if (fieldInfos.Section != prevFieldInfos.Section) + pagePos = PagePosition.First; + } + } + + HeaderFooterPosition hfp = new HeaderFooterPosition(fieldInfos.Section, pagePos); + if (_formattedHeaders.ContainsKey(hfp)) + return _formattedHeaders[hfp]; + return null; + } + + /// + /// Gets a formatted headerfooter object for footer of the given page. + /// + /// The physical page the footer shall appear on. + /// The required footer, null if none exists to render. + public FormattedHeaderFooter GetFormattedFooter(int page) + { + FieldInfos fieldInfos = _pageFieldInfos[page]; + int logicalPage = fieldInfos.DisplayPageNr; + + PagePosition pagePos = logicalPage % 2 == 0 ? PagePosition.Even : PagePosition.Odd; + + if (page == 1) + pagePos = PagePosition.First; + else //page > 1 + { + if (IsEmptyPage(page - 1)) // these empty pages only occur between sections. + pagePos = PagePosition.First; + else + { + FieldInfos prevFieldInfos = _pageFieldInfos[page - 1]; + if (fieldInfos.Section != prevFieldInfos.Section) + pagePos = PagePosition.First; + } + } + + HeaderFooterPosition hfp = new HeaderFooterPosition(fieldInfos.Section, pagePos); + if (_formattedFooters.ContainsKey(hfp)) + return _formattedFooters[hfp]; + return null; + } + + private Rectangle GetHeaderArea(Section section, int page) + { + PageSetup pageSetup = section.PageSetup; + XUnit xPos; + if (pageSetup.MirrorMargins && page % 2 == 0) + xPos = pageSetup.RightMargin.Point; + else + xPos = pageSetup.LeftMargin.Point; + + XUnit width = pageSetup.EffectivePageWidth.Point; + width -= pageSetup.LeftMargin + pageSetup.RightMargin; + + XUnit yPos = pageSetup.HeaderDistance.Point; + XUnit height = pageSetup.TopMargin - pageSetup.HeaderDistance; + return new Rectangle(xPos, yPos, width, height); + } + + public Rectangle GetHeaderArea(int page) + { + FieldInfos fieldInfos = _pageFieldInfos[page]; + Section section = _document.Sections[fieldInfos.Section - 1]; + return GetHeaderArea(section, page); + } + + public Rectangle GetFooterArea(int page) + { + FieldInfos fieldInfos = _pageFieldInfos[page]; + Section section = _document.Sections[fieldInfos.Section - 1]; + return GetFooterArea(section, page); + } + + private Rectangle GetFooterArea(Section section, int page) + { + PageSetup pageSetup = section.PageSetup; + XUnit xPos; + if (pageSetup.MirrorMargins && page % 2 == 0) + xPos = pageSetup.RightMargin.Point; + else + xPos = pageSetup.LeftMargin.Point; + + XUnit width = pageSetup.EffectivePageWidth.Point; + width -= pageSetup.LeftMargin + pageSetup.RightMargin; + XUnit yPos = pageSetup.EffectivePageHeight.Point; + + yPos -= pageSetup.BottomMargin.Point; + XUnit height = pageSetup.BottomMargin - pageSetup.FooterDistance; + return new Rectangle(xPos, yPos, width, height); + } + + private HeaderFooter ChooseHeaderFooter(HeadersFooters hfs, PagePosition pagePos) + { + if (hfs == null) + return null; + + PageSetup pageSetup = _currentSection.PageSetup; + + if (pagePos == PagePosition.First) + { + if (pageSetup.DifferentFirstPageHeaderFooter) + return (HeaderFooter)hfs.GetValue("FirstPage", GV.ReadOnly); + } + if (pagePos == PagePosition.Even || _shownPageNumber/*_currentPage*/ % 2 == 0) + { + if (pageSetup.OddAndEvenPagesHeaderFooter) + return (HeaderFooter)hfs.GetValue("EvenPage", GV.ReadOnly); + } + return (HeaderFooter)hfs.GetValue("Primary", GV.ReadOnly); + } + + /// + /// Gets the number of pages of the document. + /// + public int PageCount + { + get { return _pageCount; } + } + int _pageCount; + + + /// + /// Gets information about the specified page. + /// + /// The page the information is asked for. + /// The page information. + public PageInfo GetPageInfo(int page) + { + if (page < 1 || page > _pageCount) +#if !SILVERLIGHT + throw new ArgumentOutOfRangeException("page", page, page.ToString(CultureInfo.InvariantCulture)); +#else + throw new PdfSharp.ArgumentOutOfRangeException("page", page, page.ToString(CultureInfo.InvariantCulture)); +#endif + + return _pageInfos[page]; + } + + #region IAreaProvider Members + + Area IAreaProvider.GetNextArea() + { + if (_isNewSection) + _sectionPages = 0; + + ++_currentPage; + ++_shownPageNumber; + ++_sectionPages; + InitFieldInfos(); + FormatHeadersFooters(); + _isNewSection = false; + return CalcContentRect(_currentPage); + } + int _currentPage; + + Area IAreaProvider.ProbeNextArea() + { + return CalcContentRect(_currentPage + 1); + } + + void InitFieldInfos() + { + _currentFieldInfos = new FieldInfos(_bookmarks); + _currentFieldInfos.PhysicalPageNr = _currentPage; + _currentFieldInfos.Section = _sectionNumber; + + if (_isNewSection && !_currentSection.PageSetup._startingNumber.IsNull) + _shownPageNumber = _currentSection.PageSetup.StartingNumber; + + _currentFieldInfos.DisplayPageNr = _shownPageNumber; + } + + void IAreaProvider.StoreRenderInfos(List renderInfos) + { + _pageRenderInfos.Add(_currentPage, renderInfos); + XSize pageSize = CalcPageSize(_currentSection.PageSetup); + PageOrientation pageOrientation = CalcPageOrientation(_currentSection.PageSetup); + PageInfo pageInfo = new PageInfo(pageSize.Width, pageSize.Height, pageOrientation); + _pageInfos.Add(_currentPage, pageInfo); + _pageFieldInfos.Add(_currentPage, _currentFieldInfos); + } + + PageOrientation CalcPageOrientation(PageSetup pageSetup) + { + PageOrientation pageOrientation = PageOrientation.Portrait; + if (_currentSection.PageSetup.Orientation == Orientation.Landscape) + pageOrientation = PageOrientation.Landscape; + + return pageOrientation; + } + + XSize CalcPageSize(PageSetup pageSetup) + { + return new XSize(pageSetup.PageWidth.Point, pageSetup.PageHeight.Point); + } + + bool IAreaProvider.PositionHorizontally(LayoutInfo layoutInfo) + { + switch (layoutInfo.HorizontalReference) + { + case HorizontalReference.PageMargin: + case HorizontalReference.AreaBoundary: + return PositionHorizontallyToMargin(layoutInfo); + + case HorizontalReference.Page: + return PositionHorizontallyToPage(layoutInfo); + } + return false; + } + + /// + /// Gets the alignment depending on the currentPage for the alignments "Outside" and "Inside". + /// + /// The original alignment + /// the alignment depending on the currentPage for the alignments "Outside" and "Inside" + private ElementAlignment GetCurrentAlignment(ElementAlignment alignment) + { + ElementAlignment align = alignment; + + if (align == ElementAlignment.Inside) + { + align = _currentPage % 2 == 0 ? ElementAlignment.Far : ElementAlignment.Near; + } + else if (align == ElementAlignment.Outside) + { + align = _currentPage % 2 == 0 ? ElementAlignment.Near : ElementAlignment.Far; + } + return align; + } + + bool PositionHorizontallyToMargin(LayoutInfo layoutInfo) + { + Rectangle rect = CalcContentRect(_currentPage); + ElementAlignment align = GetCurrentAlignment(layoutInfo.HorizontalAlignment); + + + switch (align) + { + case ElementAlignment.Near: + if (layoutInfo.Left != 0) + { + layoutInfo.ContentArea.X += layoutInfo.Left; + return true; + } + if (layoutInfo.MarginLeft != 0) + { + layoutInfo.ContentArea.X += layoutInfo.MarginLeft; + return true; + } + return false; + + case ElementAlignment.Far: + XUnit xPos = rect.X + rect.Width; + xPos -= layoutInfo.ContentArea.Width; + xPos -= layoutInfo.MarginRight; + layoutInfo.ContentArea.X = xPos; + return true; + + case ElementAlignment.Center: + xPos = rect.Width; + xPos -= layoutInfo.ContentArea.Width; + xPos = rect.X + xPos / 2; + layoutInfo.ContentArea.X = xPos; + return true; + } + return false; + } + + bool PositionHorizontallyToPage(LayoutInfo layoutInfo) + { + XUnit xPos; + ElementAlignment align = GetCurrentAlignment(layoutInfo.HorizontalAlignment); + switch (align) + { + case ElementAlignment.Near: +#if true + // Attempt to make it compatible with MigraDoc CPP. + // Ignore layoutInfo.Left if absolute position is specified in layoutInfo.MarginLeft. + // Use layoutInfo.Left if layoutInfo.MarginLeft is 0. + // TODO We would need HasValue for XUnit to determine whether a value was assigned. + if (layoutInfo.HorizontalReference == HorizontalReference.Page || + layoutInfo.HorizontalReference == HorizontalReference.PageMargin) + xPos = layoutInfo.MarginLeft != 0 ? layoutInfo.MarginLeft : layoutInfo.Left; + else + xPos = Math.Max(layoutInfo.MarginLeft, layoutInfo.Left); +#else + if (layoutInfo.HorizontalReference == HorizontalReference.Page || + layoutInfo.HorizontalReference == HorizontalReference.PageMargin) + xPos = layoutInfo.MarginLeft; // ignore layoutInfo.Left if absolute position is specified + else + xPos = Math.Max(layoutInfo.MarginLeft, layoutInfo.Left); +#endif + layoutInfo.ContentArea.X = xPos; + break; + + case ElementAlignment.Far: + xPos = _currentSection.PageSetup.EffectivePageWidth.Point; + xPos -= layoutInfo.ContentArea.Width; + xPos -= layoutInfo.MarginRight; + layoutInfo.ContentArea.X = xPos; + break; + + case ElementAlignment.Center: + xPos = _currentSection.PageSetup.EffectivePageWidth.Point; + xPos -= layoutInfo.ContentArea.Width; + xPos /= 2; + layoutInfo.ContentArea.X = xPos; + break; + } + return true; + } + + bool PositionVerticallyToMargin(LayoutInfo layoutInfo) + { + Rectangle rect = CalcContentRect(_currentPage); + XUnit yPos; + switch (layoutInfo.VerticalAlignment) + { + case ElementAlignment.Near: + yPos = rect.Y; + if (layoutInfo.Top == 0) + yPos += layoutInfo.MarginTop; + else + yPos += layoutInfo.Top; + layoutInfo.ContentArea.Y = yPos; + break; + + case ElementAlignment.Far: + yPos = rect.Y + rect.Height; + yPos -= layoutInfo.ContentArea.Height; + yPos -= layoutInfo.MarginBottom; + layoutInfo.ContentArea.Y = yPos; + break; + + case ElementAlignment.Center: + yPos = rect.Height; + yPos -= layoutInfo.ContentArea.Height; + yPos = rect.Y + yPos / 2; + layoutInfo.ContentArea.Y = yPos; + break; + } + return true; + } + + bool NeedsEmptyPage() + { + int nextPage = _currentPage + 1; + PageSetup pageSetup = _currentSection.PageSetup; + bool startOnEvenPage = pageSetup.SectionStart == BreakType.BreakEvenPage; + bool startOnOddPage = pageSetup.SectionStart == BreakType.BreakOddPage; + + if (startOnOddPage) + return nextPage % 2 == 0; + if (startOnEvenPage) + return nextPage % 2 == 1; + + return false; + } + + void InsertEmptyPage() + { + ++_currentPage; + ++_shownPageNumber; + _emptyPages.Add(_currentPage, null); + + XSize pageSize = CalcPageSize(_currentSection.PageSetup); + PageOrientation pageOrientation = CalcPageOrientation(_currentSection.PageSetup); + PageInfo pageInfo = new PageInfo(pageSize.Width, pageSize.Height, pageOrientation); + _pageInfos.Add(_currentPage, pageInfo); + } + + bool PositionVerticallyToPage(LayoutInfo layoutInfo) + { + XUnit yPos; + switch (layoutInfo.VerticalAlignment) + { + case ElementAlignment.Near: + yPos = Math.Max(layoutInfo.MarginTop, layoutInfo.Top); + layoutInfo.ContentArea.Y = yPos; + break; + + case ElementAlignment.Far: + yPos = _currentSection.PageSetup.EffectivePageHeight.Point; + yPos -= layoutInfo.ContentArea.Height; + yPos -= layoutInfo.MarginBottom; + layoutInfo.ContentArea.Y = yPos; + break; + + case ElementAlignment.Center: + yPos = _currentSection.PageSetup.EffectivePageHeight.Point; + yPos -= layoutInfo.ContentArea.Height; + yPos /= 2; + layoutInfo.ContentArea.Y = yPos; + break; + } + return true; + } + + bool IAreaProvider.PositionVertically(LayoutInfo layoutInfo) + { + switch (layoutInfo.VerticalReference) + { + case VerticalReference.PreviousElement: + return false; + + case VerticalReference.AreaBoundary: + case VerticalReference.PageMargin: + return PositionVerticallyToMargin(layoutInfo); + + case VerticalReference.Page: + return PositionVerticallyToPage(layoutInfo); + } + return false; + } + + public FieldInfos GetFieldInfos(int page) + { + return _pageFieldInfos[page]; + } + + FieldInfos IAreaProvider.AreaFieldInfos + { + get { return _currentFieldInfos; } + } + + bool IAreaProvider.IsAreaBreakBefore(LayoutInfo layoutInfo) + { + return layoutInfo.PageBreakBefore; + } + + public bool IsEmptyPage(int page) + { + return _emptyPages.ContainsKey(page); + } + #endregion + + Dictionary _bookmarks; + int _sectionPages; + int _shownPageNumber; + int _sectionNumber; + Section _currentSection; + bool _isNewSection; + FieldInfos _currentFieldInfos; + Dictionary _pageFieldInfos; + Dictionary _formattedHeaders; + Dictionary _formattedFooters; + readonly DocumentRenderer _documentRenderer; + XGraphics _gfx; + Dictionary _pageInfos; + readonly Dictionary _emptyPages = new Dictionary(); + readonly Document _document; + } +} \ No newline at end of file diff --git a/MigraDoc.Rendering/Rendering/FormattedHeaderFooter.cs b/MigraDoc.Rendering/Rendering/FormattedHeaderFooter.cs new file mode 100644 index 0000000..abf9f95 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/FormattedHeaderFooter.cs @@ -0,0 +1,128 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering +{ + /// + /// Represents a formatted header or footer. + /// + public class FormattedHeaderFooter : IAreaProvider + { + public FormattedHeaderFooter(HeaderFooter headerFooter, DocumentRenderer documentRenderer, FieldInfos fieldInfos) + { + _headerFooter = headerFooter; + _fieldInfos = fieldInfos; + _documentRenderer = documentRenderer; + } + + public void Format(XGraphics gfx) + { + _gfx = gfx; + _isFirstArea = true; + _formatter = new TopDownFormatter(this, _documentRenderer, _headerFooter.Elements); + _formatter.FormatOnAreas(gfx, false); + _contentHeight = RenderInfo.GetTotalHeight(GetRenderInfos()); + } + + Area IAreaProvider.GetNextArea() + { + if (_isFirstArea) + return new Rectangle(ContentRect.X, ContentRect.Y, ContentRect.Width, double.MaxValue); + + return null; + } + + Area IAreaProvider.ProbeNextArea() + { + return null; + } + + FieldInfos IAreaProvider.AreaFieldInfos + { + get { return _fieldInfos; } + } + + void IAreaProvider.StoreRenderInfos(List renderInfos) + { + _renderInfos = renderInfos; + } + + bool IAreaProvider.IsAreaBreakBefore(LayoutInfo layoutInfo) + { + return false; + } + + public RenderInfo[] GetRenderInfos() + { + if (_renderInfos != null) + return _renderInfos.ToArray(); + + return new RenderInfo[0]; + } + + public Rectangle ContentRect + { + get { return _contentRect; } + set { _contentRect = value; } + } + private Rectangle _contentRect; + + XUnit ContentHeight + { + get { return _contentHeight; } + } + private XUnit _contentHeight; + + + bool IAreaProvider.PositionVertically(LayoutInfo layoutInfo) + { + IAreaProvider formattedDoc = _documentRenderer.FormattedDocument; + return formattedDoc.PositionVertically(layoutInfo); + } + + bool IAreaProvider.PositionHorizontally(LayoutInfo layoutInfo) + { + IAreaProvider formattedDoc = _documentRenderer.FormattedDocument; + return formattedDoc.PositionHorizontally(layoutInfo); + } + + HeaderFooter _headerFooter; + FieldInfos _fieldInfos; + TopDownFormatter _formatter; + List _renderInfos; + XGraphics _gfx; + bool _isFirstArea; + readonly DocumentRenderer _documentRenderer; + } +} diff --git a/MigraDoc.Rendering/Rendering/FormattedTextArea.cs b/MigraDoc.Rendering/Rendering/FormattedTextArea.cs new file mode 100644 index 0000000..cb33643 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/FormattedTextArea.cs @@ -0,0 +1,171 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel; +using MigraDoc.DocumentObjectModel.Shapes.Charts; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering +{ + /// + /// Represents a formatted text area. + /// + public class FormattedTextArea : IAreaProvider + { + public FormattedTextArea(DocumentRenderer documentRenderer, TextArea textArea, FieldInfos fieldInfos) + { + TextArea = textArea; + _fieldInfos = fieldInfos; + _documentRenderer = documentRenderer; + } + + public void Format(XGraphics gfx) + { + _gfx = gfx; + _isFirstArea = true; + _formatter = new TopDownFormatter(this, _documentRenderer, TextArea.Elements); + _formatter.FormatOnAreas(gfx, false); + } + + public XUnit InnerWidth + { + set { _innerWidth = value; } + get + { + if (double.IsNaN(_innerWidth)) + { + if (!TextArea._width.IsNull) + _innerWidth = TextArea.Width.Point; + else + _innerWidth = CalcInherentWidth(); + } + return _innerWidth; + } + } + XUnit _innerWidth = double.NaN; + + public XUnit InnerHeight + { + get + { + if (TextArea._height.IsNull) + return ContentHeight + TextArea.TopPadding + TextArea.BottomPadding; + return TextArea.Height.Point; + } + } + + + XUnit CalcInherentWidth() + { + XUnit inherentWidth = 0; + foreach (DocumentObject obj in TextArea.Elements) + { + Renderer renderer = Renderer.Create(_gfx, _documentRenderer, obj, _fieldInfos); + if (renderer != null) + { + renderer.Format(new Rectangle(0, 0, double.MaxValue, double.MaxValue), null); + inherentWidth = Math.Max(renderer.RenderInfo.LayoutInfo.MinWidth, inherentWidth); + } + } + inherentWidth += TextArea.LeftPadding; + inherentWidth += TextArea.RightPadding; + return inherentWidth; + } + + Area IAreaProvider.GetNextArea() + { + if (_isFirstArea) + return CalcContentRect(); + + return null; + } + + Area IAreaProvider.ProbeNextArea() + { + return null; + } + + FieldInfos IAreaProvider.AreaFieldInfos + { + get { return _fieldInfos; } + } + + void IAreaProvider.StoreRenderInfos(List renderInfos) + { + _renderInfos = renderInfos; + } + + bool IAreaProvider.IsAreaBreakBefore(LayoutInfo layoutInfo) + { + return false; + } + + public RenderInfo[] GetRenderInfos() + { + if (_renderInfos != null) + return _renderInfos.ToArray(); + + return null; + } + + public XUnit ContentHeight + { + get { return RenderInfo.GetTotalHeight(GetRenderInfos()); } + } + + Rectangle CalcContentRect() + { + XUnit width = InnerWidth - TextArea.LeftPadding - TextArea.RightPadding; + XUnit height = double.MaxValue; + return new Rectangle(0, 0, width, height); + } + + bool IAreaProvider.PositionVertically(LayoutInfo layoutInfo) + { + return false; + } + + bool IAreaProvider.PositionHorizontally(LayoutInfo layoutInfo) + { + return false; + } + + public readonly TextArea TextArea; + + readonly FieldInfos _fieldInfos; + TopDownFormatter _formatter; + List _renderInfos; + XGraphics _gfx; + bool _isFirstArea; + readonly DocumentRenderer _documentRenderer; + } +} diff --git a/MigraDoc.Rendering/Rendering/FormattedTextFrame.cs b/MigraDoc.Rendering/Rendering/FormattedTextFrame.cs new file mode 100644 index 0000000..f24df64 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/FormattedTextFrame.cs @@ -0,0 +1,180 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel.Shapes; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering +{ + /// + /// Represents a formatted text frame. + /// + public class FormattedTextFrame : IAreaProvider + { + public FormattedTextFrame(TextFrame textframe, DocumentRenderer documentRenderer, FieldInfos fieldInfos) + { + _textframe = textframe; + _fieldInfos = fieldInfos; + _documentRenderer = documentRenderer; + } + + public void Format(XGraphics gfx) + { + _gfx = gfx; + _isFirstArea = true; + _formatter = new TopDownFormatter(this, _documentRenderer, _textframe.Elements); + _formatter.FormatOnAreas(gfx, false); + _contentHeight = RenderInfo.GetTotalHeight(GetRenderInfos()); + } + + Area IAreaProvider.GetNextArea() + { + if (_isFirstArea) + return CalcContentRect(); + return null; + } + + Area IAreaProvider.ProbeNextArea() + { + return null; + } + + FieldInfos IAreaProvider.AreaFieldInfos + { + get { return _fieldInfos; } + } + + void IAreaProvider.StoreRenderInfos(List renderInfos) + { + _renderInfos = renderInfos; + } + + bool IAreaProvider.IsAreaBreakBefore(LayoutInfo layoutInfo) + { + return false; + } + + public RenderInfo[] GetRenderInfos() + { + if (_renderInfos != null) + return _renderInfos.ToArray(); + return null; + } + + Rectangle CalcContentRect() + { + LineFormatRenderer lfr = new LineFormatRenderer(_textframe.LineFormat, _gfx); + XUnit lineWidth = lfr.GetWidth(); + XUnit width; + XUnit xOffset = lineWidth / 2; + XUnit yOffset = lineWidth / 2; + + if (_textframe.Orientation == TextOrientation.Horizontal || + _textframe.Orientation == TextOrientation.HorizontalRotatedFarEast) + { + width = _textframe.Width.Point; + xOffset += _textframe.MarginLeft; + yOffset += _textframe.MarginTop; + width -= xOffset; + width -= _textframe.MarginRight + lineWidth / 2; + } + else + { + width = _textframe.Height.Point; + if (_textframe.Orientation == TextOrientation.Upward) + { + xOffset += _textframe.MarginBottom; + yOffset += _textframe.MarginLeft; + width -= xOffset; + width -= _textframe.MarginTop + lineWidth / 2; + } + else + { + xOffset += _textframe.MarginTop; + yOffset += _textframe.MarginRight; + width -= xOffset; + width -= _textframe.MarginBottom + lineWidth / 2; + } + } + XUnit height = double.MaxValue; + return new Rectangle(xOffset, yOffset, width, height); + } + + XUnit ContentHeight + { + get { return _contentHeight; } + } + + bool IAreaProvider.PositionVertically(LayoutInfo layoutInfo) + { + return false; + } + + bool IAreaProvider.PositionHorizontally(LayoutInfo layoutInfo) + { + Rectangle rect = CalcContentRect(); + switch (layoutInfo.HorizontalAlignment) + { + case ElementAlignment.Near: + if (layoutInfo.Left != 0) + { + layoutInfo.ContentArea.X += layoutInfo.Left; + return true; + } + return false; + + case ElementAlignment.Far: + XUnit xPos = rect.X + rect.Width; + xPos -= layoutInfo.ContentArea.Width; + xPos -= layoutInfo.MarginRight; + layoutInfo.ContentArea.X = xPos; + return true; + + case ElementAlignment.Center: + xPos = rect.Width; + xPos -= layoutInfo.ContentArea.Width; + xPos = rect.X + xPos / 2; + layoutInfo.ContentArea.X = xPos; + return true; + } + return false; + } + + readonly TextFrame _textframe; + readonly FieldInfos _fieldInfos; + TopDownFormatter _formatter; + List _renderInfos; + XGraphics _gfx; + bool _isFirstArea; + XUnit _contentHeight; + readonly DocumentRenderer _documentRenderer; + } +} diff --git a/MigraDoc.Rendering/Rendering/IAreaProvider.cs b/MigraDoc.Rendering/Rendering/IAreaProvider.cs new file mode 100644 index 0000000..5a5215e --- /dev/null +++ b/MigraDoc.Rendering/Rendering/IAreaProvider.cs @@ -0,0 +1,78 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; + +namespace MigraDoc.Rendering +{ + /// + /// Represents a class that provides a series of Areas to render into. + /// + public interface IAreaProvider + { + /// + /// Gets the next area to render into. + /// + Area GetNextArea(); + + /// + /// Probes the next area to render into like GetNextArea, but doesn't change the provider state. + /// + /// The area for the next rendering act. + Area ProbeNextArea(); + + FieldInfos AreaFieldInfos { get; } + + /// + /// Determines whether the element requires an area break before. + /// + bool IsAreaBreakBefore(LayoutInfo layoutInfo); + + /// + /// Positions the element vertically relatively to the current area. + /// + /// The layout info of the element. + /// True, if the element was moved by the function. + bool PositionVertically(LayoutInfo layoutInfo); + + /// + /// Positions the element horizontally relatively to the current area. + /// + /// The layout info of the element. + /// True, if the element was moved by the function. + bool PositionHorizontally(LayoutInfo layoutInfo); + + /// + /// Stores the RenderInfos of elements on the current area. + /// + /// + void StoreRenderInfos(List renderInfos); + } +} diff --git a/MigraDoc.Rendering/Rendering/ImageFormatInfo.cs b/MigraDoc.Rendering/Rendering/ImageFormatInfo.cs new file mode 100644 index 0000000..d697ff0 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ImageFormatInfo.cs @@ -0,0 +1,50 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering +{ + /// + /// Formatting information for an image. + /// + public sealed class ImageFormatInfo : ShapeFormatInfo + { + public int CropX; + public int CropY; + public int CropWidth; + public int CropHeight; + public XUnit Width; + public XUnit Height; + + public ImageFailure Failure; + public string ImagePath; + } +} diff --git a/MigraDoc.Rendering/Rendering/ImageRenderInfo.cs b/MigraDoc.Rendering/Rendering/ImageRenderInfo.cs new file mode 100644 index 0000000..df0d782 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ImageRenderInfo.cs @@ -0,0 +1,48 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.Rendering +{ + /// + /// Represents rendering information for images. + /// + public sealed class ImageRenderInfo : ShapeRenderInfo + { + /// + /// Gets the format information in a specific derived type. For a table, for example, this will be a TableFormatInfo with information about the first and last row showing on a page. + /// + public override FormatInfo FormatInfo + { + get { return _formatInfo ?? (_formatInfo = new ImageFormatInfo()); } + set { _formatInfo = (ImageFormatInfo)value; } + } + ImageFormatInfo _formatInfo; + } +} diff --git a/MigraDoc.Rendering/Rendering/ImageRenderer.cs b/MigraDoc.Rendering/Rendering/ImageRenderer.cs new file mode 100644 index 0000000..008eb7b --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ImageRenderer.cs @@ -0,0 +1,367 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.IO; +using System.Diagnostics; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel.Shapes; +using MigraDoc.Rendering.Resources; + +namespace MigraDoc.Rendering +{ + /// + /// Renders images. + /// + public class ImageRenderer : ShapeRenderer + { + public ImageRenderer(XGraphics gfx, Image image, FieldInfos fieldInfos) + : base(gfx, image, fieldInfos) + { + _image = image; + ImageRenderInfo renderInfo = new ImageRenderInfo(); + renderInfo.DocumentObject = _shape; + _renderInfo = renderInfo; + } + + public ImageRenderer(XGraphics gfx, RenderInfo renderInfo, FieldInfos fieldInfos) + : base(gfx, renderInfo, fieldInfos) + { + _image = (Image)renderInfo.DocumentObject; + } + + public override void Format(Area area, FormatInfo previousFormatInfo) + { + _imageFilePath = _image.GetFilePath(_documentRenderer.WorkingDirectory); + // The Image is stored in the string if path starts with "base64:", otherwise we check whether the file exists. + if (!_imageFilePath.StartsWith("base64:") && + !XImage.ExistsFile(_imageFilePath)) + { + _failure = ImageFailure.FileNotFound; + Debug.WriteLine(Messages2.ImageNotFound(_image.Name), "warning"); + } + ImageFormatInfo formatInfo = (ImageFormatInfo)_renderInfo.FormatInfo; + formatInfo.Failure = _failure; + formatInfo.ImagePath = _imageFilePath; + CalculateImageDimensions(); + base.Format(area, previousFormatInfo); + } + + protected override XUnit ShapeHeight + { + get + { + ImageFormatInfo formatInfo = (ImageFormatInfo)_renderInfo.FormatInfo; + return formatInfo.Height + _lineFormatRenderer.GetWidth(); + } + } + + protected override XUnit ShapeWidth + { + get + { + ImageFormatInfo formatInfo = (ImageFormatInfo)_renderInfo.FormatInfo; + return formatInfo.Width + _lineFormatRenderer.GetWidth(); + } + } + + public override void Render() + { + RenderFilling(); + + ImageFormatInfo formatInfo = (ImageFormatInfo)_renderInfo.FormatInfo; + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + XRect destRect = new XRect(contentArea.X, contentArea.Y, formatInfo.Width, formatInfo.Height); + + if (formatInfo.Failure == ImageFailure.None) + { + XImage xImage = null; + try + { + XRect srcRect = new XRect(formatInfo.CropX, formatInfo.CropY, formatInfo.CropWidth, formatInfo.CropHeight); + //xImage = XImage.FromFile(formatInfo.ImagePath); + xImage = CreateXImage(formatInfo.ImagePath); + _gfx.DrawImage(xImage, destRect, srcRect, XGraphicsUnit.Point); //Pixel. + } + catch (Exception) + { + RenderFailureImage(destRect); + } + finally + { + if (xImage != null) + xImage.Dispose(); + } + } + else + RenderFailureImage(destRect); + + RenderLine(); + } + + void RenderFailureImage(XRect destRect) + { + _gfx.DrawRectangle(XBrushes.LightGray, destRect); + string failureString; + ImageFormatInfo formatInfo = (ImageFormatInfo)RenderInfo.FormatInfo; + + switch (formatInfo.Failure) + { + case ImageFailure.EmptySize: + failureString = Messages2.DisplayEmptyImageSize; + break; + + case ImageFailure.FileNotFound: + failureString = Messages2.DisplayImageFileNotFound; + break; + + case ImageFailure.InvalidType: + failureString = Messages2.DisplayInvalidImageType; + break; + + case ImageFailure.NotRead: + default: + failureString = Messages2.DisplayImageNotRead; + break; + } + + // Create stub font + XFont font = new XFont("Courier New", 8); + _gfx.DrawString(failureString, font, XBrushes.Red, destRect, XStringFormats.Center); + } + + private void CalculateImageDimensions() + { + ImageFormatInfo formatInfo = (ImageFormatInfo)_renderInfo.FormatInfo; + + if (formatInfo.Failure == ImageFailure.None) + { + XImage xImage = null; + try + { + //xImage = XImage.FromFile(_imageFilePath); + xImage = CreateXImage(_imageFilePath); + } + catch (InvalidOperationException ex) + { + Debug.WriteLine(Messages2.InvalidImageType(ex.Message)); + formatInfo.Failure = ImageFailure.InvalidType; + } + + if (formatInfo.Failure == ImageFailure.None) + { + try + { + XUnit usrWidth = _image.Width.Point; + XUnit usrHeight = _image.Height.Point; + bool usrWidthSet = !_image._width.IsNull; + bool usrHeightSet = !_image._height.IsNull; + + XUnit resultWidth = usrWidth; + XUnit resultHeight = usrHeight; + + Debug.Assert(xImage != null); + double xPixels = xImage.PixelWidth; + bool usrResolutionSet = !_image._resolution.IsNull; + + double horzRes = usrResolutionSet ? _image.Resolution : xImage.HorizontalResolution; + double vertRes = usrResolutionSet ? _image.Resolution : xImage.VerticalResolution; + +// ReSharper disable CompareOfFloatsByEqualityOperator + if (horzRes == 0 && vertRes == 0) + { + horzRes = 72; + vertRes = 72; + } + else if (horzRes == 0) + { + Debug.Assert(false, "How can this be?"); + horzRes = 72; + } + else if (vertRes == 0) + { + Debug.Assert(false, "How can this be?"); + vertRes = 72; + } + // ReSharper restore CompareOfFloatsByEqualityOperator + + XUnit inherentWidth = XUnit.FromInch(xPixels / horzRes); + double yPixels = xImage.PixelHeight; + XUnit inherentHeight = XUnit.FromInch(yPixels / vertRes); + + //bool lockRatio = _image.IsNull("LockAspectRatio") ? true : _image.LockAspectRatio; + bool lockRatio = _image._lockAspectRatio.IsNull || _image.LockAspectRatio; + + double scaleHeight = _image.ScaleHeight; + double scaleWidth = _image.ScaleWidth; + //bool scaleHeightSet = !_image.IsNull("ScaleHeight"); + //bool scaleWidthSet = !_image.IsNull("ScaleWidth"); + bool scaleHeightSet = !_image._scaleHeight.IsNull; + bool scaleWidthSet = !_image._scaleWidth.IsNull; + + if (lockRatio && !(scaleHeightSet && scaleWidthSet)) + { + if (usrWidthSet && !usrHeightSet) + { + resultHeight = inherentHeight / inherentWidth * usrWidth; + } + else if (usrHeightSet && !usrWidthSet) + { + resultWidth = inherentWidth / inherentHeight * usrHeight; + } +// ReSharper disable once ConditionIsAlwaysTrueOrFalse + else if (!usrHeightSet && !usrWidthSet) + { + resultHeight = inherentHeight; + resultWidth = inherentWidth; + } + + if (scaleHeightSet) + { + resultHeight = resultHeight * scaleHeight; + resultWidth = resultWidth * scaleHeight; + } + if (scaleWidthSet) + { + resultHeight = resultHeight * scaleWidth; + resultWidth = resultWidth * scaleWidth; + } + } + else + { + if (!usrHeightSet) + resultHeight = inherentHeight; + + if (!usrWidthSet) + resultWidth = inherentWidth; + + if (scaleHeightSet) + resultHeight = resultHeight * scaleHeight; + if (scaleWidthSet) + resultWidth = resultWidth * scaleWidth; + } + + formatInfo.CropWidth = (int)xPixels; + formatInfo.CropHeight = (int)yPixels; + if (_image._pictureFormat != null && !_image._pictureFormat.IsNull()) + { + PictureFormat picFormat = _image.PictureFormat; + //Cropping in pixels. + XUnit cropLeft = picFormat.CropLeft.Point; + XUnit cropRight = picFormat.CropRight.Point; + XUnit cropTop = picFormat.CropTop.Point; + XUnit cropBottom = picFormat.CropBottom.Point; + formatInfo.CropX = (int)(horzRes * cropLeft.Inch); + formatInfo.CropY = (int)(vertRes * cropTop.Inch); + formatInfo.CropWidth -= (int)(horzRes * ((XUnit)(cropLeft + cropRight)).Inch); + formatInfo.CropHeight -= (int)(vertRes * ((XUnit)(cropTop + cropBottom)).Inch); + + //Scaled cropping of the height and width. + double xScale = resultWidth / inherentWidth; + double yScale = resultHeight / inherentHeight; + + cropLeft = xScale * cropLeft; + cropRight = xScale * cropRight; + cropTop = yScale * cropTop; + cropBottom = yScale * cropBottom; + + resultHeight = resultHeight - cropTop - cropBottom; + resultWidth = resultWidth - cropLeft - cropRight; + } + if (resultHeight <= 0 || resultWidth <= 0) + { + formatInfo.Width = XUnit.FromCentimeter(2.5); + formatInfo.Height = XUnit.FromCentimeter(2.5); + Debug.WriteLine(Messages2.EmptyImageSize); + _failure = ImageFailure.EmptySize; + } + else + { + formatInfo.Width = resultWidth; + formatInfo.Height = resultHeight; + } + } + catch (Exception ex) + { + Debug.WriteLine(Messages2.ImageNotReadable(_image.Name, ex.Message)); + formatInfo.Failure = ImageFailure.NotRead; + } + finally + { + if (xImage != null) + xImage.Dispose(); + } + } + } + if (formatInfo.Failure != ImageFailure.None) + { + if (!_image._width.IsNull) + formatInfo.Width = _image.Width.Point; + else + formatInfo.Width = XUnit.FromCentimeter(2.5); + + if (!_image._height.IsNull) + formatInfo.Height = _image.Height.Point; + else + formatInfo.Height = XUnit.FromCentimeter(2.5); + } + } + + XImage CreateXImage(string uri) + { + if (uri.StartsWith("base64:")) + { + string base64 = uri.Substring("base64:".Length); + byte[] bytes = Convert.FromBase64String(base64); +#if WPF || CORE_WITH_GDI || GDI + // WPF stores a reference to the stream publicly. We must not destroy the stream here, otherwise rendering the PDF will fail. + // Same for GDI. CORE currently uses the GDI implementation. + // We have to rely on the garbage collector to properly dispose the MemoryStream. + { + Stream stream = new MemoryStream(bytes); + XImage image = XImage.FromStream(stream); + return image; + } +#else + using (Stream stream = new MemoryStream(bytes)) + { + XImage image = XImage.FromStream(stream); + return image; + } +#endif + } + return XImage.FromFile(uri); + } + + readonly Image _image; + string _imageFilePath; + ImageFailure _failure; + } +} diff --git a/MigraDoc.Rendering/Rendering/LayoutInfo.cs b/MigraDoc.Rendering/Rendering/LayoutInfo.cs new file mode 100644 index 0000000..90c24b1 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/LayoutInfo.cs @@ -0,0 +1,229 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering +{ + /// + /// Abstract base class to serve as a layoutable unit. + /// + public class LayoutInfo + { + public LayoutInfo() + { } + + /// + /// Gets or sets the height necessary to start the document object. + /// + public XUnit StartingHeight + { + get { return _startingHeight; } + set { _startingHeight = value; } + } + XUnit _startingHeight; + + /// + /// Gets or sets the height necessary to end the document object. + /// + public XUnit TrailingHeight + { + get { return _trailingHeight; } + set { _trailingHeight = value; } + } + XUnit _trailingHeight; + + /// + /// Indicates whether the document object shall be kept on one page + /// with its successor. + /// + public bool KeepWithNext + { + get { return _keepWithNext; } + set { _keepWithNext = value; } + } + bool _keepWithNext; + + /// + /// Indicates whether the document object shall be kept together on one page. + /// + public bool KeepTogether + { + get { return _keepTogether; } + set { _keepTogether = value; } + } + bool _keepTogether; + + /// + /// The space that shall be kept free above the element's content. + /// + public virtual XUnit MarginTop + { + get { return _marginTop; } + set { _marginTop = value; } + } + XUnit _marginTop; + + /// + /// The space that shall be kept free right to the element's content. + /// + public XUnit MarginRight + { + get { return _marginRight; } + set { _marginRight = value; } + } + XUnit _marginRight; + + /// + /// The space that shall be kept free below the element's content. + /// + public XUnit MarginBottom + { + get { return _marginBottom; } + set { _marginBottom = value; } + } + XUnit _marginBottom; + + /// + /// The space that shall be kept free left to the element's content. + /// + public XUnit MarginLeft + { + get { return _marginLeft; } + set { _marginLeft = value; } + } + XUnit _marginLeft; + + /// + /// Gets or sets the Area needed by the content (including padding and borders for e.g. paragraphs). + /// + public Area ContentArea + { + get { return _contentArea; } + set { _contentArea = value; } + } + Area _contentArea; + + /// + /// Gets or sets the a value indicating whether the element shall appear on a new page. + /// + public bool PageBreakBefore + { + get { return _pageBreakBefore; } + set { _pageBreakBefore = value; } + } + bool _pageBreakBefore; + + /// + /// Gets or sets the reference point for horizontal positioning. + /// + /// Default value is AreaBoundary. + public HorizontalReference HorizontalReference + { + get { return _horizontalReference; } + set { _horizontalReference = value; } + } + HorizontalReference _horizontalReference; + + /// + /// Gets or sets the reference point for vertical positioning. + /// + /// Default value is PreviousElement. + public VerticalReference VerticalReference + { + get { return _verticalReference; } + set { _verticalReference = value; } + } + VerticalReference _verticalReference; + + /// + /// Gets or sets the horizontal alignment of the element. + /// + /// Default value is Near. + public ElementAlignment HorizontalAlignment + { + get { return _horizontalAlignment; } + set { _horizontalAlignment = value; } + } + ElementAlignment _horizontalAlignment; + + /// + /// Gets or sets the vertical alignment of the element. + /// + /// Default value is Near. + public ElementAlignment VerticalAlignment + { + get { return _verticalAlignment; } + set { _verticalAlignment = value; } + } + ElementAlignment _verticalAlignment; + + /// + /// Gets or sets the floating behavior of surrounding elements. + /// + /// Default value is TopBottom. + public Floating Floating + { + get { return _floating; } + set { _floating = value; } + } + Floating _floating; + + /// + /// Gets or sets the top position of the element. + /// + public XUnit Top + { + get { return _top; } + set { _top = value; } + } + XUnit _top; + + /// + /// Gets or sets the left position of the element. + /// + public XUnit Left + { + get { return _left; } + set { _left = value; } + } + XUnit _left; + + /// + /// Gets or sets the minimum width of the element. + /// + public XUnit MinWidth + { + get { return _minWidth; } + set { _minWidth = value; } + } + XUnit _minWidth; + } +} diff --git a/MigraDoc.Rendering/Rendering/LineFormatRenderer.cs b/MigraDoc.Rendering/Rendering/LineFormatRenderer.cs new file mode 100644 index 0000000..7d7068e --- /dev/null +++ b/MigraDoc.Rendering/Rendering/LineFormatRenderer.cs @@ -0,0 +1,122 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel.Shapes; + +namespace MigraDoc.Rendering +{ + /// + /// Renders a line format to an XGraphics object. + /// + public class LineFormatRenderer + { + public LineFormatRenderer(LineFormat lineFormat, XGraphics gfx) + { + _lineFormat = lineFormat; + _gfx = gfx; + } + + private XColor GetColor() + { + Color clr = Colors.Black; + + if (_lineFormat != null && !_lineFormat.Color.IsEmpty) + clr = _lineFormat.Color; + +#if noCMYK + return XColor.FromArgb((int)clr.Argb); +#else + return ColorHelper.ToXColor(clr, _lineFormat.Document.UseCmykColor); +#endif + } + + public XUnit GetWidth() + { + if (_lineFormat == null) + return 0; + if (!_lineFormat._visible.IsNull && !_lineFormat.Visible) + return 0; + + if (!_lineFormat._width.IsNull) + return _lineFormat.Width.Point; + + if (!_lineFormat._color.IsNull || !_lineFormat._style.IsNull || _lineFormat.Visible) + return 1; + + return 0; + } + + public void Render(XUnit xPosition, XUnit yPosition, XUnit width, XUnit height) + { + XUnit lineWidth = GetWidth(); + if (lineWidth > 0) + { + XPen pen = GetPen(lineWidth); + _gfx.DrawRectangle(pen, xPosition, yPosition, width, height); + } + } + + XPen GetPen(XUnit width) + { + if (width == 0) + return null; + + XPen pen = new XPen(GetColor(), width); + switch (_lineFormat.DashStyle) + { + case DashStyle.Dash: + pen.DashStyle = XDashStyle.Dash; + break; + + case DashStyle.DashDot: + pen.DashStyle = XDashStyle.DashDot; + break; + + case DashStyle.DashDotDot: + pen.DashStyle = XDashStyle.DashDotDot; + break; + + case DashStyle.Solid: + pen.DashStyle = XDashStyle.Solid; + break; + + case DashStyle.SquareDot: + pen.DashStyle = XDashStyle.Dot; + break; + } + return pen; + } + + readonly LineFormat _lineFormat; + readonly XGraphics _gfx; + } +} diff --git a/MigraDoc.Rendering/Rendering/NumberFormatter.cs b/MigraDoc.Rendering/Rendering/NumberFormatter.cs new file mode 100644 index 0000000..ffae400 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/NumberFormatter.cs @@ -0,0 +1,125 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using MigraDoc.Rendering.Resources; + +namespace MigraDoc.Rendering +{ + /// + /// Formats numbers roman or with letters. + /// + public class NumberFormatter + { + public static string Format(int number, string format) + { + switch (format) + { + case "ROMAN": + return AsRoman(number, false); + + case "roman": + return AsRoman(number, true); + + case "ALPHABETIC": + return AsLetters(number, false); + + case "alphabetic": + return AsLetters(number, true); + } + return number.ToString(CultureInfo.InvariantCulture); + } + + static string AsRoman(int number, bool lowercase) + { + if (Math.Abs(number) > 32768) + { + Debug.WriteLine(Messages2.NumberTooLargeForRoman(number), "warning"); + return number.ToString(CultureInfo.InvariantCulture); + } + if (number == 0) + return "0"; + + string res = ""; + if (number < 0) + res += "-"; + + number = Math.Abs(number); + + string[] roman; + if (lowercase) + roman = new string[] { "m", "cm", "d", "cd", "c", "xc", "l", "xl", "x", "ix", "v", "iv", "i" }; + else + roman = new string[] { "M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I" }; + + int[] numberValues = new int[] { 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 }; + + for (int i = 0; i < numberValues.Length; ++i) + { + while (number >= numberValues[i]) + { + res += roman[i]; + number -= numberValues[i]; + } + } + return res; + } + + static string AsLetters(int number, bool lowercase) + { + if (Math.Abs(number) > 32768) + { + Debug.WriteLine(Messages2.NumberTooLargeForLetters(number)); + return number.ToString(); + } + + if (number == 0) + return "0"; + + string str = ""; + if (number < 0) + str += "-"; + + number = Math.Abs(number); + char cr; + if (lowercase) + cr = (char)('a' + (number - 1) % 26); + else + cr = (char)('A' + (number - 1) % 26); + + for (int n = 0; n <= (number - 1) / 26; ++n) + str += cr; + + return str; + } + } +} diff --git a/MigraDoc.Rendering/Rendering/PageBreakFormatInfo.cs b/MigraDoc.Rendering/Rendering/PageBreakFormatInfo.cs new file mode 100644 index 0000000..b875cc7 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/PageBreakFormatInfo.cs @@ -0,0 +1,68 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.Rendering +{ + /// + /// Formatting information for a page break. + /// + public sealed class PageBreakFormatInfo : FormatInfo + { + public override bool EndingIsComplete + { + get { return true; } + } + + public override bool IsComplete + { + get { return true; } + } + + public override bool IsEmpty + { + get { return false; } + } + + public override bool IsEnding + { + get { return true; } + } + + public override bool IsStarting + { + get { return true; } + } + + public override bool StartingIsComplete + { + get { return true; } + } + } +} diff --git a/MigraDoc.Rendering/Rendering/PageBreakRenderInfo.cs b/MigraDoc.Rendering/Rendering/PageBreakRenderInfo.cs new file mode 100644 index 0000000..3fa5b6f --- /dev/null +++ b/MigraDoc.Rendering/Rendering/PageBreakRenderInfo.cs @@ -0,0 +1,63 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel; + +namespace MigraDoc.Rendering +{ + /// + /// Rendering information for page breaks. + /// + public sealed class PageBreakRenderInfo : RenderInfo + { + public PageBreakRenderInfo() + { } + + /// + /// Gets the format information in a specific derived type. For a table, for example, this will be a TableFormatInfo with information about the first and last row showing on a page. + /// + public override FormatInfo FormatInfo + { + get { return _pageBreakFormatInfo; } + set { _pageBreakFormatInfo = (PageBreakFormatInfo)value; } + } + PageBreakFormatInfo _pageBreakFormatInfo; + + /// + /// Gets the document object to which the layout information applies. Use the Tag property of DocumentObject to identify an object. + /// + public override DocumentObject DocumentObject + { + get { return _pageBreak; } + set { _pageBreak = (PageBreak)value; } + } + PageBreak _pageBreak; + } +} diff --git a/MigraDoc.Rendering/Rendering/PageBreakRenderer.cs b/MigraDoc.Rendering/Rendering/PageBreakRenderer.cs new file mode 100644 index 0000000..b19d703 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/PageBreakRenderer.cs @@ -0,0 +1,92 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering +{ + /// + /// Renders a page break to an XGraphics object. + /// + public class PageBreakRenderer : Renderer + { + /// + /// Initializes a ParagraphRenderer object for formatting. + /// + /// The XGraphics object to do measurements on. + /// The page break. + /// The field infos. + public PageBreakRenderer(XGraphics gfx, PageBreak pageBreak, FieldInfos fieldInfos) + : base(gfx, pageBreak, fieldInfos) + { + _pageBreak = pageBreak; + } + + /// + /// Initializes a ParagraphRenderer object for rendering. + /// + /// The XGraphics object to render on. + /// The render info object containing information necessary for rendering. + /// The field infos. + public PageBreakRenderer(XGraphics gfx, RenderInfo renderInfo, FieldInfos fieldInfos) + : base(gfx, renderInfo, fieldInfos) + { + _renderInfo = renderInfo; + } + + public override void Format(Area area, FormatInfo previousFormatInfo) + { + PageBreakRenderInfo pbRenderInfo = new PageBreakRenderInfo(); + pbRenderInfo.FormatInfo = new PageBreakFormatInfo(); + _renderInfo = pbRenderInfo; + + pbRenderInfo.LayoutInfo.PageBreakBefore = true; + pbRenderInfo.LayoutInfo.ContentArea = new Rectangle(area.Y, area.Y, 0, 0); + pbRenderInfo.DocumentObject = _pageBreak; + } + + public override void Render() + { + // Nothing to do here. + } + + public override LayoutInfo InitialLayoutInfo + { + get + { + LayoutInfo layoutInfo = new LayoutInfo(); + layoutInfo.PageBreakBefore = true; + return layoutInfo; + } + } + readonly PageBreak _pageBreak; + } +} diff --git a/MigraDoc.Rendering/Rendering/PageInfo.cs b/MigraDoc.Rendering/Rendering/PageInfo.cs new file mode 100644 index 0000000..099bf91 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/PageInfo.cs @@ -0,0 +1,79 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering +{ + /// + /// Provides information necessary to render the page. + /// + public class PageInfo + { + public PageInfo(XUnit width, XUnit height, PageOrientation orientation) + { + _width = width; + _height = height; + _orientation = orientation; + } + + /// + /// Gets the with of the described page as specified in Document.PageSetup, i.e. the orientation + /// is not taken into account. + /// + public XUnit Width + { + get { return _width; } + } + private readonly XUnit _width; + + /// + /// Gets the height of the described page as specified in Document.PageSetup, i.e. the orientation + /// is not taken into account. + /// + public XUnit Height + { + get { return _height; } + } + private readonly XUnit _height; + + /// + /// Gets the orientation of the described page as specified in Document.PageSetup. + /// The value has no influence on the properties Width or Height, i.e. if the result is PageOrientation.Landscape + /// you must exchange the values of Width or Height to get the real page size. + /// + public PageOrientation Orientation + { + get { return _orientation; } + } + private readonly PageOrientation _orientation; + } +} diff --git a/MigraDoc.Rendering/Rendering/ParagraphFormatInfo.cs b/MigraDoc.Rendering/Rendering/ParagraphFormatInfo.cs new file mode 100644 index 0000000..8adb299 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ParagraphFormatInfo.cs @@ -0,0 +1,187 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel.Shapes; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel; + +namespace MigraDoc.Rendering +{ + /// + /// Vertical measurements of a paragraph line. + /// + public struct VerticalLineInfo + { + public VerticalLineInfo(XUnit height, XUnit descent, XUnit inherentlineSpace) + { + Height = height; + Descent = descent; + InherentlineSpace = inherentlineSpace; + } + + public XUnit Height; + + public XUnit Descent; + + public XUnit InherentlineSpace; + } + + /// + /// Line info object used by the paragraph format info. + /// + public struct LineInfo + { + public ParagraphIterator StartIter; + public ParagraphIterator EndIter; + public XUnit WordsWidth; + public XUnit LineWidth; + public int BlankCount; + public VerticalLineInfo Vertical; + public List TabOffsets; + public bool ReMeasureLine; + public DocumentObject LastTab; + } + + /// + /// Formatting information for a paragraph. + /// + public sealed class ParagraphFormatInfo : FormatInfo + { + public ParagraphFormatInfo() + { } + + public LineInfo GetLineInfo(int lineIdx) + { + return _lineInfos[lineIdx]; + } + + public LineInfo GetLastLineInfo() + { + return _lineInfos[LineCount - 1]; + } + + public LineInfo GetFirstLineInfo() + { + return _lineInfos[0]; + } + + public void AddLineInfo(LineInfo lineInfo) + { + _lineInfos.Add(lineInfo); + } + + public int LineCount + { + get { return _lineInfos.Count; } + } + + /// + /// + /// + /// + /// + public void Append(FormatInfo mergeInfo) + { + ParagraphFormatInfo formatInfo = (ParagraphFormatInfo)mergeInfo; + _lineInfos.AddRange(formatInfo._lineInfos); + } + + /// + /// Indicates whether the paragraph is ending. + /// + /// True if the paragraph is ending. + public override bool IsEnding + { + get { return _isEnding; } + } + public bool _isEnding; + + /// + /// Indicates whether the paragraph is starting. + /// + /// True if the paragraph is starting. + public override bool IsStarting + { + get { return _isStarting; } + } + public bool _isStarting; + + public override bool IsComplete + { + get { return _isStarting && _isEnding; } + } + + public override bool IsEmpty + { + get { return _lineInfos.Count == 0; } + } + + public override bool StartingIsComplete + { + get + { + if (_widowControl) + return (IsComplete || (_isStarting && _lineInfos.Count >= 2)); + return _isStarting; + } + } + + public bool _widowControl; + + public override bool EndingIsComplete + { + get + { + if (_widowControl) + return (IsComplete || (_isEnding && _lineInfos.Count >= 2)); + return _isEnding; + } + } + + public void RemoveEnding() + { + if (!IsEmpty) + { + if (_widowControl && _isEnding && LineCount >= 2) + _lineInfos.RemoveAt(LineCount - 2); + if (LineCount > 0) + _lineInfos.RemoveAt(LineCount - 1); + + _isEnding = false; + } + } + + public string ListSymbol; + public XFont ListFont; + public Dictionary ImageRenderInfos; + readonly List _lineInfos = new List(); + } +} diff --git a/MigraDoc.Rendering/Rendering/ParagraphIterator.cs b/MigraDoc.Rendering/Rendering/ParagraphIterator.cs new file mode 100644 index 0000000..0a473be --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ParagraphIterator.cs @@ -0,0 +1,286 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel; + +namespace MigraDoc.Rendering +{ + /// + /// Iterates sequentially through the elements of a paragraph. + /// + public class ParagraphIterator + { + /// + /// Initializes a paragraph iterator pointing on the given paragraph elements object. + /// Paragraph iterators received from this paragraph iterator relate to this root node. + /// + /// The root node for the paragraph iterator. + public ParagraphIterator(ParagraphElements rootNode) + { + _rootNode = rootNode; + _current = rootNode; + _positionIndices = new List(); + } + + /// + /// Initializes a paragraph iterator given the root node, its position in the object tree and the current object + /// + /// The node the position indices relate to. + /// The element the iterator shall point to. + /// The position of the paragraph iterator in terms of element indices. + private ParagraphIterator(ParagraphElements rootNode, DocumentObject current, List indices) + { + _rootNode = rootNode; + _positionIndices = indices; + _current = current; + } + + /// + /// Determines whether this iterator is the first leaf of the root node. + /// + public bool IsFirstLeaf + { + get + { + if (!(_current is DocumentElements)) + { + ParagraphIterator prevIter = GetPreviousLeaf(); + return prevIter == null; + } + return false; + } + } + + /// + /// Determines whether this iterator is the last leaf of the document object tree. + /// + public bool IsLastLeaf + { + get + { + if (!(_current is DocumentElements)) + { + ParagraphIterator nextIter = GetNextLeaf(); + return nextIter == null; + } + return false; + } + } + + /// + /// Gets the document object this instance ponits to. + /// + public DocumentObject Current + { + get { return _current; } + } + + /// + /// Gets the last leaf of the document object tree. + /// + /// The paragraph iterator pointing to the last leaf in the document object tree. + public ParagraphIterator GetLastLeaf() + { + if (_rootNode.Count == 0) + return null; + return SeekLastLeaf(); + } + + + /// + /// Gets the first leaf of the element tree. + /// + /// The paragraph iterator pointing to the first leaf in the element tree. + public ParagraphIterator GetFirstLeaf() + { + if (_rootNode.Count == 0) + return null; + return SeekFirstLeaf(); + } + + /// + /// Returns the next iterator in the tree pointing to a leaf. + /// + /// This function is intended to receive the renderable objects of a paragraph. + /// Thus, empty ParagraphElement objects (which are collections) don't count as leafs. + public ParagraphIterator GetNextLeaf() + { + //Move up to appropriate parent element + ParagraphIterator parIterator = GetParentIterator(); + if (parIterator == null) + return null; + + int elementIndex = LastIndex; + ParagraphElements parEls = (ParagraphElements)parIterator._current; + while (elementIndex == parEls.Count - 1) + { + elementIndex = parIterator.LastIndex; + parIterator = parIterator.GetParentIterator(); + if (parIterator == null) + break; + + parEls = (ParagraphElements)parIterator._current; + } + if (parIterator == null) + return null; + int newIndex = elementIndex + 1; + if (newIndex >= parEls.Count) + return null; + + List indices = new List(parIterator._positionIndices); //(Array_List)parIterator.positionIndices.Clone(); + indices.Add(newIndex); + DocumentObject obj = GetNodeObject(parEls[newIndex]); + ParagraphIterator iterator = new ParagraphIterator(_rootNode, obj, indices); + return iterator.SeekFirstLeaf(); + } + + /// + /// Gets the object a paragraph iterator shall point to. + /// Only ParagraphElements and renderable objects are allowed. + /// + /// The object to select the node object for. + /// The object a paragraph iterator shall point to. + private DocumentObject GetNodeObject(DocumentObject obj) + { + if (obj is FormattedText) + return ((FormattedText)obj).Elements; + if (obj is Hyperlink) + return ((Hyperlink)obj).Elements; + return obj; + } + + /// + /// Returns the previous iterator to a leaf in the document object tree pointing. + /// + /// The previous leaf, null if none exists. + public ParagraphIterator GetPreviousLeaf() + { + //Move up to appropriate parent element + ParagraphIterator parIterator = GetParentIterator(); + if (parIterator == null) + return null; + + int elementIndex = LastIndex; + ParagraphElements parEls = (ParagraphElements)parIterator._current; + while (elementIndex == 0) + { + elementIndex = parIterator.LastIndex; + parIterator = parIterator.GetParentIterator(); + if (parIterator == null) + break; + + parEls = (ParagraphElements)parIterator._current; + } + if (parIterator == null) + return null; + + int newIndex = elementIndex - 1; + if (newIndex < 0) + return null; + + List indices = new List(parIterator._positionIndices);//(Array_List)parIterator.positionIndices.Clone(); + indices.Add(newIndex); + + DocumentObject obj = GetNodeObject(parEls[newIndex]); + ParagraphIterator iterator = new ParagraphIterator(_rootNode, obj, indices); + return iterator.SeekLastLeaf(); + } + + private ParagraphIterator SeekLastLeaf() + { + DocumentObject obj = Current; + if (!(obj is ParagraphElements)) + return this; + + List indices = new List(_positionIndices); + + while (obj is ParagraphElements) + { + ParagraphElements parEls = (ParagraphElements)obj; + if (((ParagraphElements)obj).Count == 0) + return new ParagraphIterator(_rootNode, obj, indices); + + int idx = ((ParagraphElements)obj).Count - 1; + indices.Add(idx); + obj = GetNodeObject(parEls[idx]); + } + return new ParagraphIterator(_rootNode, obj, indices); + } + + /// + /// Gets the leftmost leaf within the hierarchy. + /// + /// The searched leaf. + ParagraphIterator SeekFirstLeaf() + { + DocumentObject obj = Current; + if (!(obj is ParagraphElements)) + return this; + List indices = new List(_positionIndices); + + while (obj is ParagraphElements) + { + ParagraphElements parEls = (ParagraphElements)obj; + if (parEls.Count == 0) + return new ParagraphIterator(_rootNode, obj, indices); + + indices.Add(0); + obj = GetNodeObject(parEls[0]); + } + return new ParagraphIterator(_rootNode, obj, indices); + } + + private ParagraphIterator GetParentIterator() + { + if (_positionIndices.Count == 0) + return null; + + List indices = new List(_positionIndices); + indices.RemoveAt(indices.Count - 1); + DocumentObject parent = DocumentRelations.GetParentOfType(_current, typeof(ParagraphElements)); + return new ParagraphIterator(_rootNode, parent, indices); + } + + private int LastIndex + { + get + { + if (_positionIndices.Count == 0) + return -1; + return _positionIndices[_positionIndices.Count - 1]; + } + } + + readonly ParagraphElements _rootNode; + readonly List _positionIndices; + readonly DocumentObject _current; + } +} diff --git a/MigraDoc.Rendering/Rendering/ParagraphRenderInfo.cs b/MigraDoc.Rendering/Rendering/ParagraphRenderInfo.cs new file mode 100644 index 0000000..7fd1c0e --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ParagraphRenderInfo.cs @@ -0,0 +1,71 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel; + +namespace MigraDoc.Rendering +{ + /// + /// Represents rendering information for a paragraph. + /// + public sealed class ParagraphRenderInfo : RenderInfo + { + public ParagraphRenderInfo() + { } + + /// + /// Gets the format information in a specific derived type. For a table, for example, this will be a TableFormatInfo with information about the first and last row showing on a page. + /// + public override FormatInfo FormatInfo + { + get { return _formatInfo; } + set { _formatInfo = (ParagraphFormatInfo)value; } + } + ParagraphFormatInfo _formatInfo = new ParagraphFormatInfo(); + + /// + /// Gets the document object to which the layout information applies. Use the Tag property of DocumentObject to identify an object. + /// + public override DocumentObject DocumentObject + { + get { return _paragraph; } + set { _paragraph = (Paragraph)value; } + } + Paragraph _paragraph; + + public override void RemoveEnding() + { + ParagraphFormatInfo pfInfo = (ParagraphFormatInfo)FormatInfo; + pfInfo.RemoveEnding(); + Area contentArea = LayoutInfo.ContentArea; + contentArea.Height -= LayoutInfo.TrailingHeight; + } + } +} diff --git a/MigraDoc.Rendering/Rendering/ParagraphRenderer.cs b/MigraDoc.Rendering/Rendering/ParagraphRenderer.cs new file mode 100644 index 0000000..b481222 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ParagraphRenderer.cs @@ -0,0 +1,2545 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using MigraDoc.DocumentObjectModel; +using PdfSharp.Pdf; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel.Fields; +using MigraDoc.DocumentObjectModel.Shapes; +using MigraDoc.Rendering.Resources; + +namespace MigraDoc.Rendering +{ + public struct TabOffset + { + public TabOffset(TabLeader leader, XUnit offset) + { + Leader = leader; + Offset = offset; + } + public TabLeader Leader; + public XUnit Offset; + } + + /// + /// Summary description for ParagraphRenderer. + /// + public class ParagraphRenderer : Renderer + { + /// + /// Process phases of the renderer. + /// + private enum Phase + { + Formatting, + Rendering + } + + /// + /// Results that can occur when processing a paragraph element + /// during formatting. + /// + private enum FormatResult + { + /// + /// Ignore the current element during formatting. + /// + Ignore, + + /// + /// Continue with the next element within the same line. + /// + Continue, + + /// + /// Start a new line from the current object on. + /// + NewLine, + + /// + /// Break formatting and continue in a new area (e.g. a new page). + /// + NewArea + } + Phase _phase; + + /// + /// Initializes a ParagraphRenderer object for formatting. + /// + /// The XGraphics object to do measurements on. + /// The paragraph to format. + /// The field infos. + public ParagraphRenderer(XGraphics gfx, Paragraph paragraph, FieldInfos fieldInfos) + : base(gfx, paragraph, fieldInfos) + { + _paragraph = paragraph; + + ParagraphRenderInfo parRenderInfo = new ParagraphRenderInfo(); + parRenderInfo.DocumentObject = _paragraph; + ((ParagraphFormatInfo)parRenderInfo.FormatInfo)._widowControl = _paragraph.Format.WidowControl; + + _renderInfo = parRenderInfo; + } + + /// + /// Initializes a ParagraphRenderer object for rendering. + /// + /// The XGraphics object to render on. + /// The render info object containing information necessary for rendering. + /// The field infos. + public ParagraphRenderer(XGraphics gfx, RenderInfo renderInfo, FieldInfos fieldInfos) + : base(gfx, renderInfo, fieldInfos) + { + _paragraph = (Paragraph)renderInfo.DocumentObject; + } + + /// + /// Renders the paragraph. + /// + public override void Render() + { + InitRendering(); + if ((int)_paragraph.Format.OutlineLevel >= 1 && _gfx.PdfPage != null) // Don't call GetOutlineTitle() in vain + _documentRenderer.AddOutline((int)_paragraph.Format.OutlineLevel, GetOutlineTitle(), _gfx.PdfPage); + + RenderShading(); + RenderBorders(); + + ParagraphFormatInfo parFormatInfo = (ParagraphFormatInfo)_renderInfo.FormatInfo; + for (int idx = 0; idx < parFormatInfo.LineCount; ++idx) + { + LineInfo lineInfo = parFormatInfo.GetLineInfo(idx); + _isLastLine = (idx == parFormatInfo.LineCount - 1); + + _lastTabPosition = 0; + if (lineInfo.ReMeasureLine) + ReMeasureLine(ref lineInfo); + + RenderLine(lineInfo); + } + } + + bool IsRenderedField(DocumentObject docObj) + { + if (docObj is NumericFieldBase) + return true; + + if (docObj is DocumentInfo) + return true; + + if (docObj is DateField) + return true; + + return false; + } + + string GetFieldValue(DocumentObject field) + { + NumericFieldBase numericFieldBase = field as NumericFieldBase; + if (numericFieldBase != null) + { + int number = -1; + PageRefField refField = field as PageRefField; + if (refField != null) + { + PageRefField pageRefField = refField; + number = _fieldInfos.GetShownPageNumber(pageRefField.Name); + if (number <= 0) + { + if (_phase == Phase.Formatting) + return "XX"; + return Messages2.BookmarkNotDefined(pageRefField.Name); + } + } + else if (field is SectionField) + { + number = _fieldInfos.Section; + if (number <= 0) + return "XX"; + } + else if (field is PageField) + { + number = _fieldInfos.DisplayPageNr; + if (number <= 0) + return "XX"; + } + else if (field is NumPagesField) + { + number = _fieldInfos.NumPages; + if (number <= 0) + return "XXX"; + } + else if (field is SectionPagesField) + { + number = _fieldInfos.SectionPages; + if (number <= 0) + return "XX"; + } + return NumberFormatter.Format(number, numericFieldBase.Format); + } + else + { + DateField dateField = field as DateField; + if (dateField != null) + { + DateTime dt = (_fieldInfos.Date); + if (dt == DateTime.MinValue) + dt = DateTime.Now; + + return _fieldInfos.Date.ToString(dateField.Format); + } + + InfoField infoField = field as InfoField; + if (infoField != null) + return GetDocumentInfo(infoField.Name); + + Debug.Assert(false, "Given parameter must be a rendered Field"); + } + + return ""; + } + + string GetOutlineTitle() + { + ParagraphIterator iter = new ParagraphIterator(_paragraph.Elements); + iter = iter.GetFirstLeaf(); + + bool ignoreBlank = true; + string title = ""; + while (iter != null) + { + DocumentObject current = iter.Current; + if (!ignoreBlank && (IsBlank(current) || IsTab(current) || IsLineBreak(current))) + { + title += " "; + ignoreBlank = true; + } + else if (current is Text) + { + title += ((Text)current).Content; + ignoreBlank = false; + } + else if (IsRenderedField(current)) + { + title += GetFieldValue(current); + ignoreBlank = false; + } + else if (IsSymbol(current)) + { + title += GetSymbol((Character)current); + ignoreBlank = false; + } + + if (title.Length > 64) + break; + iter = iter.GetNextLeaf(); + } + return title; + } + + /// + /// Gets a layout info with only margin and break information set. + /// It can be taken before the paragraph is formatted. + /// + /// + /// The following layout information is set properly:
+ /// MarginTop, MarginLeft, MarginRight, MarginBottom, KeepTogether, KeepWithNext, PagebreakBefore. + ///
+ public override LayoutInfo InitialLayoutInfo + { + get + { + LayoutInfo layoutInfo = new LayoutInfo(); + layoutInfo.PageBreakBefore = _paragraph.Format.PageBreakBefore; + layoutInfo.MarginTop = _paragraph.Format.SpaceBefore.Point; + layoutInfo.MarginBottom = _paragraph.Format.SpaceAfter.Point; + //Don't confuse margins with left or right indent. + //Indents are invisible for the layouter. + layoutInfo.MarginRight = 0; + layoutInfo.MarginLeft = 0; + layoutInfo.KeepTogether = _paragraph.Format.KeepTogether; + layoutInfo.KeepWithNext = _paragraph.Format.KeepWithNext; + return layoutInfo; + } + } + + /// + /// Adjusts the current x position to the given tab stop if possible. + /// + /// True, if the text doesn't fit the line any more and the tab causes a line break. + FormatResult FormatTab() + { + // For Tabs in Justified context + if (_paragraph.Format.Alignment == ParagraphAlignment.Justify) + _reMeasureLine = true; + TabStop nextTabStop = GetNextTabStop(); + _savedWordWidth = 0; + if (nextTabStop == null) + return FormatResult.NewLine; + + bool notFitting = false; + XUnit xPositionBeforeTab = _currentXPosition; + switch (nextTabStop.Alignment) + { + case TabAlignment.Left: + _currentXPosition = ProbeAfterLeftAlignedTab(nextTabStop.Position.Point, out notFitting); + break; + + case TabAlignment.Right: + _currentXPosition = ProbeAfterRightAlignedTab(nextTabStop.Position.Point, out notFitting); + break; + + case TabAlignment.Center: + _currentXPosition = ProbeAfterCenterAlignedTab(nextTabStop.Position.Point, out notFitting); + break; + + case TabAlignment.Decimal: + _currentXPosition = ProbeAfterDecimalAlignedTab(nextTabStop.Position.Point, out notFitting); + break; + } + if (!notFitting) + { + // For correct right paragraph alignment with tabs + if (!IgnoreHorizontalGrowth) + _currentLineWidth += _currentXPosition - xPositionBeforeTab; + + _tabOffsets.Add(new TabOffset(nextTabStop.Leader, _currentXPosition - xPositionBeforeTab)); + if (_currentLeaf != null) + _lastTab = _currentLeaf.Current; + } + + return notFitting ? FormatResult.NewLine : FormatResult.Continue; + } + + bool IsLineBreak(DocumentObject docObj) + { + if (docObj is Character) + { + if (((Character)docObj).SymbolName == SymbolName.LineBreak) + return true; + } + return false; + } + + bool IsBlank(DocumentObject docObj) + { + if (docObj is Text) + { + if (((Text)docObj).Content == " ") + return true; + } + return false; + } + + bool IsTab(DocumentObject docObj) + { + if (docObj is Character) + { + if (((Character)docObj).SymbolName == SymbolName.Tab) + return true; + } + return false; + } + + bool IsSoftHyphen(DocumentObject docObj) + { + Text text = docObj as Text; + if (text != null) + return text.Content == "­"; + + return false; + } + + /// + /// Probes the paragraph elements after a left aligned tab stop and returns the vertical text position to start at. + /// + /// Position of the tab to probe. + /// Out parameter determining whether the tab causes a line break. + /// The new x-position to restart behind the tab. + XUnit ProbeAfterLeftAlignedTab(XUnit tabStopPosition, out bool notFitting) + { + //--- Save --------------------------------- + ParagraphIterator iter; + int blankCount; + XUnit xPosition; + XUnit lineWidth; + XUnit wordsWidth; + XUnit blankWidth; + SaveBeforeProbing(out iter, out blankCount, out wordsWidth, out xPosition, out lineWidth, out blankWidth); + //------------------------------------------ + + XUnit xPositionAfterTab = xPosition; + _currentXPosition = _formattingArea.X + tabStopPosition.Point; + + notFitting = ProbeAfterTab(); + if (!notFitting) + xPositionAfterTab = _formattingArea.X + tabStopPosition; + + //--- Restore --------------------------------- + RestoreAfterProbing(iter, blankCount, wordsWidth, xPosition, lineWidth, blankWidth); + //------------------------------------------ + return xPositionAfterTab; + } + + /// + /// Probes the paragraph elements after a right aligned tab stop and returns the vertical text position to start at. + /// + /// Position of the tab to probe. + /// Out parameter determining whether the tab causes a line break. + /// The new x-position to restart behind the tab. + XUnit ProbeAfterRightAlignedTab(XUnit tabStopPosition, out bool notFitting) + { + //--- Save --------------------------------- + ParagraphIterator iter; + int blankCount; + XUnit xPosition; + XUnit lineWidth; + XUnit wordsWidth; + XUnit blankWidth; + SaveBeforeProbing(out iter, out blankCount, out wordsWidth, out xPosition, out lineWidth, out blankWidth); + //------------------------------------------ + + XUnit xPositionAfterTab = xPosition; + + notFitting = ProbeAfterTab(); + if (!notFitting && xPosition + _currentLineWidth <= _formattingArea.X + tabStopPosition) + xPositionAfterTab = _formattingArea.X + tabStopPosition - _currentLineWidth; + + //--- Restore ------------------------------ + RestoreAfterProbing(iter, blankCount, wordsWidth, xPosition, lineWidth, blankWidth); + //------------------------------------------ + return xPositionAfterTab; + } + + Hyperlink GetHyperlink() + { + DocumentObject elements = DocumentRelations.GetParent(_currentLeaf.Current); + DocumentObject parent = DocumentRelations.GetParent(elements); + while (!(parent is Paragraph)) + { + Hyperlink hyperlink = parent as Hyperlink; + if (hyperlink != null) + return hyperlink; + elements = DocumentRelations.GetParent(parent); + parent = DocumentRelations.GetParent(elements); + } + return null; + } + + /// + /// Probes the paragraph elements after a right aligned tab stop and returns the vertical text position to start at. + /// + /// Position of the tab to probe. + /// Out parameter determining whether the tab causes a line break. + /// The new x-position to restart behind the tab. + XUnit ProbeAfterCenterAlignedTab(XUnit tabStopPosition, out bool notFitting) + { + //--- Save --------------------------------- + ParagraphIterator iter; + int blankCount; + XUnit xPosition; + XUnit lineWidth; + XUnit wordsWidth; + XUnit blankWidth; + SaveBeforeProbing(out iter, out blankCount, out wordsWidth, out xPosition, out lineWidth, out blankWidth); + //------------------------------------------ + + XUnit xPositionAfterTab = xPosition; + notFitting = ProbeAfterTab(); + + if (!notFitting) + { + if (xPosition + _currentLineWidth / 2.0 <= _formattingArea.X + tabStopPosition) + { + Rectangle rect = _formattingArea.GetFittingRect(_currentYPosition, _currentVerticalInfo.Height); + if (_formattingArea.X + tabStopPosition + _currentLineWidth / 2.0 > rect.X + rect.Width - RightIndent) + { + //the text is too long on the right hand side of the tabstop => align to right indent. + xPositionAfterTab = rect.X + + rect.Width - + RightIndent - + _currentLineWidth; + } + else + xPositionAfterTab = _formattingArea.X + tabStopPosition - _currentLineWidth / 2; + } + } + + //--- Restore ------------------------------ + RestoreAfterProbing(iter, blankCount, wordsWidth, xPosition, lineWidth, blankWidth); + //------------------------------------------ + return xPositionAfterTab; + } + + /// + /// Probes the paragraph elements after a right aligned tab stop and returns the vertical text position to start at. + /// + /// Position of the tab to probe. + /// Out parameter determining whether the tab causes a line break. + /// The new x-position to restart behind the tab. + XUnit ProbeAfterDecimalAlignedTab(XUnit tabStopPosition, out bool notFitting) + { + notFitting = false; + ParagraphIterator savedLeaf = _currentLeaf; + + //Extra for auto tab after list symbol + if (IsTab(_currentLeaf.Current)) + _currentLeaf = _currentLeaf.GetNextLeaf(); + if (_currentLeaf == null) + { + _currentLeaf = savedLeaf; + return _currentXPosition + tabStopPosition; + } + VerticalLineInfo newVerticalInfo = CalcCurrentVerticalInfo(); + Rectangle fittingRect = _formattingArea.GetFittingRect(_currentYPosition, newVerticalInfo.Height); + if (fittingRect == null) + { + notFitting = true; + _currentLeaf = savedLeaf; + return _currentXPosition; + } + + if (IsPlainText(_currentLeaf.Current)) + { + Text text = (Text)_currentLeaf.Current; + string word = text.Content; + int lastIndex = text.Content.LastIndexOfAny(new char[] { ',', '.' }); + if (lastIndex > 0) + word = word.Substring(0, lastIndex); + + XUnit wordLength = MeasureString(word); + notFitting = _currentXPosition + wordLength >= _formattingArea.X + _formattingArea.Width + Tolerance; + if (!notFitting) + return _formattingArea.X + tabStopPosition - wordLength; + + return _currentXPosition; + } + _currentLeaf = savedLeaf; + return ProbeAfterRightAlignedTab(tabStopPosition, out notFitting); + } + + void SaveBeforeProbing(out ParagraphIterator paragraphIter, out int blankCount, out XUnit wordsWidth, out XUnit xPosition, out XUnit lineWidth, out XUnit blankWidth) + { + paragraphIter = _currentLeaf; + blankCount = _currentBlankCount; + xPosition = _currentXPosition; + lineWidth = _currentLineWidth; + wordsWidth = _currentWordsWidth; + blankWidth = _savedBlankWidth; + } + + void RestoreAfterProbing(ParagraphIterator paragraphIter, int blankCount, XUnit wordsWidth, XUnit xPosition, XUnit lineWidth, XUnit blankWidth) + { + _currentLeaf = paragraphIter; + _currentBlankCount = blankCount; + _currentXPosition = xPosition; + _currentLineWidth = lineWidth; + _currentWordsWidth = wordsWidth; + _savedBlankWidth = blankWidth; + } + + /// + /// Probes the paragraph after a tab. + /// Caution: This Function resets the word count and line width before doing its work. + /// + /// True if the tab causes a linebreak. + bool ProbeAfterTab() + { + _currentLineWidth = 0; + _currentBlankCount = 0; + //Extra for auto tab after list symbol + + //TODO: KLPO4KLPO: Check if this conditional statement is still required + if (_currentLeaf != null && IsTab(_currentLeaf.Current)) + _currentLeaf = _currentLeaf.GetNextLeaf(); + + bool wordAppeared = false; + while (_currentLeaf != null && !IsLineBreak(_currentLeaf.Current) && !IsTab(_currentLeaf.Current)) + { + FormatResult result = FormatElement(_currentLeaf.Current); + if (result != FormatResult.Continue) + break; + + wordAppeared = wordAppeared || IsWordLikeElement(_currentLeaf.Current); + _currentLeaf = _currentLeaf.GetNextLeaf(); + } + return _currentLeaf != null && !IsLineBreak(_currentLeaf.Current) && + !IsTab(_currentLeaf.Current) && !wordAppeared; + } + + /// + /// Gets the next tab stop following the current x position. + /// + /// The searched tab stop. + private TabStop GetNextTabStop() + { + ParagraphFormat format = _paragraph.Format; + TabStops tabStops = format.TabStops; + XUnit lastPosition = 0; + + foreach (TabStop tabStop in tabStops) + { + if (tabStop.Position.Point > _formattingArea.Width - RightIndent + Tolerance) + break; + + // Compare with "Tolerance" to prevent rounding errors from taking us one tabstop too far. + if (tabStop.Position.Point + _formattingArea.X > _currentXPosition + Tolerance) + return tabStop; + + lastPosition = tabStop.Position.Point; + } + //Automatic tab stop: FirstLineIndent < 0 => automatic tab stop at LeftIndent. + + if (format.FirstLineIndent < 0 || + (format._listInfo != null && !format._listInfo.IsNull() && format.ListInfo.NumberPosition < format.LeftIndent)) + { + XUnit leftIndent = format.LeftIndent.Point; + if (_isFirstLine && _currentXPosition < leftIndent + _formattingArea.X) + return new TabStop(leftIndent.Point); + } + XUnit defaultTabStop = "1.25cm"; + if (!_paragraph.Document._defaultTabStop.IsNull) + defaultTabStop = _paragraph.Document.DefaultTabStop.Point; + + XUnit currTabPos = defaultTabStop; + while (currTabPos + _formattingArea.X <= _formattingArea.Width - RightIndent) + { + if (currTabPos > lastPosition && currTabPos + _formattingArea.X > _currentXPosition + Tolerance) + return new TabStop(currTabPos.Point); + + currTabPos += defaultTabStop; + } + return null; + } + + /// + /// Gets the horizontal position to start a new line. + /// + /// The position to start the line. + XUnit StartXPosition + { + get + { + XUnit xPos = 0; + + if (_phase == Phase.Formatting) + { + xPos = _formattingArea.GetFittingRect(_currentYPosition, _currentVerticalInfo.Height).X; + xPos += LeftIndent; + } + else //if (phase == Phase.Rendering) + { + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + //next lines for non fitting lines that produce an empty fitting rect: + XUnit rectX = contentArea.X; + XUnit rectWidth = contentArea.Width; + + Rectangle fittingRect = contentArea.GetFittingRect(_currentYPosition, _currentVerticalInfo.Height); + if (fittingRect != null) + { + rectX = fittingRect.X; + rectWidth = fittingRect.Width; + } + switch (_paragraph.Format.Alignment) + { + case ParagraphAlignment.Left: + case ParagraphAlignment.Justify: + xPos = rectX; + xPos += LeftIndent; + break; + + case ParagraphAlignment.Right: + xPos = rectX + rectWidth - RightIndent; + xPos -= _currentLineWidth; + break; + + case ParagraphAlignment.Center: + xPos = rectX + (rectWidth + LeftIndent - RightIndent - _currentLineWidth) / 2.0; + break; + } + } + return xPos; + } + } + + /// + /// Renders a single line. + /// + /// + void RenderLine(LineInfo lineInfo) + { + _currentVerticalInfo = lineInfo.Vertical; + _currentLeaf = lineInfo.StartIter; + _startLeaf = lineInfo.StartIter; + _endLeaf = lineInfo.EndIter; + _currentBlankCount = lineInfo.BlankCount; + _currentLineWidth = lineInfo.LineWidth; + _currentWordsWidth = lineInfo.WordsWidth; + _currentXPosition = StartXPosition; + _tabOffsets = lineInfo.TabOffsets; + _lastTabPassed = lineInfo.LastTab == null; + _lastTab = lineInfo.LastTab; + + _tabIdx = 0; + + bool ready = _currentLeaf == null; + if (_isFirstLine) + RenderListSymbol(); + + while (!ready) + { + if (_currentLeaf.Current == lineInfo.EndIter.Current) + ready = true; + + if (_currentLeaf.Current == lineInfo.LastTab) + _lastTabPassed = true; + RenderElement(_currentLeaf.Current); + _currentLeaf = _currentLeaf.GetNextLeaf(); + } + _currentYPosition += lineInfo.Vertical.Height; + _isFirstLine = false; + } + + void ReMeasureLine(ref LineInfo lineInfo) + { + //--- Save --------------------------------- + ParagraphIterator iter; + int blankCount; + XUnit xPosition; + XUnit lineWidth; + XUnit wordsWidth; + XUnit blankWidth; + SaveBeforeProbing(out iter, out blankCount, out wordsWidth, out xPosition, out lineWidth, out blankWidth); + bool origLastTabPassed = _lastTabPassed; + //------------------------------------------ + _currentLeaf = lineInfo.StartIter; + _endLeaf = lineInfo.EndIter; + _formattingArea = _renderInfo.LayoutInfo.ContentArea; + _tabOffsets = new List(); + _currentLineWidth = 0; + _currentWordsWidth = 0; + + Rectangle fittingRect = _formattingArea.GetFittingRect(_currentYPosition, _currentVerticalInfo.Height); + if (fittingRect != null) + { + _currentXPosition = fittingRect.X + LeftIndent; + FormatListSymbol(); + bool goOn = true; + while (goOn && _currentLeaf != null) + { + if (_currentLeaf.Current == lineInfo.LastTab) + _lastTabPassed = true; + + FormatElement(_currentLeaf.Current); + + goOn = _currentLeaf != null && _currentLeaf.Current != _endLeaf.Current; + if (goOn) + _currentLeaf = _currentLeaf.GetNextLeaf(); + } + lineInfo.LineWidth = _currentLineWidth; + lineInfo.WordsWidth = _currentWordsWidth; + lineInfo.BlankCount = _currentBlankCount; + lineInfo.TabOffsets = _tabOffsets; + lineInfo.ReMeasureLine = false; + _lastTabPassed = origLastTabPassed; + } + RestoreAfterProbing(iter, blankCount, wordsWidth, xPosition, lineWidth, blankWidth); + } + + XUnit CurrentWordDistance + { + get + { + if (_phase == Phase.Rendering && + _paragraph.Format.Alignment == ParagraphAlignment.Justify && _lastTabPassed) + { + if (_currentBlankCount >= 1 && !(_isLastLine && _renderInfo.FormatInfo.IsEnding)) + { + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + XUnit width = contentArea.GetFittingRect(_currentYPosition, _currentVerticalInfo.Height).Width; + if (_lastTabPosition > 0) + { + width -= (_lastTabPosition - + contentArea.X); + } + else + width -= LeftIndent; + + width -= RightIndent; + return (width - _currentWordsWidth) / (_currentBlankCount); + } + } + return MeasureString(" "); + } + } + + void RenderElement(DocumentObject docObj) + { + string typeName = docObj.GetType().Name; + switch (typeName) + { + case "Text": + if (IsBlank(docObj)) + RenderBlank(); + else if (IsSoftHyphen(docObj)) + RenderSoftHyphen(); + else + RenderText((Text)docObj); + break; + + case "Character": + RenderCharacter((Character)docObj); + break; + + case "DateField": + RenderDateField((DateField)docObj); + break; + + case "InfoField": + RenderInfoField((InfoField)docObj); + break; + + case "NumPagesField": + RenderNumPagesField((NumPagesField)docObj); + break; + + case "PageField": + RenderPageField((PageField)docObj); + break; + + case "SectionField": + RenderSectionField((SectionField)docObj); + break; + + case "SectionPagesField": + RenderSectionPagesField((SectionPagesField)docObj); + break; + + case "BookmarkField": + RenderBookmarkField(); + break; + + case "PageRefField": + RenderPageRefField((PageRefField)docObj); + break; + + case "Image": + RenderImage((Image)docObj); + break; + // default: + // throw new NotImplementedException(typeName + " is coming soon..."); + } + } + + void RenderImage(Image image) + { + RenderInfo renderInfo = CurrentImageRenderInfo; + XUnit top = CurrentBaselinePosition; + Area contentArea = renderInfo.LayoutInfo.ContentArea; + top -= contentArea.Height; + RenderByInfos(_currentXPosition, top, new RenderInfo[] { renderInfo }); + + RenderUnderline(contentArea.Width, true); + RealizeHyperlink(contentArea.Width); + + _currentXPosition += contentArea.Width; + } + + void RenderDateField(DateField dateField) + { + RenderWord(_fieldInfos.Date.ToString(dateField.Format)); + } + + void RenderInfoField(InfoField infoField) + { + RenderWord(GetDocumentInfo(infoField.Name)); + } + + void RenderNumPagesField(NumPagesField numPagesField) + { + RenderWord(GetFieldValue(numPagesField)); + } + + void RenderPageField(PageField pageField) + { + RenderWord(GetFieldValue(pageField)); + } + + void RenderSectionField(SectionField sectionField) + { + RenderWord(GetFieldValue(sectionField)); + } + + void RenderSectionPagesField(SectionPagesField sectionPagesField) + { + RenderWord(GetFieldValue(sectionPagesField)); + } + + void RenderBookmarkField() + { + RenderUnderline(0, false); + } + + void RenderPageRefField(PageRefField pageRefField) + { + RenderWord(GetFieldValue(pageRefField)); + } + + void RenderCharacter(Character character) + { + switch (character.SymbolName) + { + case SymbolName.Blank: + case SymbolName.Em: + case SymbolName.Em4: + case SymbolName.En: + RenderSpace(character); + break; + case SymbolName.LineBreak: + RenderLinebreak(); + break; + + case SymbolName.Tab: + RenderTab(); + break; + + default: + RenderSymbol(character); + break; + } + } + + void RenderSpace(Character character) + { + XUnit width = GetSpaceWidth(character); + RenderUnderline(width, false); + RealizeHyperlink(width); + _currentXPosition += width; + } + + void RenderLinebreak() + { + RenderUnderline(0, false); + RealizeHyperlink(0); + } + + void RenderSymbol(Character character) + { + string sym = GetSymbol(character); + string completeWord = sym; + for (int idx = 1; idx < character.Count; ++idx) + completeWord += sym; + + RenderWord(completeWord); + } + + void RenderTab() + { + TabOffset tabOffset = NextTabOffset(); + RenderUnderline(tabOffset.Offset, false); + RenderTabLeader(tabOffset); + RealizeHyperlink(tabOffset.Offset); + _currentXPosition += tabOffset.Offset; + if (_currentLeaf.Current == _lastTab) + _lastTabPosition = _currentXPosition; + } + + void RenderTabLeader(TabOffset tabOffset) + { + string leaderString; + switch (tabOffset.Leader) + { + case TabLeader.Dashes: + leaderString = "-"; + break; + + case TabLeader.Dots: + leaderString = "."; + break; + + case TabLeader.Heavy: + case TabLeader.Lines: + leaderString = "_"; + break; + + case TabLeader.MiddleDot: + leaderString = "·"; + break; + + default: + return; + } + XUnit leaderWidth = MeasureString(leaderString); + XUnit xPosition = _currentXPosition; + string drawString = ""; + + while (xPosition + leaderWidth <= _currentXPosition + tabOffset.Offset) + { + drawString += leaderString; + xPosition += leaderWidth; + } + Font font = CurrentDomFont; + XFont xFont = CurrentFont; + if (font.Subscript || font.Superscript) + xFont = FontHandler.ToSubSuperFont(xFont); + + _gfx.DrawString(drawString, xFont, CurrentBrush, _currentXPosition, CurrentBaselinePosition); + } + + TabOffset NextTabOffset() + { + TabOffset offset = _tabOffsets.Count > _tabIdx ? _tabOffsets[_tabIdx] : + new TabOffset(0, 0); + + ++_tabIdx; + return offset; + } + int _tabIdx; + + bool IgnoreBlank() + { + if (_currentLeaf == _startLeaf) + return true; + + if (_endLeaf != null && _currentLeaf.Current == _endLeaf.Current) + return true; + + ParagraphIterator nextIter = _currentLeaf.GetNextLeaf(); + while (nextIter != null && (IsBlank(nextIter.Current) || nextIter.Current is BookmarkField)) + { + nextIter = nextIter.GetNextLeaf(); + } + if (nextIter == null) + return true; + + if (IsTab(nextIter.Current)) + return true; + + ParagraphIterator prevIter = _currentLeaf.GetPreviousLeaf(); + // Can be null if currentLeaf is the first leaf + DocumentObject obj = prevIter != null ? prevIter.Current : null; + while (obj != null && obj is BookmarkField) + { + prevIter = prevIter.GetPreviousLeaf(); + obj = prevIter != null ? prevIter.Current : null; + } + if (obj == null) + return true; + + return IsBlank(obj) || IsTab(obj); + } + + void RenderBlank() + { + if (!IgnoreBlank()) + { + XUnit wordDistance = CurrentWordDistance; + RenderUnderline(wordDistance, false); + RealizeHyperlink(wordDistance); + _currentXPosition += wordDistance; + } + else + { + RenderUnderline(0, false); + RealizeHyperlink(0); + } + } + + void RenderSoftHyphen() + { + if (_currentLeaf.Current == _endLeaf.Current) + RenderWord("-"); + } + + void RenderText(Text text) + { + RenderWord(text.Content); + } + + void RenderWord(string word) + { + Font font = CurrentDomFont; + XFont xFont = CurrentFont; + if (font.Subscript || font.Superscript) + xFont = FontHandler.ToSubSuperFont(xFont); + + _gfx.DrawString(word, xFont, CurrentBrush, _currentXPosition, CurrentBaselinePosition); + XUnit wordWidth = MeasureString(word); + RenderUnderline(wordWidth, true); + RealizeHyperlink(wordWidth); + _currentXPosition += wordWidth; + } + + void StartHyperlink(XUnit left, XUnit top) + { + _hyperlinkRect = new XRect(left, top, 0, 0); + } + + void EndHyperlink(Hyperlink hyperlink, XUnit right, XUnit bottom) + { + _hyperlinkRect.Width = right - _hyperlinkRect.X; + _hyperlinkRect.Height = bottom - _hyperlinkRect.Y; + PdfPage page = _gfx.PdfPage; + if (page != null) + { + XRect rect = _gfx.Transformer.WorldToDefaultPage(_hyperlinkRect); + + switch (hyperlink.Type) + { + case HyperlinkType.Local: + int pageRef = _fieldInfos.GetPhysicalPageNumber(hyperlink.Name); + if (pageRef > 0) + page.AddDocumentLink(new PdfRectangle(rect), pageRef); + break; + + case HyperlinkType.Web: + page.AddWebLink(new PdfRectangle(rect), hyperlink.Name); + break; + + case HyperlinkType.File: + page.AddFileLink(new PdfRectangle(rect), hyperlink.Name); + break; + } + _hyperlinkRect = new XRect(); + } + } + + void RealizeHyperlink(XUnit width) + { + XUnit top = _currentYPosition; + XUnit left = _currentXPosition; + XUnit bottom = top + _currentVerticalInfo.Height; + XUnit right = left + width; + Hyperlink hyperlink = GetHyperlink(); + + bool hyperlinkChanged = _currentHyperlink != hyperlink; + + if (hyperlinkChanged) + { + if (_currentHyperlink != null) + EndHyperlink(_currentHyperlink, left, bottom); + + if (hyperlink != null) + StartHyperlink(left, top); + + _currentHyperlink = hyperlink; + } + + if (_currentLeaf.Current == _endLeaf.Current) + { + if (_currentHyperlink != null) + EndHyperlink(_currentHyperlink, right, bottom); + + _currentHyperlink = null; + } + } + Hyperlink _currentHyperlink; + XRect _hyperlinkRect; + + XUnit CurrentBaselinePosition + { + get + { + VerticalLineInfo verticalInfo = _currentVerticalInfo; + XUnit position = _currentYPosition; + + Font font = CurrentDomFont; + XFont xFont = CurrentFont; + + // $MaOs BUG: For LineSpacingRule.AtLeast the text should be positioned at the line bottom. Maybe verticalInfo.InherentlineSpace does not contain the lineSpacing value in this case. + double setLineSpace = verticalInfo.InherentlineSpace; + double standardFontLineSpace = xFont.GetHeight(); + + // Set position to bottom of text. + position += setLineSpace; + if (font.Subscript) + { + // Move sub-/superscaled descender up. + position -= FontHandler.GetSubSuperScaling(CurrentFont) * FontHandler.GetDescent(xFont); + } + else if (font.Superscript) + { + // Set position to top of text. + position -= standardFontLineSpace; + // Move sub-/superscaled LineSpace down and descender up. + position += FontHandler.GetSubSuperScaling(CurrentFont) * (standardFontLineSpace - FontHandler.GetDescent(xFont)); + } + else + // Move descender up. + position -= verticalInfo.Descent; + + return position; + } + } + + XBrush CurrentBrush + { + get + { + if (_currentLeaf != null) + return FontHandler.FontColorToXBrush(CurrentDomFont); + + return null; + } + } + + private void InitRendering() + { + _phase = Phase.Rendering; + + ParagraphFormatInfo parFormatInfo = (ParagraphFormatInfo)_renderInfo.FormatInfo; + if (parFormatInfo.LineCount == 0) + return; + _isFirstLine = parFormatInfo.IsStarting; + + LineInfo lineInfo = parFormatInfo.GetFirstLineInfo(); + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + _currentYPosition = contentArea.Y + TopBorderOffset; + // StL: GetFittingRect liefert manchmal null + Rectangle rect = contentArea.GetFittingRect(_currentYPosition, lineInfo.Vertical.Height); + if (rect != null) + _currentXPosition = rect.X; + _currentLineWidth = 0; + } + + /// + /// Initializes this instance for formatting. + /// + /// The area for formatting + /// A previous format info. + /// False, if nothing of the paragraph will fit the area any more. + private bool InitFormat(Area area, FormatInfo previousFormatInfo) + { + _phase = Phase.Formatting; + + _tabOffsets = new List(); + + ParagraphFormatInfo prevParaFormatInfo = (ParagraphFormatInfo)previousFormatInfo; + if (previousFormatInfo == null || prevParaFormatInfo.LineCount == 0) + { + ((ParagraphFormatInfo)_renderInfo.FormatInfo)._isStarting = true; + ParagraphIterator parIt = new ParagraphIterator(_paragraph.Elements); + _currentLeaf = parIt.GetFirstLeaf(); + _isFirstLine = true; + } + else + { + _currentLeaf = prevParaFormatInfo.GetLastLineInfo().EndIter.GetNextLeaf(); + _isFirstLine = false; + ((ParagraphFormatInfo)_renderInfo.FormatInfo)._isStarting = false; + } + + _startLeaf = _currentLeaf; + _currentVerticalInfo = CalcCurrentVerticalInfo(); + _currentYPosition = area.Y + TopBorderOffset; + _formattingArea = area; + Rectangle rect = _formattingArea.GetFittingRect(_currentYPosition, _currentVerticalInfo.Height); + if (rect == null) + return false; + + _currentXPosition = rect.X + LeftIndent; + if (_isFirstLine) + FormatListSymbol(); + + return true; + } + + /// + /// Gets information necessary to render or measure the list symbol. + /// + /// The text to list symbol to render or measure + /// The font to use for rendering or measuring. + /// True, if a symbol needs to be rendered. + bool GetListSymbol(out string symbol, out XFont font) + { + font = null; + symbol = null; + ParagraphFormatInfo formatInfo = (ParagraphFormatInfo)_renderInfo.FormatInfo; + if (_phase == Phase.Formatting) + { + ParagraphFormat format = _paragraph.Format; + if (format._listInfo != null && !format._listInfo.IsNull()) + { + ListInfo listInfo = format.ListInfo; + double size = format.Font.Size; + XFontStyle style = FontHandler.GetXStyle(format.Font); + + switch (listInfo.ListType) + { + case ListType.BulletList1: + symbol = "·"; + font = new XFont("Symbol", size, style); + break; + + case ListType.BulletList2: + symbol = "o"; + font = new XFont("Courier New", size, style); + break; + + case ListType.BulletList3: + symbol = "§"; + font = new XFont("Wingdings", size, style); + break; + + case ListType.NumberList1: + symbol = _documentRenderer.NextListNumber(listInfo) + "."; + font = FontHandler.FontToXFont(format.Font, _gfx.MUH); + break; + + case ListType.NumberList2: + symbol = _documentRenderer.NextListNumber(listInfo) + ")"; + font = FontHandler.FontToXFont(format.Font, _gfx.MUH); + break; + + case ListType.NumberList3: + symbol = NumberFormatter.Format(_documentRenderer.NextListNumber(listInfo), "alphabetic") + ")"; + font = FontHandler.FontToXFont(format.Font, _gfx.MUH); + break; + } + formatInfo.ListFont = font; + formatInfo.ListSymbol = symbol; + return true; + } + } + else + { + if (formatInfo.ListFont != null && formatInfo.ListSymbol != null) + { + font = formatInfo.ListFont; + symbol = formatInfo.ListSymbol; + return true; + } + } + return false; + } + + XUnit LeftIndent + { + get + { + ParagraphFormat format = _paragraph.Format; + XUnit leftIndent = format.LeftIndent.Point; + if (_isFirstLine) + { + if (format._listInfo != null && !format._listInfo.IsNull()) + { + if (!format.ListInfo._numberPosition.IsNull) + return format.ListInfo.NumberPosition.Point; + if (format._firstLineIndent.IsNull) + return 0; + } + return leftIndent + _paragraph.Format.FirstLineIndent.Point; + } + return leftIndent; + } + } + + XUnit RightIndent + { + get + { + return _paragraph.Format.RightIndent.Point; + } + } + + /// + /// Formats the paragraph by performing line breaks etc. + /// + /// The area in which to render. + /// The format info that was obtained on formatting the same paragraph on a previous area. + public override void Format(Area area, FormatInfo previousFormatInfo) + { + ParagraphFormatInfo formatInfo = ((ParagraphFormatInfo)_renderInfo.FormatInfo); + if (!InitFormat(area, previousFormatInfo)) + { + formatInfo._isStarting = false; + return; + } + formatInfo._isEnding = true; + + FormatResult lastResult = FormatResult.Continue; + while (_currentLeaf != null) + { + FormatResult result = FormatElement(_currentLeaf.Current); + switch (result) + { + case FormatResult.Ignore: + _currentLeaf = _currentLeaf.GetNextLeaf(); + break; + + case FormatResult.Continue: + lastResult = result; + _currentLeaf = _currentLeaf.GetNextLeaf(); + break; + + case FormatResult.NewLine: + lastResult = result; + StoreLineInformation(); + if (!StartNewLine()) + { + result = FormatResult.NewArea; + formatInfo._isEnding = false; + } + break; + } + if (result == FormatResult.NewArea) + { + lastResult = result; + formatInfo._isEnding = false; + break; + } + } + if (formatInfo.IsEnding && lastResult != FormatResult.NewLine) + StoreLineInformation(); + + formatInfo.ImageRenderInfos = _imageRenderInfos; + FinishLayoutInfo(); + } + + /// + /// Finishes the layout info by calculating starting and trailing heights. + /// + private void FinishLayoutInfo() + { + LayoutInfo layoutInfo = _renderInfo.LayoutInfo; + ParagraphFormat format = _paragraph.Format; + ParagraphFormatInfo parInfo = (ParagraphFormatInfo)_renderInfo.FormatInfo; + layoutInfo.MinWidth = _minWidth; + layoutInfo.KeepTogether = format.KeepTogether; + + if (parInfo.IsComplete) + { + int limitOfLines = 1; + if (parInfo._widowControl) + limitOfLines = 3; + + if (parInfo.LineCount <= limitOfLines) + layoutInfo.KeepTogether = true; + } + if (parInfo.IsStarting) + { + layoutInfo.MarginTop = format.SpaceBefore.Point; + layoutInfo.PageBreakBefore = format.PageBreakBefore; + } + else + { + layoutInfo.MarginTop = 0; + layoutInfo.PageBreakBefore = false; + } + + if (parInfo.IsEnding) + { + layoutInfo.MarginBottom = _paragraph.Format.SpaceAfter.Point; + layoutInfo.KeepWithNext = _paragraph.Format.KeepWithNext; + } + else + { + layoutInfo.MarginBottom = 0; + layoutInfo.KeepWithNext = false; + } + if (parInfo.LineCount > 0) + { + XUnit startingHeight = parInfo.GetFirstLineInfo().Vertical.Height; + if (parInfo._isStarting && _paragraph.Format.WidowControl && parInfo.LineCount >= 2) + startingHeight += parInfo.GetLineInfo(1).Vertical.Height; + + layoutInfo.StartingHeight = startingHeight; + + XUnit trailingHeight = parInfo.GetLastLineInfo().Vertical.Height; + + if (parInfo.IsEnding && _paragraph.Format.WidowControl && parInfo.LineCount >= 2) + trailingHeight += parInfo.GetLineInfo(parInfo.LineCount - 2).Vertical.Height; + + layoutInfo.TrailingHeight = trailingHeight; + } + } + + + private XUnit PopSavedBlankWidth() + { + XUnit width = _savedBlankWidth; + _savedBlankWidth = 0; + return width; + } + + private void SaveBlankWidth(XUnit blankWidth) + { + _savedBlankWidth = blankWidth; + } + XUnit _savedBlankWidth = 0; + + /// + /// Processes the elements when formatting. + /// + /// + /// + FormatResult FormatElement(DocumentObject docObj) + { + switch (docObj.GetType().Name) + { + case "Text": + if (IsBlank(docObj)) + return FormatBlank(); + if (IsSoftHyphen(docObj)) + return FormatSoftHyphen(); + return FormatText((Text)docObj); + + case "Character": + return FormatCharacter((Character)docObj); + + case "DateField": + return FormatDateField((DateField)docObj); + + case "InfoField": + return FormatInfoField((InfoField)docObj); + + case "NumPagesField": + return FormatNumPagesField((NumPagesField)docObj); + + case "PageField": + return FormatPageField((PageField)docObj); + + case "SectionField": + return FormatSectionField((SectionField)docObj); + + case "SectionPagesField": + return FormatSectionPagesField((SectionPagesField)docObj); + + case "BookmarkField": + return FormatBookmarkField((BookmarkField)docObj); + + case "PageRefField": + return FormatPageRefField((PageRefField)docObj); + + case "Image": + return FormatImage((Image)docObj); + + default: + return FormatResult.Continue; + } + } + + FormatResult FormatImage(Image image) + { + XUnit width = CurrentImageRenderInfo.LayoutInfo.ContentArea.Width; + return FormatAsWord(width); + } + + RenderInfo CalcImageRenderInfo(Image image) + { + Renderer renderer = Create(_gfx, _documentRenderer, image, _fieldInfos); + renderer.Format(new Rectangle(0, 0, double.MaxValue, double.MaxValue), null); + + return renderer.RenderInfo; + } + + bool IsPlainText(DocumentObject docObj) + { + if (docObj is Text) + return !IsSoftHyphen(docObj) && !IsBlank(docObj); + + return false; + } + + bool IsSymbol(DocumentObject docObj) + { + if (docObj is Character) + { + return !IsSpaceCharacter(docObj) && !IsTab(docObj) && !IsLineBreak(docObj); + } + return false; + } + + bool IsSpaceCharacter(DocumentObject docObj) + { + Character character = docObj as Character; + if (character != null) + { + switch ((character).SymbolName) + { + case SymbolName.Blank: + case SymbolName.Em: + case SymbolName.Em4: + case SymbolName.En: + return true; + } + } + return false; + } + + bool IsWordLikeElement(DocumentObject docObj) + { + if (IsPlainText(docObj)) + return true; + + if (IsRenderedField(docObj)) + return true; + + if (IsSymbol(docObj)) + return true; + + + return false; + } + + FormatResult FormatBookmarkField(BookmarkField bookmarkField) + { + _fieldInfos.AddBookmark(bookmarkField.Name); + return FormatResult.Ignore; + } + + FormatResult FormatPageRefField(PageRefField pageRefField) + { + _reMeasureLine = true; + string fieldValue = GetFieldValue(pageRefField); + return FormatWord(fieldValue); + } + + FormatResult FormatNumPagesField(NumPagesField numPagesField) + { + _reMeasureLine = true; + string fieldValue = GetFieldValue(numPagesField); + return FormatWord(fieldValue); + } + + FormatResult FormatPageField(PageField pageField) + { + _reMeasureLine = true; + string fieldValue = GetFieldValue(pageField); + return FormatWord(fieldValue); + } + + FormatResult FormatSectionField(SectionField sectionField) + { + _reMeasureLine = true; + string fieldValue = GetFieldValue(sectionField); + return FormatWord(fieldValue); + } + + FormatResult FormatSectionPagesField(SectionPagesField sectionPagesField) + { + _reMeasureLine = true; + string fieldValue = GetFieldValue(sectionPagesField); + return FormatWord(fieldValue); + } + + /// + /// Helper function for formatting word-like elements like text and fields. + /// + FormatResult FormatWord(string word) + { + XUnit width = MeasureString(word); + return FormatAsWord(width); + } + + XUnit _savedWordWidth = 0; + + /// + /// When rendering a justified paragraph, only the part after the last tab stop needs remeasuring. + /// + private bool IgnoreHorizontalGrowth + { + get + { + return _phase == Phase.Rendering && _paragraph.Format.Alignment == ParagraphAlignment.Justify && + !_lastTabPassed; + } + } + + FormatResult FormatAsWord(XUnit width) + { + VerticalLineInfo newVertInfo = CalcCurrentVerticalInfo(); + + Rectangle rect = _formattingArea.GetFittingRect(_currentYPosition, newVertInfo.Height + BottomBorderOffset); + if (rect == null) + return FormatResult.NewArea; + + if (_currentXPosition + width <= rect.X + rect.Width - RightIndent + Tolerance) + { + _savedWordWidth = width; + _currentXPosition += width; + // For Tabs in justified context + if (!IgnoreHorizontalGrowth) + _currentWordsWidth += width; + if (_savedBlankWidth > 0) + { + // For Tabs in justified context + if (!IgnoreHorizontalGrowth) + ++_currentBlankCount; + } + // For Tabs in justified context + if (!IgnoreHorizontalGrowth) + _currentLineWidth += width + PopSavedBlankWidth(); + _currentVerticalInfo = newVertInfo; + _minWidth = Math.Max(_minWidth, width); + return FormatResult.Continue; + } + else + { + _savedWordWidth = width; + return FormatResult.NewLine; + } + } + + FormatResult FormatDateField(DateField dateField) + { + _reMeasureLine = true; + string estimatedFieldValue = DateTime.Now.ToString(dateField.Format); + return FormatWord(estimatedFieldValue); + } + + FormatResult FormatInfoField(InfoField infoField) + { + string fieldValue = GetDocumentInfo(infoField.Name); + if (fieldValue != "") + return FormatWord(fieldValue); + + return FormatResult.Continue; + } + + string GetDocumentInfo(string name) + { + string valueName; + switch (name.ToLower()) + { + case "title": + valueName = "Title"; + break; + + case "author": + valueName = "Author"; + break; + + case "keywords": + valueName = "Keywords"; + break; + + case "subject": + valueName = "Subject"; + break; + + default: + return String.Empty; + } + return _paragraph.Document.Info.GetValue(valueName).ToString(); + + //string docInfoValue = ""; + //string[] enumNames = Enum.GetNames(typeof(InfoFieldType)); + //foreach (string enumName in enumNames) + //{ + // if (String.Compare(name, enumName, true) == 0) + // { + // docInfoValue = paragraph.Document.Info.GetValue(enumName).ToString(); + // break; + // } + //} + //return docInfoValue; + } + + Area GetShadingArea() + { + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + ParagraphFormat format = _paragraph.Format; + XUnit left = contentArea.X; + left += format.LeftIndent; + if (format.FirstLineIndent < 0) + left += format.FirstLineIndent; + + XUnit top = contentArea.Y; + XUnit bottom = contentArea.Y + contentArea.Height; + XUnit right = contentArea.X + contentArea.Width; + right -= format.RightIndent; + + if (_paragraph.Format._borders != null && !_paragraph.Format._borders.IsNull()) + { + Borders borders = format.Borders; + BordersRenderer bordersRenderer = new BordersRenderer(borders, _gfx); + + if (_renderInfo.FormatInfo.IsStarting) + top += bordersRenderer.GetWidth(BorderType.Top); + if (_renderInfo.FormatInfo.IsEnding) + bottom -= bordersRenderer.GetWidth(BorderType.Bottom); + + left -= borders.DistanceFromLeft; + right += borders.DistanceFromRight; + } + return new Rectangle(left, top, right - left, bottom - top); + } + + void RenderShading() + { + if (_paragraph.Format._shading == null || _paragraph.Format._shading.IsNull()) + return; + + ShadingRenderer shadingRenderer = new ShadingRenderer(_gfx, _paragraph.Format.Shading); + Area area = GetShadingArea(); + + shadingRenderer.Render(area.X, area.Y, area.Width, area.Height); + } + + + void RenderBorders() + { + if (_paragraph.Format._borders == null || _paragraph.Format._borders.IsNull()) + return; + + Area shadingArea = GetShadingArea(); + XUnit left = shadingArea.X; + XUnit top = shadingArea.Y; + XUnit bottom = shadingArea.Y + shadingArea.Height; + XUnit right = shadingArea.X + shadingArea.Width; + + Borders borders = _paragraph.Format.Borders; + BordersRenderer bordersRenderer = new BordersRenderer(borders, _gfx); + XUnit borderWidth = bordersRenderer.GetWidth(BorderType.Left); + if (borderWidth > 0) + { + left -= borderWidth; + bordersRenderer.RenderVertically(BorderType.Left, left, top, bottom - top); + } + + borderWidth = bordersRenderer.GetWidth(BorderType.Right); + if (borderWidth > 0) + { + bordersRenderer.RenderVertically(BorderType.Right, right, top, bottom - top); + right += borderWidth; + } + + borderWidth = bordersRenderer.GetWidth(BorderType.Top); + if (_renderInfo.FormatInfo.IsStarting && borderWidth > 0) + { + top -= borderWidth; + bordersRenderer.RenderHorizontally(BorderType.Top, left, top, right - left); + } + + borderWidth = bordersRenderer.GetWidth(BorderType.Bottom); + if (_renderInfo.FormatInfo.IsEnding && borderWidth > 0) + { + bordersRenderer.RenderHorizontally(BorderType.Bottom, left, bottom, right - left); + } + } + + XUnit MeasureString(string word) + { + XFont xFont = CurrentFont; + XUnit width = _gfx.MeasureString(word, xFont, StringFormat).Width; + Font font = CurrentDomFont; + + if (font.Subscript || font.Superscript) + width *= FontHandler.GetSubSuperScaling(xFont); + + return width; + } + + XUnit GetSpaceWidth(Character character) + { + XUnit width = 0; + switch (character.SymbolName) + { + case SymbolName.Blank: + width = MeasureString(" "); + break; + case SymbolName.Em: + width = MeasureString("m"); + break; + case SymbolName.Em4: + width = 0.25 * MeasureString("m"); + break; + case SymbolName.En: + width = MeasureString("n"); + break; + } + return width * character.Count; + } + + void RenderListSymbol() + { + string symbol; + XFont font; + if (GetListSymbol(out symbol, out font)) + { + XBrush brush = FontHandler.FontColorToXBrush(_paragraph.Format.Font); + _gfx.DrawString(symbol, font, brush, _currentXPosition, CurrentBaselinePosition); + _currentXPosition += _gfx.MeasureString(symbol, font, StringFormat).Width; + TabOffset tabOffset = NextTabOffset(); + _currentXPosition += tabOffset.Offset; + _lastTabPosition = _currentXPosition; + } + } + + void FormatListSymbol() + { + string symbol; + XFont font; + if (GetListSymbol(out symbol, out font)) + { + _currentVerticalInfo = CalcVerticalInfo(font); + _currentXPosition += _gfx.MeasureString(symbol, font, StringFormat).Width; + FormatTab(); + } + } + + FormatResult FormatSpace(Character character) + { + XUnit width = GetSpaceWidth(character); + return FormatAsWord(width); + } + + static string GetSymbol(Character character) + { + char ch; + switch (character.SymbolName) + { + case SymbolName.Euro: + ch = '€'; + break; + + case SymbolName.Copyright: + ch = '©'; + break; + + case SymbolName.Trademark: + ch = '™'; + break; + + case SymbolName.RegisteredTrademark: + ch = '®'; + break; + + case SymbolName.Bullet: + ch = '•'; + break; + + case SymbolName.Not: + ch = '¬'; + break; + //REM: Non-breakable blanks are still ignored. + // case SymbolName.SymbolNonBreakableBlank: + // return "\xA0"; + // break; + + case SymbolName.EmDash: + ch = '—'; + break; + + case SymbolName.EnDash: + ch = '–'; + break; + + default: + char c = character.Char; + char[] chars = Encoding.UTF8.GetChars(new byte[] { (byte)c }); + //#if !SILVERLIGHT + // char[] chars = System.Text.Encoding.Default.GetChars(new byte[] { (byte)c }); + //#else + // char[] chars = System.Text.Encoding.UTF8.GetChars(new byte[] { (byte)c }); + //#endif + ch = chars[0]; + break; + } + string returnString = ""; + returnString += ch; + int count = character.Count; + while (--count > 0) + returnString += ch; + return returnString; + } + + FormatResult FormatSymbol(Character character) + { + return FormatWord(GetSymbol(character)); + } + + /// + /// Processes (measures) a special character within text. + /// + /// The character to process. + /// True if the character should start at a new line. + FormatResult FormatCharacter(Character character) + { + switch (character.SymbolName) + { + case SymbolName.Blank: + case SymbolName.Em: + case SymbolName.Em4: + case SymbolName.En: + return FormatSpace(character); + + case SymbolName.LineBreak: + return FormatLineBreak(); + + case SymbolName.Tab: + return FormatTab(); + + default: + return FormatSymbol(character); + } + } + + /// + /// Processes (measures) a blank. + /// + /// True if the blank causes a line break. + FormatResult FormatBlank() + { + if (IgnoreBlank()) + return FormatResult.Ignore; + + _savedWordWidth = 0; + XUnit width = MeasureString(" "); + VerticalLineInfo newVertInfo = CalcCurrentVerticalInfo(); + Rectangle rect = _formattingArea.GetFittingRect(_currentYPosition, newVertInfo.Height + BottomBorderOffset); + if (rect == null) + return FormatResult.NewArea; + + if (width + _currentXPosition <= rect.X + rect.Width + Tolerance) + { + _currentXPosition += width; + _currentVerticalInfo = newVertInfo; + SaveBlankWidth(width); + return FormatResult.Continue; + } + return FormatResult.NewLine; + } + + FormatResult FormatLineBreak() + { + if (_phase != Phase.Rendering) + _currentLeaf = _currentLeaf.GetNextLeaf(); + + _savedWordWidth = 0; + return FormatResult.NewLine; + } + + /// + /// Processes a text element during formatting. + /// + /// The text element to measure. + FormatResult FormatText(Text text) + { + return FormatWord(text.Content); + } + + FormatResult FormatSoftHyphen() + { + if (_currentLeaf.Current == _startLeaf.Current) + return FormatResult.Continue; + + ParagraphIterator nextIter = _currentLeaf.GetNextLeaf(); + ParagraphIterator prevIter = _currentLeaf.GetPreviousLeaf(); + // nextIter can be null if the soft hyphen is at the end of a paragraph. To prevent a crash, we jump out if nextIter is null. + if (!IsWordLikeElement(prevIter.Current) || nextIter == null || !IsWordLikeElement(nextIter.Current)) + return FormatResult.Continue; + + //--- Save --------------------------------- + ParagraphIterator iter; + int blankCount; + XUnit xPosition; + XUnit lineWidth; + XUnit wordsWidth; + XUnit blankWidth; + SaveBeforeProbing(out iter, out blankCount, out wordsWidth, out xPosition, out lineWidth, out blankWidth); + //------------------------------------------ + _currentLeaf = nextIter; + FormatResult result = FormatElement(nextIter.Current); + + //--- Restore ------------------------------ + RestoreAfterProbing(iter, blankCount, wordsWidth, xPosition, lineWidth, blankWidth); + //------------------------------------------ + if (result == FormatResult.Continue) + return FormatResult.Continue; + + RestoreAfterProbing(iter, blankCount, wordsWidth, xPosition, lineWidth, blankWidth); + Rectangle fittingRect = _formattingArea.GetFittingRect(_currentYPosition, _currentVerticalInfo.Height); + + XUnit hyphenWidth = MeasureString("-"); + if (xPosition + hyphenWidth <= fittingRect.X + fittingRect.Width + Tolerance + // If one word fits, but not the hyphen, the formatting must continue with the next leaf + || prevIter.Current == _startLeaf.Current) + { + // For Tabs in justified context + if (!IgnoreHorizontalGrowth) + { + _currentWordsWidth += hyphenWidth; + _currentLineWidth += hyphenWidth; + } + _currentLeaf = nextIter; + return FormatResult.NewLine; + } + else + { + _currentWordsWidth -= _savedWordWidth; + _currentLineWidth -= _savedWordWidth; + _currentLineWidth -= GetPreviousBlankWidth(prevIter); + _currentLeaf = prevIter; + return FormatResult.NewLine; + } + } + + XUnit GetPreviousBlankWidth(ParagraphIterator beforeIter) + { + XUnit width = 0; + ParagraphIterator savedIter = _currentLeaf; + _currentLeaf = beforeIter.GetPreviousLeaf(); + while (_currentLeaf != null) + { + if (_currentLeaf.Current is BookmarkField) + _currentLeaf = _currentLeaf.GetPreviousLeaf(); + else if (IsBlank(_currentLeaf.Current)) + { + if (!IgnoreBlank()) + width = CurrentWordDistance; + + break; + } + else + break; + } + _currentLeaf = savedIter; + return width; + } + + void HandleNonFittingLine() + { + if (_currentLeaf != null) + { + if (_savedWordWidth > 0) + { + _currentWordsWidth = _savedWordWidth; + _currentLineWidth = _savedWordWidth; + } + _currentLeaf = _currentLeaf.GetNextLeaf(); + _currentYPosition += _currentVerticalInfo.Height; + _currentVerticalInfo = new VerticalLineInfo(); + } + } + + /// + /// Starts a new line by resetting measuring values. + /// Do not call before the first first line is formatted! + /// + /// True, if the new line may fit the formatting area. + bool StartNewLine() + { + _tabOffsets = new List(); + _lastTab = null; + _lastTabPosition = 0; + _currentYPosition += _currentVerticalInfo.Height; + + Rectangle rect = _formattingArea.GetFittingRect(_currentYPosition, _currentVerticalInfo.Height + BottomBorderOffset); + if (rect == null) + return false; + + _isFirstLine = false; + _currentXPosition = StartXPosition; // depends on "currentVerticalInfo" + _currentVerticalInfo = new VerticalLineInfo(); + _currentVerticalInfo = CalcCurrentVerticalInfo(); + _startLeaf = _currentLeaf; + _currentBlankCount = 0; + _currentWordsWidth = 0; + _currentLineWidth = 0; + return true; + } + /// + /// Stores all line information. + /// + void StoreLineInformation() + { + PopSavedBlankWidth(); + + XUnit topBorderOffset = TopBorderOffset; + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + if (topBorderOffset > 0)//May only occure for the first line. + contentArea = _formattingArea.GetFittingRect(_formattingArea.Y, topBorderOffset); + + if (contentArea == null) + contentArea = _formattingArea.GetFittingRect(_currentYPosition, _currentVerticalInfo.Height); + else + contentArea = contentArea.Unite(_formattingArea.GetFittingRect(_currentYPosition, _currentVerticalInfo.Height)); + + XUnit bottomBorderOffset = BottomBorderOffset; + if (bottomBorderOffset > 0) + contentArea = contentArea.Unite(_formattingArea.GetFittingRect(_currentYPosition + _currentVerticalInfo.Height, bottomBorderOffset)); + + LineInfo lineInfo = new LineInfo(); + lineInfo.Vertical = _currentVerticalInfo; + + if (_startLeaf != null && _startLeaf == _currentLeaf) + HandleNonFittingLine(); + + lineInfo.LastTab = _lastTab; + _renderInfo.LayoutInfo.ContentArea = contentArea; + + lineInfo.StartIter = _startLeaf; + + if (_currentLeaf == null) + lineInfo.EndIter = new ParagraphIterator(_paragraph.Elements).GetLastLeaf(); + else + lineInfo.EndIter = _currentLeaf.GetPreviousLeaf(); + + lineInfo.BlankCount = _currentBlankCount; + + lineInfo.WordsWidth = _currentWordsWidth; + + lineInfo.LineWidth = _currentLineWidth; + lineInfo.TabOffsets = _tabOffsets; + lineInfo.ReMeasureLine = _reMeasureLine; + + _savedWordWidth = 0; + _reMeasureLine = false; + ((ParagraphFormatInfo)_renderInfo.FormatInfo).AddLineInfo(lineInfo); + } + + /// + /// Gets the top border offset for the first line, else 0. + /// + XUnit TopBorderOffset + { + get + { + XUnit offset = 0; + if (_isFirstLine && _paragraph.Format._borders != null && !_paragraph.Format._borders.IsNull()) + { + offset += _paragraph.Format.Borders.DistanceFromTop; + if (_paragraph.Format._borders != null && !_paragraph.Format._borders.IsNull()) + { + BordersRenderer bordersRenderer = new BordersRenderer(_paragraph.Format.Borders, _gfx); + offset += bordersRenderer.GetWidth(BorderType.Top); + } + } + return offset; + } + } + + bool IsLastVisibleLeaf + { + get + { + // REM: Code is missing here for blanks, bookmarks etc. which might be invisible. + if (_currentLeaf.IsLastLeaf) + return true; + + return false; + } + } + /// + /// Gets the bottom border offset for the last line, else 0. + /// + XUnit BottomBorderOffset + { + get + { + XUnit offset = 0; + //while formatting, it is impossible to determine whether we are in the last line until the last visible leaf is reached. + if ((_phase == Phase.Formatting && (_currentLeaf == null || IsLastVisibleLeaf)) + || (_phase == Phase.Rendering && (_isLastLine))) + { + if (_paragraph.Format._borders != null && !_paragraph.Format._borders.IsNull()) + { + offset += _paragraph.Format.Borders.DistanceFromBottom; + BordersRenderer bordersRenderer = new BordersRenderer(_paragraph.Format.Borders, _gfx); + offset += bordersRenderer.GetWidth(BorderType.Bottom); + } + } + return offset; + } + } + + VerticalLineInfo CalcCurrentVerticalInfo() + { + return CalcVerticalInfo(CurrentFont); + } + + VerticalLineInfo CalcVerticalInfo(XFont font) + { + ParagraphFormat paragraphFormat = _paragraph.Format; + LineSpacingRule spacingRule = paragraphFormat.LineSpacingRule; + XUnit lineHeight = 0; + + XUnit descent = FontHandler.GetDescent(font); + descent = Math.Max(_currentVerticalInfo.Descent, descent); + + XUnit singleLineSpace = font.GetHeight(); + RenderInfo imageRenderInfo = CurrentImageRenderInfo; + if (imageRenderInfo != null) + singleLineSpace = singleLineSpace - FontHandler.GetAscent(font) + imageRenderInfo.LayoutInfo.ContentArea.Height; + + XUnit inherentLineSpace = Math.Max(_currentVerticalInfo.InherentlineSpace, singleLineSpace); + switch (spacingRule) + { + case LineSpacingRule.Single: + lineHeight = singleLineSpace; + break; + + case LineSpacingRule.OnePtFive: + lineHeight = 1.5 * singleLineSpace; + break; + + case LineSpacingRule.Double: + lineHeight = 2.0 * singleLineSpace; + break; + + case LineSpacingRule.Multiple: + lineHeight = _paragraph.Format.LineSpacing * singleLineSpace; + break; + + case LineSpacingRule.AtLeast: + lineHeight = Math.Max(singleLineSpace, _paragraph.Format.LineSpacing); + break; + + case LineSpacingRule.Exactly: + lineHeight = new XUnit(_paragraph.Format.LineSpacing); + inherentLineSpace = _paragraph.Format.LineSpacing.Point; + break; + } + lineHeight = Math.Max(_currentVerticalInfo.Height, lineHeight); + if (MaxElementHeight > 0) + lineHeight = Math.Min(MaxElementHeight - Tolerance, lineHeight); + + return new VerticalLineInfo(lineHeight, descent, inherentLineSpace); + } + + /// + /// The font used for the current paragraph element. + /// + private XFont CurrentFont + { + get { return FontHandler.FontToXFont(CurrentDomFont, /*_documentRenderer.PrivateFonts,*/ _gfx.MUH); } + } + + private Font CurrentDomFont + { + get + { + if (_currentLeaf != null) + { + DocumentObject parent = DocumentRelations.GetParent(_currentLeaf.Current); + parent = DocumentRelations.GetParent(parent); + + FormattedText formattedText = parent as FormattedText; + if (formattedText != null) + return formattedText.Font; + + Hyperlink hyperlink = parent as Hyperlink; + if (hyperlink != null) + return hyperlink.Font; + } + return _paragraph.Format.Font; + } + } + + /// + /// Help function to receive a line height on empty paragraphs. + /// + /// The format. + /// The GFX. + /// The renderer. + public static XUnit GetLineHeight(ParagraphFormat format, XGraphics gfx, DocumentRenderer renderer) + { + XFont font = FontHandler.FontToXFont(format.Font, /*renderer.PrivateFonts,*/ gfx.MUH); + XUnit singleLineSpace = font.GetHeight(); + switch (format.LineSpacingRule) + { + case LineSpacingRule.Exactly: + return format.LineSpacing.Point; + + case LineSpacingRule.AtLeast: + return Math.Max(format.LineSpacing.Point, font.GetHeight()); // old: GetHeight(gfx)); + + case LineSpacingRule.Multiple: + return format.LineSpacing * format.Font.Size; + + case LineSpacingRule.OnePtFive: + return 1.5 * singleLineSpace; + + case LineSpacingRule.Double: + return 2.0 * singleLineSpace; + + case LineSpacingRule.Single: + default: + return singleLineSpace; + } + } + + void RenderUnderline(XUnit width, bool isWord) + { + XPen pen = GetUnderlinePen(isWord); + + bool penChanged = UnderlinePenChanged(pen); + if (penChanged) + { + if (_currentUnderlinePen != null) + EndUnderline(_currentUnderlinePen, _currentXPosition); + + if (pen != null) + StartUnderline(_currentXPosition); + + _currentUnderlinePen = pen; + } + + if (_currentLeaf.Current == _endLeaf.Current) + { + if (_currentUnderlinePen != null) + EndUnderline(_currentUnderlinePen, _currentXPosition + width); + + _currentUnderlinePen = null; + } + } + + void StartUnderline(XUnit xPosition) + { + _underlineStartPos = xPosition; + } + + void EndUnderline(XPen pen, XUnit xPosition) + { + XUnit yPosition = CurrentBaselinePosition; + yPosition += 0.33 * _currentVerticalInfo.Descent; + _gfx.DrawLine(pen, _underlineStartPos, yPosition, xPosition, yPosition); + } + + XPen _currentUnderlinePen; + XUnit _underlineStartPos; + + bool UnderlinePenChanged(XPen pen) + { + if (pen == null && _currentUnderlinePen == null) + return false; + + if (pen == null && _currentUnderlinePen != null) + return true; + + if (pen != null && _currentUnderlinePen == null) + return true; + + if (pen != null && pen.Color != _currentUnderlinePen.Color) + return true; + + return pen.Width != _currentUnderlinePen.Width; + } + + RenderInfo CurrentImageRenderInfo + { + get + { + if (_currentLeaf != null && _currentLeaf.Current is Image) + { + Image image = (Image)_currentLeaf.Current; + if (_imageRenderInfos != null && _imageRenderInfos.ContainsKey(image)) + return _imageRenderInfos[image]; + else + { + if (_imageRenderInfos == null) + _imageRenderInfos = new Dictionary(); + + RenderInfo renderInfo = CalcImageRenderInfo(image); + _imageRenderInfos.Add(image, renderInfo); + return renderInfo; + } + } + return null; + } + } + XPen GetUnderlinePen(bool isWord) + { + Font font = CurrentDomFont; + Underline underlineType = font.Underline; + if (underlineType == Underline.None) + return null; + + if (underlineType == Underline.Words && !isWord) + return null; + +#if noCMYK + XPen pen = new XPen(XColor.FromArgb(font.Color.Argb), font.Size / 16); +#else + XPen pen = new XPen(ColorHelper.ToXColor(font.Color, _paragraph.Document.UseCmykColor), font.Size / 16); +#endif + switch (font.Underline) + { + case Underline.DotDash: + pen.DashStyle = XDashStyle.DashDot; + break; + + case Underline.DotDotDash: + pen.DashStyle = XDashStyle.DashDotDot; + break; + + case Underline.Dash: + pen.DashStyle = XDashStyle.Dash; + break; + + case Underline.Dotted: + pen.DashStyle = XDashStyle.Dot; + break; + + case Underline.Single: + default: + pen.DashStyle = XDashStyle.Solid; + break; + } + return pen; + } + + private static XStringFormat StringFormat + { + get { return _stringFormat ?? (_stringFormat = XStringFormats.Default); } + } + + /// + /// The paragraph to format or render. + /// + readonly Paragraph _paragraph; + XUnit _currentWordsWidth; + int _currentBlankCount; + XUnit _currentLineWidth; + bool _isFirstLine; + bool _isLastLine; + VerticalLineInfo _currentVerticalInfo; + Area _formattingArea; + XUnit _currentYPosition; + XUnit _currentXPosition; + ParagraphIterator _currentLeaf; + ParagraphIterator _startLeaf; + ParagraphIterator _endLeaf; + static XStringFormat _stringFormat; + bool _reMeasureLine; + XUnit _minWidth = 0; + Dictionary _imageRenderInfos; + List _tabOffsets; + DocumentObject _lastTab; + bool _lastTabPassed; + XUnit _lastTabPosition; + } +} diff --git a/MigraDoc.Rendering/Rendering/PdfDocumentRenderer.cs b/MigraDoc.Rendering/Rendering/PdfDocumentRenderer.cs new file mode 100644 index 0000000..d6fc51d --- /dev/null +++ b/MigraDoc.Rendering/Rendering/PdfDocumentRenderer.cs @@ -0,0 +1,319 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Reflection; +using System.IO; +using MigraDoc.DocumentObjectModel; +using MigraDoc.Rendering.Resources; +using PdfSharp.Pdf; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering +{ + /// + /// Provides the functionality to convert a MigraDoc document into PDF. + /// + public class PdfDocumentRenderer + { + /// + /// Initializes a new instance of the PdfDocumentRenderer class. + /// + public PdfDocumentRenderer() + { + //_unicode = true; + } + + /// + /// Initializes a new instance of the class. + /// + /// If true Unicode encoding is used for all text. If false, WinAnsi encoding is used. + public PdfDocumentRenderer(bool unicode) + { + _unicode = unicode; + } + + /// + /// Initializes a new instance of the class. + /// + /// If true Unicode encoding is used for all text. If false, WinAnsi encoding is used. + /// Obsolete parameter. + [Obsolete("Must not specify an embedding option anymore.")] + public PdfDocumentRenderer(bool unicode, PdfFontEmbedding fontEmbedding) + { + _unicode = unicode; + } + + /// + /// Gets a value indicating whether the text is rendered as Unicode. + /// + public bool Unicode + { + get { return _unicode; } + } + readonly bool _unicode; + + /// + /// Gets or sets the language. + /// + /// The language. + public string Language + { + get { return _language; } + set { _language = value; } + } + string _language = String.Empty; + + /// + /// Set the MigraDoc document to be rendered by this printer. + /// + public Document Document + { + set + { + _document = null; + value.BindToRenderer(this); + _document = value; + } + } + Document _document; + + /// + /// Gets or sets a document renderer. + /// + /// + /// A document renderer is automatically created and prepared + /// when printing before this property was set. + /// + public DocumentRenderer DocumentRenderer + { + get + { + if (_documentRenderer == null) + PrepareDocumentRenderer(); + return _documentRenderer; + } + set { _documentRenderer = value; } + } + DocumentRenderer _documentRenderer; + + void PrepareDocumentRenderer() + { + PrepareDocumentRenderer(false); + } + + void PrepareDocumentRenderer(bool prepareCompletely) + { + if (_document == null) +#if !NETFX_CORE + throw new InvalidOperationException(Messages2.PropertyNotSetBefore("DocumentRenderer", MethodBase.GetCurrentMethod().Name)); +#else + throw new InvalidOperationException(Messages2.PropertyNotSetBefore("DocumentRenderer", "PrepareDocumentRenderer")); +#endif + + if (_documentRenderer == null) + { + _documentRenderer = new DocumentRenderer(_document); + _documentRenderer.WorkingDirectory = _workingDirectory; + } + if (prepareCompletely && _documentRenderer.FormattedDocument == null) + { + _documentRenderer.PrepareDocument(); + } + } + + /// + /// Renders the document into a PdfDocument containing all pages of the document. + /// + public void RenderDocument() + { +#if true + PrepareRenderPages(); +#else + if (this.documentRenderer == null) + PrepareDocumentRenderer(); + + if (this.pdfDocument == null) + { + this.pdfDocument = new PdfDocument(); + this.pdfDocument.Info.Creator = VersionInfo.Creator; + } + + WriteDocumentInformation(); +#endif + RenderPages(1, _documentRenderer.FormattedDocument.PageCount); + } + + /// + /// Renders the document into a PdfDocument containing all pages of the document. + /// + public void PrepareRenderPages() + { + //if (this.documentRenderer == null) + PrepareDocumentRenderer(true); + + if (_pdfDocument == null) + { + _pdfDocument = CreatePdfDocument(); + if (_document.UseCmykColor) + _pdfDocument.Options.ColorMode = PdfColorMode.Cmyk; + } + + WriteDocumentInformation(); + //RenderPages(1, this.documentRenderer.FormattedDocument.PageCount); + } + + /// + /// Gets the count of pages. + /// + public int PageCount + { + get { return _documentRenderer.FormattedDocument.PageCount; } + } + + /// + /// Saves the PdfDocument to the specified path. If a file already exists, it will be overwritten. + /// + public void Save(string path) + { + if (path == null) + throw new ArgumentNullException("path"); + + if (path == "") + throw new ArgumentException("PDF file Path must not be empty"); + + if (_workingDirectory != null) + path = Path.Combine(_workingDirectory, path); + + _pdfDocument.Save(path); + } + + /// + /// Saves the PDF document to the specified stream. + /// + public void Save(Stream stream, bool closeStream) + { + _pdfDocument.Save(stream, closeStream); + } + + /// + /// Renders the specified page range. + /// + /// The first page to print. + /// The last page to print + public void RenderPages(int startPage, int endPage) + { + if (startPage < 1) + throw new ArgumentOutOfRangeException("startPage"); + + if (endPage > _documentRenderer.FormattedDocument.PageCount) + throw new ArgumentOutOfRangeException("endPage"); + + if (_documentRenderer == null) + PrepareDocumentRenderer(); + + if (_pdfDocument == null) + _pdfDocument = CreatePdfDocument(); + + _documentRenderer._printDate = DateTime.Now; + for (int pageNr = startPage; pageNr <= endPage; ++pageNr) + { + PdfPage pdfPage = _pdfDocument.AddPage(); + PageInfo pageInfo = _documentRenderer.FormattedDocument.GetPageInfo(pageNr); + pdfPage.Width = pageInfo.Width; + pdfPage.Height = pageInfo.Height; + pdfPage.Orientation = pageInfo.Orientation; + + using (XGraphics gfx = XGraphics.FromPdfPage(pdfPage)) + { + gfx.MUH = _unicode ? PdfFontEncoding.Unicode : PdfFontEncoding.WinAnsi; + _documentRenderer.RenderPage(gfx, pageNr); + } + } + } + + /// + /// Gets or sets a working directory for the printing process. + /// + public string WorkingDirectory + { + get { return _workingDirectory; } + set { _workingDirectory = value; } + } + string _workingDirectory; + + /// + /// Gets or sets the PDF document to render on. + /// + /// A PDF document in memory is automatically created when printing before this property was set. + public PdfDocument PdfDocument + { + get { return _pdfDocument; } + set { _pdfDocument = value; } + } + PdfDocument _pdfDocument; + + /// + /// Writes document information like author and subject to the PDF document. + /// + public void WriteDocumentInformation() + { + if (!_document.IsNull("Info")) + { + DocumentInfo docInfo = _document.Info; + PdfDocumentInformation pdfInfo = _pdfDocument.Info; + + if (!docInfo.IsNull("Author")) + pdfInfo.Author = docInfo.Author; + + if (!docInfo.IsNull("Keywords")) + pdfInfo.Keywords = docInfo.Keywords; + + if (!docInfo.IsNull("Subject")) + pdfInfo.Subject = docInfo.Subject; + + if (!docInfo.IsNull("Title")) + pdfInfo.Title = docInfo.Title; + } + } + + /// + /// Creates a new PDF document. + /// + PdfDocument CreatePdfDocument() + { + PdfDocument document = new PdfDocument(); + document.Info.Creator = "damienbod"; + if (!String.IsNullOrEmpty(_language)) + document.Language = _language; + return document; + } + } +} diff --git a/MigraDoc.Rendering/Rendering/PdfPrinter.cs b/MigraDoc.Rendering/Rendering/PdfPrinter.cs new file mode 100644 index 0000000..d5e5ed5 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/PdfPrinter.cs @@ -0,0 +1,207 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if DELETED +namespace MigraDoc.Rendering +{ + /// + /// Provides the functionality to convert MigraDoc documents into PDF. + /// + [Obsolete("Use class PdfDocumentRenderer.")] // DELETE: 8/06 + public class PdfPrinter + { + /// + /// Initializes a new instance of the PdfPrinter class. + /// + public PdfPrinter() + { } + + /// + /// Set the MigraDoc document to be rendered by this printer. + /// + public Document Document + { + set + { + _document = null; + value.BindToRenderer(this); + _document = value; + } + } + Document _document; + + /// + /// Gets or sets a document renderer. + /// + /// + /// A document renderer is automatically created and prepared + /// when printing before this property was set. + /// + public DocumentRenderer DocumentRenderer + { + get { return _documentRenderer; } + set { _documentRenderer = value; } + } + DocumentRenderer _documentRenderer; + + void PrepareDocumentRenderer() + { + if (_document == null) + throw new InvalidOperationException(Messages2.PropertyNotSetBefore("DocumentRenderer", MethodInfo.GetCurrentMethod().Name)); + + _documentRenderer = new DocumentRenderer(_document); + _documentRenderer.WorkingDirectory = this.workingDirectory; + _documentRenderer.PrepareDocument(); + } + + /// + /// Prints a PDF document containing all pages of the document. + /// + public void PrintDocument() + { + if (_documentRenderer == null) + PrepareDocumentRenderer(); + + if (_pdfDocument == null) + { + _pdfDocument = new PdfDocument(); + _pdfDocument.Info.Creator = VersionInfo.Creator; + } + + WriteDocumentInformation(); + PrintPages(1, _documentRenderer.FormattedDocument.PageCount); + } + + /// + /// Saves the PDF document to the specified path. If a file already exists, it will be overwritten. + /// + public void Save(string path) + { + if (path == null) + throw new ArgumentNullException("path"); + + if (path == "") + throw new ArgumentException("PDF file Path must not be empty"); + + if (this.workingDirectory != null) + Path.Combine(this.workingDirectory, path); + + _pdfDocument.Save(path); + } + + /// + /// Saves the PDF document to the specified stream. + /// + public void Save(Stream stream, bool closeStream) + { + _pdfDocument.Save(stream, closeStream); + } + + /// + /// Prints the specified page range. + /// + /// The first page to print. + /// The last page to print + public void PrintPages(int startPage, int endPage) + { + if (startPage < 1) + throw new ArgumentOutOfRangeException("startPage"); + + if (endPage > _documentRenderer.FormattedDocument.PageCount) + throw new ArgumentOutOfRangeException("endPage"); + + if (_documentRenderer == null) + PrepareDocumentRenderer(); + + if (_pdfDocument == null) + { + _pdfDocument = new PdfDocument(); + _pdfDocument.Info.Creator = VersionInfo.Creator; + } + + _documentRenderer._printDate = DateTime.Now; + for (int pageNr = startPage; pageNr <= endPage; ++pageNr) + { + PdfPage pdfPage = _pdfDocument.AddPage(); + PageInfo pageInfo = _documentRenderer.FormattedDocument.GetPageInfo(pageNr); + pdfPage.Width = pageInfo.Width; + pdfPage.Height = pageInfo.Height; + pdfPage.Orientation = pageInfo.Orientation; + _documentRenderer.RenderPage(XGraphics.FromPdfPage(pdfPage), pageNr); + } + } + + /// + /// Gets or sets a working directory for the printing process. + /// + public string WorkingDirectory + { + get { return this.workingDirectory; } + set { this.workingDirectory = value; } + } + string workingDirectory; + + /// + /// Gets or sets the PDF document to render on. + /// + /// A PDF document in memory is automatically created when printing before this property was set. + public PdfDocument PdfDocument + { + get { return _pdfDocument; } + set { _pdfDocument = value; } + } + + /// + /// Writes document information like author and subject to the PDF document. + /// + private void WriteDocumentInformation() + { + if (!_document.IsNull("Info")) + { + DocumentInfo docInfo = _document.Info; + PdfDocumentInformation pdfInfo = _pdfDocument.Info; + + if (!docInfo.IsNull("Author")) + pdfInfo.Author = docInfo.Author; + + if (!docInfo.IsNull("Keywords")) + pdfInfo.Keywords = docInfo.Keywords; + + if (!docInfo.IsNull("Subject")) + pdfInfo.Subject = docInfo.Subject; + + if (!docInfo.IsNull("Title")) + pdfInfo.Title = docInfo.Title; + } + } + PdfDocument _pdfDocument; + } +} +#endif diff --git a/MigraDoc.Rendering/Rendering/RenderInfo.cs b/MigraDoc.Rendering/Rendering/RenderInfo.cs new file mode 100644 index 0000000..db29756 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/RenderInfo.cs @@ -0,0 +1,81 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering +{ + /// + /// Abstract base class for all classes that store rendering information. + /// + public abstract class RenderInfo + { + /// + /// Gets the format information in a specific derived type. For a table, for example, this will be a TableFormatInfo with information about the first and last row showing on a page. + /// + public abstract FormatInfo FormatInfo { get; set; } + + /// + /// Gets the layout information. + /// + public LayoutInfo LayoutInfo + { + get { return _layoutInfo; } + } + readonly LayoutInfo _layoutInfo = new LayoutInfo(); + + /// + /// Gets the document object to which the layout information applies. Use the Tag property of DocumentObject to identify an object. + /// + public abstract DocumentObject DocumentObject { get; set; } + + public virtual void RemoveEnding() + { + System.Diagnostics.Debug.Assert(false, "Unexpected call of RemoveEnding"); + } + + public static XUnit GetTotalHeight(RenderInfo[] renderInfos) + { + if (renderInfos == null || renderInfos.Length == 0) + return 0; + + int lastIdx = renderInfos.Length - 1; + RenderInfo firstRenderInfo = renderInfos[0]; + RenderInfo lastRenderInfo = renderInfos[lastIdx]; + LayoutInfo firstLayoutInfo = firstRenderInfo.LayoutInfo; + LayoutInfo lastLayoutInfo = lastRenderInfo.LayoutInfo; + XUnit top = firstLayoutInfo.ContentArea.Y - firstLayoutInfo.MarginTop; + XUnit bottom = lastLayoutInfo.ContentArea.Y + lastLayoutInfo.ContentArea.Height; + bottom += lastLayoutInfo.MarginBottom; + return bottom - top; + } + } +} diff --git a/MigraDoc.Rendering/Rendering/Renderer.cs b/MigraDoc.Rendering/Rendering/Renderer.cs new file mode 100644 index 0000000..50586fa --- /dev/null +++ b/MigraDoc.Rendering/Rendering/Renderer.cs @@ -0,0 +1,211 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel.Tables; +using MigraDoc.DocumentObjectModel.Shapes; +using MigraDoc.DocumentObjectModel.Shapes.Charts; + +namespace MigraDoc.Rendering +{ + /// + /// Abstract base class for all renderers. + /// + public abstract class Renderer + { + /// + /// Determines the maximum height a single element may have. + /// + public XUnit MaxElementHeight + { + get { return _maxElementHeight; } + set { _maxElementHeight = value; } + } + + public Renderer(XGraphics gfx, DocumentObject documentObject, FieldInfos fieldInfos) + { + _documentObject = documentObject; + _gfx = gfx; + _fieldInfos = fieldInfos; + } + + public Renderer(XGraphics gfx, RenderInfo renderInfo, FieldInfos fieldInfos) + { + _documentObject = renderInfo.DocumentObject; + _gfx = gfx; + _renderInfo = renderInfo; + _fieldInfos = fieldInfos; + } + + /// + /// In inherited classes, gets a layout info with only margin and break information set. + /// It can be taken before the documen object is formatted. + /// + /// + /// In inherited classes, the following parts are set properly: + /// MarginTop, MarginLeft, MarginRight, MarginBottom, + /// KeepTogether, KeepWithNext, PagebreakBefore, Floating, + /// VerticalReference, HorizontalReference. + /// + public abstract LayoutInfo InitialLayoutInfo { get; } + + /// + /// Renders the contents shifted to the given Coordinates. + /// + /// The x shift. + /// The y shift. + /// The render infos. + protected void RenderByInfos(XUnit xShift, XUnit yShift, RenderInfo[] renderInfos) + { + if (renderInfos == null) + return; + + foreach (RenderInfo renderInfo in renderInfos) + { + XUnit savedX = renderInfo.LayoutInfo.ContentArea.X; + XUnit savedY = renderInfo.LayoutInfo.ContentArea.Y; + renderInfo.LayoutInfo.ContentArea.X += xShift; + renderInfo.LayoutInfo.ContentArea.Y += yShift; + Renderer renderer = Create(_gfx, _documentRenderer, renderInfo, _fieldInfos); + renderer.Render(); + renderInfo.LayoutInfo.ContentArea.X = savedX; + renderInfo.LayoutInfo.ContentArea.Y = savedY; + } + } + + protected void RenderByInfos(RenderInfo[] renderInfos) + { + RenderByInfos(0, 0, renderInfos); + } + + /// + /// Gets the render information necessary to render and position the object. + /// + public RenderInfo RenderInfo + { + get { return _renderInfo; } + } + protected RenderInfo _renderInfo; + + /// + /// Sets the field infos object. + /// + /// This property is set by the AreaProvider. + public FieldInfos FieldInfos + { + set { _fieldInfos = value; } + } + protected FieldInfos _fieldInfos; + + /// + /// Renders (draws) the object to the Graphics object. + /// + public abstract void Render(); + + /// + /// Formats the object by calculating distances and linebreaks and stopping when the area is filled. + /// + /// The area to render into. + /// An information object received from a previous call of Format(). + /// Null for the first call. + public abstract void Format(Area area, FormatInfo previousFormatInfo); + + /// + /// Creates a fitting renderer for the given document object for formatting. + /// + /// The XGraphics object to do measurements on. + /// The document renderer. + /// the document object to format. + /// The field infos. + /// The fitting Renderer. + public static Renderer Create(XGraphics gfx, DocumentRenderer documentRenderer, DocumentObject documentObject, FieldInfos fieldInfos) + { + Renderer renderer = null; + if (documentObject is Paragraph) + renderer = new ParagraphRenderer(gfx, (Paragraph)documentObject, fieldInfos); + else if (documentObject is Table) + renderer = new TableRenderer(gfx, (Table)documentObject, fieldInfos); + else if (documentObject is PageBreak) + renderer = new PageBreakRenderer(gfx, (PageBreak)documentObject, fieldInfos); + else if (documentObject is TextFrame) + renderer = new TextFrameRenderer(gfx, (TextFrame)documentObject, fieldInfos); + else if (documentObject is Chart) + renderer = new ChartRenderer(gfx, (Chart)documentObject, fieldInfos); + else if (documentObject is Image) + renderer = new ImageRenderer(gfx, (Image)documentObject, fieldInfos); + + if (renderer != null) + renderer._documentRenderer = documentRenderer; + + return renderer; + } + + /// + /// Creates a fitting renderer for the render info to render and layout with. + /// + /// The XGraphics object to render on. + /// The document renderer. + /// The RenderInfo object stored after a previous call of Format(). + /// The field infos. + /// The fitting Renderer. + public static Renderer Create(XGraphics gfx, DocumentRenderer documentRenderer, RenderInfo renderInfo, FieldInfos fieldInfos) + { + Renderer renderer = null; + + if (renderInfo.DocumentObject is Paragraph) + renderer = new ParagraphRenderer(gfx, renderInfo, fieldInfos); + else if (renderInfo.DocumentObject is Table) + renderer = new TableRenderer(gfx, renderInfo, fieldInfos); + else if (renderInfo.DocumentObject is PageBreak) + renderer = new PageBreakRenderer(gfx, renderInfo, fieldInfos); + else if (renderInfo.DocumentObject is TextFrame) + renderer = new TextFrameRenderer(gfx, renderInfo, fieldInfos); + else if (renderInfo.DocumentObject is Chart) + renderer = new ChartRenderer(gfx, renderInfo, fieldInfos); + //else if (renderInfo.DocumentObject is Chart) + // renderer = new ChartRenderer(gfx, renderInfo, fieldInfos); + else if (renderInfo.DocumentObject is Image) + renderer = new ImageRenderer(gfx, renderInfo, fieldInfos); + + if (renderer != null) + renderer._documentRenderer = documentRenderer; + + return renderer; + } + + public readonly static XUnit Tolerance = XUnit.FromPoint(0.001); + private XUnit _maxElementHeight = -1; + + protected DocumentObject _documentObject; + protected DocumentRenderer _documentRenderer; + protected XGraphics _gfx; + } +} diff --git a/MigraDoc.Rendering/Rendering/ShadingRenderer.cs b/MigraDoc.Rendering/Rendering/ShadingRenderer.cs new file mode 100644 index 0000000..5f19922 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ShadingRenderer.cs @@ -0,0 +1,120 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel.Tables; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel; + +namespace MigraDoc.Rendering +{ + /// + /// Renders a Shading to an XGraphics object. + /// + public class ShadingRenderer + { + public ShadingRenderer(XGraphics gfx, Shading shading) + { + _gfx = gfx; + _shading = shading; + RealizeBrush(); + } + + public void Render(XUnit x, XUnit y, XUnit width, XUnit height) + { + if (_shading == null || _brush == null) + return; + + _gfx.DrawRectangle(_brush, x.Point, y.Point, width.Point, height.Point); + } + + public void Render(XUnit x, XUnit y, XUnit width, XUnit height, RoundedCorner roundedCorner) + { + // If there is no rounded corner, we can use the usual Render method. + if (roundedCorner == RoundedCorner.None) + { + Render(x, y, width, height); + return; + } + + if (_shading == null || _brush == null) + return; + + XGraphicsPath path = new XGraphicsPath(); + + switch (roundedCorner) + { + case RoundedCorner.TopLeft: + path.AddArc(new XRect(x, y, width * 2, height * 2), 180, 90); // Error in CORE: _corePath.AddArc(). + path.AddLine(new XPoint(x + width, y), new XPoint(x + width, y + height)); + break; + case RoundedCorner.TopRight: + path.AddArc(new XRect(x - width, y, width * 2, height * 2), 270, 90); // Error in CORE: _corePath.AddArc(). + path.AddLine(new XPoint(x + width, y + height), new XPoint(x, y + height)); + break; + case RoundedCorner.BottomRight: + path.AddArc(new XRect(x - width, y - height, width * 2, height * 2), 0, 90); // Error in CORE: _corePath.AddArc(). + path.AddLine(new XPoint(x, y + height), new XPoint(x, y)); + break; + case RoundedCorner.BottomLeft: + path.AddArc(new XRect(x, y - height, width * 2, height * 2), 90, 90); // Error in CORE: _corePath.AddArc(). + path.AddLine(new XPoint(x, y), new XPoint(x + width, y)); + break; + } + + path.CloseFigure(); + _gfx.DrawPath(_brush, path); + } + + private bool IsVisible() + { + if (!_shading._visible.IsNull) + return _shading.Visible; + else + return !_shading._color.IsNull; + } + + private void RealizeBrush() + { + if (_shading == null) + return; + if (IsVisible()) + { +#if noCMYK + this.brush = new XSolidBrush(XColor.FromArgb((int)this.shading.Color.Argb)); +#else + _brush = new XSolidBrush(ColorHelper.ToXColor(_shading.Color, _shading.Document.UseCmykColor)); +#endif + } + } + readonly Shading _shading; + XBrush _brush; + readonly XGraphics _gfx; + } +} diff --git a/MigraDoc.Rendering/Rendering/ShapeFormatInfo.cs b/MigraDoc.Rendering/Rendering/ShapeFormatInfo.cs new file mode 100644 index 0000000..b825c19 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ShapeFormatInfo.cs @@ -0,0 +1,77 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.Rendering +{ + /// + /// Format information for all shapes. + /// + public + class ShapeFormatInfo : FormatInfo + { + public override bool IsStarting + { + get { return Fits; } + } + + public override bool IsEnding + { + get { return Fits; } + } + + public override bool IsComplete + { + get { return Fits; } + } + + /// + /// Indicates that the starting of the element is completed + /// + public override bool StartingIsComplete + { + get { return Fits; } + } + + /// + /// Indicates that the ending of the element is completed + /// + public override bool EndingIsComplete + { + get { return Fits; } + } + + public override bool IsEmpty + { + get { return !Fits; } + } + + public bool Fits; + } +} diff --git a/MigraDoc.Rendering/Rendering/ShapeRenderInfo.cs b/MigraDoc.Rendering/Rendering/ShapeRenderInfo.cs new file mode 100644 index 0000000..ec64ca8 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ShapeRenderInfo.cs @@ -0,0 +1,54 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel; +using MigraDoc.DocumentObjectModel.Shapes; + +namespace MigraDoc.Rendering +{ + /// + /// Rendering information for shapes. + /// + public abstract class ShapeRenderInfo : RenderInfo + { + public ShapeRenderInfo() + { } + + /// + /// Gets the document object to which the layout information applies. Use the Tag property of DocumentObject to identify an object. + /// + public override DocumentObject DocumentObject + { + get { return _shape; } + set { _shape = (Shape)value; } + } + Shape _shape; + } +} diff --git a/MigraDoc.Rendering/Rendering/ShapeRenderer.cs b/MigraDoc.Rendering/Rendering/ShapeRenderer.cs new file mode 100644 index 0000000..83722a3 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/ShapeRenderer.cs @@ -0,0 +1,234 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel.Shapes; +using MigraDoc.DocumentObjectModel.publics; + +namespace MigraDoc.Rendering +{ + /// + /// Renders a shape to an XGraphics object. + /// + public abstract class ShapeRenderer : Renderer + { + public ShapeRenderer(XGraphics gfx, Shape shape, FieldInfos fieldInfos) + : base(gfx, shape, fieldInfos) + { + _shape = shape; + LineFormat lf = (LineFormat)_shape.GetValue("LineFormat", GV.ReadOnly); + _lineFormatRenderer = new LineFormatRenderer(lf, gfx); + } + + public ShapeRenderer(XGraphics gfx, RenderInfo renderInfo, FieldInfos fieldInfos) + : base(gfx, renderInfo, fieldInfos) + { + _shape = (Shape)renderInfo.DocumentObject; + LineFormat lf = (LineFormat)_shape.GetValue("LineFormat", GV.ReadOnly); + _lineFormatRenderer = new LineFormatRenderer(lf, gfx); + FillFormat ff = (FillFormat)_shape.GetValue("FillFormat", GV.ReadOnly); + _fillFormatRenderer = new FillFormatRenderer(ff, gfx); + } + + public override LayoutInfo InitialLayoutInfo + { + get + { + LayoutInfo layoutInfo = new LayoutInfo(); + + layoutInfo.MarginTop = _shape.WrapFormat.DistanceTop.Point; + layoutInfo.MarginLeft = _shape.WrapFormat.DistanceLeft.Point; + layoutInfo.MarginBottom = _shape.WrapFormat.DistanceBottom.Point; + layoutInfo.MarginRight = _shape.WrapFormat.DistanceRight.Point; + layoutInfo.KeepTogether = true; + layoutInfo.KeepWithNext = false; + layoutInfo.PageBreakBefore = false; + layoutInfo.VerticalReference = GetVerticalReference(); + layoutInfo.HorizontalReference = GetHorizontalReference(); + layoutInfo.Floating = GetFloating(); + if (layoutInfo.Floating == Floating.TopBottom && !_shape.Top.Position.IsEmpty) + layoutInfo.MarginTop = Math.Max(layoutInfo.MarginTop, _shape.Top.Position); + return layoutInfo; + } + } + + Floating GetFloating() + { + if (_shape.RelativeVertical != RelativeVertical.Line && _shape.RelativeVertical != RelativeVertical.Paragraph) + return Floating.None; + + switch (_shape.WrapFormat.Style) + { + case WrapStyle.None: + case WrapStyle.Through: + return Floating.None; + } + return Floating.TopBottom; + } + + /// + /// Gets the shape width including line width. + /// + protected virtual XUnit ShapeWidth + { + get { return _shape.Width + _lineFormatRenderer.GetWidth(); } + } + + /// + /// Gets the shape height including line width. + /// + protected virtual XUnit ShapeHeight + { + get { return _shape.Height + _lineFormatRenderer.GetWidth(); } + } + + /// + /// Formats the shape. + /// + /// The area to fit in the shape. + /// + public override void Format(Area area, FormatInfo previousFormatInfo) + { + Floating floating = GetFloating(); + bool fits = floating == Floating.None || ShapeHeight <= area.Height; + ((ShapeFormatInfo)_renderInfo.FormatInfo).Fits = fits; + FinishLayoutInfo(area); + } + + + void FinishLayoutInfo(Area area) + { + LayoutInfo layoutInfo = _renderInfo.LayoutInfo; + Area contentArea = new Rectangle(area.X, area.Y, ShapeWidth, ShapeHeight); + layoutInfo.ContentArea = contentArea; + layoutInfo.MarginTop = _shape.WrapFormat.DistanceTop.Point; + layoutInfo.MarginLeft = _shape.WrapFormat.DistanceLeft.Point; + layoutInfo.MarginBottom = _shape.WrapFormat.DistanceBottom.Point; + layoutInfo.MarginRight = _shape.WrapFormat.DistanceRight.Point; + layoutInfo.KeepTogether = true; + layoutInfo.KeepWithNext = false; + layoutInfo.PageBreakBefore = false; + layoutInfo.MinWidth = ShapeWidth; + + if (_shape.Top.ShapePosition == ShapePosition.Undefined) + layoutInfo.Top = _shape.Top.Position.Point; + + layoutInfo.VerticalAlignment = GetVerticalAlignment(); + layoutInfo.HorizontalAlignment = GetHorizontalAlignment(); + + if (_shape.Left.ShapePosition == ShapePosition.Undefined) + layoutInfo.Left = _shape.Left.Position.Point; + + layoutInfo.HorizontalReference = GetHorizontalReference(); + layoutInfo.VerticalReference = GetVerticalReference(); + layoutInfo.Floating = GetFloating(); + } + + HorizontalReference GetHorizontalReference() + { + switch (_shape.RelativeHorizontal) + { + case RelativeHorizontal.Margin: + return HorizontalReference.PageMargin; + case RelativeHorizontal.Page: + return HorizontalReference.Page; + } + return HorizontalReference.AreaBoundary; + } + + VerticalReference GetVerticalReference() + { + switch (_shape.RelativeVertical) + { + case RelativeVertical.Margin: + return VerticalReference.PageMargin; + + case RelativeVertical.Page: + return VerticalReference.Page; + } + return VerticalReference.PreviousElement; + } + + ElementAlignment GetVerticalAlignment() + { + switch (_shape.Top.ShapePosition) + { + case ShapePosition.Center: + return ElementAlignment.Center; + + case ShapePosition.Bottom: + return ElementAlignment.Far; + } + return ElementAlignment.Near; + } + + protected void RenderFilling() + { + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + XUnit lineWidth = _lineFormatRenderer.GetWidth(); + // Half of the line is drawn outside the shape, the other half inside the shape. + // Therefore we have to reduce the position of the filling by 0.5 lineWidth and width and height by 2 lineWidth. + _fillFormatRenderer.Render(contentArea.X + lineWidth / 2, contentArea.Y + lineWidth / 2, + contentArea.Width - 2 * lineWidth, contentArea.Height - 2 * lineWidth); + } + + protected void RenderLine() + { + Area contentArea = _renderInfo.LayoutInfo.ContentArea; + XUnit lineWidth = _lineFormatRenderer.GetWidth(); + XUnit width = contentArea.Width - lineWidth; + XUnit height = contentArea.Height - lineWidth; + _lineFormatRenderer.Render(contentArea.X, contentArea.Y, width, height); + } + + ElementAlignment GetHorizontalAlignment() + { + switch (_shape.Left.ShapePosition) + { + case ShapePosition.Center: + return ElementAlignment.Center; + + case ShapePosition.Right: + return ElementAlignment.Far; + + case ShapePosition.Outside: + return ElementAlignment.Outside; + + case ShapePosition.Inside: + return ElementAlignment.Inside; + } + return ElementAlignment.Near; + } + protected LineFormatRenderer _lineFormatRenderer; + protected FillFormatRenderer _fillFormatRenderer; + protected Shape _shape; + } +} diff --git a/MigraDoc.Rendering/Rendering/TableFormatInfo.cs b/MigraDoc.Rendering/Rendering/TableFormatInfo.cs new file mode 100644 index 0000000..3d1aea1 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/TableFormatInfo.cs @@ -0,0 +1,98 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel.Tables; +using MigraDoc.DocumentObjectModel.Visitors; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering +{ + /// + /// Formatting information for tables. + /// + public class TableFormatInfo : FormatInfo + { + public TableFormatInfo() + { } + + public override bool EndingIsComplete + { + get { return _isEnding; } + } + + public override bool StartingIsComplete + { + get { return !IsEmpty && StartRow > LastHeaderRow; } + } + + public override bool IsComplete + { + get { return false; } + } + + public override bool IsEmpty + { + get { return StartRow < 0; } + } + + public override bool IsEnding + { + get { return _isEnding; } + } + public bool _isEnding; + + public override bool IsStarting + { + get { return StartRow == LastHeaderRow + 1; } + } + + public int StartColumn = -1; + public int EndColumn = -1; + + /// + /// The first row of the table that is showing on a page. + /// + public int StartRow = -1; + /// + /// The last row of the table that is showing on a page. + /// + public int EndRow = -1; + + public int LastHeaderRow = -1; + /// + /// The formatted cells. + /// + public Dictionary FormattedCells; //Sorted_List formattedCells; + public MergedCellList MergedCells; + public Dictionary BottomBorderMap; //Sorted_List bottomBorderMap; + public Dictionary ConnectedRowsMap; //Sorted_List connectedRowsMap; + } +} diff --git a/MigraDoc.Rendering/Rendering/TableRenderInfo.cs b/MigraDoc.Rendering/Rendering/TableRenderInfo.cs new file mode 100644 index 0000000..e5c4f39 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/TableRenderInfo.cs @@ -0,0 +1,64 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using MigraDoc.DocumentObjectModel; +using MigraDoc.DocumentObjectModel.Tables; + +namespace MigraDoc.Rendering +{ + /// + /// Rendering information for tables. + /// + public class TableRenderInfo : RenderInfo + { + public TableRenderInfo() + { } + + /// + /// Gets the format information in a specific derived type. For a table, for example, this will be a TableFormatInfo with information about the first and last row showing on a page. + /// + public override FormatInfo FormatInfo + { + get { return _formatInfo; } + set { _formatInfo = (TableFormatInfo)value; } + } + TableFormatInfo _formatInfo = new TableFormatInfo(); + + /// + /// Gets the document object to which the layout information applies. Use the Tag property of DocumentObject to identify an object. + /// + public override DocumentObject DocumentObject + { + get { return _table; } + set { _table = (Table)value; } + } + Table _table; + } +} diff --git a/MigraDoc.Rendering/Rendering/TableRenderer.cs b/MigraDoc.Rendering/Rendering/TableRenderer.cs new file mode 100644 index 0000000..4febbc3 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/TableRenderer.cs @@ -0,0 +1,821 @@ +#region MigraDoc - Creating Documents on the Fly + +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#endregion + +using System; +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel.publics; +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel; +using MigraDoc.DocumentObjectModel.Visitors; +using MigraDoc.DocumentObjectModel.Tables; + +namespace MigraDoc.Rendering +{ + /// + /// Renders a table to an XGraphics object. + /// + public class TableRenderer : Renderer + { + public TableRenderer(XGraphics gfx, Table documentObject, FieldInfos fieldInfos) + : base(gfx, documentObject, fieldInfos) + { + _table = documentObject; + } + + public TableRenderer(XGraphics gfx, RenderInfo renderInfo, FieldInfos fieldInfos) + : base(gfx, renderInfo, fieldInfos) + { + _table = (Table)_renderInfo.DocumentObject; + } + + public override LayoutInfo InitialLayoutInfo + { + get + { + LayoutInfo layoutInfo = new LayoutInfo(); + layoutInfo.KeepTogether = _table.KeepTogether; + layoutInfo.KeepWithNext = false; + layoutInfo.MarginBottom = 0; + layoutInfo.MarginLeft = 0; + layoutInfo.MarginTop = 0; + layoutInfo.MarginRight = 0; + return layoutInfo; + } + } + + private void InitRendering() + { + TableFormatInfo formatInfo = (TableFormatInfo)_renderInfo.FormatInfo; + _bottomBorderMap = formatInfo.BottomBorderMap; + _connectedRowsMap = formatInfo.ConnectedRowsMap; + _formattedCells = formatInfo.FormattedCells; + + _currRow = formatInfo.StartRow; + _startRow = formatInfo.StartRow; + _endRow = formatInfo.EndRow; + + _mergedCells = formatInfo.MergedCells; + _lastHeaderRow = formatInfo.LastHeaderRow; + _startX = _renderInfo.LayoutInfo.ContentArea.X; + _startY = _renderInfo.LayoutInfo.ContentArea.Y; + } + + private void RenderHeaderRows() + { + if (_lastHeaderRow < 0) + return; + + foreach (Cell cell in _mergedCells) + { + if (cell.Row.Index <= _lastHeaderRow) + RenderCell(cell); + } + } + + private void RenderCell(Cell cell) + { + Rectangle innerRect = GetInnerRect(CalcStartingHeight(), cell); + RenderShading(cell, innerRect); + RenderContent(cell, innerRect); + RenderBorders(cell, innerRect); + } + + private void EqualizeRoundedCornerBorders(Cell cell) + { + // If any of a corner relevant border is set, we want to copy its values to the second corner relevant border, + // to ensure the innerWidth of the cell is the same, regardless of which border is used. + // If set, we use the vertical borders as source for the values, otherwise we use the horizontal borders. + RoundedCorner roundedCorner = cell.RoundedCorner; + + if (roundedCorner == RoundedCorner.None) + return; + + BorderType primaryBorderType = BorderType.Top, secondaryBorderType = BorderType.Top; + + if (roundedCorner == RoundedCorner.TopLeft || roundedCorner == RoundedCorner.BottomLeft) + primaryBorderType = BorderType.Left; + if (roundedCorner == RoundedCorner.TopRight || roundedCorner == RoundedCorner.BottomRight) + primaryBorderType = BorderType.Right; + + if (roundedCorner == RoundedCorner.TopLeft || roundedCorner == RoundedCorner.TopRight) + secondaryBorderType = BorderType.Top; + if (roundedCorner == RoundedCorner.BottomLeft || roundedCorner == RoundedCorner.BottomRight) + secondaryBorderType = BorderType.Bottom; + + // If both borders don't exist, there's nothing to do and we should not create one by accessing it. + if (!cell.Borders.HasBorder(primaryBorderType) && !cell.Borders.HasBorder(secondaryBorderType)) + return; + + // Get the borders. By using GV.ReadWrite we create the border, if not existing. + Border primaryBorder = (Border)cell.Borders.GetValue(primaryBorderType.ToString(), GV.ReadWrite); + Border secondaryBorder = (Border)cell.Borders.GetValue(secondaryBorderType.ToString(), GV.ReadWrite); + + Border source = primaryBorder.Visible ? primaryBorder + : secondaryBorder.Visible ? secondaryBorder : null; + Border target = primaryBorder.Visible ? secondaryBorder + : secondaryBorder.Visible ? primaryBorder : null; + + if (source == null || target == null) + return; + + target.Visible = source.Visible; + target.Width = source.Width; + target.Style = source.Style; + target.Color = source.Color; + } + + private void RenderShading(Cell cell, Rectangle innerRect) + { + ShadingRenderer shadeRenderer = new ShadingRenderer(_gfx, cell.Shading); + shadeRenderer.Render(innerRect.X, innerRect.Y, innerRect.Width, innerRect.Height, cell.RoundedCorner); + } + + private void RenderBorders(Cell cell, Rectangle innerRect) + { + XUnit leftPos = innerRect.X; + XUnit rightPos = leftPos + innerRect.Width; + XUnit topPos = innerRect.Y; + XUnit bottomPos = innerRect.Y + innerRect.Height; + Borders mergedBorders = _mergedCells.GetEffectiveBorders(cell); + + BordersRenderer bordersRenderer = new BordersRenderer(mergedBorders, _gfx); + XUnit bottomWidth = bordersRenderer.GetWidth(BorderType.Bottom); + XUnit leftWidth = bordersRenderer.GetWidth(BorderType.Left); + XUnit topWidth = bordersRenderer.GetWidth(BorderType.Top); + XUnit rightWidth = bordersRenderer.GetWidth(BorderType.Right); + + if (cell.RoundedCorner == RoundedCorner.TopLeft) + bordersRenderer.RenderRounded(cell.RoundedCorner, innerRect.X, innerRect.Y, innerRect.Width + rightWidth, innerRect.Height + bottomWidth); + else if (cell.RoundedCorner == RoundedCorner.TopRight) + bordersRenderer.RenderRounded(cell.RoundedCorner, innerRect.X - leftWidth, innerRect.Y, innerRect.Width + leftWidth, innerRect.Height + bottomWidth); + else if (cell.RoundedCorner == RoundedCorner.BottomLeft) + bordersRenderer.RenderRounded(cell.RoundedCorner, innerRect.X, innerRect.Y - topWidth, innerRect.Width + rightWidth, innerRect.Height + topWidth); + else if (cell.RoundedCorner == RoundedCorner.BottomRight) + bordersRenderer.RenderRounded(cell.RoundedCorner, innerRect.X - leftWidth, innerRect.Y - topWidth, innerRect.Width + leftWidth, innerRect.Height + topWidth); + + // Render horizontal and vertical borders only if touching no rounded corner. + if (cell.RoundedCorner != RoundedCorner.TopRight && cell.RoundedCorner != RoundedCorner.BottomRight) + bordersRenderer.RenderVertically(BorderType.Right, rightPos, topPos, bottomPos + bottomWidth - topPos); + + if (cell.RoundedCorner != RoundedCorner.TopLeft && cell.RoundedCorner != RoundedCorner.BottomLeft) + bordersRenderer.RenderVertically(BorderType.Left, leftPos - leftWidth, topPos, bottomPos + bottomWidth - topPos); + + if (cell.RoundedCorner != RoundedCorner.BottomLeft && cell.RoundedCorner != RoundedCorner.BottomRight) + bordersRenderer.RenderHorizontally(BorderType.Bottom, leftPos - leftWidth, bottomPos, rightPos + rightWidth + leftWidth - leftPos); + + if (cell.RoundedCorner != RoundedCorner.TopLeft && cell.RoundedCorner != RoundedCorner.TopRight) + bordersRenderer.RenderHorizontally(BorderType.Top, leftPos - leftWidth, topPos - topWidth, rightPos + rightWidth + leftWidth - leftPos); + + RenderDiagonalBorders(mergedBorders, innerRect); + } + + private void RenderDiagonalBorders(Borders mergedBorders, Rectangle innerRect) + { + BordersRenderer bordersRenderer = new BordersRenderer(mergedBorders, _gfx); + bordersRenderer.RenderDiagonally(BorderType.DiagonalDown, innerRect.X, innerRect.Y, innerRect.Width, innerRect.Height); + bordersRenderer.RenderDiagonally(BorderType.DiagonalUp, innerRect.X, innerRect.Y, innerRect.Width, innerRect.Height); + } + + private void RenderContent(Cell cell, Rectangle innerRect) + { + FormattedCell formattedCell = _formattedCells[cell]; + RenderInfo[] renderInfos = formattedCell.GetRenderInfos(); + + if (renderInfos == null) + return; + + VerticalAlignment verticalAlignment = cell.VerticalAlignment; + XUnit contentHeight = formattedCell.ContentHeight; + XUnit innerHeight = innerRect.Height; + XUnit targetX = innerRect.X + cell.Column.LeftPadding; + + XUnit targetY; + if (verticalAlignment == VerticalAlignment.Bottom) + { + targetY = innerRect.Y + innerRect.Height; + targetY -= cell.Row.BottomPadding; + targetY -= contentHeight; + } + else if (verticalAlignment == VerticalAlignment.Center) + { + targetY = innerRect.Y + cell.Row.TopPadding; + targetY += innerRect.Y + innerRect.Height - cell.Row.BottomPadding; + targetY -= contentHeight; + targetY /= 2; + } + else + targetY = innerRect.Y + cell.Row.TopPadding; + + RenderByInfos(targetX, targetY, renderInfos); + } + + private Rectangle GetInnerRect(XUnit startingHeight, Cell cell) + { + BordersRenderer bordersRenderer = new BordersRenderer(_mergedCells.GetEffectiveBorders(cell), _gfx); + FormattedCell formattedCell = _formattedCells[cell]; + XUnit width = formattedCell.InnerWidth; + + XUnit y = _startY; + if (cell.Row.Index > _lastHeaderRow) + y += startingHeight; + else + y += CalcMaxTopBorderWidth(0); + +#if true + // !!!new 18-03-09 Attempt to fix an exception. begin + XUnit upperBorderPos; + if (!_bottomBorderMap.TryGetValue(cell.Row.Index, out upperBorderPos)) + { + //GetType(); + } + // !!!new 18-03-09 Attempt to fix an exception. end +#else + XUnit upperBorderPos = _bottomBorderMap[cell.Row.Index]; +#endif + + y += upperBorderPos; + if (cell.Row.Index > _lastHeaderRow) + y -= _bottomBorderMap[_startRow]; + +#if true + // !!!new 18-03-09 Attempt to fix an exception. begin + XUnit lowerBorderPos; + if (!_bottomBorderMap.TryGetValue(cell.Row.Index + cell.MergeDown + 1, out lowerBorderPos)) + { + //GetType(); + } + // !!!new 18-03-09 Attempt to fix an exception. end +#else + XUnit lowerBorderPos = _bottomBorderMap[cell.Row.Index + cell.MergeDown + 1]; +#endif + + XUnit height = lowerBorderPos - upperBorderPos; + height -= bordersRenderer.GetWidth(BorderType.Bottom); + + XUnit x = _startX; + for (int clmIdx = 0; clmIdx < cell.Column.Index; ++clmIdx) + { + x += _table.Columns[clmIdx].Width; + } + x += LeftBorderOffset; + + return new Rectangle(x, y, width, height); + } + + public override void Render() + { + InitRendering(); + RenderHeaderRows(); + if (_startRow < _table.Rows.Count) + { + Cell cell = _table[_startRow, 0]; + + int cellIdx = _mergedCells.BinarySearch(_table[_startRow, 0], new CellComparer()); + while (cellIdx < _mergedCells.Count) + { + cell = _mergedCells[cellIdx]; + if (cell.Row.Index > _endRow) + break; + + RenderCell(cell); + ++cellIdx; + } + } + } + + private void InitFormat(Area area, FormatInfo previousFormatInfo) + { + TableFormatInfo prevTableFormatInfo = (TableFormatInfo)previousFormatInfo; + TableRenderInfo tblRenderInfo = new TableRenderInfo(); + tblRenderInfo.DocumentObject = _table; + + // Equalize the two borders, that are used to determine a rounded corner's border. + // This way the innerWidth of the cell, which is got by the saved _formattedCells, is the same regardless of which corner relevant border is set. + foreach (Row row in _table.Rows) + foreach (Cell cell in row.Cells) + EqualizeRoundedCornerBorders(cell); + + _renderInfo = tblRenderInfo; + + if (prevTableFormatInfo != null) + { + _mergedCells = prevTableFormatInfo.MergedCells; + _formattedCells = prevTableFormatInfo.FormattedCells; + _bottomBorderMap = prevTableFormatInfo.BottomBorderMap; + _lastHeaderRow = prevTableFormatInfo.LastHeaderRow; + _connectedRowsMap = prevTableFormatInfo.ConnectedRowsMap; + _startRow = prevTableFormatInfo.EndRow + 1; + } + else + { + _mergedCells = new MergedCellList(_table); + FormatCells(); + CalcLastHeaderRow(); + CreateConnectedRows(); + CreateBottomBorderMap(); + if (_doHorizontalBreak) + { + CalcLastHeaderColumn(); + CreateConnectedColumns(); + } + _startRow = _lastHeaderRow + 1; + } + ((TableFormatInfo)tblRenderInfo.FormatInfo).MergedCells = _mergedCells; + ((TableFormatInfo)tblRenderInfo.FormatInfo).FormattedCells = _formattedCells; + ((TableFormatInfo)tblRenderInfo.FormatInfo).BottomBorderMap = _bottomBorderMap; + ((TableFormatInfo)tblRenderInfo.FormatInfo).ConnectedRowsMap = _connectedRowsMap; + ((TableFormatInfo)tblRenderInfo.FormatInfo).LastHeaderRow = _lastHeaderRow; + } + + private void FormatCells() + { + _formattedCells = new Dictionary(); //new Sorted_List(new CellComparer()); + foreach (Cell cell in _mergedCells) + { + FormattedCell formattedCell = new FormattedCell(cell, _documentRenderer, _mergedCells.GetEffectiveBorders(cell), + _fieldInfos, 0, 0); + formattedCell.Format(_gfx); + _formattedCells.Add(cell, formattedCell); + } + } + + /// + /// Formats (measures) the table. + /// + /// The area on which to fit the table. + /// + public override void Format(Area area, FormatInfo previousFormatInfo) + { + DocumentElements elements = DocumentRelations.GetParent(_table) as DocumentElements; + if (elements != null) + { + Section section = DocumentRelations.GetParent(elements) as Section; + if (section != null) + _doHorizontalBreak = section.PageSetup.HorizontalPageBreak; + } + + _renderInfo = new TableRenderInfo(); + InitFormat(area, previousFormatInfo); + + // Don't take any Rows higher then MaxElementHeight + XUnit topHeight = CalcStartingHeight(); + XUnit probeHeight = topHeight; + XUnit offset; + if (_startRow > _lastHeaderRow + 1 && + _startRow < _table.Rows.Count) + offset = _bottomBorderMap[_startRow] - topHeight; + else + offset = -CalcMaxTopBorderWidth(0); + + int probeRow = _startRow; + XUnit currentHeight = 0; + XUnit startingHeight = 0; + bool isEmpty = false; + + while (probeRow < _table.Rows.Count) + { + bool firstProbe = probeRow == _startRow; + probeRow = _connectedRowsMap[probeRow]; + // Don't take any Rows higher then MaxElementHeight + probeHeight = _bottomBorderMap[probeRow + 1] - offset; + // First test whether MaxElementHeight has been set. + if (MaxElementHeight > 0 && firstProbe && probeHeight > MaxElementHeight - Tolerance) + probeHeight = MaxElementHeight - Tolerance; + //if (firstProbe && probeHeight > MaxElementHeight - Tolerance) + // probeHeight = MaxElementHeight - Tolerance; + + //The height for the first new row(s) + headerrows: + if (startingHeight == 0) + { + if (probeHeight > area.Height) + { + isEmpty = true; + break; + } + startingHeight = probeHeight; + } + + if (probeHeight > area.Height) + break; + + else + { + _currRow = probeRow; + currentHeight = probeHeight; + ++probeRow; + } + } + if (!isEmpty) + { + TableFormatInfo formatInfo = (TableFormatInfo)_renderInfo.FormatInfo; + formatInfo.StartRow = _startRow; + formatInfo._isEnding = _currRow >= _table.Rows.Count - 1; + formatInfo.EndRow = _currRow; + } + FinishLayoutInfo(area, currentHeight, startingHeight); + } + + private void FinishLayoutInfo(Area area, XUnit currentHeight, XUnit startingHeight) + { + LayoutInfo layoutInfo = _renderInfo.LayoutInfo; + layoutInfo.StartingHeight = startingHeight; + //REM: Trailing height would have to be calculated in case tables had a keep with next property. + layoutInfo.TrailingHeight = 0; + if (_currRow >= 0) + { + layoutInfo.ContentArea = new Rectangle(area.X, area.Y, 0, currentHeight); + XUnit width = LeftBorderOffset; + foreach (Column clm in _table.Columns) + { + width += clm.Width; + } + layoutInfo.ContentArea.Width = width; + } + layoutInfo.MinWidth = layoutInfo.ContentArea.Width; + + if (!_table.Rows._leftIndent.IsNull) + layoutInfo.Left = _table.Rows.LeftIndent.Point; + + else if (_table.Rows.Alignment == RowAlignment.Left) + { + XUnit leftOffset = LeftBorderOffset; + leftOffset += _table.Columns[0].LeftPadding; + layoutInfo.Left = -leftOffset; + } + + switch (_table.Rows.Alignment) + { + case RowAlignment.Left: + layoutInfo.HorizontalAlignment = ElementAlignment.Near; + break; + + case RowAlignment.Right: + layoutInfo.HorizontalAlignment = ElementAlignment.Far; + break; + + case RowAlignment.Center: + layoutInfo.HorizontalAlignment = ElementAlignment.Center; + break; + } + } + + private XUnit LeftBorderOffset + { + get + { + if (_leftBorderOffset < 0) + { + if (_table.Rows.Count > 0 && _table.Columns.Count > 0) + { + Borders borders = _mergedCells.GetEffectiveBorders(_table[0, 0]); + BordersRenderer bordersRenderer = new BordersRenderer(borders, _gfx); + _leftBorderOffset = bordersRenderer.GetWidth(BorderType.Left); + } + else + _leftBorderOffset = 0; + } + return _leftBorderOffset; + } + } + + private XUnit _leftBorderOffset = -1; + + /// + /// Calcs either the height of the header rows or the height of the uppermost top border. + /// + /// + private XUnit CalcStartingHeight() + { + XUnit height = 0; + if (_lastHeaderRow >= 0) + { + height = _bottomBorderMap[_lastHeaderRow + 1]; + height += CalcMaxTopBorderWidth(0); + } + else + { + if (_table.Rows.Count > _startRow) + height = CalcMaxTopBorderWidth(_startRow); + } + + return height; + } + + + private void CalcLastHeaderColumn() + { + _lastHeaderColumn = -1; + foreach (Column clm in _table.Columns) + { + if (clm.HeadingFormat) + _lastHeaderColumn = clm.Index; + else break; + } + if (_lastHeaderColumn >= 0) + _lastHeaderRow = CalcLastConnectedColumn(_lastHeaderColumn); + + // Ignore heading format if all the table is heading: + if (_lastHeaderRow == _table.Rows.Count - 1) + _lastHeaderRow = -1; + } + + private void CalcLastHeaderRow() + { + _lastHeaderRow = -1; + foreach (Row row in _table.Rows) + { + if (row.HeadingFormat) + _lastHeaderRow = row.Index; + else break; + } + if (_lastHeaderRow >= 0) + _lastHeaderRow = CalcLastConnectedRow(_lastHeaderRow); + + // Ignore heading format if all the table is heading: + if (_lastHeaderRow == _table.Rows.Count - 1) + _lastHeaderRow = -1; + } + + private void CreateConnectedRows() + { + _connectedRowsMap = new Dictionary(); //new Sorted_List(); + foreach (Cell cell in _mergedCells) + { + if (!_connectedRowsMap.ContainsKey(cell.Row.Index)) + { + int lastConnectedRow = CalcLastConnectedRow(cell.Row.Index); + _connectedRowsMap[cell.Row.Index] = lastConnectedRow; + } + } + } + + private void CreateConnectedColumns() + { + _connectedColumnsMap = new Dictionary(); //new SortedList(); + foreach (Cell cell in _mergedCells) + { + if (!_connectedColumnsMap.ContainsKey(cell.Column.Index)) + { + int lastConnectedColumn = CalcLastConnectedColumn(cell.Column.Index); + _connectedColumnsMap[cell.Column.Index] = lastConnectedColumn; + } + } + } + + private void CreateBottomBorderMap() + { + _bottomBorderMap = new Dictionary(); //new SortedList(); + _bottomBorderMap.Add(0, XUnit.FromPoint(0)); + while (!_bottomBorderMap.ContainsKey(_table.Rows.Count)) + { + CreateNextBottomBorderPosition(); + } + } + + /// + /// Calculates the top border width for the first row that is rendered or formatted. + /// + /// The row index. + private XUnit CalcMaxTopBorderWidth(int row) + { + XUnit maxWidth = 0; + if (_table.Rows.Count > row) + { + int cellIdx = _mergedCells.BinarySearch(_table[row, 0], new CellComparer()); + Cell rowCell = _mergedCells[cellIdx]; + while (cellIdx < _mergedCells.Count) + { + rowCell = _mergedCells[cellIdx]; + if (rowCell.Row.Index > row) + break; + + if (rowCell._borders != null && !rowCell._borders.IsNull()) + { + BordersRenderer bordersRenderer = new BordersRenderer(rowCell.Borders, _gfx); + XUnit width = bordersRenderer.GetWidth(BorderType.Top); + if (width > maxWidth) + maxWidth = width; + } + ++cellIdx; + } + } + return maxWidth; + } + + /// + /// Creates the next bottom border position. + /// + private void CreateNextBottomBorderPosition() + { + //int lastIdx = _bottomBorderMap.Count - 1; + // SortedList version: + //int lastBorderRow = (int)bottomBorderMap.GetKey(lastIdx); + //XUnit lastPos = (XUnit)bottomBorderMap.GetByIndex(lastIdx); + int lastBorderRow = 0; + foreach (int key in _bottomBorderMap.Keys) + { + if (key > lastBorderRow) + lastBorderRow = key; + } + XUnit lastPos = _bottomBorderMap[lastBorderRow]; + + Cell minMergedCell = GetMinMergedCell(lastBorderRow); + FormattedCell minMergedFormattedCell = _formattedCells[minMergedCell]; + XUnit maxBottomBorderPosition = lastPos + minMergedFormattedCell.InnerHeight; + maxBottomBorderPosition += CalcBottomBorderWidth(minMergedCell); + + foreach (Cell cell in _mergedCells) + { + if (cell.Row.Index > minMergedCell.Row.Index + minMergedCell.MergeDown) + break; + + if (cell.Row.Index + cell.MergeDown == minMergedCell.Row.Index + minMergedCell.MergeDown) + { + FormattedCell formattedCell = _formattedCells[cell]; + // !!!new 18-03-09 Attempt to fix an exception. begin + // if (cell.Row.Index < _bottomBorderMap.Count) + { + // !!!new 18-03-09 Attempt to fix an exception. end +#if true + // !!!new 18-03-09 Attempt to fix an exception. begin + XUnit topBorderPos = maxBottomBorderPosition; + if (!_bottomBorderMap.TryGetValue(cell.Row.Index, out topBorderPos)) + { + //GetType(); + } + // !!!new 18-03-09 Attempt to fix an exception. end +#else + XUnit topBorderPos = _bottomBorderMap[cell.Row.Index]; +#endif + XUnit bottomBorderPos = topBorderPos + formattedCell.InnerHeight; + bottomBorderPos += CalcBottomBorderWidth(cell); + if (bottomBorderPos > maxBottomBorderPosition) + maxBottomBorderPosition = bottomBorderPos; + // !!!new 18-03-09 Attempt to fix an exception. begin + } + // !!!new 18-03-09 Attempt to fix an exception. end + } + } + _bottomBorderMap.Add(minMergedCell.Row.Index + minMergedCell.MergeDown + 1, maxBottomBorderPosition); + } + + /// + /// Calculates bottom border width of a cell. + /// + /// The cell the bottom border of the row that is probed. + /// The calculated border width. + private XUnit CalcBottomBorderWidth(Cell cell) + { + Borders borders = _mergedCells.GetEffectiveBorders(cell); + if (borders != null) + { + BordersRenderer bordersRenderer = new BordersRenderer(borders, _gfx); + return bordersRenderer.GetWidth(BorderType.Bottom); + } + return 0; + } + + /// + /// Gets the first cell that ends in the given row or as close as possible. + /// + /// The row to probe. + /// The first cell with minimal vertical merge. + private Cell GetMinMergedCell(int row) + { +#if true + //!!!new 18-03-10 begin + // Also look at rows above "row", but only consider cells that end at "row" or as close as possible. + int minMerge = _table.Rows.Count; + Cell minCell = null; + foreach (Cell cell in _mergedCells) + { + if (cell.Row.Index <= row && cell.Row.Index + cell.MergeDown >= row) + { + if (cell.Row.Index == row && cell.MergeDown == 0) + { + // Perfect match: non-merged cell in the desired row. + minCell = cell; + break; + } + else if (cell.Row.Index + cell.MergeDown - row < minMerge) + { + minMerge = cell.Row.Index + cell.MergeDown - row; + minCell = cell; + } + } + else if (cell.Row.Index > row) + break; + } + //!!!new 18-03-10 end +#else + int minMerge = _table.Rows.Count; + Cell minCell = null; + foreach (Cell cell in _mergedCells) + { + if (cell.Row.Index == row) + { + if (cell.MergeDown == 0) + { + minCell = cell; + break; + } + else if (cell.MergeDown < minMerge) + { + minMerge = cell.MergeDown; + minCell = cell; + } + } + else if (cell.Row.Index > row) + break; + } +#endif + return minCell; + } + + /// + /// Calculates the last row that is connected with the given row. + /// + /// The row that is probed for downward connection. + /// The last row that is connected with the given row. + private int CalcLastConnectedRow(int row) + { + int lastConnectedRow = row; + foreach (Cell cell in _mergedCells) + { + if (cell.Row.Index <= lastConnectedRow) + { + int downConnection = Math.Max(cell.Row.KeepWith, cell.MergeDown); + if (lastConnectedRow < cell.Row.Index + downConnection) + lastConnectedRow = cell.Row.Index + downConnection; + } + } + return lastConnectedRow; + } + + /// + /// Calculates the last column that is connected with the specified column. + /// + /// The column that is probed for downward connection. + /// The last column that is connected with the given column. + private int CalcLastConnectedColumn(int column) + { + int lastConnectedColumn = column; + foreach (Cell cell in _mergedCells) + { + if (cell.Column.Index <= lastConnectedColumn) + { + int rightConnection = Math.Max(cell.Column.KeepWith, cell.MergeRight); + if (lastConnectedColumn < cell.Column.Index + rightConnection) + lastConnectedColumn = cell.Column.Index + rightConnection; + } + } + return lastConnectedColumn; + } + + private readonly Table _table; + private MergedCellList _mergedCells; + private Dictionary _formattedCells; //SortedList formattedCells; + private Dictionary _bottomBorderMap; //SortedList bottomBorderMap; + private Dictionary _connectedRowsMap; //SortedList connectedRowsMap; + private Dictionary _connectedColumnsMap; //SortedList connectedColumnsMap; + + private int _lastHeaderRow; + private int _lastHeaderColumn; + private int _startRow; + private int _currRow; + private int _endRow = -1; + + private bool _doHorizontalBreak; + private XUnit _startX; + private XUnit _startY; + } +} \ No newline at end of file diff --git a/MigraDoc.Rendering/Rendering/TextFrameFormatInfo.cs b/MigraDoc.Rendering/Rendering/TextFrameFormatInfo.cs new file mode 100644 index 0000000..6adf172 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/TextFrameFormatInfo.cs @@ -0,0 +1,40 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.Rendering +{ + /// + /// Formatting information for textframes. + /// + public sealed class TextFrameFormatInfo : ShapeFormatInfo + { + public FormattedTextFrame FormattedTextFrame; + } +} diff --git a/MigraDoc.Rendering/Rendering/TextFrameRenderInfo.cs b/MigraDoc.Rendering/Rendering/TextFrameRenderInfo.cs new file mode 100644 index 0000000..4bd9e1c --- /dev/null +++ b/MigraDoc.Rendering/Rendering/TextFrameRenderInfo.cs @@ -0,0 +1,48 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.Rendering +{ + /// + /// Summary description for TextFrameRenderInfo. + /// + public sealed class TextFrameRenderInfo : ShapeRenderInfo + { + /// + /// Gets the format information in a specific derived type. For a table, for example, this will be a TableFormatInfo with information about the first and last row showing on a page. + /// + public override FormatInfo FormatInfo + { + get { return _formatInfo ?? (_formatInfo = new TextFrameFormatInfo()); } + set { _formatInfo = (TextFrameFormatInfo)value; } + } + TextFrameFormatInfo _formatInfo; + } +} diff --git a/MigraDoc.Rendering/Rendering/TextFrameRenderer.cs b/MigraDoc.Rendering/Rendering/TextFrameRenderer.cs new file mode 100644 index 0000000..378a2e1 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/TextFrameRenderer.cs @@ -0,0 +1,130 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; +using MigraDoc.DocumentObjectModel.Shapes; + +namespace MigraDoc.Rendering +{ + /// + /// Renders textframes. + /// + public class TextFrameRenderer : ShapeRenderer + { + public TextFrameRenderer(XGraphics gfx, TextFrame textframe, FieldInfos fieldInfos) + : base(gfx, textframe, fieldInfos) + { + _textframe = textframe; + TextFrameRenderInfo renderInfo = new TextFrameRenderInfo(); + renderInfo.DocumentObject = _shape; + _renderInfo = renderInfo; + } + + public TextFrameRenderer(XGraphics gfx, RenderInfo renderInfo, FieldInfos fieldInfos) + : base(gfx, renderInfo, fieldInfos) + { + _textframe = (TextFrame)renderInfo.DocumentObject; + } + + public override void Format(Area area, FormatInfo previousFormatInfo) + { + FormattedTextFrame formattedTextFrame = new FormattedTextFrame(_textframe, _documentRenderer, _fieldInfos); + formattedTextFrame.Format(_gfx); + ((TextFrameFormatInfo)_renderInfo.FormatInfo).FormattedTextFrame = formattedTextFrame; + base.Format(area, previousFormatInfo); + } + + public override LayoutInfo InitialLayoutInfo + { + get { return base.InitialLayoutInfo; } + } + + public override void Render() + { + RenderFilling(); + RenderContent(); + RenderLine(); + } + + void RenderContent() + { + FormattedTextFrame formattedTextFrame = ((TextFrameFormatInfo)_renderInfo.FormatInfo).FormattedTextFrame; + RenderInfo[] renderInfos = formattedTextFrame.GetRenderInfos(); + if (renderInfos == null) + return; + + XGraphicsState state = Transform(); + RenderByInfos(renderInfos); + ResetTransform(state); + } + + XGraphicsState Transform() + { + Area frameContentArea = _renderInfo.LayoutInfo.ContentArea; + XGraphicsState state = _gfx.Save(); + XUnit xPosition; + XUnit yPosition; + switch (_textframe.Orientation) + { + case TextOrientation.Downward: + case TextOrientation.Vertical: + case TextOrientation.VerticalFarEast: + xPosition = frameContentArea.X + frameContentArea.Width; + yPosition = frameContentArea.Y; + _gfx.TranslateTransform(xPosition, yPosition); + _gfx.RotateTransform(90); + break; + + case TextOrientation.Upward: + state = _gfx.Save(); + xPosition = frameContentArea.X; + yPosition = frameContentArea.Y + frameContentArea.Height; + _gfx.TranslateTransform(xPosition, yPosition); + _gfx.RotateTransform(-90); + break; + + default: + xPosition = frameContentArea.X; + yPosition = frameContentArea.Y; + _gfx.TranslateTransform(xPosition, yPosition); + break; + } + return state; + } + + void ResetTransform(XGraphicsState state) + { + if (state != null) + _gfx.Restore(state); + } + + readonly TextFrame _textframe; + } +} diff --git a/MigraDoc.Rendering/Rendering/TopDownFormatter.cs b/MigraDoc.Rendering/Rendering/TopDownFormatter.cs new file mode 100644 index 0000000..615c51d --- /dev/null +++ b/MigraDoc.Rendering/Rendering/TopDownFormatter.cs @@ -0,0 +1,362 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using MigraDoc.DocumentObjectModel; +using PdfSharp.Drawing; + +namespace MigraDoc.Rendering +{ + /// + /// Formats a series of document elements from top to bottom. + /// + public class TopDownFormatter + { + /// + /// Returns the max of the given Margins, if both are positive or 0, the sum otherwise. + /// + /// The bottom margin of the previous element. + /// The top margin of the next element. + /// + private XUnit MarginMax(XUnit prevBottomMargin, XUnit nextTopMargin) + { + if (prevBottomMargin >= 0 && nextTopMargin >= 0) + return Math.Max(prevBottomMargin, nextTopMargin); + return prevBottomMargin + nextTopMargin; + } + + public TopDownFormatter(IAreaProvider areaProvider, DocumentRenderer documentRenderer, DocumentElements elements) + { + _documentRenderer = documentRenderer; + _areaProvider = areaProvider; + _elements = elements; + } + + readonly IAreaProvider _areaProvider; + + readonly DocumentElements _elements; + + /// + /// Formats the elements on the areas provided by the area provider. + /// + /// The graphics object to render on. + /// if set to true formats the object is on top level. + public void FormatOnAreas(XGraphics gfx, bool topLevel) + { + _gfx = gfx; + XUnit prevBottomMargin = 0; + XUnit yPos = prevBottomMargin; + RenderInfo prevRenderInfo = null; + FormatInfo prevFormatInfo = null; + List renderInfos = new List(); + bool ready = _elements.Count == 0; + bool isFirstOnPage = true; + Area area = _areaProvider.GetNextArea(); + XUnit maxHeight = area.Height; + if (ready) + { + _areaProvider.StoreRenderInfos(renderInfos); + return; + } + int idx = 0; + while (!ready && area != null) + { + DocumentObject docObj = _elements[idx]; + Renderer renderer = Renderer.Create(gfx, _documentRenderer, docObj, _areaProvider.AreaFieldInfos); + if (renderer != null) // "Slightly hacked" for legends: see below + renderer.MaxElementHeight = maxHeight; + + if (topLevel && _documentRenderer.HasPrepareDocumentProgress) + { + _documentRenderer.OnPrepareDocumentProgress(_documentRenderer.ProgressCompleted + idx + 1, + _documentRenderer.ProgressMaximum); + } + + // "Slightly hacked" for legends: they are rendered as part of the chart. + // So they are skipped here. + if (renderer == null) + { + ready = idx == _elements.Count - 1; + if (ready) + _areaProvider.StoreRenderInfos(renderInfos); + ++idx; + continue; + } + /////////////////////////////////////////// + if (prevFormatInfo == null) + { + LayoutInfo initialLayoutInfo = renderer.InitialLayoutInfo; + XUnit distance = prevBottomMargin; + if (initialLayoutInfo.VerticalReference == VerticalReference.PreviousElement && + initialLayoutInfo.Floating != Floating.None) + distance = MarginMax(initialLayoutInfo.MarginTop, distance); + + area = area.Lower(distance); + } + renderer.Format(area, prevFormatInfo); + _areaProvider.PositionHorizontally(renderer.RenderInfo.LayoutInfo); + bool pagebreakBefore = _areaProvider.IsAreaBreakBefore(renderer.RenderInfo.LayoutInfo) && !isFirstOnPage; + pagebreakBefore = pagebreakBefore || !isFirstOnPage && IsForcedAreaBreak(idx, renderer, area); + + if (!pagebreakBefore && renderer.RenderInfo.FormatInfo.IsEnding) + { + if (PreviousRendererNeedsRemoveEnding(prevRenderInfo, renderer.RenderInfo, area)) + { + prevRenderInfo.RemoveEnding(); + renderer = Renderer.Create(gfx, _documentRenderer, docObj, _areaProvider.AreaFieldInfos); + renderer.MaxElementHeight = maxHeight; + renderer.Format(area, prevRenderInfo.FormatInfo); + } + else if (NeedsEndingOnNextArea(idx, renderer, area, isFirstOnPage)) + { + renderer.RenderInfo.RemoveEnding(); + prevRenderInfo = FinishPage(renderer.RenderInfo, pagebreakBefore, ref renderInfos); + if (prevRenderInfo != null) + prevFormatInfo = prevRenderInfo.FormatInfo; + else + { + prevFormatInfo = null; + isFirstOnPage = true; + } + prevBottomMargin = 0; + area = _areaProvider.GetNextArea(); + maxHeight = area.Height; + } + else + { + renderInfos.Add(renderer.RenderInfo); + isFirstOnPage = false; + _areaProvider.PositionVertically(renderer.RenderInfo.LayoutInfo); + if (renderer.RenderInfo.LayoutInfo.VerticalReference == VerticalReference.PreviousElement + && renderer.RenderInfo.LayoutInfo.Floating != Floating.None) + { + prevBottomMargin = renderer.RenderInfo.LayoutInfo.MarginBottom; + if (renderer.RenderInfo.LayoutInfo.Floating != Floating.None) + area = area.Lower(renderer.RenderInfo.LayoutInfo.ContentArea.Height); + } + else + prevBottomMargin = 0; + + prevFormatInfo = null; + prevRenderInfo = null; + + ++idx; + } + } + else + { + if (renderer.RenderInfo.FormatInfo.IsEmpty && isFirstOnPage) + { + area = area.Unite(new Rectangle(area.X, area.Y, area.Width, double.MaxValue)); + + renderer = Renderer.Create(gfx, _documentRenderer, docObj, _areaProvider.AreaFieldInfos); + renderer.MaxElementHeight = maxHeight; + renderer.Format(area, prevFormatInfo); + prevFormatInfo = null; + + _areaProvider.PositionHorizontally(renderer.RenderInfo.LayoutInfo); + _areaProvider.PositionVertically(renderer.RenderInfo.LayoutInfo); + + ready = idx == _elements.Count - 1; + + ++idx; + } + prevRenderInfo = FinishPage(renderer.RenderInfo, pagebreakBefore, ref renderInfos); + if (prevRenderInfo != null) + prevFormatInfo = prevRenderInfo.FormatInfo; + else + { + prevFormatInfo = null; + } + isFirstOnPage = true; + prevBottomMargin = 0; + + if (!ready) + { + area = _areaProvider.GetNextArea(); + maxHeight = area.Height; + } + + } + if (idx == _elements.Count && !ready) + { + _areaProvider.StoreRenderInfos(renderInfos); + ready = true; + } + } + } + + /// + /// Finishes rendering for the page. + /// + /// The last render info. + /// set to true if there is a pagebreak before this page. + /// The render infos. + /// + /// The RenderInfo to set as previous RenderInfo. + /// + RenderInfo FinishPage(RenderInfo lastRenderInfo, bool pagebreakBefore, ref List renderInfos) + { + RenderInfo prevRenderInfo; + if (lastRenderInfo.FormatInfo.IsEmpty || pagebreakBefore) + { + prevRenderInfo = null; + } + else + { + prevRenderInfo = lastRenderInfo; + renderInfos.Add(lastRenderInfo); + if (lastRenderInfo.FormatInfo.IsEnding) + prevRenderInfo = null; + } + _areaProvider.StoreRenderInfos(renderInfos); + renderInfos = new List(); + return prevRenderInfo; + } + + /// + /// Indicates that a break between areas has to be performed before the element with the given idx. + /// + /// Index of the document element. + /// A formatted renderer for the document element. + /// The remaining area. + bool IsForcedAreaBreak(int idx, Renderer renderer, Area remainingArea) + { + FormatInfo formatInfo = renderer.RenderInfo.FormatInfo; + LayoutInfo layoutInfo = renderer.RenderInfo.LayoutInfo; + + if (formatInfo.IsStarting && !formatInfo.StartingIsComplete) + return true; + + if (layoutInfo.KeepTogether && !formatInfo.IsComplete) + return true; + + if (layoutInfo.KeepTogether && layoutInfo.KeepWithNext) + { + Area area = remainingArea.Lower(layoutInfo.ContentArea.Height); + return NextElementsDontFit(idx, area, layoutInfo.MarginBottom); + } + return false; + } + + /// + /// Indicates that the Ending of the element has to be removed. + /// + /// The prev render info. + /// The succeding render info. + /// The remaining area. + bool PreviousRendererNeedsRemoveEnding(RenderInfo prevRenderInfo, RenderInfo succedingRenderInfo, Area remainingArea) + { + if (prevRenderInfo == null) + return false; + LayoutInfo layoutInfo = succedingRenderInfo.LayoutInfo; + FormatInfo formatInfo = succedingRenderInfo.FormatInfo; + LayoutInfo prevLayoutInfo = prevRenderInfo.LayoutInfo; + if (formatInfo.IsEnding && !formatInfo.EndingIsComplete) + { + Area area = _areaProvider.ProbeNextArea(); + if (area.Height > prevLayoutInfo.TrailingHeight + layoutInfo.TrailingHeight + Renderer.Tolerance) + return true; + } + + return false; + } + + /// + /// The maximum number of elements that can be combined via keepwithnext and keeptogether + /// + public static readonly int MaxCombineElements = 10; + bool NextElementsDontFit(int idx, Area remainingArea, XUnit previousMarginBottom) + { + XUnit elementDistance = previousMarginBottom; + Area area = remainingArea; + for (int index = idx + 1; index < _elements.Count; ++index) + { + // Never combine more than MaxCombineElements elements + if (index - idx > MaxCombineElements) + return false; + + DocumentObject obj = _elements[index]; + Renderer currRenderer = Renderer.Create(_gfx, _documentRenderer, obj, _areaProvider.AreaFieldInfos); + elementDistance = MarginMax(elementDistance, currRenderer.InitialLayoutInfo.MarginTop); + area = area.Lower(elementDistance); + + if (area.Height <= 0) + return true; + + currRenderer.Format(area, null); + FormatInfo currFormatInfo = currRenderer.RenderInfo.FormatInfo; + LayoutInfo currLayoutInfo = currRenderer.RenderInfo.LayoutInfo; + + if (currLayoutInfo.VerticalReference != VerticalReference.PreviousElement) + return false; + + if (!currFormatInfo.StartingIsComplete) + return true; + + if (currLayoutInfo.KeepTogether && !currFormatInfo.IsComplete) + return true; + + if (!(currLayoutInfo.KeepTogether && currLayoutInfo.KeepWithNext)) + return false; + + area = area.Lower(currLayoutInfo.ContentArea.Height); + if (area.Height <= 0) + return true; + + elementDistance = currLayoutInfo.MarginBottom; + } + return false; + } + + bool NeedsEndingOnNextArea(int idx, Renderer renderer, Area remainingArea, bool isFirstOnPage) + { + LayoutInfo layoutInfo = renderer.RenderInfo.LayoutInfo; + if (isFirstOnPage && layoutInfo.KeepTogether) + return false; + FormatInfo formatInfo = renderer.RenderInfo.FormatInfo; + + if (!formatInfo.EndingIsComplete) + return false; + + if (layoutInfo.KeepWithNext) + { + remainingArea = remainingArea.Lower(layoutInfo.ContentArea.Height); + return NextElementsDontFit(idx, remainingArea, layoutInfo.MarginBottom); + } + + return false; + } + + readonly DocumentRenderer _documentRenderer; + XGraphics _gfx; + } +} diff --git a/MigraDoc.Rendering/Rendering/enums/ElementAlignment.cs b/MigraDoc.Rendering/Rendering/enums/ElementAlignment.cs new file mode 100644 index 0000000..a058764 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/enums/ElementAlignment.cs @@ -0,0 +1,44 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.Rendering +{ + /// + /// Alignment of layout elements. + /// + public enum ElementAlignment + { + Near = 0, // Default + Center, + Far, + Inside, + Outside + } +} diff --git a/MigraDoc.Rendering/Rendering/enums/Floating.cs b/MigraDoc.Rendering/Rendering/enums/Floating.cs new file mode 100644 index 0000000..9d8e955 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/enums/Floating.cs @@ -0,0 +1,46 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.Rendering +{ + /// + /// Floating behavior of layout elements. + /// + public enum Floating + { + TopBottom = 0, // Default + None, // The element is ignored. + + // Served for future extensions: + Left, + Right, + BothSides, + } +} diff --git a/MigraDoc.Rendering/Rendering/enums/HorizontalReference.cs b/MigraDoc.Rendering/Rendering/enums/HorizontalReference.cs new file mode 100644 index 0000000..2347491 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/enums/HorizontalReference.cs @@ -0,0 +1,42 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.Rendering +{ + /// + /// Horizontal reference point of alignment. + /// + public enum HorizontalReference + { + AreaBoundary = 0, // Default + PageMargin, + Page + } +} diff --git a/MigraDoc.Rendering/Rendering/enums/ImageFailure.cs b/MigraDoc.Rendering/Rendering/enums/ImageFailure.cs new file mode 100644 index 0000000..e9c1be8 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/enums/ImageFailure.cs @@ -0,0 +1,41 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.Rendering +{ + public enum ImageFailure + { + None = 0, + FileNotFound, + InvalidType, + NotRead, + EmptySize + } +} diff --git a/MigraDoc.Rendering/Rendering/enums/PageRenderOptions.cs b/MigraDoc.Rendering/Rendering/enums/PageRenderOptions.cs new file mode 100644 index 0000000..6dd3cf2 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/enums/PageRenderOptions.cs @@ -0,0 +1,81 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace MigraDoc.Rendering +{ + /// + /// Determines the parts of a page to be rendered. + /// + [Flags] + public enum PageRenderOptions + { + /// + /// Renders nothing (creates an empty page). + /// + None = 0, + + /// + /// Renders Headers. + /// + RenderHeader = 1, + + /// + /// Renders Footers. + /// + RenderFooter = 2, + + /// + /// Renders Content. + /// + RenderContent = 4, + + /// + /// Renders PDF background pages. + /// + RenderPdfBackground = 8, + + /// + /// Renders PDF content pages. + /// + RenderPdfContent = 16, + + /// + /// Renders all. + /// + All = RenderHeader | RenderFooter | RenderContent | RenderPdfBackground | RenderPdfContent, + + /// + /// Creates not even an empty page. + /// + RemovePage = 32 + } +} diff --git a/MigraDoc.Rendering/Rendering/enums/VerticalReference.cs b/MigraDoc.Rendering/Rendering/enums/VerticalReference.cs new file mode 100644 index 0000000..1522bb5 --- /dev/null +++ b/MigraDoc.Rendering/Rendering/enums/VerticalReference.cs @@ -0,0 +1,40 @@ +#region MigraDoc - Creating Documents on the Fly +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2001-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://www.migradoc.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace MigraDoc.Rendering +{ + public enum VerticalReference + { + PreviousElement = 0, // Default + AreaBoundary, + PageMargin, + Page + } +} diff --git a/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.dll b/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.dll new file mode 100644 index 0000000..5ed2823 Binary files /dev/null and b/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.dll differ diff --git a/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.pdb b/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.pdb new file mode 100644 index 0000000..e9915bc Binary files /dev/null and b/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.pdb differ diff --git a/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.Rendering.deps.json b/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.Rendering.deps.json new file mode 100644 index 0000000..1073a73 --- /dev/null +++ b/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.Rendering.deps.json @@ -0,0 +1,111 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "MigraDoc.Rendering/3.0.0.0": { + "dependencies": { + "MigraDoc.DocumentObjectModel": "3.0.0", + "NETStandard.Library": "2.0.3", + "PdfSharp": "3.0.0", + "PdfSharp.Charting": "3.0.0", + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "MigraDoc.Rendering.dll": {} + }, + "resources": { + "de/MigraDoc.Rendering.resources.dll": { + "locale": "de" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.0": {}, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "System.Drawing.Common/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Drawing.Common.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "MigraDoc.DocumentObjectModel/3.0.0": { + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "MigraDoc.DocumentObjectModel.dll": {} + } + }, + "PdfSharp/3.0.0": { + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "PdfSharp.dll": {} + } + }, + "PdfSharp.Charting/3.0.0": { + "dependencies": { + "PdfSharp": "3.0.0", + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "PdfSharp.Charting.dll": {} + } + } + } + }, + "libraries": { + "MigraDoc.Rendering/3.0.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "path": "microsoft.netcore.platforms/1.1.0", + "hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "System.Drawing.Common/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AiJFxxVPdeITstiRS5aAu8+8Dpf5NawTMoapZ53Gfirml24p7HIfhjmCRxdXnmmf3IUA3AX3CcW7G73CjWxW/Q==", + "path": "system.drawing.common/4.5.0", + "hashPath": "system.drawing.common.4.5.0.nupkg.sha512" + }, + "MigraDoc.DocumentObjectModel/3.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "PdfSharp/3.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "PdfSharp.Charting/3.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.Rendering.dll b/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.Rendering.dll new file mode 100644 index 0000000..48c51a1 Binary files /dev/null and b/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.Rendering.dll differ diff --git a/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.Rendering.pdb b/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.Rendering.pdb new file mode 100644 index 0000000..9d9973e Binary files /dev/null and b/MigraDoc.Rendering/bin/Debug/netstandard2.0/MigraDoc.Rendering.pdb differ diff --git a/MigraDoc.Rendering/bin/Debug/netstandard2.0/PdfSharp.Charting.dll b/MigraDoc.Rendering/bin/Debug/netstandard2.0/PdfSharp.Charting.dll new file mode 100644 index 0000000..af1412c Binary files /dev/null and b/MigraDoc.Rendering/bin/Debug/netstandard2.0/PdfSharp.Charting.dll differ diff --git a/MigraDoc.Rendering/bin/Debug/netstandard2.0/PdfSharp.Charting.pdb b/MigraDoc.Rendering/bin/Debug/netstandard2.0/PdfSharp.Charting.pdb new file mode 100644 index 0000000..f6365b7 Binary files /dev/null and b/MigraDoc.Rendering/bin/Debug/netstandard2.0/PdfSharp.Charting.pdb differ diff --git a/MigraDoc.Rendering/bin/Debug/netstandard2.0/PdfSharp.dll b/MigraDoc.Rendering/bin/Debug/netstandard2.0/PdfSharp.dll new file mode 100644 index 0000000..4050264 Binary files /dev/null and b/MigraDoc.Rendering/bin/Debug/netstandard2.0/PdfSharp.dll differ diff --git a/MigraDoc.Rendering/bin/Debug/netstandard2.0/PdfSharp.pdb b/MigraDoc.Rendering/bin/Debug/netstandard2.0/PdfSharp.pdb new file mode 100644 index 0000000..f3c0d1d Binary files /dev/null and b/MigraDoc.Rendering/bin/Debug/netstandard2.0/PdfSharp.pdb differ diff --git a/MigraDoc.Rendering/bin/Debug/netstandard2.0/de/MigraDoc.Rendering.resources.dll b/MigraDoc.Rendering/bin/Debug/netstandard2.0/de/MigraDoc.Rendering.resources.dll new file mode 100644 index 0000000..08b0229 Binary files /dev/null and b/MigraDoc.Rendering/bin/Debug/netstandard2.0/de/MigraDoc.Rendering.resources.dll differ diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs b/MigraDoc.Rendering/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs new file mode 100644 index 0000000..45b1ca0 --- /dev/null +++ b/MigraDoc.Rendering/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.AssemblyInfo.cs b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.AssemblyInfo.cs new file mode 100644 index 0000000..338aef5 --- /dev/null +++ b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.AssemblyInfo.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("3.0.0.0")] + +// Создано классом WriteCodeFragment MSBuild. + diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.AssemblyInfoInputs.cache b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.AssemblyInfoInputs.cache new file mode 100644 index 0000000..b902023 --- /dev/null +++ b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +c9bbb4259b11bff14843734a92523ce79fd4d971 diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.Rendering.Resources.Messages2.de.resources b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.Rendering.Resources.Messages2.de.resources new file mode 100644 index 0000000..84a4af7 Binary files /dev/null and b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.Rendering.Resources.Messages2.de.resources differ diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.Rendering.Resources.Messages2.resources b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.Rendering.Resources.Messages2.resources new file mode 100644 index 0000000..3993155 Binary files /dev/null and b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.Rendering.Resources.Messages2.resources differ diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.assets.cache b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.assets.cache new file mode 100644 index 0000000..00813e7 Binary files /dev/null and b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.assets.cache differ diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csproj.CopyComplete b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csproj.CoreCompileInputs.cache b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..2398e58 --- /dev/null +++ b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +693735657783e5d1e8dc68c4eef86f60df2919eb diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csproj.FileListAbsolute.txt b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..84e1d3b --- /dev/null +++ b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csproj.FileListAbsolute.txt @@ -0,0 +1,21 @@ +F:\Projects1\MigraDoc.Rendering\bin\Debug\netstandard2.0\MigraDoc.Rendering.deps.json +F:\Projects1\MigraDoc.Rendering\bin\Debug\netstandard2.0\MigraDoc.Rendering.dll +F:\Projects1\MigraDoc.Rendering\bin\Debug\netstandard2.0\MigraDoc.Rendering.pdb +F:\Projects1\MigraDoc.Rendering\bin\Debug\netstandard2.0\de\MigraDoc.Rendering.resources.dll +F:\Projects1\MigraDoc.Rendering\bin\Debug\netstandard2.0\MigraDoc.DocumentObjectModel.dll +F:\Projects1\MigraDoc.Rendering\bin\Debug\netstandard2.0\PdfSharp.Charting.dll +F:\Projects1\MigraDoc.Rendering\bin\Debug\netstandard2.0\PdfSharp.dll +F:\Projects1\MigraDoc.Rendering\bin\Debug\netstandard2.0\MigraDoc.DocumentObjectModel.pdb +F:\Projects1\MigraDoc.Rendering\bin\Debug\netstandard2.0\PdfSharp.Charting.pdb +F:\Projects1\MigraDoc.Rendering\bin\Debug\netstandard2.0\PdfSharp.pdb +F:\Projects1\MigraDoc.Rendering\obj\Debug\netstandard2.0\MigraDoc.Rendering.csprojAssemblyReference.cache +F:\Projects1\MigraDoc.Rendering\obj\Debug\netstandard2.0\MigraDoc.Rendering.Rendering.Resources.Messages2.resources +F:\Projects1\MigraDoc.Rendering\obj\Debug\netstandard2.0\MigraDoc.Rendering.Rendering.Resources.Messages2.de.resources +F:\Projects1\MigraDoc.Rendering\obj\Debug\netstandard2.0\MigraDoc.Rendering.csproj.GenerateResource.cache +F:\Projects1\MigraDoc.Rendering\obj\Debug\netstandard2.0\MigraDoc.Rendering.AssemblyInfoInputs.cache +F:\Projects1\MigraDoc.Rendering\obj\Debug\netstandard2.0\MigraDoc.Rendering.AssemblyInfo.cs +F:\Projects1\MigraDoc.Rendering\obj\Debug\netstandard2.0\MigraDoc.Rendering.csproj.CoreCompileInputs.cache +F:\Projects1\MigraDoc.Rendering\obj\Debug\netstandard2.0\de\MigraDoc.Rendering.resources.dll +F:\Projects1\MigraDoc.Rendering\obj\Debug\netstandard2.0\MigraDoc.Rendering.csproj.CopyComplete +F:\Projects1\MigraDoc.Rendering\obj\Debug\netstandard2.0\MigraDoc.Rendering.dll +F:\Projects1\MigraDoc.Rendering\obj\Debug\netstandard2.0\MigraDoc.Rendering.pdb diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csproj.GenerateResource.cache b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csproj.GenerateResource.cache new file mode 100644 index 0000000..3ff4014 Binary files /dev/null and b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csproj.GenerateResource.cache differ diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csprojAssemblyReference.cache b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csprojAssemblyReference.cache new file mode 100644 index 0000000..bb539b0 Binary files /dev/null and b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csprojAssemblyReference.cache differ diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.dll b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.dll new file mode 100644 index 0000000..48c51a1 Binary files /dev/null and b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.dll differ diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.pdb b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.pdb new file mode 100644 index 0000000..9d9973e Binary files /dev/null and b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.pdb differ diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/de/MigraDoc.Rendering.resources.dll b/MigraDoc.Rendering/obj/Debug/netstandard2.0/de/MigraDoc.Rendering.resources.dll new file mode 100644 index 0000000..08b0229 Binary files /dev/null and b/MigraDoc.Rendering/obj/Debug/netstandard2.0/de/MigraDoc.Rendering.resources.dll differ diff --git a/MigraDoc.Rendering/obj/MigraDoc.Rendering.csproj.nuget.dgspec.json b/MigraDoc.Rendering/obj/MigraDoc.Rendering.csproj.nuget.dgspec.json new file mode 100644 index 0000000..8731589 --- /dev/null +++ b/MigraDoc.Rendering/obj/MigraDoc.Rendering.csproj.nuget.dgspec.json @@ -0,0 +1,278 @@ +{ + "format": 1, + "restore": { + "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj": {} + }, + "projects": { + "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj", + "projectName": "MigraDoc.DocumentObjectModel", + "projectPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj", + "projectName": "MigraDoc.Rendering", + "projectPath": "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\MigraDoc.Rendering\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": { + "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj": { + "projectPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj" + }, + "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj" + }, + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj", + "projectName": "PdfSharp.Charting", + "projectPath": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\PdfSharp.Charting\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": { + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj", + "projectName": "PdfSharp", + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\PdfSharp\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/MigraDoc.Rendering/obj/MigraDoc.Rendering.csproj.nuget.g.props b/MigraDoc.Rendering/obj/MigraDoc.Rendering.csproj.nuget.g.props new file mode 100644 index 0000000..1771934 --- /dev/null +++ b/MigraDoc.Rendering/obj/MigraDoc.Rendering.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\google\.nuget\packages\;C:\Microsoft\Xamarin\NuGet\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder + PackageReference + 5.6.0 + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/MigraDoc.Rendering/obj/MigraDoc.Rendering.csproj.nuget.g.targets b/MigraDoc.Rendering/obj/MigraDoc.Rendering.csproj.nuget.g.targets new file mode 100644 index 0000000..f09823b --- /dev/null +++ b/MigraDoc.Rendering/obj/MigraDoc.Rendering.csproj.nuget.g.targets @@ -0,0 +1,9 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + \ No newline at end of file diff --git a/MigraDoc.Rendering/obj/project.assets.json b/MigraDoc.Rendering/obj/project.assets.json new file mode 100644 index 0000000..50f732c --- /dev/null +++ b/MigraDoc.Rendering/obj/project.assets.json @@ -0,0 +1,361 @@ +{ + "version": 3, + "targets": { + ".NETStandard,Version=v2.0": { + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + }, + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + }, + "build": { + "build/netstandard2.0/NETStandard.Library.targets": {} + } + }, + "System.Drawing.Common/4.5.0": { + "type": "package", + "compile": { + "ref/netstandard2.0/System.Drawing.Common.dll": {} + }, + "runtime": { + "lib/netstandard2.0/System.Drawing.Common.dll": {} + } + }, + "MigraDoc.DocumentObjectModel/3.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "compile": { + "bin/placeholder/MigraDoc.DocumentObjectModel.dll": {} + }, + "runtime": { + "bin/placeholder/MigraDoc.DocumentObjectModel.dll": {} + } + }, + "PdfSharp/3.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "compile": { + "bin/placeholder/PdfSharp.dll": {} + }, + "runtime": { + "bin/placeholder/PdfSharp.dll": {} + } + }, + "PdfSharp.Charting/3.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "PdfSharp": "3.0.0", + "System.Drawing.Common": "4.5.0" + }, + "compile": { + "bin/placeholder/PdfSharp.Charting.dll": {} + }, + "runtime": { + "bin/placeholder/PdfSharp.Charting.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.NETCore.Platforms/1.1.0": { + "sha512": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "type": "package", + "path": "microsoft.netcore.platforms/1.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "ThirdPartyNotices.txt", + "dotnet_library_license.txt", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.1.1.0.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json" + ] + }, + "NETStandard.Library/2.0.3": { + "sha512": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "type": "package", + "path": "netstandard.library/2.0.3", + "files": [ + ".nupkg.metadata", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "build/netstandard2.0/NETStandard.Library.targets", + "build/netstandard2.0/ref/Microsoft.Win32.Primitives.dll", + "build/netstandard2.0/ref/System.AppContext.dll", + "build/netstandard2.0/ref/System.Collections.Concurrent.dll", + "build/netstandard2.0/ref/System.Collections.NonGeneric.dll", + "build/netstandard2.0/ref/System.Collections.Specialized.dll", + "build/netstandard2.0/ref/System.Collections.dll", + "build/netstandard2.0/ref/System.ComponentModel.Composition.dll", + "build/netstandard2.0/ref/System.ComponentModel.EventBasedAsync.dll", + "build/netstandard2.0/ref/System.ComponentModel.Primitives.dll", + "build/netstandard2.0/ref/System.ComponentModel.TypeConverter.dll", + "build/netstandard2.0/ref/System.ComponentModel.dll", + "build/netstandard2.0/ref/System.Console.dll", + "build/netstandard2.0/ref/System.Core.dll", + "build/netstandard2.0/ref/System.Data.Common.dll", + "build/netstandard2.0/ref/System.Data.dll", + "build/netstandard2.0/ref/System.Diagnostics.Contracts.dll", + "build/netstandard2.0/ref/System.Diagnostics.Debug.dll", + "build/netstandard2.0/ref/System.Diagnostics.FileVersionInfo.dll", + "build/netstandard2.0/ref/System.Diagnostics.Process.dll", + "build/netstandard2.0/ref/System.Diagnostics.StackTrace.dll", + "build/netstandard2.0/ref/System.Diagnostics.TextWriterTraceListener.dll", + "build/netstandard2.0/ref/System.Diagnostics.Tools.dll", + "build/netstandard2.0/ref/System.Diagnostics.TraceSource.dll", + "build/netstandard2.0/ref/System.Diagnostics.Tracing.dll", + "build/netstandard2.0/ref/System.Drawing.Primitives.dll", + "build/netstandard2.0/ref/System.Drawing.dll", + "build/netstandard2.0/ref/System.Dynamic.Runtime.dll", + "build/netstandard2.0/ref/System.Globalization.Calendars.dll", + "build/netstandard2.0/ref/System.Globalization.Extensions.dll", + "build/netstandard2.0/ref/System.Globalization.dll", + "build/netstandard2.0/ref/System.IO.Compression.FileSystem.dll", + "build/netstandard2.0/ref/System.IO.Compression.ZipFile.dll", + "build/netstandard2.0/ref/System.IO.Compression.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.DriveInfo.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.Primitives.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.Watcher.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.dll", + "build/netstandard2.0/ref/System.IO.IsolatedStorage.dll", + "build/netstandard2.0/ref/System.IO.MemoryMappedFiles.dll", + "build/netstandard2.0/ref/System.IO.Pipes.dll", + "build/netstandard2.0/ref/System.IO.UnmanagedMemoryStream.dll", + "build/netstandard2.0/ref/System.IO.dll", + "build/netstandard2.0/ref/System.Linq.Expressions.dll", + "build/netstandard2.0/ref/System.Linq.Parallel.dll", + "build/netstandard2.0/ref/System.Linq.Queryable.dll", + "build/netstandard2.0/ref/System.Linq.dll", + "build/netstandard2.0/ref/System.Net.Http.dll", + "build/netstandard2.0/ref/System.Net.NameResolution.dll", + "build/netstandard2.0/ref/System.Net.NetworkInformation.dll", + "build/netstandard2.0/ref/System.Net.Ping.dll", + "build/netstandard2.0/ref/System.Net.Primitives.dll", + "build/netstandard2.0/ref/System.Net.Requests.dll", + "build/netstandard2.0/ref/System.Net.Security.dll", + "build/netstandard2.0/ref/System.Net.Sockets.dll", + "build/netstandard2.0/ref/System.Net.WebHeaderCollection.dll", + "build/netstandard2.0/ref/System.Net.WebSockets.Client.dll", + "build/netstandard2.0/ref/System.Net.WebSockets.dll", + "build/netstandard2.0/ref/System.Net.dll", + "build/netstandard2.0/ref/System.Numerics.dll", + "build/netstandard2.0/ref/System.ObjectModel.dll", + "build/netstandard2.0/ref/System.Reflection.Extensions.dll", + "build/netstandard2.0/ref/System.Reflection.Primitives.dll", + "build/netstandard2.0/ref/System.Reflection.dll", + "build/netstandard2.0/ref/System.Resources.Reader.dll", + "build/netstandard2.0/ref/System.Resources.ResourceManager.dll", + "build/netstandard2.0/ref/System.Resources.Writer.dll", + "build/netstandard2.0/ref/System.Runtime.CompilerServices.VisualC.dll", + "build/netstandard2.0/ref/System.Runtime.Extensions.dll", + "build/netstandard2.0/ref/System.Runtime.Handles.dll", + "build/netstandard2.0/ref/System.Runtime.InteropServices.RuntimeInformation.dll", + "build/netstandard2.0/ref/System.Runtime.InteropServices.dll", + "build/netstandard2.0/ref/System.Runtime.Numerics.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Formatters.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Json.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Primitives.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Xml.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.dll", + "build/netstandard2.0/ref/System.Runtime.dll", + "build/netstandard2.0/ref/System.Security.Claims.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Algorithms.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Csp.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Encoding.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Primitives.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.X509Certificates.dll", + "build/netstandard2.0/ref/System.Security.Principal.dll", + "build/netstandard2.0/ref/System.Security.SecureString.dll", + "build/netstandard2.0/ref/System.ServiceModel.Web.dll", + "build/netstandard2.0/ref/System.Text.Encoding.Extensions.dll", + "build/netstandard2.0/ref/System.Text.Encoding.dll", + "build/netstandard2.0/ref/System.Text.RegularExpressions.dll", + "build/netstandard2.0/ref/System.Threading.Overlapped.dll", + "build/netstandard2.0/ref/System.Threading.Tasks.Parallel.dll", + "build/netstandard2.0/ref/System.Threading.Tasks.dll", + "build/netstandard2.0/ref/System.Threading.Thread.dll", + "build/netstandard2.0/ref/System.Threading.ThreadPool.dll", + "build/netstandard2.0/ref/System.Threading.Timer.dll", + "build/netstandard2.0/ref/System.Threading.dll", + "build/netstandard2.0/ref/System.Transactions.dll", + "build/netstandard2.0/ref/System.ValueTuple.dll", + "build/netstandard2.0/ref/System.Web.dll", + "build/netstandard2.0/ref/System.Windows.dll", + "build/netstandard2.0/ref/System.Xml.Linq.dll", + "build/netstandard2.0/ref/System.Xml.ReaderWriter.dll", + "build/netstandard2.0/ref/System.Xml.Serialization.dll", + "build/netstandard2.0/ref/System.Xml.XDocument.dll", + "build/netstandard2.0/ref/System.Xml.XPath.XDocument.dll", + "build/netstandard2.0/ref/System.Xml.XPath.dll", + "build/netstandard2.0/ref/System.Xml.XmlDocument.dll", + "build/netstandard2.0/ref/System.Xml.XmlSerializer.dll", + "build/netstandard2.0/ref/System.Xml.dll", + "build/netstandard2.0/ref/System.dll", + "build/netstandard2.0/ref/mscorlib.dll", + "build/netstandard2.0/ref/netstandard.dll", + "build/netstandard2.0/ref/netstandard.xml", + "lib/netstandard1.0/_._", + "netstandard.library.2.0.3.nupkg.sha512", + "netstandard.library.nuspec" + ] + }, + "System.Drawing.Common/4.5.0": { + "sha512": "AiJFxxVPdeITstiRS5aAu8+8Dpf5NawTMoapZ53Gfirml24p7HIfhjmCRxdXnmmf3IUA3AX3CcW7G73CjWxW/Q==", + "type": "package", + "path": "system.drawing.common/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net461/System.Drawing.Common.dll", + "lib/netstandard2.0/System.Drawing.Common.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net461/System.Drawing.Common.dll", + "ref/netstandard2.0/System.Drawing.Common.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll", + "runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll", + "system.drawing.common.4.5.0.nupkg.sha512", + "system.drawing.common.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "MigraDoc.DocumentObjectModel/3.0.0": { + "type": "project", + "path": "../MigraDoc.DocumentObjectModel/MigraDoc.DocumentObjectModel.csproj", + "msbuildProject": "../MigraDoc.DocumentObjectModel/MigraDoc.DocumentObjectModel.csproj" + }, + "PdfSharp/3.0.0": { + "type": "project", + "path": "../PdfSharp/PdfSharp.csproj", + "msbuildProject": "../PdfSharp/PdfSharp.csproj" + }, + "PdfSharp.Charting/3.0.0": { + "type": "project", + "path": "../PdfSharp.Charting/PdfSharp.Charting.csproj", + "msbuildProject": "../PdfSharp.Charting/PdfSharp.Charting.csproj" + } + }, + "projectFileDependencyGroups": { + ".NETStandard,Version=v2.0": [ + "MigraDoc.DocumentObjectModel >= 3.0.0", + "NETStandard.Library >= 2.0.3", + "PdfSharp >= 3.0.0", + "PdfSharp.Charting >= 3.0.0", + "System.Drawing.Common >= 4.5.0" + ] + }, + "packageFolders": { + "C:\\Users\\google\\.nuget\\packages\\": {}, + "C:\\Microsoft\\Xamarin\\NuGet\\": {}, + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {} + }, + "project": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj", + "projectName": "MigraDoc.Rendering", + "projectPath": "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\MigraDoc.Rendering\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": { + "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj": { + "projectPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj" + }, + "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj" + }, + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/MigraDoc.Rendering/obj/project.nuget.cache b/MigraDoc.Rendering/obj/project.nuget.cache new file mode 100644 index 0000000..97de297 --- /dev/null +++ b/MigraDoc.Rendering/obj/project.nuget.cache @@ -0,0 +1,12 @@ +{ + "version": 2, + "dgSpecHash": "boPx2os+VDK56gNpLDBReXbp4OV9AGYwwrv86BRJsF2scutJ8fzCbPDkyxMEq+/zQMPSQAtmuoi0W8xng+k80A==", + "success": true, + "projectFilePath": "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj", + "expectedPackageFiles": [ + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\netstandard.library\\2.0.3\\netstandard.library.2.0.3.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\system.drawing.common\\4.5.0\\system.drawing.common.4.5.0.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/PdfSharp.Charting/Charting.Renderers/AreaChartRenderer.cs b/PdfSharp.Charting/Charting.Renderers/AreaChartRenderer.cs new file mode 100644 index 0000000..90aeeff --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/AreaChartRenderer.cs @@ -0,0 +1,189 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents an area chart renderer. + /// + internal class AreaChartRenderer : ColumnLikeChartRenderer + { + /// + /// Initializes a new instance of the AreaChartRenderer class with the + /// specified renderer parameters. + /// + internal AreaChartRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Returns an initialized and renderer specific rendererInfo. + /// + internal override RendererInfo Init() + { + ChartRendererInfo cri = new ChartRendererInfo(); + cri._chart = (Chart)_rendererParms.DrawingItem; + _rendererParms.RendererInfo = cri; + + InitSeriesRendererInfo(); + + LegendRenderer lr = new ColumnLikeLegendRenderer(_rendererParms); + cri.legendRendererInfo = (LegendRendererInfo)lr.Init(); + + AxisRenderer xar = new HorizontalXAxisRenderer(_rendererParms); + cri.xAxisRendererInfo = (AxisRendererInfo)xar.Init(); + + AxisRenderer yar = new VerticalYAxisRenderer(_rendererParms); + cri.yAxisRendererInfo = (AxisRendererInfo)yar.Init(); + + PlotArea plotArea = cri._chart.PlotArea; + PlotAreaRenderer renderer = new AreaPlotAreaRenderer(_rendererParms); + cri.plotAreaRendererInfo = (PlotAreaRendererInfo)renderer.Init(); + + return cri; + } + + /// + /// Layouts and calculates the space used by the line chart. + /// + internal override void Format() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + LegendRenderer lr = new ColumnLikeLegendRenderer(_rendererParms); + lr.Format(); + + // axes + AxisRenderer xar = new HorizontalXAxisRenderer(_rendererParms); + xar.Format(); + + AxisRenderer yar = new VerticalYAxisRenderer(_rendererParms); + yar.Format(); + + // Calculate rects and positions. + CalcLayout(); + + // Calculated remaining plot area, now it's safe to format. + PlotAreaRenderer renderer = new AreaPlotAreaRenderer(_rendererParms); + renderer.Format(); + } + + /// + /// Draws the column chart. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + LegendRenderer lr = new ColumnLikeLegendRenderer(_rendererParms); + lr.Draw(); + + // Draw wall. + WallRenderer wr = new WallRenderer(_rendererParms); + wr.Draw(); + + // Draw gridlines. + GridlinesRenderer glr = new ColumnLikeGridlinesRenderer(_rendererParms); + glr.Draw(); + + PlotAreaBorderRenderer pabr = new PlotAreaBorderRenderer(_rendererParms); + pabr.Draw(); + + PlotAreaRenderer renderer = new AreaPlotAreaRenderer(_rendererParms); + renderer.Draw(); + + // Draw axes. + if (cri.xAxisRendererInfo._axis != null) + { + AxisRenderer xar = new HorizontalXAxisRenderer(_rendererParms); + xar.Draw(); + } + + if (cri.yAxisRendererInfo._axis != null) + { + AxisRenderer yar = new VerticalYAxisRenderer(_rendererParms); + yar.Draw(); + } + } + + /// + /// Initializes all necessary data to draw a series for an area chart. + /// + private void InitSeriesRendererInfo() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + SeriesCollection seriesColl = cri._chart.SeriesCollection; + cri.seriesRendererInfos = new SeriesRendererInfo[seriesColl.Count]; + for (int idx = 0; idx < seriesColl.Count; ++idx) + { + SeriesRendererInfo sri = new SeriesRendererInfo(); + sri._series = seriesColl[idx]; + cri.seriesRendererInfos[idx] = sri; + } + + InitSeries(); + } + + /// + /// Initializes all necessary data to draw a series for an area chart. + /// + internal void InitSeries() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + int seriesIndex = 0; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + sri.LineFormat = Converter.ToXPen(sri._series._lineFormat, XColors.Black, ChartRenderer.DefaultSeriesLineWidth); + sri.FillFormat = Converter.ToXBrush(sri._series._fillFormat, ColumnColors.Item(seriesIndex++)); + + sri._pointRendererInfos = new PointRendererInfo[sri._series._seriesElements.Count]; + for (int pointIdx = 0; pointIdx < sri._pointRendererInfos.Length; ++pointIdx) + { + PointRendererInfo pri = new PointRendererInfo(); + Point point = sri._series._seriesElements[pointIdx]; + pri.Point = point; + if (point != null) + { + pri.LineFormat = sri.LineFormat; + pri.FillFormat = sri.FillFormat; + if (point._lineFormat != null && !point._lineFormat._color.IsEmpty) + pri.LineFormat = new XPen(point._lineFormat._color, point._lineFormat._width); + if (point._fillFormat != null && !point._lineFormat._color.IsEmpty) + pri.FillFormat = new XSolidBrush(point._fillFormat._color); + } + sri._pointRendererInfos[pointIdx] = pri; + } + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/AreaPlotAreaRenderer.cs b/PdfSharp.Charting/Charting.Renderers/AreaPlotAreaRenderer.cs new file mode 100644 index 0000000..7079e76 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/AreaPlotAreaRenderer.cs @@ -0,0 +1,85 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a plot area renderer of areas. + /// + internal class AreaPlotAreaRenderer : ColumnLikePlotAreaRenderer + { + /// + /// Initializes a new instance of the AreaPlotAreaRenderer class + /// with the specified renderer parameters. + /// + internal AreaPlotAreaRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Draws the content of the area plot area. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + XRect plotAreaRect = cri.plotAreaRendererInfo.Rect; + if (plotAreaRect.IsEmpty) + return; + + XGraphics gfx = _rendererParms.Graphics; + XGraphicsState state = gfx.Save(); + //gfx.SetClip(plotAreaRect, XCombineMode.Intersect); + gfx.IntersectClip(plotAreaRect); + + XMatrix matrix = cri.plotAreaRendererInfo._matrix; + double xMajorTick = cri.xAxisRendererInfo.MajorTick; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + int count = sri._series.Elements.Count; + XPoint[] points = new XPoint[count + 2]; + points[0] = new XPoint(xMajorTick / 2, 0); + for (int idx = 0; idx < count; idx++) + { + double pointValue = sri._series.Elements[idx].Value; + if (double.IsNaN(pointValue)) + pointValue = 0; + points[idx + 1] = new XPoint(idx + xMajorTick / 2, pointValue); + } + points[count + 1] = new XPoint(count - 1 + xMajorTick / 2, 0); + matrix.TransformPoints(points); + gfx.DrawPolygon(sri.LineFormat, sri.FillFormat, points, XFillMode.Winding); + } + + //gfx.ResetClip(); + gfx.Restore(state); + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/AxisRenderer.cs b/PdfSharp.Charting/Charting.Renderers/AxisRenderer.cs new file mode 100644 index 0000000..4211683 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/AxisRenderer.cs @@ -0,0 +1,189 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the base for all specialized axis renderer. Initialization common too all + /// axis renderer should come here. + /// + internal abstract class AxisRenderer : Renderer + { + /// + /// Initializes a new instance of the AxisRenderer class with the specified renderer parameters. + /// + internal AxisRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Initializes the axis title of the rendererInfo. All missing font attributes will be taken + /// from the specified defaultFont. + /// + protected void InitAxisTitle(AxisRendererInfo rendererInfo, XFont defaultFont) + { + if (rendererInfo._axis._title != null) + { + AxisTitleRendererInfo atri = new AxisTitleRendererInfo(); + rendererInfo._axisTitleRendererInfo = atri; + + atri._axisTitle = rendererInfo._axis._title; + atri.AxisTitleText = rendererInfo._axis._title._caption; + atri.AxisTitleAlignment = rendererInfo._axis._title._alignment; + atri.AxisTitleVerticalAlignment = rendererInfo._axis._title._verticalAlignment; + atri.AxisTitleFont = Converter.ToXFont(rendererInfo._axis._title._font, defaultFont); + XColor fontColor = XColors.Black; + if (rendererInfo._axis._title._font != null && !rendererInfo._axis._title._font._color.IsEmpty) + fontColor = rendererInfo._axis._title._font._color; + atri.AxisTitleBrush = new XSolidBrush(fontColor); + atri.AxisTitleOrientation = rendererInfo._axis._title._orientation; + } + } + + /// + /// Initializes the tick labels of the rendererInfo. All missing font attributes will be taken + /// from the specified defaultFont. + /// + protected void InitTickLabels(AxisRendererInfo rendererInfo, XFont defaultFont) + { + if (rendererInfo._axis._tickLabels != null) + { + rendererInfo.TickLabelsFont = Converter.ToXFont(rendererInfo._axis._tickLabels._font, defaultFont); + XColor fontColor = XColors.Black; + if (rendererInfo._axis._tickLabels._font != null && !rendererInfo._axis._tickLabels._font._color.IsEmpty) + fontColor = rendererInfo._axis._tickLabels._font._color; + rendererInfo.TickLabelsBrush = new XSolidBrush(fontColor); + + rendererInfo.TickLabelsFormat = rendererInfo._axis._tickLabels._format; + if (rendererInfo.TickLabelsFormat == null) + rendererInfo.TickLabelsFormat = GetDefaultTickLabelsFormat(); + } + else + { + rendererInfo.TickLabelsFont = defaultFont; + rendererInfo.TickLabelsBrush = new XSolidBrush(XColors.Black); + rendererInfo.TickLabelsFormat = GetDefaultTickLabelsFormat(); + } + } + + /// + /// Initializes the line format of the rendererInfo. + /// + protected void InitAxisLineFormat(AxisRendererInfo rendererInfo) + { + if (rendererInfo._axis._minorTickMarkInitialized) + rendererInfo.MinorTickMark = rendererInfo._axis.MinorTickMark; + + if (rendererInfo._axis._majorTickMarkInitialized) + rendererInfo.MajorTickMark = rendererInfo._axis.MajorTickMark; + else + rendererInfo.MajorTickMark = TickMarkType.Outside; + + if (rendererInfo.MinorTickMark != TickMarkType.None) + rendererInfo.MinorTickMarkLineFormat = Converter.ToXPen(rendererInfo._axis._lineFormat, XColors.Black, DefaultMinorTickMarkLineWidth); + + if (rendererInfo.MajorTickMark != TickMarkType.None) + rendererInfo.MajorTickMarkLineFormat = Converter.ToXPen(rendererInfo._axis._lineFormat, XColors.Black, DefaultMajorTickMarkLineWidth); + + if (rendererInfo._axis._lineFormat != null) + { + rendererInfo.LineFormat = Converter.ToXPen(rendererInfo._axis.LineFormat, XColors.Black, DefaultLineWidth); + if (!rendererInfo._axis._majorTickMarkInitialized) + rendererInfo.MajorTickMark = TickMarkType.Outside; + } + } + + /// + /// Initializes the gridlines of the rendererInfo. + /// + protected void InitGridlines(AxisRendererInfo rendererInfo) + { + if (rendererInfo._axis._minorGridlines != null) + { + rendererInfo.MinorGridlinesLineFormat = + Converter.ToXPen(rendererInfo._axis._minorGridlines._lineFormat, XColors.Black, DefaultGridLineWidth); + } + else if (rendererInfo._axis._hasMinorGridlines) + { + // No minor gridlines object are given, but user asked for. + rendererInfo.MinorGridlinesLineFormat = new XPen(XColors.Black, DefaultGridLineWidth); + } + + if (rendererInfo._axis._majorGridlines != null) + { + rendererInfo.MajorGridlinesLineFormat = + Converter.ToXPen(rendererInfo._axis._majorGridlines._lineFormat, XColors.Black, DefaultGridLineWidth); + } + else if (rendererInfo._axis._hasMajorGridlines) + { + // No major gridlines object are given, but user asked for. + rendererInfo.MajorGridlinesLineFormat = new XPen(XColors.Black, DefaultGridLineWidth); + } + } + + /// + /// Default width for a variety of lines. + /// + protected const double DefaultLineWidth = 0.4; // 0.15 mm + + /// + /// Default width for a gridlines. + /// + protected const double DefaultGridLineWidth = 0.15; + + /// + /// Default width for major tick marks. + /// + protected const double DefaultMajorTickMarkLineWidth = 1; + + /// + /// Default width for minor tick marks. + /// + protected const double DefaultMinorTickMarkLineWidth = 1; + + /// + /// Default width of major tick marks. + /// + protected const double DefaultMajorTickMarkWidth = 4.3; // 1.5 mm + + /// + /// Default width of minor tick marks. + /// + protected const double DefaultMinorTickMarkWidth = 2.8; // 1 mm + + /// + /// Default width of space between label and tick mark. + /// + protected const double SpaceBetweenLabelAndTickmark = 2.1; // 0.7 mm + + protected abstract string GetDefaultTickLabelsFormat(); + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/AxisTitleRenderer.cs b/PdfSharp.Charting/Charting.Renderers/AxisTitleRenderer.cs new file mode 100644 index 0000000..b46c98b --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/AxisTitleRenderer.cs @@ -0,0 +1,182 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a axis title renderer used for x and y axis titles. + /// + internal class AxisTitleRenderer : Renderer + { + /// + /// Initializes a new instance of the AxisTitleRenderer class with the + /// specified renderer parameters. + /// + internal AxisTitleRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculates the space used for the axis title. + /// + internal override void Format() + { + XGraphics gfx = _rendererParms.Graphics; + + AxisTitleRendererInfo atri = ((AxisRendererInfo)_rendererParms.RendererInfo)._axisTitleRendererInfo; + if (atri.AxisTitleText != "") + { + XSize size = gfx.MeasureString(atri.AxisTitleText, atri.AxisTitleFont); + if (atri.AxisTitleOrientation != 0) + { + XPoint[] points = new XPoint[2]; + points[0].X = 0; + points[0].Y = 0; + points[1].X = size.Width; + points[1].Y = size.Height; + + XMatrix matrix = new XMatrix(); + matrix.RotatePrepend(-atri.AxisTitleOrientation); + matrix.TransformPoints(points); + + size.Width = Math.Abs(points[1].X - points[0].X); + size.Height = Math.Abs(points[1].Y - points[0].Y); + } + + atri.X = 0; + atri.Y = 0; + atri.Height = size.Height; + atri.Width = size.Width; + } + } + + /// + /// Draws the axis title. + /// + internal override void Draw() + { + AxisRendererInfo ari = (AxisRendererInfo)_rendererParms.RendererInfo; + AxisTitleRendererInfo atri = ari._axisTitleRendererInfo; + if (atri.AxisTitleText != "") + { + XGraphics gfx = _rendererParms.Graphics; + if (atri.AxisTitleOrientation != 0) + { + XRect layout = atri.Rect; + layout.X = -(layout.Width / 2); + layout.Y = -(layout.Height / 2); + + double x = 0; + switch (atri.AxisTitleAlignment) + { + case HorizontalAlignment.Center: + x = atri.X + atri.Width / 2; + break; + + case HorizontalAlignment.Right: + x = atri.X + atri.Width - layout.Width / 2; + break; + + case HorizontalAlignment.Left: + default: + x = atri.X; + break; + } + + double y = 0; + switch (atri.AxisTitleVerticalAlignment) + { + case VerticalAlignment.Center: + y = atri.Y + atri.Height / 2; + break; + + case VerticalAlignment.Bottom: + y = atri.Y + atri.Height - layout.Height / 2; + break; + + case VerticalAlignment.Top: + default: + y = atri.Y; + break; + } + + XStringFormat xsf = new XStringFormat(); + xsf.Alignment = XStringAlignment.Center; + xsf.LineAlignment = XLineAlignment.Center; + + XGraphicsState state = gfx.Save(); + gfx.TranslateTransform(x, y); + gfx.RotateTransform(-atri.AxisTitleOrientation); + gfx.DrawString(atri.AxisTitleText, atri.AxisTitleFont, atri.AxisTitleBrush, layout, xsf); + gfx.Restore(state); + } + else + { + XStringFormat format = new XStringFormat(); + switch (atri.AxisTitleAlignment) + { + case HorizontalAlignment.Center: + format.Alignment = XStringAlignment.Center; + break; + + case HorizontalAlignment.Right: + format.Alignment = XStringAlignment.Far; + break; + + case HorizontalAlignment.Left: + default: + format.Alignment = XStringAlignment.Near; + break; + } + + switch (atri.AxisTitleVerticalAlignment) + { + case VerticalAlignment.Center: + format.LineAlignment = XLineAlignment.Center; + break; + + case VerticalAlignment.Bottom: + format.LineAlignment = XLineAlignment.Far; + break; + + case VerticalAlignment.Top: + default: + format.LineAlignment = XLineAlignment.Near; + break; + } + + gfx.DrawString(atri.AxisTitleText, atri.AxisTitleFont, atri.AxisTitleBrush, atri.Rect, format); + } + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/BarChartRenderer.cs b/PdfSharp.Charting/Charting.Renderers/BarChartRenderer.cs new file mode 100644 index 0000000..7c16a55 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/BarChartRenderer.cs @@ -0,0 +1,257 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a bar chart renderer. + /// + internal class BarChartRenderer : ChartRenderer + { + /// + /// Initializes a new instance of the BarChartRenderer class with the + /// specified renderer parameters. + /// + internal BarChartRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Returns an initialized and renderer specific rendererInfo. + /// + internal override RendererInfo Init() + { + ChartRendererInfo cri = new ChartRendererInfo(); + cri._chart = (Chart)_rendererParms.DrawingItem; + _rendererParms.RendererInfo = cri; + + InitSeriesRendererInfo(); + + LegendRenderer lr = GetLegendRenderer(); + cri.legendRendererInfo = (LegendRendererInfo)lr.Init(); + + AxisRenderer xar = new VerticalXAxisRenderer(_rendererParms); + cri.xAxisRendererInfo = (AxisRendererInfo)xar.Init(); + + AxisRenderer yar = GetYAxisRenderer(); + cri.yAxisRendererInfo = (AxisRendererInfo)yar.Init(); + + PlotArea plotArea = cri._chart.PlotArea; + PlotAreaRenderer renderer = GetPlotAreaRenderer(); + cri.plotAreaRendererInfo = (PlotAreaRendererInfo)renderer.Init(); + + DataLabelRenderer dlr = new BarDataLabelRenderer(_rendererParms); + dlr.Init(); + + return cri; + } + + /// + /// Layouts and calculates the space used by the column chart. + /// + internal override void Format() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + LegendRenderer lr = GetLegendRenderer(); + lr.Format(); + + // axes + AxisRenderer xar = new VerticalXAxisRenderer(_rendererParms); + xar.Format(); + + AxisRenderer yar = GetYAxisRenderer(); + yar.Format(); + + // Calculate rects and positions. + XRect chartRect = LayoutLegend(); + cri.xAxisRendererInfo.X = chartRect.Left; + cri.xAxisRendererInfo.Y = chartRect.Top; + cri.xAxisRendererInfo.Height = chartRect.Height - cri.yAxisRendererInfo.Height; + cri.yAxisRendererInfo.X = chartRect.Left + cri.xAxisRendererInfo.Width; + cri.yAxisRendererInfo.Y = chartRect.Bottom - cri.yAxisRendererInfo.Height; + cri.yAxisRendererInfo.Width = chartRect.Width - cri.xAxisRendererInfo.Width; + cri.plotAreaRendererInfo.X = cri.yAxisRendererInfo.X; + cri.plotAreaRendererInfo.Y = cri.xAxisRendererInfo.Y; + cri.plotAreaRendererInfo.Width = cri.yAxisRendererInfo.InnerRect.Width; + cri.plotAreaRendererInfo.Height = cri.xAxisRendererInfo.Height; + + // Calculated remaining plot area, now it's safe to format. + PlotAreaRenderer renderer = GetPlotAreaRenderer(); + renderer.Format(); + + DataLabelRenderer dlr = new BarDataLabelRenderer(_rendererParms); + dlr.Format(); + } + + /// + /// Draws the column chart. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + LegendRenderer lr = GetLegendRenderer(); + lr.Draw(); + + WallRenderer wr = new WallRenderer(_rendererParms); + wr.Draw(); + + GridlinesRenderer glr = new BarGridlinesRenderer(_rendererParms); + glr.Draw(); + + PlotAreaBorderRenderer pabr = new PlotAreaBorderRenderer(_rendererParms); + pabr.Draw(); + + PlotAreaRenderer renderer = GetPlotAreaRenderer(); + renderer.Draw(); + + DataLabelRenderer dlr = new BarDataLabelRenderer(_rendererParms); + dlr.Draw(); + + if (cri.xAxisRendererInfo._axis != null) + { + AxisRenderer xar = new VerticalXAxisRenderer(_rendererParms); + xar.Draw(); + } + + if (cri.yAxisRendererInfo._axis != null) + { + AxisRenderer yar = GetYAxisRenderer(); + yar.Draw(); + } + } + + /// + /// Returns the specific plot area renderer. + /// + private PlotAreaRenderer GetPlotAreaRenderer() + { + Chart chart = (Chart)_rendererParms.DrawingItem; + switch (chart._type) + { + case ChartType.Bar2D: + return new BarClusteredPlotAreaRenderer(_rendererParms); + + case ChartType.BarStacked2D: + return new BarStackedPlotAreaRenderer(_rendererParms); + } + return null; + } + + /// + /// Returns the specific legend renderer. + /// + private LegendRenderer GetLegendRenderer() + { + Chart chart = (Chart)_rendererParms.DrawingItem; + switch (chart._type) + { + case ChartType.Bar2D: + return new BarClusteredLegendRenderer(_rendererParms); + + case ChartType.BarStacked2D: + return new ColumnLikeLegendRenderer(_rendererParms); + } + return null; + } + + /// + /// Returns the specific plot area renderer. + /// + private YAxisRenderer GetYAxisRenderer() + { + Chart chart = (Chart)_rendererParms.DrawingItem; + switch (chart._type) + { + case ChartType.Bar2D: + return new HorizontalYAxisRenderer(_rendererParms); + + case ChartType.BarStacked2D: + return new HorizontalStackedYAxisRenderer(_rendererParms); + } + return null; + } + + /// + /// Initializes all necessary data to draw all series for a column chart. + /// + private void InitSeriesRendererInfo() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + SeriesCollection seriesColl = cri._chart.SeriesCollection; + cri.seriesRendererInfos = new SeriesRendererInfo[seriesColl.Count]; + // Lowest series is the first, like in Excel + for (int idx = 0; idx < seriesColl.Count; ++idx) + { + SeriesRendererInfo sri = new SeriesRendererInfo(); + sri._series = seriesColl[idx]; + cri.seriesRendererInfos[idx] = sri; + } + + InitSeries(); + } + + /// + /// Initializes all necessary data to draw all series for a column chart. + /// + internal void InitSeries() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + int seriesIndex = 0; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + sri.LineFormat = Converter.ToXPen(sri._series._lineFormat, XColors.Black, DefaultSeriesLineWidth); + sri.FillFormat = Converter.ToXBrush(sri._series._fillFormat, ColumnColors.Item(seriesIndex++)); + + sri._pointRendererInfos = new ColumnRendererInfo[sri._series._seriesElements.Count]; + for (int pointIdx = 0; pointIdx < sri._pointRendererInfos.Length; ++pointIdx) + { + PointRendererInfo pri = new ColumnRendererInfo(); + Point point = sri._series._seriesElements[pointIdx]; + pri.Point = point; + if (point != null) + { + pri.LineFormat = sri.LineFormat; + pri.FillFormat = sri.FillFormat; + if (point._lineFormat != null && !point._lineFormat._color.IsEmpty) + pri.LineFormat = Converter.ToXPen(point._lineFormat, sri.LineFormat); + if (point._fillFormat != null && !point._fillFormat._color.IsEmpty) + pri.FillFormat = new XSolidBrush(point._fillFormat._color); + } + sri._pointRendererInfos[pointIdx] = pri; + } + } + } + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/Charting.Renderers/BarClusteredLegendRenderer.cs b/PdfSharp.Charting/Charting.Renderers/BarClusteredLegendRenderer.cs new file mode 100644 index 0000000..7280f80 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/BarClusteredLegendRenderer.cs @@ -0,0 +1,105 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the legend renderer specific to bar charts. + /// + internal class BarClusteredLegendRenderer : ColumnLikeLegendRenderer + { + /// + /// Initializes a new instance of the BarClusteredLegendRenderer class with the + /// specified renderer parameters. + /// + internal BarClusteredLegendRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Draws the legend. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + LegendRendererInfo lri = cri.legendRendererInfo; + if (lri == null) + return; + + XGraphics gfx = _rendererParms.Graphics; + RendererParameters parms = new RendererParameters(); + parms.Graphics = gfx; + + LegendEntryRenderer ler = new LegendEntryRenderer(parms); + + bool verticalLegend = (lri._legend._docking == DockingType.Left || lri._legend._docking == DockingType.Right); + int paddingFactor = 1; + if (lri.BorderPen != null) + paddingFactor = 2; + XRect legendRect = lri.Rect; + legendRect.X += LeftPadding * paddingFactor; + if (verticalLegend) + legendRect.Y = legendRect.Bottom - BottomPadding * paddingFactor; + else + legendRect.Y += TopPadding * paddingFactor; + + foreach (LegendEntryRendererInfo leri in cri.legendRendererInfo.Entries) + { + if (verticalLegend) + legendRect.Y -= leri.Height; + + XRect entryRect = legendRect; + entryRect.Width = leri.Width; + entryRect.Height = leri.Height; + + leri.Rect = entryRect; + parms.RendererInfo = leri; + ler.Draw(); + + if (verticalLegend) + legendRect.Y -= EntrySpacing; + else + legendRect.X += entryRect.Width + EntrySpacing; + } + + // Draw border around legend + if (lri.BorderPen != null) + { + XRect borderRect = lri.Rect; + borderRect.X += LeftPadding; + borderRect.Y += TopPadding; + borderRect.Width -= LeftPadding + RightPadding; + borderRect.Height -= TopPadding + BottomPadding; + gfx.DrawRectangle(lri.BorderPen, borderRect); + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/BarClusteredPlotAreaRenderer.cs b/PdfSharp.Charting/Charting.Renderers/BarClusteredPlotAreaRenderer.cs new file mode 100644 index 0000000..052ec1b --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/BarClusteredPlotAreaRenderer.cs @@ -0,0 +1,127 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a plot area renderer of clustered bars, i. e. all bars are drawn side by side. + /// + internal class BarClusteredPlotAreaRenderer : BarPlotAreaRenderer + { + /// + /// Initializes a new instance of the BarClusteredPlotAreaRenderer class with the + /// specified renderer parameters. + /// + internal BarClusteredPlotAreaRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculates the position, width and height of each bar of all series. + /// + protected override void CalcBars() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + if (cri.seriesRendererInfos.Length == 0) + return; + + double xMax = cri.xAxisRendererInfo.MaximumScale; + double yMin = cri.yAxisRendererInfo.MinimumScale; + double yMax = cri.yAxisRendererInfo.MaximumScale; + + int pointCount = 0; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + pointCount += sri._series._seriesElements.Count; + + // Space shared by one clustered bar. + double groupWidth = cri.xAxisRendererInfo.MajorTick; + + // Space used by one bar. + double columnWidth = groupWidth * 0.75 / cri.seriesRendererInfos.Length; + + int seriesIdx = 0; + XPoint[] points = new XPoint[2]; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + // Set x to first clustered bar for each series. + double x = xMax - groupWidth / 2; + + // Offset for bars of a particular series from the start of a clustered bar. + double dx = (columnWidth * seriesIdx) - (columnWidth / 2 * cri.seriesRendererInfos.Length); + double y0 = yMin; + + foreach (ColumnRendererInfo column in sri._pointRendererInfos) + { + if (column.Point != null) + { + double x0 = x - dx; + double x1 = x - dx - columnWidth; + double y1 = column.Point.Value; + + // Draw from zero base line, if it exists. + if (y0 < 0 && yMax >= 0) + y0 = 0; + + // y0 should always be lower than y1, i. e. draw bar from bottom to top. + if (y1 < 0 && y1 < y0) + { + double y = y0; + y0 = y1; + y1 = y; + } + + points[0].X = y0; // upper left + points[0].Y = x0; + points[1].X = y1; // lower right + points[1].Y = x1; + + cri.plotAreaRendererInfo._matrix.TransformPoints(points); + + column.Rect = new XRect(points[0].X, + points[1].Y, + points[1].X - points[0].X, + points[0].Y - points[1].Y); + } + x--; // Next clustered bar. + } + seriesIdx++; + } + } + + /// + /// If yValue is within the range from yMin to yMax returns true, otherwise false. + /// + protected override bool IsDataInside(double yMin, double yMax, double yValue) + { + return yValue <= yMax && yValue >= yMin; + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/BarDataLabelRenderer.cs b/PdfSharp.Charting/Charting.Renderers/BarDataLabelRenderer.cs new file mode 100644 index 0000000..3ed2e68 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/BarDataLabelRenderer.cs @@ -0,0 +1,162 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a data label renderer for bar charts. + /// + internal class BarDataLabelRenderer : DataLabelRenderer + { + /// + /// Initializes a new instance of the BarDataLabelRenderer class with the + /// specified renderer parameters. + /// + internal BarDataLabelRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculates the space used by the data labels. + /// + internal override void Format() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + if (sri._dataLabelRendererInfo == null) + continue; + + XGraphics gfx = _rendererParms.Graphics; + + sri._dataLabelRendererInfo.Entries = new DataLabelEntryRendererInfo[sri._pointRendererInfos.Length]; + int index = 0; + foreach (ColumnRendererInfo column in sri._pointRendererInfos) + { + DataLabelEntryRendererInfo dleri = new DataLabelEntryRendererInfo(); + if (sri._dataLabelRendererInfo.Type != DataLabelType.None) + { + if (sri._dataLabelRendererInfo.Type == DataLabelType.Value) + dleri.Text = column.Point._value.ToString(sri._dataLabelRendererInfo.Format); + else if (sri._dataLabelRendererInfo.Type == DataLabelType.Percent) + throw new InvalidOperationException(PSCSR.PercentNotSupportedByColumnDataLabel); + + if (dleri.Text.Length > 0) + dleri.Size = gfx.MeasureString(dleri.Text, sri._dataLabelRendererInfo.Font); + } + + sri._dataLabelRendererInfo.Entries[index++] = dleri; + } + } + + CalcPositions(); + } + + /// + /// Draws the data labels of the bar chart. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + if (sri._dataLabelRendererInfo == null) + continue; + + XGraphics gfx = _rendererParms.Graphics; + XFont font = sri._dataLabelRendererInfo.Font; + XBrush fontColor = sri._dataLabelRendererInfo.FontColor; + XStringFormat format = XStringFormats.Center; + format.LineAlignment = XLineAlignment.Center; + foreach (DataLabelEntryRendererInfo dataLabel in sri._dataLabelRendererInfo.Entries) + { + if (dataLabel.Text != null) + gfx.DrawString(dataLabel.Text, font, fontColor, dataLabel.Rect, format); + } + } + } + + /// + /// Calculates the data label positions specific for column charts. + /// + internal override void CalcPositions() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + XGraphics gfx = _rendererParms.Graphics; + + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + if (sri._dataLabelRendererInfo == null) + continue; + + int columnIndex = 0; + foreach (ColumnRendererInfo bar in sri._pointRendererInfos) + { + DataLabelEntryRendererInfo dleri = sri._dataLabelRendererInfo.Entries[columnIndex++]; + + dleri.Y = bar.Rect.Y + (bar.Rect.Height - dleri.Height) / 2; // Always the same... + switch (sri._dataLabelRendererInfo.Position) + { + case DataLabelPosition.InsideEnd: + // Inner border of the column. + dleri.X = bar.Rect.X; + if (bar.Point._value > 0) + dleri.X += bar.Rect.Width - dleri.Width; + break; + + case DataLabelPosition.Center: + // Centered inside the column. + dleri.X = bar.Rect.X + (bar.Rect.Width - dleri.Width) / 2; + break; + + case DataLabelPosition.InsideBase: + // Aligned at the base of the column. + dleri.X = bar.Rect.X; + if (bar.Point._value < 0) + dleri.X += bar.Rect.Width - dleri.Width; + break; + + case DataLabelPosition.OutsideEnd: + // Outer border of the column. + dleri.X = bar.Rect.X; + if (bar.Point._value > 0) + dleri.X += bar.Rect.Width; + else + dleri.X -= dleri.Width; + break; + } + } + } + } + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/Charting.Renderers/BarGridlinesRenderer.cs b/PdfSharp.Charting/Charting.Renderers/BarGridlinesRenderer.cs new file mode 100644 index 0000000..37e3a88 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/BarGridlinesRenderer.cs @@ -0,0 +1,135 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents gridlines used by bar charts, i. e. X axis grid will be rendered + /// from left to right and Y axis grid will be rendered from top to bottom of the plot area. + /// + internal class BarGridlinesRenderer : GridlinesRenderer + { + /// + /// Initializes a new instance of the BarGridlinesRenderer class with the + /// specified renderer parameters. + /// + internal BarGridlinesRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Draws the gridlines into the plot area. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + XRect plotAreaRect = cri.plotAreaRendererInfo.Rect; + if (plotAreaRect.IsEmpty) + return; + + AxisRendererInfo xari = cri.xAxisRendererInfo; + AxisRendererInfo yari = cri.yAxisRendererInfo; + + double xMin = xari.MinimumScale; + double xMax = xari.MaximumScale; + double yMin = yari.MinimumScale; + double yMax = yari.MaximumScale; + double xMajorTick = xari.MajorTick; + double yMajorTick = yari.MajorTick; + double xMinorTick = xari.MinorTick; + double yMinorTick = yari.MinorTick; + double xMaxExtension = xari.MajorTick; + + XMatrix matrix = cri.plotAreaRendererInfo._matrix; + + LineFormatRenderer lineFormatRenderer; + XGraphics gfx = _rendererParms.Graphics; + + XPoint[] points = new XPoint[2]; + if (xari.MinorGridlinesLineFormat != null) + { + lineFormatRenderer = new LineFormatRenderer(gfx, xari.MinorGridlinesLineFormat); + for (double x = xMin + xMinorTick; x < xMax; x += xMinorTick) + { + points[0].Y = x; + points[0].X = yMin; + points[1].Y = x; + points[1].X = yMax; + matrix.TransformPoints(points); + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + + if (xari.MajorGridlinesLineFormat != null) + { + lineFormatRenderer = new LineFormatRenderer(gfx, xari.MajorGridlinesLineFormat); + for (double x = xMin; x <= xMax; x += xMajorTick) + { + points[0].Y = x; + points[0].X = yMin; + points[1].Y = x; + points[1].X = yMax; + matrix.TransformPoints(points); + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + + if (yari.MinorGridlinesLineFormat != null) + { + lineFormatRenderer = new LineFormatRenderer(gfx, yari.MinorGridlinesLineFormat); + for (double y = yMin + yMinorTick; y < yMax; y += yMinorTick) + { + points[0].Y = xMin; + points[0].X = y; + points[1].Y = xMax; + points[1].X = y; + matrix.TransformPoints(points); + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + + if (yari.MajorGridlinesLineFormat != null) + { + lineFormatRenderer = new LineFormatRenderer(gfx, yari.MajorGridlinesLineFormat); + for (double y = yMin; y <= yMax; y += yMajorTick) + { + points[0].Y = xMin; + points[0].X = y; + points[1].Y = xMax; + points[1].X = y; + matrix.TransformPoints(points); + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/BarPlotAreaRenderer.cs b/PdfSharp.Charting/Charting.Renderers/BarPlotAreaRenderer.cs new file mode 100644 index 0000000..798434f --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/BarPlotAreaRenderer.cs @@ -0,0 +1,154 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a plot area renderer for bars. + /// + internal abstract class BarPlotAreaRenderer : PlotAreaRenderer + { + /// + /// Initializes a new instance of the BarPlotAreaRenderer class with the + /// specified renderer parameters. + /// + internal BarPlotAreaRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Layouts and calculates the space for each bar. + /// + internal override void Format() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + double xMin = cri.xAxisRendererInfo.MinimumScale; + double xMax = cri.xAxisRendererInfo.MaximumScale; + double yMin = cri.yAxisRendererInfo.MinimumScale; + double yMax = cri.yAxisRendererInfo.MaximumScale; + double xMajorTick = cri.xAxisRendererInfo.MajorTick; + + XRect plotAreaBox = cri.plotAreaRendererInfo.Rect; + + cri.plotAreaRendererInfo._matrix = new XMatrix(); + cri.plotAreaRendererInfo._matrix.TranslatePrepend(-yMin, xMin); + cri.plotAreaRendererInfo._matrix.Scale(plotAreaBox.Width / (yMax - yMin), plotAreaBox.Height / (xMax - xMin), XMatrixOrder.Append); + cri.plotAreaRendererInfo._matrix.Translate(plotAreaBox.X, plotAreaBox.Y, XMatrixOrder.Append); + + CalcBars(); + } + + /// + /// Draws the content of the bar plot area. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + XRect plotAreaBox = cri.plotAreaRendererInfo.Rect; + if (plotAreaBox.IsEmpty) + return; + + XGraphics gfx = _rendererParms.Graphics; + + double xMin = cri.xAxisRendererInfo.MinimumScale; + double xMax = cri.xAxisRendererInfo.MaximumScale; + double yMin = cri.yAxisRendererInfo.MinimumScale; + double yMax = cri.yAxisRendererInfo.MaximumScale; + double xMajorTick = cri.xAxisRendererInfo.MajorTick; + + LineFormatRenderer lineFormatRenderer; + + // Under some circumstances it is possible that no zero base line will be drawn, + // e. g. because of unfavourable minimum/maximum scale and/or major tick, so force to draw + // a zero base line if necessary. + if (cri.yAxisRendererInfo.MajorGridlinesLineFormat != null || + cri.yAxisRendererInfo.MinorGridlinesLineFormat != null) + { + if (yMin < 0 && yMax > 0) + { + XPoint[] points = new XPoint[2]; + points[0].X = 0; + points[0].Y = xMin; + points[1].X = 0; + points[1].Y = xMax; + cri.plotAreaRendererInfo._matrix.TransformPoints(points); + + if (cri.yAxisRendererInfo.MinorGridlinesLineFormat != null) + lineFormatRenderer = new LineFormatRenderer(gfx, cri.yAxisRendererInfo.MinorGridlinesLineFormat); + else + lineFormatRenderer = new LineFormatRenderer(gfx, cri.yAxisRendererInfo.MajorGridlinesLineFormat); + + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + + // Draw bars + XGraphicsState state = gfx.Save(); + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + foreach (ColumnRendererInfo column in sri._pointRendererInfos) + { + // Do not draw bar if value is outside yMin/yMax range. Clipping does not make sense. + if (IsDataInside(yMin, yMax, column.Point._value)) + gfx.DrawRectangle(column.FillFormat, column.Rect); + } + } + + // Draw borders around bar. + // A border can overlap neighbor bars, so it is important to draw borders at the end. + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + foreach (ColumnRendererInfo column in sri._pointRendererInfos) + { + // Do not draw bar if value is outside yMin/yMax range. Clipping does not make sense. + if (IsDataInside(yMin, yMax, column.Point._value)) + { + lineFormatRenderer = new LineFormatRenderer(gfx, column.LineFormat); + lineFormatRenderer.DrawRectangle(column.Rect); + } + } + } + gfx.Restore(state); + } + + /// + /// Calculates the position, width and height of each bar of all series. + /// + protected abstract void CalcBars(); + + /// + /// If yValue is within the range from yMin to yMax returns true, otherwise false. + /// + protected abstract bool IsDataInside(double yMin, double yMax, double yValue); + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/BarStackedPlotAreaRenderer.cs b/PdfSharp.Charting/Charting.Renderers/BarStackedPlotAreaRenderer.cs new file mode 100644 index 0000000..ab64b33 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/BarStackedPlotAreaRenderer.cs @@ -0,0 +1,122 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a plot area renderer of stacked bars, i. e. all bars are drawn one on another. + /// + internal class BarStackedPlotAreaRenderer : BarPlotAreaRenderer + { + /// + /// Initializes a new instance of the BarStackedPlotAreaRenderer class with the + /// specified renderer parameters. + /// + internal BarStackedPlotAreaRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculates the position, width and height of each bar of all series. + /// + protected override void CalcBars() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + if (cri.seriesRendererInfos.Length == 0) + return; + + double xMax = cri.xAxisRendererInfo.MaximumScale; + double xMajorTick = cri.xAxisRendererInfo.MajorTick; + + int maxPoints = 0; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + maxPoints = Math.Max(maxPoints, sri._series._seriesElements.Count); + + // Space used by one bar. + double x = xMax - xMajorTick / 2; + double columnWidth = xMajorTick * 0.75 / 2; + + XPoint[] points = new XPoint[2]; + for (int pointIdx = 0; pointIdx < maxPoints; ++pointIdx) + { + double yMin = 0, yMax = 0, y0 = 0, y1 = 0; + double x0 = x - columnWidth; + double x1 = x + columnWidth; + + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + if (sri._pointRendererInfos.Length <= pointIdx) + break; + + ColumnRendererInfo column = (ColumnRendererInfo)sri._pointRendererInfos[pointIdx]; + if (column.Point != null && !double.IsNaN(column.Point._value)) + { + double y = column.Point._value; + if (y < 0) + { + y0 = yMin + y; + y1 = yMin; + yMin += y; + } + else + { + y0 = yMax; + y1 = yMax + y; + yMax += y; + } + + points[0].Y = x0; // oben links + points[0].X = y0; + points[1].Y = x1; // unten rechts + points[1].X = y1; + + cri.plotAreaRendererInfo._matrix.TransformPoints(points); + + column.Rect = new XRect(points[0].X, + points[0].Y, + points[1].X - points[0].X, + points[1].Y - points[0].Y); + } + } + x--; // Next stacked column. + } + } + + /// + /// If yValue is within the range from yMin to yMax returns true, otherwise false. + /// + protected override bool IsDataInside(double yMin, double yMax, double yValue) + { + return yValue <= yMax && yValue >= yMin; + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/ChartRenderer.cs b/PdfSharp.Charting/Charting.Renderers/ChartRenderer.cs new file mode 100644 index 0000000..9f4b2d6 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/ChartRenderer.cs @@ -0,0 +1,100 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the base class for all chart renderers. + /// + internal abstract class ChartRenderer : Renderer + { + /// + /// Initializes a new instance of the ChartRenderer class with the specified renderer parameters. + /// + internal ChartRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculates the space used by the legend and returns the remaining space available for the + /// other parts of the chart. + /// + protected XRect LayoutLegend() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + XRect remainingRect = _rendererParms.Box; + if (cri.legendRendererInfo != null) + { + switch (cri.legendRendererInfo._legend.Docking) + { + case DockingType.Left: + cri.legendRendererInfo.X = remainingRect.Left; + cri.legendRendererInfo.Y = remainingRect.Height / 2 - cri.legendRendererInfo.Height / 2; + double width = cri.legendRendererInfo.Width + LegendSpacing; + remainingRect.X += width; + remainingRect.Width -= width; + break; + + case DockingType.Right: + cri.legendRendererInfo.X = remainingRect.Right - cri.legendRendererInfo.Width; + cri.legendRendererInfo.Y = remainingRect.Height / 2 - cri.legendRendererInfo.Height / 2; + remainingRect.Width -= cri.legendRendererInfo.Width + LegendSpacing; + break; + + case DockingType.Top: + cri.legendRendererInfo.X = remainingRect.Width / 2 - cri.legendRendererInfo.Width / 2; + cri.legendRendererInfo.Y = remainingRect.Top; + double height = cri.legendRendererInfo.Height + LegendSpacing; + remainingRect.Y += height; + remainingRect.Height -= height; + break; + + case DockingType.Bottom: + cri.legendRendererInfo.X = remainingRect.Width / 2 - cri.legendRendererInfo.Width / 2; + cri.legendRendererInfo.Y = remainingRect.Bottom - cri.legendRendererInfo.Height; + remainingRect.Height -= cri.legendRendererInfo.Height + LegendSpacing; + break; + } + } + return remainingRect; + } + + /// + /// Used to separate the legend from the plot area. + /// + private const double LegendSpacing = 0; + + /// + /// Represents the default width for all series lines, like borders in column/bar charts. + /// + protected static readonly double DefaultSeriesLineWidth = 0.15; + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/Colors.cs b/PdfSharp.Charting/Charting.Renderers/Colors.cs new file mode 100644 index 0000000..9cdb554 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/Colors.cs @@ -0,0 +1,126 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the predefined column/bar chart colors. + /// + internal sealed class ColumnColors + { + /// + /// Gets the color for column/bar charts from the specified index. + /// + public static XColor Item(int index) + { + return XColor.FromArgb((int)_seriesColors[index]); + } + + /// + /// Colors for column/bar charts taken from Excel. + /// + static readonly uint[] _seriesColors = new uint[] + { + 0xFF9999FF, 0xFF993366, 0xFFFFFFCC, 0xFFCCFFFF, 0xFF660066, 0xFFFF8080, + 0xFF0066CC, 0xFFCCCCFF, 0xFF000080, 0xFFFF00FF, 0xFFFFFF00, 0xFF00FFFF, + 0xFF800080, 0xFF800000, 0xFF008080, 0xFF0000FF, 0xFF00CCFF, 0xFFCCFFFF, + 0xFFCCFFCC, 0xFFFFFF99, 0xFF99CCFF, 0xFFFF99CC, 0xFFCC99FF, 0xFFFFCC99, + 0xFF3366FF, 0xFF33CCCC, 0xFF99CC00, 0xFFFFCC00, 0xFFFF9900, 0xFFFF6600, + 0xFF666699, 0xFF969696, 0xFF003366, 0xFF339966, 0xFF003300, 0xFF333300, + 0xFF993300, 0xFF993366, 0xFF333399, 0xFF333333, 0xFF000000, 0xFFFFFFFF, + 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFF00, 0xFFFF00FF, 0xFF00FFFF, + 0xFF800000, 0xFF008000, 0xFF000080, 0xFF808000, 0xFF800080, 0xFF008080, + 0xFFC0C0C0, 0xFF808080 + }; + } + + /// + /// Represents the predefined line chart colors. + /// + internal sealed class LineColors + { + /// + /// Gets the color for line charts from the specified index. + /// + public static XColor Item(int index) + { + return XColor.FromArgb((int)_lineColors[index]); + } + + /// + /// Colors for line charts taken from Excel. + /// + static readonly uint[] _lineColors = new uint[] + { + 0xFF000080, 0xFFFF00FF, 0xFFFFFF00, 0xFF00FFFF, 0xFF800080, 0xFF800000, + 0xFF008080, 0xFF0000FF, 0xFF00CCFF, 0xFFCCFFFF, 0xFFCCFFCC, 0xFFFFFF99, + 0xFF99CCFF, 0xFFFF99CC, 0xFFCC99FF, 0xFFFFCC99, 0xFF3366FF, 0xFF33CCCC, + 0xFF99CC00, 0xFFFFCC00, 0xFFFF9900, 0xFFFF6600, 0xFF666699, 0xFF969696, + 0xFF003366, 0xFF339966, 0xFF003300, 0xFF333300, 0xFF993300, 0xFF993366, + 0xFF333399, 0xFF000000, 0xFFFFFFFF, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, + 0xFFFFFF00, 0xFFFF00FF, 0xFF00FFFF, 0xFF800000, 0xFF008000, 0xFF000080, + 0xFF808000, 0xFF800080, 0xFF008080, 0xFFC0C0C0, 0xFF808080, 0xFF9999FF, + 0xFF993366, 0xFFFFFFCC, 0xFFCCFFFF, 0xFF660066, 0xFFFF8080, 0xFF0066CC, + 0xFFCCCCFF + }; + } + + /// + /// Represents the predefined pie chart colors. + /// + internal sealed class PieColors + { + /// + /// Gets the color for pie charts from the specified index. + /// + public static XColor Item(int index) + { + return XColor.FromArgb((int)_sectorColors[index]); + } + + /// + /// Colors for pie charts taken from Excel. + /// + static readonly uint[] _sectorColors = new uint[] + { + 0xFF9999FF, 0xFF993366, 0xFFFFFFCC, 0xFFCCFFFF, 0xFF660066, 0xFFFF8080, + 0xFF0066CC, 0xFFCCCCFF, 0xFF000080, 0xFFFF00FF, 0xFFFFFF00, 0xFF00FFFF, + 0xFF800080, 0xFF800000, 0xFF008080, 0xFF0000FF, 0xFF00CCFF, 0xFFCCFFFF, + 0xFFCCFFCC, 0xFFFFFF99, 0xFF99CCFF, 0xFFFF99CC, 0xFFCC99FF, 0xFFFFCC99, + 0xFF3366FF, 0xFF33CCCC, 0xFF99CC00, 0xFFFFCC00, 0xFFFF9900, 0xFFFF6600, + 0xFF666699, 0xFF969696, 0xFF003366, 0xFF339966, 0xFF003300, 0xFF333300, + 0xFF993300, 0xFF993366, 0xFF333399, 0xFF333333, 0xFF000000, 0xFFFFFFFF, + 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFFFF00, 0xFFFF00FF, 0xFF00FFFF, + 0xFF800000, 0xFF008000, 0xFF000080, 0xFF808000, 0xFF800080, 0xFF008080, + 0xFFC0C0C0, 0xFF808080 + }; + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/ColumnChartRenderer.cs b/PdfSharp.Charting/Charting.Renderers/ColumnChartRenderer.cs new file mode 100644 index 0000000..cd0ddda --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/ColumnChartRenderer.cs @@ -0,0 +1,229 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a column chart renderer. + /// + internal class ColumnChartRenderer : ColumnLikeChartRenderer + { + /// + /// Initializes a new instance of the ColumnChartRenderer class with the + /// specified renderer parameters. + /// + internal ColumnChartRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Returns an initialized and renderer specific rendererInfo. + /// + internal override RendererInfo Init() + { + ChartRendererInfo cri = new ChartRendererInfo(); + cri._chart = (Chart)_rendererParms.DrawingItem; + _rendererParms.RendererInfo = cri; + + InitSeriesRendererInfo(); + + LegendRenderer lr = new ColumnLikeLegendRenderer(_rendererParms); + cri.legendRendererInfo = (LegendRendererInfo)lr.Init(); + + AxisRenderer xar = new HorizontalXAxisRenderer(_rendererParms); + cri.xAxisRendererInfo = (AxisRendererInfo)xar.Init(); + + AxisRenderer yar = GetYAxisRenderer(); + cri.yAxisRendererInfo = (AxisRendererInfo)yar.Init(); + + PlotArea plotArea = cri._chart.PlotArea; + PlotAreaRenderer renderer = GetPlotAreaRenderer(); + cri.plotAreaRendererInfo = (PlotAreaRendererInfo)renderer.Init(); + + DataLabelRenderer dlr = new ColumnDataLabelRenderer(_rendererParms); + dlr.Init(); + + return cri; + } + + /// + /// Layouts and calculates the space used by the column chart. + /// + internal override void Format() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + LegendRenderer lr = new ColumnLikeLegendRenderer(_rendererParms); + lr.Format(); + + // axes + AxisRenderer xar = new HorizontalXAxisRenderer(_rendererParms); + xar.Format(); + + AxisRenderer yar = GetYAxisRenderer(); + yar.Format(); + + // Calculate rects and positions. + CalcLayout(); + + // Calculated remaining plot area, now it's safe to format. + PlotAreaRenderer renderer = GetPlotAreaRenderer(); + renderer.Format(); + + DataLabelRenderer dlr = new ColumnDataLabelRenderer(_rendererParms); + dlr.Format(); + } + + /// + /// Draws the column chart. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + LegendRenderer lr = new ColumnLikeLegendRenderer(_rendererParms); + lr.Draw(); + + WallRenderer wr = new WallRenderer(_rendererParms); + wr.Draw(); + + GridlinesRenderer glr = new ColumnLikeGridlinesRenderer(_rendererParms); + glr.Draw(); + + PlotAreaBorderRenderer pabr = new PlotAreaBorderRenderer(_rendererParms); + pabr.Draw(); + + PlotAreaRenderer renderer = GetPlotAreaRenderer(); + renderer.Draw(); + + DataLabelRenderer dlr = new ColumnDataLabelRenderer(_rendererParms); + dlr.Draw(); + + if (cri.xAxisRendererInfo._axis != null) + { + AxisRenderer xar = new HorizontalXAxisRenderer(_rendererParms); + xar.Draw(); + } + + if (cri.yAxisRendererInfo._axis != null) + { + AxisRenderer yar = GetYAxisRenderer(); + yar.Draw(); + } + } + + /// + /// Returns the specific plot area renderer. + /// + private PlotAreaRenderer GetPlotAreaRenderer() + { + Chart chart = (Chart)_rendererParms.DrawingItem; + switch (chart._type) + { + case ChartType.Column2D: + return new ColumnClusteredPlotAreaRenderer(_rendererParms); + + case ChartType.ColumnStacked2D: + return new ColumnStackedPlotAreaRenderer(_rendererParms); + } + return null; + } + + /// + /// Returns the specific y axis renderer. + /// + private YAxisRenderer GetYAxisRenderer() + { + Chart chart = (Chart)_rendererParms.DrawingItem; + switch (chart._type) + { + case ChartType.Column2D: + return new VerticalYAxisRenderer(_rendererParms); + + case ChartType.ColumnStacked2D: + return new VerticalStackedYAxisRenderer(_rendererParms); + } + return null; + } + + /// + /// Initializes all necessary data to draw all series for a column chart. + /// + private void InitSeriesRendererInfo() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + SeriesCollection seriesColl = cri._chart.SeriesCollection; + cri.seriesRendererInfos = new SeriesRendererInfo[seriesColl.Count]; + for (int idx = 0; idx < seriesColl.Count; ++idx) + { + SeriesRendererInfo sri = new SeriesRendererInfo(); + sri._series = seriesColl[idx]; + cri.seriesRendererInfos[idx] = sri; + } + + InitSeries(); + } + + /// + /// Initializes all necessary data to draw all series for a column chart. + /// + internal void InitSeries() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + int seriesIndex = 0; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + sri.LineFormat = Converter.ToXPen(sri._series._lineFormat, XColors.Black, ChartRenderer.DefaultSeriesLineWidth); + sri.FillFormat = Converter.ToXBrush(sri._series._fillFormat, ColumnColors.Item(seriesIndex++)); + + sri._pointRendererInfos = new ColumnRendererInfo[sri._series._seriesElements.Count]; + for (int pointIdx = 0; pointIdx < sri._pointRendererInfos.Length; ++pointIdx) + { + PointRendererInfo pri = new ColumnRendererInfo(); + Point point = sri._series._seriesElements[pointIdx]; + pri.Point = point; + if (point != null) + { + pri.LineFormat = sri.LineFormat; + pri.FillFormat = sri.FillFormat; + if (point._lineFormat != null) + pri.LineFormat = Converter.ToXPen(point._lineFormat, sri.LineFormat); + if (point._fillFormat != null && !point._fillFormat._color.IsEmpty) + pri.FillFormat = new XSolidBrush(point._fillFormat._color); + } + sri._pointRendererInfos[pointIdx] = pri; + } + } + } + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/Charting.Renderers/ColumnClusteredPlotAreaRenderer.cs b/PdfSharp.Charting/Charting.Renderers/ColumnClusteredPlotAreaRenderer.cs new file mode 100644 index 0000000..f721b89 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/ColumnClusteredPlotAreaRenderer.cs @@ -0,0 +1,127 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a plot area renderer of clustered columns, i. e. all columns are drawn side by side. + /// + internal class ColumnClusteredPlotAreaRenderer : ColumnPlotAreaRenderer + { + /// + /// Initializes a new instance of the ColumnClusteredPlotAreaRenderer class with the + /// specified renderer parameters. + /// + internal ColumnClusteredPlotAreaRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculates the position, width and height of each column of all series. + /// + protected override void CalcColumns() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + if (cri.seriesRendererInfos.Length == 0) + return; + + double xMin = cri.xAxisRendererInfo.MinimumScale; + double yMin = cri.yAxisRendererInfo.MinimumScale; + double yMax = cri.yAxisRendererInfo.MaximumScale; + + int pointCount = 0; + foreach (SeriesRendererInfo sr in cri.seriesRendererInfos) + pointCount += sr._series._seriesElements.Count; + + // Space shared by one clustered column. + double groupWidth = cri.xAxisRendererInfo.MajorTick; + + // Space used by one column. + double columnWidth = groupWidth * 3 / 4 / cri.seriesRendererInfos.Length; + + int seriesIdx = 0; + XPoint[] points = new XPoint[2]; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + // Set x to first clustered column for each series. + double x = xMin + groupWidth / 2; + + // Offset for columns of a particular series from the start of a clustered cloumn. + double dx = (columnWidth * seriesIdx) - (columnWidth / 2 * cri.seriesRendererInfos.Length); + + foreach (ColumnRendererInfo column in sri._pointRendererInfos) + { + if (column.Point != null) + { + double x0 = x + dx; + double x1 = x + dx + columnWidth; + double y0 = yMin; + double y1 = column.Point.Value; + + // Draw from zero base line, if it exists. + if (y0 < 0 && yMax >= 0) + y0 = 0; + + // y0 should always be lower than y1, i. e. draw column from bottom to top. + if (y1 < 0 && y1 < y0) + { + double y = y0; + y0 = y1; + y1 = y; + } + + points[0].X = x0; // upper left + points[0].Y = y1; + points[1].X = x1; // lower right + points[1].Y = y0; + + cri.plotAreaRendererInfo._matrix.TransformPoints(points); + + column.Rect = new XRect(points[0].X, + points[0].Y, + points[1].X - points[0].X, + points[1].Y - points[0].Y); + } + x++; // Next clustered column. + } + seriesIdx++; + } + } + + /// + /// If yValue is within the range from yMin to yMax returns true, otherwise false. + /// + protected override bool IsDataInside(double yMin, double yMax, double yValue) + { + return yValue <= yMax && yValue >= yMin; + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/ColumnDataLabelRenderer.cs b/PdfSharp.Charting/Charting.Renderers/ColumnDataLabelRenderer.cs new file mode 100644 index 0000000..b6344b1 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/ColumnDataLabelRenderer.cs @@ -0,0 +1,160 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a data label renderer for column charts. + /// + internal class ColumnDataLabelRenderer : DataLabelRenderer + { + /// + /// Initializes a new instance of the ColumnDataLabelRenderer class with the + /// specified renderer parameters. + /// + internal ColumnDataLabelRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculates the space used by the data labels. + /// + internal override void Format() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + if (sri._dataLabelRendererInfo == null) + continue; + + XGraphics gfx = _rendererParms.Graphics; + + sri._dataLabelRendererInfo.Entries = new DataLabelEntryRendererInfo[sri._pointRendererInfos.Length]; + int index = 0; + foreach (ColumnRendererInfo column in sri._pointRendererInfos) + { + DataLabelEntryRendererInfo dleri = new DataLabelEntryRendererInfo(); + if (sri._dataLabelRendererInfo.Type != DataLabelType.None) + { + if (sri._dataLabelRendererInfo.Type == DataLabelType.Value) + dleri.Text = column.Point._value.ToString(sri._dataLabelRendererInfo.Format); + else if (sri._dataLabelRendererInfo.Type == DataLabelType.Percent) + throw new InvalidOperationException(PSCSR.PercentNotSupportedByColumnDataLabel); + + if (dleri.Text.Length > 0) + dleri.Size = gfx.MeasureString(dleri.Text, sri._dataLabelRendererInfo.Font); + } + + sri._dataLabelRendererInfo.Entries[index++] = dleri; + } + } + + CalcPositions(); + } + + /// + /// Draws the data labels of the column chart. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + if (sri._dataLabelRendererInfo == null) + continue; + + XGraphics gfx = _rendererParms.Graphics; + XFont font = sri._dataLabelRendererInfo.Font; + XBrush fontColor = sri._dataLabelRendererInfo.FontColor; + XStringFormat format = XStringFormats.Center; + format.LineAlignment = XLineAlignment.Center; + foreach (DataLabelEntryRendererInfo dataLabel in sri._dataLabelRendererInfo.Entries) + { + if (dataLabel.Text != null) + gfx.DrawString(dataLabel.Text, font, fontColor, dataLabel.Rect, format); + } + } + } + + /// + /// Calculates the data label positions specific for column charts. + /// + internal override void CalcPositions() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + XGraphics gfx = _rendererParms.Graphics; + + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + if (sri._dataLabelRendererInfo == null) + continue; + + int columnIndex = 0; + foreach (ColumnRendererInfo column in sri._pointRendererInfos) + { + DataLabelEntryRendererInfo dleri = sri._dataLabelRendererInfo.Entries[columnIndex++]; + + dleri.X = column.Rect.X + column.Rect.Width / 2 - dleri.Width / 2; // Always the same... + switch (sri._dataLabelRendererInfo.Position) + { + case DataLabelPosition.InsideEnd: + // Inner border of the column. + dleri.Y = column.Rect.Y; + if (column.Point._value < 0) + dleri.Y = column.Rect.Y + column.Rect.Height - dleri.Height; + break; + + case DataLabelPosition.Center: + // Centered inside the column. + dleri.Y = column.Rect.Y + column.Rect.Height / 2 - dleri.Height / 2; + break; + + case DataLabelPosition.InsideBase: + // Aligned at the base of the column. + dleri.Y = column.Rect.Y + column.Rect.Height - dleri.Height; + if (column.Point._value < 0) + dleri.Y = column.Rect.Y; + break; + + case DataLabelPosition.OutsideEnd: + // Outer border of the column. + dleri.Y = column.Rect.Y - dleri.Height; + if (column.Point._value < 0) + dleri.Y = column.Rect.Y + column.Rect.Height; + break; + } + } + } + } + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/Charting.Renderers/ColumnLikeChartRenderer.cs b/PdfSharp.Charting/Charting.Renderers/ColumnLikeChartRenderer.cs new file mode 100644 index 0000000..3c2f03f --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/ColumnLikeChartRenderer.cs @@ -0,0 +1,68 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents column like chart renderer. + /// + internal abstract class ColumnLikeChartRenderer : ChartRenderer + { + /// + /// Initializes a new instance of the ColumnLikeChartRenderer class with the + /// specified renderer parameters. + /// + internal ColumnLikeChartRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculates the chart layout. + /// + internal void CalcLayout() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + // Calculate rects and positions. + XRect chartRect = LayoutLegend(); + cri.xAxisRendererInfo.X = chartRect.Left + cri.yAxisRendererInfo.Width; + cri.xAxisRendererInfo.Y = chartRect.Bottom - cri.xAxisRendererInfo.Height; + cri.xAxisRendererInfo.Width = chartRect.Width - cri.yAxisRendererInfo.Width; + cri.yAxisRendererInfo.X = chartRect.Left; + cri.yAxisRendererInfo.Y = chartRect.Top; + cri.yAxisRendererInfo.Height = cri.xAxisRendererInfo.Y - chartRect.Top; + cri.plotAreaRendererInfo.X = cri.xAxisRendererInfo.X; + cri.plotAreaRendererInfo.Y = cri.yAxisRendererInfo.InnerRect.Y; + cri.plotAreaRendererInfo.Width = cri.xAxisRendererInfo.Width; + cri.plotAreaRendererInfo.Height = cri.yAxisRendererInfo.InnerRect.Height; + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/ColumnLikeGridlinesRenderer.cs b/PdfSharp.Charting/Charting.Renderers/ColumnLikeGridlinesRenderer.cs new file mode 100644 index 0000000..750096c --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/ColumnLikeGridlinesRenderer.cs @@ -0,0 +1,134 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents gridlines used by column or line charts, i. e. X axis grid will be rendered + /// from top to bottom and Y axis grid will be rendered from left to right of the plot area. + /// + internal class ColumnLikeGridlinesRenderer : GridlinesRenderer + { + /// + /// Initializes a new instance of the ColumnLikeGridlinesRenderer class with the + /// specified renderer parameters. + /// + internal ColumnLikeGridlinesRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Draws the gridlines into the plot area. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + XRect plotAreaRect = cri.plotAreaRendererInfo.Rect; + if (plotAreaRect.IsEmpty) + return; + + AxisRendererInfo xari = cri.xAxisRendererInfo; + AxisRendererInfo yari = cri.yAxisRendererInfo; + + double xMin = xari.MinimumScale; + double xMax = xari.MaximumScale; + double yMin = yari.MinimumScale; + double yMax = yari.MaximumScale; + double xMajorTick = xari.MajorTick; + double yMajorTick = yari.MajorTick; + double xMinorTick = xari.MinorTick; + double yMinorTick = yari.MinorTick; + + XMatrix matrix = cri.plotAreaRendererInfo._matrix; + + LineFormatRenderer lineFormatRenderer; + XGraphics gfx = _rendererParms.Graphics; + + XPoint[] points = new XPoint[2]; + if (xari.MinorGridlinesLineFormat != null) + { + lineFormatRenderer = new LineFormatRenderer(gfx, xari.MinorGridlinesLineFormat); + for (double x = xMin + xMinorTick; x < xMax; x += xMinorTick) + { + points[0].X = x; + points[0].Y = yMin; + points[1].X = x; + points[1].Y = yMax; + matrix.TransformPoints(points); + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + + if (xari.MajorGridlinesLineFormat != null) + { + lineFormatRenderer = new LineFormatRenderer(gfx, xari.MajorGridlinesLineFormat); + for (double x = xMin; x <= xMax; x += xMajorTick) + { + points[0].X = x; + points[0].Y = yMin; + points[1].X = x; + points[1].Y = yMax; + matrix.TransformPoints(points); + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + + if (yari.MinorGridlinesLineFormat != null) + { + lineFormatRenderer = new LineFormatRenderer(gfx, yari.MinorGridlinesLineFormat); + for (double y = yMin + yMinorTick; y < yMax; y += yMinorTick) + { + points[0].X = xMin; + points[0].Y = y; + points[1].X = xMax; + points[1].Y = y; + matrix.TransformPoints(points); + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + + if (yari.MajorGridlinesLineFormat != null) + { + lineFormatRenderer = new LineFormatRenderer(gfx, yari.MajorGridlinesLineFormat); + for (double y = yMin; y <= yMax; y += yMajorTick) + { + points[0].X = xMin; + points[0].Y = y; + points[1].X = xMax; + points[1].Y = y; + matrix.TransformPoints(points); + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/ColumnLikeLegendRenderer.cs b/PdfSharp.Charting/Charting.Renderers/ColumnLikeLegendRenderer.cs new file mode 100644 index 0000000..79a8011 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/ColumnLikeLegendRenderer.cs @@ -0,0 +1,96 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the legend renderer specific to charts like column, line, or bar. + /// + internal class ColumnLikeLegendRenderer : LegendRenderer + { + /// + /// Initializes a new instance of the ColumnLikeLegendRenderer class with the + /// specified renderer parameters. + /// + internal ColumnLikeLegendRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Initializes the legend's renderer info. Each data series will be represented through + /// a legend entry renderer info. + /// + internal override RendererInfo Init() + { + LegendRendererInfo lri = null; + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + if (cri._chart._legend != null) + { + lri = new LegendRendererInfo(); + lri._legend = cri._chart._legend; + + lri.Font = Converter.ToXFont(lri._legend._font, cri.DefaultFont); + lri.FontColor = new XSolidBrush(XColors.Black); + + if (lri._legend._lineFormat != null) + lri.BorderPen = Converter.ToXPen(lri._legend._lineFormat, XColors.Black, DefaultLineWidth, XDashStyle.Solid); + + lri.Entries = new LegendEntryRendererInfo[cri.seriesRendererInfos.Length]; + int index = 0; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + LegendEntryRendererInfo leri = new LegendEntryRendererInfo(); + leri._seriesRendererInfo = sri; + leri._legendRendererInfo = lri; + leri.EntryText = sri._series.Name; + if (sri._markerRendererInfo != null) + { + leri.MarkerSize.Width = leri.MarkerSize.Height = sri._markerRendererInfo.MarkerSize.Point; + leri.MarkerPen = new XPen(sri._markerRendererInfo.MarkerForegroundColor); + leri.MarkerBrush = new XSolidBrush(sri._markerRendererInfo.MarkerBackgroundColor); + } + else + { + leri.MarkerPen = sri.LineFormat; + leri.MarkerBrush = sri.FillFormat; + } + + if (cri._chart._type == ChartType.ColumnStacked2D) + // Stacked columns are in reverse order. + lri.Entries[cri.seriesRendererInfos.Length - index++ - 1] = leri; + else + lri.Entries[index++] = leri; + } + } + return lri; + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/ColumnLikePlotAreaRenderer.cs b/PdfSharp.Charting/Charting.Renderers/ColumnLikePlotAreaRenderer.cs new file mode 100644 index 0000000..b725473 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/ColumnLikePlotAreaRenderer.cs @@ -0,0 +1,68 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Base class for all plot area renderers. + /// + internal abstract class ColumnLikePlotAreaRenderer : PlotAreaRenderer + { + /// + /// Initializes a new instance of the ColumnLikePlotAreaRenderer class with the + /// specified renderer parameters. + /// + internal ColumnLikePlotAreaRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Layouts and calculates the space for column like plot areas. + /// + internal override void Format() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + double xMin = cri.xAxisRendererInfo.MinimumScale; + double xMax = cri.xAxisRendererInfo.MaximumScale; + double yMin = cri.yAxisRendererInfo.MinimumScale; + double yMax = cri.yAxisRendererInfo.MaximumScale; + + XRect plotAreaBox = cri.plotAreaRendererInfo.Rect; + + cri.plotAreaRendererInfo._matrix = new XMatrix(); + cri.plotAreaRendererInfo._matrix.TranslatePrepend(-xMin, yMax); + cri.plotAreaRendererInfo._matrix.Scale(plotAreaBox.Width / xMax, plotAreaBox.Height / (yMax - yMin), XMatrixOrder.Append); + cri.plotAreaRendererInfo._matrix.ScalePrepend(1, -1); + cri.plotAreaRendererInfo._matrix.Translate(plotAreaBox.X, plotAreaBox.Y, XMatrixOrder.Append); + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/ColumnPlotAreaRenderer.cs b/PdfSharp.Charting/Charting.Renderers/ColumnPlotAreaRenderer.cs new file mode 100644 index 0000000..34893c4 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/ColumnPlotAreaRenderer.cs @@ -0,0 +1,139 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a plot area renderer of clustered columns, i. e. all columns are drawn side by side. + /// + internal abstract class ColumnPlotAreaRenderer : ColumnLikePlotAreaRenderer + { + /// + /// Initializes a new instance of the ColumnPlotAreaRenderer class with the + /// specified renderer parameters. + /// + internal ColumnPlotAreaRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Layouts and calculates the space for each column. + /// + internal override void Format() + { + base.Format(); + CalcColumns(); + } + + /// + /// Draws the content of the column plot area. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + XRect plotAreaBox = cri.plotAreaRendererInfo.Rect; + if (plotAreaBox.IsEmpty) + return; + + XGraphics gfx = _rendererParms.Graphics; + + double xMin = cri.xAxisRendererInfo.MinimumScale; + double xMax = cri.xAxisRendererInfo.MaximumScale; + double yMin = cri.yAxisRendererInfo.MinimumScale; + double yMax = cri.yAxisRendererInfo.MaximumScale; + + LineFormatRenderer lineFormatRenderer; + + // Under some circumstances it is possible that no zero base line will be drawn, + // e. g. because of unfavourable minimum/maximum scale and/or major tick, so force to draw + // a zero base line if necessary. + if (cri.yAxisRendererInfo.MajorGridlinesLineFormat != null || + cri.yAxisRendererInfo.MinorGridlinesLineFormat != null) + { + if (yMin < 0 && yMax > 0) + { + XPoint[] points = new XPoint[2]; + points[0].X = xMin; + points[0].Y = 0; + points[1].X = xMax; + points[1].Y = 0; + cri.plotAreaRendererInfo._matrix.TransformPoints(points); + + if (cri.yAxisRendererInfo.MinorGridlinesLineFormat != null) + lineFormatRenderer = new LineFormatRenderer(gfx, cri.yAxisRendererInfo.MinorGridlinesLineFormat); + else + lineFormatRenderer = new LineFormatRenderer(gfx, cri.yAxisRendererInfo.MajorGridlinesLineFormat); + + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + + // Draw columns + XGraphicsState state = gfx.Save(); + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + foreach (ColumnRendererInfo column in sri._pointRendererInfos) + { + // Do not draw column if value is outside yMin/yMax range. Clipping does not make sense. + if (IsDataInside(yMin, yMax, column.Point._value)) + gfx.DrawRectangle(column.FillFormat, column.Rect); + } + } + + // Draw borders around column. + // A border can overlap neighbor columns, so it is important to draw borders at the end. + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + foreach (ColumnRendererInfo column in sri._pointRendererInfos) + { + // Do not draw column if value is outside yMin/yMax range. Clipping does not make sense. + if (IsDataInside(yMin, yMax, column.Point._value) && column.LineFormat.Width > 0) + { + lineFormatRenderer = new LineFormatRenderer(gfx, column.LineFormat); + lineFormatRenderer.DrawRectangle(column.Rect); + } + } + } + gfx.Restore(state); + } + + /// + /// Calculates the position, width and height of each column of all series. + /// + protected abstract void CalcColumns(); + + /// + /// If yValue is within the range from yMin to yMax returns true, otherwise false. + /// + protected abstract bool IsDataInside(double yMin, double yMax, double yValue); + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/ColumnStackedPlotAreaRenderer.cs b/PdfSharp.Charting/Charting.Renderers/ColumnStackedPlotAreaRenderer.cs new file mode 100644 index 0000000..4fb95d3 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/ColumnStackedPlotAreaRenderer.cs @@ -0,0 +1,124 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a plot area renderer of stacked columns, i. e. all columns are drawn one on another. + /// + internal class ColumnStackedPlotAreaRenderer : ColumnPlotAreaRenderer + { + /// + /// Initializes a new instance of the ColumnStackedPlotAreaRenderer class with the + /// specified renderer parameters. + /// + internal ColumnStackedPlotAreaRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculates the position, width and height of each column of all series. + /// + protected override void CalcColumns() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + if (cri.seriesRendererInfos.Length == 0) + return; + + double xMin = cri.xAxisRendererInfo.MinimumScale; + double xMajorTick = cri.xAxisRendererInfo.MajorTick; + + int maxPoints = 0; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + maxPoints = Math.Max(maxPoints, sri._series._seriesElements.Count); + + double x = xMin + xMajorTick / 2; + + // Space used by one column. + double columnWidth = xMajorTick * 0.75 / 2; + + XPoint[] points = new XPoint[2]; + for (int pointIdx = 0; pointIdx < maxPoints; ++pointIdx) + { + // Set x to first clustered column for each series. + double yMin = 0, yMax = 0, y0 = 0, y1 = 0; + double x0 = x - columnWidth; + double x1 = x + columnWidth; + + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + if (sri._pointRendererInfos.Length <= pointIdx) + break; + + ColumnRendererInfo column = (ColumnRendererInfo)sri._pointRendererInfos[pointIdx]; + if (column.Point != null && !double.IsNaN(column.Point._value)) + { + double y = column.Point._value; + if (y < 0) + { + y0 = yMin + y; + y1 = yMin; + yMin += y; + } + else + { + y0 = yMax; + y1 = yMax + y; + yMax += y; + } + + points[0].X = x0; // upper left + points[0].Y = y1; + points[1].X = x1; // lower right + points[1].Y = y0; + + cri.plotAreaRendererInfo._matrix.TransformPoints(points); + + column.Rect = new XRect(points[0].X, + points[0].Y, + points[1].X - points[0].X, + points[1].Y - points[0].Y); + } + } + x++; // Next stacked column. + } + } + + /// + /// Stacked columns are always inside. + /// + protected override bool IsDataInside(double yMin, double yMax, double yValue) + { + return true; + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/CombinationChartRenderer.cs b/PdfSharp.Charting/Charting.Renderers/CombinationChartRenderer.cs new file mode 100644 index 0000000..f26590a --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/CombinationChartRenderer.cs @@ -0,0 +1,295 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a renderer for combinations of charts. + /// + internal class CombinationChartRenderer : ChartRenderer + { + /// + /// Initializes a new instance of the CombinationChartRenderer class with the + /// specified renderer parameters. + /// + internal CombinationChartRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Returns an initialized and renderer specific rendererInfo. + /// + internal override RendererInfo Init() + { + CombinationRendererInfo cri = new CombinationRendererInfo(); + cri._chart = (Chart)_rendererParms.DrawingItem; + _rendererParms.RendererInfo = cri; + + InitSeriesRendererInfo(); + DistributeSeries(); + + if (cri._areaSeriesRendererInfos != null) + { + cri.seriesRendererInfos = cri._areaSeriesRendererInfos; + AreaChartRenderer renderer = new AreaChartRenderer(_rendererParms); + renderer.InitSeries(); + } + if (cri._columnSeriesRendererInfos != null) + { + cri.seriesRendererInfos = cri._columnSeriesRendererInfos; + ColumnChartRenderer renderer = new ColumnChartRenderer(_rendererParms); + renderer.InitSeries(); + } + if (cri._lineSeriesRendererInfos != null) + { + cri.seriesRendererInfos = cri._lineSeriesRendererInfos; + LineChartRenderer renderer = new LineChartRenderer(_rendererParms); + renderer.InitSeries(); + } + cri.seriesRendererInfos = cri._commonSeriesRendererInfos; + + LegendRenderer lr = new ColumnLikeLegendRenderer(_rendererParms); + cri.legendRendererInfo = (LegendRendererInfo)lr.Init(); + + AxisRenderer xar = new HorizontalXAxisRenderer(_rendererParms); + cri.xAxisRendererInfo = (AxisRendererInfo)xar.Init(); + + AxisRenderer yar = new VerticalYAxisRenderer(_rendererParms); + cri.yAxisRendererInfo = (AxisRendererInfo)yar.Init(); + + PlotArea plotArea = cri._chart.PlotArea; + PlotAreaRenderer apar = new AreaPlotAreaRenderer(_rendererParms); + cri.plotAreaRendererInfo = (PlotAreaRendererInfo)apar.Init(); + + // Draw data labels. + if (cri._columnSeriesRendererInfos != null) + { + cri.seriesRendererInfos = cri._columnSeriesRendererInfos; + DataLabelRenderer dlr = new ColumnDataLabelRenderer(_rendererParms); + dlr.Init(); + } + + return cri; + } + + /// + /// Layouts and calculates the space used by the combination chart. + /// + internal override void Format() + { + CombinationRendererInfo cri = (CombinationRendererInfo)_rendererParms.RendererInfo; + cri.seriesRendererInfos = cri._commonSeriesRendererInfos; + + LegendRenderer lr = new ColumnLikeLegendRenderer(_rendererParms); + lr.Format(); + + // axes + AxisRenderer xar = new HorizontalXAxisRenderer(_rendererParms); + xar.Format(); + + AxisRenderer yar = new VerticalYAxisRenderer(_rendererParms); + yar.Format(); + + // Calculate rects and positions. + XRect chartRect = LayoutLegend(); + cri.xAxisRendererInfo.X = chartRect.Left + cri.yAxisRendererInfo.Width; + cri.xAxisRendererInfo.Y = chartRect.Bottom - cri.xAxisRendererInfo.Height; + cri.xAxisRendererInfo.Width = chartRect.Width - cri.yAxisRendererInfo.Width; + cri.yAxisRendererInfo.X = chartRect.Left; + cri.yAxisRendererInfo.Y = chartRect.Top; + cri.yAxisRendererInfo.Height = chartRect.Height - cri.xAxisRendererInfo.Height; + cri.plotAreaRendererInfo.X = cri.xAxisRendererInfo.X; + cri.plotAreaRendererInfo.Y = cri.yAxisRendererInfo.InnerRect.Y; + cri.plotAreaRendererInfo.Width = cri.xAxisRendererInfo.Width; + cri.plotAreaRendererInfo.Height = cri.yAxisRendererInfo.InnerRect.Height; + + // Calculated remaining plot area, now it's safe to format. + PlotAreaRenderer renderer; + if (cri._areaSeriesRendererInfos != null) + { + cri.seriesRendererInfos = cri._areaSeriesRendererInfos; + renderer = new AreaPlotAreaRenderer(_rendererParms); + renderer.Format(); + } + if (cri._columnSeriesRendererInfos != null) + { + cri.seriesRendererInfos = cri._columnSeriesRendererInfos; + //TODO Check for Clustered- or StackedPlotAreaRenderer + renderer = new ColumnClusteredPlotAreaRenderer(_rendererParms); + renderer.Format(); + } + if (cri._lineSeriesRendererInfos != null) + { + cri.seriesRendererInfos = cri._lineSeriesRendererInfos; + renderer = new LinePlotAreaRenderer(_rendererParms); + renderer.Format(); + } + + // Draw data labels. + if (cri._columnSeriesRendererInfos != null) + { + cri.seriesRendererInfos = cri._columnSeriesRendererInfos; + DataLabelRenderer dlr = new ColumnDataLabelRenderer(_rendererParms); + dlr.Format(); + } + } + + /// + /// Draws the column chart. + /// + internal override void Draw() + { + CombinationRendererInfo cri = (CombinationRendererInfo)_rendererParms.RendererInfo; + cri.seriesRendererInfos = cri._commonSeriesRendererInfos; + + LegendRenderer lr = new ColumnLikeLegendRenderer(_rendererParms); + lr.Draw(); + + WallRenderer wr = new WallRenderer(_rendererParms); + wr.Draw(); + + GridlinesRenderer glr = new ColumnLikeGridlinesRenderer(_rendererParms); + glr.Draw(); + + PlotAreaBorderRenderer pabr = new PlotAreaBorderRenderer(_rendererParms); + pabr.Draw(); + + PlotAreaRenderer renderer; + if (cri._areaSeriesRendererInfos != null) + { + cri.seriesRendererInfos = cri._areaSeriesRendererInfos; + renderer = new AreaPlotAreaRenderer(_rendererParms); + renderer.Draw(); + } + if (cri._columnSeriesRendererInfos != null) + { + cri.seriesRendererInfos = cri._columnSeriesRendererInfos; + //TODO Check for Clustered- or StackedPlotAreaRenderer + renderer = new ColumnClusteredPlotAreaRenderer(_rendererParms); + renderer.Draw(); + } + if (cri._lineSeriesRendererInfos != null) + { + cri.seriesRendererInfos = cri._lineSeriesRendererInfos; + renderer = new LinePlotAreaRenderer(_rendererParms); + renderer.Draw(); + } + + // Draw data labels. + if (cri._columnSeriesRendererInfos != null) + { + cri.seriesRendererInfos = cri._columnSeriesRendererInfos; + DataLabelRenderer dlr = new ColumnDataLabelRenderer(_rendererParms); + dlr.Draw(); + } + + // Draw axes. + cri.seriesRendererInfos = cri._commonSeriesRendererInfos; + if (cri.xAxisRendererInfo._axis != null) + { + AxisRenderer xar = new HorizontalXAxisRenderer(_rendererParms); + xar.Draw(); + } + if (cri.yAxisRendererInfo._axis != null) + { + AxisRenderer yar = new VerticalYAxisRenderer(_rendererParms); + yar.Draw(); + } + } + + /// + /// Initializes all necessary data to draw series for a combination chart. + /// + private void InitSeriesRendererInfo() + { + CombinationRendererInfo cri = (CombinationRendererInfo)_rendererParms.RendererInfo; + SeriesCollection seriesColl = cri._chart.SeriesCollection; + cri.seriesRendererInfos = new SeriesRendererInfo[seriesColl.Count]; + for (int idx = 0; idx < seriesColl.Count; ++idx) + { + SeriesRendererInfo sri = new SeriesRendererInfo(); + sri._series = seriesColl[idx]; + cri.seriesRendererInfos[idx] = sri; + } + } + + /// + /// Sort all series renderer info dependent on their chart type. + /// + private void DistributeSeries() + { + CombinationRendererInfo cri = (CombinationRendererInfo)_rendererParms.RendererInfo; + + List areaSeries = new List(); + List columnSeries = new List(); + List lineSeries = new List(); + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + switch (sri._series._chartType) + { + case ChartType.Area2D: + areaSeries.Add(sri); + break; + + case ChartType.Column2D: + columnSeries.Add(sri); + break; + + case ChartType.Line: + lineSeries.Add(sri); + break; + + default: + throw new InvalidOperationException(PSCSR.InvalidChartTypeForCombination(sri._series._chartType)); + } + } + + cri._commonSeriesRendererInfos = cri.seriesRendererInfos; + if (areaSeries.Count > 0) + { + cri._areaSeriesRendererInfos = new SeriesRendererInfo[areaSeries.Count]; + areaSeries.CopyTo(cri._areaSeriesRendererInfos); + } + if (columnSeries.Count > 0) + { + cri._columnSeriesRendererInfos = new SeriesRendererInfo[columnSeries.Count]; + columnSeries.CopyTo(cri._columnSeriesRendererInfos); + } + if (lineSeries.Count > 0) + { + cri._lineSeriesRendererInfos = new SeriesRendererInfo[lineSeries.Count]; + lineSeries.CopyTo(cri._lineSeriesRendererInfos); + } + } + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/Charting.Renderers/Converter.cs b/PdfSharp.Charting/Charting.Renderers/Converter.cs new file mode 100644 index 0000000..a703df6 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/Converter.cs @@ -0,0 +1,138 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Provides functions which converts Charting.DOM objects into PdfSharp.Drawing objects. + /// + internal class Converter + { + /// + /// Creates a XFont based on the font. Missing attributes will be taken from the defaultFont + /// parameter. + /// + internal static XFont ToXFont(Font font, XFont defaultFont) + { + XFont xfont = defaultFont; + if (font != null) + { + string fontFamily = font.Name; + if (fontFamily == "") + fontFamily = defaultFont.FontFamily.Name; + + XFontStyle fontStyle = defaultFont.Style; + if (font._bold) + fontStyle |= XFontStyle.Bold; + if (font._italic) + fontStyle |= XFontStyle.Italic; + + double size = font._size.Point; //emSize??? + if (size == 0) + size = defaultFont.Size; + + xfont = new XFont(fontFamily, size, fontStyle); + } + return xfont; + } + + /// + /// Creates a XPen based on the specified line format. If not specified color and width will be taken + /// from the defaultColor and defaultWidth parameter. + /// + internal static XPen ToXPen(LineFormat lineFormat, XColor defaultColor, double defaultWidth) + { + return ToXPen(lineFormat, defaultColor, defaultWidth, XDashStyle.Solid); + } + + /// + /// Creates a XPen based on the specified line format. If not specified color and width will be taken + /// from the defaultPen parameter. + /// + internal static XPen ToXPen(LineFormat lineFormat, XPen defaultPen) + { + return ToXPen(lineFormat, defaultPen.Color, defaultPen.Width, defaultPen.DashStyle); + } + + /// + /// Creates a XPen based on the specified line format. If not specified color, width and dash style + /// will be taken from the defaultColor, defaultWidth and defaultDashStyle parameters. + /// + internal static XPen ToXPen(LineFormat lineFormat, XColor defaultColor, double defaultWidth, XDashStyle defaultDashStyle) + { + XPen pen = null; + if (lineFormat == null) + { + pen = new XPen(defaultColor, defaultWidth); + pen.DashStyle = defaultDashStyle; + } + else + { + XColor color = defaultColor; + if (!lineFormat.Color.IsEmpty) + color = lineFormat.Color; + + double width = lineFormat.Width.Point; + if (!lineFormat.Visible) + width = 0; + if (lineFormat.Visible && width == 0) + width = defaultWidth; + + pen = new XPen(color, width); + pen.DashStyle = lineFormat._dashStyle; + pen.DashOffset = 10 * width; + } + return pen; + } + + /// + /// Creates a XBrush based on the specified fill format. If not specified, color will be taken + /// from the defaultColor parameter. + /// + internal static XBrush ToXBrush(FillFormat fillFormat, XColor defaultColor) + { + if (fillFormat == null || fillFormat._color.IsEmpty) + return new XSolidBrush(defaultColor); + return new XSolidBrush(fillFormat._color); + } + + /// + /// Creates a XBrush based on the specified font color. If not specified, color will be taken + /// from the defaultColor parameter. + /// + internal static XBrush ToXBrush(Font font, XColor defaultColor) + { + if (font == null || font._color.IsEmpty) + return new XSolidBrush(defaultColor); + return new XSolidBrush(font._color); + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/DataLabelRenderer.cs b/PdfSharp.Charting/Charting.Renderers/DataLabelRenderer.cs new file mode 100644 index 0000000..7d1dc8d --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/DataLabelRenderer.cs @@ -0,0 +1,107 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a data label renderer. + /// + internal abstract class DataLabelRenderer : Renderer + { + /// + /// Initializes a new instance of the DataLabelRenderer class with the + /// specified renderer parameters. + /// + internal DataLabelRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Creates a data label rendererInfo. + /// Does not return any renderer info. + /// + internal override RendererInfo Init() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + if (cri._chart._hasDataLabel || cri._chart._dataLabel != null || + sri._series._hasDataLabel || sri._series._dataLabel != null) + { + DataLabelRendererInfo dlri = new DataLabelRendererInfo(); + + DataLabel dl = sri._series._dataLabel; + if (dl == null) + dl = cri._chart._dataLabel; + if (dl == null) + { + dlri.Format = "0"; + dlri.Font = cri.DefaultDataLabelFont; + dlri.FontColor = new XSolidBrush(XColors.Black); + dlri.Position = DataLabelPosition.InsideEnd; + if (cri._chart._type == ChartType.Pie2D || cri._chart._type == ChartType.PieExploded2D) + dlri.Type = DataLabelType.Percent; + else + dlri.Type = DataLabelType.Value; + } + else + { + dlri.Format = dl.Format.Length > 0 ? dl.Format : "0"; + dlri.Font = Converter.ToXFont(dl._font, cri.DefaultDataLabelFont); + dlri.FontColor = Converter.ToXBrush(dl._font, XColors.Black); + if (dl._positionInitialized) + dlri.Position = dl._position; + else + dlri.Position = DataLabelPosition.OutsideEnd; + if (dl._typeInitialized) + dlri.Type = dl._type; + else + { + if (cri._chart._type == ChartType.Pie2D || cri._chart._type == ChartType.PieExploded2D) + dlri.Type = DataLabelType.Percent; + else + dlri.Type = DataLabelType.Value; + } + } + + sri._dataLabelRendererInfo = dlri; + } + } + + return null; + } + + /// + /// Calculates the specific positions for each data label. + /// + internal abstract void CalcPositions(); + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/Charting.Renderers/GridlinesRenderer.cs b/PdfSharp.Charting/Charting.Renderers/GridlinesRenderer.cs new file mode 100644 index 0000000..4b6ca62 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/GridlinesRenderer.cs @@ -0,0 +1,44 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Base class for all renderers used to draw gridlines. + /// + internal abstract class GridlinesRenderer : Renderer + { + /// + /// Initializes a new instance of the GridlinesRenderer class with the specified renderer parameters. + /// + internal GridlinesRenderer(RendererParameters parms) + : base(parms) + { } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/HorizontalStackedYAxisRenderer.cs b/PdfSharp.Charting/Charting.Renderers/HorizontalStackedYAxisRenderer.cs new file mode 100644 index 0000000..0183df7 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/HorizontalStackedYAxisRenderer.cs @@ -0,0 +1,84 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a Y axis renderer used for charts of type BarStacked2D. + /// + internal class HorizontalStackedYAxisRenderer : HorizontalYAxisRenderer + { + /// + /// Initializes a new instance of the HorizontalStackedYAxisRenderer class with the + /// specified renderer parameters. + /// + internal HorizontalStackedYAxisRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Determines the sum of the smallest and the largest stacked bar + /// from all series of the chart. + /// + protected override void CalcYAxis(out double yMin, out double yMax) + { + yMin = double.MaxValue; + yMax = double.MinValue; + + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + int maxPoints = 0; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + maxPoints = Math.Max(maxPoints, sri._series._seriesElements.Count); + + for (int pointIdx = 0; pointIdx < maxPoints; ++pointIdx) + { + double valueSumPos = 0, valueSumNeg = 0; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + if (sri._pointRendererInfos.Length <= pointIdx) + break; + + ColumnRendererInfo column = (ColumnRendererInfo)sri._pointRendererInfos[pointIdx]; + if (column.Point != null && !double.IsNaN(column.Point._value)) + { + if (column.Point._value < 0) + valueSumNeg += column.Point._value; + else + valueSumPos += column.Point._value; + } + } + yMin = Math.Min(valueSumNeg, yMin); + yMax = Math.Max(valueSumPos, yMax); + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/HorizontalXAxisRenderer.cs b/PdfSharp.Charting/Charting.Renderers/HorizontalXAxisRenderer.cs new file mode 100644 index 0000000..03d1ccf --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/HorizontalXAxisRenderer.cs @@ -0,0 +1,314 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents an axis renderer used for charts of type Column2D or Line. + /// + internal class HorizontalXAxisRenderer : XAxisRenderer + { + /// + /// Initializes a new instance of the HorizontalXAxisRenderer class with the specified renderer parameters. + /// + internal HorizontalXAxisRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Returns an initialized rendererInfo based on the X axis. + /// + internal override RendererInfo Init() + { + Chart chart = (Chart)_rendererParms.DrawingItem; + + AxisRendererInfo xari = new AxisRendererInfo(); + xari._axis = chart._xAxis; + if (xari._axis != null) + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + CalculateXAxisValues(xari); + InitTickLabels(xari, cri.DefaultFont); + InitXValues(xari); + InitAxisTitle(xari, cri.DefaultFont); + InitAxisLineFormat(xari); + InitGridlines(xari); + } + return xari; + } + + /// + /// Calculates the space used for the X axis. + /// + internal override void Format() + { + AxisRendererInfo xari = ((ChartRendererInfo)_rendererParms.RendererInfo).xAxisRendererInfo; + if (xari._axis != null) + { + AxisTitleRendererInfo atri = xari._axisTitleRendererInfo; + + // Calculate space used for axis title. + XSize titleSize = new XSize(0, 0); + if (atri != null && atri.AxisTitleText != null && atri.AxisTitleText.Length > 0) + { + titleSize = _rendererParms.Graphics.MeasureString(atri.AxisTitleText, atri.AxisTitleFont); + atri.AxisTitleSize = titleSize; + } + + // Calculate space used for tick labels. + XSize size = new XSize(0, 0); + if (xari.XValues.Count > 0) + { + XSeries xs = xari.XValues[0]; + foreach (XValue xv in xs) + { + if (xv != null) + { + string tickLabel = xv._value; + XSize valueSize = _rendererParms.Graphics.MeasureString(tickLabel, xari.TickLabelsFont); + size.Height = Math.Max(valueSize.Height, size.Height); + size.Width += valueSize.Width; + } + } + } + + // Remember space for later drawing. + xari.TickLabelsHeight = size.Height; + xari.Height = titleSize.Height + size.Height + xari.MajorTickMarkWidth; + xari.Width = Math.Max(titleSize.Width, size.Width); + } + } + + /// + /// Draws the horizontal X axis. + /// + internal override void Draw() + { + XGraphics gfx = _rendererParms.Graphics; + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + AxisRendererInfo xari = cri.xAxisRendererInfo; + + double xMin = xari.MinimumScale; + double xMax = xari.MaximumScale; + double xMajorTick = xari.MajorTick; + double xMinorTick = xari.MinorTick; + double xMaxExtension = xari.MajorTick; + + // Draw tick labels. Each tick label will be aligned centered. + int countTickLabels = (int)xMax; + double tickLabelStep = xari.Width; + if (countTickLabels != 0) + tickLabelStep = xari.Width / countTickLabels; + + //XPoint startPos = new XPoint(xari.X + tickLabelStep / 2, xari.Y + /*xari.TickLabelsHeight +*/ xari.MajorTickMarkWidth); + XPoint startPos = new XPoint(xari.X + tickLabelStep / 2, xari.Y + xari.TickLabelsHeight); + if (xari.MajorTickMark != TickMarkType.None) + startPos.Y += xari.MajorTickMarkWidth; + foreach (XSeries xs in xari.XValues) + { + for (int idx = 0; idx < countTickLabels && idx < xs.Count; ++idx) + { + XValue xv = xs[idx]; + if (xv != null) + { + string tickLabel = xv._value; + XSize size = gfx.MeasureString(tickLabel, xari.TickLabelsFont); + gfx.DrawString(tickLabel, xari.TickLabelsFont, xari.TickLabelsBrush, startPos.X - size.Width / 2, startPos.Y); + } + startPos.X += tickLabelStep; + } + } + + // Draw axis. + // First draw tick marks, second draw axis. + double majorTickMarkStart = 0, majorTickMarkEnd = 0, + minorTickMarkStart = 0, minorTickMarkEnd = 0; + GetTickMarkPos(xari, ref majorTickMarkStart, ref majorTickMarkEnd, ref minorTickMarkStart, ref minorTickMarkEnd); + + LineFormatRenderer lineFormatRenderer = new LineFormatRenderer(gfx, xari.LineFormat); + XPoint[] points = new XPoint[2]; + + // Minor ticks. + if (xari.MinorTickMark != TickMarkType.None) + { + int countMinorTickMarks = (int)(xMax / xMinorTick); + double minorTickMarkStep = xari.Width / countMinorTickMarks; + startPos.X = xari.X; + for (int x = 0; x <= countMinorTickMarks; x++) + { + points[0].X = startPos.X + minorTickMarkStep * x; + points[0].Y = minorTickMarkStart; + points[1].X = points[0].X; + points[1].Y = minorTickMarkEnd; + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + + // Major ticks. + if (xari.MajorTickMark != TickMarkType.None) + { + int countMajorTickMarks = (int)(xMax / xMajorTick); + double majorTickMarkStep = xari.Width; + if (countMajorTickMarks != 0) + majorTickMarkStep = xari.Width / countMajorTickMarks; + startPos.X = xari.X; + for (int x = 0; x <= countMajorTickMarks; x++) + { + points[0].X = startPos.X + majorTickMarkStep * x; + points[0].Y = majorTickMarkStart; + points[1].X = points[0].X; + points[1].Y = majorTickMarkEnd; + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + + // Axis. + if (xari.LineFormat != null) + { + points[0].X = xari.X; + points[0].Y = xari.Y; + points[1].X = xari.X + xari.Width; + points[1].Y = xari.Y; + if (xari.MajorTickMark != TickMarkType.None) + { + points[0].X -= xari.LineFormat.Width / 2; + points[1].X += xari.LineFormat.Width / 2; + } + lineFormatRenderer.DrawLine(points[0], points[1]); + } + + // Draw axis title. + AxisTitleRendererInfo atri = xari._axisTitleRendererInfo; + if (atri != null && atri.AxisTitleText != null && atri.AxisTitleText.Length > 0) + { + XRect rect = new XRect(xari.Rect.Right / 2 - atri.AxisTitleSize.Width / 2, xari.Rect.Bottom, + atri.AxisTitleSize.Width, 0); + gfx.DrawString(atri.AxisTitleText, atri.AxisTitleFont, atri.AxisTitleBrush, rect); + } + } + + /// + /// Calculates the X axis describing values like minimum/maximum scale, major/minor tick and + /// major/minor tick mark width. + /// + private void CalculateXAxisValues(AxisRendererInfo rendererInfo) + { + // Calculates the maximum number of data points over all series. + SeriesCollection seriesCollection = ((Chart)rendererInfo._axis._parent)._seriesCollection; + int count = 0; + foreach (Series series in seriesCollection) + count = Math.Max(count, series.Count); + + rendererInfo.MinimumScale = 0; + rendererInfo.MaximumScale = count; // At least 0 + rendererInfo.MajorTick = 1; + rendererInfo.MinorTick = 0.5; + rendererInfo.MajorTickMarkWidth = DefaultMajorTickMarkWidth; + rendererInfo.MinorTickMarkWidth = DefaultMinorTickMarkWidth; + } + + /// + /// Initializes the rendererInfo's xvalues. If not set by the user xvalues will be simply numbers + /// from minimum scale + 1 to maximum scale. + /// + private void InitXValues(AxisRendererInfo rendererInfo) + { + rendererInfo.XValues = ((Chart)rendererInfo._axis._parent)._xValues; + if (rendererInfo.XValues == null) + { + rendererInfo.XValues = new XValues(); + XSeries xs = rendererInfo.XValues.AddXSeries(); + for (double i = rendererInfo.MinimumScale + 1; i <= rendererInfo.MaximumScale; ++i) + xs.Add(i.ToString(rendererInfo.TickLabelsFormat)); + } + } + + /// + /// Calculates the starting and ending y position for the minor and major tick marks. + /// + private void GetTickMarkPos(AxisRendererInfo rendererInfo, + ref double majorTickMarkStart, ref double majorTickMarkEnd, + ref double minorTickMarkStart, ref double minorTickMarkEnd) + { + double majorTickMarkWidth = rendererInfo.MajorTickMarkWidth; + double minorTickMarkWidth = rendererInfo.MinorTickMarkWidth; + XRect rect = rendererInfo.Rect; + + switch (rendererInfo.MajorTickMark) + { + case TickMarkType.Inside: + majorTickMarkStart = rect.Y; + majorTickMarkEnd = rect.Y - majorTickMarkWidth; + break; + + case TickMarkType.Outside: + majorTickMarkStart = rect.Y; + majorTickMarkEnd = rect.Y + majorTickMarkWidth; + break; + + case TickMarkType.Cross: + majorTickMarkStart = rect.Y + majorTickMarkWidth; + majorTickMarkEnd = rect.Y - majorTickMarkWidth; + break; + + case TickMarkType.None: + majorTickMarkStart = 0; + majorTickMarkEnd = 0; + break; + } + + switch (rendererInfo.MinorTickMark) + { + case TickMarkType.Inside: + minorTickMarkStart = rect.Y; + minorTickMarkEnd = rect.Y - minorTickMarkWidth; + break; + + case TickMarkType.Outside: + minorTickMarkStart = rect.Y; + minorTickMarkEnd = rect.Y + minorTickMarkWidth; + break; + + case TickMarkType.Cross: + minorTickMarkStart = rect.Y + minorTickMarkWidth; + minorTickMarkEnd = rect.Y - minorTickMarkWidth; + break; + + case TickMarkType.None: + minorTickMarkStart = 0; + minorTickMarkEnd = 0; + break; + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/HorizontalYAxisRenderer.cs b/PdfSharp.Charting/Charting.Renderers/HorizontalYAxisRenderer.cs new file mode 100644 index 0000000..ec5c131 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/HorizontalYAxisRenderer.cs @@ -0,0 +1,315 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a Y axis renderer used for charts of type Bar2D. + /// + internal class HorizontalYAxisRenderer : YAxisRenderer + { + /// + /// Initializes a new instance of the HorizontalYAxisRenderer class with the + /// specified renderer parameters. + /// + internal HorizontalYAxisRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Returns a initialized rendererInfo based on the Y axis. + /// + internal override RendererInfo Init() + { + Chart chart = (Chart)_rendererParms.DrawingItem; + XGraphics gfx = _rendererParms.Graphics; + + AxisRendererInfo yari = new AxisRendererInfo(); + yari._axis = chart._yAxis; + InitScale(yari); + if (yari._axis != null) + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + InitTickLabels(yari, cri.DefaultFont); + InitAxisTitle(yari, cri.DefaultFont); + InitAxisLineFormat(yari); + InitGridlines(yari); + } + return yari; + } + + /// + /// Calculates the space used for the Y axis. + /// + internal override void Format() + { + AxisRendererInfo yari = ((ChartRendererInfo)_rendererParms.RendererInfo).yAxisRendererInfo; + if (yari._axis != null) + { + XGraphics gfx = _rendererParms.Graphics; + + XSize size = new XSize(0, 0); + + // height of all ticklabels + double yMin = yari.MinimumScale; + double yMax = yari.MaximumScale; + double yMajorTick = yari.MajorTick; + double lineHeight = Double.MinValue; + XSize labelSize = new XSize(0, 0); + for (double y = yMin; y <= yMax; y += yMajorTick) + { + string str = y.ToString(yari.TickLabelsFormat); + labelSize = gfx.MeasureString(str, yari.TickLabelsFont); + size.Width += labelSize.Width; + size.Height = Math.Max(labelSize.Height, size.Height); + lineHeight = Math.Max(lineHeight, labelSize.Width); + } + + // add space for tickmarks + size.Height += yari.MajorTickMarkWidth * 1.5; + + // Measure axis title + XSize titleSize = new XSize(0, 0); + if (yari._axisTitleRendererInfo != null) + { + RendererParameters parms = new RendererParameters(); + parms.Graphics = gfx; + parms.RendererInfo = yari; + AxisTitleRenderer atr = new AxisTitleRenderer(parms); + atr.Format(); + titleSize.Height = yari._axisTitleRendererInfo.Height; + titleSize.Width = yari._axisTitleRendererInfo.Width; + } + + yari.Height = size.Height + titleSize.Height; + yari.Width = Math.Max(size.Width, titleSize.Width); + + yari.InnerRect = yari.Rect; + yari.LabelSize = labelSize; + } + } + + /// + /// Draws the vertical Y axis. + /// + internal override void Draw() + { + AxisRendererInfo yari = ((ChartRendererInfo)_rendererParms.RendererInfo).yAxisRendererInfo; + + double yMin = yari.MinimumScale; + double yMax = yari.MaximumScale; + double yMajorTick = yari.MajorTick; + double yMinorTick = yari.MinorTick; + + XMatrix matrix = new XMatrix(); + matrix.TranslatePrepend(-yMin, -yari.Y); + matrix.Scale(yari.InnerRect.Width / (yMax - yMin), 1, XMatrixOrder.Append); + matrix.Translate(yari.X, yari.Y, XMatrixOrder.Append); + + // Draw axis. + // First draw tick marks, second draw axis. + double majorTickMarkStart = 0, majorTickMarkEnd = 0, + minorTickMarkStart = 0, minorTickMarkEnd = 0; + GetTickMarkPos(yari, ref majorTickMarkStart, ref majorTickMarkEnd, ref minorTickMarkStart, ref minorTickMarkEnd); + + XGraphics gfx = _rendererParms.Graphics; + LineFormatRenderer lineFormatRenderer = new LineFormatRenderer(gfx, yari.LineFormat); + XPoint[] points = new XPoint[2]; + if (yari.MinorTickMark != TickMarkType.None) + { + for (double y = yMin + yMinorTick; y < yMax; y += yMinorTick) + { + points[0].X = y; + points[0].Y = minorTickMarkStart; + points[1].X = y; + points[1].Y = minorTickMarkEnd; + matrix.TransformPoints(points); + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + + XStringFormat xsf = new XStringFormat(); + xsf.LineAlignment = XLineAlignment.Near; + int countTickLabels = (int)((yMax - yMin) / yMajorTick) + 1; + for (int i = 0; i < countTickLabels; ++i) + { + double y = yMin + yMajorTick * i; + string str = y.ToString(yari.TickLabelsFormat); + + XSize labelSize = gfx.MeasureString(str, yari.TickLabelsFont); + if (yari.MajorTickMark != TickMarkType.None) + { + labelSize.Height += 1.5f * yari.MajorTickMarkWidth; + points[0].X = y; + points[0].Y = majorTickMarkStart; + points[1].X = y; + points[1].Y = majorTickMarkEnd; + matrix.TransformPoints(points); + lineFormatRenderer.DrawLine(points[0], points[1]); + } + + XPoint[] layoutText = new XPoint[1]; + layoutText[0].X = y; + layoutText[0].Y = yari.Y + 1.5 * yari.MajorTickMarkWidth; + matrix.TransformPoints(layoutText); + layoutText[0].X -= labelSize.Width / 2; // Center text vertically. + gfx.DrawString(str, yari.TickLabelsFont, yari.TickLabelsBrush, layoutText[0], xsf); + } + + if (yari.LineFormat != null) + { + points[0].X = yMin; + points[0].Y = yari.Y; + points[1].X = yMax; + points[1].Y = yari.Y; + matrix.TransformPoints(points); + if (yari.MajorTickMark != TickMarkType.None) + { + // yMax is at the upper side of the axis + points[0].X -= yari.LineFormat.Width / 2; + points[1].X += yari.LineFormat.Width / 2; + } + lineFormatRenderer.DrawLine(points[0], points[1]); + } + + // Draw axis title + if (yari._axisTitleRendererInfo != null) + { + RendererParameters parms = new RendererParameters(); + parms.Graphics = gfx; + parms.RendererInfo = yari; + XRect rcTitle = yari.Rect; + rcTitle.Height = yari._axisTitleRendererInfo.Height; + rcTitle.Y += yari.Rect.Height - rcTitle.Height; + yari._axisTitleRendererInfo.Rect = rcTitle; + AxisTitleRenderer atr = new AxisTitleRenderer(parms); + atr.Draw(); + } + } + + /// + /// Calculates all values necessary for scaling the axis like minimum/maximum scale or + /// minor/major tick. + /// + private void InitScale(AxisRendererInfo rendererInfo) + { + double yMin, yMax; + CalcYAxis(out yMin, out yMax); + FineTuneYAxis(rendererInfo, yMin, yMax); + + rendererInfo.MajorTickMarkWidth = DefaultMajorTickMarkWidth; + rendererInfo.MinorTickMarkWidth = DefaultMinorTickMarkWidth; + } + + /// + /// Gets the top and bottom position of the major and minor tick marks depending on the + /// tick mark type. + /// + private void GetTickMarkPos(AxisRendererInfo rendererInfo, + ref double majorTickMarkStart, ref double majorTickMarkEnd, + ref double minorTickMarkStart, ref double minorTickMarkEnd) + { + double majorTickMarkWidth = rendererInfo.MajorTickMarkWidth; + double minorTickMarkWidth = rendererInfo.MinorTickMarkWidth; + double y = rendererInfo.Rect.Y; + + switch (rendererInfo.MajorTickMark) + { + case TickMarkType.Inside: + majorTickMarkStart = y - majorTickMarkWidth; + majorTickMarkEnd = y; + break; + + case TickMarkType.Outside: + majorTickMarkStart = y; + majorTickMarkEnd = y + majorTickMarkWidth; + break; + + case TickMarkType.Cross: + majorTickMarkStart = y - majorTickMarkWidth; + majorTickMarkEnd = y + majorTickMarkWidth; + break; + + //TickMarkType.None: + default: + majorTickMarkStart = 0; + majorTickMarkEnd = 0; + break; + } + + switch (rendererInfo.MinorTickMark) + { + case TickMarkType.Inside: + minorTickMarkStart = y - minorTickMarkWidth; + minorTickMarkEnd = y; + break; + + case TickMarkType.Outside: + minorTickMarkStart = y; + minorTickMarkEnd = y + minorTickMarkWidth; + break; + + case TickMarkType.Cross: + minorTickMarkStart = y - minorTickMarkWidth; + minorTickMarkEnd = y + minorTickMarkWidth; + break; + + //TickMarkType.None: + default: + minorTickMarkStart = 0; + minorTickMarkEnd = 0; + break; + } + } + + /// + /// Determines the smallest and the largest number from all series of the chart. + /// + protected virtual void CalcYAxis(out double yMin, out double yMax) + { + yMin = double.MaxValue; + yMax = double.MinValue; + + foreach (Series series in ((Chart)_rendererParms.DrawingItem).SeriesCollection) + { + foreach (Point point in series.Elements) + { + if (!double.IsNaN(point._value)) + { + yMin = Math.Min(yMin, point.Value); + yMax = Math.Max(yMax, point.Value); + } + } + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/LegendEntryRenderer.cs b/PdfSharp.Charting/Charting.Renderers/LegendEntryRenderer.cs new file mode 100644 index 0000000..bfdf42a --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/LegendEntryRenderer.cs @@ -0,0 +1,144 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the renderer for a legend entry. + /// + internal class LegendEntryRenderer : Renderer + { + /// + /// Initializes a new instance of the LegendEntryRenderer class with the specified renderer + /// parameters. + /// + internal LegendEntryRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculates the space used by the legend entry. + /// + internal override void Format() + { + XGraphics gfx = _rendererParms.Graphics; + LegendEntryRendererInfo leri = (LegendEntryRendererInfo)_rendererParms.RendererInfo; + + // Initialize + leri.MarkerArea.Width = MaxLegendMarkerWidth; + leri.MarkerArea.Height = MaxLegendMarkerHeight; + leri.MarkerSize = new XSize(); + leri.MarkerSize.Width = leri.MarkerArea.Width; + leri.MarkerSize.Height = leri.MarkerArea.Height; + if (leri._seriesRendererInfo._series._chartType == ChartType.Line) + leri.MarkerArea.Width *= 3; + leri.Width = leri.MarkerArea.Width; + leri.Height = leri.MarkerArea.Height; + + if (leri.EntryText != "") + { + leri.TextSize = gfx.MeasureString(leri.EntryText, leri._legendRendererInfo.Font); + if (leri._seriesRendererInfo._series._chartType == ChartType.Line) + { + leri.MarkerSize.Width = leri._seriesRendererInfo._markerRendererInfo.MarkerSize.Value; + leri.MarkerArea.Width = Math.Max(3 * leri.MarkerSize.Width, leri.MarkerArea.Width); + } + + leri.MarkerArea.Height = Math.Min(leri.MarkerArea.Height, leri.TextSize.Height); + leri.MarkerSize.Height = Math.Min(leri.MarkerSize.Height, leri.TextSize.Height); + leri.Width = leri.TextSize.Width + leri.MarkerArea.Width + SpacingBetweenMarkerAndText; + leri.Height = leri.TextSize.Height; + } + } + + /// + /// Draws one legend entry. + /// + internal override void Draw() + { + XGraphics gfx = _rendererParms.Graphics; + LegendEntryRendererInfo leri = (LegendEntryRendererInfo)_rendererParms.RendererInfo; + + XRect rect; + if (leri._seriesRendererInfo._series._chartType == ChartType.Line) + { + // Draw line. + XPoint posLineStart = new XPoint(leri.X, leri.Y + leri.Height / 2); + XPoint posLineEnd = new XPoint(leri.X + leri.MarkerArea.Width, leri.Y + leri.Height / 2); + gfx.DrawLine(new XPen(((XSolidBrush)leri.MarkerBrush).Color), posLineStart, posLineEnd); + + // Draw marker. + double x = leri.X + leri.MarkerArea.Width / 2; + XPoint posMarker = new XPoint(x, leri.Y + leri.Height / 2); + MarkerRenderer.Draw(gfx, posMarker, leri._seriesRendererInfo._markerRendererInfo); + } + else + { + // Draw series rectangle for column, bar or pie charts. + rect = new XRect(leri.X, leri.Y, leri.MarkerArea.Width, leri.MarkerArea.Height); + rect.Y += (leri.Height - leri.MarkerArea.Height) / 2; + gfx.DrawRectangle(leri.MarkerPen, leri.MarkerBrush, rect); + } + + // Draw text + if (leri.EntryText.Length > 0) + { + rect = leri.Rect; + rect.X += leri.MarkerArea.Width + LegendEntryRenderer.SpacingBetweenMarkerAndText; + XStringFormat format = new XStringFormat(); + format.LineAlignment = XLineAlignment.Near; + gfx.DrawString(leri.EntryText, leri._legendRendererInfo.Font, + leri._legendRendererInfo.FontColor, rect, format); + } + } + + /// + /// Absolute width for markers (including line) in point. + /// + private const double MarkerWidth = 4.3; // 1.5 mm + + /// + /// Maximum legend marker width in point. + /// + private const double MaxLegendMarkerWidth = 7; // 2.5 mm + + /// + /// Maximum legend marker height in point. + /// + private const double MaxLegendMarkerHeight = 7; // 2.5 mm + + /// + /// Insert spacing between marker and text in point. + /// + private const double SpacingBetweenMarkerAndText = 4.3; // 1.5 mm + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/LegendRenderer.cs b/PdfSharp.Charting/Charting.Renderers/LegendRenderer.cs new file mode 100644 index 0000000..e4bc6c3 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/LegendRenderer.cs @@ -0,0 +1,179 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the legend renderer for all chart types. + /// + internal abstract class LegendRenderer : Renderer + { + /// + /// Initializes a new instance of the LegendRenderer class with the specified renderer parameters. + /// + internal LegendRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Layouts and calculates the space used by the legend. + /// + internal override void Format() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + LegendRendererInfo lri = cri.legendRendererInfo; + if (lri == null) + return; + + RendererParameters parms = new RendererParameters(); + parms.Graphics = _rendererParms.Graphics; + + bool verticalLegend = (lri._legend._docking == DockingType.Left || lri._legend._docking == DockingType.Right); + XSize maxMarkerArea = new XSize(); + LegendEntryRenderer ler = new LegendEntryRenderer(parms); + foreach (LegendEntryRendererInfo leri in lri.Entries) + { + parms.RendererInfo = leri; + ler.Format(); + + maxMarkerArea.Width = Math.Max(leri.MarkerArea.Width, maxMarkerArea.Width); + maxMarkerArea.Height = Math.Max(leri.MarkerArea.Height, maxMarkerArea.Height); + + if (verticalLegend) + { + lri.Width = Math.Max(lri.Width, leri.Width); + lri.Height += leri.Height; + } + else + { + lri.Width += leri.Width; + lri.Height = Math.Max(lri.Height, leri.Height); + } + } + + // Add padding to left, right, top and bottom + int paddingFactor = 1; + if (lri.BorderPen != null) + paddingFactor = 2; + lri.Width += (LegendRenderer.LeftPadding + LegendRenderer.RightPadding) * paddingFactor; + lri.Height += (LegendRenderer.TopPadding + LegendRenderer.BottomPadding) * paddingFactor; + if (verticalLegend) + lri.Height += LegendRenderer.EntrySpacing * (lri.Entries.Length - 1); + else + lri.Width += LegendRenderer.EntrySpacing * (lri.Entries.Length - 1); + + foreach (LegendEntryRendererInfo leri in lri.Entries) + leri.MarkerArea = maxMarkerArea; + } + + /// + /// Draws the legend. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + LegendRendererInfo lri = cri.legendRendererInfo; + if (lri == null) + return; + + XGraphics gfx = _rendererParms.Graphics; + RendererParameters parms = new RendererParameters(); + parms.Graphics = gfx; + + LegendEntryRenderer ler = new LegendEntryRenderer(parms); + + bool verticalLegend = (lri._legend._docking == DockingType.Left || lri._legend._docking == DockingType.Right); + int paddingFactor = 1; + if (lri.BorderPen != null) + paddingFactor = 2; + XRect legendRect = lri.Rect; + legendRect.X += LegendRenderer.LeftPadding * paddingFactor; + legendRect.Y += LegendRenderer.TopPadding * paddingFactor; + foreach (LegendEntryRendererInfo leri in cri.legendRendererInfo.Entries) + { + XRect entryRect = legendRect; + entryRect.Width = leri.Width; + entryRect.Height = leri.Height; + + leri.Rect = entryRect; + parms.RendererInfo = leri; + ler.Draw(); + + if (verticalLegend) + legendRect.Y += entryRect.Height + LegendRenderer.EntrySpacing; + else + legendRect.X += entryRect.Width + LegendRenderer.EntrySpacing; + } + + // Draw border around legend + if (lri.BorderPen != null) + { + XRect borderRect = lri.Rect; + borderRect.X += LegendRenderer.LeftPadding; + borderRect.Y += LegendRenderer.TopPadding; + borderRect.Width -= LegendRenderer.LeftPadding + LegendRenderer.RightPadding; + borderRect.Height -= LegendRenderer.TopPadding + LegendRenderer.BottomPadding; + gfx.DrawRectangle(lri.BorderPen, borderRect); + } + } + + /// + /// Used to insert a padding on the left. + /// + protected const double LeftPadding = 6; + + /// + /// Used to insert a padding on the right. + /// + protected const double RightPadding = 6; + + /// + /// Used to insert a padding at the top. + /// + protected const double TopPadding = 6; + + /// + /// Used to insert a padding at the bottom. + /// + protected const double BottomPadding = 6; + + /// + /// Used to insert a padding between entries. + /// + protected const double EntrySpacing = 5; + + /// + /// Default line width used for the legend's border. + /// + protected const double DefaultLineWidth = 0.14; // 0.05 mm + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/LineChartRenderer.cs b/PdfSharp.Charting/Charting.Renderers/LineChartRenderer.cs new file mode 100644 index 0000000..4687897 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/LineChartRenderer.cs @@ -0,0 +1,196 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a line chart renderer. + /// + internal class LineChartRenderer : ColumnLikeChartRenderer + { + /// + /// Initializes a new instance of the LineChartRenderer class with the specified renderer parameters. + /// + internal LineChartRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Returns an initialized and renderer specific rendererInfo. + /// + internal override RendererInfo Init() + { + ChartRendererInfo cri = new ChartRendererInfo(); + cri._chart = (Chart)_rendererParms.DrawingItem; + _rendererParms.RendererInfo = cri; + + InitSeriesRendererInfo(); + + LegendRenderer lr = new ColumnLikeLegendRenderer(_rendererParms); + cri.legendRendererInfo = (LegendRendererInfo)lr.Init(); + + AxisRenderer xar = new HorizontalXAxisRenderer(_rendererParms); + cri.xAxisRendererInfo = (AxisRendererInfo)xar.Init(); + + AxisRenderer yar = new VerticalYAxisRenderer(_rendererParms); + cri.yAxisRendererInfo = (AxisRendererInfo)yar.Init(); + + PlotArea plotArea = cri._chart.PlotArea; + LinePlotAreaRenderer lpar = new LinePlotAreaRenderer(_rendererParms); + cri.plotAreaRendererInfo = (PlotAreaRendererInfo)lpar.Init(); + + return cri; + } + + /// + /// Layouts and calculates the space used by the line chart. + /// + internal override void Format() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + LegendRenderer lr = new ColumnLikeLegendRenderer(_rendererParms); + lr.Format(); + + // axes + AxisRenderer xar = new HorizontalXAxisRenderer(_rendererParms); + xar.Format(); + + AxisRenderer yar = new VerticalYAxisRenderer(_rendererParms); + yar.Format(); + + // Calculate rects and positions. + CalcLayout(); + + // Calculated remaining plot area, now it's safe to format. + LinePlotAreaRenderer lpar = new LinePlotAreaRenderer(_rendererParms); + lpar.Format(); + } + + /// + /// Draws the line chart. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + LegendRenderer lr = new ColumnLikeLegendRenderer(_rendererParms); + lr.Draw(); + + // Draw wall. + WallRenderer wr = new WallRenderer(_rendererParms); + wr.Draw(); + + // Draw gridlines. + GridlinesRenderer glr = new ColumnLikeGridlinesRenderer(_rendererParms); + glr.Draw(); + + PlotAreaBorderRenderer pabr = new PlotAreaBorderRenderer(_rendererParms); + pabr.Draw(); + + // Draw line chart's plot area. + LinePlotAreaRenderer lpar = new LinePlotAreaRenderer(_rendererParms); + lpar.Draw(); + + // Draw x- and y-axis. + if (cri.xAxisRendererInfo._axis != null) + { + AxisRenderer xar = new HorizontalXAxisRenderer(_rendererParms); + xar.Draw(); + } + + if (cri.yAxisRendererInfo._axis != null) + { + AxisRenderer yar = new VerticalYAxisRenderer(_rendererParms); + yar.Draw(); + } + } + + /// + /// Initializes all necessary data to draw a series for a line chart. + /// + private void InitSeriesRendererInfo() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + SeriesCollection seriesColl = cri._chart.SeriesCollection; + cri.seriesRendererInfos = new SeriesRendererInfo[seriesColl.Count]; + for (int idx = 0; idx < seriesColl.Count; ++idx) + { + SeriesRendererInfo sri = new SeriesRendererInfo(); + sri._series = seriesColl[idx]; + cri.seriesRendererInfos[idx] = sri; + } + InitSeries(); + } + + /// + /// Initializes all necessary data to draw a series for a line chart. + /// + internal void InitSeries() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + int seriesIndex = 0; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + if (sri._series._markerBackgroundColor.IsEmpty) + sri.LineFormat = Converter.ToXPen(sri._series._lineFormat, LineColors.Item(seriesIndex), ChartRenderer.DefaultSeriesLineWidth); + else + sri.LineFormat = Converter.ToXPen(sri._series._lineFormat, sri._series._markerBackgroundColor, ChartRenderer.DefaultSeriesLineWidth); + sri.LineFormat.LineJoin = XLineJoin.Bevel; + + MarkerRendererInfo mri = new MarkerRendererInfo(); + sri._markerRendererInfo = mri; + + mri.MarkerForegroundColor = sri._series._markerForegroundColor; + if (mri.MarkerForegroundColor.IsEmpty) + mri.MarkerForegroundColor = XColors.Black; + + mri.MarkerBackgroundColor = sri._series._markerBackgroundColor; + if (mri.MarkerBackgroundColor.IsEmpty) + mri.MarkerBackgroundColor = sri.LineFormat.Color; + + mri.MarkerSize = sri._series._markerSize; + if (mri.MarkerSize == 0) + mri.MarkerSize = 7; + + if (!sri._series._markerStyleInitialized) + //mri.MarkerStyle = (MarkerStyle)(seriesIndex % (Enum.GetNames(typeof(MarkerStyle)).Length - 1) + 1); + mri.MarkerStyle = (MarkerStyle)(seriesIndex % (10 - 1) + 1); + else + mri.MarkerStyle = sri._series._markerStyle; + + ++seriesIndex; + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/LineFormatRenderer.cs b/PdfSharp.Charting/Charting.Renderers/LineFormatRenderer.cs new file mode 100644 index 0000000..4be5616 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/LineFormatRenderer.cs @@ -0,0 +1,118 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a renderer specialized to draw lines in various styles, colors and widths. + /// + class LineFormatRenderer + { + /// + /// Initializes a new instance of the LineFormatRenderer class with the specified graphics, line format + /// and default width. + /// + public LineFormatRenderer(XGraphics gfx, LineFormat lineFormat, double defaultWidth) + { + _gfx = gfx; + bool visible = false; + double width = 0; + + if (lineFormat != null) + { + width = lineFormat._width; + if (width == 0 && !lineFormat.Color.IsEmpty) + width = defaultWidth; + visible = lineFormat.Visible || width > 0 || !lineFormat.Color.IsEmpty; + } + + if (visible) + { + _pen = new XPen(lineFormat.Color, width); + _pen.DashStyle = lineFormat.DashStyle; + } + } + + /// + /// Initializes a new instance of the LineFormatRenderer class with the specified graphics and + /// line format. + /// + public LineFormatRenderer(XGraphics gfx, LineFormat lineFormat) : + this(gfx, lineFormat, 0) + { } + + /// + /// Initializes a new instance of the LineFormatRenderer class with the specified graphics and pen. + /// + public LineFormatRenderer(XGraphics gfx, XPen pen) + { + _gfx = gfx; + _pen = pen; + } + + /// + /// Draws a line from point pt0 to point pt1. + /// + public void DrawLine(XPoint pt0, XPoint pt1) + { + if (_pen != null) + _gfx.DrawLine(_pen, pt0, pt1); + } + + /// + /// Draws a line specified by rect. + /// + public void DrawRectangle(XRect rect) + { + if (_pen != null) + _gfx.DrawRectangle(_pen, rect); + } + + /// + /// Draws a line specified by path. + /// + public void DrawPath(XGraphicsPath path) + { + if (_pen != null) + _gfx.DrawPath(_pen, path); + } + + /// + /// Surface to draw the line. + /// + readonly XGraphics _gfx; + + /// + /// Pen used to draw the line. + /// + readonly XPen _pen; + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/LinePlotAreaRenderer.cs b/PdfSharp.Charting/Charting.Renderers/LinePlotAreaRenderer.cs new file mode 100644 index 0000000..5a17b5b --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/LinePlotAreaRenderer.cs @@ -0,0 +1,99 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Renders the plot area used by line charts. + /// + internal class LinePlotAreaRenderer : ColumnLikePlotAreaRenderer + { + /// + /// Initializes a new instance of the LinePlotAreaRenderer class with the + /// specified renderer parameters. + /// + internal LinePlotAreaRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Draws the content of the line plot area. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + XRect plotAreaRect = cri.plotAreaRendererInfo.Rect; + if (plotAreaRect.IsEmpty) + return; + + XGraphics gfx = _rendererParms.Graphics; + XGraphicsState state = gfx.Save(); + //gfx.SetClip(plotAreaRect, XCombineMode.Intersect); + gfx.IntersectClip(plotAreaRect); + + //TODO Treat null values correctly. + // Points can be missing. Treat null values accordingly (NotPlotted, Interpolate etc.) + + // Draw lines and markers for each data series. + XMatrix matrix = cri.plotAreaRendererInfo._matrix; + + double xMajorTick = cri.xAxisRendererInfo.MajorTick; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + int count = sri._series.Elements.Count; + XPoint[] points = new XPoint[count]; + for (int idx = 0; idx < count; idx++) + { + double v = sri._series.Elements[idx].Value; + if (double.IsNaN(v)) + v = 0; + points[idx] = new XPoint(idx + xMajorTick / 2, v); + } + matrix.TransformPoints(points); + gfx.DrawLines(sri.LineFormat, points); + DrawMarker(gfx, points, sri); + } + + //gfx.ResetClip(); + gfx.Restore(state); + } + + /// + /// Draws all markers given in rendererInfo at the positions specified by points. + /// + void DrawMarker(XGraphics graphics, XPoint[] points, SeriesRendererInfo rendererInfo) + { + foreach (XPoint pos in points) + MarkerRenderer.Draw(graphics, pos, rendererInfo._markerRendererInfo); + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/MarkerRenderer.cs b/PdfSharp.Charting/Charting.Renderers/MarkerRenderer.cs new file mode 100644 index 0000000..ca083c2 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/MarkerRenderer.cs @@ -0,0 +1,189 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a renderer for markers in line charts and legends. + /// + internal class MarkerRenderer + { + /// + /// Draws the marker given through rendererInfo at the specified position. Position specifies + /// the center of the marker. + /// + internal static void Draw(XGraphics graphics, XPoint pos, MarkerRendererInfo rendererInfo) + { +#if SILVERLIGHT + return; // BUG: Code crashs Silverlight Path class. +#pragma warning disable 0162 +#endif + + if (rendererInfo.MarkerStyle == MarkerStyle.None) + return; + + double size = rendererInfo.MarkerSize; + double size2 = size / 2; + double x0, y0, x1, y1; + double g; + + XPen foreground = new XPen(rendererInfo.MarkerForegroundColor, 0.5); + XBrush background = new XSolidBrush(rendererInfo.MarkerBackgroundColor); + + XGraphicsPath gp = new XGraphicsPath(); + switch (rendererInfo.MarkerStyle) + { + case MarkerStyle.Square: + x0 = pos.X - size2; + y0 = pos.Y - size2; + x1 = pos.X + size2; + y1 = pos.Y + size2; + gp.AddLine(x0, y0, x1, y0); + gp.AddLine(x1, y0, x1, y1); + gp.AddLine(x1, y1, x0, y1); + gp.AddLine(x0, y1, x0, y0); + break; + + case MarkerStyle.Diamond: + gp.AddLine(x1 = pos.X + size2, pos.Y, pos.X, y0 = pos.Y - size2); + gp.AddLine(pos.X, y0, x0 = pos.X - size2, pos.Y); + gp.AddLine(x0, pos.Y, pos.X, y1 = pos.Y + size2); + gp.AddLine(pos.X, y1, x1, pos.Y); + break; + + case MarkerStyle.Triangle: + y0 = pos.Y + size / 2; + y1 = pos.Y - size / 2; + g = Math.Sqrt(size * size * 4 / 3) / 2; + gp.AddLine(pos.X, y1, pos.X + g, y0); + gp.AddLine(pos.X + g, y0, pos.X - g, y0); + gp.AddLine(pos.X - g, y0, pos.X, y1); + break; + + case MarkerStyle.Plus: + g = size2 / 4; + gp.AddLine(pos.X - size2, pos.Y + g, pos.X - g, pos.Y + g); + gp.AddLine(pos.X - g, pos.Y + g, pos.X - g, pos.Y + size2); + gp.AddLine(pos.X - g, pos.Y + size2, pos.X + g, pos.Y + size2); + gp.AddLine(pos.X + g, pos.Y + size2, pos.X + g, pos.Y + g); + gp.AddLine(pos.X + g, pos.Y + g, pos.X + size2, pos.Y + g); + gp.AddLine(pos.X + size2, pos.Y + g, pos.X + size2, pos.Y - g); + gp.AddLine(pos.X + size2, pos.Y - g, pos.X + g, pos.Y - g); + gp.AddLine(pos.X + g, pos.Y - g, pos.X + g, pos.Y - size2); + gp.AddLine(pos.X + g, pos.Y - size2, pos.X - g, pos.Y - size2); + gp.AddLine(pos.X - g, pos.Y - size2, pos.X - g, pos.Y - g); + gp.AddLine(pos.X - g, pos.Y - g, pos.X - size2, pos.Y - g); + gp.AddLine(pos.X - size2, pos.Y - g, pos.X - size2, pos.Y + g); + break; + + case MarkerStyle.Circle: + case MarkerStyle.Dot: + x0 = pos.X - size2; + y0 = pos.Y - size2; + gp.AddEllipse(x0, y0, size, size); + break; + + case MarkerStyle.Dash: + x0 = pos.X - size2; + y0 = pos.Y - size2 / 3; + x1 = pos.X + size2; + y1 = pos.Y + size2 / 3; + gp.AddLine(x0, y0, x1, y0); + gp.AddLine(x1, y0, x1, y1); + gp.AddLine(x1, y1, x0, y1); + gp.AddLine(x0, y1, x0, y0); + break; + + case MarkerStyle.X: + g = size / 4; + gp.AddLine(pos.X - size2 + g, pos.Y - size2, pos.X, pos.Y - g); + gp.AddLine(pos.X, pos.Y - g, pos.X + size2 - g, pos.Y - size2); + gp.AddLine(pos.X + size2 - g, pos.Y - size2, pos.X + size2, pos.Y - size2 + g); + gp.AddLine(pos.X + size2, pos.Y - size2 + g, pos.X + g, pos.Y); + gp.AddLine(pos.X + g, pos.Y, pos.X + size2, pos.Y + size2 - g); + gp.AddLine(pos.X + size2, pos.Y + size2 - g, pos.X + size2 - g, pos.Y + size2); + gp.AddLine(pos.X + size2 - g, pos.Y + size2, pos.X, pos.Y + g); + gp.AddLine(pos.X, pos.Y + g, pos.X - size2 + g, pos.Y + size2); + gp.AddLine(pos.X - size2 + g, pos.Y + size2, pos.X - size2, pos.Y + size2 - g); + gp.AddLine(pos.X - size2, pos.Y + size2 - g, pos.X - g, pos.Y); + gp.AddLine(pos.X - g, pos.Y, pos.X - size2, pos.Y - size2 + g); + break; + + case MarkerStyle.Star: + { + XPoint[] points = new XPoint[10]; + + double radStep = 2 * Math.PI / 5; + double outerCircle = size / 2; + double innerCircle = size / 5; + // outer circle + double rad = -(Math.PI / 2); // 90 + for (int idx = 0; idx < 10; idx += 2) + { + points[idx].X = pos.X + outerCircle * Math.Cos(rad); + points[idx].Y = pos.Y + outerCircle * Math.Sin(rad); + rad += radStep; + } + + // inner circle + rad = -(Math.PI / 4); // 45 + double x = innerCircle * Math.Cos(rad); + double y = innerCircle * Math.Sin(rad); + points[1].X = pos.X + x; + points[1].Y = pos.Y + y; + points[9].X = pos.X - x; + points[9].Y = pos.Y + y; + rad += radStep; + x = innerCircle * Math.Cos(rad); + y = innerCircle * Math.Sin(rad); + points[3].X = pos.X + x; + points[3].Y = pos.Y + y; + points[7].X = pos.X - x; + points[7].Y = pos.Y + y; + rad += radStep; + y = innerCircle * Math.Sin(rad); + points[5].X = pos.X; + points[5].Y = pos.Y + y; + gp.AddLines(points); + } + break; + } + + gp.CloseFigure(); + if (rendererInfo.MarkerStyle != MarkerStyle.Dot) + { + graphics.DrawPath(background, gp); + graphics.DrawPath(foreground, gp); + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/PieChartRenderer.cs b/PdfSharp.Charting/Charting.Renderers/PieChartRenderer.cs new file mode 100644 index 0000000..cb1dc94 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/PieChartRenderer.cs @@ -0,0 +1,177 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a pie chart renderer. + /// + internal class PieChartRenderer : ChartRenderer + { + /// + /// Initializes a new instance of the PieChartRenderer class with the + /// specified renderer parameters. + /// + internal PieChartRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Returns an initialized and renderer specific rendererInfo. + /// + internal override RendererInfo Init() + { + ChartRendererInfo cri = new ChartRendererInfo(); + cri._chart = (Chart)_rendererParms.DrawingItem; + _rendererParms.RendererInfo = cri; + + InitSeries(cri); + + LegendRenderer lr = new PieLegendRenderer(_rendererParms); + cri.legendRendererInfo = (LegendRendererInfo)lr.Init(); + + PlotArea plotArea = cri._chart.PlotArea; + PlotAreaRenderer renderer = GetPlotAreaRenderer(); + cri.plotAreaRendererInfo = (PlotAreaRendererInfo)renderer.Init(); + + DataLabelRenderer dlr = new PieDataLabelRenderer(_rendererParms); + dlr.Init(); + + return cri; + } + + /// + /// Layouts and calculates the space used by the pie chart. + /// + internal override void Format() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + LegendRenderer lr = new PieLegendRenderer(_rendererParms); + lr.Format(); + + // Calculate rects and positions. + XRect chartRect = LayoutLegend(); + cri.plotAreaRendererInfo.Rect = chartRect; + double edge = Math.Min(chartRect.Width, chartRect.Height); + cri.plotAreaRendererInfo.X += (chartRect.Width - edge) / 2; + cri.plotAreaRendererInfo.Y += (chartRect.Height - edge) / 2; + cri.plotAreaRendererInfo.Width = edge; + cri.plotAreaRendererInfo.Height = edge; + + DataLabelRenderer dlr = new PieDataLabelRenderer(_rendererParms); + dlr.Format(); + + // Calculated remaining plot area, now it's safe to format. + PlotAreaRenderer renderer = GetPlotAreaRenderer(); + renderer.Format(); + + dlr.CalcPositions(); + } + + /// + /// Draws the pie chart. + /// + internal override void Draw() + { + LegendRenderer lr = new PieLegendRenderer(_rendererParms); + lr.Draw(); + + WallRenderer wr = new WallRenderer(_rendererParms); + wr.Draw(); + + PlotAreaBorderRenderer pabr = new PlotAreaBorderRenderer(_rendererParms); + pabr.Draw(); + + PlotAreaRenderer renderer = GetPlotAreaRenderer(); + renderer.Draw(); + + DataLabelRenderer dlr = new PieDataLabelRenderer(_rendererParms); + dlr.Draw(); + } + + /// + /// Returns the specific plot area renderer. + /// + private PlotAreaRenderer GetPlotAreaRenderer() + { + Chart chart = (Chart)_rendererParms.DrawingItem; + switch (chart._type) + { + case ChartType.Pie2D: + return new PieClosedPlotAreaRenderer(_rendererParms); + + case ChartType.PieExploded2D: + return new PieExplodedPlotAreaRenderer(_rendererParms); + } + return null; + } + + /// + /// Initializes all necessary data to draw a series for a pie chart. + /// + protected void InitSeries(ChartRendererInfo rendererInfo) + { + SeriesCollection seriesColl = rendererInfo._chart.SeriesCollection; + rendererInfo.seriesRendererInfos = new SeriesRendererInfo[seriesColl.Count]; + for (int idx = 0; idx < seriesColl.Count; ++idx) + { + SeriesRendererInfo sri = new SeriesRendererInfo(); + rendererInfo.seriesRendererInfos[idx] = sri; + sri._series = seriesColl[idx]; + + sri.LineFormat = Converter.ToXPen(sri._series._lineFormat, XColors.Black, ChartRenderer.DefaultSeriesLineWidth); + sri.FillFormat = Converter.ToXBrush(sri._series._fillFormat, ColumnColors.Item(idx)); + + sri._pointRendererInfos = new SectorRendererInfo[sri._series._seriesElements.Count]; + for (int pointIdx = 0; pointIdx < sri._pointRendererInfos.Length; ++pointIdx) + { + PointRendererInfo pri = new SectorRendererInfo(); + Point point = sri._series._seriesElements[pointIdx]; + pri.Point = point; + if (point != null) + { + pri.LineFormat = sri.LineFormat; + if (point._lineFormat != null && !point._lineFormat._color.IsEmpty) + pri.LineFormat = new XPen(point._lineFormat._color); + if (point._fillFormat != null && !point._fillFormat._color.IsEmpty) + pri.FillFormat = new XSolidBrush(point._fillFormat._color); + else + pri.FillFormat = new XSolidBrush(PieColors.Item(pointIdx)); + pri.LineFormat.LineJoin = XLineJoin.Round; + } + sri._pointRendererInfos[pointIdx] = pri; + } + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/PieClosedPlotAreaRenderer.cs b/PdfSharp.Charting/Charting.Renderers/PieClosedPlotAreaRenderer.cs new file mode 100644 index 0000000..ac922ac --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/PieClosedPlotAreaRenderer.cs @@ -0,0 +1,103 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a closed pie plot area renderer. + /// + internal class PieClosedPlotAreaRenderer : PiePlotAreaRenderer + { + /// + /// Initializes a new instance of the PiePlotAreaRenderer class + /// with the specified renderer parameters. + /// + internal PieClosedPlotAreaRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculate angles for each sector. + /// + protected override void CalcSectors() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + if (cri.seriesRendererInfos.Length == 0) + return; + + SeriesRendererInfo sri = cri.seriesRendererInfos[0]; + + double sumValues = sri.SumOfPoints; + if (sumValues == 0) + return; + + double textMeasure = 0; + if (sri._dataLabelRendererInfo != null && sri._dataLabelRendererInfo.Position == DataLabelPosition.OutsideEnd) + { + foreach (DataLabelEntryRendererInfo dleri in sri._dataLabelRendererInfo.Entries) + { + textMeasure = Math.Max(textMeasure, dleri.Width); + textMeasure = Math.Max(textMeasure, dleri.Height); + } + } + + XRect pieRect = cri.plotAreaRendererInfo.Rect; + if (textMeasure != 0) + { + pieRect.X += textMeasure; + pieRect.Y += textMeasure; + pieRect.Width -= 2 * textMeasure; + pieRect.Height -= 2 * textMeasure; + } + + double startAngle = 270, sweepAngle = 0; + foreach (SectorRendererInfo sector in sri._pointRendererInfos) + { + if (!double.IsNaN(sector.Point._value) && sector.Point._value != 0) + { + sweepAngle = 360 / (sumValues / Math.Abs(sector.Point._value)); + + sector.Rect = pieRect; + sector.StartAngle = startAngle; + sector.SweepAngle = sweepAngle; + + startAngle += sweepAngle; + } + else + { + sector.StartAngle = double.NaN; + sector.SweepAngle = double.NaN; + } + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/PieDataLabelRenderer.cs b/PdfSharp.Charting/Charting.Renderers/PieDataLabelRenderer.cs new file mode 100644 index 0000000..02827bc --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/PieDataLabelRenderer.cs @@ -0,0 +1,182 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a data label renderer for pie charts. + /// + internal class PieDataLabelRenderer : DataLabelRenderer + { + /// + /// Initializes a new instance of the PieDataLabelRenderer class with the + /// specified renderer parameters. + /// + internal PieDataLabelRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculates the space used by the data labels. + /// + internal override void Format() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + if (cri.seriesRendererInfos.Length == 0) + return; + + SeriesRendererInfo sri = cri.seriesRendererInfos[0]; + if (sri._dataLabelRendererInfo == null) + return; + + double sumValues = sri.SumOfPoints; + XGraphics gfx = _rendererParms.Graphics; + + sri._dataLabelRendererInfo.Entries = new DataLabelEntryRendererInfo[sri._pointRendererInfos.Length]; + int index = 0; + foreach (SectorRendererInfo sector in sri._pointRendererInfos) + { + DataLabelEntryRendererInfo dleri = new DataLabelEntryRendererInfo(); + if (sri._dataLabelRendererInfo.Type != DataLabelType.None) + { + if (sri._dataLabelRendererInfo.Type == DataLabelType.Percent) + { + double percent = 100 / (sumValues / Math.Abs(sector.Point._value)); + dleri.Text = percent.ToString(sri._dataLabelRendererInfo.Format) + "%"; + } + else if (sri._dataLabelRendererInfo.Type == DataLabelType.Value) + dleri.Text = sector.Point._value.ToString(sri._dataLabelRendererInfo.Format); + + if (dleri.Text.Length > 0) + dleri.Size = gfx.MeasureString(dleri.Text, sri._dataLabelRendererInfo.Font); + } + + sri._dataLabelRendererInfo.Entries[index++] = dleri; + } + } + + /// + /// Draws the data labels of the pie chart. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + if (cri.seriesRendererInfos.Length == 0) + return; + + SeriesRendererInfo sri = cri.seriesRendererInfos[0]; + if (sri == null || sri._dataLabelRendererInfo == null) + return; + + XGraphics gfx = _rendererParms.Graphics; + XFont font = sri._dataLabelRendererInfo.Font; + XBrush fontColor = sri._dataLabelRendererInfo.FontColor; + XStringFormat format = XStringFormats.Center; + format.LineAlignment = XLineAlignment.Center; + foreach (DataLabelEntryRendererInfo dataLabel in sri._dataLabelRendererInfo.Entries) + { + if (dataLabel.Text != null) + gfx.DrawString(dataLabel.Text, font, fontColor, dataLabel.Rect, format); + } + } + + /// + /// Calculates the data label positions specific for pie charts. + /// + internal override void CalcPositions() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + XGraphics gfx = _rendererParms.Graphics; + + if (cri.seriesRendererInfos.Length > 0) + { + SeriesRendererInfo sri = cri.seriesRendererInfos[0]; + if (sri != null && sri._dataLabelRendererInfo != null) + { + int sectorIndex = 0; + foreach (SectorRendererInfo sector in sri._pointRendererInfos) + { + // Determine output rectangle + double midAngle = sector.StartAngle + sector.SweepAngle / 2; + double radMidAngle = midAngle / 180 * Math.PI; + XPoint origin = new XPoint(sector.Rect.X + sector.Rect.Width / 2, + sector.Rect.Y + sector.Rect.Height / 2); + double radius = sector.Rect.Width / 2; + double halfradius = radius / 2; + + DataLabelEntryRendererInfo dleri = sri._dataLabelRendererInfo.Entries[sectorIndex++]; + switch (sri._dataLabelRendererInfo.Position) + { + case DataLabelPosition.OutsideEnd: + // Outer border of the circle. + dleri.X = origin.X + (radius * Math.Cos(radMidAngle)); + dleri.Y = origin.Y + (radius * Math.Sin(radMidAngle)); + if (dleri.X < origin.X) + dleri.X -= dleri.Width; + if (dleri.Y < origin.Y) + dleri.Y -= dleri.Height; + break; + + case DataLabelPosition.InsideEnd: + // Inner border of the circle. + dleri.X = origin.X + (radius * Math.Cos(radMidAngle)); + dleri.Y = origin.Y + (radius * Math.Sin(radMidAngle)); + if (dleri.X > origin.X) + dleri.X -= dleri.Width; + if (dleri.Y > origin.Y) + dleri.Y -= dleri.Height; + break; + + case DataLabelPosition.Center: + // Centered + dleri.X = origin.X + (halfradius * Math.Cos(radMidAngle)); + dleri.Y = origin.Y + (halfradius * Math.Sin(radMidAngle)); + dleri.X -= dleri.Width / 2; + dleri.Y -= dleri.Height / 2; + break; + + case DataLabelPosition.InsideBase: + // Aligned at the base/center of the circle + dleri.X = origin.X; + dleri.Y = origin.Y; + if (dleri.X < origin.X) + dleri.X -= dleri.Width; + if (dleri.Y < origin.Y) + dleri.Y -= dleri.Height; + break; + } + } + } + } + } + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/Charting.Renderers/PieExplodedPlotAreaRenderer.cs b/PdfSharp.Charting/Charting.Renderers/PieExplodedPlotAreaRenderer.cs new file mode 100644 index 0000000..7907850 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/PieExplodedPlotAreaRenderer.cs @@ -0,0 +1,122 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a exploded pie plot area renderer. + /// + internal class PieExplodedPlotAreaRenderer : PiePlotAreaRenderer + { + /// + /// Initializes a new instance of the PieExplodedPlotAreaRenderer class + /// with the specified renderer parameters. + /// + internal PieExplodedPlotAreaRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculate angles for each sector. + /// + protected override void CalcSectors() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + if (cri.seriesRendererInfos.Length == 0) + return; + + SeriesRendererInfo sri = cri.seriesRendererInfos[0]; + + double sumValues = sri.SumOfPoints; + if (sumValues == 0) + return; + + double textMeasure = 0; + if (sri._dataLabelRendererInfo != null && sri._dataLabelRendererInfo.Position == DataLabelPosition.OutsideEnd) + { + foreach (DataLabelEntryRendererInfo dleri in sri._dataLabelRendererInfo.Entries) + { + textMeasure = Math.Max(textMeasure, dleri.Width); + textMeasure = Math.Max(textMeasure, dleri.Height); + } + } + + XRect pieRect = cri.plotAreaRendererInfo.Rect; + if (textMeasure != 0) + { + pieRect.X += textMeasure; + pieRect.Y += textMeasure; + pieRect.Width -= 2 * textMeasure; + pieRect.Height -= 2 * textMeasure; + } + + XPoint origin = new XPoint(pieRect.X + pieRect.Width / 2, pieRect.Y + pieRect.Height / 2); + XRect innerRect = new XRect(); + XPoint p1 = new XPoint(); + + double midAngle = 0, sectorStartAngle = 0, sectorSweepAngle = 0, + deltaAngle = 2, startAngle = 270, sweepAngle = 0, + rInnerCircle = pieRect.Width / 15, + rOuterCircle = pieRect.Width / 2; + + foreach (SectorRendererInfo sector in sri._pointRendererInfos) + { + if (!double.IsNaN(sector.Point._value) && sector.Point._value != 0) + { + sweepAngle = 360 / (sumValues / Math.Abs(sector.Point._value)); + + midAngle = startAngle + sweepAngle / 2; + sectorStartAngle = Math.Max(0, startAngle + deltaAngle); + sectorSweepAngle = Math.Max(sweepAngle, sweepAngle - deltaAngle); + + p1.X = origin.X + rInnerCircle * Math.Cos(midAngle / 180 * Math.PI); + p1.Y = origin.Y + rInnerCircle * Math.Sin(midAngle / 180 * Math.PI); + innerRect.X = p1.X - rOuterCircle + rInnerCircle; + innerRect.Y = p1.Y - rOuterCircle + rInnerCircle; + innerRect.Width = (rOuterCircle - rInnerCircle) * 2; + innerRect.Height = innerRect.Width; + + sector.Rect = innerRect; + sector.StartAngle = sectorStartAngle; + sector.SweepAngle = sectorSweepAngle; + + startAngle += sweepAngle; + } + else + { + sector.StartAngle = double.NaN; + sector.SweepAngle = double.NaN; + } + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/PieLegendRenderer.cs b/PdfSharp.Charting/Charting.Renderers/PieLegendRenderer.cs new file mode 100644 index 0000000..d10f7f2 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/PieLegendRenderer.cs @@ -0,0 +1,95 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the legend renderer specific to pie charts. + /// + internal class PieLegendRenderer : LegendRenderer + { + /// + /// Initializes a new instance of the PieLegendRenderer class with the specified renderer + /// parameters. + /// + internal PieLegendRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Initializes the legend's renderer info. Each data point will be represented through + /// a legend entry renderer info. + /// + internal override RendererInfo Init() + { + LegendRendererInfo lri = null; + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + if (cri._chart._legend != null) + { + lri = new LegendRendererInfo(); + lri._legend = cri._chart._legend; + + lri.Font = Converter.ToXFont(lri._legend._font, cri.DefaultFont); + lri.FontColor = new XSolidBrush(XColors.Black); + + if (lri._legend._lineFormat != null) + lri.BorderPen = Converter.ToXPen(lri._legend._lineFormat, XColors.Black, DefaultLineWidth, XDashStyle.Solid); + + XSeries xseries = null; + if (cri._chart._xValues != null) + xseries = cri._chart._xValues[0]; + + int index = 0; + SeriesRendererInfo sri = cri.seriesRendererInfos[0]; + lri.Entries = new LegendEntryRendererInfo[sri._pointRendererInfos.Length]; + foreach (PointRendererInfo pri in sri._pointRendererInfos) + { + LegendEntryRendererInfo leri = new LegendEntryRendererInfo(); + leri._seriesRendererInfo = sri; + leri._legendRendererInfo = lri; + leri.EntryText = string.Empty; + if (xseries != null) + { + if (xseries.Count > index) + leri.EntryText = xseries[index]._value; + } + else + leri.EntryText = (index + 1).ToString(); // create default/dummy entry + leri.MarkerPen = pri.LineFormat; + leri.MarkerBrush = pri.FillFormat; + + lri.Entries[index++] = leri; + } + } + return lri; + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/PiePlotAreaRenderer.cs b/PdfSharp.Charting/Charting.Renderers/PiePlotAreaRenderer.cs new file mode 100644 index 0000000..0128f96 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/PiePlotAreaRenderer.cs @@ -0,0 +1,94 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the base for all pie plot area renderer. + /// + internal abstract class PiePlotAreaRenderer : PlotAreaRenderer + { + /// + /// Initializes a new instance of the PiePlotAreaRenderer class + /// with the specified renderer parameters. + /// + internal PiePlotAreaRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Layouts and calculates the space used by the pie plot area. + /// + internal override void Format() + { + CalcSectors(); + } + + /// + /// Draws the content of the pie plot area. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + XRect plotAreaRect = cri.plotAreaRendererInfo.Rect; + if (plotAreaRect.IsEmpty) + return; + + if (cri.seriesRendererInfos.Length == 0) + return; + + XGraphics gfx = _rendererParms.Graphics; + XGraphicsState state = gfx.Save(); + + // Draw sectors. + SeriesRendererInfo sri = cri.seriesRendererInfos[0]; + foreach (SectorRendererInfo sector in sri._pointRendererInfos) + { + if (!double.IsNaN(sector.StartAngle) && !double.IsNaN(sector.SweepAngle)) + gfx.DrawPie(sector.FillFormat, sector.Rect, sector.StartAngle, sector.SweepAngle); + } + + // Draw border of the sectors. + foreach (SectorRendererInfo sector in sri._pointRendererInfos) + { + if (!double.IsNaN(sector.StartAngle) && !double.IsNaN(sector.SweepAngle)) + gfx.DrawPie(sector.LineFormat, sector.Rect, sector.StartAngle, sector.SweepAngle); + } + + gfx.Restore(state); + } + + /// + /// Calculates the specific positions for each sector. + /// + protected abstract void CalcSectors(); + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/PlotAreaBorderRenderer.cs b/PdfSharp.Charting/Charting.Renderers/PlotAreaBorderRenderer.cs new file mode 100644 index 0000000..bd2b5a8 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/PlotAreaBorderRenderer.cs @@ -0,0 +1,61 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the border renderer for plot areas. + /// + internal class PlotAreaBorderRenderer : Renderer + { + /// + /// Initializes a new instance of the PlotAreaBorderRenderer class with the specified + /// renderer parameters. + /// + internal PlotAreaBorderRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Draws the border around the plot area. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + if (cri.plotAreaRendererInfo.LineFormat != null && cri.plotAreaRendererInfo.LineFormat.Width > 0) + { + XGraphics gfx = _rendererParms.Graphics; + LineFormatRenderer lineFormatRenderer = new LineFormatRenderer(gfx, cri.plotAreaRendererInfo.LineFormat); + lineFormatRenderer.DrawRectangle(cri.plotAreaRendererInfo.Rect); + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/PlotAreaRenderer.cs b/PdfSharp.Charting/Charting.Renderers/PlotAreaRenderer.cs new file mode 100644 index 0000000..fc71154 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/PlotAreaRenderer.cs @@ -0,0 +1,83 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Base class for all plot area renderers. + /// + internal abstract class PlotAreaRenderer : Renderer + { + /// + /// Initializes a new instance of the PlotAreaRenderer class with the specified renderer parameters. + /// + internal PlotAreaRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Returns an initialized PlotAreaRendererInfo. + /// + internal override RendererInfo Init() + { + PlotAreaRendererInfo pari = new PlotAreaRendererInfo(); + pari._plotArea = ((ChartRendererInfo)_rendererParms.RendererInfo)._chart._plotArea; + InitLineFormat(pari); + InitFillFormat(pari); + return pari; + } + + /// + /// Initializes the plot area's line format common to all derived plot area renderers. + /// If line format is given all uninitialized values will be set. + /// + protected void InitLineFormat(PlotAreaRendererInfo rendererInfo) + { + if (rendererInfo._plotArea._lineFormat != null) + rendererInfo.LineFormat = Converter.ToXPen(rendererInfo._plotArea._lineFormat, XColors.Black, DefaultLineWidth); + } + + /// + /// Initializes the plot area's fill format common to all derived plot area renderers. + /// If fill format is given all uninitialized values will be set. + /// + protected void InitFillFormat(PlotAreaRendererInfo rendererInfo) + { + if (rendererInfo._plotArea._fillFormat != null) + rendererInfo.FillFormat = Converter.ToXBrush(rendererInfo._plotArea._fillFormat, XColors.White); + } + + /// + /// Represents the default line width for the plot area's border. + /// + protected const double DefaultLineWidth = 0.15; + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/Renderer.cs b/PdfSharp.Charting/Charting.Renderers/Renderer.cs new file mode 100644 index 0000000..46b5036 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/Renderer.cs @@ -0,0 +1,72 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Base class of all renderers. + /// + internal abstract class Renderer + { + /// + /// Initializes a new instance of the Renderer class with the specified renderer parameters. + /// + internal Renderer(RendererParameters rendererParms) + { + _rendererParms = rendererParms; + } + + /// + /// Derived renderer should return an initialized and renderer specific rendererInfo, + /// e. g. XAxisRenderer returns an new instance of AxisRendererInfo class. + /// + internal virtual RendererInfo Init() + { + return null; + } + + /// + /// Layouts and calculates the space used by the renderer's drawing item. + /// + internal virtual void Format() + { + // nothing to do + } + + /// + /// Draws the item. + /// + internal abstract void Draw(); + + /// + /// Holds all necessary rendering information. + /// + protected RendererParameters _rendererParms; + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/RendererInfo.cs b/PdfSharp.Charting/Charting.Renderers/RendererInfo.cs new file mode 100644 index 0000000..19247b4 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/RendererInfo.cs @@ -0,0 +1,409 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the base class of all renderer infos. + /// Renderer infos are used to hold all necessary information and time consuming calculations + /// between rendering cycles. + /// + internal abstract class RendererInfo + { } + + /// + /// Base class for all renderer infos which defines an area. + /// + internal abstract class AreaRendererInfo : RendererInfo + { + /// + /// Gets or sets the x coordinate of this rectangle. + /// + internal virtual double X + { + get { return _rect.X; } + set { _rect.X = value; } + } + + /// + /// Gets or sets the y coordinate of this rectangle. + /// + internal virtual double Y + { + get { return _rect.Y; } + set { _rect.Y = value; } + } + + /// + /// Gets or sets the width of this rectangle. + /// + internal virtual double Width + { + get { return _rect.Width; } + set { _rect.Width = value; } + } + + /// + /// Gets or sets the height of this rectangle. + /// + internal virtual double Height + { + get { return _rect.Height; } + set { _rect.Height = value; } + } + + /// + /// Gets the area's size. + /// + internal XSize Size + { + get { return _rect.Size; } + set { _rect.Size = value; } + } + + /// + /// Gets the area's rectangle. + /// + internal XRect Rect + { + get { return _rect; } + set { _rect = value; } + } + XRect _rect; + } + + /// + /// A ChartRendererInfo stores information of all main parts of a chart like axis renderer info or + /// plotarea renderer info. + /// + internal class ChartRendererInfo : AreaRendererInfo + { + internal Chart _chart; + + internal AxisRendererInfo xAxisRendererInfo; + internal AxisRendererInfo yAxisRendererInfo; + //internal AxisRendererInfo zAxisRendererInfo; // not yet used + internal PlotAreaRendererInfo plotAreaRendererInfo; + internal LegendRendererInfo legendRendererInfo; + internal SeriesRendererInfo[] seriesRendererInfos; + + /// + /// Gets the chart's default font for rendering. + /// + internal XFont DefaultFont + { + get + { + return _defaultFont ?? + (_defaultFont = Converter.ToXFont(_chart._font, new XFont("Arial", 12, XFontStyle.Regular))); + } + } + XFont _defaultFont; + + /// + /// Gets the chart's default font for rendering data labels. + /// + internal XFont DefaultDataLabelFont + { + get + { + return _defaultDataLabelFont ?? + (_defaultDataLabelFont = Converter.ToXFont(_chart._font, new XFont("Arial", 10, XFontStyle.Regular))); + } + } + XFont _defaultDataLabelFont; + } + + /// + /// A CombinationRendererInfo stores information for rendering combination of charts. + /// + internal class CombinationRendererInfo : ChartRendererInfo + { + internal SeriesRendererInfo[] _commonSeriesRendererInfos; + internal SeriesRendererInfo[] _areaSeriesRendererInfos; + internal SeriesRendererInfo[] _columnSeriesRendererInfos; + internal SeriesRendererInfo[] _lineSeriesRendererInfos; + } + + /// + /// PointRendererInfo is used to render one single data point which is part of a data series. + /// + internal class PointRendererInfo : RendererInfo + { + internal Point Point; + + internal XPen LineFormat; + internal XBrush FillFormat; + } + + /// + /// Represents one sector of a series used by a pie chart. + /// + internal class SectorRendererInfo : PointRendererInfo + { + internal XRect Rect; + internal double StartAngle; + internal double SweepAngle; + } + + /// + /// Represents one data point of a series and the corresponding rectangle. + /// + internal class ColumnRendererInfo : PointRendererInfo + { + internal XRect Rect; + } + + /// + /// Stores rendering specific information for one data label entry. + /// + internal class DataLabelEntryRendererInfo : AreaRendererInfo + { + internal string Text; + } + + /// + /// Stores data label specific rendering information. + /// + internal class DataLabelRendererInfo : RendererInfo + { + internal DataLabelEntryRendererInfo[] Entries; + + internal string Format; + internal XFont Font; + internal XBrush FontColor; + internal DataLabelPosition Position; + internal DataLabelType Type; + } + + /// + /// SeriesRendererInfo holds all data series specific rendering information. + /// + internal class SeriesRendererInfo : RendererInfo + { + internal Series _series; + + internal DataLabelRendererInfo _dataLabelRendererInfo; + internal PointRendererInfo[] _pointRendererInfos; + + internal XPen LineFormat; + internal XBrush FillFormat; + + // Used if ChartType is set to Line + internal MarkerRendererInfo _markerRendererInfo; + + /// + /// Gets the sum of all points in PointRendererInfo. + /// + internal double SumOfPoints + { + get + { + double sum = 0; + foreach (PointRendererInfo pri in _pointRendererInfos) + { + if (!double.IsNaN(pri.Point._value)) + sum += Math.Abs(pri.Point._value); + } + return sum; + } + } + } + + /// + /// Represents a description of a marker for a line chart. + /// + internal class MarkerRendererInfo : RendererInfo + { + internal XUnit MarkerSize; + internal MarkerStyle MarkerStyle; + internal XColor MarkerForegroundColor; + internal XColor MarkerBackgroundColor; + } + + /// + /// An AxisRendererInfo holds all axis specific rendering information. + /// + internal class AxisRendererInfo : AreaRendererInfo + { + internal Axis _axis; + + internal double MinimumScale; + internal double MaximumScale; + internal double MajorTick; + internal double MinorTick; + internal TickMarkType MinorTickMark; + internal TickMarkType MajorTickMark; + internal double MajorTickMarkWidth; + internal double MinorTickMarkWidth; + internal XPen MajorTickMarkLineFormat; + internal XPen MinorTickMarkLineFormat; + + //Gridlines + internal XPen MajorGridlinesLineFormat; + internal XPen MinorGridlinesLineFormat; + + //AxisTitle + internal AxisTitleRendererInfo _axisTitleRendererInfo; + + //TickLabels + internal string TickLabelsFormat; + internal XFont TickLabelsFont; + internal XBrush TickLabelsBrush; + internal double TickLabelsHeight; + + //LineFormat + internal XPen LineFormat; + + //Chart.XValues, used for X axis only. + internal XValues XValues; + + /// + /// Sets the x coordinate of the inner rectangle. + /// + internal override double X + { + set + { + base.X = value; + InnerRect.X = value; + } + } + + /// + /// Sets the y coordinate of the inner rectangle. + /// + internal override double Y + { + set + { + base.Y = value; + InnerRect.Y = value + LabelSize.Height / 2; + } + } + + /// + /// Sets the height of the inner rectangle. + /// + internal override double Height + { + set + { + base.Height = value; + InnerRect.Height = value - (InnerRect.Y - Y); + } + } + + /// + /// Sets the width of the inner rectangle. + /// + internal override double Width + { + set + { + base.Width = value; + InnerRect.Width = value - LabelSize.Width / 2; + } + } + internal XRect InnerRect; + internal XSize LabelSize; + } + + internal class AxisTitleRendererInfo : AreaRendererInfo + { + internal AxisTitle _axisTitle; + + internal string AxisTitleText; + internal XFont AxisTitleFont; + internal XBrush AxisTitleBrush; + internal double AxisTitleOrientation; + internal HorizontalAlignment AxisTitleAlignment; + internal VerticalAlignment AxisTitleVerticalAlignment; + internal XSize AxisTitleSize; + } + + /// + /// Represents one description of a legend entry. + /// + internal class LegendEntryRendererInfo : AreaRendererInfo + { + internal SeriesRendererInfo _seriesRendererInfo; + internal LegendRendererInfo _legendRendererInfo; + + internal string EntryText; + + /// + /// Size for the marker only. + /// + internal XSize MarkerSize; + internal XPen MarkerPen; + internal XBrush MarkerBrush; + + /// + /// Width for marker area. Extra spacing for line charts are considered. + /// + internal XSize MarkerArea; + + /// + /// Size for text area. + /// + internal XSize TextSize; + } + + /// + /// Stores legend specific rendering information. + /// + internal class LegendRendererInfo : AreaRendererInfo + { + internal Legend _legend; + + internal XFont Font; + internal XBrush FontColor; + internal XPen BorderPen; + internal LegendEntryRendererInfo[] Entries; + } + + /// + /// Stores rendering information common to all plot area renderers. + /// + internal class PlotAreaRendererInfo : AreaRendererInfo + { + internal PlotArea _plotArea; + + /// + /// Saves the plot area's matrix. + /// + internal XMatrix _matrix; + internal XPen LineFormat; + internal XBrush FillFormat; + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/RendererParameters.cs b/PdfSharp.Charting/Charting.Renderers/RendererParameters.cs new file mode 100644 index 0000000..a6e3981 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/RendererParameters.cs @@ -0,0 +1,105 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the necessary data for chart rendering. + /// + internal class RendererParameters + { + /// + /// Initializes a new instance of the RendererParameters class. + /// + public RendererParameters() + { } + + /// + /// Initializes a new instance of the RendererParameters class with the specified graphics and + /// coordinates. + /// + public RendererParameters(XGraphics gfx, double x, double y, double width, double height) + { + _gfx = gfx; + _box = new XRect(x, y, width, height); + } + + /// + /// Initializes a new instance of the RendererParameters class with the specified graphics and + /// rectangle. + /// + public RendererParameters(XGraphics gfx, XRect boundingBox) + { + _gfx = gfx; + _box = boundingBox; + } + + /// + /// Gets or sets the graphics object. + /// + public XGraphics Graphics + { + get { return _gfx; } + set { _gfx = value; } + } + XGraphics _gfx; + + /// + /// Gets or sets the item to draw. + /// + public object DrawingItem + { + get { return _item; } + set { _item = value; } + } + object _item; + + /// + /// Gets or sets the rectangle for the drawing item. + /// + public XRect Box + { + get { return _box; } + set { _box = value; } + } + XRect _box; + + /// + /// Gets or sets the RendererInfo. + /// + public RendererInfo RendererInfo + { + get { return _rendererInfo; } + set { _rendererInfo = value; } + } + RendererInfo _rendererInfo; + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/Charting.Renderers/VerticalStackedYAxisRenderer.cs b/PdfSharp.Charting/Charting.Renderers/VerticalStackedYAxisRenderer.cs new file mode 100644 index 0000000..5c477d7 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/VerticalStackedYAxisRenderer.cs @@ -0,0 +1,84 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a Y axis renderer used for charts of type Column2D or Line. + /// + internal class VerticalStackedYAxisRenderer : VerticalYAxisRenderer + { + /// + /// Initializes a new instance of the VerticalYAxisRenderer class with the + /// specified renderer parameters. + /// + internal VerticalStackedYAxisRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Determines the sum of the smallest and the largest stacked column + /// from all series of the chart. + /// + protected override void CalcYAxis(out double yMin, out double yMax) + { + yMin = double.MaxValue; + yMax = double.MinValue; + + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + int maxPoints = 0; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + maxPoints = Math.Max(maxPoints, sri._series._seriesElements.Count); + + for (int pointIdx = 0; pointIdx < maxPoints; ++pointIdx) + { + double valueSumPos = 0, valueSumNeg = 0; + foreach (SeriesRendererInfo sri in cri.seriesRendererInfos) + { + if (sri._pointRendererInfos.Length <= pointIdx) + break; + + ColumnRendererInfo column = (ColumnRendererInfo)sri._pointRendererInfos[pointIdx]; + if (column.Point != null && !double.IsNaN(column.Point._value)) + { + if (column.Point._value < 0) + valueSumNeg += column.Point._value; + else + valueSumPos += column.Point._value; + } + } + yMin = Math.Min(valueSumNeg, yMin); + yMax = Math.Max(valueSumPos, yMax); + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/VerticalXAxisRenderer.cs b/PdfSharp.Charting/Charting.Renderers/VerticalXAxisRenderer.cs new file mode 100644 index 0000000..34e0914 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/VerticalXAxisRenderer.cs @@ -0,0 +1,296 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents an axis renderer used for charts of type Bar2D. + /// + internal class VerticalXAxisRenderer : XAxisRenderer + { + /// + /// Initializes a new instance of the VerticalXAxisRenderer class with the specified renderer parameters. + /// + internal VerticalXAxisRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Returns an initialized rendererInfo based on the X axis. + /// + internal override RendererInfo Init() + { + Chart chart = (Chart)_rendererParms.DrawingItem; + + AxisRendererInfo xari = new AxisRendererInfo(); + xari._axis = chart._xAxis; + if (xari._axis != null) + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + + CalculateXAxisValues(xari); + InitXValues(xari); + InitAxisTitle(xari, cri.DefaultFont); + InitTickLabels(xari, cri.DefaultFont); + InitAxisLineFormat(xari); + InitGridlines(xari); + } + return xari; + } + + /// + /// Calculates the space used for the X axis. + /// + internal override void Format() + { + AxisRendererInfo xari = ((ChartRendererInfo)_rendererParms.RendererInfo).xAxisRendererInfo; + if (xari._axis != null) + { + AxisTitleRendererInfo atri = xari._axisTitleRendererInfo; + + // Calculate space used for axis title. + XSize titleSize = new XSize(0, 0); + if (atri != null && atri.AxisTitleText != null && atri.AxisTitleText.Length > 0) + titleSize = _rendererParms.Graphics.MeasureString(atri.AxisTitleText, atri.AxisTitleFont); + + // Calculate space used for tick labels. + XSize size = new XSize(0, 0); + foreach (XSeries xs in xari.XValues) + { + foreach (XValue xv in xs) + { + XSize valueSize = _rendererParms.Graphics.MeasureString(xv._value, xari.TickLabelsFont); + size.Height += valueSize.Height; + size.Width = Math.Max(valueSize.Width, size.Width); + } + } + + // Remember space for later drawing. + if (atri != null) + atri.AxisTitleSize = titleSize; + xari.TickLabelsHeight = size.Height; + xari.Height = size.Height; + xari.Width = titleSize.Width + size.Width + xari.MajorTickMarkWidth; + } + } + + /// + /// Draws the horizontal X axis. + /// + internal override void Draw() + { + XGraphics gfx = _rendererParms.Graphics; + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + AxisRendererInfo xari = cri.xAxisRendererInfo; + + double xMin = xari.MinimumScale; + double xMax = xari.MaximumScale; + double xMajorTick = xari.MajorTick; + double xMinorTick = xari.MinorTick; + double xMaxExtension = xari.MajorTick; + + // Draw tick labels. Each tick label will be aligned centered. + int countTickLabels = (int)xMax; + double tickLabelStep = xari.Height / countTickLabels; + XPoint startPos = new XPoint(xari.X + xari.Width - xari.MajorTickMarkWidth, xari.Y + tickLabelStep / 2); + foreach (XSeries xs in xari.XValues) + { + for (int idx = countTickLabels - 1; idx >= 0; --idx) + { + XValue xv = xs[idx]; + string tickLabel = xv._value; + XSize size = gfx.MeasureString(tickLabel, xari.TickLabelsFont); + gfx.DrawString(tickLabel, xari.TickLabelsFont, xari.TickLabelsBrush, startPos.X - size.Width, startPos.Y + size.Height / 2); + startPos.Y += tickLabelStep; + } + } + + // Draw axis. + // First draw tick marks, second draw axis. + double majorTickMarkStart = 0, majorTickMarkEnd = 0, + minorTickMarkStart = 0, minorTickMarkEnd = 0; + GetTickMarkPos(xari, ref majorTickMarkStart, ref majorTickMarkEnd, ref minorTickMarkStart, ref minorTickMarkEnd); + + LineFormatRenderer lineFormatRenderer = new LineFormatRenderer(gfx, xari.LineFormat); + XPoint[] points = new XPoint[2]; + + // Minor ticks. + if (xari.MinorTickMark != TickMarkType.None) + { + int countMinorTickMarks = (int)(xMax / xMinorTick); + double minorTickMarkStep = xari.Height / countMinorTickMarks; + startPos.Y = xari.Y; + for (int x = 0; x <= countMinorTickMarks; x++) + { + points[0].X = minorTickMarkStart; + points[0].Y = startPos.Y + minorTickMarkStep * x; + points[1].X = minorTickMarkEnd; + points[1].Y = points[0].Y; + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + + // Major ticks. + if (xari.MajorTickMark != TickMarkType.None) + { + int countMajorTickMarks = (int)(xMax / xMajorTick); + double majorTickMarkStep = xari.Height / countMajorTickMarks; + startPos.Y = xari.Y; + for (int x = 0; x <= countMajorTickMarks; x++) + { + points[0].X = majorTickMarkStart; + points[0].Y = startPos.Y + majorTickMarkStep * x; + points[1].X = majorTickMarkEnd; + points[1].Y = points[0].Y; + lineFormatRenderer.DrawLine(points[0], points[1]); + } + } + + // Axis. + if (xari.LineFormat != null) + { + points[0].X = xari.X + xari.Width; + points[0].Y = xari.Y; + points[1].X = xari.X + xari.Width; + points[1].Y = xari.Y + xari.Height; + if (xari.MajorTickMark != TickMarkType.None) + { + points[0].Y -= xari.LineFormat.Width / 2; + points[1].Y += xari.LineFormat.Width / 2; + } + lineFormatRenderer.DrawLine(points[0], points[1]); + } + + // Draw axis title. + AxisTitleRendererInfo atri = xari._axisTitleRendererInfo; + if (atri != null && atri.AxisTitleText != null && atri.AxisTitleText.Length > 0) + { + XRect rect = new XRect(xari.X, xari.Y + xari.Height / 2, atri.AxisTitleSize.Width, 0); + gfx.DrawString(atri.AxisTitleText, atri.AxisTitleFont, atri.AxisTitleBrush, rect); + } + } + + /// + /// Calculates the X axis describing values like minimum/maximum scale, major/minor tick and + /// major/minor tick mark width. + /// + private void CalculateXAxisValues(AxisRendererInfo rendererInfo) + { + // Calculates the maximum number of data points over all series. + SeriesCollection seriesCollection = ((Chart)rendererInfo._axis._parent)._seriesCollection; + int count = 0; + foreach (Series series in seriesCollection) + count = Math.Max(count, series.Count); + + rendererInfo.MinimumScale = 0; + rendererInfo.MaximumScale = count; // At least 0 + rendererInfo.MajorTick = 1; + rendererInfo.MinorTick = 0.5; + rendererInfo.MajorTickMarkWidth = DefaultMajorTickMarkWidth; + rendererInfo.MinorTickMarkWidth = DefaultMinorTickMarkWidth; + } + + /// + /// Initializes the rendererInfo's xvalues. If not set by the user xvalues will be simply numbers + /// from minimum scale + 1 to maximum scale. + /// + private void InitXValues(AxisRendererInfo rendererInfo) + { + rendererInfo.XValues = ((Chart)rendererInfo._axis._parent)._xValues; + if (rendererInfo.XValues == null) + { + rendererInfo.XValues = new XValues(); + XSeries xs = rendererInfo.XValues.AddXSeries(); + for (double i = rendererInfo.MinimumScale + 1; i <= rendererInfo.MaximumScale; ++i) + xs.Add(i.ToString()); + } + } + + /// + /// Calculates the starting and ending y position for the minor and major tick marks. + /// + private void GetTickMarkPos(AxisRendererInfo rendererInfo, + ref double majorTickMarkStart, ref double majorTickMarkEnd, + ref double minorTickMarkStart, ref double minorTickMarkEnd) + { + double majorTickMarkWidth = rendererInfo.MajorTickMarkWidth; + double minorTickMarkWidth = rendererInfo.MinorTickMarkWidth; + double x = rendererInfo.Rect.X + rendererInfo.Rect.Width; + + switch (rendererInfo.MajorTickMark) + { + case TickMarkType.Inside: + majorTickMarkStart = x; + majorTickMarkEnd = x + majorTickMarkWidth; + break; + + case TickMarkType.Outside: + majorTickMarkStart = x - majorTickMarkWidth; + majorTickMarkEnd = x; + break; + + case TickMarkType.Cross: + majorTickMarkStart = x - majorTickMarkWidth; + majorTickMarkEnd = x + majorTickMarkWidth; + break; + + case TickMarkType.None: + majorTickMarkStart = 0; + majorTickMarkEnd = 0; + break; + } + + switch (rendererInfo.MinorTickMark) + { + case TickMarkType.Inside: + minorTickMarkStart = x; + minorTickMarkEnd = x + minorTickMarkWidth; + break; + + case TickMarkType.Outside: + minorTickMarkStart = x - minorTickMarkWidth; + minorTickMarkEnd = x; + break; + + case TickMarkType.Cross: + minorTickMarkStart = x - minorTickMarkWidth; + minorTickMarkEnd = x + minorTickMarkWidth; + break; + + case TickMarkType.None: + minorTickMarkStart = 0; + minorTickMarkEnd = 0; + break; + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/VerticalYAxisRenderer.cs b/PdfSharp.Charting/Charting.Renderers/VerticalYAxisRenderer.cs new file mode 100644 index 0000000..156d55b --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/VerticalYAxisRenderer.cs @@ -0,0 +1,331 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a Y axis renderer used for charts of type Column2D or Line. + /// + internal class VerticalYAxisRenderer : YAxisRenderer + { + /// + /// Initializes a new instance of the VerticalYAxisRenderer class with the + /// specified renderer parameters. + /// + internal VerticalYAxisRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Returns a initialized rendererInfo based on the Y axis. + /// + internal override RendererInfo Init() + { + Chart chart = (Chart)_rendererParms.DrawingItem; + XGraphics gfx = _rendererParms.Graphics; + + AxisRendererInfo yari = new AxisRendererInfo(); + yari._axis = chart._yAxis; + InitScale(yari); + if (yari._axis != null) + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + InitTickLabels(yari, cri.DefaultFont); + InitAxisTitle(yari, cri.DefaultFont); + InitAxisLineFormat(yari); + InitGridlines(yari); + } + return yari; + } + + /// + /// Calculates the space used for the Y axis. + /// + internal override void Format() + { + AxisRendererInfo yari = ((ChartRendererInfo)_rendererParms.RendererInfo).yAxisRendererInfo; + if (yari._axis != null) + { + XGraphics gfx = _rendererParms.Graphics; + + XSize size = new XSize(0, 0); + + // height of all ticklabels + double yMin = yari.MinimumScale; + double yMax = yari.MaximumScale; + double yMajorTick = yari.MajorTick; + double lineHeight = Double.MinValue; + XSize labelSize = new XSize(0, 0); + for (double y = yMin; y <= yMax; y += yMajorTick) + { + string str = y.ToString(yari.TickLabelsFormat); + labelSize = gfx.MeasureString(str, yari.TickLabelsFont); + size.Height += labelSize.Height; + size.Width = Math.Max(size.Width, labelSize.Width); + lineHeight = Math.Max(lineHeight, labelSize.Height); + } + + // add space for tickmarks + size.Width += yari.MajorTickMarkWidth * 1.5; + + // Measure axis title + XSize titleSize = new XSize(0, 0); + if (yari._axisTitleRendererInfo != null) + { + RendererParameters parms = new RendererParameters(); + parms.Graphics = gfx; + parms.RendererInfo = yari; + AxisTitleRenderer atr = new AxisTitleRenderer(parms); + atr.Format(); + titleSize.Height = yari._axisTitleRendererInfo.Height; + titleSize.Width = yari._axisTitleRendererInfo.Width; + } + + yari.Height = Math.Max(size.Height, titleSize.Height); + yari.Width = size.Width + titleSize.Width; + + yari.InnerRect = yari.Rect; + yari.InnerRect.Y += yari.TickLabelsFont.Height / 2; + yari.LabelSize = labelSize; + } + } + + /// + /// Draws the vertical Y axis. + /// + internal override void Draw() + { + AxisRendererInfo yari = ((ChartRendererInfo)_rendererParms.RendererInfo).yAxisRendererInfo; + + double yMin = yari.MinimumScale; + double yMax = yari.MaximumScale; + double yMajorTick = yari.MajorTick; + double yMinorTick = yari.MinorTick; + + XMatrix matrix = new XMatrix(); + matrix.TranslatePrepend(-yari.InnerRect.X, yMax); + matrix.Scale(1, yari.InnerRect.Height / (yMax - yMin), XMatrixOrder.Append); + matrix.ScalePrepend(1, -1); // mirror horizontal + matrix.Translate(yari.InnerRect.X, yari.InnerRect.Y, XMatrixOrder.Append); + + // Draw axis. + // First draw tick marks, second draw axis. + double majorTickMarkStart = 0, majorTickMarkEnd = 0, + minorTickMarkStart = 0, minorTickMarkEnd = 0; + GetTickMarkPos(yari, ref majorTickMarkStart, ref majorTickMarkEnd, ref minorTickMarkStart, ref minorTickMarkEnd); + + XGraphics gfx = _rendererParms.Graphics; + LineFormatRenderer lineFormatRenderer = new LineFormatRenderer(gfx, yari.LineFormat); + LineFormatRenderer minorTickMarkLineFormat = new LineFormatRenderer(gfx, yari.MinorTickMarkLineFormat); + LineFormatRenderer majorTickMarkLineFormat = new LineFormatRenderer(gfx, yari.MajorTickMarkLineFormat); + XPoint[] points = new XPoint[2]; + + // Draw minor tick marks. + if (yari.MinorTickMark != TickMarkType.None) + { + for (double y = yMin + yMinorTick; y < yMax; y += yMinorTick) + { + points[0].X = minorTickMarkStart; + points[0].Y = y; + points[1].X = minorTickMarkEnd; + points[1].Y = y; + matrix.TransformPoints(points); + minorTickMarkLineFormat.DrawLine(points[0], points[1]); + } + } + + double lineSpace = yari.TickLabelsFont.GetHeight(); // old: yari.TickLabelsFont.GetHeight(gfx); + int cellSpace = yari.TickLabelsFont.FontFamily.GetLineSpacing(yari.TickLabelsFont.Style); + double xHeight = yari.TickLabelsFont.Metrics.XHeight; + + XSize labelSize = new XSize(0, 0); + labelSize.Height = lineSpace * xHeight / cellSpace; + + int countTickLabels = (int)((yMax - yMin) / yMajorTick) + 1; + for (int i = 0; i < countTickLabels; ++i) + { + double y = yMin + yMajorTick * i; + string str = y.ToString(yari.TickLabelsFormat); + + labelSize.Width = gfx.MeasureString(str, yari.TickLabelsFont).Width; + + // Draw major tick marks. + if (yari.MajorTickMark != TickMarkType.None) + { + labelSize.Width += yari.MajorTickMarkWidth * 1.5; + points[0].X = majorTickMarkStart; + points[0].Y = y; + points[1].X = majorTickMarkEnd; + points[1].Y = y; + matrix.TransformPoints(points); + majorTickMarkLineFormat.DrawLine(points[0], points[1]); + } + else + labelSize.Width += SpaceBetweenLabelAndTickmark; + + // Draw label text. + XPoint[] layoutText = new XPoint[1]; + layoutText[0].X = yari.InnerRect.X + yari.InnerRect.Width - labelSize.Width; + layoutText[0].Y = y; + matrix.TransformPoints(layoutText); + layoutText[0].Y += labelSize.Height / 2; // Center text vertically. + gfx.DrawString(str, yari.TickLabelsFont, yari.TickLabelsBrush, layoutText[0]); + } + + // Draw axis. + if (yari.LineFormat != null && yari.LineFormat.Width > 0) + { + points[0].X = yari.InnerRect.X + yari.InnerRect.Width; + points[0].Y = yMin; + points[1].X = yari.InnerRect.X + yari.InnerRect.Width; + points[1].Y = yMax; + matrix.TransformPoints(points); + if (yari.MajorTickMark != TickMarkType.None) + { + // yMax is at the upper side of the axis + points[1].Y -= yari.LineFormat.Width / 2; + points[0].Y += yari.LineFormat.Width / 2; + } + lineFormatRenderer.DrawLine(points[0], points[1]); + } + + // Draw axis title + if (yari._axisTitleRendererInfo != null && yari._axisTitleRendererInfo.AxisTitleText != "") + { + RendererParameters parms = new RendererParameters(); + parms.Graphics = gfx; + parms.RendererInfo = yari; + double width = yari._axisTitleRendererInfo.Width; + yari._axisTitleRendererInfo.Rect = yari.InnerRect; + yari._axisTitleRendererInfo.Width = width; + AxisTitleRenderer atr = new AxisTitleRenderer(parms); + atr.Draw(); + } + } + + /// + /// Calculates all values necessary for scaling the axis like minimum/maximum scale or + /// minor/major tick. + /// + private void InitScale(AxisRendererInfo rendererInfo) + { + double yMin, yMax; + CalcYAxis(out yMin, out yMax); + FineTuneYAxis(rendererInfo, yMin, yMax); + + rendererInfo.MajorTickMarkWidth = DefaultMajorTickMarkWidth; + rendererInfo.MinorTickMarkWidth = DefaultMinorTickMarkWidth; + } + + /// + /// Gets the top and bottom position of the major and minor tick marks depending on the + /// tick mark type. + /// + private void GetTickMarkPos(AxisRendererInfo rendererInfo, + ref double majorTickMarkStart, ref double majorTickMarkEnd, + ref double minorTickMarkStart, ref double minorTickMarkEnd) + { + double majorTickMarkWidth = rendererInfo.MajorTickMarkWidth; + double minorTickMarkWidth = rendererInfo.MinorTickMarkWidth; + XRect rect = rendererInfo.Rect; + + switch (rendererInfo.MajorTickMark) + { + case TickMarkType.Inside: + majorTickMarkStart = rect.X + rect.Width; + majorTickMarkEnd = rect.X + rect.Width + majorTickMarkWidth; + break; + + case TickMarkType.Outside: + majorTickMarkStart = rect.X + rect.Width; + majorTickMarkEnd = rect.X + rect.Width - majorTickMarkWidth; + break; + + case TickMarkType.Cross: + majorTickMarkStart = rect.X + rect.Width - majorTickMarkWidth; + majorTickMarkEnd = rect.X + rect.Width + majorTickMarkWidth; + break; + + //TickMarkType.None: + default: + majorTickMarkStart = 0; + majorTickMarkEnd = 0; + break; + } + + switch (rendererInfo.MinorTickMark) + { + case TickMarkType.Inside: + minorTickMarkStart = rect.X + rect.Width; + minorTickMarkEnd = rect.X + rect.Width + minorTickMarkWidth; + break; + + case TickMarkType.Outside: + minorTickMarkStart = rect.X + rect.Width; + minorTickMarkEnd = rect.X + rect.Width - minorTickMarkWidth; + break; + + case TickMarkType.Cross: + minorTickMarkStart = rect.X + rect.Width - minorTickMarkWidth; + minorTickMarkEnd = rect.X + rect.Width + minorTickMarkWidth; + break; + + //TickMarkType.None: + default: + minorTickMarkStart = 0; + minorTickMarkEnd = 0; + break; + } + } + + /// + /// Determines the smallest and the largest number from all series of the chart. + /// + protected virtual void CalcYAxis(out double yMin, out double yMax) + { + yMin = double.MaxValue; + yMax = double.MinValue; + + foreach (Series series in ((Chart)_rendererParms.DrawingItem).SeriesCollection) + { + foreach (Point point in series.Elements) + { + if (!double.IsNaN(point._value)) + { + yMin = Math.Min(yMin, point.Value); + yMax = Math.Max(yMax, point.Value); + } + } + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/WallRenderer.cs b/PdfSharp.Charting/Charting.Renderers/WallRenderer.cs new file mode 100644 index 0000000..7b9228e --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/WallRenderer.cs @@ -0,0 +1,62 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents a renderer for the plot area background. + /// + internal class WallRenderer : Renderer + { + /// + /// Initializes a new instance of the WallRenderer class with the specified renderer parameters. + /// + internal WallRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Draws the wall. + /// + internal override void Draw() + { + ChartRendererInfo cri = (ChartRendererInfo)_rendererParms.RendererInfo; + if (cri.plotAreaRendererInfo.FillFormat != null) + { + XRect plotAreaBox = cri.plotAreaRendererInfo.Rect; + if (plotAreaBox.IsEmpty) + return; + + _rendererParms.Graphics.DrawRectangle(cri.plotAreaRendererInfo.FillFormat, plotAreaBox); + } + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/XAxisRenderer.cs b/PdfSharp.Charting/Charting.Renderers/XAxisRenderer.cs new file mode 100644 index 0000000..4714129 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/XAxisRenderer.cs @@ -0,0 +1,52 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the base class for all X axis renderer. + /// + internal abstract class XAxisRenderer : AxisRenderer + { + /// + /// Initializes a new instance of the XAxisRenderer class with the specified renderer parameters. + /// + internal XAxisRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Returns the default tick labels format string. + /// + protected override string GetDefaultTickLabelsFormat() + { + return "0"; + } + } +} diff --git a/PdfSharp.Charting/Charting.Renderers/YAxisRenderer.cs b/PdfSharp.Charting/Charting.Renderers/YAxisRenderer.cs new file mode 100644 index 0000000..4c73059 --- /dev/null +++ b/PdfSharp.Charting/Charting.Renderers/YAxisRenderer.cs @@ -0,0 +1,130 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Charting.Renderers +{ + /// + /// Represents the base class for all Y axis renderer. + /// + internal abstract class YAxisRenderer : AxisRenderer + { + /// + /// Initializes a new instance of the YAxisRenderer class with the specified renderer parameters. + /// + internal YAxisRenderer(RendererParameters parms) + : base(parms) + { } + + /// + /// Calculates optimal minimum/maximum scale and minor/major tick based on yMin and yMax. + /// + protected void FineTuneYAxis(AxisRendererInfo rendererInfo, double yMin, double yMax) + { + if (yMin == double.MaxValue && yMax == double.MinValue) + { + // No series data given. + yMin = 0.0f; + yMax = 0.9f; + } + + if (yMin == yMax) + { + if (yMin == 0) + yMax = 0.9f; + else if (yMin < 0) + yMax = 0; + else if (yMin > 0) + yMax = yMin + 1; + } + + // If the ratio between yMax to yMin is more than 1.2, the smallest number will be set too zero. + // It's Excel's behavior. + if (yMin != 0) + { + if (yMin < 0 && yMax < 0) + { + if (yMin / yMax >= 1.2) + yMax = 0; + } + else if (yMax / yMin >= 1.2) + yMin = 0; + } + + double deltaYRaw = yMax - yMin; + + int digits = (int)(Math.Log(deltaYRaw, 10) + 1); + double normed = deltaYRaw / Math.Pow(10, digits) * 10; + + double normedStepWidth = 1; + if (normed < 2) + normedStepWidth = 0.2f; + else if (normed < 5) + normedStepWidth = 0.5f; + + AxisRendererInfo yari = rendererInfo; + double stepWidth = normedStepWidth * Math.Pow(10.0, digits - 1.0); + if (yari._axis == null || double.IsNaN(yari._axis._majorTick)) + yari.MajorTick = stepWidth; + else + yari.MajorTick = yari._axis._majorTick; + + double roundFactor = stepWidth * 0.5; + if (yari._axis == null || double.IsNaN(yari._axis.MinimumScale)) + { + double signumMin = (yMin != 0) ? yMin / Math.Abs(yMin) : 0; + yari.MinimumScale = (int)(Math.Abs((yMin - roundFactor) / stepWidth) - (1 * signumMin)) * stepWidth * signumMin; + } + else + yari.MinimumScale = yari._axis.MinimumScale; + + if (yari._axis == null || double.IsNaN(yari._axis.MaximumScale)) + { + double signumMax = (yMax != 0) ? yMax / Math.Abs(yMax) : 0; + yari.MaximumScale = (int)(Math.Abs((yMax + roundFactor) / stepWidth) + (1 * signumMax)) * stepWidth * signumMax; + } + else + yari.MaximumScale = yari._axis.MaximumScale; + + if (yari._axis == null || double.IsNaN(yari._axis._minorTick)) + yari.MinorTick = yari.MajorTick / 5; + else + yari.MinorTick = yari._axis._minorTick; + } + + /// + /// Returns the default tick labels format string. + /// + protected override string GetDefaultTickLabelsFormat() + { + return "0.0"; + } + } +} diff --git a/PdfSharp.Charting/Charting/Axis.cs b/PdfSharp.Charting/Charting/Axis.cs new file mode 100644 index 0000000..6502fcc --- /dev/null +++ b/PdfSharp.Charting/Charting/Axis.cs @@ -0,0 +1,232 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if !WINDOWS_PHONE +using System.ComponentModel; +#endif + +namespace PdfSharp.Charting +{ + /// + /// This class represents an axis in a chart. + /// + public class Axis : ChartObject + { + /// + /// Initializes a new instance of the Axis class with the specified parent. + /// + internal Axis(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Axis Clone() + { + return (Axis)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Axis axis = (Axis)base.DeepCopy(); + if (axis._title != null) + { + axis._title = axis._title.Clone(); + axis._title._parent = axis; + } + if (axis._tickLabels != null) + { + axis._tickLabels = axis._tickLabels.Clone(); + axis._tickLabels._parent = axis; + } + if (axis._lineFormat != null) + { + axis._lineFormat = axis._lineFormat.Clone(); + axis._lineFormat._parent = axis; + } + if (axis._majorGridlines != null) + { + axis._majorGridlines = axis._majorGridlines.Clone(); + axis._majorGridlines._parent = axis; + } + if (axis._minorGridlines != null) + { + axis._minorGridlines = axis._minorGridlines.Clone(); + axis._minorGridlines._parent = axis; + } + return axis; + } + #endregion + + #region Properties + /// + /// Gets the title of the axis. + /// + public AxisTitle Title + { + get { return _title ?? (_title = new AxisTitle(this)); } + } + internal AxisTitle _title; + + /// + /// Gets or sets the minimum value of the axis. + /// + public double MinimumScale + { + get { return _minimumScale; } + set { _minimumScale = value; } + } + internal double _minimumScale = double.NaN; + + /// + /// Gets or sets the maximum value of the axis. + /// + public double MaximumScale + { + get { return _maximumScale; } + set { _maximumScale = value; } + } + internal double _maximumScale = double.NaN; + + /// + /// Gets or sets the interval of the primary tick. + /// + public double MajorTick + { + get { return _majorTick; } + set { _majorTick = value; } + } + internal double _majorTick = double.NaN; + + /// + /// Gets or sets the interval of the secondary tick. + /// + public double MinorTick + { + get { return _minorTick; } + set { _minorTick = value; } + } + internal double _minorTick = double.NaN; + + /// + /// Gets or sets the type of the primary tick mark. + /// + public TickMarkType MajorTickMark + { + get { return _majorTickMark; } + set + { + if (!Enum.IsDefined(typeof(TickMarkType), value)) + throw new InvalidEnumArgumentException("value", (int)value, typeof(TickMarkType)); + _majorTickMark = value; + _majorTickMarkInitialized = true; + } + } + internal TickMarkType _majorTickMark; + internal bool _majorTickMarkInitialized; + + /// + /// Gets or sets the type of the secondary tick mark. + /// + public TickMarkType MinorTickMark + { + get { return _minorTickMark; } + set + { + if (!Enum.IsDefined(typeof(TickMarkType), value)) + throw new InvalidEnumArgumentException("value", (int)value, typeof(TickMarkType)); + _minorTickMark = value; + _minorTickMarkInitialized = true; + } + } + internal TickMarkType _minorTickMark; + internal bool _minorTickMarkInitialized; + + /// + /// Gets the label of the primary tick. + /// + public TickLabels TickLabels + { + get { return _tickLabels ?? (_tickLabels = new TickLabels(this)); } + } + internal TickLabels _tickLabels; + + /// + /// Gets the format of the axis line. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + } + internal LineFormat _lineFormat; + + /// + /// Gets the primary gridline object. + /// + public Gridlines MajorGridlines + { + get { return _majorGridlines ?? (_majorGridlines = new Gridlines(this)); } + } + internal Gridlines _majorGridlines; + + /// + /// Gets the secondary gridline object. + /// + public Gridlines MinorGridlines + { + get { return _minorGridlines ?? (_minorGridlines = new Gridlines(this)); } + } + internal Gridlines _minorGridlines; + + /// + /// Gets or sets, whether the axis has a primary gridline object. + /// + public bool HasMajorGridlines + { + get { return _hasMajorGridlines; } + set { _hasMajorGridlines = value; } + } + internal bool _hasMajorGridlines; + + /// + /// Gets or sets, whether the axis has a secondary gridline object. + /// + public bool HasMinorGridlines + { + get { return _hasMinorGridlines; } + set { _hasMinorGridlines = value; } + } + internal bool _hasMinorGridlines; + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/AxisTitle.cs b/PdfSharp.Charting/Charting/AxisTitle.cs new file mode 100644 index 0000000..f752699 --- /dev/null +++ b/PdfSharp.Charting/Charting/AxisTitle.cs @@ -0,0 +1,125 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Charting +{ + /// + /// Represents the title of an axis. + /// + public class AxisTitle : ChartObject + { + /// + /// Initializes a new instance of the AxisTitle class. + /// + public AxisTitle() + { } + + /// + /// Initializes a new instance of the AxisTitle class with the specified parent. + /// + internal AxisTitle(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new AxisTitle Clone() + { + return (AxisTitle)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + AxisTitle axisTitle = (AxisTitle)base.DeepCopy(); + if (axisTitle._font != null) + { + axisTitle._font = axisTitle._font.Clone(); + axisTitle._font._parent = axisTitle; + } + return axisTitle; + } + #endregion + + #region Properties + /// + /// Gets or sets the caption of the title. + /// + public string Caption + { + get { return _caption; } + set { _caption = value; } + } + internal string _caption = String.Empty; + + /// + /// Gets the font of the title. + /// + public Font Font + { + get { return _font ?? (_font = new Font(this)); } + } + internal Font _font; + + /// + /// Gets or sets the orientation of the caption. + /// + public double Orientation + { + get { return _orientation; } + set { _orientation = value; } + } + internal double _orientation; + + /// + /// Gets or sets the horizontal alignment of the caption. + /// + public HorizontalAlignment Alignment + { + get { return _alignment; } + set { _alignment = value; } + } + internal HorizontalAlignment _alignment; + + /// + /// Gets or sets the vertical alignment of the caption. + /// + public VerticalAlignment VerticalAlignment + { + get { return _verticalAlignment; } + set { _verticalAlignment = value; } + } + internal VerticalAlignment _verticalAlignment; + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/Chart.cs b/PdfSharp.Charting/Charting/Chart.cs new file mode 100644 index 0000000..6f790c0 --- /dev/null +++ b/PdfSharp.Charting/Charting/Chart.cs @@ -0,0 +1,241 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Represents charts with different types. + /// + public class Chart : DocumentObject + { + /// + /// Initializes a new instance of the Chart class. + /// + public Chart() + { } + + /// + /// Initializes a new instance of the Chart class with the specified parent. + /// + internal Chart(DocumentObject parent) : base(parent) { } + + /// + /// Initializes a new instance of the Chart class with the specified chart type. + /// + public Chart(ChartType type) + : this() + { + Type = type; + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Chart Clone() + { + return (Chart)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Chart chart = (Chart)base.DeepCopy(); + if (chart._xAxis != null) + { + chart._xAxis = chart._xAxis.Clone(); + chart._xAxis._parent = chart; + } + if (chart._yAxis != null) + { + chart._yAxis = chart._yAxis.Clone(); + chart._yAxis._parent = chart; + } + if (chart._zAxis != null) + { + chart._zAxis = chart._zAxis.Clone(); + chart._zAxis._parent = chart; + } + if (chart._seriesCollection != null) + { + chart._seriesCollection = chart._seriesCollection.Clone(); + chart._seriesCollection._parent = chart; + } + if (chart._xValues != null) + { + chart._xValues = chart._xValues.Clone(); + chart._xValues._parent = chart; + } + if (chart._plotArea != null) + { + chart._plotArea = chart._plotArea.Clone(); + chart._plotArea._parent = chart; + } + if (chart._dataLabel != null) + { + chart._dataLabel = chart._dataLabel.Clone(); + chart._dataLabel._parent = chart; + } + return chart; + } + + /// + /// Determines the type of the given axis. + /// + internal string CheckAxis(Axis axis) + { + if ((_xAxis != null) && (axis == _xAxis)) + return "xaxis"; + if ((_yAxis != null) && (axis == _yAxis)) + return "yaxis"; + if ((_zAxis != null) && (axis == _zAxis)) + return "zaxis"; + + return ""; + } + #endregion + + #region Properties + /// + /// Gets or sets the base type of the chart. + /// ChartType of the series can be overwritten. + /// + public ChartType Type + { + get { return _type; } + set { _type = value; } + } + internal ChartType _type; + + /// + /// Gets or sets the font for the chart. This will be the default font for all objects which are + /// part of the chart. + /// + public Font Font + { + get { return _font ?? (_font = new Font(this)); } + } + internal Font _font; + + /// + /// Gets the legend of the chart. + /// + public Legend Legend + { + get { return _legend ?? (_legend = new Legend(this)); } + } + internal Legend _legend; + + /// + /// Gets the X-Axis of the Chart. + /// + public Axis XAxis + { + get { return _xAxis ?? (_xAxis = new Axis(this)); } + } + internal Axis _xAxis; + + /// + /// Gets the Y-Axis of the Chart. + /// + public Axis YAxis + { + get { return _yAxis ?? (_yAxis = new Axis(this)); } + } + internal Axis _yAxis; + + /// + /// Gets the Z-Axis of the Chart. + /// + public Axis ZAxis + { + get { return _zAxis ?? (_zAxis = new Axis(this)); } + } + internal Axis _zAxis; + + /// + /// Gets the collection of the data series. + /// + public SeriesCollection SeriesCollection + { + get { return _seriesCollection ?? (_seriesCollection = new SeriesCollection(this)); } + } + internal SeriesCollection _seriesCollection; + + /// + /// Gets the collection of the values written on the X-Axis. + /// + public XValues XValues + { + get { return _xValues ?? (_xValues = new XValues(this)); } + } + internal XValues _xValues; + + /// + /// Gets the plot (drawing) area of the chart. + /// + public PlotArea PlotArea + { + get { return _plotArea ?? (_plotArea = new PlotArea(this)); } + } + internal PlotArea _plotArea; + + /// + /// Gets or sets a value defining how blanks in the data series should be shown. + /// + public BlankType DisplayBlanksAs + { + get { return _displayBlanksAs; } + set { _displayBlanksAs = value; } + } + internal BlankType _displayBlanksAs; + + /// + /// Gets the DataLabel of the chart. + /// + public DataLabel DataLabel + { + get { return _dataLabel ?? (_dataLabel = new DataLabel(this)); } + } + internal DataLabel _dataLabel; + + /// + /// Gets or sets whether the chart has a DataLabel. + /// + public bool HasDataLabel + { + get { return _hasDataLabel; } + set { _hasDataLabel = value; } + } + internal bool _hasDataLabel; + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/ChartFrame.cs b/PdfSharp.Charting/Charting/ChartFrame.cs new file mode 100644 index 0000000..92ed620 --- /dev/null +++ b/PdfSharp.Charting/Charting/ChartFrame.cs @@ -0,0 +1,228 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; +using PdfSharp.Drawing; +using PdfSharp.Charting.Renderers; + +namespace PdfSharp.Charting +{ + /// + /// Represents the frame which holds one or more charts. + /// + public class ChartFrame + { + /// + /// Initializes a new instance of the ChartFrame class. + /// + public ChartFrame() + { } + + /// + /// Initializes a new instance of the ChartFrame class with the specified rectangle. + /// + public ChartFrame(XRect rect) + { + _location = rect.Location; + _size = rect.Size; + } + + /// + /// Gets or sets the location of the ChartFrame. + /// + public XPoint Location + { + get { return _location; } + set { _location = value; } + } + XPoint _location; + + /// + /// Gets or sets the size of the ChartFrame. + /// + public XSize Size + { + get { return _size; } + set { _size = value; } + } + XSize _size; + + /// + /// Adds a chart to the ChartFrame. + /// + public void Add(Chart chart) + { + if (_chartList == null) + _chartList = new List(); + _chartList.Add(chart); + } + + /// + /// Draws all charts inside the ChartFrame. + /// + public void Draw(XGraphics gfx) + { + // Draw frame of ChartFrame. First shadow frame. + const int dx = 5; + const int dy = 5; + gfx.DrawRoundedRectangle(XBrushes.Gainsboro, + _location.X + dx, _location.Y + dy, + _size.Width, _size.Height, 20, 20); + + XRect chartRect = new XRect(_location.X, _location.Y, _size.Width, _size.Height); + XLinearGradientBrush brush = new XLinearGradientBrush(chartRect, XColor.FromArgb(0xFFD0DEEF), XColors.White, + XLinearGradientMode.Vertical); + XPen penBorder = new XPen(XColors.SteelBlue, 2.5); + gfx.DrawRoundedRectangle(penBorder, brush, + _location.X, _location.Y, _size.Width, _size.Height, + 15, 15); + + XGraphicsState state = gfx.Save(); + gfx.TranslateTransform(_location.X, _location.Y); + + // Calculate rectangle for all charts. Y-Position will be moved for each chart. + int charts = _chartList.Count; + const uint dxChart = 20; + const uint dyChart = 20; + const uint dyBetweenCharts = 30; + XRect rect = new XRect(dxChart, dyChart, + _size.Width - 2 * dxChart, + (_size.Height - (charts - 1) * dyBetweenCharts - 2 * dyChart) / charts); + + // draw each chart in list + foreach (Chart chart in _chartList) + { + RendererParameters parms = new RendererParameters(gfx, rect); + parms.DrawingItem = chart; + + ChartRenderer renderer = GetChartRenderer(chart, parms); + renderer.Init(); + renderer.Format(); + renderer.Draw(); + + rect.Y += rect.Height + dyBetweenCharts; + } + gfx.Restore(state); + + // // Calculate rectangle for all charts. Y-Position will be moved for each chart. + // int charts = chartList.Count; + // uint dxChart = 0; + // uint dyChart = 0; + // uint dyBetweenCharts = 0; + // XRect rect = new XRect(dxChart, dyChart, + // size.Width - 2 * dxChart, + // (size.Height - (charts - 1) * dyBetweenCharts - 2 * dyChart) / charts); + // + // // draw each chart in list + // foreach (Chart chart in chartList) + // { + // RendererParameters parms = new RendererParameters(gfx, rect); + // parms.DrawingItem = chart; + // + // ChartRenderer renderer = GetChartRenderer(chart, parms); + // renderer.Init(); + // renderer.Format(); + // renderer.Draw(); + // + // rect.Y += rect.Height + dyBetweenCharts; + // } + } + + /// + /// Draws first chart only. + /// + public void DrawChart(XGraphics gfx) + { + XGraphicsState state = gfx.Save(); + gfx.TranslateTransform(_location.X, _location.Y); + + if (_chartList.Count > 0) + { + XRect chartRect = new XRect(0, 0, _size.Width, _size.Height); + Chart chart = (Chart)_chartList[0]; + RendererParameters parms = new RendererParameters(gfx, chartRect); + parms.DrawingItem = chart; + + ChartRenderer renderer = GetChartRenderer(chart, parms); + renderer.Init(); + renderer.Format(); + renderer.Draw(); + } + gfx.Restore(state); + } + + /// + /// Returns the chart renderer appropriate for the chart. + /// + private ChartRenderer GetChartRenderer(Chart chart, RendererParameters parms) + { + ChartType chartType = chart.Type; + bool useCombinationRenderer = false; + foreach (Series series in chart._seriesCollection) + { + if (series._chartType != chartType) + { + useCombinationRenderer = true; + break; + } + } + + if (useCombinationRenderer) + return new CombinationChartRenderer(parms); + + switch (chartType) + { + case ChartType.Line: + return new LineChartRenderer(parms); + + case ChartType.Column2D: + case ChartType.ColumnStacked2D: + return new ColumnChartRenderer(parms); + + case ChartType.Bar2D: + case ChartType.BarStacked2D: + return new BarChartRenderer(parms); + + case ChartType.Area2D: + return new AreaChartRenderer(parms); + + case ChartType.Pie2D: + case ChartType.PieExploded2D: + return new PieChartRenderer(parms); + } + + return null; + } + + /// + /// Holds the charts which will be drawn inside the ChartFrame. + /// + List _chartList; + } +} diff --git a/PdfSharp.Charting/Charting/ChartObject.cs b/PdfSharp.Charting/Charting/ChartObject.cs new file mode 100644 index 0000000..fb63c7a --- /dev/null +++ b/PdfSharp.Charting/Charting/ChartObject.cs @@ -0,0 +1,48 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Base class for all chart classes. + /// + public class ChartObject : DocumentObject + { + /// + /// Initializes a new instance of the ChartObject class. + /// + public ChartObject() + { } + + /// + /// Initializes a new instance of the ChartObject class with the specified parent. + /// + internal ChartObject(DocumentObject parent) : base(parent) { } + } +} diff --git a/PdfSharp.Charting/Charting/DataLabel.cs b/PdfSharp.Charting/Charting/DataLabel.cs new file mode 100644 index 0000000..153bfec --- /dev/null +++ b/PdfSharp.Charting/Charting/DataLabel.cs @@ -0,0 +1,134 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if !WINDOWS_PHONE +using System.ComponentModel; +#endif + +namespace PdfSharp.Charting +{ + /// + /// Represents a DataLabel of a Series + /// + public class DataLabel : DocumentObject + { + /// + /// Initializes a new instance of the DataLabel class. + /// + public DataLabel() + { } + + /// + /// Initializes a new instance of the DataLabel class with the specified parent. + /// + internal DataLabel(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new DataLabel Clone() + { + return (DataLabel)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + DataLabel dataLabel = (DataLabel)base.DeepCopy(); + if (dataLabel._font != null) + { + dataLabel._font = dataLabel._font.Clone(); + dataLabel._font._parent = dataLabel; + } + return dataLabel; + } + #endregion + + #region Properties + /// + /// Gets or sets a numeric format string for the DataLabel. + /// + public string Format + { + get { return _format; } + set { _format = value; } + } + internal string _format = String.Empty; + + /// + /// Gets the Font for the DataLabel. + /// + public Font Font + { + get { return _font ?? (_font = new Font(this)); } + } + internal Font _font; + + /// + /// Gets or sets the position of the DataLabel. + /// + public DataLabelPosition Position + { + get { return (DataLabelPosition)_position; } + set + { + if (!Enum.IsDefined(typeof(DataLabelPosition), value)) + throw new InvalidEnumArgumentException("value", (int)value, typeof(DataLabelPosition)); + + _position = value; + _positionInitialized = true; + } + } + internal DataLabelPosition _position; + internal bool _positionInitialized; + + /// + /// Gets or sets the type of the DataLabel. + /// + public DataLabelType Type + { + get { return _type; } + set + { + if (!Enum.IsDefined(typeof(DataLabelType), value)) + throw new InvalidEnumArgumentException("value", (int)value, typeof(DataLabelType)); + + _type = value; + _typeInitialized = true; + } + } + internal DataLabelType _type; + internal bool _typeInitialized; + #endregion + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/Charting/DocumentObject.cs b/PdfSharp.Charting/Charting/DocumentObject.cs new file mode 100644 index 0000000..be172f9 --- /dev/null +++ b/PdfSharp.Charting/Charting/DocumentObject.cs @@ -0,0 +1,87 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Base class for all chart classes. + /// + public class DocumentObject + { + /// + /// Initializes a new instance of the DocumentObject class. + /// + public DocumentObject() + { } + + /// + /// Initializes a new instance of the DocumentObject class with the specified parent. + /// + public DocumentObject(DocumentObject parent) + { + _parent = parent; + } + + #region Methods + /// + /// Creates a deep copy of the DocumentObject. The parent of the new object is null. + /// + public object Clone() + { + return DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected virtual object DeepCopy() + { + DocumentObject value = (DocumentObject)MemberwiseClone(); + value._parent = null; + return value; + } + #endregion + + #region Properties + /// + /// Gets the parent object. + /// + public DocumentObject Parent + { + get { return _parent; } + } + + /// + /// + /// + /*protected*/ + internal DocumentObject _parent; + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/DocumentObjectCollection.cs b/PdfSharp.Charting/Charting/DocumentObjectCollection.cs new file mode 100644 index 0000000..1193742 --- /dev/null +++ b/PdfSharp.Charting/Charting/DocumentObjectCollection.cs @@ -0,0 +1,261 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace PdfSharp.Charting +{ + /// + /// Base class of all collections. + /// + public abstract class DocumentObjectCollection : DocumentObject, IList + { + /// + /// Initializes a new instance of the DocumentObjectCollection class. + /// + internal DocumentObjectCollection() + { + _elements = new List(); + } + + /// + /// Initializes a new instance of the DocumentObjectCollection class with the specified parent. + /// + internal DocumentObjectCollection(DocumentObject parent) + : base(parent) + { + _elements = new List(); + } + + /// + /// Gets the element at the specified index. + /// + public virtual DocumentObject this[int index] + { + get { return _elements[index]; } + internal set { _elements[index] = value; } + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new DocumentObjectCollection Clone() + { + return (DocumentObjectCollection)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + DocumentObjectCollection coll = (DocumentObjectCollection)base.DeepCopy(); + + int count = Count; + coll._elements = new List(count); + for (int index = 0; index < count; ++index) + coll._elements.Add((DocumentObject)this[index].Clone()); + return coll; + } + + /// + /// Copies the Array_List or a portion of it to a one-dimensional array. + /// + public void CopyTo(Array array, int index) + { + throw new NotImplementedException("TODO"); + //elements.CopyTo(array, index); + } + + /// + /// Removes all elements from the collection. + /// + public void Clear() + { + _elements.Clear(); + } + + /// + /// Inserts an element into the collection at the specified position. + /// + public virtual void InsertObject(int index, DocumentObject val) + { + _elements.Insert(index, val); + } + + /// + /// Searches for the specified object and returns the zero-based index of the first occurrence. + /// + public int IndexOf(DocumentObject val) + { + return _elements.IndexOf(val); + } + + /// + /// Removes the element at the specified index. + /// + public void RemoveObjectAt(int index) + { + _elements.RemoveAt(index); + } + + /// + /// Adds the specified document object to the collection. + /// + public virtual void Add(DocumentObject value) + { + if (value != null) + value._parent = this; + _elements.Add(value); + } + #endregion + + #region Properties + /// + /// Gets the number of elements actually contained in the collection. + /// + public int Count + { + get { return _elements.Count; } + } + + /// + /// Gets the first value in the collection, if there is any, otherwise null. + /// + public DocumentObject First + { + get + { + if (Count > 0) + return this[0]; + return null; + } + } + + /// + /// Gets the last element or null, if no such element exists. + /// + public DocumentObject LastObject + { + get + { + int count = _elements.Count; + if (count > 0) + return (DocumentObject)_elements[count - 1]; + return null; + } + } + #endregion + + #region IList + bool IList.IsReadOnly + { + get { return false; } + } + + bool IList.IsFixedSize + { + get { return false; } + } + + object IList.this[int index] + { + get { return _elements[index]; } + set { _elements[index] = (DocumentObject)value; } + } + + void IList.RemoveAt(int index) + { + throw new NotImplementedException("IList.RemoveAt"); + // TODO: Add DocumentObjectCollection.RemoveAt implementation + } + + void IList.Insert(int index, object value) + { + throw new NotImplementedException("IList.Insert"); + // TODO: Add DocumentObjectCollection.Insert implementation + } + + void IList.Remove(object value) + { + throw new NotImplementedException("IList.Remove"); + // TODO: Add DocumentObjectCollection.Remove implementation + } + + bool IList.Contains(object value) + { + throw new NotImplementedException("IList.Contains"); + // TODO: Add DocumentObjectCollection.Contains implementation + //return false; + } + + int System.Collections.IList.IndexOf(object value) + { + throw new NotImplementedException("IList.IndexOf"); + // TODO: Add DocumentObjectCollection.System.Collections.IList.IndexOf implementation + //return 0; + } + + int IList.Add(object value) + { + throw new NotImplementedException("IList.Add"); + // TODO: Add DocumentObjectCollection.Add implementation + //return 0; + } + #endregion + + #region ICollection + bool ICollection.IsSynchronized + { + get { return false; } + } + + object ICollection.SyncRoot + { + get { return null; } + } + #endregion + + /// + /// Returns an enumerator that iterates through a collection. + /// + /// + /// An object that can be used to iterate through the collection. + /// + public IEnumerator GetEnumerator() + { + return _elements.GetEnumerator(); + } + + List _elements; + } +} diff --git a/PdfSharp.Charting/Charting/FillFormat.cs b/PdfSharp.Charting/Charting/FillFormat.cs new file mode 100644 index 0000000..fa7b21f --- /dev/null +++ b/PdfSharp.Charting/Charting/FillFormat.cs @@ -0,0 +1,82 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting +{ + /// + /// Defines the background filling of the shape. + /// + public class FillFormat : DocumentObject + { + /// + /// Initializes a new instance of the FillFormat class. + /// + public FillFormat() + { } + + /// + /// Initializes a new instance of the FillFormat class with the specified parent. + /// + internal FillFormat(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new FillFormat Clone() + { + return (FillFormat)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets the color of the filling. + /// + public XColor Color + { + get { return _color; } + set { _color = value; } + } + internal XColor _color = XColor.Empty; + + /// + /// Gets or sets a value indicating whether the background color should be visible. + /// + public bool Visible + { + get { return _visible; } + set { _visible = value; } + } + internal bool _visible; + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/Font.cs b/PdfSharp.Charting/Charting/Font.cs new file mode 100644 index 0000000..9efa94c --- /dev/null +++ b/PdfSharp.Charting/Charting/Font.cs @@ -0,0 +1,169 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Charting +{ + /// + /// Font represents the formatting of characters in a paragraph. + /// + public sealed class Font : DocumentObject + { + /// + /// Initializes a new instance of the Font class that can be used as a template. + /// + public Font() + { } + + /// + /// Initializes a new instance of the Font class with the specified parent. + /// + internal Font(DocumentObject parent) + : base(parent) + { } + + /// + /// Initializes a new instance of the Font class with the specified name and size. + /// + public Font(string name, XUnit size) + : this() + { + _name = name; + _size = size; + } + + #region Methods + /// + /// Creates a copy of the Font. + /// + public new Font Clone() + { + return (Font)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets the name of the font. + /// + public string Name + { + get { return _name; } + set { _name = value; } + } + internal string _name = String.Empty; + + /// + /// Gets or sets the size of the font. + /// + public XUnit Size + { + get { return _size; } + set { _size = value; } + } + internal XUnit _size; + + /// + /// Gets or sets the bold property. + /// + public bool Bold + { + get { return _bold; } + set { _bold = value; } + } + internal bool _bold; + + /// + /// Gets or sets the italic property. + /// + public bool Italic + { + get { return _italic; } + set { _italic = value; } + } + internal bool _italic; + + /// + /// Gets or sets the underline property. + /// + public Underline Underline + { + get { return _underline; } + set { _underline = value; } + } + internal Underline _underline; + + /// + /// Gets or sets the color property. + /// + public XColor Color + { + get { return _color; } + set { _color = value; } + } + internal XColor _color = XColor.Empty; + + /// + /// Gets or sets the superscript property. + /// + public bool Superscript + { + get { return _superscript; } + set + { + if (_superscript != value) + { + _superscript = value; + _subscript = false; + } + } + } + internal bool _superscript; + + /// + /// Gets or sets the subscript property. + /// + public bool Subscript + { + get { return _subscript; } + set + { + if (_subscript != value) + { + _subscript = value; + _superscript = false; + } + } + } + internal bool _subscript; + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/Gridlines.cs b/PdfSharp.Charting/Charting/Gridlines.cs new file mode 100644 index 0000000..d045fbf --- /dev/null +++ b/PdfSharp.Charting/Charting/Gridlines.cs @@ -0,0 +1,85 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Represents the gridlines on the axes. + /// + public class Gridlines : ChartObject + { + /// + /// Initializes a new instance of the Gridlines class. + /// + public Gridlines() + { } + + /// + /// Initializes a new instance of the Gridlines class with the specified parent. + /// + internal Gridlines(DocumentObject parent) + : base(parent) + { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Gridlines Clone() + { + return (Gridlines)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Gridlines gridlines = (Gridlines)base.DeepCopy(); + if (gridlines._lineFormat != null) + { + gridlines._lineFormat = gridlines._lineFormat.Clone(); + gridlines._lineFormat._parent = gridlines; + } + return gridlines; + } + #endregion + + #region Properties + /// + /// Gets the line format of the grid. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + } + internal LineFormat _lineFormat; + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/Legend.cs b/PdfSharp.Charting/Charting/Legend.cs new file mode 100644 index 0000000..5cc437c --- /dev/null +++ b/PdfSharp.Charting/Charting/Legend.cs @@ -0,0 +1,117 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if !WINDOWS_PHONE +using System.ComponentModel; +#endif + +namespace PdfSharp.Charting +{ + /// + /// Represents a legend of a chart. + /// + public class Legend : ChartObject + { + /// + /// Initializes a new instance of the Legend class. + /// + public Legend() + { } + + /// + /// Initializes a new instance of the Legend class with the specified parent. + /// + internal Legend(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Legend Clone() + { + return (Legend)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Legend legend = (Legend)base.DeepCopy(); + if (legend._lineFormat != null) + { + legend._lineFormat = legend._lineFormat.Clone(); + legend._lineFormat._parent = legend; + } + if (legend._font != null) + { + legend._font = legend._font.Clone(); + legend._font._parent = legend; + } + return legend; + } + #endregion + + #region Properties + /// + /// Gets the line format of the legend's border. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + } + internal LineFormat _lineFormat; + + /// + /// Gets the font of the legend. + /// + public Font Font + { + get { return _font ?? (_font = new Font(this)); } + } + internal Font _font; + + /// + /// Gets or sets the docking type. + /// + public DockingType Docking + { + get { return _docking; } + set + { + if (!Enum.IsDefined(typeof(DockingType), value)) + throw new InvalidEnumArgumentException("value", (int)value, typeof(DockingType)); + _docking = value; + } + } + internal DockingType _docking; + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/LineFormat.cs b/PdfSharp.Charting/Charting/LineFormat.cs new file mode 100644 index 0000000..f6bca55 --- /dev/null +++ b/PdfSharp.Charting/Charting/LineFormat.cs @@ -0,0 +1,112 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting +{ + /// + /// Defines the format of a line in a shape object. + /// + public class LineFormat : DocumentObject + { + /// + /// Initializes a new instance of the LineFormat class. + /// + public LineFormat() + { } + + /// + /// Initializes a new instance of the LineFormat class with the specified parent. + /// + internal LineFormat(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new LineFormat Clone() + { + return (LineFormat)DeepCopy(); + } + #endregion + + #region Properties + /// + /// Gets or sets a value indicating whether the line should be visible. + /// + public bool Visible + { + get { return _visible; } + set { _visible = value; } + } + internal bool _visible; + + /// + /// Gets or sets the width of the line in XUnit. + /// + public XUnit Width + { + get { return _width; } + set { _width = value; } + } + internal XUnit _width; + + /// + /// Gets or sets the color of the line. + /// + public XColor Color + { + get { return _color; } + set { _color = value; } + } + internal XColor _color = XColor.Empty; + + /// + /// Gets or sets the dash style of the line. + /// + public XDashStyle DashStyle + { + get { return _dashStyle; } + set { _dashStyle = value; } + } + internal XDashStyle _dashStyle; + + /// + /// Gets or sets the style of the line. + /// + public LineStyle Style + { + get { return _style; } + set { _style = value; } + } + internal LineStyle _style; + #endregion + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/Charting/PSCSR.cs b/PdfSharp.Charting/Charting/PSCSR.cs new file mode 100644 index 0000000..1497852 --- /dev/null +++ b/PdfSharp.Charting/Charting/PSCSR.cs @@ -0,0 +1,48 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// The Pdf-Sharp-Charting-String-Resources. + /// + // ReSharper disable once InconsistentNaming + internal class PSCSR + { + internal static string InvalidChartTypeForCombination(ChartType chartType) + { + return string.Format("ChartType '{0}' not valid for combination of charts.", chartType.ToString()); + } + + internal static string PercentNotSupportedByColumnDataLabel + { + get { return "Column data label cannot be set to 'Percent'"; } + } + } +} diff --git a/PdfSharp.Charting/Charting/PlotArea.cs b/PdfSharp.Charting/Charting/PlotArea.cs new file mode 100644 index 0000000..c59c6ba --- /dev/null +++ b/PdfSharp.Charting/Charting/PlotArea.cs @@ -0,0 +1,139 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Charting +{ + /// + /// Represents the area where the actual chart is drawn. + /// + public class PlotArea : ChartObject + { + /// + /// Initializes a new instance of the PlotArea class. + /// + internal PlotArea() + { } + + /// + /// Initializes a new instance of the PlotArea class with the specified parent. + /// + internal PlotArea(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new PlotArea Clone() + { + return (PlotArea)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + PlotArea plotArea = (PlotArea)base.DeepCopy(); + if (plotArea._lineFormat != null) + { + plotArea._lineFormat = plotArea._lineFormat.Clone(); + plotArea._lineFormat._parent = plotArea; + } + if (plotArea._fillFormat != null) + { + plotArea._fillFormat = plotArea._fillFormat.Clone(); + plotArea._fillFormat._parent = plotArea; + } + return plotArea; + } + #endregion + + #region Properties + /// + /// Gets the line format of the plot area's border. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + } + internal LineFormat _lineFormat; + + /// + /// Gets the background filling of the plot area. + /// + public FillFormat FillFormat + { + get { return _fillFormat ?? (_fillFormat = new FillFormat(this)); } + } + internal FillFormat _fillFormat; + + /// + /// Gets or sets the left padding of the area. + /// + public XUnit LeftPadding + { + get { return _leftPadding; } + set { _leftPadding = value; } + } + internal XUnit _leftPadding; + + /// + /// Gets or sets the right padding of the area. + /// + public XUnit RightPadding + { + get { return _rightPadding; } + set { _rightPadding = value; } + } + internal XUnit _rightPadding; + + /// + /// Gets or sets the top padding of the area. + /// + public XUnit TopPadding + { + get { return _topPadding; } + set { _topPadding = value; } + } + internal XUnit _topPadding; + + /// + /// Gets or sets the bottom padding of the area. + /// + public XUnit BottomPadding + { + get { return _bottomPadding; } + set { _bottomPadding = value; } + } + internal XUnit _bottomPadding; + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/Point.cs b/PdfSharp.Charting/Charting/Point.cs new file mode 100644 index 0000000..ac3da12 --- /dev/null +++ b/PdfSharp.Charting/Charting/Point.cs @@ -0,0 +1,121 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Represents a formatted value on the data series. + /// + public class Point : ChartObject + { + /// + /// Initializes a new instance of the Point class. + /// + internal Point() + { } + + /// + /// Initializes a new instance of the Point class with a real value. + /// + public Point(double value) + : this() + { + Value = value; + } + + /// + /// Initializes a new instance of the Point class with a real value. + /// + public Point(string value) + : this() + { + // = "34.5 23.9" + Value = 0; + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Point Clone() + { + return (Point)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Point point = (Point)base.DeepCopy(); + if (point._lineFormat != null) + { + point._lineFormat = point._lineFormat.Clone(); + point._lineFormat._parent = point; + } + if (point._fillFormat != null) + { + point._fillFormat = point._fillFormat.Clone(); + point._fillFormat._parent = point; + } + return point; + } + #endregion + + #region Properties + /// + /// Gets the line format of the data point's border. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + } + internal LineFormat _lineFormat; + + /// + /// Gets the filling format of the data point. + /// + public FillFormat FillFormat + { + get { return _fillFormat ?? (_fillFormat = new FillFormat(this)); } + } + internal FillFormat _fillFormat; + + /// + /// The actual value of the data point. + /// + public double Value + { + get { return _value; } + set { _value = value; } + } + internal double _value; + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/Series.cs b/PdfSharp.Charting/Charting/Series.cs new file mode 100644 index 0000000..3d9bc6d --- /dev/null +++ b/PdfSharp.Charting/Charting/Series.cs @@ -0,0 +1,246 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; +#if !SILVERLIGHT +using System.ComponentModel; +#endif + +namespace PdfSharp.Charting +{ + /// + /// Represents a series of data on the chart. + /// + public class Series : ChartObject + { + /// + /// Initializes a new instance of the Series class. + /// + public Series() + { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new Series Clone() + { + return (Series)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + Series series = (Series)base.DeepCopy(); + if (series._seriesElements != null) + { + series._seriesElements = series._seriesElements.Clone(); + series._seriesElements._parent = series; + } + if (series._lineFormat != null) + { + series._lineFormat = series._lineFormat.Clone(); + series._lineFormat._parent = series; + } + if (series._fillFormat != null) + { + series._fillFormat = series._fillFormat.Clone(); + series._fillFormat._parent = series; + } + if (series._dataLabel != null) + { + series._dataLabel = series._dataLabel.Clone(); + series._dataLabel._parent = series; + } + return series; + } + + /// + /// Adds a blank to the series. + /// + public void AddBlank() + { + Elements.AddBlank(); + } + + /// + /// Adds a real value to the series. + /// + public Point Add(double value) + { + return Elements.Add(value); + } + + /// + /// Adds an array of real values to the series. + /// + public void Add(params double[] values) + { + Elements.Add(values); + } + #endregion + + #region Properties + /// + /// The actual value container of the series. + /// + public SeriesElements Elements + { + get { return _seriesElements ?? (_seriesElements = new SeriesElements(this)); } + } + internal SeriesElements _seriesElements; + + /// + /// Gets or sets the name of the series which will be used in the legend. + /// + public string Name + { + get { return _name; } + set { _name = value; } + } + internal string _name = String.Empty; + + /// + /// Gets the line format of the border of each data. + /// + public LineFormat LineFormat + { + get { return _lineFormat ?? (_lineFormat = new LineFormat(this)); } + } + internal LineFormat _lineFormat; + + /// + /// Gets the background filling of the data. + /// + public FillFormat FillFormat + { + get { return _fillFormat ?? (_fillFormat = new FillFormat(this)); } + } + internal FillFormat _fillFormat; + + /// + /// Gets or sets the size of the marker in a line chart. + /// + public XUnit MarkerSize + { + get { return _markerSize; } + set { _markerSize = value; } + } + internal XUnit _markerSize; + + /// + /// Gets or sets the style of the marker in a line chart. + /// + public MarkerStyle MarkerStyle + { + get { return _markerStyle; } + set + { + if (!Enum.IsDefined(typeof(MarkerStyle), value)) + throw new InvalidEnumArgumentException("value", (int)value, typeof(MarkerStyle)); + + _markerStyle = value; + _markerStyleInitialized = true; + } + } + internal MarkerStyle _markerStyle; + internal bool _markerStyleInitialized; + + /// + /// Gets or sets the foreground color of the marker in a line chart. + /// + public XColor MarkerForegroundColor + { + get { return _markerForegroundColor; } + set { _markerForegroundColor = value; } + } + internal XColor _markerForegroundColor = XColor.Empty; + + /// + /// Gets or sets the background color of the marker in a line chart. + /// + public XColor MarkerBackgroundColor + { + get { return _markerBackgroundColor; } + set { _markerBackgroundColor = value; } + } + internal XColor _markerBackgroundColor = XColor.Empty; + + /// + /// Gets or sets the chart type of the series if it's intended to be different than the + /// global chart type. + /// + public ChartType ChartType + { + get { return _chartType; } + set + { + if (!Enum.IsDefined(typeof(ChartType), value)) + throw new InvalidEnumArgumentException("value", (int)value, typeof(ChartType)); + + _chartType = value; + } + } + internal ChartType _chartType; + + /// + /// Gets the DataLabel of the series. + /// + public DataLabel DataLabel + { + get { return _dataLabel ?? (_dataLabel = new DataLabel(this)); } + } + internal DataLabel _dataLabel; + + /// + /// Gets or sets whether the series has a DataLabel. + /// + public bool HasDataLabel + { + get { return _hasDataLabel; } + set { _hasDataLabel = value; } + } + internal bool _hasDataLabel; + + /// + /// Gets the element count of the series. + /// + public int Count + { + get + { + return _seriesElements != null ? _seriesElements.Count : 0; + } + } + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/SeriesCollection.cs b/PdfSharp.Charting/Charting/SeriesCollection.cs new file mode 100644 index 0000000..b2d5947 --- /dev/null +++ b/PdfSharp.Charting/Charting/SeriesCollection.cs @@ -0,0 +1,78 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// The collection of data series. + /// + public class SeriesCollection : DocumentObjectCollection + { + /// + /// Initializes a new instance of the SeriesCollection class. + /// + internal SeriesCollection() + { } + + /// + /// Initializes a new instance of the SeriesCollection class with the specified parent. + /// + internal SeriesCollection(DocumentObject parent) : base(parent) { } + + /// + /// Gets a series by its index. + /// + public new Series this[int index] + { + get { return base[index] as Series; } + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new SeriesCollection Clone() + { + return (SeriesCollection)DeepCopy(); + } + + /// + /// Adds a new series to the collection. + /// + public Series AddSeries() + { + Series series = new Series(); + // Initialize chart type for each new series. + series._chartType = ((Chart)_parent)._type; + Add(series); + return series; + } + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/SeriesElements.cs b/PdfSharp.Charting/Charting/SeriesElements.cs new file mode 100644 index 0000000..21b106e --- /dev/null +++ b/PdfSharp.Charting/Charting/SeriesElements.cs @@ -0,0 +1,93 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Represents the collection of the values in a data series. + /// + public class SeriesElements : DocumentObjectCollection + { + /// + /// Initializes a new instance of the SeriesElements class. + /// + internal SeriesElements() + { } + + /// + /// Initializes a new instance of the SeriesElements class with the specified parent. + /// + internal SeriesElements(DocumentObject parent) : base(parent) { } + + /// + /// Gets a point by its index. + /// + public new Point this[int index] + { + get { return (Point)base[index]; } + } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new SeriesElements Clone() + { + return (SeriesElements)DeepCopy(); + } + + /// + /// Adds a blank to the series. + /// + public void AddBlank() + { + base.Add(null); + } + + /// + /// Adds a new point with a real value to the series. + /// + public Point Add(double value) + { + Point point = new Point(value); + Add(point); + return point; + } + + /// + /// Adds an array of new points with real values to the series. + /// + public void Add(params double[] values) + { + foreach (double val in values) + Add(val); + } + #endregion + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/Charting/TickLabels.cs b/PdfSharp.Charting/Charting/TickLabels.cs new file mode 100644 index 0000000..5718848 --- /dev/null +++ b/PdfSharp.Charting/Charting/TickLabels.cs @@ -0,0 +1,95 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Charting +{ + /// + /// Represents the format of the label of each value on the axis. + /// + public class TickLabels : ChartObject + { + /// + /// Initializes a new instance of the TickLabels class. + /// + public TickLabels() + { } + + /// + /// Initializes a new instance of the TickLabels class with the specified parent. + /// + internal TickLabels(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new TickLabels Clone() + { + return (TickLabels)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + TickLabels tickLabels = (TickLabels)base.DeepCopy(); + if (tickLabels._font != null) + { + tickLabels._font = tickLabels._font.Clone(); + tickLabels._font._parent = tickLabels; + } + return tickLabels; + } + #endregion + + #region Properties + /// + /// Gets or sets the label's number format. + /// + public string Format + { + get { return _format; } + set { _format = value; } + } + internal string _format = String.Empty; + + /// + /// Gets the font of the label. + /// + public Font Font + { + get { return _font ?? (_font = new Font(this)); } + } + internal Font _font; + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/XSeries.cs b/PdfSharp.Charting/Charting/XSeries.cs new file mode 100644 index 0000000..63b919e --- /dev/null +++ b/PdfSharp.Charting/Charting/XSeries.cs @@ -0,0 +1,127 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections; + +namespace PdfSharp.Charting +{ + /// + /// Represents a series of data on the X-Axis. + /// + public class XSeries : ChartObject + { + /// + /// Initializes a new instance of the XSeries class. + /// + public XSeries() + { + _xSeriesElements = new XSeriesElements(); + } + + /// + /// Gets the xvalue at the specified index. + /// + public XValue this[int index] + { + get { return (XValue)_xSeriesElements[index]; } + } + + /// + /// The actual value container of the XSeries. + /// + protected XSeriesElements _xSeriesElements; + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new XSeries Clone() + { + return (XSeries)DeepCopy(); + } + + /// + /// Implements the deep copy of the object. + /// + protected override object DeepCopy() + { + XSeries xSeries = (XSeries)base.DeepCopy(); + if (xSeries._xSeriesElements != null) + { + xSeries._xSeriesElements = xSeries._xSeriesElements.Clone(); + xSeries._xSeriesElements._parent = xSeries; + } + return xSeries; + } + + /// + /// Adds a blank to the XSeries. + /// + public void AddBlank() + { + _xSeriesElements.AddBlank(); + } + + /// + /// Adds a value to the XSeries. + /// + public XValue Add(string value) + { + return _xSeriesElements.Add(value); + } + + /// + /// Adds an array of values to the XSeries. + /// + public void Add(params string[] values) + { + _xSeriesElements.Add(values); + } + + /// + /// Gets the enumerator. + /// + /// + public IEnumerator GetEnumerator() + { + return _xSeriesElements.GetEnumerator(); + } + #endregion + + #region Properties + /// + /// Gets the number of xvalues actually contained in the xseries. + /// + public int Count + { + get { return _xSeriesElements.Count; } + } + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/XSeriesElements.cs b/PdfSharp.Charting/Charting/XSeriesElements.cs new file mode 100644 index 0000000..40a6d44 --- /dev/null +++ b/PdfSharp.Charting/Charting/XSeriesElements.cs @@ -0,0 +1,80 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Represents the collection of the value in an XSeries. + /// + public class XSeriesElements : DocumentObjectCollection + { + /// + /// Initializes a new instance of the XSeriesElements class. + /// + public XSeriesElements() + { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new XSeriesElements Clone() + { + return (XSeriesElements)base.DeepCopy(); + } + + /// + /// Adds a blank to the XSeries. + /// + public void AddBlank() + { + base.Add(null); + } + + /// + /// Adds a value to the XSeries. + /// + public XValue Add(string value) + { + XValue xValue = new XValue(value); + Add(xValue); + return xValue; + } + + /// + /// Adds an array of values to the XSeries. + /// + public void Add(params string[] values) + { + foreach (string val in values) + Add(val); + } + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/XValue.cs b/PdfSharp.Charting/Charting/XValue.cs new file mode 100644 index 0000000..fe9a9bc --- /dev/null +++ b/PdfSharp.Charting/Charting/XValue.cs @@ -0,0 +1,72 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Charting +{ + /// + /// Represents the actual value on the XSeries. + /// + public class XValue : ChartObject + { + /// + /// Initializes a new instance of the XValue class. + /// + internal XValue() + { } + + /// + /// Initializes a new instance of the XValue class with the specified value. + /// + public XValue(string value) + : this() + { + if (value == null) + throw new ArgumentNullException("value"); + + _value = value; + } + + /// + /// The actual value of the XValue. + /// + internal string _value; + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new XValue Clone() + { + return (XValue)DeepCopy(); + } + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/XValues.cs b/PdfSharp.Charting/Charting/XValues.cs new file mode 100644 index 0000000..d707d33 --- /dev/null +++ b/PdfSharp.Charting/Charting/XValues.cs @@ -0,0 +1,76 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Represents the collection of values on the X-Axis. + /// + public class XValues : DocumentObjectCollection + { + /// + /// Initializes a new instance of the XValues class. + /// + public XValues() + { } + + /// + /// Initializes a new instance of the XValues class with the specified parent. + /// + internal XValues(DocumentObject parent) : base(parent) { } + + #region Methods + /// + /// Creates a deep copy of this object. + /// + public new XValues Clone() + { + return (XValues)DeepCopy(); + } + + /// + /// Gets an XSeries by its index. + /// + public new XSeries this[int index] + { + get { return base[index] as XSeries; } + } + + /// + /// Adds a new XSeries to the collection. + /// + public XSeries AddXSeries() + { + XSeries xSeries = new XSeries(); + Add(xSeries); + return xSeries; + } + #endregion + } +} diff --git a/PdfSharp.Charting/Charting/enums/BlankType.cs b/PdfSharp.Charting/Charting/enums/BlankType.cs new file mode 100644 index 0000000..6ba3d75 --- /dev/null +++ b/PdfSharp.Charting/Charting/enums/BlankType.cs @@ -0,0 +1,52 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Determines how null values will be handled in a chart. + /// + public enum BlankType + { + /// + /// Null value is not plotted. + /// + NotPlotted, + + /// + /// Null value will be interpolated. + /// + Interpolated, + + /// + /// Null value will be handled as zero. + /// + Zero + } +} diff --git a/PdfSharp.Charting/Charting/enums/ChartType.cs b/PdfSharp.Charting/Charting/enums/ChartType.cs new file mode 100644 index 0000000..bb401a5 --- /dev/null +++ b/PdfSharp.Charting/Charting/enums/ChartType.cs @@ -0,0 +1,77 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Specifies with type of chart will be drawn. + /// + public enum ChartType + { + /// + /// A line chart. + /// + Line, + + /// + /// A clustered 2d column chart. + /// + Column2D, + + /// + /// A stacked 2d column chart. + /// + ColumnStacked2D, + + /// + /// A 2d area chart. + /// + Area2D, + + /// + /// A clustered 2d bar chart. + /// + Bar2D, + + /// + /// A stacked 2d bar chart. + /// + BarStacked2D, + + /// + /// A 2d pie chart. + /// + Pie2D, + + /// + /// An exploded 2d pie chart. + /// + PieExploded2D, + } +} diff --git a/PdfSharp.Charting/Charting/enums/DataLabelPosition.cs b/PdfSharp.Charting/Charting/enums/DataLabelPosition.cs new file mode 100644 index 0000000..7bbb2f7 --- /dev/null +++ b/PdfSharp.Charting/Charting/enums/DataLabelPosition.cs @@ -0,0 +1,57 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Determines where the data label will be positioned. + /// + public enum DataLabelPosition + { + /// + /// DataLabel will be centered inside the bar or pie. + /// + Center, + + /// + /// Inside the bar or pie at the origin. + /// + InsideBase, + + /// + /// Inside the bar or pie at the edge. + /// + InsideEnd, + + /// + /// Outside the bar or pie. + /// + OutsideEnd + } +} diff --git a/PdfSharp.Charting/Charting/enums/DataLabelType.cs b/PdfSharp.Charting/Charting/enums/DataLabelType.cs new file mode 100644 index 0000000..fef4d24 --- /dev/null +++ b/PdfSharp.Charting/Charting/enums/DataLabelType.cs @@ -0,0 +1,52 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Determines the type of the data label. + /// + public enum DataLabelType + { + /// + /// No DataLabel. + /// + None, + + /// + /// Percentage of the data. For pie charts only. + /// + Percent, + + /// + /// Value of the data. + /// + Value + } +} diff --git a/PdfSharp.Charting/Charting/enums/DockingType.cs b/PdfSharp.Charting/Charting/enums/DockingType.cs new file mode 100644 index 0000000..406e206 --- /dev/null +++ b/PdfSharp.Charting/Charting/enums/DockingType.cs @@ -0,0 +1,54 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Specifies the legend's position inside the chart. + /// + public enum DockingType + { + /// + /// Above the chart. + /// + Top, + /// + /// Below the chart. + /// + Bottom, + /// + /// Left from the chart. + /// + Left, + /// + /// Right from the chart. + /// + Right + } +} diff --git a/PdfSharp.Charting/Charting/enums/FontProperties.cs b/PdfSharp.Charting/Charting/enums/FontProperties.cs new file mode 100644 index 0000000..f15b8cc --- /dev/null +++ b/PdfSharp.Charting/Charting/enums/FontProperties.cs @@ -0,0 +1,52 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Charting +{ + /// + /// Specifies the properties for the font. + /// FOR INTERNAL USE ONLY. + /// + [Flags] + enum FontProperties + { + None = 0x0000, + Name = 0x0001, + Size = 0x0002, + Bold = 0x0004, + Italic = 0x0008, + Underline = 0x0010, + Color = 0x0020, + Border = 0x0040, + Superscript = 0x0080, + Subscript = 0x0100, + } +} diff --git a/PdfSharp.Charting/Charting/enums/HorizontalAlignment.cs b/PdfSharp.Charting/Charting/enums/HorizontalAlignment.cs new file mode 100644 index 0000000..26fb8cb --- /dev/null +++ b/PdfSharp.Charting/Charting/enums/HorizontalAlignment.cs @@ -0,0 +1,52 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Used to determine the horizontal alignment of the axis title. + /// + public enum HorizontalAlignment + { + /// + /// Axis title will be left aligned. + /// + Left, + + /// + /// Axis title will be right aligned. + /// + Right, + + /// + /// Axis title will be centered. + /// + Center + } +} diff --git a/PdfSharp.Charting/Charting/enums/LineStyle.cs b/PdfSharp.Charting/Charting/enums/LineStyle.cs new file mode 100644 index 0000000..c463924 --- /dev/null +++ b/PdfSharp.Charting/Charting/enums/LineStyle.cs @@ -0,0 +1,42 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Specifies the line style of the LineFormat object. + /// + public enum LineStyle + { + /// + /// + /// + Single + } +} diff --git a/PdfSharp.Charting/Charting/enums/MarkerStyle.cs b/PdfSharp.Charting/Charting/enums/MarkerStyle.cs new file mode 100644 index 0000000..b4deca5 --- /dev/null +++ b/PdfSharp.Charting/Charting/enums/MarkerStyle.cs @@ -0,0 +1,78 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Symbols of a data point in a line chart. + /// + public enum MarkerStyle + { + /// + /// + /// + None, + /// + /// + /// + Circle, + /// + /// + /// + Dash, + /// + /// + /// + Diamond, + /// + /// + /// + Dot, + /// + /// + /// + Plus, + /// + /// + /// + Square, + /// + /// + /// + Star, + /// + /// + /// + Triangle, + /// + /// + /// + X + } +} diff --git a/PdfSharp.Charting/Charting/enums/TickMarkType.cs b/PdfSharp.Charting/Charting/enums/TickMarkType.cs new file mode 100644 index 0000000..cb3a6a7 --- /dev/null +++ b/PdfSharp.Charting/Charting/enums/TickMarkType.cs @@ -0,0 +1,57 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Determines the position where the Tickmarks will be rendered. + /// + public enum TickMarkType + { + /// + /// Tickmarks are not rendered. + /// + None, + + /// + /// Tickmarks are rendered inside the plot area. + /// + Inside, + + /// + /// Tickmarks are rendered outside the plot area. + /// + Outside, + + /// + /// Tickmarks are rendered inside and outside the plot area. + /// + Cross + } +} diff --git a/PdfSharp.Charting/Charting/enums/Underline.cs b/PdfSharp.Charting/Charting/enums/Underline.cs new file mode 100644 index 0000000..fa8b9a9 --- /dev/null +++ b/PdfSharp.Charting/Charting/enums/Underline.cs @@ -0,0 +1,66 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Specifies the underline type for the font. + /// + public enum Underline + { + /// + /// + /// + None, + /// + /// + /// + Single, + /// + /// + /// + Words, + /// + /// + /// + Dotted, + /// + /// + /// + Dash, + /// + /// + /// + DotDash, + /// + /// + /// + DotDotDash, + } +} diff --git a/PdfSharp.Charting/Charting/enums/VerticalAlignment.cs b/PdfSharp.Charting/Charting/enums/VerticalAlignment.cs new file mode 100644 index 0000000..7b24ef7 --- /dev/null +++ b/PdfSharp.Charting/Charting/enums/VerticalAlignment.cs @@ -0,0 +1,52 @@ +#region PDFsharp Charting - A .NET charting library based on PDFsharp +// +// Authors: +// Niklas Schneider +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Charting +{ + /// + /// Used to determine the vertical alignment of the axis title. + /// + public enum VerticalAlignment + { + /// + /// Axis title will be top aligned. + /// + Top, + + /// + /// Axis title will be centered. + /// + Center, + + /// + /// Axis title will be bottom aligned. + /// + Bottom + } +} diff --git a/PdfSharp.Charting/PdfSharp.Charting.csproj b/PdfSharp.Charting/PdfSharp.Charting.csproj new file mode 100644 index 0000000..f34e6f1 --- /dev/null +++ b/PdfSharp.Charting/PdfSharp.Charting.csproj @@ -0,0 +1,31 @@ + + + + 3.0.0.0 + netstandard2.0 + $(DefineConstants);CORE;CORE_WITH_GDI + PdfSharp.Charting + PdfSharp.Charting + false + false + false + false + false + false + false + PdfSharp.Charting + + + + + + + + + + + + + + + diff --git a/PdfSharp.Charting/PdfSharp.Charting.csproj_orig b/PdfSharp.Charting/PdfSharp.Charting.csproj_orig new file mode 100644 index 0000000..3c79e8d --- /dev/null +++ b/PdfSharp.Charting/PdfSharp.Charting.csproj_orig @@ -0,0 +1,158 @@ + + + + + Debug + AnyCPU + {6F98A822-41B0-4C7A-85A6-E95C1D3E88EF} + Library + Properties + PdfSharp + PdfSharp.Charting + v2.0 + 512 + + + true + full + false + bin\Debug\ + TRACE;DEBUG;CORE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE;CORE + prompt + 4 + bin\Release\PdfSharp.Charting.xml + + + true + + + StrongnameKey.snk + + + + + + + + root\VersionInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {5a6055bc-bf86-4fdd-9f62-0109db7a303b} + PdfSharp + + + + + \ No newline at end of file diff --git a/PdfSharp.Charting/Resources/Messages.de.restext b/PdfSharp.Charting/Resources/Messages.de.restext new file mode 100644 index 0000000..ddbdd0f --- /dev/null +++ b/PdfSharp.Charting/Resources/Messages.de.restext @@ -0,0 +1,7 @@ +; PDFsharp string resources (German) +; +; Must be saved as Unicode (UTF-8 with signature) to force resgen.exe to process German umlauts. + +CultureID = Deutsch (de) + +; ----- Charting Messages ------------------------------------------------------------------------- diff --git a/PdfSharp.Charting/Resources/Messages.restext b/PdfSharp.Charting/Resources/Messages.restext new file mode 100644 index 0000000..5f53d32 --- /dev/null +++ b/PdfSharp.Charting/Resources/Messages.restext @@ -0,0 +1,7 @@ +; PDFsharp string resources (English) +; +; + +CultureID = Neutral + +; ----- Charting Messages ------------------------------------------------------------------------- diff --git a/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.Charting.deps.json b/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.Charting.deps.json new file mode 100644 index 0000000..208e602 --- /dev/null +++ b/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.Charting.deps.json @@ -0,0 +1,77 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "PdfSharp.Charting/3.0.0.0": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "PdfSharp": "3.0.0", + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "PdfSharp.Charting.dll": {} + } + }, + "Microsoft.NETCore.Platforms/1.1.0": {}, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "System.Drawing.Common/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Drawing.Common.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "PdfSharp/3.0.0": { + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "PdfSharp.dll": {} + } + } + } + }, + "libraries": { + "PdfSharp.Charting/3.0.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "path": "microsoft.netcore.platforms/1.1.0", + "hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "System.Drawing.Common/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AiJFxxVPdeITstiRS5aAu8+8Dpf5NawTMoapZ53Gfirml24p7HIfhjmCRxdXnmmf3IUA3AX3CcW7G73CjWxW/Q==", + "path": "system.drawing.common/4.5.0", + "hashPath": "system.drawing.common.4.5.0.nupkg.sha512" + }, + "PdfSharp/3.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.Charting.dll b/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.Charting.dll new file mode 100644 index 0000000..af1412c Binary files /dev/null and b/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.Charting.dll differ diff --git a/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.Charting.pdb b/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.Charting.pdb new file mode 100644 index 0000000..f6365b7 Binary files /dev/null and b/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.Charting.pdb differ diff --git a/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.dll b/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.dll new file mode 100644 index 0000000..4050264 Binary files /dev/null and b/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.dll differ diff --git a/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.pdb b/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.pdb new file mode 100644 index 0000000..f3c0d1d Binary files /dev/null and b/PdfSharp.Charting/bin/Debug/netstandard2.0/PdfSharp.pdb differ diff --git a/PdfSharp.Charting/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs b/PdfSharp.Charting/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs new file mode 100644 index 0000000..45b1ca0 --- /dev/null +++ b/PdfSharp.Charting/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] diff --git a/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.AssemblyInfo.cs b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.AssemblyInfo.cs new file mode 100644 index 0000000..338aef5 --- /dev/null +++ b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.AssemblyInfo.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("3.0.0.0")] + +// Создано классом WriteCodeFragment MSBuild. + diff --git a/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.AssemblyInfoInputs.cache b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.AssemblyInfoInputs.cache new file mode 100644 index 0000000..b902023 --- /dev/null +++ b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +c9bbb4259b11bff14843734a92523ce79fd4d971 diff --git a/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.assets.cache b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.assets.cache new file mode 100644 index 0000000..e2c7dac Binary files /dev/null and b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.assets.cache differ diff --git a/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csproj.CopyComplete b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csproj.CoreCompileInputs.cache b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..fb7323a --- /dev/null +++ b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +dcce592c6865c66649bf4a9a43eddd0bdda2e1c9 diff --git a/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csproj.FileListAbsolute.txt b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..094443d --- /dev/null +++ b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csproj.FileListAbsolute.txt @@ -0,0 +1,12 @@ +F:\Projects1\PdfSharp.Charting\bin\Debug\netstandard2.0\PdfSharp.Charting.deps.json +F:\Projects1\PdfSharp.Charting\bin\Debug\netstandard2.0\PdfSharp.Charting.dll +F:\Projects1\PdfSharp.Charting\bin\Debug\netstandard2.0\PdfSharp.Charting.pdb +F:\Projects1\PdfSharp.Charting\bin\Debug\netstandard2.0\PdfSharp.dll +F:\Projects1\PdfSharp.Charting\bin\Debug\netstandard2.0\PdfSharp.pdb +F:\Projects1\PdfSharp.Charting\obj\Debug\netstandard2.0\PdfSharp.Charting.csprojAssemblyReference.cache +F:\Projects1\PdfSharp.Charting\obj\Debug\netstandard2.0\PdfSharp.Charting.AssemblyInfoInputs.cache +F:\Projects1\PdfSharp.Charting\obj\Debug\netstandard2.0\PdfSharp.Charting.AssemblyInfo.cs +F:\Projects1\PdfSharp.Charting\obj\Debug\netstandard2.0\PdfSharp.Charting.csproj.CoreCompileInputs.cache +F:\Projects1\PdfSharp.Charting\obj\Debug\netstandard2.0\PdfSharp.Charting.csproj.CopyComplete +F:\Projects1\PdfSharp.Charting\obj\Debug\netstandard2.0\PdfSharp.Charting.dll +F:\Projects1\PdfSharp.Charting\obj\Debug\netstandard2.0\PdfSharp.Charting.pdb diff --git a/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csprojAssemblyReference.cache b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csprojAssemblyReference.cache new file mode 100644 index 0000000..a4b04df Binary files /dev/null and b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csprojAssemblyReference.cache differ diff --git a/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.dll b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.dll new file mode 100644 index 0000000..af1412c Binary files /dev/null and b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.dll differ diff --git a/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.pdb b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.pdb new file mode 100644 index 0000000..f6365b7 Binary files /dev/null and b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.pdb differ diff --git a/PdfSharp.Charting/obj/PdfSharp.Charting.csproj.nuget.dgspec.json b/PdfSharp.Charting/obj/PdfSharp.Charting.csproj.nuget.dgspec.json new file mode 100644 index 0000000..80d35d1 --- /dev/null +++ b/PdfSharp.Charting/obj/PdfSharp.Charting.csproj.nuget.dgspec.json @@ -0,0 +1,140 @@ +{ + "format": 1, + "restore": { + "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj": {} + }, + "projects": { + "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj", + "projectName": "PdfSharp.Charting", + "projectPath": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\PdfSharp.Charting\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": { + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj", + "projectName": "PdfSharp", + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\PdfSharp\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/obj/PdfSharp.Charting.csproj.nuget.g.props b/PdfSharp.Charting/obj/PdfSharp.Charting.csproj.nuget.g.props new file mode 100644 index 0000000..1771934 --- /dev/null +++ b/PdfSharp.Charting/obj/PdfSharp.Charting.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\google\.nuget\packages\;C:\Microsoft\Xamarin\NuGet\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder + PackageReference + 5.6.0 + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/PdfSharp.Charting/obj/PdfSharp.Charting.csproj.nuget.g.targets b/PdfSharp.Charting/obj/PdfSharp.Charting.csproj.nuget.g.targets new file mode 100644 index 0000000..f09823b --- /dev/null +++ b/PdfSharp.Charting/obj/PdfSharp.Charting.csproj.nuget.g.targets @@ -0,0 +1,9 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + \ No newline at end of file diff --git a/PdfSharp.Charting/obj/project.assets.json b/PdfSharp.Charting/obj/project.assets.json new file mode 100644 index 0000000..337a094 --- /dev/null +++ b/PdfSharp.Charting/obj/project.assets.json @@ -0,0 +1,316 @@ +{ + "version": 3, + "targets": { + ".NETStandard,Version=v2.0": { + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + }, + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + }, + "build": { + "build/netstandard2.0/NETStandard.Library.targets": {} + } + }, + "System.Drawing.Common/4.5.0": { + "type": "package", + "compile": { + "ref/netstandard2.0/System.Drawing.Common.dll": {} + }, + "runtime": { + "lib/netstandard2.0/System.Drawing.Common.dll": {} + } + }, + "PdfSharp/3.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "compile": { + "bin/placeholder/PdfSharp.dll": {} + }, + "runtime": { + "bin/placeholder/PdfSharp.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.NETCore.Platforms/1.1.0": { + "sha512": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "type": "package", + "path": "microsoft.netcore.platforms/1.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "ThirdPartyNotices.txt", + "dotnet_library_license.txt", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.1.1.0.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json" + ] + }, + "NETStandard.Library/2.0.3": { + "sha512": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "type": "package", + "path": "netstandard.library/2.0.3", + "files": [ + ".nupkg.metadata", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "build/netstandard2.0/NETStandard.Library.targets", + "build/netstandard2.0/ref/Microsoft.Win32.Primitives.dll", + "build/netstandard2.0/ref/System.AppContext.dll", + "build/netstandard2.0/ref/System.Collections.Concurrent.dll", + "build/netstandard2.0/ref/System.Collections.NonGeneric.dll", + "build/netstandard2.0/ref/System.Collections.Specialized.dll", + "build/netstandard2.0/ref/System.Collections.dll", + "build/netstandard2.0/ref/System.ComponentModel.Composition.dll", + "build/netstandard2.0/ref/System.ComponentModel.EventBasedAsync.dll", + "build/netstandard2.0/ref/System.ComponentModel.Primitives.dll", + "build/netstandard2.0/ref/System.ComponentModel.TypeConverter.dll", + "build/netstandard2.0/ref/System.ComponentModel.dll", + "build/netstandard2.0/ref/System.Console.dll", + "build/netstandard2.0/ref/System.Core.dll", + "build/netstandard2.0/ref/System.Data.Common.dll", + "build/netstandard2.0/ref/System.Data.dll", + "build/netstandard2.0/ref/System.Diagnostics.Contracts.dll", + "build/netstandard2.0/ref/System.Diagnostics.Debug.dll", + "build/netstandard2.0/ref/System.Diagnostics.FileVersionInfo.dll", + "build/netstandard2.0/ref/System.Diagnostics.Process.dll", + "build/netstandard2.0/ref/System.Diagnostics.StackTrace.dll", + "build/netstandard2.0/ref/System.Diagnostics.TextWriterTraceListener.dll", + "build/netstandard2.0/ref/System.Diagnostics.Tools.dll", + "build/netstandard2.0/ref/System.Diagnostics.TraceSource.dll", + "build/netstandard2.0/ref/System.Diagnostics.Tracing.dll", + "build/netstandard2.0/ref/System.Drawing.Primitives.dll", + "build/netstandard2.0/ref/System.Drawing.dll", + "build/netstandard2.0/ref/System.Dynamic.Runtime.dll", + "build/netstandard2.0/ref/System.Globalization.Calendars.dll", + "build/netstandard2.0/ref/System.Globalization.Extensions.dll", + "build/netstandard2.0/ref/System.Globalization.dll", + "build/netstandard2.0/ref/System.IO.Compression.FileSystem.dll", + "build/netstandard2.0/ref/System.IO.Compression.ZipFile.dll", + "build/netstandard2.0/ref/System.IO.Compression.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.DriveInfo.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.Primitives.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.Watcher.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.dll", + "build/netstandard2.0/ref/System.IO.IsolatedStorage.dll", + "build/netstandard2.0/ref/System.IO.MemoryMappedFiles.dll", + "build/netstandard2.0/ref/System.IO.Pipes.dll", + "build/netstandard2.0/ref/System.IO.UnmanagedMemoryStream.dll", + "build/netstandard2.0/ref/System.IO.dll", + "build/netstandard2.0/ref/System.Linq.Expressions.dll", + "build/netstandard2.0/ref/System.Linq.Parallel.dll", + "build/netstandard2.0/ref/System.Linq.Queryable.dll", + "build/netstandard2.0/ref/System.Linq.dll", + "build/netstandard2.0/ref/System.Net.Http.dll", + "build/netstandard2.0/ref/System.Net.NameResolution.dll", + "build/netstandard2.0/ref/System.Net.NetworkInformation.dll", + "build/netstandard2.0/ref/System.Net.Ping.dll", + "build/netstandard2.0/ref/System.Net.Primitives.dll", + "build/netstandard2.0/ref/System.Net.Requests.dll", + "build/netstandard2.0/ref/System.Net.Security.dll", + "build/netstandard2.0/ref/System.Net.Sockets.dll", + "build/netstandard2.0/ref/System.Net.WebHeaderCollection.dll", + "build/netstandard2.0/ref/System.Net.WebSockets.Client.dll", + "build/netstandard2.0/ref/System.Net.WebSockets.dll", + "build/netstandard2.0/ref/System.Net.dll", + "build/netstandard2.0/ref/System.Numerics.dll", + "build/netstandard2.0/ref/System.ObjectModel.dll", + "build/netstandard2.0/ref/System.Reflection.Extensions.dll", + "build/netstandard2.0/ref/System.Reflection.Primitives.dll", + "build/netstandard2.0/ref/System.Reflection.dll", + "build/netstandard2.0/ref/System.Resources.Reader.dll", + "build/netstandard2.0/ref/System.Resources.ResourceManager.dll", + "build/netstandard2.0/ref/System.Resources.Writer.dll", + "build/netstandard2.0/ref/System.Runtime.CompilerServices.VisualC.dll", + "build/netstandard2.0/ref/System.Runtime.Extensions.dll", + "build/netstandard2.0/ref/System.Runtime.Handles.dll", + "build/netstandard2.0/ref/System.Runtime.InteropServices.RuntimeInformation.dll", + "build/netstandard2.0/ref/System.Runtime.InteropServices.dll", + "build/netstandard2.0/ref/System.Runtime.Numerics.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Formatters.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Json.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Primitives.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Xml.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.dll", + "build/netstandard2.0/ref/System.Runtime.dll", + "build/netstandard2.0/ref/System.Security.Claims.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Algorithms.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Csp.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Encoding.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Primitives.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.X509Certificates.dll", + "build/netstandard2.0/ref/System.Security.Principal.dll", + "build/netstandard2.0/ref/System.Security.SecureString.dll", + "build/netstandard2.0/ref/System.ServiceModel.Web.dll", + "build/netstandard2.0/ref/System.Text.Encoding.Extensions.dll", + "build/netstandard2.0/ref/System.Text.Encoding.dll", + "build/netstandard2.0/ref/System.Text.RegularExpressions.dll", + "build/netstandard2.0/ref/System.Threading.Overlapped.dll", + "build/netstandard2.0/ref/System.Threading.Tasks.Parallel.dll", + "build/netstandard2.0/ref/System.Threading.Tasks.dll", + "build/netstandard2.0/ref/System.Threading.Thread.dll", + "build/netstandard2.0/ref/System.Threading.ThreadPool.dll", + "build/netstandard2.0/ref/System.Threading.Timer.dll", + "build/netstandard2.0/ref/System.Threading.dll", + "build/netstandard2.0/ref/System.Transactions.dll", + "build/netstandard2.0/ref/System.ValueTuple.dll", + "build/netstandard2.0/ref/System.Web.dll", + "build/netstandard2.0/ref/System.Windows.dll", + "build/netstandard2.0/ref/System.Xml.Linq.dll", + "build/netstandard2.0/ref/System.Xml.ReaderWriter.dll", + "build/netstandard2.0/ref/System.Xml.Serialization.dll", + "build/netstandard2.0/ref/System.Xml.XDocument.dll", + "build/netstandard2.0/ref/System.Xml.XPath.XDocument.dll", + "build/netstandard2.0/ref/System.Xml.XPath.dll", + "build/netstandard2.0/ref/System.Xml.XmlDocument.dll", + "build/netstandard2.0/ref/System.Xml.XmlSerializer.dll", + "build/netstandard2.0/ref/System.Xml.dll", + "build/netstandard2.0/ref/System.dll", + "build/netstandard2.0/ref/mscorlib.dll", + "build/netstandard2.0/ref/netstandard.dll", + "build/netstandard2.0/ref/netstandard.xml", + "lib/netstandard1.0/_._", + "netstandard.library.2.0.3.nupkg.sha512", + "netstandard.library.nuspec" + ] + }, + "System.Drawing.Common/4.5.0": { + "sha512": "AiJFxxVPdeITstiRS5aAu8+8Dpf5NawTMoapZ53Gfirml24p7HIfhjmCRxdXnmmf3IUA3AX3CcW7G73CjWxW/Q==", + "type": "package", + "path": "system.drawing.common/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net461/System.Drawing.Common.dll", + "lib/netstandard2.0/System.Drawing.Common.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net461/System.Drawing.Common.dll", + "ref/netstandard2.0/System.Drawing.Common.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll", + "runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll", + "system.drawing.common.4.5.0.nupkg.sha512", + "system.drawing.common.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "PdfSharp/3.0.0": { + "type": "project", + "path": "../PdfSharp/PdfSharp.csproj", + "msbuildProject": "../PdfSharp/PdfSharp.csproj" + } + }, + "projectFileDependencyGroups": { + ".NETStandard,Version=v2.0": [ + "NETStandard.Library >= 2.0.3", + "PdfSharp >= 3.0.0", + "System.Drawing.Common >= 4.5.0" + ] + }, + "packageFolders": { + "C:\\Users\\google\\.nuget\\packages\\": {}, + "C:\\Microsoft\\Xamarin\\NuGet\\": {}, + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {} + }, + "project": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj", + "projectName": "PdfSharp.Charting", + "projectPath": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\PdfSharp.Charting\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": { + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/PdfSharp.Charting/obj/project.nuget.cache b/PdfSharp.Charting/obj/project.nuget.cache new file mode 100644 index 0000000..a44b69d --- /dev/null +++ b/PdfSharp.Charting/obj/project.nuget.cache @@ -0,0 +1,12 @@ +{ + "version": 2, + "dgSpecHash": "itc+HkE+PPUVGgNXzbLv7aC/Ix7SfAgwaJ8WngMZTXLED3SlDxwJ4k8mH+t4WQobeulkRRpgSk2Ln8iPW8cPqw==", + "success": true, + "projectFilePath": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj", + "expectedPackageFiles": [ + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\netstandard.library\\2.0.3\\netstandard.library.2.0.3.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\system.drawing.common\\4.5.0\\system.drawing.common.4.5.0.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/PdfSharp/!JetBrains/Annotations.cs b/PdfSharp/!JetBrains/Annotations.cs new file mode 100644 index 0000000..345f142 --- /dev/null +++ b/PdfSharp/!JetBrains/Annotations.cs @@ -0,0 +1,695 @@ +/* + * Copyright 2007-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Not yet used in PDFsharp. + +#pragma warning disable 1591 + +// Currently not used. +#if true_ +using System; +using System.ComponentModel; + +namespace JetBrains.Annotations +{ + /// + /// Indicates that marked element should be localized or not. + /// + /// + /// + /// [LocalizationRequiredAttribute(true)] + /// public class Foo + /// { + /// private string str = "my string"; // Warning: Localizable string + /// } + /// + /// + [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)] + public sealed class LocalizationRequiredAttribute : Attribute + { + /// + /// Initializes a new instance of the class with + /// set to . + /// + public LocalizationRequiredAttribute() + : this(true) + { } + + /// + /// Initializes a new instance of the class. + /// + /// true if a element should be localized; otherwise, false. + public LocalizationRequiredAttribute(bool required) + { + Required = required; + } + + /// + /// Gets a value indicating whether a element should be localized. + /// true if a element should be localized; otherwise, false. + /// + [UsedImplicitly] + public bool Required { get; private set; } + + /// + /// Returns whether the value of the given object is equal to the current . + /// + /// The object to test the value equality of. + /// + /// true if the value of the given object is equal to that of the current; otherwise, false. + /// + public override bool Equals(object obj) + { + var attribute = obj as LocalizationRequiredAttribute; + return attribute != null && attribute.Required == Required; + } + + /// + /// Returns the hash code for this instance. + /// + /// A hash code for the current . + public override int GetHashCode() + { + return base.GetHashCode(); + } + } + + /// + /// Indicates that the marked method builds string by format pattern and (optional) arguments. + /// Parameter, which contains format string, should be given in constructor. + /// The format string should be in -like form + /// + /// + /// + /// [StringFormatMethod("message")] + /// public void ShowError(string message, params object[] args) + /// { + /// //Do something + /// } + /// public void Foo() + /// { + /// ShowError("Failed: {0}"); // Warning: Non-existing argument in format string + /// } + /// + /// + [AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] + public sealed class StringFormatMethodAttribute : Attribute + { + /// + /// Initializes new instance of StringFormatMethodAttribute + /// + /// Specifies which parameter of an annotated method should be treated as format-string + public StringFormatMethodAttribute(string formatParameterName) + { + FormatParameterName = formatParameterName; + } + + /// + /// Gets format parameter name + /// + [UsedImplicitly] + public string FormatParameterName { get; private set; } + } + + /// + /// Indicates that the function argument should be string literal and match one of the parameters + /// of the caller function. + /// For example, ReSharper annotates the parameter of . + /// + /// + /// + /// public void Foo(string param) + /// { + /// if (param == null) + /// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol + /// } + /// + /// + [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] + public sealed class InvokerParameterNameAttribute : Attribute { } + + /// + /// Indicates that the method is contained in a type that implements + /// interface + /// and this method is used to notify that some property value changed. + /// + /// + /// The method should be non-static and conform to one of the supported signatures: + /// + /// NotifyChanged(string) + /// NotifyChanged(params string[]) + /// NotifyChanged{T}(Expression{Func{T}}) + /// NotifyChanged{T,U}(Expression{Func{T,U}}) + /// SetProperty{T}(ref T, T, string) + /// + /// + /// + /// + /// public class Foo : INotifyPropertyChanged + /// { + /// public event PropertyChangedEventHandler PropertyChanged; + /// + /// [NotifyPropertyChangedInvocator] + /// protected virtual void NotifyChanged(string propertyName) + /// {} + /// + /// private string _name; + /// public string Name + /// { + /// get { return _name; } + /// set + /// { + /// _name = value; + /// NotifyChanged("LastName"); // Warning + /// } + /// } + /// } + /// + /// Examples of generated notifications: + /// + /// NotifyChanged("Property") + /// NotifyChanged(() => Property) + /// NotifyChanged((VM x) => x.Property) + /// SetProperty(ref myField, value, "Property") + /// + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] + public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute + { + public NotifyPropertyChangedInvocatorAttribute() { } + public NotifyPropertyChangedInvocatorAttribute(string parameterName) + { + ParameterName = parameterName; + } + + [UsedImplicitly] + public string ParameterName { get; private set; } + } + + /// + /// Indicates that the value of the marked element could be null sometimes, + /// so the check for null is necessary before its usage. + /// + /// + /// + /// [CanBeNull] + /// public object Test() + /// { + /// return null; + /// } + /// + /// public void UseTest() + /// { + /// var p = Test(); + /// var s = p.ToString(); // Warning: Possible 'System.NullReferenceException' + /// } + /// + /// + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public sealed class CanBeNullAttribute : Attribute { } + + /// + /// Indicates that the value of the marked element could never be null + /// + /// + /// + /// [NotNull] + /// public object Foo() + /// { + /// return null; // Warning: Possible 'null' assignment + /// } + /// + /// + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public sealed class NotNullAttribute : Attribute { } + + /// + /// Describes dependency between method input and output. + /// + /// + ///

Function Definition Table syntax:

+ /// + /// FDT ::= FDTRow [;FDTRow]* + /// FDTRow ::= Input => Output | Output <= Input + /// Input ::= ParameterName: Value [, Input]* + /// Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value} + /// Value ::= true | false | null | notnull | canbenull + /// + /// If method has single input parameter, its name could be omitted.
+ /// Using halt (or void/nothing, which is the same) for method output means that the methos doesn't return normally.
+ /// canbenull annotation is only applicable for output parameters.
+ /// You can use multiple [ContractAnnotation] for each FDT row, or use single attribute with rows separated by semicolon.
+ ///
+ /// + /// + /// + /// [ContractAnnotation("=> halt")] + /// public void TerminationMethod() + /// + /// + /// [ContractAnnotation("halt <= condition: false")] + /// public void Assert(bool condition, string text) // Regular Assertion method + /// + /// + /// [ContractAnnotation("s:null => true")] + /// public bool IsNullOrEmpty(string s) // String.IsNullOrEmpty + /// + /// + /// // A method that returns null if the parameter is null, and not null if the parameter is not null + /// [ContractAnnotation("null => null; notnull => notnull")] + /// public object Transform(object data) + /// + /// + /// [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")] + /// public bool TryParse(string s, out Person result) + /// + /// + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)] + public sealed class ContractAnnotationAttribute : Attribute + { + public ContractAnnotationAttribute([NotNull] string fdt) + : this(fdt, false) + { + } + + public ContractAnnotationAttribute([NotNull] string fdt, bool forceFullStates) + { + FDT = fdt; + ForceFullStates = forceFullStates; + } + + public string FDT { get; private set; } + public bool ForceFullStates { get; private set; } + } + + /// + /// Indicates that the value of the marked type (or its derivatives) + /// cannot be compared using '==' or '!=' operators and Equals() should be used instead. + /// However, using '==' or '!=' for comparison with null is always permitted. + /// + /// + /// + /// [CannotApplyEqualityOperator] + /// class NoEquality + /// { + /// } + /// + /// class UsesNoEquality + /// { + /// public void Test() + /// { + /// var ca1 = new NoEquality(); + /// var ca2 = new NoEquality(); + /// + /// if (ca1 != null) // OK + /// { + /// bool condition = ca1 == ca2; // Warning + /// } + /// } + /// } + /// + /// + [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] + public sealed class CannotApplyEqualityOperatorAttribute : Attribute { } + + /// + /// When applied to a target attribute, specifies a requirement for any type marked with + /// the target attribute to implement or inherit specific type or types. + /// + /// + /// + /// [BaseTypeRequired(typeof(IComponent)] // Specify requirement + /// public class ComponentAttribute : Attribute + /// {} + /// + /// [Component] // ComponentAttribute requires implementing IComponent interface + /// public class MyComponent : IComponent + /// {} + /// + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] + [BaseTypeRequired(typeof(Attribute))] + public sealed class BaseTypeRequiredAttribute : Attribute + { + /// + /// Initializes new instance of BaseTypeRequiredAttribute + /// + /// Specifies which types are required + public BaseTypeRequiredAttribute(Type baseType) + { + BaseTypes = new[] { baseType }; + } + + /// + /// Gets enumerations of specified base types + /// + public Type[] BaseTypes { get; private set; } + } + + /// + /// Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library), + /// so this symbol will not be marked as unused (as well as by other usage inspections) + /// + [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)] + public sealed class UsedImplicitlyAttribute : Attribute + { + [UsedImplicitly] + public UsedImplicitlyAttribute() + : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) + { } + + [UsedImplicitly] + public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) + { + UseKindFlags = useKindFlags; + TargetFlags = targetFlags; + } + + [UsedImplicitly] + public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags) + : this(useKindFlags, ImplicitUseTargetFlags.Default) + { } + + [UsedImplicitly] + public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags) + : this(ImplicitUseKindFlags.Default, targetFlags) + { } + + [UsedImplicitly] + public ImplicitUseKindFlags UseKindFlags { get; private set; } + + /// + /// Gets value indicating what is meant to be used + /// + [UsedImplicitly] + public ImplicitUseTargetFlags TargetFlags { get; private set; } + } + + /// + /// Should be used on attributes and causes ReSharper + /// to not mark symbols marked with such attributes as unused (as well as by other usage inspections) + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] + public sealed class MeansImplicitUseAttribute : Attribute + { + [UsedImplicitly] + public MeansImplicitUseAttribute() + : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) + { } + + [UsedImplicitly] + public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) + { + UseKindFlags = useKindFlags; + TargetFlags = targetFlags; + } + + [UsedImplicitly] + public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags) + : this(useKindFlags, ImplicitUseTargetFlags.Default) + { + } + + [UsedImplicitly] + public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags) + : this(ImplicitUseKindFlags.Default, targetFlags) + { } + + [UsedImplicitly] + public ImplicitUseKindFlags UseKindFlags { get; private set; } + + /// + /// Gets value indicating what is meant to be used + /// + [UsedImplicitly] + public ImplicitUseTargetFlags TargetFlags { get; private set; } + } + + [Flags] + public enum ImplicitUseKindFlags + { + Default = Access | Assign | InstantiatedWithFixedConstructorSignature, + + /// + /// Only entity marked with attribute considered used + /// + Access = 1, + + /// + /// Indicates implicit assignment to a member + /// + Assign = 2, + + /// + /// Indicates implicit instantiation of a type with fixed constructor signature. + /// That means any unused constructor parameters won't be reported as such. + /// + InstantiatedWithFixedConstructorSignature = 4, + + /// + /// Indicates implicit instantiation of a type + /// + InstantiatedNoFixedConstructorSignature = 8, + } + + /// + /// Specify what is considered used implicitly when marked with or + /// + [Flags] + public enum ImplicitUseTargetFlags + { + Default = Itself, + + Itself = 1, + + /// + /// Members of entity marked with attribute are considered used + /// + Members = 2, + + /// + /// Entity marked with attribute and all its members considered used + /// + WithMembers = Itself | Members + } + + /// + /// This attribute is intended to mark publicly available API which should not be removed and so is treated as used. + /// + [MeansImplicitUse] + public sealed class PublicAPIAttribute : Attribute + { + public PublicAPIAttribute() { } + public PublicAPIAttribute(string comment) { } + } + + /// + /// Tells code analysis engine if the parameter is completely handled when the invoked method is on stack. + /// If the parameter is a delegate, indicates that delegate is executed while the method is executed. + /// If the parameter is an enumerable, indicates that it is enumerated while the method is executed. + /// + [AttributeUsage(AttributeTargets.Parameter, Inherited = true)] + public sealed class InstantHandleAttribute : Attribute { } + + + /// + /// Indicates that a method does not make any observable state changes. + /// The same as + /// + /// + /// + /// [Pure] + /// private int Multiply(int x, int y) + /// { + /// return x*y; + /// } + /// + /// public void Foo() + /// { + /// const int a=2, b=2; + /// Multiply(a, b); // Waring: Return value of pure method is not used + /// } + /// + /// + [AttributeUsage(AttributeTargets.Method, Inherited = true)] + public sealed class PureAttribute : Attribute { } + + /// + /// Indicates that a parameter is a path to a file or a folder within a web project. + /// Path can be relative or absolute, starting from web root (~). + /// + [AttributeUsage(AttributeTargets.Parameter)] + public class PathReferenceAttribute : Attribute + { + public PathReferenceAttribute() { } + + [UsedImplicitly] + public PathReferenceAttribute([PathReference] string basePath) + { + BasePath = basePath; + } + + [UsedImplicitly] + public string BasePath { get; private set; } + } + + // ASP.NET MVC attributes + + /// + /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC action. + /// If applied to a method, the MVC action name is calculated implicitly from the context. + /// Use this attribute for custom wrappers similar to + /// + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] + public sealed class AspMvcActionAttribute : Attribute + { + [UsedImplicitly] + public string AnonymousProperty { get; private set; } + + public AspMvcActionAttribute() { } + + public AspMvcActionAttribute(string anonymousProperty) + { + AnonymousProperty = anonymousProperty; + } + } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC araa. + /// Use this attribute for custom wrappers similar to + /// + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcAreaAttribute : PathReferenceAttribute + { + [UsedImplicitly] + public string AnonymousProperty { get; private set; } + + [UsedImplicitly] + public AspMvcAreaAttribute() { } + + public AspMvcAreaAttribute(string anonymousProperty) + { + AnonymousProperty = anonymousProperty; + } + } + + /// + /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC controller. + /// If applied to a method, the MVC controller name is calculated implicitly from the context. + /// Use this attribute for custom wrappers similar to + /// + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] + public sealed class AspMvcControllerAttribute : Attribute + { + [UsedImplicitly] + public string AnonymousProperty { get; private set; } + + public AspMvcControllerAttribute() { } + + public AspMvcControllerAttribute(string anonymousProperty) + { + AnonymousProperty = anonymousProperty; + } + } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC Master. + /// Use this attribute for custom wrappers similar to + /// + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcMasterAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC model type. + /// Use this attribute for custom wrappers similar to + /// + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcModelTypeAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC partial view. + /// If applied to a method, the MVC partial view name is calculated implicitly from the context. + /// Use this attribute for custom wrappers similar to + /// + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] + public sealed class AspMvcPartialViewAttribute : PathReferenceAttribute { } + + /// + /// ASP.NET MVC attribute. Allows disabling all inspections for MVC views within a class or a method. + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] + public sealed class AspMvcSupressViewErrorAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template. + /// Use this attribute for custom wrappers similar to + /// + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcDisplayTemplateAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template. + /// Use this attribute for custom wrappers similar to + /// + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcEditorTemplateAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC view. + /// If applied to a method, the MVC view name is calculated implicitly from the context. + /// Use this attribute for custom wrappers similar to + /// + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] + public sealed class AspMvcViewAttribute : PathReferenceAttribute { } + + /// + /// ASP.NET MVC attribute. When applied to a parameter of an attribute, + /// indicates that this parameter is an MVC action name. + /// + /// + /// + /// [ActionName("Foo")] + /// public ActionResult Login(string returnUrl) + /// { + /// ViewBag.ReturnUrl = Url.Action("Foo"); // OK + /// return RedirectToAction("Bar"); // Error: Cannot resolve action + /// } + /// + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)] + public sealed class AspMvcActionSelectorAttribute : Attribute { } + + // Razor attributes + + /// + /// Razor attribute. Indicates that a parameter or a method is a Razor section. + /// Use this attribute for custom wrappers similar to + /// + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, Inherited = true)] + public sealed class RazorSectionAttribute : Attribute { } +} +#endif \ No newline at end of file diff --git a/PdfSharp/!internal/Configuration.cs b/PdfSharp/!internal/Configuration.cs new file mode 100644 index 0000000..66b9379 --- /dev/null +++ b/PdfSharp/!internal/Configuration.cs @@ -0,0 +1,69 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp +{ + /// + /// Floating point formatting. + /// + static class Config + { + public const string SignificantFigures2 = "0.##"; + public const string SignificantFigures3 = "0.###"; + public const string SignificantFigures4 = "0.####"; + public const string SignificantFigures7 = "0.#######"; + public const string SignificantFigures10 = "0.##########"; + public const string SignificantFigures1Plus9 = "0.0#########"; + } + + static class Const + { + /// + /// Factor to convert from degree to radian measure. + /// + public const double Deg2Rad = Math.PI / 180; // = 0.017453292519943295 + + /// + /// Sinus of the angle to turn a regular font to look oblique. Used for italic simulation. + /// + public const double ItalicSkewAngleSinus = 0.34202014332566873304409961468226; // = sin(20°) + + /// + /// Factor of the em size of a regular font to look bold. Used for bold simulation. + /// Value of 2% found in original XPS 1.0 documentation. + /// + public const double BoldEmphasis = 0.02; + + // The κ (kappa) for drawing a circle or an ellipse with four Bézier splines, specifying the distance of the influence point from the starting or end point of a spline. + // Petzold: 4/3 * tan(α / 4) + public const double κ = 0.5522847498307933984022516322796; // := 4/3 * (1 - cos(-π/4)) / sin(π/4)) <=> 4/3 * (sqrt(2) - 1) <=> 4/3 * tan(π/8) + } +} diff --git a/PdfSharp/!internal/Directives.cs b/PdfSharp/!internal/Directives.cs new file mode 100644 index 0000000..0e83377 --- /dev/null +++ b/PdfSharp/!internal/Directives.cs @@ -0,0 +1,113 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// +// Documentation of conditional compilation symbols used in PDFsharp. +// Checks correct settings and obsolete conditional compilation symbols. +// + +#if NewViewMatrix // obsolete +#error NewViewMatrix must not be defined anmore. +#endif + +#if MIGRADOC // obsolete +// empira internal only: Some hacks that make PDFsharp behave like PDFlib when used with Asc.RenderContext. +// Applies to MigraDoc 1.2 only. The Open Source MigraDoc lite does not need this define. +#error MIGRADOC must not be defined anmore. +#endif + +#if NET_ZIP // obsolete +// In .NET 2.0 GZipStream is used instead of SharpZipLib +// This does not work as anticipated. +#error Undefine 'NET_ZIP' because it has no effect anymore. +#endif + +#if NET_2_0 // obsolete +#error Undefine 'NET_2_0' because earlier versions are not supported anymore. +#endif + +#if Gdip // obsolete +#error Conditional compilation symbol 'Gdip' was renamed to 'GDI'. +#endif + +#if GdipUseGdiObjects // obsolete +#error Conditional compilation symbol 'GdipUseGdiObjects' was renamed to 'UseGdiObjects'. +#endif + +// Fragmentation of large object heap is a serious issue that must be tackled in the future. +// Update: .NET 4.51 can ultimately defragment LOH. So maybe we can wait and see. +#if UseMemoryStreams +// Use MemoryStream instead of byte[] to avoid large heap problems. +#error Undefine 'UseMemoryStreams' because it has no effect anymore. +#else +// Use byte[] (instead of MemoryStream) to analyse the symptoms of large heap issues. +#endif + +#if GDI && WPF +// PDFsharp based on both System.Drawing and System.Windows classes +// This is for developing and cross testing only +#elif GDI +// PDFsharp based on System.Drawing classes +#if GdipUseGdiObjects +#error Conditional compilation symbol 'GdipUseGdiObjects' was renamed to 'UseGdiObjects'. +#endif + +#if UseGdiObjects +// PDFsharp X graphics classes have implicit cast operators for GDI+ objects. +// Define this to make it easier to use older code with PDFsharp. +// Undefine this to prevent dependencies to GDI+ +#endif + +#elif WPF +// PDFsharp based on Windows Presentation Foundation. +#elif SILVERLIGHT +// PDFsharp based on 'Silverlight'. +#if !WPF +#error 'SILVERLIGHT' must be defined together with 'WPF' +#endif + +#elif WINDOWS_PHONE +// PDFsharp based on 'Windows Phone'. +#if !WPF +#error 'WINDOWS_PHONE' must be defined together with 'WPF'. +#endif +#if !SILVERLIGHT +#error 'WINDOWS_PHONE' must be defined together with 'SILVERLIGHT'. +#endif + +#elif CORE +// PDFsharp independent of any particular .NET library. +#elif NETFX_CORE +// PDFsharp based on 'WinRT'. +#elif UWP +// PDFsharp based on 'Windows Universal Platform'. + +#else +#error Either 'CORE', 'GDI', 'WPF', 'SILVERLIGHT', 'WINDOWS_PHONE', or 'NETFX_CORE' must be defined. Or UWP. +#endif diff --git a/PdfSharp/!internal/TargetContext.cs b/PdfSharp/!internal/TargetContext.cs new file mode 100644 index 0000000..a2845ac --- /dev/null +++ b/PdfSharp/!internal/TargetContext.cs @@ -0,0 +1,45 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; + +namespace PdfSharp.Internal +{ + // In PDFsharp hybrid build both GDI and WPF is defined. + // This is for development and testing only. +#if GDI && WPF + /// + /// Internal switch indicating what context has to be used if both GDI and WPF are defined. + /// + static class TargetContextHelper + { + public static XGraphicTargetContext TargetContext = XGraphicTargetContext.WPF; + } +#endif +} \ No newline at end of file diff --git a/PdfSharp/Drawing.BarCodes/BarCode.cs b/PdfSharp/Drawing.BarCodes/BarCode.cs new file mode 100644 index 0000000..babe97a --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/BarCode.cs @@ -0,0 +1,170 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.ComponentModel; + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Represents the base class of all bar codes. + /// + public abstract class BarCode : CodeBase + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + public BarCode(string text, XSize size, CodeDirection direction) + : base(text, size, direction) + { + Text = text; + Size = size; + Direction = direction; + } + + /// + /// Creates a bar code from the specified code type. + /// + public static BarCode FromType(CodeType type, string text, XSize size, CodeDirection direction) + { + switch (type) + { + case CodeType.Code2of5Interleaved: + return new Code2of5Interleaved(text, size, direction); + + case CodeType.Code3of9Standard: + return new Code3of9Standard(text, size, direction); + + default: + throw new InvalidEnumArgumentException("type", (int)type, typeof(CodeType)); + } + } + + /// + /// Creates a bar code from the specified code type. + /// + public static BarCode FromType(CodeType type, string text, XSize size) + { + return FromType(type, text, size, CodeDirection.LeftToRight); + } + + /// + /// Creates a bar code from the specified code type. + /// + public static BarCode FromType(CodeType type, string text) + { + return FromType(type, text, XSize.Empty, CodeDirection.LeftToRight); + } + + /// + /// Creates a bar code from the specified code type. + /// + public static BarCode FromType(CodeType type) + { + return FromType(type, String.Empty, XSize.Empty, CodeDirection.LeftToRight); + } + + /// + /// When overridden in a derived class gets or sets the wide narrow ratio. + /// + public virtual double WideNarrowRatio + { + get { return 0; } + set { } + } + + /// + /// Gets or sets the location of the text next to the bar code. + /// + public TextLocation TextLocation + { + get { return _textLocation; } + set { _textLocation = value; } + } + TextLocation _textLocation; + + /// + /// Gets or sets the length of the data that defines the bar code. + /// + public int DataLength + { + get { return _dataLength; } + set { _dataLength = value; } + } + int _dataLength; + + /// + /// Gets or sets the optional start character. + /// + public char StartChar + { + get { return _startChar; } + set { _startChar = value; } + } + char _startChar; + + /// + /// Gets or sets the optional end character. + /// + public char EndChar + { + get { return _endChar; } + set { _endChar = value; } + } + char _endChar; + + /// + /// Gets or sets a value indicating whether the turbo bit is to be drawn. + /// (A turbo bit is something special to Kern (computer output processing) company (as far as I know)) + /// + public virtual bool TurboBit + { + get { return _turboBit; } + set { _turboBit = value; } + } + bool _turboBit; + + internal virtual void InitRendering(BarCodeRenderInfo info) + { + if (Text == null) + throw new InvalidOperationException(BcgSR.BarCodeNotSet); + + if (Size.IsEmpty) + throw new InvalidOperationException(BcgSR.EmptyBarCodeSize); + } + + /// + /// When defined in a derived class renders the code. + /// + protected internal abstract void Render(XGraphics gfx, XBrush brush, XFont font, XPoint position); + } +} diff --git a/PdfSharp/Drawing.BarCodes/BarCodeRenderInfo.cs b/PdfSharp/Drawing.BarCodes/BarCodeRenderInfo.cs new file mode 100644 index 0000000..28f4092 --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/BarCodeRenderInfo.cs @@ -0,0 +1,54 @@ +// +// PDFsharp - A library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Holds all temporary information needed during rendering. + /// + class BarCodeRenderInfo + { + public BarCodeRenderInfo(XGraphics gfx, XBrush brush, XFont font, XPoint position) + { + Gfx = gfx; + Brush = brush; + Font = font; + Position = position; + } + + public XGraphics Gfx; + public XBrush Brush; + public XFont Font; + public XPoint Position; + public double BarHeight; + public XPoint CurrPos; + public int CurrPosInString; + public double ThinBarWidth; + } +} diff --git a/PdfSharp/Drawing.BarCodes/BcgSR.cs b/PdfSharp/Drawing.BarCodes/BcgSR.cs new file mode 100644 index 0000000..c4b5d5f --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/BcgSR.cs @@ -0,0 +1,93 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.BarCodes +{ + // TODO: Mere with PDFsharp strings table + /// + /// String resources for the empira barcode renderer. + /// + internal class BcgSR + { + internal static string Invalid2Of5Code(string code) + { + return string.Format("'{0}' is not a valid code for an interleave 2 of 5 bar code. It can only represent an even number of digits.", code); + } + + internal static string Invalid3Of9Code(string code) + { + return string.Format("'{0}' is not a valid code for a 3 of 9 standard bar code.", code); + } + + internal static string BarCodeNotSet + { + get { return "A text must be set before rendering the bar code."; } + } + + internal static string EmptyBarCodeSize + { + get { return "A non-empty size must be set before rendering the bar code."; } + } + + internal static string Invalid2of5Relation + { + get { return "Value of relation between thick and thin lines on the interleaved 2 of 5 code must be between 2 and 3."; } + } + + internal static string InvalidMarkName(string name) + { + return string.Format("'{0}' is not a valid mark name for this OMR representation.", name); + } + + internal static string OmrAlreadyInitialized + { + get { return "Mark descriptions cannot be set when marks have already been set on OMR."; } + } + + internal static string DataMatrixTooBig + { + get { return "The given data and encoding combination is too big for the matrix size."; } + } + + internal static string DataMatrixNotSupported + { + get { return "Zero sizes, odd sizes and other than ecc200 coded DataMatrix is not supported."; } + } + + internal static string DataMatrixNull + { + get { return "No DataMatrix code is produced."; } + } + + internal static string DataMatrixInvalid(int columns, int rows) + { + return string.Format("'{1}'x'{0}' is an invalid ecc200 DataMatrix size.", columns, rows); + } + } +} diff --git a/PdfSharp/Drawing.BarCodes/Code2of5Interleaved.cs b/PdfSharp/Drawing.BarCodes/Code2of5Interleaved.cs new file mode 100644 index 0000000..0a19ccc --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/Code2of5Interleaved.cs @@ -0,0 +1,193 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Implementation of the Code 2 of 5 bar code. + /// + public class Code2of5Interleaved : ThickThinBarCode + { + /// + /// Initializes a new instance of Interleaved2of5. + /// + public Code2of5Interleaved() + : base("", XSize.Empty, CodeDirection.LeftToRight) + {} + + /// + /// Initializes a new instance of Interleaved2of5. + /// + public Code2of5Interleaved(string code) + : base(code, XSize.Empty, CodeDirection.LeftToRight) + {} + + /// + /// Initializes a new instance of Interleaved2of5. + /// + public Code2of5Interleaved(string code, XSize size) + : base(code, size, CodeDirection.LeftToRight) + {} + + /// + /// Initializes a new instance of Interleaved2of5. + /// + public Code2of5Interleaved(string code, XSize size, CodeDirection direction) + : base(code, size, direction) + {} + + /// + /// Returns an array of size 5 that represents the thick (true) and thin (false) lines or spaces + /// representing the specified digit. + /// + /// The digit to represent. + static bool[] ThickAndThinLines(int digit) + { + return Lines[digit]; + } + static bool[][] Lines = + { + new bool[] {false, false, true, true, false}, + new bool[] {true, false, false, false, true}, + new bool[] {false, true, false, false, true}, + new bool[] {true, true, false, false, false}, + new bool[] {false, false, true, false, true}, + new bool[] {true, false, true, false, false}, + new bool[] {false, true, true, false, false}, + new bool[] {false, false, false, true, true}, + new bool[] {true, false, false, true, false}, + new bool[] {false, true, false, true, false}, + }; + + /// + /// Renders the bar code. + /// + protected internal override void Render(XGraphics gfx, XBrush brush, XFont font, XPoint position) + { + XGraphicsState state = gfx.Save(); + + BarCodeRenderInfo info = new BarCodeRenderInfo(gfx, brush, font, position); + InitRendering(info); + info.CurrPosInString = 0; + //info.CurrPos = info.Center - Size / 2; + info.CurrPos = position - CodeBase.CalcDistance(AnchorType.TopLeft, Anchor, Size); + + if (TurboBit) + RenderTurboBit(info, true); + RenderStart(info); + while (info.CurrPosInString < Text.Length) + RenderNextPair(info); + RenderStop(info); + if (TurboBit) + RenderTurboBit(info, false); + if (TextLocation != TextLocation.None) + RenderText(info); + + gfx.Restore(state); + } + + /// + /// Calculates the thick and thin line widths, + /// taking into account the required rendering size. + /// + internal override void CalcThinBarWidth(BarCodeRenderInfo info) + { + /* + * The total width is the sum of the following parts: + * Starting lines = 4 * thin + * + + * Code Representation = (2 * thick + 3 * thin) * code.Length + * + + * Stopping lines = 1 * thick + 2 * thin + * + * with r = relation ( = thick / thin), this results in + * + * Total width = (6 + r + (2 * r + 3) * text.Length) * thin + */ + double thinLineAmount = 6 + WideNarrowRatio + (2 * WideNarrowRatio + 3) * Text.Length; + info.ThinBarWidth = Size.Width / thinLineAmount; + } + + private void RenderStart(BarCodeRenderInfo info) + { + RenderBar(info, false); + RenderGap(info, false); + RenderBar(info, false); + RenderGap(info, false); + } + + private void RenderStop(BarCodeRenderInfo info) + { + RenderBar(info, true); + RenderGap(info, false); + RenderBar(info, false); + } + + /// + /// Renders the next digit pair as bar code element. + /// + private void RenderNextPair(BarCodeRenderInfo info) + { + int digitForLines = int.Parse(Text[info.CurrPosInString].ToString()); + int digitForGaps = int.Parse(Text[info.CurrPosInString + 1].ToString()); + bool[] linesArray = Lines[digitForLines]; + bool[] gapsArray = Lines[digitForGaps]; + for (int idx = 0; idx < 5; ++idx) + { + RenderBar(info, linesArray[idx]); + RenderGap(info, gapsArray[idx]); + } + info.CurrPosInString += 2; + } + + /// + /// Checks the code to be convertible into an interleaved 2 of 5 bar code. + /// + /// The code to be checked. + protected override void CheckCode(string text) + { +#if true_ + if (text == null) + throw new ArgumentNullException("text"); + + if (text == "") + throw new ArgumentException(BcgSR.Invalid2Of5Code(text)); + + if (text.Length % 2 != 0) + throw new ArgumentException(BcgSR.Invalid2Of5Code(text)); + + foreach (char ch in text) + { + if (!Char.IsDigit(ch)) + throw new ArgumentException(BcgSR.Invalid2Of5Code(text)); + } +#endif + } + } +} diff --git a/PdfSharp/Drawing.BarCodes/Code3of9Standard.cs b/PdfSharp/Drawing.BarCodes/Code3of9Standard.cs new file mode 100644 index 0000000..6d9f121 --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/Code3of9Standard.cs @@ -0,0 +1,271 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Imlpementation of the Code 3 of 9 bar code. + /// + // ReSharper disable once InconsistentNaming + public class Code3of9Standard : ThickThinBarCode + { + /// + /// Initializes a new instance of Standard3of9. + /// + public Code3of9Standard() + : base("", XSize.Empty, CodeDirection.LeftToRight) + { } + + /// + /// Initializes a new instance of Standard3of9. + /// + public Code3of9Standard(string code) + : base(code, XSize.Empty, CodeDirection.LeftToRight) + { } + + /// + /// Initializes a new instance of Standard3of9. + /// + public Code3of9Standard(string code, XSize size) + : base(code, size, CodeDirection.LeftToRight) + { } + + /// + /// Initializes a new instance of Standard3of9. + /// + public Code3of9Standard(string code, XSize size, CodeDirection direction) + : base(code, size, direction) + { } + + /// + /// Returns an array of size 9 that represents the thick (true) and thin (false) lines and spaces + /// representing the specified digit. + /// + /// The character to represent. + private static bool[] ThickThinLines(char ch) + { + return Lines["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*".IndexOf(ch)]; + } + static readonly bool[][] Lines = + { + // '0' + new bool[] {false, false, false, true, true, false, true, false, false}, + // '1' + new bool[] {true, false, false, true, false, false, false, false, true}, + // '2' + new bool[] {false, false, true, true, false, false, false, false, true}, + // '3' + new bool[] {true, false, true, true, false, false, false, false, false}, + // '4' + new bool[] {false, false, false, true, true, false, false, false, true}, + // '5' + new bool[] {true, false, false, true, true, false, false, false, false}, + // '6' + new bool[] {false, false, true, true, true, false, false, false, false}, + // '7' + new bool[] {false, false, false, true, false, false, true, false, true}, + // '8' + new bool[] {true, false, false, true, false, false, true, false, false}, + // '9' + new bool[] {false, false, true, true, false, false, true, false, false}, + // 'A' + new bool[] {true, false, false, false, false, true, false, false, true}, + // 'B' + new bool[] {false, false, true, false, false, true, false, false, true}, + // 'C' + new bool[] {true, false, true, false, false, true, false, false, false}, + // 'D' + new bool[] {false, false, false, false, true, true, false, false, true}, + // 'E' + new bool[] {true, false, false, false, true, true, false, false, false}, + // 'F' + new bool[] {false, false, true, false, true, true, false, false, false}, + // 'G' + new bool[] {false, false, false, false, false, true, true, false, true}, + // 'H' + new bool[] {true, false, false, false, false, true, true, false, false}, + // 'I' + new bool[] {false, false, true, false, false, true, true, false, false}, + // 'J' + new bool[] {false, false, false, false, true, true, true, false, false}, + // 'K' + new bool[] {true, false, false, false, false, false, false, true, true}, + // 'L' + new bool[] {false, false, true, false, false, false, false, true, true}, + // 'M' + new bool[] {true, false, true, false, false, false, false, true, false}, + // 'N' + new bool[] {false, false, false, false, true, false, false, true, true}, + // 'O' + new bool[] {true, false, false, false, true, false, false, true, false}, + // 'P': + new bool[] {false, false, true, false, true, false, false, true, false}, + // 'Q' + new bool[] {false, false, false, false, false, false, true, true, true}, + // 'R' + new bool[] {true, false, false, false, false, false, true, true, false}, + // 'S' + new bool[] {false, false, true, false, false, false, true, true, false}, + // 'T' + new bool[] {false, false, false, false, true, false, true, true, false}, + // 'U' + new bool[] {true, true, false, false, false, false, false, false, true}, + // 'V' + new bool[] {false, true, true, false, false, false, false, false, true}, + // 'W' + new bool[] {true, true, true, false, false, false, false, false, false}, + // 'X' + new bool[] {false, true, false, false, true, false, false, false, true}, + // 'Y' + new bool[] {true, true, false, false, true, false, false, false, false}, + // 'Z' + new bool[] {false, true, true, false, true, false, false, false, false}, + // '-' + new bool[] {false, true, false, false, false, false, true, false, true}, + // '.' + new bool[] {true, true, false, false, false, false, true, false, false}, + // ' ' + new bool[] {false, true, true, false, false, false, true, false, false}, + // '$' + new bool[] {false, true, false, true, false, true, false, false, false}, + // '/' + new bool[] {false, true, false, true, false, false, false, true, false}, + // '+' + new bool[] {false, true, false, false, false, true, false, true, false}, + // '%' + new bool[] {false, false, false, true, false, true, false, true, false}, + // '*' + new bool[] {false, true, false, false, true, false, true, false, false}, + }; + + + /// + /// Calculates the thick and thin line widths, + /// taking into account the required rendering size. + /// + internal override void CalcThinBarWidth(BarCodeRenderInfo info) + { + /* + * The total width is the sum of the following parts: + * Starting lines = 3 * thick + 7 * thin + * + + * Code Representation = (3 * thick + 7 * thin) * code.Length + * + + * Stopping lines = 3 * thick + 6 * thin + * + * with r = relation ( = thick / thin), this results in + * + * Total width = (13 + 6 * r + (3 * r + 7) * code.Length) * thin + */ + double thinLineAmount = 13 + 6 * WideNarrowRatio + (3 * WideNarrowRatio + 7) * Text.Length; + info.ThinBarWidth = Size.Width / thinLineAmount; + } + + /// + /// Checks the code to be convertible into an standard 3 of 9 bar code. + /// + /// The code to be checked. + protected override void CheckCode(string text) + { + if (text == null) + throw new ArgumentNullException("text"); + + if (text.Length == 0) + throw new ArgumentException(BcgSR.Invalid3Of9Code(text)); + + foreach (char ch in text) + { + if ("0123456789ABCDEFGHIJKLMNOP'QRSTUVWXYZ-. $/+%*".IndexOf(ch) < 0) + throw new ArgumentException(BcgSR.Invalid3Of9Code(text)); + } + } + + /// + /// Renders the bar code. + /// + protected internal override void Render(XGraphics gfx, XBrush brush, XFont font, XPoint position) + { + XGraphicsState state = gfx.Save(); + + BarCodeRenderInfo info = new BarCodeRenderInfo(gfx, brush, font, position); + InitRendering(info); + info.CurrPosInString = 0; + //info.CurrPos = Center - Size / 2; + info.CurrPos = position - CalcDistance(AnchorType.TopLeft, Anchor, Size); + + if (TurboBit) + RenderTurboBit(info, true); + RenderStart(info); + while (info.CurrPosInString < Text.Length) + { + RenderNextChar(info); + RenderGap(info, false); + } + RenderStop(info); + if (TurboBit) + RenderTurboBit(info, false); + if (TextLocation != TextLocation.None) + RenderText(info); + + gfx.Restore(state); + } + + private void RenderNextChar(BarCodeRenderInfo info) + { + RenderChar(info, Text[info.CurrPosInString]); + ++info.CurrPosInString; + } + + private void RenderChar(BarCodeRenderInfo info, char ch) + { + bool[] thickThinLines = ThickThinLines(ch); + int idx = 0; + while (idx < 9) + { + RenderBar(info, thickThinLines[idx]); + if (idx < 8) + RenderGap(info, thickThinLines[idx + 1]); + idx += 2; + } + } + + private void RenderStart(BarCodeRenderInfo info) + { + RenderChar(info, '*'); + RenderGap(info, false); + } + + private void RenderStop(BarCodeRenderInfo info) + { + RenderChar(info, '*'); + } + } +} diff --git a/PdfSharp/Drawing.BarCodes/CodeBase.cs b/PdfSharp/Drawing.BarCodes/CodeBase.cs new file mode 100644 index 0000000..ebb8d49 --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/CodeBase.cs @@ -0,0 +1,169 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Represents the base class of all codes. + /// + public abstract class CodeBase + { + /// + /// Initializes a new instance of the class. + /// + public CodeBase(string text, XSize size, CodeDirection direction) + { + _text = text; + _size = size; + _direction = direction; + } + + //public static CodeBase FromType(CodeType type, string text, XSize size, CodeDirection direction) + //{ + // switch (type) + // { + // case CodeType.Code2of5Interleaved: + // return new Code2of5Interleaved(text, size, direction); + + // case CodeType.Code3of9Standard: + // return new Code3of9Standard(text, size, direction); + + // default: + // throw new InvalidEnumArgumentException("type", (int)type, typeof(CodeType)); + // } + //} + + //public static CodeBase FromType(CodeType type, string text, XSize size) + //{ + // return FromType(type, text, size, CodeDirection.LeftToRight); + //} + + //public static CodeBase FromType(CodeType type, string text) + //{ + // return FromType(type, text, XSize.Empty, CodeDirection.LeftToRight); + //} + + //public static CodeBase FromType(CodeType type) + //{ + // return FromType(type, String.Empty, XSize.Empty, CodeDirection.LeftToRight); + //} + + /// + /// Gets or sets the size. + /// + public XSize Size + { + get { return _size; } + set { _size = value; } + } + XSize _size; + + /// + /// Gets or sets the text the bar code shall represent. + /// + public string Text + { + get { return _text; } + set + { + CheckCode(value); + _text = value; + } + } + string _text; + + /// + /// Always MiddleCenter. + /// + public AnchorType Anchor + { + get { return _anchor; } + set { _anchor = value; } + } + AnchorType _anchor; + + /// + /// Gets or sets the drawing direction. + /// + public CodeDirection Direction + { + get { return _direction; } + set { _direction = value; } + } + CodeDirection _direction; + + /// + /// When implemented in a derived class, determines whether the specified string can be used as Text + /// for this bar code type. + /// + /// The code string to check. + /// True if the text can be used for the actual barcode. + protected abstract void CheckCode(string text); + + /// + /// Calculates the distance between an old anchor point and a new anchor point. + /// + /// + /// + /// + public static XVector CalcDistance(AnchorType oldType, AnchorType newType, XSize size) + { + if (oldType == newType) + return new XVector(); + + XVector result; + Delta delta = Deltas[(int)oldType, (int)newType]; + result = new XVector(size.Width / 2 * delta.X, size.Height / 2 * delta.Y); + return result; + } + + struct Delta + { + public Delta(int x, int y) + { + X = x; + Y = y; + } + public readonly int X; + public readonly int Y; + } + static readonly Delta[,] Deltas = new Delta[9, 9] + { + { new Delta(0, 0), new Delta(1, 0), new Delta(2, 0), new Delta(0, 1), new Delta(1, 1), new Delta(2, 1), new Delta(0, 2), new Delta(1, 2), new Delta(2, 2) }, + { new Delta(-1, 0), new Delta(0, 0), new Delta(1, 0), new Delta(-1, 1), new Delta(0, 1), new Delta(1, 1), new Delta(-1, 2), new Delta(0, 2), new Delta(1, 2) }, + { new Delta(-2, 0), new Delta(-1, 0), new Delta(0, 0), new Delta(-2, 1), new Delta(-1, 1), new Delta(0, 1), new Delta(-2, 2), new Delta(-1, 2), new Delta(0, 2) }, + { new Delta(0, -1), new Delta(1, -1), new Delta(2, -1), new Delta(0, 0), new Delta(1, 0), new Delta(2, 0), new Delta(0, 1), new Delta(1, 1), new Delta(2, 1) }, + { new Delta(-1, -1), new Delta(0, -1), new Delta(1, -1), new Delta(-1, 0), new Delta(0, 0), new Delta(1, 0), new Delta(-1, 1), new Delta(0, 1), new Delta(1, 1) }, + { new Delta(-2, -1), new Delta(-1, -1), new Delta(0, -1), new Delta(-2, 0), new Delta(-1, 0), new Delta(0, 0), new Delta(-2, 1), new Delta(-1, 1), new Delta(0, 1) }, + { new Delta(0, -2), new Delta(1, -2), new Delta(2, -2), new Delta(0, -1), new Delta(1, -1), new Delta(2, -1), new Delta(0, 0), new Delta(1, 0), new Delta(2, 0) }, + { new Delta(-1, -2), new Delta(0, -2), new Delta(1, -2), new Delta(-1, -1), new Delta(0, -1), new Delta(1, -1), new Delta(-1, 0), new Delta(0, 0), new Delta(1, 0) }, + { new Delta(-2, -2), new Delta(-1, -2), new Delta(0, -2), new Delta(-2, -1), new Delta(-1, -1), new Delta(0, -1), new Delta(-2, 0), new Delta(-1, 0), new Delta(0, 0) }, + }; + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing.BarCodes/CodeDataMatrix.cs b/PdfSharp/Drawing.BarCodes/CodeDataMatrix.cs new file mode 100644 index 0000000..eda299c --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/CodeDataMatrix.cs @@ -0,0 +1,217 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// David Stephensen +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Defines the DataMatrix 2D barcode. THIS IS AN EMPIRA INTERNAL IMPLEMENTATION. THE CODE IN + /// THE OPEN SOURCE VERSION IS A FAKE. + /// + public class CodeDataMatrix : MatrixCode + { + /// + /// Initializes a new instance of CodeDataMatrix. + /// + public CodeDataMatrix() + : this("", "", 26, 26, 0, XSize.Empty) + {} + + /// + /// Initializes a new instance of CodeDataMatrix. + /// + public CodeDataMatrix(string code, int length) + : this(code, "", length, length, 0, XSize.Empty) + {} + + /// + /// Initializes a new instance of CodeDataMatrix. + /// + public CodeDataMatrix(string code, int length, XSize size) + : this(code, "", length, length, 0, size) + {} + + /// + /// Initializes a new instance of CodeDataMatrix. + /// + public CodeDataMatrix(string code, DataMatrixEncoding dmEncoding, int length, XSize size) + : this(code, CreateEncoding(dmEncoding, code.Length), length, length, 0, size) + {} + + /// + /// Initializes a new instance of CodeDataMatrix. + /// + public CodeDataMatrix(string code, int rows, int columns) + : this(code, "", rows, columns, 0, XSize.Empty) + {} + + /// + /// Initializes a new instance of CodeDataMatrix. + /// + public CodeDataMatrix(string code, int rows, int columns, XSize size) + : this(code, "", rows, columns, 0, size) + {} + + /// + /// Initializes a new instance of CodeDataMatrix. + /// + public CodeDataMatrix(string code, DataMatrixEncoding dmEncoding, int rows, int columns, XSize size) + : this(code, CreateEncoding(dmEncoding, code.Length), rows, columns, 0, size) + {} + + /// + /// Initializes a new instance of CodeDataMatrix. + /// + public CodeDataMatrix(string code, int rows, int columns, int quietZone) + : this(code, "", rows, columns, quietZone, XSize.Empty) + {} + + /// + /// Initializes a new instance of CodeDataMatrix. + /// + public CodeDataMatrix(string code, string encoding, int rows, int columns, int quietZone, XSize size) + : base(code, encoding, rows, columns, size) + { + QuietZone = quietZone; + } + + /// + /// Sets the encoding of the DataMatrix. + /// + public void SetEncoding(DataMatrixEncoding dmEncoding) + { + Encoding = CreateEncoding(dmEncoding, Text.Length); + } + + static string CreateEncoding(DataMatrixEncoding dmEncoding, int length) + { + string tempencoding = ""; + switch (dmEncoding) + { + case DataMatrixEncoding.Ascii: + tempencoding = new string('a', length); + break; + case DataMatrixEncoding.C40: + tempencoding = new string('c', length); + break; + case DataMatrixEncoding.Text: + tempencoding = new string('t', length); + break; + case DataMatrixEncoding.X12: + tempencoding = new string('x', length); + break; + case DataMatrixEncoding.EDIFACT: + tempencoding = new string('e', length); + break; + case DataMatrixEncoding.Base256: + tempencoding = new string('b', length); + break; + } + return tempencoding; + } + + /// + /// Gets or sets the size of the Matrix' Quiet Zone. + /// + public int QuietZone + { + get { return _quietZone; } + set { _quietZone = value; } + } + int _quietZone; + + /// + /// Renders the matrix code. + /// + protected internal override void Render(XGraphics gfx, XBrush brush, XPoint position) + { + XGraphicsState state = gfx.Save(); + + switch (Direction) + { + case CodeDirection.RightToLeft: + gfx.RotateAtTransform(180, position); + break; + + case CodeDirection.TopToBottom: + gfx.RotateAtTransform(90, position); + break; + + case CodeDirection.BottomToTop: + gfx.RotateAtTransform(-90, position); + break; + } + + XPoint pos = position + CalcDistance(Anchor, AnchorType.TopLeft, Size); + + if (MatrixImage == null) + MatrixImage = DataMatrixImage.GenerateMatrixImage(Text, Encoding, Rows, Columns); + + if (QuietZone > 0) + { + XSize sizeWithZone = new XSize(Size.Width, Size.Height); + sizeWithZone.Width = sizeWithZone.Width / (Columns + 2 * QuietZone) * Columns; + sizeWithZone.Height = sizeWithZone.Height / (Rows + 2 * QuietZone) * Rows; + + XPoint posWithZone = new XPoint(pos.X, pos.Y); + posWithZone.X += Size.Width / (Columns + 2 * QuietZone) * QuietZone; + posWithZone.Y += Size.Height / (Rows + 2 * QuietZone) * QuietZone; + + gfx.DrawRectangle(XBrushes.White, pos.X, pos.Y, Size.Width, Size.Height); + gfx.DrawImage(MatrixImage, posWithZone.X, posWithZone.Y, sizeWithZone.Width, sizeWithZone.Height); + } + else + gfx.DrawImage(MatrixImage, pos.X, pos.Y, Size.Width, Size.Height); + + gfx.Restore(state); + } + + /// + /// Determines whether the specified string can be used as data in the DataMatrix. + /// + /// The code to be checked. + protected override void CheckCode(string text) + { + if (text == null) + throw new ArgumentNullException("text"); + + DataMatrixImage mImage = new DataMatrixImage(Text, Encoding, Rows, Columns); + mImage.Iec16022Ecc200(Columns, Rows, Encoding, Text.Length, Text, 0, 0, 0); + } + } +} diff --git a/PdfSharp/Drawing.BarCodes/CodeOmr.cs b/PdfSharp/Drawing.BarCodes/CodeOmr.cs new file mode 100644 index 0000000..c9bf6f9 --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/CodeOmr.cs @@ -0,0 +1,247 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Represents an OMR code. + /// + public class CodeOmr : BarCode + { + /// + /// initializes a new OmrCode with the given data. + /// + public CodeOmr(string text, XSize size, CodeDirection direction) + : base(text, size, direction) + { } + + /// + /// Renders the OMR code. + /// + protected internal override void Render(XGraphics gfx, XBrush brush, XFont font, XPoint position) + { + XGraphicsState state = gfx.Save(); + + switch (Direction) + { + case CodeDirection.RightToLeft: + gfx.RotateAtTransform(180, position); + break; + + case CodeDirection.TopToBottom: + gfx.RotateAtTransform(90, position); + break; + + case CodeDirection.BottomToTop: + gfx.RotateAtTransform(-90, position); + break; + } + + //XPoint pt = center - size / 2; + XPoint pt = position - CodeBase.CalcDistance(AnchorType.TopLeft, Anchor, Size); + uint value; + uint.TryParse(Text, out value); +#if true + // HACK: Project Wallenwein: set LK + value |= 1; + _synchronizeCode = true; +#endif + if (_synchronizeCode) + { + XRect rect = new XRect(pt.X, pt.Y, _makerThickness, Size.Height); + gfx.DrawRectangle(brush, rect); + pt.X += 2 * _makerDistance; + } + for (int idx = 0; idx < 32; idx++) + { + if ((value & 1) == 1) + { + XRect rect = new XRect(pt.X + idx * _makerDistance, pt.Y, _makerThickness, Size.Height); + gfx.DrawRectangle(brush, rect); + } + value = value >> 1; + } + gfx.Restore(state); + } + + /// + /// Gets or sets a value indicating whether a synchronize mark is rendered. + /// + public bool SynchronizeCode + { + get { return _synchronizeCode; } + set { _synchronizeCode = value; } + } + bool _synchronizeCode; + + /// + /// Gets or sets the distance of the markers. + /// + public double MakerDistance + { + get { return _makerDistance; } + set { _makerDistance = value; } + } + double _makerDistance = 12; // 1/6" + + /// + /// Gets or sets the thickness of the makers. + /// + public double MakerThickness + { + get { return _makerThickness; } + set { _makerThickness = value; } + } + double _makerThickness = 1; + + ///// + ///// Renders the mark at the given position. + ///// + ///// The mark position to render. + //private void RenderMark(int position) + //{ + // double yPos = TopLeft.Y + UpperDistance + position * ToUnit(markDistance).Centimeter; + // //Center mark + // double xPos = TopLeft.X + Width / 2 - this.MarkWidth / 2; + + // Gfx.DrawLine(pen, xPos, yPos, xPos + MarkWidth, yPos); + //} + + ///// + ///// Distance of the marks. Default is 2/6 inch. + ///// + //public MarkDistance MarkDistance + //{ + // get { return markDistance; } + // set { markDistance = value; } + //} + //private MarkDistance markDistance = MarkDistance.Inch2_6; + + ///// + ///// Converts a mark distance to an XUnit object. + ///// + ///// The mark distance to convert. + ///// The converted mark distance. + //public static XUnit ToUnit(MarkDistance markDistance) + //{ + // switch (markDistance) + // { + // case MarkDistance.Inch1_6: + // return XUnit.FromInch(1.0 / 6.0); + // case MarkDistance.Inch2_6: + // return XUnit.FromInch(2.0 / 6.0); + // case MarkDistance.Inch2_8: + // return XUnit.FromInch(2.0 / 8.0); + // default: + // throw new ArgumentOutOfRangeException("markDistance"); + // } + //} + + ///// + ///// The upper left point of the reading zone. + ///// + //public XPoint TopLeft + //{ + // get + // { + // XPoint topLeft = center; + // topLeft.X -= Width; + // double height = upperDistance + lowerDistance; + // height += (data.Marks.Length - 1) * ToUnit(MarkDistance).Centimeter; + // topLeft.Y -= height / 2; + // return topLeft; + // } + //} + + ///// + ///// the upper distance from position to the first mark. + ///// The default value is 8 / 6 inch. + ///// + //double UpperDistance + //{ + // get { return upperDistance; } + // set { upperDistance = value; } + //} + //private double upperDistance = XUnit.FromInch(8.0 / 6.0).Centimeter; + + ///// + ///// The lower distance from the last possible mark to the end of the reading zone. + ///// The default value is + ///// + //double LowerDistance + //{ + // get { return lowerDistance; } + // set { lowerDistance = value; } + //} + //private double lowerDistance = XUnit.FromInch(2.0 / 6.0).Centimeter; + + ///// + ///// Gets or sets the width of the reading zone. + ///// Default and minimum is 3/12 inch. + ///// + //public double Width + //{ + // get { return width; } + // set { width = value; } + //} + //double width = XUnit.FromInch(3.0 / 12.0).Centimeter; + + ///// + ///// Gets or sets the mark width. Default is 1/2 * width. + ///// + //public XUnit MarkWidth + //{ + // get + // { + // if (markWidth > 0) + // return markWidth; + // else + // return width / 2; + // } + // set { markWidth = value; } + //} + //XUnit markWidth; + + ///// + ///// Gets or sets the width of the mark line. Default is 1pt. + ///// + //public XUnit MarkLineWidth + //{ + // get { return markLineWidth; } + // set { markLineWidth = value; } + //} + //XUnit markLineWidth = 1; + + /// + /// Determines whether the specified string can be used as Text for the OMR code. + /// + protected override void CheckCode(string text) + { } + } +} diff --git a/PdfSharp/Drawing.BarCodes/DataMatrixImage.cs b/PdfSharp/Drawing.BarCodes/DataMatrixImage.cs new file mode 100644 index 0000000..81cbf6a --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/DataMatrixImage.cs @@ -0,0 +1,787 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// David Stephensen +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +#if GDI +using System.Drawing; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +#endif + +// WPFHACK +#pragma warning disable 162 + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Creates the XImage object for a DataMatrix. + /// + internal class DataMatrixImage + { + public static XImage GenerateMatrixImage(string text, string encoding, int rows, int columns) + { + DataMatrixImage dataMatrixImage = new DataMatrixImage(text, encoding, rows, columns); + return dataMatrixImage.DrawMatrix(); + } + + public DataMatrixImage(string text, string encoding, int rows, int columns) + { + _text = text; + _encoding = encoding; + _rows = rows; + _columns = columns; + } + + string _encoding; + readonly string _text; + readonly int _rows; + readonly int _columns; + + /// + /// Possible ECC200 Matrices. + /// + static Ecc200Block[] ecc200Sizes = + { + new Ecc200Block( 10, 10, 10, 10, 3, 3, 5), // + new Ecc200Block( 12, 12, 12, 12, 5, 5, 7), // + new Ecc200Block( 8, 18, 8, 18, 5, 5, 7), // + new Ecc200Block( 14, 14, 14, 14, 8, 8, 10), // + new Ecc200Block( 8, 32, 8, 16, 10, 10, 11), // + new Ecc200Block( 16, 16, 16, 16, 12, 12, 12), // + new Ecc200Block( 12, 26, 12, 26, 16, 16, 14), // + new Ecc200Block( 18, 18, 18, 18, 18, 18, 14), // + new Ecc200Block( 20, 20, 20, 20, 22, 22, 18), // + new Ecc200Block( 12, 36, 12, 18, 22, 22, 18), // + new Ecc200Block( 22, 22, 22, 22, 30, 30, 20), // Post + new Ecc200Block( 16, 36, 16, 18, 32, 32, 24), // + new Ecc200Block( 24, 24, 24, 24, 36, 36, 24), // + new Ecc200Block( 26, 26, 26, 26, 44, 44, 28), // Post + new Ecc200Block( 16, 48, 16, 24, 49, 49, 28), // + new Ecc200Block( 32, 32, 16, 16, 62, 62, 36), // + new Ecc200Block( 36, 36, 18, 18, 86, 86, 42), // + new Ecc200Block( 40, 40, 20, 20, 114, 114, 48), // + new Ecc200Block( 44, 44, 22, 22, 144, 144, 56), // + new Ecc200Block( 48, 48, 24, 24, 174, 174, 68), // + new Ecc200Block( 52, 52, 26, 26, 204, 102, 42), // + new Ecc200Block( 64, 64, 16, 16, 280, 140, 56), // + new Ecc200Block( 72, 72, 18, 18, 368, 92, 36), // + new Ecc200Block( 80, 80, 20, 20, 456, 114, 48), // + new Ecc200Block( 88, 88, 22, 22, 576, 144, 56), // + new Ecc200Block( 96, 96, 24, 24, 696, 174, 68), // + new Ecc200Block(104, 104, 26, 26, 816, 136, 56), // + new Ecc200Block(120, 120, 20, 20, 1050, 175, 68), // + new Ecc200Block(132, 132, 22, 22, 1304, 163, 62), // + new Ecc200Block(144, 144, 24, 24, 1558, 156, 62), // 156*4+155*2 + new Ecc200Block( 0, 0, 0, 0, 0, 0, 0) // terminate + }; + + public XImage DrawMatrix() + { + return CreateImage(DataMatrix(), _rows, _columns); + } + + /// + /// Creates the DataMatrix code. + /// + internal char[] DataMatrix() + { + int matrixColumns = _columns; + int matrixRows = _rows; + int ecc = 200; + if (String.IsNullOrEmpty(_encoding)) + _encoding = new String('a', _text.Length); + int len = 0; + int maxlen = 0; + int ecclen = 0; + char[] grid = null; + + if (matrixColumns != 0 && matrixRows != 0 && (matrixColumns & 1) != 0 && (matrixRows & 1) != 0 && ecc == 200) + throw new ArgumentException(BcgSR.DataMatrixNotSupported); + + grid = Iec16022Ecc200(matrixColumns, matrixRows, _encoding, _text.Length, _text, len, maxlen, ecclen); + + if (grid == null || matrixColumns == 0) + throw new ArgumentException(BcgSR.DataMatrixNull); //DaSt: ever happen? + return grid; + } + + /// + /// Encodes the DataMatrix. + /// + internal char[] Iec16022Ecc200(int columns, int rows, string encoding, int barcodeLength, string barcode, int len, int max, int ecc) + { + char[] binary = new char[3000]; // encoded raw data and ecc to place in barcode + Ecc200Block matrix = new Ecc200Block(0, 0, 0, 0, 0, 0, 0); + for (int i = 0; i < 3000; i++) + binary[i] = (char)0; + + foreach (Ecc200Block eccmatrix in ecc200Sizes) + { + matrix = eccmatrix; + if (matrix.Width == columns && matrix.Height == rows) + break; + } + + if (matrix.Width == 0) + throw new ArgumentException(BcgSR.DataMatrixInvalid(columns, rows)); + + if (!Ecc200Encode(ref binary, matrix.Bytes, barcode, barcodeLength, encoding, ref len)) + throw new ArgumentException(BcgSR.DataMatrixTooBig); + + // ecc code + Ecc200(binary, matrix.Bytes, matrix.DataBlock, matrix.RSBlock); + // placement + int x; + int y; + int NR; + int[] places; + int NC = columns - 2 * (columns / matrix.CellWidth); + NR = rows - 2 * (rows / matrix.CellHeight); + places = new int[NC * NR]; + Ecc200Placement(ref places, NR, NC); + char[] grid = new char[columns * rows]; + for (y = 0; y < rows; y += matrix.CellHeight) + { + for (x = 0; x < columns; x++) + grid[y * columns + x] = (char)1; + for (x = 0; x < columns; x += 2) + grid[(y + matrix.CellHeight - 1) * columns + x] = (char)1; + } + + for (x = 0; x < columns; x += matrix.CellWidth) + { + for (y = 0; y < rows; y++) + grid[y * columns + x] = (char)1; + for (y = 0; y < rows; y += 2) + grid[y * columns + x + matrix.CellWidth - 1] = (char)1; + } + + for (y = 0; y < NR; y++) + { + for (x = 0; x < NC; x++) + { + int v = places[(NR - y - 1) * NC + x]; + if (v == 1 || v > 7 && ((binary[(v >> 3) - 1] & (1 << (v & 7))) != 0)) + grid[(1 + y + 2 * (y / (matrix.CellHeight - 2))) * columns + 1 + x + 2 * (x / (matrix.CellWidth - 2))] = (char)1; + } + } + return grid; + } + + /// + /// Encodes the barcode with the DataMatrix ECC200 Encoding. + /// + internal bool Ecc200Encode(ref char[] t, int targetLength, string s, int sourceLength, string encoding, ref int len) + { + char enc = 'a'; // start in ASCII encoding mode + int targetposition = 0; + int sourceposition = 0; + if (encoding.Length < sourceLength) + return false; + + // do the encoding + while (sourceposition < sourceLength && targetposition < targetLength) + { + char newenc = enc; // suggest new encoding + if (targetLength - targetposition <= 1 && (enc == 'c' || enc == 't') || targetLength - targetposition <= 2 && enc == 'x') + enc = 'a'; // auto revert to ASCII +#if !SILVERLIGHT + // StL: Who wrote this nonsense? + //newenc = char.Parse(encoding[sourceposition].ToString(CultureInfo.InvariantCulture).ToLower()); + newenc = char.ToLower(encoding[sourceposition]); +#else + throw new NotImplementedException("char.Parse"); +#endif + switch (newenc) + { // encode character + case 'c': // C40 + case 't': // Text + case 'x': // X12 + { + char[] output = new char[6]; + char p = (char)0; + + string e = null; + string s2 = "!\"#$%&'()*+,-./:;<=>?@[\\]_"; + string s3 = null; + if (newenc == 'c') + { + e = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + s3 = "`abcdefghijklmnopqrstuvwxyz{|}~±"; + } + if (newenc == 't') + { + e = " 0123456789abcdefghijklmnopqrstuvwxyz"; + s3 = "`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~±"; + } + if (newenc == 'x') + e = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\r*>"; + do + { + char c = s[sourceposition++]; + char w; + if ((c & 0x80) != 0) + { + if (newenc == 'x') + { + // fprintf (stderr, "Cannot encode char 0x%02X in X12\n", c); + return false; + } + c &= (char)0x7f; + output[p++] = (char)1; + output[p++] = (char)30; + } + w = e.IndexOf(c) == -1 ? (char)0 : e[e.IndexOf(c)]; + if (w != (char)0) + output[p++] = (char)((e.IndexOf(w) + 3) % 40); + else + { + if (newenc == 'x') + { + //fprintf (stderr, "Cannot encode char 0x%02X in X12\n", c); + return false; + } + if (c < 32) + { // shift 1 + output[p++] = (char)0; + output[p++] = c; + } + else + { + w = s2.IndexOf(c) == -1 ? (char)0 : (char)s2.IndexOf(c); + if (w != (char)0) + { // shift 2 + output[p++] = (char)1; + output[p++] = w; + } + else + { + w = s3.IndexOf(c) == -1 ? (char)0 : (char)s3.IndexOf(c); + if (w != (char)0) + { + output[p++] = (char)2; + output[p++] = w; + } + else + //fprintf (stderr, "Could not encode 0x%02X, should not happen\n", c); + return false; + } + } + } + + if (p == 2 && targetposition + 2 == targetLength && sourceposition == sourceLength) + output[p++] = (char)0; // shift 1 pad at end + while (p >= 3) + { + int v = output[0] * 1600 + output[1] * 40 + output[2] + 1; + if (enc != newenc) + { + if (enc == 'c' || enc == 't' || enc == 'x') + t[targetposition++] = (char)254; // escape C40/text/X12 + else if (enc == 'x') + t[targetposition++] = (char)0x7C; // escape EDIFACT + if (newenc == 'c') + t[targetposition++] = (char)230; + if (newenc == 't') + t[targetposition++] = (char)239; + if (newenc == 'x') + t[targetposition++] = (char)238; + enc = newenc; + } + t[targetposition++] = (char)(v >> 8); + t[targetposition++] = (char)(v & 0xFF); + p -= (char)3; + output[0] = output[3]; + output[1] = output[4]; + output[2] = output[5]; + } + } + while (p != (char)0 && sourceposition < sourceLength); + } + break; + case 'e': // EDIFACT + { + char[] output = new char[4]; + char p = (char)0; + if (enc != newenc) + { // can only be from C40/Text/X12 + t[targetposition++] = (char)254; + enc = 'a'; + } + while (sourceposition < sourceLength && /*encoding[sourceposition].ToString(CultureInfo.InvariantCulture).ToLower() == "e"*/ + char.ToLower(encoding[sourceposition]) == 'e' && p < 4) + output[p++] = s[sourceposition++]; + if (p < 4) + { + output[p++] = (char)0x1F; + enc = 'a'; + } // termination + t[targetposition] = (char)((s[0] & 0x3F) << 2); + t[targetposition++] |= (char)((s[1] & 0x30) >> 4); + t[targetposition] = (char)((s[1] & 0x0F) << 4); + if (p == 2) + targetposition++; + else + { + t[targetposition++] |= (char)((s[2] & 0x3C) >> 2); + t[targetposition] = (char)((s[2] & 0x03) << 6); + t[targetposition++] |= (char)(s[3] & 0x3F); + } + } + break; + case 'a': // ASCII + if (enc != newenc) + { + if (enc == 'c' || enc == 't' || enc == 'x') + t[targetposition++] = (char)254; // escape C40/text/X12 + else + t[targetposition++] = (char)0x7C; // escape EDIFACT + } + enc = 'a'; + if (sourceLength - sourceposition >= 2 && char.IsDigit(s[sourceposition]) && char.IsDigit(s[sourceposition + 1])) + { + t[targetposition++] = (char)((s[sourceposition] - '0') * 10 + s[sourceposition + 1] - '0' + 130); + sourceposition += 2; + } + else if (s[sourceposition] > 127) + { + t[targetposition++] = (char)235; + t[targetposition++] = (char)(s[sourceposition++] - 127); + } + else + t[targetposition++] = (char)(s[sourceposition++] + 1); + break; + case 'b': // Binary + { + int l = 0; // how much to encode + if (encoding != null) + { + int p; + for (p = sourceposition; p < sourceLength && /*encoding[p].ToString(CultureInfo.InvariantCulture).ToLower() == "b"*/ char.ToLower(encoding[p]) == 'b'; p++) + l++; + } + t[targetposition++] = (char)231; // base256 + if (l < 250) + { + t[targetposition] = (char)State255(l, targetposition); + targetposition++; + } + else + { + t[targetposition] = (char)State255(249 + (l / 250), targetposition); + targetposition++; + t[targetposition] = (char)State255(l % 250, targetposition); + targetposition++; + } + while (l-- != 0 && targetposition < targetLength) + { + t[targetposition] = (char)State255(s[sourceposition++], targetposition); + targetposition++; + } + enc = 'a'; // reverse to ASCII at end + } + break; + // default: + // fprintf (stderr, "Unknown encoding %c\n", newenc); + // return 0; // failed + } + } + if (len != 0) + len = targetposition; + if (targetposition < targetLength && enc != 'a') + { + if (enc == 'c' || enc == 'x' || enc == 't') + t[targetposition++] = (char)254; // escape X12/C40/Text + else + t[targetposition++] = (char)0x7C; // escape EDIFACT + } + + if (targetposition < targetLength) + t[targetposition++] = (char)129; // pad + + while (targetposition < targetLength) + { // more padding + int v = 129 + (((targetposition + 1) * 149) % 253) + 1; // see Annex H + if (v > 254) + v -= 254; + t[targetposition++] = (char)v; + } + if (targetposition > targetLength || sourceposition < sourceLength) + return false; // did not fit + return true; // OK + } + + int State255(int value, int position) + { + return ((value + (((position + 1) * 149) % 255) + 1) % 256); + } + + /// + /// Places the data in the right positions according to Annex M of the ECC200 specification. + /// + void Ecc200Placement(ref int[] array, int NR, int NC) + { + int r; + int c; + int p; + + // invalidate + for (r = 0; r < NR; r++) + for (c = 0; c < NC; c++) + array[r * NC + c] = 0; + // start + p = 1; + r = 4; + c = 0; + do + { + // check corner + if (r == NR && (c == 0)) + Ecc200PlacementCornerA(ref array, NR, NC, p++); + if (r == NR - 2 && c == 0 && ((NC % 4) != 0)) + Ecc200PlacementCornerB(ref array, NR, NC, p++); + if (r == NR - 2 && c == 0 && ((NC % 8) == 4)) + Ecc200PlacementCornerC(ref array, NR, NC, p++); + if (r == NR + 4 && c == 2 && ((NC % 8) == 0)) + Ecc200PlacementCornerD(ref array, NR, NC, p++); + // up/right + do + { + if (r < NR && c >= 0 && array[r * NC + c] == 0) + Ecc200PlacementBlock(ref array, NR, NC, r, c, p++); + r -= 2; + c += 2; + } + while (r >= 0 && c < NC); + r++; + c += 3; + // down/left + do + { + if (r >= 0 && c < NC && array[r * NC + c] == 0) + Ecc200PlacementBlock(ref array, NR, NC, r, c, p++); + r += 2; + c -= 2; + } + while (r < NR && c >= 0); + r += 3; + c++; + } + while (r < NR || c < NC); + // unfilled corner + if (array[NR * NC - 1] == 0) + array[NR * NC - 1] = array[NR * NC - NC - 2] = 1; + } + + /// + /// Places the ECC200 bits in the right positions. + /// + void Ecc200PlacementBit(ref int[] array, int NR, int NC, int r, int c, int p, int b) + { + if (r < 0) + { + r += NR; + c += 4 - ((NR + 4) % 8); + } + if (c < 0) + { + c += NC; + r += 4 - ((NC + 4) % 8); + } + array[r * NC + c] = (p << 3) + b; + } + + void Ecc200PlacementBlock(ref int[] array, int NR, int NC, int r, int c, int p) + { + Ecc200PlacementBit(ref array, NR, NC, r - 2, c - 2, p, 7); + Ecc200PlacementBit(ref array, NR, NC, r - 2, c - 1, p, 6); + Ecc200PlacementBit(ref array, NR, NC, r - 1, c - 2, p, 5); + Ecc200PlacementBit(ref array, NR, NC, r - 1, c - 1, p, 4); + Ecc200PlacementBit(ref array, NR, NC, r - 1, c - 0, p, 3); + Ecc200PlacementBit(ref array, NR, NC, r - 0, c - 2, p, 2); + Ecc200PlacementBit(ref array, NR, NC, r - 0, c - 1, p, 1); + Ecc200PlacementBit(ref array, NR, NC, r - 0, c - 0, p, 0); + } + + void Ecc200PlacementCornerA(ref int[] array, int NR, int NC, int p) + { + Ecc200PlacementBit(ref array, NR, NC, NR - 1, 0, p, 7); + Ecc200PlacementBit(ref array, NR, NC, NR - 1, 1, p, 6); + Ecc200PlacementBit(ref array, NR, NC, NR - 1, 2, p, 5); + Ecc200PlacementBit(ref array, NR, NC, 0, NC - 2, p, 4); + Ecc200PlacementBit(ref array, NR, NC, 0, NC - 1, p, 3); + Ecc200PlacementBit(ref array, NR, NC, 1, NC - 1, p, 2); + Ecc200PlacementBit(ref array, NR, NC, 2, NC - 1, p, 1); + Ecc200PlacementBit(ref array, NR, NC, 3, NC - 1, p, 0); + } + + void Ecc200PlacementCornerB(ref int[] array, int NR, int NC, int p) + { + Ecc200PlacementBit(ref array, NR, NC, NR - 3, 0, p, 7); + Ecc200PlacementBit(ref array, NR, NC, NR - 2, 0, p, 6); + Ecc200PlacementBit(ref array, NR, NC, NR - 1, 0, p, 5); + Ecc200PlacementBit(ref array, NR, NC, 0, NC - 4, p, 4); + Ecc200PlacementBit(ref array, NR, NC, 0, NC - 3, p, 3); + Ecc200PlacementBit(ref array, NR, NC, 0, NC - 2, p, 2); + Ecc200PlacementBit(ref array, NR, NC, 0, NC - 1, p, 1); + Ecc200PlacementBit(ref array, NR, NC, 1, NC - 1, p, 0); + } + + void Ecc200PlacementCornerC(ref int[] array, int NR, int NC, int p) + { + Ecc200PlacementBit(ref array, NR, NC, NR - 3, 0, p, 7); + Ecc200PlacementBit(ref array, NR, NC, NR - 2, 0, p, 6); + Ecc200PlacementBit(ref array, NR, NC, NR - 1, 0, p, 5); + Ecc200PlacementBit(ref array, NR, NC, 0, NC - 2, p, 4); + Ecc200PlacementBit(ref array, NR, NC, 0, NC - 1, p, 3); + Ecc200PlacementBit(ref array, NR, NC, 1, NC - 1, p, 2); + Ecc200PlacementBit(ref array, NR, NC, 2, NC - 1, p, 1); + Ecc200PlacementBit(ref array, NR, NC, 3, NC - 1, p, 0); + } + + void Ecc200PlacementCornerD(ref int[] array, int NR, int NC, int p) + { + Ecc200PlacementBit(ref array, NR, NC, NR - 1, 0, p, 7); + Ecc200PlacementBit(ref array, NR, NC, NR - 1, NC - 1, p, 6); + Ecc200PlacementBit(ref array, NR, NC, 0, NC - 3, p, 5); + Ecc200PlacementBit(ref array, NR, NC, 0, NC - 2, p, 4); + Ecc200PlacementBit(ref array, NR, NC, 0, NC - 1, p, 3); + Ecc200PlacementBit(ref array, NR, NC, 1, NC - 3, p, 2); + Ecc200PlacementBit(ref array, NR, NC, 1, NC - 2, p, 1); + Ecc200PlacementBit(ref array, NR, NC, 1, NC - 1, p, 0); + } + + /// + /// Calculate and append the Reed Solomon Code. + /// + void Ecc200(char[] binary, int bytes, int datablock, int rsblock) + { + int blocks = (bytes + 2) / datablock; + int b; + InitGalois(0x12d); + InitReedSolomon(rsblock, 1); + for (b = 0; b < blocks; b++) + { + int[] buf = new int[256]; + int[] ecc = new int[256]; + int n, + p = 0; + for (n = b; n < bytes; n += blocks) + buf[p++] = binary[n]; + EncodeReedSolomon(p, buf, ref ecc); + p = rsblock - 1; // comes back reversed + for (n = b; n < rsblock * blocks; n += blocks) + binary[bytes + n] = (char)ecc[p--]; + } + } + + static int gfpoly; + static int symsize; // in bits + static int logmod; // 2**symsize - 1 + static int rlen; + + static int[] log = null; + static int[] alog = null; + static int[] rspoly = null; + + /// + /// Initialize the Galois Field. + /// + /// + public static void InitGalois(int poly) + { + int m; + int b; + int p; + int v; + + // Return storage from previous setup + if (log != null) + { + log = null; + alog = null; + rspoly = null; + } + // Find the top bit, and hence the symbol size + for (b = 1, m = 0; b <= poly; b <<= 1) + m++; + b >>= 1; + m--; + gfpoly = poly; + symsize = m; + + // Calculate the log/alog tables + logmod = (1 << m) - 1; + log = new int[logmod + 1]; + alog = new int[logmod]; + + for (p = 1, v = 0; v < logmod; v++) + { + alog[v] = p; + log[p] = v; + p <<= 1; + if ((p & b) != 0) //DaSt: check! + p ^= poly; + } + } + + /// + /// Initializes the Reed-Solomon Encoder. + /// + public static void InitReedSolomon(int nsym, int index) + { + int i; + int k; + + if (rspoly != null) + rspoly = null; + rspoly = new int[nsym + 1]; + + rlen = nsym; + + rspoly[0] = 1; + for (i = 1; i <= nsym; i++) + { + rspoly[i] = 1; + for (k = i - 1; k > 0; k--) + { + if (rspoly[k] != 0) //DaSt: check! + rspoly[k] = alog[(log[rspoly[k]] + index) % logmod]; + rspoly[k] ^= rspoly[k - 1]; + } + rspoly[0] = alog[(log[rspoly[0]] + index) % logmod]; + index++; + } + } + + /// + /// Encodes the Reed-Solomon encoding + /// + public void EncodeReedSolomon(int length, int[] data, ref int[] result) + { + int i; + int k; + int m; + for (i = 0; i < rlen; i++) + result[i] = 0; + for (i = 0; i < length; i++) + { + m = result[rlen - 1] ^ data[i]; + for (k = rlen - 1; k > 0; k--) + { + if ((m != 0) && (rspoly[k] != 0)) //DaSt: check! + result[k] = result[k - 1] ^ alog[(log[m] + log[rspoly[k]]) % logmod]; + else + result[k] = result[k - 1]; + } + if ((m != 0) && (rspoly[0] != 0)) //DaSt: check! + result[0] = alog[(log[m] + log[rspoly[0]]) % logmod]; + else + result[0] = 0; + } + } + + /// + /// Creates a DataMatrix image object. + /// + /// A hex string like "AB 08 C3...". + /// I.e. 26 for a 26x26 matrix + public XImage CreateImage(char[] code, int size)//(string code, int size) + { + return CreateImage(code, size, size, 10); + } + + /// + /// Creates a DataMatrix image object. + /// + public XImage CreateImage(char[] code, int rows, int columns) + { + return CreateImage(code, rows, columns, 10); + } + + /// + /// Creates a DataMatrix image object. + /// + public XImage CreateImage(char[] code, int rows, int columns, int pixelsize) + { +#if GDI + Bitmap bm = new Bitmap(columns * pixelsize, rows * pixelsize); + using (Graphics gfx = Graphics.FromImage(bm)) + { + gfx.FillRectangle(System.Drawing.Brushes.White, new Rectangle(0, 0, columns * pixelsize, rows * pixelsize)); + + for (int i = rows - 1; i >= 0; i--) + { + for (int j = 0; j < columns; j++) + { + if (code[((rows - 1) - i) * columns + j] == (char)1) + gfx.FillRectangle(System.Drawing.Brushes.Black, j * pixelsize, i * pixelsize, pixelsize, pixelsize); + } + } + } + XImage image = XImage.FromGdiPlusImage(bm); + image.Interpolate = false; + return image; +#endif +#if WPF + // WPFHACK + return null; +#endif +#if CORE || NETFX_CORE || UWP + return null; +#endif + } + + struct Ecc200Block + { + public readonly int Height; + public readonly int Width; + public readonly int CellHeight; + public readonly int CellWidth; + public readonly int Bytes; + public readonly int DataBlock; + public readonly int RSBlock; + + public Ecc200Block(int h, int w, int ch, int cw, int bytes, int dataBlock, int rsBlock) + { + Height = h; + Width = w; + CellHeight = ch; + CellWidth = cw; + Bytes = bytes; + DataBlock = dataBlock; + RSBlock = rsBlock; + } + } + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing.BarCodes/DataMatrixImage.opensource.cs b/PdfSharp/Drawing.BarCodes/DataMatrixImage.opensource.cs new file mode 100644 index 0000000..7bef7e1 --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/DataMatrixImage.opensource.cs @@ -0,0 +1,239 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// David Stephensen +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if GDI +using System.Drawing; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +#endif + + + +// ======================================================================================== +// ======================================================================================== +// ===== THIS CLASS IS A FAKE. THE OPEN SOURCE VERSION OF PDFSHARP DOES NOT IMPLEMENT ===== +// ===== A DATAMATRIX CODE. THIS IS BECAUSE OF THE ISO COPYRIGHT. ===== +// ======================================================================================== +// ======================================================================================== + +// Even if it looks like a datamatrix code it is just random + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Creates the XImage object for a DataMatrix. + /// Important note for OpenSource version of PDFsharp: + /// The generated image object only contains random data. + /// If you need the correct implementation as defined in the ISO/IEC 16022:2000 specification, + /// please contact empira Software GmbH via www.pdfsharp.com. + /// + internal class DataMatrixImage + { + public static XImage GenerateMatrixImage(string text, string encoding, int rows, int columns) + { + DataMatrixImage dataMatrixImage = new DataMatrixImage(text, encoding, rows, columns); + return dataMatrixImage.DrawMatrix(); + } + + public DataMatrixImage(string text, string encoding, int rows, int columns) + { + this.text = text; + this.encoding = encoding; + this.rows = rows; + this.columns = columns; + } + + string text; + string encoding; + int rows; + int columns; + + /// + /// Possible ECC200 Matrixes + /// + static Ecc200Block[] ecc200Sizes = + { + new Ecc200Block( 10, 10, 10, 10, 3, 3, 5), // + new Ecc200Block( 12, 12, 12, 12, 5, 5, 7), // + new Ecc200Block( 8, 18, 8, 18, 5, 5, 7), // + new Ecc200Block( 14, 14, 14, 14, 8, 8, 10), // + new Ecc200Block( 8, 32, 8, 16, 10, 10, 11), // + new Ecc200Block( 16, 16, 16, 16, 12, 12, 12), // + new Ecc200Block( 12, 26, 12, 26, 16, 16, 14), // + new Ecc200Block( 18, 18, 18, 18, 18, 18, 14), // + new Ecc200Block( 20, 20, 20, 20, 22, 22, 18), // + new Ecc200Block( 12, 36, 12, 18, 22, 22, 18), // + new Ecc200Block( 22, 22, 22, 22, 30, 30, 20), // + new Ecc200Block( 16, 36, 16, 18, 32, 32, 24), // + new Ecc200Block( 24, 24, 24, 24, 36, 36, 24), // + new Ecc200Block( 26, 26, 26, 26, 44, 44, 28), // + new Ecc200Block( 16, 48, 16, 24, 49, 49, 28), // + new Ecc200Block( 32, 32, 16, 16, 62, 62, 36), // + new Ecc200Block( 36, 36, 18, 18, 86, 86, 42), // + new Ecc200Block( 40, 40, 20, 20, 114, 114, 48), // + new Ecc200Block( 44, 44, 22, 22, 144, 144, 56), // + new Ecc200Block( 48, 48, 24, 24, 174, 174, 68), // + new Ecc200Block( 52, 52, 26, 26, 204, 102, 42), // + new Ecc200Block( 64, 64, 16, 16, 280, 140, 56), // + new Ecc200Block( 72, 72, 18, 18, 368, 92, 36), // + new Ecc200Block( 80, 80, 20, 20, 456, 114, 48), // + new Ecc200Block( 88, 88, 22, 22, 576, 144, 56), // + new Ecc200Block( 96, 96, 24, 24, 696, 174, 68), // + new Ecc200Block(104, 104, 26, 26, 816, 136, 56), // + new Ecc200Block(120, 120, 20, 20, 1050, 175, 68), // + new Ecc200Block(132, 132, 22, 22, 1304, 163, 62), // + new Ecc200Block(144, 144, 24, 24, 1558, 156, 62), // 156*4+155*2 + new Ecc200Block( 0, 0, 0, 0, 0, 0, 0) // terminate + }; + + public XImage DrawMatrix() + { + return CreateImage(DataMatrix(), this.rows, this.columns); + } + + /// + /// Creates the DataMatrix code. + /// + internal char[] DataMatrix() + { + int matrixColumns = this.columns; + int matrixRows = this.rows; + Ecc200Block matrix = new Ecc200Block(0, 0, 0, 0, 0, 0, 0); + + foreach (Ecc200Block eccmatrix in ecc200Sizes) + { + matrix = eccmatrix; + if (matrix.Width != columns || matrix.Height != rows) + continue; + else + break; + } + + char[] grid = new char[matrixColumns * matrixRows]; + Random rand = new Random(); + + for (int ccol = 0; ccol < matrixColumns; ccol++) + grid[ccol] = (char)1; + + for (int rrows = 1; rrows < matrixRows; rrows++) + { + grid[rrows * matrixRows] = (char)1; + for (int ccol = 1; ccol < matrixColumns; ccol++) + grid[rrows * matrixRows + ccol] = (char)rand.Next(2); + } + + if (grid == null || matrixColumns == 0) + return null; //No barcode produced; + return grid; + } + + /// + /// Encodes the DataMatrix. + /// + internal char[] Iec16022Ecc200(int columns, int rows, string encoding, int barcodelen, string barcode, int len, int max, int ecc) + { + return null; + } + + /// + /// Creates a DataMatrix image object. + /// + /// A hex string like "AB 08 C3...". + /// I.e. 26 for a 26x26 matrix + public XImage CreateImage(char[] code, int size)//(string code, int size) + { + return CreateImage(code, size, size, 10); + } + + /// + /// Creates a DataMatrix image object. + /// + public XImage CreateImage(char[] code, int rows, int columns) + { + return CreateImage(code, rows, columns, 10); + } + + /// + /// Creates a DataMatrix image object. + /// + public XImage CreateImage(char[] code, int rows, int columns, int pixelsize) + { +#if GDI + Bitmap bm = new Bitmap(columns * pixelsize, rows * pixelsize); + using (Graphics gfx = Graphics.FromImage(bm)) + { + gfx.FillRectangle(System.Drawing.Brushes.White, new Rectangle(0, 0, columns * pixelsize, rows * pixelsize)); + + for (int i = rows - 1; i >= 0; i--) + { + for (int j = 0; j < columns; j++) + { + if (code[((rows - 1) - i) * columns + j] == (char)1) + gfx.FillRectangle(System.Drawing.Brushes.Black, j * pixelsize, i * pixelsize, pixelsize, pixelsize); + } + } + System.Drawing.Pen pen = new System.Drawing.Pen(System.Drawing.Color.Firebrick, pixelsize); + gfx.DrawLine(pen, 0, 0, rows * pixelsize, columns * pixelsize); + gfx.DrawLine(pen, columns * pixelsize, 0, 0, rows * pixelsize); + } + XImage image = XImage.FromGdiPlusImage(bm); + image.Interpolate = false; + return image; +#elif WPF + return null; +#endif + } + } + + struct Ecc200Block + { + public int Height; + public int Width; + public int CellHeight; + public int CellWidth; + public int Bytes; + public int DataBlock; + public int RSBlock; + + public Ecc200Block(int h, int w, int ch, int cw, int bytes, int datablock, int rsblock) + { + Height = h; + Width = w; + CellHeight = ch; + CellWidth = cw; + Bytes = bytes; + DataBlock = datablock; + RSBlock = rsblock; + } + } +} diff --git a/PdfSharp/Drawing.BarCodes/MatrixCode.cs b/PdfSharp/Drawing.BarCodes/MatrixCode.cs new file mode 100644 index 0000000..f0fce0c --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/MatrixCode.cs @@ -0,0 +1,137 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// David Stephensen +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Represents the base class of all 2D codes. + /// + public abstract class MatrixCode : CodeBase + { + /// + /// Initializes a new instance of the class. + /// + public MatrixCode(string text, string encoding, int rows, int columns, XSize size) + : base(text, size, CodeDirection.LeftToRight) + { + _encoding = encoding; + if (String.IsNullOrEmpty(_encoding)) + _encoding = new String('a', Text.Length); + + if (columns < rows) + { + _rows = columns; + _columns = rows; + } + else + { + _columns = columns; + _rows = rows; + } + + Text = text; + } + + /// + /// Gets or sets the encoding. docDaSt + /// + public string Encoding + { + get { return _encoding; } + set + { + _encoding = value; + _matrixImage = null; + } + } + string _encoding; + + /// + /// docDaSt + /// + public int Columns + { + get { return _columns; } + set + { + _columns = value; + _matrixImage = null; + } + } + int _columns; + + /// + /// docDaSt + /// + public int Rows + { + get { return _rows; } + set + { + _rows = value; + _matrixImage = null; + } + } + int _rows; + + /// + /// docDaSt + /// + public new string Text + { + get { return base.Text; } + set + { + base.Text = value; + _matrixImage = null; + } + } + + internal XImage MatrixImage + { + get { return _matrixImage; } + set { _matrixImage = value; } + } + XImage _matrixImage; + + /// + /// When implemented in a derived class renders the 2D code. + /// + protected internal abstract void Render(XGraphics gfx, XBrush brush, XPoint center); + + /// + /// Determines whether the specified string can be used as Text for this matrix code type. + /// + protected override void CheckCode(string text) + { } + } +} diff --git a/PdfSharp/Drawing.BarCodes/OmrData.cs b/PdfSharp/Drawing.BarCodes/OmrData.cs new file mode 100644 index 0000000..5b0168b --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/OmrData.cs @@ -0,0 +1,130 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.BarCodes +{ +#if true_ + /// + /// Represents the data coded within the OMR code. + /// + class OmrData + { + private OmrData() + { + } + + public static OmrData ForTesting + { + get + { + OmrData data = new OmrData(); + data.AddMarkDescription("LK"); + data.AddMarkDescription("DGR"); + data.AddMarkDescription("GM1"); + data.AddMarkDescription("GM2"); + data.AddMarkDescription("GM4"); + data.AddMarkDescription("GM8"); + data.AddMarkDescription("GM16"); + data.AddMarkDescription("GM32"); + data.AddMarkDescription("ZS1"); + data.AddMarkDescription("ZS2"); + data.AddMarkDescription("ZS3"); + data.AddMarkDescription("ZS4"); + data.AddMarkDescription("ZS5"); + data.InitMarks(); + return data; + } + } + + ///// + ///// NYI: Get OMR description read from text file. + ///// + ///// An OmrData object. + //public static OmrData FromDescriptionFile(string filename) + //{ + // throw new NotImplementedException(); + //} + + /// + /// Adds a mark description by name. + /// + /// The name to for setting or unsetting the mark. + private void AddMarkDescription(string name) + { + if (_marksInitialized) + throw new InvalidOperationException(BcgSR.OmrAlreadyInitialized); + + _nameToIndex[name] = AddedDescriptions; + ++AddedDescriptions; + } + + private void InitMarks() + { + if (AddedDescriptions == 0) + throw new InvalidOperationException(); + + _marks = new bool[AddedDescriptions]; + _marks.Initialize(); + _marksInitialized = true; + } + + private int FindIndex(string name) + { + if (!_marksInitialized) + InitMarks(); + + if (!_nameToIndex.Contains(name)) + throw new ArgumentException(BcgSR.InvalidMarkName(name)); + + return (int)_nameToIndex[name]; + } + + public void SetMark(string name) + { + int idx = FindIndex(name); + _marks[idx] = true; + } + + public void UnsetMark(string name) + { + int idx = FindIndex(name); + _marks[idx] = false; + } + + public bool[] Marks + { + get { return _marks; } + } + System.Collections.Hash_table nameToIndex = new Hash_table(); + bool[] marks; + int addedDescriptions = 0; + bool marksInitialized = false; + } +#endif +} diff --git a/PdfSharp/Drawing.BarCodes/ThickThinBarcodeRenderer.cs b/PdfSharp/Drawing.BarCodes/ThickThinBarcodeRenderer.cs new file mode 100644 index 0000000..45ef2b7 --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/ThickThinBarcodeRenderer.cs @@ -0,0 +1,186 @@ +// +// PDFsharp - A library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +using System; + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Internal base class for several bar code types. + /// + public abstract class ThickThinBarCode : BarCode // TODO: The name is not optimal + { + /// + /// Initializes a new instance of the class. + /// + public ThickThinBarCode(string code, XSize size, CodeDirection direction) + : base(code, size, direction) + { } + + internal override void InitRendering(BarCodeRenderInfo info) + { + base.InitRendering(info); + CalcThinBarWidth(info); + info.BarHeight = Size.Height; + // HACK in ThickThinBarCode + if (TextLocation != TextLocation.None) + info.BarHeight *= 4.0 / 5; + +#if DEBUG_ + XColor back = XColors.LightSalmon; + back.A = 0.3; + XSolidBrush brush = new XSolidBrush(back); + info.Gfx.DrawRectangle(brush, new XRect(info.Center - size / 2, size)); +#endif + switch (Direction) + { + case CodeDirection.RightToLeft: + info.Gfx.RotateAtTransform(180, info.Position); + break; + + case CodeDirection.TopToBottom: + info.Gfx.RotateAtTransform(90, info.Position); + break; + + case CodeDirection.BottomToTop: + info.Gfx.RotateAtTransform(-90, info.Position); + break; + } + } + + /// + /// Gets or sets the ration between thick an thin lines. Must be between 2 and 3. + /// Optimal and also default value is 2.6. + /// + public override double WideNarrowRatio + { + get { return _wideNarrowRatio; } + set + { + if (value > 3 || value < 2) + throw new ArgumentOutOfRangeException("value", BcgSR.Invalid2of5Relation); + _wideNarrowRatio = value; + } + } + double _wideNarrowRatio = 2.6; + + /// + /// Renders a thick or thin line for the bar code. + /// + /// + /// Determines whether a thick or a thin line is about to be rendered. + internal void RenderBar(BarCodeRenderInfo info, bool isThick) + { + double barWidth = GetBarWidth(info, isThick); + double height = Size.Height; + double xPos = info.CurrPos.X; + double yPos = info.CurrPos.Y; + + switch (TextLocation) + { + case TextLocation.AboveEmbedded: + height -= info.Gfx.MeasureString(Text, info.Font).Height; + yPos += info.Gfx.MeasureString(Text, info.Font).Height; + break; + case TextLocation.BelowEmbedded: + height -= info.Gfx.MeasureString(Text, info.Font).Height; + break; + } + + XRect rect = new XRect(xPos, yPos, barWidth, height); + info.Gfx.DrawRectangle(info.Brush, rect); + info.CurrPos.X += barWidth; + } + + /// + /// Renders a thick or thin gap for the bar code. + /// + /// + /// Determines whether a thick or a thin gap is about to be rendered. + internal void RenderGap(BarCodeRenderInfo info, bool isThick) + { + info.CurrPos.X += GetBarWidth(info, isThick); + } + + /// + /// Renders a thick bar before or behind the code. + /// + internal void RenderTurboBit(BarCodeRenderInfo info, bool startBit) + { + if (startBit) + info.CurrPos.X -= 0.5 + GetBarWidth(info, true); + else + info.CurrPos.X += 0.5; //GetBarWidth(info, true); + + RenderBar(info, true); + + if (startBit) + info.CurrPos.X += 0.5; //GetBarWidth(info, true); + } + + internal void RenderText(BarCodeRenderInfo info) + { + if (info.Font == null) + info.Font = new XFont("Courier New", Size.Height / 6); + XPoint center = info.Position + CalcDistance(Anchor, AnchorType.TopLeft, Size); + + switch (TextLocation) + { + case TextLocation.Above: + center = new XPoint(center.X, center.Y - info.Gfx.MeasureString(Text, info.Font).Height); + info.Gfx.DrawString(Text, info.Font, info.Brush, new XRect(center, Size), XStringFormats.TopCenter); + break; + case TextLocation.AboveEmbedded: + info.Gfx.DrawString(Text, info.Font, info.Brush, new XRect(center, Size), XStringFormats.TopCenter); + break; + case TextLocation.Below: + center = new XPoint(center.X, info.Gfx.MeasureString(Text, info.Font).Height + center.Y); + info.Gfx.DrawString(Text, info.Font, info.Brush, new XRect(center, Size), XStringFormats.BottomCenter); + break; + case TextLocation.BelowEmbedded: + info.Gfx.DrawString(Text, info.Font, info.Brush, new XRect(center, Size), XStringFormats.BottomCenter); + break; + } + } + + /// + /// Gets the width of a thick or a thin line (or gap). CalcLineWidth must have been called before. + /// + /// + /// Determines whether a thick line's with shall be returned. + internal double GetBarWidth(BarCodeRenderInfo info, bool isThick) + { + if (isThick) + return info.ThinBarWidth * _wideNarrowRatio; + return info.ThinBarWidth; + } + + internal abstract void CalcThinBarWidth(BarCodeRenderInfo info); + } +} diff --git a/PdfSharp/Drawing.BarCodes/enums/AnchorType.cs b/PdfSharp/Drawing.BarCodes/enums/AnchorType.cs new file mode 100644 index 0000000..498bc2f --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/enums/AnchorType.cs @@ -0,0 +1,82 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Specifies whether and how the text is displayed at the code area. + /// + public enum AnchorType + { + /// + /// The anchor is located top left. + /// + TopLeft, + + /// + /// The anchor is located top center. + /// + TopCenter, + + /// + /// The anchor is located top right. + /// + TopRight, + + /// + /// The anchor is located middle left. + /// + MiddleLeft, + + /// + /// The anchor is located middle center. + /// + MiddleCenter, + + /// + /// The anchor is located middle right. + /// + MiddleRight, + + /// + /// The anchor is located bottom left. + /// + BottomLeft, + + /// + /// The anchor is located bottom center. + /// + BottomCenter, + + /// + /// The anchor is located bottom right. + /// + BottomRight, + } +} diff --git a/PdfSharp/Drawing.BarCodes/enums/CodeDirection.cs b/PdfSharp/Drawing.BarCodes/enums/CodeDirection.cs new file mode 100644 index 0000000..a4c50bb --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/enums/CodeDirection.cs @@ -0,0 +1,57 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Specifies the drawing direction of the code. + /// + public enum CodeDirection + { + /// + /// Does not rotate the code. + /// + LeftToRight, + + /// + /// Rotates the code 180 at the anchor position. + /// + BottomToTop, + + /// + /// Rotates the code 180 at the anchor position. + /// + RightToLeft, + + /// + /// Rotates the code 180 at the anchor position. + /// + TopToBottom, + } +} diff --git a/PdfSharp/Drawing.BarCodes/enums/CodeType.cs b/PdfSharp/Drawing.BarCodes/enums/CodeType.cs new file mode 100644 index 0000000..bc4aa42 --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/enums/CodeType.cs @@ -0,0 +1,59 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Specifies the type of the bar code. + /// + public enum CodeType + { + /// + /// The standard 2 of 5 interleaved bar code. + /// + // ReSharper disable once InconsistentNaming + Code2of5Interleaved, + + /// + /// The standard 3 of 9 bar code. + /// + // ReSharper disable once InconsistentNaming + Code3of9Standard, + + /// + /// The OMR code. + /// + Omr, + + /// + /// The data matrix code. + /// + DataMatrix, + } +} diff --git a/PdfSharp/Drawing.BarCodes/enums/DataMatrixEncoding.cs b/PdfSharp/Drawing.BarCodes/enums/DataMatrixEncoding.cs new file mode 100644 index 0000000..0c672d0 --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/enums/DataMatrixEncoding.cs @@ -0,0 +1,68 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// docDaSt + /// + public enum DataMatrixEncoding + { + /// + /// docDaSt + /// + Ascii, + + /// + /// docDaSt + /// + C40, + + /// + /// docDaSt + /// + Text, + + /// + /// docDaSt + /// + X12, + + /// + /// docDaSt + /// + // ReSharper disable once InconsistentNaming + EDIFACT, + + /// + /// docDaSt + /// + Base256 + } +} diff --git a/PdfSharp/Drawing.BarCodes/enums/MarkDistance.cs b/PdfSharp/Drawing.BarCodes/enums/MarkDistance.cs new file mode 100644 index 0000000..fcf76dd --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/enums/MarkDistance.cs @@ -0,0 +1,50 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.BarCodes +{ + ///// + ///// Valid mark distances for OMR Codes. + ///// + //public enum MarkDistance + //{ + // /// + // /// 2/6 inch, valid for printing with 6 lpi. (line height = 12 pt). + // /// + // Inch1_6, + // /// + // /// 2/6 inch, valid for printing with 6 lpi (line height = 12 pt). + // /// + // Inch2_6, + // /// + // /// 2/8 inch, valid for printing with 8 lpi (line height = 9 pt). + // /// + // Inch2_8 + //} +} \ No newline at end of file diff --git a/PdfSharp/Drawing.BarCodes/enums/TextLocation.cs b/PdfSharp/Drawing.BarCodes/enums/TextLocation.cs new file mode 100644 index 0000000..92268f4 --- /dev/null +++ b/PdfSharp/Drawing.BarCodes/enums/TextLocation.cs @@ -0,0 +1,64 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Klaus Potzesny +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.BarCodes +{ + /// + /// Specifies whether and how the text is displayed at the code. + /// + public enum TextLocation + { + /// + /// No text is drawn. + /// + None, + + /// + /// The text is located above the code. + /// + Above, + + /// + /// The text is located below the code. + /// + Below, + + + /// + /// The text is located above within the code. + /// + AboveEmbedded, + + + /// + /// The text is located below within the code. + /// + BelowEmbedded, + } +} diff --git a/PdfSharp/Drawing.Internal/IImageImporter.cs b/PdfSharp/Drawing.Internal/IImageImporter.cs new file mode 100644 index 0000000..8d97a50 --- /dev/null +++ b/PdfSharp/Drawing.Internal/IImageImporter.cs @@ -0,0 +1,328 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Thomas Hövel +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.IO; +using PdfSharp.Pdf; + +namespace PdfSharp.Drawing +{ + /// + /// This interface will be implemented by specialized classes, one for JPEG, one for BMP, one for PNG, one for GIF. Maybe more. + /// + internal interface IImageImporter + { + /// + /// Imports the image. Returns null if the image importer does not support the format. + /// + ImportedImage ImportImage(StreamReaderHelper stream, PdfDocument document); + + /// + /// Prepares the image data needed for the PDF file. + /// + ImageData PrepareImage(ImagePrivateData data); + } + + // $THHO Add IDispose?. + /// + /// Helper for dealing with Stream data. + /// + internal class StreamReaderHelper + { + internal StreamReaderHelper(Stream stream) + { +#if GDI || WPF + _stream = stream; + MemoryStream ms = stream as MemoryStream; + if (ms == null) + { + // THHO4STLA byte[] or MemoryStream? + _ownedMemoryStream = ms = new MemoryStream(); + CopyStream(stream, ms); + // For .NET 4: stream.CopyTo(ms); + } + _data = ms.GetBuffer(); + _length = (int)ms.Length; +#else + // For WinRT there is no GetBuffer() => alternative implementation for WinRT. + // TODO: Are there advantages of GetBuffer()? It should reduce LOH fragmentation. + _stream = stream; + _stream.Position = 0; + if (_stream.Length > int.MaxValue) + throw new ArgumentException("Stream is too large.", "stream"); + _length = (int)_stream.Length; + _data = new byte[_length]; + _stream.Read(_data, 0, _length); +#endif + } + + internal byte GetByte(int offset) + { + if (_currentOffset + offset >= _length) + { + Debug.Assert(false); + return 0; + } + return _data[_currentOffset + offset]; + } + + internal ushort GetWord(int offset, bool bigEndian) + { + return (ushort)(bigEndian ? + GetByte(offset) * 256 + GetByte(offset + 1) : + GetByte(offset) + GetByte(offset + 1) * 256); + } + + internal uint GetDWord(int offset, bool bigEndian) + { + return (uint)(bigEndian ? + GetWord(offset, true) * 65536 + GetWord(offset + 2, true) : + GetWord(offset, false) + GetWord(offset + 2, false) * 65536); + } + + private static void CopyStream(Stream input, Stream output) + { + byte[] buffer = new byte[65536]; + int read; + while ((read = input.Read(buffer, 0, buffer.Length)) > 0) + { + output.Write(buffer, 0, read); + } + } + + /// + /// Resets this instance. + /// + public void Reset() + { + _currentOffset = 0; + } + + /// + /// Gets the original stream. + /// + public Stream OriginalStream + { + get { return _stream; } + } + private readonly Stream _stream; + + internal int CurrentOffset + { + get { return _currentOffset; } + set { _currentOffset = value; } + } + private int _currentOffset; + + /// + /// Gets the data as byte[]. + /// + public byte[] Data + { + get { return _data; } + } + private readonly byte[] _data; + + /// + /// Gets the length of Data. + /// + public int Length + { + get { return _length; } + } + + private readonly int _length; + +#if GDI || WPF + /// + /// Gets the owned memory stream. Can be null if no MemoryStream was created. + /// + public MemoryStream OwnedMemoryStream + { + get { return _ownedMemoryStream; } + } + private readonly MemoryStream _ownedMemoryStream; +#endif + } + + /// + /// The imported image. + /// + internal abstract class ImportedImage + { + /// + /// Initializes a new instance of the class. + /// + protected ImportedImage(IImageImporter importer, ImagePrivateData data, PdfDocument document) + { + Data = data; + _document = document; + data.Image = this; + _importer = importer; + } + + + /// + /// Gets information about the image. + /// + public ImageInformation Information + { + get { return _information; } + private set { _information = value; } + } + private ImageInformation _information = new ImageInformation(); + + /// + /// Gets a value indicating whether image data for the PDF file was already prepared. + /// + public bool HasImageData + { + get { return _imageData != null; } + } + + /// + /// Gets the image data needed for the PDF file. + /// + public ImageData ImageData + { + get { if(!HasImageData) _imageData = PrepareImageData(); return _imageData; } + private set { _imageData = value; } + } + private ImageData _imageData; + + internal virtual ImageData PrepareImageData() + { + throw new NotImplementedException(); + } + + private IImageImporter _importer; + internal ImagePrivateData Data; + internal readonly PdfDocument _document; + } + + /// + /// Public information about the image, filled immediately. + /// Note: The stream will be read and decoded on the first call to PrepareImageData(). + /// ImageInformation can be filled for corrupted images that will throw an expection on PrepareImageData(). + /// + internal class ImageInformation + { + internal enum ImageFormats + { + /// + /// Standard JPEG format (RGB). + /// + JPEG, + /// + /// Grayscale JPEG format. + /// + JPEGGRAY, + /// + /// JPEG file with inverted CMYK, thus RGBW. + /// + JPEGRGBW, + /// + /// JPEG file with CMYK. + /// + JPEGCMYK, + Palette1, + Palette4, + Palette8, + RGB24, + ARGB32 + } + + internal ImageFormats ImageFormat; + + internal uint Width; + internal uint Height; + + /// + /// The horizontal DPI (dots per inch). Can be 0 if not supported by the image format. + /// Note: JFIF (JPEG) files may contain either DPI or DPM or just the aspect ratio. Windows BMP files will contain DPM. Other formats may support any combination, including none at all. + /// + internal decimal HorizontalDPI; + /// + /// The vertical DPI (dots per inch). Can be 0 if not supported by the image format. + /// + internal decimal VerticalDPI; + + /// + /// The horizontal DPM (dots per meter). Can be 0 if not supported by the image format. + /// + internal decimal HorizontalDPM; + /// + /// The vertical DPM (dots per meter). Can be 0 if not supported by the image format. + /// + internal decimal VerticalDPM; + + /// + /// The horizontal component of the aspect ratio. Can be 0 if not supported by the image format. + /// Note: Aspect ratio will be set if either DPI or DPM was set, but may also be available in the absence of both DPI and DPM. + /// + internal decimal HorizontalAspectRatio; + /// + /// The vertical component of the aspect ratio. Can be 0 if not supported by the image format. + /// + internal decimal VerticalAspectRatio; + + /// + /// The colors used. Only valid for images with palettes, will be 0 otherwise. + /// + internal uint ColorsUsed; + } + + /// + /// Contains internal data. This includes a reference to the Stream if data for PDF was not yet prepared. + /// + internal abstract class ImagePrivateData + { + internal ImagePrivateData() + { + } + + /// + /// Gets the image. + /// + public ImportedImage Image + { + get { return _image; } + internal set { _image = value; } + } + private ImportedImage _image; + } + + /// + /// Contains data needed for PDF. Will be prepared when needed. + /// + internal abstract class ImageData + { + } +} diff --git a/PdfSharp/Drawing.Internal/ImageImporter.cs b/PdfSharp/Drawing.Internal/ImageImporter.cs new file mode 100644 index 0000000..0331c15 --- /dev/null +++ b/PdfSharp/Drawing.Internal/ImageImporter.cs @@ -0,0 +1,92 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Thomas Hövel +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; +using System.IO; +using PdfSharp.Pdf; + +namespace PdfSharp.Drawing.Internal +{ + /// + /// The class that imports images of various formats. + /// + internal class ImageImporter + { + // TODO Make a singleton! + /// + /// Gets the image importer. + /// + public static ImageImporter GetImageImporter() + { + return new ImageImporter(); + } + + private ImageImporter() + { + _importers.Add(new ImageImporterJpeg()); + _importers.Add(new ImageImporterBmp()); + // TODO: Special importer for PDF? Or dealt with at a higher level? + } + + /// + /// Imports the image. + /// + public ImportedImage ImportImage(Stream stream, PdfDocument document) + { + StreamReaderHelper helper = new StreamReaderHelper(stream); + + // Try all registered importers to see if any of them can handle the image. + foreach (IImageImporter importer in _importers) + { + helper.Reset(); + ImportedImage image = importer.ImportImage(helper, document); + if (image != null) + return image; + } + return null; + } + +#if GDI || WPF || CORE + /// + /// Imports the image. + /// + public ImportedImage ImportImage(string filename, PdfDocument document) + { + ImportedImage ii; + using (Stream fs = File.OpenRead(filename)) + { + ii = ImportImage(fs, document); + } + return ii; + } +#endif + + private readonly List _importers = new List(); + } +} diff --git a/PdfSharp/Drawing.Internal/ImageImporterBmp.cs b/PdfSharp/Drawing.Internal/ImageImporterBmp.cs new file mode 100644 index 0000000..811b293 --- /dev/null +++ b/PdfSharp/Drawing.Internal/ImageImporterBmp.cs @@ -0,0 +1,681 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Thomas Hövel +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Pdf; +using PdfSharp.Pdf.Advanced; + +namespace PdfSharp.Drawing.Internal +{ + // $THHO THHO4THHO add support for PdfDocument.Options. + internal class ImageImporterBmp : ImageImporterRoot, IImageImporter + { + public ImportedImage ImportImage(StreamReaderHelper stream, PdfDocument document) + { + try + { + stream.CurrentOffset = 0; + int offsetImageData; + if (TestBitmapFileHeader(stream, out offsetImageData)) + { + // Magic: TestBitmapFileHeader updates stream.CurrentOffset on success. + + ImagePrivateDataBitmap ipd = new ImagePrivateDataBitmap(stream.Data, stream.Length); + ImportedImage ii = new ImportedImageBitmap(this, ipd, document); + if (TestBitmapInfoHeader(stream, ii, offsetImageData)) + { + //stream.CurrentOffset = offsetImageData; + return ii; + } + } + } + // ReSharper disable once EmptyGeneralCatchClause + catch (Exception) + { + } + return null; + } + + private bool TestBitmapFileHeader(StreamReaderHelper stream, out int offset) + { + offset = 0; + // File must start with "BM". + if (stream.GetWord(0, true) == 0x424d) + { + int filesize = (int)stream.GetDWord(2, false); + // Integrity check: filesize set in BM header should match size of the stream. + // We test "<" instead of "!=" to allow extra bytes at the end of the stream. + if (filesize < stream.Length) + return false; + + offset = (int)stream.GetDWord(10, false); + stream.CurrentOffset += 14; + return true; + } + return false; + } + + private bool TestBitmapInfoHeader(StreamReaderHelper stream, ImportedImage ii, int offset) + { + int size = (int)stream.GetDWord(0, false); + if (size == 40 || size == 108 || size == 124) // sizeof BITMAPINFOHEADER == 40, sizeof BITMAPV4HEADER == 108, sizeof BITMAPV5HEADER == 124 + { + uint width = stream.GetDWord(4, false); + int height = (int)stream.GetDWord(8, false); + int planes = stream.GetWord(12, false); + int bitcount = stream.GetWord(14, false); + int compression = (int)stream.GetDWord(16, false); + int sizeImage = (int)stream.GetDWord(20, false); + int xPelsPerMeter = (int)stream.GetDWord(24, false); + int yPelsPerMeter = (int)stream.GetDWord(28, false); + uint colorsUsed = stream.GetDWord(32, false); + uint colorsImportant = stream.GetDWord(36, false); + // TODO Integrity and plausibility checks. + if (sizeImage != 0 && sizeImage + offset > stream.Length) + return false; + + ImagePrivateDataBitmap privateData = (ImagePrivateDataBitmap)ii.Data; + + // Return true only for supported formats. + if (compression == 0 || compression == 3) // BI_RGB == 0, BI_BITFIELDS == 3 + { + ((ImagePrivateDataBitmap)ii.Data).Offset = offset; + ((ImagePrivateDataBitmap)ii.Data).ColorPaletteOffset = stream.CurrentOffset + size; + ii.Information.Width = width; + ii.Information.Height = (uint)Math.Abs(height); + ii.Information.HorizontalDPM = xPelsPerMeter; + ii.Information.VerticalDPM = yPelsPerMeter; + privateData.FlippedImage = height < 0; + if (planes == 1 && bitcount == 24) + { + // RGB24 + ii.Information.ImageFormat = ImageInformation.ImageFormats.RGB24; + + // TODO: Verify Mask if size >= 108 && compression == 3. + return true; + } + if (planes == 1 && bitcount == 32) + { + // ARGB32 + //ii.Information.ImageFormat = ImageInformation.ImageFormats.ARGB32; + ii.Information.ImageFormat = compression == 0 ? + ImageInformation.ImageFormats.RGB24 : + ImageInformation.ImageFormats.ARGB32; + + // TODO: tell RGB from ARGB. Idea: assume RGB if alpha is always 0. + + // TODO: Verify Mask if size >= 108 && compression == 3. + return true; + } + if (planes == 1 && bitcount == 8) + { + // Palette8 + ii.Information.ImageFormat = ImageInformation.ImageFormats.Palette8; + ii.Information.ColorsUsed = colorsUsed; + + return true; + } + if (planes == 1 && bitcount == 4) + { + // Palette8 + ii.Information.ImageFormat = ImageInformation.ImageFormats.Palette4; + ii.Information.ColorsUsed = colorsUsed; + + return true; + } + if (planes == 1 && bitcount == 1) + { + // Palette8 + ii.Information.ImageFormat = ImageInformation.ImageFormats.Palette1; + ii.Information.ColorsUsed = colorsUsed; + + return true; + } + // TODO Implement more formats! + } + } + return false; + } + + + public ImageData PrepareImage(ImagePrivateData data) + { + throw new NotImplementedException(); + } + } + + /// + /// Bitmap refers to the format used in PDF. Will be used for BMP, PNG, TIFF, GIF and others. + /// + internal class ImportedImageBitmap : ImportedImage + { + /// + /// Initializes a new instance of the class. + /// + public ImportedImageBitmap(IImageImporter importer, ImagePrivateDataBitmap data, PdfDocument document) + : base(importer, data, document) + { } + + internal override ImageData PrepareImageData() + { + ImagePrivateDataBitmap data = (ImagePrivateDataBitmap)Data; + ImageDataBitmap imageData = new ImageDataBitmap(_document); + //imageData.Data = data.Data; + //imageData.Length = data.Length; + + data.CopyBitmap(imageData); + + return imageData; + } + } + + // THHO4THHO Maybe there will be derived classes for direct bitmaps vs. palettized bitmaps or so. Time will tell. + + /// + /// Contains data needed for PDF. Will be prepared when needed. + /// Bitmap refers to the format used in PDF. Will be used for BMP, PNG, TIFF, GIF and others. + /// + internal class ImageDataBitmap : ImageData + { + private ImageDataBitmap() + { + } + + internal ImageDataBitmap(PdfDocument document) + { + _document = document; + } + + /// + /// Gets the data. + /// + public byte[] Data + { + get { return _data; } + internal set { _data = value; } + } + private byte[] _data; + + /// + /// Gets the length. + /// + public int Length + { + get { return _length; } + internal set { _length = value; } + } + private int _length; + + /// + /// Gets the data. + /// + public byte[] DataFax + { + get { return _dataFax; } + internal set { _dataFax = value; } + } + private byte[] _dataFax; + + /// + /// Gets the length. + /// + public int LengthFax + { + get { return _lengthFax; } + internal set { _lengthFax = value; } + } + private int _lengthFax; + + public byte[] AlphaMask + { + get { return _alphaMask; } + internal set { _alphaMask = value; } + } + private byte[] _alphaMask; + + public int AlphaMaskLength + { + get { return _alphaMaskLength; } + internal set { _alphaMaskLength = value; } + } + private int _alphaMaskLength; + + public byte[] BitmapMask + { + get { return _bitmapMask; } + internal set { _bitmapMask = value; } + } + private byte[] _bitmapMask; + + public int BitmapMaskLength + { + get { return _bitmapMaskLength; } + internal set { _bitmapMaskLength = value; } + } + private int _bitmapMaskLength; + + public byte[] PaletteData + { + get { return _paletteData; } + set { _paletteData = value; } + } + private byte[] _paletteData; + + public int PaletteDataLength + { + get { return _paletteDataLength; } + set { _paletteDataLength = value; } + } + private int _paletteDataLength; + + public bool SegmentedColorMask; + + public int IsBitonal; + + public int K; + + public bool IsGray; + + internal readonly PdfDocument _document; + } + + /// + /// Image data needed for PDF bitmap images. + /// + internal class ImagePrivateDataBitmap : ImagePrivateData + { + /// + /// Initializes a new instance of the class. + /// + public ImagePrivateDataBitmap(byte[] data, int length) + { + _data = data; + _length = length; + } + + /// + /// Gets the data. + /// + public byte[] Data + { + get { return _data; } + //internal set { _data = value; } + } + private readonly byte[] _data; + + /// + /// Gets the length. + /// + public int Length + { + get { return _length; } + //internal set { _length = value; } + } + private readonly int _length; + + /// + /// True if first line is the top line, false if first line is the bottom line of the image. When needed, lines will be reversed while converting data into PDF format. + /// + internal bool FlippedImage; + + /// + /// The offset of the image data in Data. + /// + internal int Offset; + + /// + /// The offset of the color palette in Data. + /// + internal int ColorPaletteOffset; + + internal void CopyBitmap(ImageDataBitmap dest) + { + switch (Image.Information.ImageFormat) + { + case ImageInformation.ImageFormats.ARGB32: + CopyTrueColorMemoryBitmap(3, 8, true, dest); + break; + + case ImageInformation.ImageFormats.RGB24: + CopyTrueColorMemoryBitmap(4, 8, false, dest); + break; + + case ImageInformation.ImageFormats.Palette8: + CopyIndexedMemoryBitmap(8, dest); + break; + + case ImageInformation.ImageFormats.Palette4: + CopyIndexedMemoryBitmap(4, dest); + break; + + case ImageInformation.ImageFormats.Palette1: + CopyIndexedMemoryBitmap(1, dest); + break; + + + + default: + throw new NotImplementedException(); + } + } + + /// + /// Copies images without color palette. + /// + /// 4 (32bpp RGB), 3 (24bpp RGB, 32bpp ARGB) + /// 8 + /// true (ARGB), false (RGB) + /// Destination + private void CopyTrueColorMemoryBitmap(int components, int bits, bool hasAlpha, ImageDataBitmap dest) + { + int width = (int)Image.Information.Width; + int height = (int)Image.Information.Height; + + int logicalComponents = components; + if (components == 4) + logicalComponents = 3; + + byte[] imageData = new byte[components * width * height]; + + bool hasMask = false; + bool hasAlphaMask = false; + byte[] alphaMask = hasAlpha ? new byte[width * height] : null; + MonochromeMask mask = hasAlpha ? + new MonochromeMask(width, height) : null; + + int nFileOffset = Offset; + int nOffsetRead = 0; + if (logicalComponents == 3) + { + for (int y = 0; y < height; ++y) + { + // TODO Handle Flipped. + int nOffsetWrite = 3 * (height - 1 - y) * width; + int nOffsetWriteAlpha = 0; + if (hasAlpha) + { + mask.StartLine(y); + nOffsetWriteAlpha = (height - 1 - y) * width; + } + + for (int x = 0; x < width; ++x) + { + imageData[nOffsetWrite] = Data[nFileOffset + nOffsetRead + 2]; + imageData[nOffsetWrite + 1] = Data[nFileOffset + nOffsetRead + 1]; + imageData[nOffsetWrite + 2] = Data[nFileOffset + nOffsetRead]; + if (hasAlpha) + { + mask.AddPel(Data[nFileOffset + nOffsetRead + 3]); + alphaMask[nOffsetWriteAlpha] = Data[nFileOffset + nOffsetRead + 3]; + if (!hasMask || !hasAlphaMask) + { + if (Data[nFileOffset + nOffsetRead + 3] != 255) + { + hasMask = true; + if (Data[nFileOffset + nOffsetRead + 3] != 0) + hasAlphaMask = true; + } + } + ++nOffsetWriteAlpha; + } + nOffsetRead += hasAlpha ? 4 : components; + nOffsetWrite += 3; + } + nOffsetRead = 4 * ((nOffsetRead + 3) / 4); // Align to 32 bit boundary + } + } + else if (components == 1) + { + // Grayscale + throw new NotImplementedException("Image format not supported (grayscales)."); + } + + dest.Data = imageData; + dest.Length = imageData.Length; + + if (alphaMask != null) + { + dest.AlphaMask = alphaMask; + dest.AlphaMaskLength = alphaMask.Length; + } + + if (mask != null) + { + dest.BitmapMask = mask.MaskData; + dest.BitmapMaskLength = mask.MaskData.Length; + } + } + + private void CopyIndexedMemoryBitmap(int bits/*, ref bool hasAlpha*/, ImageDataBitmap dest) + { + int firstMaskColor = -1, lastMaskColor = -1; + bool segmentedColorMask = false; + + int bytesColorPaletteOffset = ((ImagePrivateDataBitmap)Image.Data).ColorPaletteOffset; // GDI+ always returns Windows bitmaps: sizeof BITMAPFILEHEADER + sizeof BITMAPINFOHEADER + + int bytesFileOffset = ((ImagePrivateDataBitmap)Image.Data).Offset; + uint paletteColors = Image.Information.ColorsUsed; + int width = (int)Image.Information.Width; + int height = (int)Image.Information.Height; + + MonochromeMask mask = new MonochromeMask(width, height); + + bool isGray = bits == 8 && (paletteColors == 256 || paletteColors == 0); + int isBitonal = 0; // 0: false; >0: true; <0: true (inverted) + byte[] paletteData = new byte[3 * paletteColors]; + for (int color = 0; color < paletteColors; ++color) + { + paletteData[3 * color] = Data[bytesColorPaletteOffset + 4 * color + 2]; + paletteData[3 * color + 1] = Data[bytesColorPaletteOffset + 4 * color + 1]; + paletteData[3 * color + 2] = Data[bytesColorPaletteOffset + 4 * color + 0]; + if (isGray) + isGray = paletteData[3 * color] == paletteData[3 * color + 1] && + paletteData[3 * color] == paletteData[3 * color + 2]; + + if (Data[bytesColorPaletteOffset + 4 * color + 3] < 128) + { + // We treat this as transparency: + if (firstMaskColor == -1) + firstMaskColor = color; + if (lastMaskColor == -1 || lastMaskColor == color - 1) + lastMaskColor = color; + if (lastMaskColor != color) + segmentedColorMask = true; + } + //else + //{ + // // We treat this as opacity: + //} + } + + if (bits == 1) + { + if (paletteColors == 0) + isBitonal = 1; + if (paletteColors == 2) + { + if (paletteData[0] == 0 && + paletteData[1] == 0 && + paletteData[2] == 0 && + paletteData[3] == 255 && + paletteData[4] == 255 && + paletteData[5] == 255) + isBitonal = 1; // Black on white + if (paletteData[5] == 0 && + paletteData[4] == 0 && + paletteData[3] == 0 && + paletteData[2] == 255 && + paletteData[1] == 255 && + paletteData[0] == 255) + isBitonal = -1; // White on black + } + } + + // NYI: (no sample found where this was required) + // if (segmentedColorMask = true) + // { ... } + + bool isFaxEncoding = false; + byte[] imageData = new byte[((width * bits + 7) / 8) * height]; + byte[] imageDataFax = null; + int k = 0; + + + if (bits == 1 && dest._document.Options.EnableCcittCompressionForBilevelImages) + { + // TODO: flag/option? + // We try Group 3 1D and Group 4 (2D) encoding here and keep the smaller byte array. + //byte[] temp = new byte[imageData.Length]; + //int ccittSize = DoFaxEncoding(ref temp, imageBits, (uint)bytesFileOffset, (uint)width, (uint)height); + + // It seems that Group 3 2D encoding never beats both other encodings, therefore we don't call it here. + //byte[] temp2D = new byte[imageData.Length]; + //uint dpiY = (uint)image.VerticalResolution; + //uint kTmp = 0; + //int ccittSize2D = DoFaxEncoding2D((uint)bytesFileOffset, ref temp2D, imageBits, (uint)width, (uint)height, dpiY, out kTmp); + //k = (int) kTmp; + + byte[] tempG4 = new byte[imageData.Length]; + int ccittSizeG4 = PdfImage.DoFaxEncodingGroup4(ref tempG4, Data, (uint)bytesFileOffset, (uint)width, (uint)height); + + isFaxEncoding = /*ccittSize > 0 ||*/ ccittSizeG4 > 0; + if (isFaxEncoding) + { + //if (ccittSize == 0) + // ccittSize = 0x7fffffff; + if (ccittSizeG4 == 0) + ccittSizeG4 = 0x7fffffff; + //if (ccittSize <= ccittSizeG4) + //{ + // Array.Resize(ref temp, ccittSize); + // imageDataFax = temp; + // k = 0; + //} + //else + { + Array.Resize(ref tempG4, ccittSizeG4); + imageDataFax = tempG4; + k = -1; + } + } + } + + //if (!isFaxEncoding) + { + int bytesOffsetRead = 0; + if (bits == 8 || bits == 4 || bits == 1) + { + int bytesPerLine = (width * bits + 7) / 8; + for (int y = 0; y < height; ++y) + { + mask.StartLine(y); + int bytesOffsetWrite = (height - 1 - y) * ((width * bits + 7) / 8); + for (int x = 0; x < bytesPerLine; ++x) + { + if (isGray) + { + // Lookup the gray value from the palette: + imageData[bytesOffsetWrite] = paletteData[3 * Data[bytesFileOffset + bytesOffsetRead]]; + } + else + { + // Store the palette index. + imageData[bytesOffsetWrite] = Data[bytesFileOffset + bytesOffsetRead]; + } + if (firstMaskColor != -1) + { + int n = Data[bytesFileOffset + bytesOffsetRead]; + if (bits == 8) + { + // TODO???: segmentedColorMask == true => bad mask NYI + mask.AddPel((n >= firstMaskColor) && (n <= lastMaskColor)); + } + else if (bits == 4) + { + // TODO???: segmentedColorMask == true => bad mask NYI + int n1 = (n & 0xf0) / 16; + int n2 = (n & 0x0f); + mask.AddPel((n1 >= firstMaskColor) && (n1 <= lastMaskColor)); + mask.AddPel((n2 >= firstMaskColor) && (n2 <= lastMaskColor)); + } + else if (bits == 1) + { + // TODO???: segmentedColorMask == true => bad mask NYI + for (int bit = 1; bit <= 8; ++bit) + { + int n1 = (n & 0x80) / 128; + mask.AddPel((n1 >= firstMaskColor) && (n1 <= lastMaskColor)); + n *= 2; + } + } + } + bytesOffsetRead += 1; + bytesOffsetWrite += 1; + } + bytesOffsetRead = 4 * ((bytesOffsetRead + 3) / 4); // Align to 32 bit boundary + } + } + else + { + throw new NotImplementedException("ReadIndexedMemoryBitmap: unsupported format #3"); + } + } + + dest.Data = imageData; + dest.Length = imageData.Length; + + if (imageDataFax != null) + { + dest.DataFax = imageDataFax; + dest.LengthFax = imageDataFax.Length; + } + + dest.IsGray = isGray; + dest.K = k; + dest.IsBitonal = isBitonal; + + dest.PaletteData = paletteData; + dest.PaletteDataLength = paletteData.Length; + dest.SegmentedColorMask = segmentedColorMask; + + //if (alphaMask != null) + //{ + // dest.AlphaMask = alphaMask; + // dest.AlphaMaskLength = alphaMask.Length; + //} + + if (mask != null && firstMaskColor != -1) + { + dest.BitmapMask = mask.MaskData; + dest.BitmapMaskLength = mask.MaskData.Length; + } + + } + } +} diff --git a/PdfSharp/Drawing.Internal/ImageImporterJpeg.cs b/PdfSharp/Drawing.Internal/ImageImporterJpeg.cs new file mode 100644 index 0000000..18f0e14 --- /dev/null +++ b/PdfSharp/Drawing.Internal/ImageImporterJpeg.cs @@ -0,0 +1,363 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Thomas Hövel +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Pdf; + +namespace PdfSharp.Drawing.Internal +{ + // ReSharper disable once InconsistentNaming + internal class ImageImporterJpeg : ImageImporterRoot, IImageImporter + { + // TODO Find information about JPEG2000. + + // Notes: JFIF is big-endian. + + public ImportedImage ImportImage(StreamReaderHelper stream, PdfDocument document) + { + try + { + + stream.CurrentOffset = 0; + // Test 2 magic bytes. + if (TestFileHeader(stream)) + { + // Skip over 2 magic bytes. + stream.CurrentOffset += 2; + + ImagePrivateDataDct ipd = new ImagePrivateDataDct(stream.Data, stream.Length); + ImportedImage ii = new ImportedImageJpeg(this, ipd, document); + if (TestJfifHeader(stream, ii)) + { + bool colorHeader = false, infoHeader = false; + + while (MoveToNextHeader(stream)) + { + if (TestColorFormatHeader(stream, ii)) + { + colorHeader = true; + } + else if (TestInfoHeader(stream, ii)) + { + infoHeader = true; + } + } + if (colorHeader && infoHeader) + return ii; + } + } + } + // ReSharper disable once EmptyGeneralCatchClause + catch (Exception) + { + } + return null; + } + + private bool TestFileHeader(StreamReaderHelper stream) + { + // File must start with 0xffd8. + return stream.GetWord(0, true) == 0xffd8; + } + + private bool TestJfifHeader(StreamReaderHelper stream, ImportedImage ii) + { + // The App0 header should be the first header in every JFIF file. + if (stream.GetWord(0, true) == 0xffe0) + { + // Now check for text "JFIF". + if (stream.GetDWord(4, true) == 0x4a464946) + { + int blockLength = stream.GetWord(2, true); + if (blockLength >= 16) + { + int version = stream.GetWord(9, true); + int units = stream.GetByte(11); + int densityX = stream.GetWord(12, true); + int densityY = stream.GetWord(14, true); + + switch (units) + { + case 0: // Aspect ratio only. + ii.Information.HorizontalAspectRatio = densityX; + ii.Information.VerticalAspectRatio = densityY; + break; + case 1: // DPI. + ii.Information.HorizontalDPI = densityX; + ii.Information.VerticalDPI = densityY; + break; + case 2: // DPCM. + ii.Information.HorizontalDPM = densityX * 100; + ii.Information.VerticalDPM = densityY * 100; + break; + } + + // More information here? More tests? + return true; + } + } + } + return false; + } + + private bool TestColorFormatHeader(StreamReaderHelper stream, ImportedImage ii) + { + // The SOS header (start of scan). + if (stream.GetWord(0, true) == 0xffda) + { + int components = stream.GetByte(4); + if (components < 1 || components > 4 || components == 2) + return false; + // 1 for grayscale, 3 for RGB, 4 for CMYK. + + int blockLength = stream.GetWord(2, true); + // Integrity check: correct size? + if (blockLength != 6 + 2 * components) + return false; + + // Eventually do more tests here. + // Magic: we assume that all JPEG files with 4 components are RGBW (inverted CMYK) and not CMYK. + // We add a test to tell CMYK from RGBW when we encounter a test file in CMYK format. + ii.Information.ImageFormat = components == 3 ? ImageInformation.ImageFormats.JPEG : + (components == 1 ? ImageInformation.ImageFormats.JPEGGRAY : ImageInformation.ImageFormats.JPEGRGBW); + + return true; + } + return false; + } + + private bool TestInfoHeader(StreamReaderHelper stream, ImportedImage ii) + { + // The SOF header (start of frame). + int header = stream.GetWord(0, true); + if (header >= 0xffc0 && header <= 0xffc3 || + header >= 0xffc9 && header <= 0xffcb) + { + // Lines in image. + int sizeY = stream.GetWord(5, true); + // Samples per line. + int sizeX = stream.GetWord(7, true); + + // $THHO TODO: Check if we always get useful information here. + ii.Information.Width = (uint)sizeX; + ii.Information.Height = (uint)sizeY; + + return true; + } + return false; + } + + private bool MoveToNextHeader(StreamReaderHelper stream) + { + int blockLength = stream.GetWord(2, true); + + int headerMagic = stream.GetByte(0); + int headerType = stream.GetByte(1); + + if (headerMagic == 0xff) + { + // EOI: last header. + if (headerType == 0xd9) + return false; + + // Check for standalone markers. + if (headerType == 0x01 || headerType >= 0xd0 && headerType <= 0xd7) + { + stream.CurrentOffset += 2; + return true; + } + + // Now assume header with block size. + stream.CurrentOffset += 2 + blockLength; + return true; + } + return false; + } + + public ImageData PrepareImage(ImagePrivateData data) + { + throw new NotImplementedException(); + } + + //int GetJpgSizeTestCode(byte[] pData, uint FileSizeLow, out int pWidth, out int pHeight) + //{ + // pWidth = -1; + // pHeight = -1; + + // int i = 0; + + + // if ((pData[i] == 0xFF) && (pData[i + 1] == 0xD8) && (pData[i + 2] == 0xFF) && (pData[i + 3] == 0xE0)) + // { + // i += 4; + + // // Check for valid JPEG header (null terminated JFIF) + // if ((pData[i + 2] == 'J') && (pData[i + 3] == 'F') && (pData[i + 4] == 'I') && (pData[i + 5] == 'F') + // && (pData[i + 6] == 0x00)) + // { + + // //Retrieve the block length of the first block since the first block will not contain the size of file + // int block_length = pData[i] * 256 + pData[i + 1]; + + // while (i < FileSizeLow) + // { + // //Increase the file index to get to the next block + // i += block_length; + + // if (i >= FileSizeLow) + // { + // //Check to protect against segmentation faults + // return -1; + // } + + // if (pData[i] != 0xFF) + // { + // return -2; + // } + + // if (pData[i + 1] == 0xC0) + // { + // //0xFFC0 is the "Start of frame" marker which contains the file size + // //The structure of the 0xFFC0 block is quite simple [0xFFC0][ushort length][uchar precision][ushort x][ushort y] + // pHeight = pData[i + 5] * 256 + pData[i + 6]; + // pWidth = pData[i + 7] * 256 + pData[i + 8]; + + // return 0; + // } + // else + // { + // i += 2; //Skip the block marker + + // //Go to the next block + // block_length = pData[i] * 256 + pData[i + 1]; + // } + // } + + // //If this point is reached then no size was found + // return -3; + // } + // else + // { + // return -4; + // } //Not a valid JFIF string + // } + // else + // { + // return -5; + // } //Not a valid SOI header + + // //return -6; + //} // GetJpgSize + } + + /// + /// Imported JPEG image. + /// + internal class ImportedImageJpeg : ImportedImage + { + /// + /// Initializes a new instance of the class. + /// + public ImportedImageJpeg(IImageImporter importer, ImagePrivateDataDct data, PdfDocument document) + : base(importer, data, document) + { } + + internal override ImageData PrepareImageData() + { + ImagePrivateDataDct data = (ImagePrivateDataDct)Data; + ImageDataDct imageData = new ImageDataDct(); + imageData.Data = data.Data; + imageData.Length = data.Length; + + return imageData; + } + } + + /// + /// Contains data needed for PDF. Will be prepared when needed. + /// + internal class ImageDataDct : ImageData + { + /// + /// Gets the data. + /// + public byte[] Data + { + get { return _data; } + internal set { _data = value; } + } + private byte[] _data; + + /// + /// Gets the length. + /// + public int Length + { + get { return _length; } + internal set { _length = value; } + } + private int _length; + } + + /*internal*/ + /// + /// Private data for JPEG images. + /// + internal class ImagePrivateDataDct : ImagePrivateData + { + /// + /// Initializes a new instance of the class. + /// + public ImagePrivateDataDct(byte[] data, int length) + { + _data = data; + _length = length; + } + + /// + /// Gets the data. + /// + public byte[] Data + { + get { return _data; } + //internal set { _data = value; } + } + private readonly byte[] _data; + + /// + /// Gets the length. + /// + public int Length + { + get { return _length; } + //internal set { _length = value; } + } + private readonly int _length; + } +} diff --git a/PdfSharp/Drawing.Internal/ImageImporterRoot.cs b/PdfSharp/Drawing.Internal/ImageImporterRoot.cs new file mode 100644 index 0000000..f257cc0 --- /dev/null +++ b/PdfSharp/Drawing.Internal/ImageImporterRoot.cs @@ -0,0 +1,35 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Thomas Hövel +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.Internal +{ + internal abstract class ImageImporterRoot + { + } +} diff --git a/PdfSharp/Drawing.Layout/XTextFormatter.cs b/PdfSharp/Drawing.Layout/XTextFormatter.cs new file mode 100644 index 0000000..0e88973 --- /dev/null +++ b/PdfSharp/Drawing.Layout/XTextFormatter.cs @@ -0,0 +1,399 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Drawing.Layout +{ + /// + /// Represents a very simple text formatter. + /// If this class does not satisfy your needs on formatting paragraphs I recommend to take a look + /// at MigraDoc Foundation. Alternatively you should copy this class in your own source code and modify it. + /// + public class XTextFormatter + { + /// + /// Initializes a new instance of the class. + /// + public XTextFormatter(XGraphics gfx) + { + if (gfx == null) + throw new ArgumentNullException("gfx"); + _gfx = gfx; + } + readonly XGraphics _gfx; + + /// + /// Gets or sets the text. + /// + /// The text. + public string Text + { + get { return _text; } + set { _text = value; } + } + string _text; + + /// + /// Gets or sets the font. + /// + public XFont Font + { + get { return _font; } + set + { + if (value == null) + throw new ArgumentNullException("Font"); + _font = value; + + _lineSpace = _font.GetHeight(); // old: _font.GetHeight(_gfx); + _cyAscent = _lineSpace * _font.CellAscent / _font.CellSpace; + _cyDescent = _lineSpace * _font.CellDescent / _font.CellSpace; + + // HACK in XTextFormatter + _spaceWidth = _gfx.MeasureString("xx", value).Width; + _spaceWidth -= _gfx.MeasureString("xx", value).Width; + } + } + XFont _font; + double _lineSpace; + double _cyAscent; + double _cyDescent; + double _spaceWidth; + + /// + /// Gets or sets the bounding box of the layout. + /// + public XRect LayoutRectangle + { + get { return _layoutRectangle; } + set { _layoutRectangle = value; } + } + XRect _layoutRectangle; + + /// + /// Gets or sets the alignment of the text. + /// + public XParagraphAlignment Alignment + { + get { return _alignment; } + set { _alignment = value; } + } + XParagraphAlignment _alignment = XParagraphAlignment.Left; + + /// + /// Draws the text. + /// + /// The text to be drawn. + /// The font. + /// The text brush. + /// The layout rectangle. + public void DrawString(string text, XFont font, XBrush brush, XRect layoutRectangle) + { + DrawString(text, font, brush, layoutRectangle, XStringFormats.TopLeft); + } + + /// + /// Draws the text. + /// + /// The text to be drawn. + /// The font. + /// The text brush. + /// The layout rectangle. + /// The format. Must be XStringFormat.TopLeft + public void DrawString(string text, XFont font, XBrush brush, XRect layoutRectangle, XStringFormat format) + { + if (text == null) + throw new ArgumentNullException("text"); + if (font == null) + throw new ArgumentNullException("font"); + if (brush == null) + throw new ArgumentNullException("brush"); + if (format.Alignment != XStringAlignment.Near || format.LineAlignment != XLineAlignment.Near) + throw new ArgumentException("Only TopLeft alignment is currently implemented."); + + Text = text; + Font = font; + LayoutRectangle = layoutRectangle; + + if (text.Length == 0) + return; + + CreateBlocks(); + + CreateLayout(); + + double dx = layoutRectangle.Location.X; + double dy = layoutRectangle.Location.Y + _cyAscent; + int count = _blocks.Count; + for (int idx = 0; idx < count; idx++) + { + Block block = _blocks[idx]; + if (block.Stop) + break; + if (block.Type == BlockType.LineBreak) + continue; + _gfx.DrawString(block.Text, font, brush, dx + block.Location.X, dy + block.Location.Y); + } + } + + void CreateBlocks() + { + _blocks.Clear(); + int length = _text.Length; + bool inNonWhiteSpace = false; + int startIndex = 0, blockLength = 0; + for (int idx = 0; idx < length; idx++) + { + char ch = _text[idx]; + + // Treat CR and CRLF as LF + if (ch == Chars.CR) + { + if (idx < length - 1 && _text[idx + 1] == Chars.LF) + idx++; + ch = Chars.LF; + } + if (ch == Chars.LF) + { + if (blockLength != 0) + { + string token = _text.Substring(startIndex, blockLength); + _blocks.Add(new Block(token, BlockType.Text, + _gfx.MeasureString(token, _font).Width)); + } + startIndex = idx + 1; + blockLength = 0; + _blocks.Add(new Block(BlockType.LineBreak)); + } + // The non-breaking space is whitespace, so we treat it like non-whitespace. + else if (ch != Chars.NonBreakableSpace && char.IsWhiteSpace(ch)) + { + if (inNonWhiteSpace) + { + string token = _text.Substring(startIndex, blockLength); + _blocks.Add(new Block(token, BlockType.Text, + _gfx.MeasureString(token, _font).Width)); + startIndex = idx + 1; + blockLength = 0; + } + else + { + blockLength++; + } + } + else + { + inNonWhiteSpace = true; + blockLength++; + } + } + if (blockLength != 0) + { + string token = _text.Substring(startIndex, blockLength); + _blocks.Add(new Block(token, BlockType.Text, + _gfx.MeasureString(token, _font).Width)); + } + } + + void CreateLayout() + { + double rectWidth = _layoutRectangle.Width; + double rectHeight = _layoutRectangle.Height - _cyAscent - _cyDescent; + int firstIndex = 0; + double x = 0, y = 0; + int count = _blocks.Count; + for (int idx = 0; idx < count; idx++) + { + Block block = _blocks[idx]; + if (block.Type == BlockType.LineBreak) + { + if (Alignment == XParagraphAlignment.Justify) + _blocks[firstIndex].Alignment = XParagraphAlignment.Left; + AlignLine(firstIndex, idx - 1, rectWidth); + firstIndex = idx + 1; + x = 0; + y += _lineSpace; + if (y > rectHeight) + { + block.Stop = true; + break; + } + } + else + { + double width = block.Width; + if ((x + width <= rectWidth || x == 0) && block.Type != BlockType.LineBreak) + { + block.Location = new XPoint(x, y); + x += width + _spaceWidth; + } + else + { + AlignLine(firstIndex, idx - 1, rectWidth); + firstIndex = idx; + y += _lineSpace; + if (y > rectHeight) + { + block.Stop = true; + break; + } + block.Location = new XPoint(0, y); + x = width + _spaceWidth; + } + } + } + if (firstIndex < count && Alignment != XParagraphAlignment.Justify) + AlignLine(firstIndex, count - 1, rectWidth); + } + + /// + /// Align center, right, or justify. + /// + void AlignLine(int firstIndex, int lastIndex, double layoutWidth) + { + XParagraphAlignment blockAlignment = _blocks[firstIndex].Alignment; + if (_alignment == XParagraphAlignment.Left || blockAlignment == XParagraphAlignment.Left) + return; + + int count = lastIndex - firstIndex + 1; + if (count == 0) + return; + + double totalWidth = -_spaceWidth; + for (int idx = firstIndex; idx <= lastIndex; idx++) + totalWidth += _blocks[idx].Width + _spaceWidth; + + double dx = Math.Max(layoutWidth - totalWidth, 0); + //Debug.Assert(dx >= 0); + if (_alignment != XParagraphAlignment.Justify) + { + if (_alignment == XParagraphAlignment.Center) + dx /= 2; + for (int idx = firstIndex; idx <= lastIndex; idx++) + { + Block block = _blocks[idx]; + block.Location += new XSize(dx, 0); + } + } + else if (count > 1) // case: justify + { + dx /= count - 1; + for (int idx = firstIndex + 1, i = 1; idx <= lastIndex; idx++, i++) + { + Block block = _blocks[idx]; + block.Location += new XSize(dx * i, 0); + } + } + } + + readonly List _blocks = new List(); + + enum BlockType + { + Text, Space, Hyphen, LineBreak, + } + + /// + /// Represents a single word. + /// + class Block + { + /// + /// Initializes a new instance of the class. + /// + /// The text of the block. + /// The type of the block. + /// The width of the text. + public Block(string text, BlockType type, double width) + { + Text = text; + Type = type; + Width = width; + } + + /// + /// Initializes a new instance of the class. + /// + /// The type. + public Block(BlockType type) + { + Type = type; + } + + /// + /// The text represented by this block. + /// + public readonly string Text; + + /// + /// The type of the block. + /// + public readonly BlockType Type; + + /// + /// The width of the text. + /// + public readonly double Width; + + /// + /// The location relative to the upper left corner of the layout rectangle. + /// + public XPoint Location; + + /// + /// The alignment of this line. + /// + public XParagraphAlignment Alignment; + + /// + /// A flag indicating that this is the last block that fits in the layout rectangle. + /// + public bool Stop; + } + // TODO: + // - more XStringFormat variations + // - calculate bounding box + // - left and right indent + // - first line indent + // - margins and paddings + // - background color + // - text background color + // - border style + // - hyphens, soft hyphens, hyphenation + // - kerning + // - change font, size, text color etc. + // - line spacing + // - underline and strike-out variation + // - super- and sub-script + // - ... + } +} diff --git a/PdfSharp/Drawing.Layout/enums/XParagraphAlignment.cs b/PdfSharp/Drawing.Layout/enums/XParagraphAlignment.cs new file mode 100644 index 0000000..d4f4dc6 --- /dev/null +++ b/PdfSharp/Drawing.Layout/enums/XParagraphAlignment.cs @@ -0,0 +1,62 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.Layout +{ + /// + /// Specifies the alignment of a paragraph. + /// + public enum XParagraphAlignment + { + /// + /// Default alignment, typically left alignment. + /// + Default, + + /// + /// The paragraph is rendered left aligned. + /// + Left, + + /// + /// The paragraph is rendered centered. + /// + Center, + + /// + /// The paragraph is rendered right aligned. + /// + Right, + + /// + /// The paragraph is rendered justified. + /// + Justify, + } +} diff --git a/PdfSharp/Drawing.Pdf/PdfGraphicsState.cs b/PdfSharp/Drawing.Pdf/PdfGraphicsState.cs new file mode 100644 index 0000000..8b76e37 --- /dev/null +++ b/PdfSharp/Drawing.Pdf/PdfGraphicsState.cs @@ -0,0 +1,543 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using System.Text; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +#endif +using PdfSharp.Internal; +using PdfSharp.Pdf; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.Internal; + +// ReSharper disable CompareOfFloatsByEqualityOperator + +namespace PdfSharp.Drawing.Pdf +{ + /// + /// Represents the current PDF graphics state. + /// + /// + /// Completely revised for PDFsharp 1.4. + /// + internal sealed class PdfGraphicsState : ICloneable + { + public PdfGraphicsState(XGraphicsPdfRenderer renderer) + { + _renderer = renderer; + } + readonly XGraphicsPdfRenderer _renderer; + + public PdfGraphicsState Clone() + { + PdfGraphicsState state = (PdfGraphicsState)MemberwiseClone(); + return state; + } + + object ICloneable.Clone() + { + return Clone(); + } + + internal int Level; + + internal InternalGraphicsState InternalState; + + public void PushState() + { + // BeginGraphic + _renderer.Append("q/n"); + } + + public void PopState() + { + //BeginGraphic + _renderer.Append("Q/n"); + } + + #region Stroke + + double _realizedLineWith = -1; + int _realizedLineCap = -1; + int _realizedLineJoin = -1; + double _realizedMiterLimit = -1; + XDashStyle _realizedDashStyle = (XDashStyle)(-1); + string _realizedDashPattern; + XColor _realizedStrokeColor = XColor.Empty; + bool _realizedStrokeOverPrint; + + public void RealizePen(XPen pen, PdfColorMode colorMode) + { + const string frmt2 = Config.SignificantFigures2; + const string format = Config.SignificantFigures3; + XColor color = pen.Color; + bool overPrint = pen.Overprint; + color = ColorSpaceHelper.EnsureColorMode(colorMode, color); + + if (_realizedLineWith != pen._width) + { + _renderer.AppendFormatArgs("{0:" + format + "} w\n", pen._width); + _realizedLineWith = pen._width; + } + + if (_realizedLineCap != (int)pen._lineCap) + { + _renderer.AppendFormatArgs("{0} J\n", (int)pen._lineCap); + _realizedLineCap = (int)pen._lineCap; + } + + if (_realizedLineJoin != (int)pen._lineJoin) + { + _renderer.AppendFormatArgs("{0} j\n", (int)pen._lineJoin); + _realizedLineJoin = (int)pen._lineJoin; + } + + if (_realizedLineCap == (int)XLineJoin.Miter) + { + if (_realizedMiterLimit != (int)pen._miterLimit && (int)pen._miterLimit != 0) + { + _renderer.AppendFormatInt("{0} M\n", (int)pen._miterLimit); + _realizedMiterLimit = (int)pen._miterLimit; + } + } + + if (_realizedDashStyle != pen._dashStyle || pen._dashStyle == XDashStyle.Custom) + { + double dot = pen.Width; + double dash = 3 * dot; + + // Line width 0 is not recommended but valid. + XDashStyle dashStyle = pen.DashStyle; + if (dot == 0) + dashStyle = XDashStyle.Solid; + + switch (dashStyle) + { + case XDashStyle.Solid: + _renderer.Append("[]0 d\n"); + break; + + case XDashStyle.Dash: + _renderer.AppendFormatArgs("[{0:" + frmt2 + "} {1:" + frmt2 + "}]0 d\n", dash, dot); + break; + + case XDashStyle.Dot: + _renderer.AppendFormatArgs("[{0:" + frmt2 + "}]0 d\n", dot); + break; + + case XDashStyle.DashDot: + _renderer.AppendFormatArgs("[{0:" + frmt2 + "} {1:" + frmt2 + "} {1:" + frmt2 + "} {1:" + frmt2 + "}]0 d\n", dash, dot); + break; + + case XDashStyle.DashDotDot: + _renderer.AppendFormatArgs("[{0:" + frmt2 + "} {1:" + frmt2 + "} {1:" + frmt2 + "} {1:" + frmt2 + "} {1:" + frmt2 + "} {1:" + frmt2 + "}]0 d\n", dash, dot); + break; + + case XDashStyle.Custom: + { + StringBuilder pdf = new StringBuilder("[", 256); + int len = pen._dashPattern == null ? 0 : pen._dashPattern.Length; + for (int idx = 0; idx < len; idx++) + { + if (idx > 0) + pdf.Append(' '); + pdf.Append(PdfEncoders.ToString(pen._dashPattern[idx] * pen._width)); + } + // Make an even number of values look like in GDI+ + if (len > 0 && len % 2 == 1) + { + pdf.Append(' '); + pdf.Append(PdfEncoders.ToString(0.2 * pen._width)); + } + pdf.AppendFormat(CultureInfo.InvariantCulture, "]{0:" + format + "} d\n", pen._dashOffset * pen._width); + string pattern = pdf.ToString(); + + // BUG: drice2@ageone.de reported a realizing problem + // HACK: I remove the if clause + //if (_realizedDashPattern != pattern) + { + _realizedDashPattern = pattern; + _renderer.Append(pattern); + } + } + break; + } + _realizedDashStyle = dashStyle; + } + + if (colorMode != PdfColorMode.Cmyk) + { + if (_realizedStrokeColor.Rgb != color.Rgb) + { + _renderer.Append(PdfEncoders.ToString(color, PdfColorMode.Rgb)); + _renderer.Append(" RG\n"); + } + } + else + { + if (!ColorSpaceHelper.IsEqualCmyk(_realizedStrokeColor, color)) + { + _renderer.Append(PdfEncoders.ToString(color, PdfColorMode.Cmyk)); + _renderer.Append(" K\n"); + } + } + + if (_renderer.Owner.Version >= 14 && (_realizedStrokeColor.A != color.A || _realizedStrokeOverPrint != overPrint)) + { + PdfExtGState extGState = _renderer.Owner.ExtGStateTable.GetExtGStateStroke(color.A, overPrint); + string gs = _renderer.Resources.AddExtGState(extGState); + _renderer.AppendFormatString("{0} gs\n", gs); + + // Must create transparency group. + if (_renderer._page != null && color.A < 1) + _renderer._page.TransparencyUsed = true; + } + _realizedStrokeColor = color; + _realizedStrokeOverPrint = overPrint; + } + + #endregion + + #region Fill + + XColor _realizedFillColor = XColor.Empty; + bool _realizedNonStrokeOverPrint; + + public void RealizeBrush(XBrush brush, PdfColorMode colorMode, int renderingMode, double fontEmSize) + { + // Rendering mode 2 is used for bold simulation. + // Reference: TABLE 5.3Text rendering modes / Page 402 + + XSolidBrush solidBrush = brush as XSolidBrush; + if (solidBrush != null) + { + XColor color = solidBrush.Color; + bool overPrint = solidBrush.Overprint; + + if (renderingMode == 0) + { + RealizeFillColor(color, overPrint, colorMode); + } + else if (renderingMode == 2) + { + // Come here in case of bold simulation. + RealizeFillColor(color, false, colorMode); + //color = XColors.Green; + RealizePen(new XPen(color, fontEmSize * Const.BoldEmphasis), colorMode); + } + else + throw new InvalidOperationException("Only rendering modes 0 and 2 are currently supported."); + } + else + { + if (renderingMode != 0) + throw new InvalidOperationException("Rendering modes other than 0 can only be used with solid color brushes."); + + XLinearGradientBrush gradientBrush = brush as XLinearGradientBrush; + if (gradientBrush != null) + { + Debug.Assert(UnrealizedCtm.IsIdentity, "Must realize ctm first."); + XMatrix matrix = _renderer.DefaultViewMatrix; + matrix.Prepend(EffectiveCtm); + PdfShadingPattern pattern = new PdfShadingPattern(_renderer.Owner); + pattern.SetupFromBrush(gradientBrush, matrix, _renderer); + string name = _renderer.Resources.AddPattern(pattern); + _renderer.AppendFormatString("/Pattern cs\n", name); + _renderer.AppendFormatString("{0} scn\n", name); + + // Invalidate fill color. + _realizedFillColor = XColor.Empty; + } + } + } + + private void RealizeFillColor(XColor color, bool overPrint, PdfColorMode colorMode) + { + color = ColorSpaceHelper.EnsureColorMode(colorMode, color); + + if (colorMode != PdfColorMode.Cmyk) + { + if (_realizedFillColor.IsEmpty || _realizedFillColor.Rgb != color.Rgb) + { + _renderer.Append(PdfEncoders.ToString(color, PdfColorMode.Rgb)); + _renderer.Append(" rg\n"); + } + } + else + { + Debug.Assert(colorMode == PdfColorMode.Cmyk); + + if (_realizedFillColor.IsEmpty || !ColorSpaceHelper.IsEqualCmyk(_realizedFillColor, color)) + { + _renderer.Append(PdfEncoders.ToString(color, PdfColorMode.Cmyk)); + _renderer.Append(" k\n"); + } + } + + if (_renderer.Owner.Version >= 14 && (_realizedFillColor.A != color.A || _realizedNonStrokeOverPrint != overPrint)) + { + + PdfExtGState extGState = _renderer.Owner.ExtGStateTable.GetExtGStateNonStroke(color.A, overPrint); + string gs = _renderer.Resources.AddExtGState(extGState); + _renderer.AppendFormatString("{0} gs\n", gs); + + // Must create transparency group. + if (_renderer._page != null && color.A < 1) + _renderer._page.TransparencyUsed = true; + } + _realizedFillColor = color; + _realizedNonStrokeOverPrint = overPrint; + } + + internal void RealizeNonStrokeTransparency(double transparency, PdfColorMode colorMode) + { + XColor color = _realizedFillColor; + color.A = transparency; + RealizeFillColor(color, _realizedNonStrokeOverPrint, colorMode); + } + + #endregion + + #region Text + + internal PdfFont _realizedFont; + string _realizedFontName = String.Empty; + double _realizedFontSize; + int _realizedRenderingMode; // Reference: TABLE 5.2 Text state operators / Page 398 + double _realizedCharSpace; // Reference: TABLE 5.2 Text state operators / Page 398 + + public void RealizeFont(XFont font, XBrush brush, int renderingMode) + { + const string format = Config.SignificantFigures3; + + // So far rendering mode 0 (fill text) and 2 (fill, then stroke text) only. + RealizeBrush(brush, _renderer._colorMode, renderingMode, font.Size); // _renderer.page.document.Options.ColorMode); + + // Realize rendering mode. + if (_realizedRenderingMode != renderingMode) + { + _renderer.AppendFormatInt("{0} Tr\n", renderingMode); + _realizedRenderingMode = renderingMode; + } + + // Realize character spacing. + if (_realizedRenderingMode == 0) + { + if (_realizedCharSpace != 0) + { + _renderer.Append("0 Tc\n"); + _realizedCharSpace = 0; + } + } + else // _realizedRenderingMode is 2. + { + double charSpace = font.Size * Const.BoldEmphasis; + if (_realizedCharSpace != charSpace) + { + _renderer.AppendFormatDouble("{0:" + format + "} Tc\n", charSpace); + _realizedCharSpace = charSpace; + } + } + + _realizedFont = null; + string fontName = _renderer.GetFontName(font, out _realizedFont); + if (fontName != _realizedFontName || _realizedFontSize != font.Size) + { + if (_renderer.Gfx.PageDirection == XPageDirection.Downwards) + _renderer.AppendFormatFont("{0} {1:" + format + "} Tf\n", fontName, font.Size); + else + _renderer.AppendFormatFont("{0} {1:" + format + "} Tf\n", fontName, font.Size); + _realizedFontName = fontName; + _realizedFontSize = font.Size; + } + } + + public XPoint RealizedTextPosition; + + /// + /// Indicates that the text transformation matrix currently skews 20 to the right. + /// + public bool ItalicSimulationOn; + + #endregion + + #region Transformation + + /// + /// The already realized part of the current transformation matrix. + /// + public XMatrix RealizedCtm; + + /// + /// The not yet realized part of the current transformation matrix. + /// + public XMatrix UnrealizedCtm; + + /// + /// Product of RealizedCtm and UnrealizedCtm. + /// + public XMatrix EffectiveCtm; + + /// + /// Inverse of EffectiveCtm used for transformation. + /// + public XMatrix InverseEffectiveCtm; + + public XMatrix WorldTransform; + + ///// + ///// The world transform in PDF world space. + ///// + //public XMatrix EffectiveCtm + //{ + // get + // { + // //if (MustRealizeCtm) + // if (!UnrealizedCtm.IsIdentity) + // { + // XMatrix matrix = RealizedCtm; + // matrix.Prepend(UnrealizedCtm); + // return matrix; + // } + // return RealizedCtm; + // } + // //set + // //{ + // // XMatrix matrix = realizedCtm; + // // matrix.Invert(); + // // matrix.Prepend(value); + // // unrealizedCtm = matrix; + // // MustRealizeCtm = !unrealizedCtm.IsIdentity; + // //} + //} + + public void AddTransform(XMatrix value, XMatrixOrder matrixOrder) + { + // TODO: User matrixOrder +#if DEBUG + if (matrixOrder == XMatrixOrder.Append) + throw new NotImplementedException("XMatrixOrder.Append"); +#endif + XMatrix transform = value; + if (_renderer.Gfx.PageDirection == XPageDirection.Downwards) + { + // Take chirality into account and + // invert the direction of rotation. + transform.M12 = -value.M12; + transform.M21 = -value.M21; + } + UnrealizedCtm.Prepend(transform); + + WorldTransform.Prepend(value); + } + + /// + /// Realizes the CTM. + /// + public void RealizeCtm() + { + //if (MustRealizeCtm) + if (!UnrealizedCtm.IsIdentity) + { + Debug.Assert(!UnrealizedCtm.IsIdentity, "mrCtm is unnecessarily set."); + + const string format = Config.SignificantFigures7; + + double[] matrix = UnrealizedCtm.GetElements(); + // Use up to six decimal digits to prevent round up problems. + _renderer.AppendFormatArgs("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} cm\n", + matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); + + RealizedCtm.Prepend(UnrealizedCtm); + UnrealizedCtm = new XMatrix(); + EffectiveCtm = RealizedCtm; + InverseEffectiveCtm = EffectiveCtm; + InverseEffectiveCtm.Invert(); + } + } + #endregion + + #region Clip Path + + public void SetAndRealizeClipRect(XRect clipRect) + { + XGraphicsPath clipPath = new XGraphicsPath(); + clipPath.AddRectangle(clipRect); + RealizeClipPath(clipPath); + } + + public void SetAndRealizeClipPath(XGraphicsPath clipPath) + { + RealizeClipPath(clipPath); + } + + void RealizeClipPath(XGraphicsPath clipPath) + { +#if CORE + DiagnosticsHelper.HandleNotImplemented("RealizeClipPath"); +#endif +#if GDI + // Do not render an empty path. + if (clipPath._gdipPath.PointCount < 0) + return; +#endif +#if WPF + // Do not render an empty path. + if (clipPath._pathGeometry.Bounds.IsEmpty) + return; +#endif + _renderer.BeginGraphicMode(); + RealizeCtm(); +#if CORE + _renderer.AppendPath(clipPath._corePath); +#endif +#if GDI && !WPF + _renderer.AppendPath(clipPath._gdipPath); +#endif +#if WPF && !GDI + _renderer.AppendPath(clipPath._pathGeometry); +#endif +#if WPF && GDI + if (_renderer.Gfx.TargetContext == XGraphicTargetContext.GDI) + _renderer.AppendPath(clipPath._gdipPath); + else + _renderer.AppendPath(clipPath._pathGeometry); +#endif + _renderer.Append(clipPath.FillMode == XFillMode.Winding ? "W n\n" : "W* n\n"); + } + + #endregion + } +} diff --git a/PdfSharp/Drawing.Pdf/XGraphicsPdfRenderer.cs b/PdfSharp/Drawing.Pdf/XGraphicsPdfRenderer.cs new file mode 100644 index 0000000..1af221b --- /dev/null +++ b/PdfSharp/Drawing.Pdf/XGraphicsPdfRenderer.cs @@ -0,0 +1,2101 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#define ITALIC_SIMULATION + +using System; +using System.Diagnostics; +using System.Globalization; +using System.Collections.Generic; +using System.Text; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +using SysPoint = System.Windows.Point; +using SysSize = System.Windows.Size; +#endif +#if NETFX_CORE +using Windows.UI.Xaml.Media; +using SysPoint = Windows.Foundation.Point; +using SysSize = Windows.Foundation.Size; +#endif +using PdfSharp.Fonts.OpenType; +using PdfSharp.Internal; +using PdfSharp.Pdf; +using PdfSharp.Pdf.Internal; +using PdfSharp.Pdf.Advanced; + +// ReSharper disable RedundantNameQualifier +// ReSharper disable CompareOfFloatsByEqualityOperator + +namespace PdfSharp.Drawing.Pdf +{ + /// + /// Represents a drawing surface for PdfPages. + /// + internal class XGraphicsPdfRenderer : IXGraphicsRenderer + { + public XGraphicsPdfRenderer(PdfPage page, XGraphics gfx, XGraphicsPdfPageOptions options) + { + _page = page; + _colorMode = page._document.Options.ColorMode; + _options = options; + _gfx = gfx; + _content = new StringBuilder(); + page.RenderContent._pdfRenderer = this; + _gfxState = new PdfGraphicsState(this); + } + + public XGraphicsPdfRenderer(XForm form, XGraphics gfx) + { + _form = form; + _colorMode = form.Owner.Options.ColorMode; + _gfx = gfx; + _content = new StringBuilder(); + form.PdfRenderer = this; + _gfxState = new PdfGraphicsState(this); + } + + /// + /// Gets the content created by this renderer. + /// + string GetContent() + { + EndPage(); + return _content.ToString(); + } + + public XGraphicsPdfPageOptions PageOptions + { + get { return _options; } + } + + public void Close() + { + if (_page != null) + { + PdfContent content2 = _page.RenderContent; + content2.CreateStream(PdfEncoders.RawEncoding.GetBytes(GetContent())); + + _gfx = null; + _page.RenderContent._pdfRenderer = null; + _page.RenderContent = null; + _page = null; + } + else if (_form != null) + { + _form._pdfForm.CreateStream(PdfEncoders.RawEncoding.GetBytes(GetContent())); + _gfx = null; + _form.PdfRenderer = null; + _form = null; + } + } + + // -------------------------------------------------------------------------------------------- + + #region Drawing + + //void SetPageLayout(down, point(0, 0), unit + + // ----- DrawLine ----------------------------------------------------------------------------- + + /// + /// Strokes a single connection of two points. + /// + public void DrawLine(XPen pen, double x1, double y1, double x2, double y2) + { + DrawLines(pen, new XPoint[] { new XPoint(x1, y1), new XPoint(x2, y2) }); + } + + // ----- DrawLines ---------------------------------------------------------------------------- + + /// + /// Strokes a series of connected points. + /// + public void DrawLines(XPen pen, XPoint[] points) + { + if (pen == null) + throw new ArgumentNullException("pen"); + if (points == null) + throw new ArgumentNullException("points"); + + int count = points.Length; + if (count == 0) + return; + + Realize(pen); + + const string format = Config.SignificantFigures4; + AppendFormatPoint("{0:" + format + "} {1:" + format + "} m\n", points[0].X, points[0].Y); + for (int idx = 1; idx < count; idx++) + AppendFormatPoint("{0:" + format + "} {1:" + format + "} l\n", points[idx].X, points[idx].Y); + _content.Append("S\n"); + } + + // ----- DrawBezier --------------------------------------------------------------------------- + + public void DrawBezier(XPen pen, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) + { + DrawBeziers(pen, new XPoint[] { new XPoint(x1, y1), new XPoint(x2, y2), new XPoint(x3, y3), new XPoint(x4, y4) }); + } + + // ----- DrawBeziers -------------------------------------------------------------------------- + + public void DrawBeziers(XPen pen, XPoint[] points) + { + if (pen == null) + throw new ArgumentNullException("pen"); + if (points == null) + throw new ArgumentNullException("points"); + + int count = points.Length; + if (count == 0) + return; + + if ((count - 1) % 3 != 0) + throw new ArgumentException("Invalid number of points for bezier curves. Number must fulfil 4+3n.", "points"); + + Realize(pen); + + const string format = Config.SignificantFigures4; + AppendFormatPoint("{0:" + format + "} {1:" + format + "} m\n", points[0].X, points[0].Y); + for (int idx = 1; idx < count; idx += 3) + AppendFormat3Points("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", + points[idx].X, points[idx].Y, + points[idx + 1].X, points[idx + 1].Y, + points[idx + 2].X, points[idx + 2].Y); + + AppendStrokeFill(pen, null, XFillMode.Alternate, false); + } + + // ----- DrawCurve ---------------------------------------------------------------------------- + + public void DrawCurve(XPen pen, XPoint[] points, double tension) + { + if (pen == null) + throw new ArgumentNullException("pen"); + if (points == null) + throw new ArgumentNullException("points"); + + int count = points.Length; + if (count == 0) + return; + if (count < 2) + throw new ArgumentException("Not enough points", "points"); + + // See http://pubpages.unh.edu/~cs770/a5/cardinal.html // Link is down... + tension /= 3; + + Realize(pen); + + const string format = Config.SignificantFigures4; + AppendFormatPoint("{0:" + format + "} {1:" + format + "} m\n", points[0].X, points[0].Y); + if (count == 2) + { + // Just draws a line. + AppendCurveSegment(points[0], points[0], points[1], points[1], tension); + } + else + { + AppendCurveSegment(points[0], points[0], points[1], points[2], tension); + for (int idx = 1; idx < count - 2; idx++) + AppendCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension); + AppendCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[count - 1], tension); + } + AppendStrokeFill(pen, null, XFillMode.Alternate, false); + } + + // ----- DrawArc ------------------------------------------------------------------------------ + + public void DrawArc(XPen pen, double x, double y, double width, double height, double startAngle, double sweepAngle) + { + if (pen == null) + throw new ArgumentNullException("pen"); + + Realize(pen); + + AppendPartialArc(x, y, width, height, startAngle, sweepAngle, PathStart.MoveTo1st, new XMatrix()); + AppendStrokeFill(pen, null, XFillMode.Alternate, false); + } + + // ----- DrawRectangle ------------------------------------------------------------------------ + + public void DrawRectangle(XPen pen, XBrush brush, double x, double y, double width, double height) + { + if (pen == null && brush == null) + throw new ArgumentNullException("pen and brush"); + + const string format = Config.SignificantFigures3; + + Realize(pen, brush); + //AppendFormat123("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} re\n", x, y, width, -height); + AppendFormatRect("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} re\n", x, y + height, width, height); + + if (pen != null && brush != null) + _content.Append("B\n"); + else if (pen != null) + _content.Append("S\n"); + else + _content.Append("f\n"); + } + + // ----- DrawRectangles ----------------------------------------------------------------------- + + public void DrawRectangles(XPen pen, XBrush brush, XRect[] rects) + { + int count = rects.Length; + for (int idx = 0; idx < count; idx++) + { + XRect rect = rects[idx]; + DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); + } + } + + // ----- DrawRoundedRectangle ----------------------------------------------------------------- + + public void DrawRoundedRectangle(XPen pen, XBrush brush, double x, double y, double width, double height, double ellipseWidth, double ellipseHeight) + { + XGraphicsPath path = new XGraphicsPath(); + path.AddRoundedRectangle(x, y, width, height, ellipseWidth, ellipseHeight); + DrawPath(pen, brush, path); + } + + // ----- DrawEllipse -------------------------------------------------------------------------- + + public void DrawEllipse(XPen pen, XBrush brush, double x, double y, double width, double height) + { + Realize(pen, brush); + + // Useful information is here http://home.t-online.de/home/Robert.Rossmair/ellipse.htm (note: link was dead on November 2, 2015) + // or here http://www.whizkidtech.redprince.net/bezier/circle/ + // Deeper but more difficult: http://www.tinaja.com/cubic01.asp + XRect rect = new XRect(x, y, width, height); + double δx = rect.Width / 2; + double δy = rect.Height / 2; + double fx = δx * Const.κ; + double fy = δy * Const.κ; + double x0 = rect.X + δx; + double y0 = rect.Y + δy; + + // Approximate an ellipse by drawing four cubic splines. + const string format = Config.SignificantFigures4; + AppendFormatPoint("{0:" + format + "} {1:" + format + "} m\n", x0 + δx, y0); + AppendFormat3Points("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", + x0 + δx, y0 + fy, x0 + fx, y0 + δy, x0, y0 + δy); + AppendFormat3Points("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", + x0 - fx, y0 + δy, x0 - δx, y0 + fy, x0 - δx, y0); + AppendFormat3Points("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", + x0 - δx, y0 - fy, x0 - fx, y0 - δy, x0, y0 - δy); + AppendFormat3Points("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", + x0 + fx, y0 - δy, x0 + δx, y0 - fy, x0 + δx, y0); + AppendStrokeFill(pen, brush, XFillMode.Winding, true); + } + + // ----- DrawPolygon -------------------------------------------------------------------------- + + public void DrawPolygon(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode) + { + Realize(pen, brush); + + int count = points.Length; + if (points.Length < 2) + throw new ArgumentException(PSSR.PointArrayAtLeast(2), "points"); + + const string format = Config.SignificantFigures4; + AppendFormatPoint("{0:" + format + "} {1:" + format + "} m\n", points[0].X, points[0].Y); + for (int idx = 1; idx < count; idx++) + AppendFormatPoint("{0:" + format + "} {1:" + format + "} l\n", points[idx].X, points[idx].Y); + + AppendStrokeFill(pen, brush, fillmode, true); + } + + // ----- DrawPie ------------------------------------------------------------------------------ + + public void DrawPie(XPen pen, XBrush brush, double x, double y, double width, double height, + double startAngle, double sweepAngle) + { + Realize(pen, brush); + + const string format = Config.SignificantFigures4; + AppendFormatPoint("{0:" + format + "} {1:" + format + "} m\n", x + width / 2, y + height / 2); + AppendPartialArc(x, y, width, height, startAngle, sweepAngle, PathStart.LineTo1st, new XMatrix()); + AppendStrokeFill(pen, brush, XFillMode.Alternate, true); + } + + // ----- DrawClosedCurve ---------------------------------------------------------------------- + + public void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points, double tension, XFillMode fillmode) + { + int count = points.Length; + if (count == 0) + return; + if (count < 2) + throw new ArgumentException("Not enough points.", "points"); + + // Simply tried out. Not proofed why it is correct. + tension /= 3; + + Realize(pen, brush); + + const string format = Config.SignificantFigures4; + AppendFormatPoint("{0:" + format + "} {1:" + format + "} m\n", points[0].X, points[0].Y); + if (count == 2) + { + // Just draw a line. + AppendCurveSegment(points[0], points[0], points[1], points[1], tension); + } + else + { + AppendCurveSegment(points[count - 1], points[0], points[1], points[2], tension); + for (int idx = 1; idx < count - 2; idx++) + AppendCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension); + AppendCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[0], tension); + AppendCurveSegment(points[count - 2], points[count - 1], points[0], points[1], tension); + } + AppendStrokeFill(pen, brush, fillmode, true); + } + + // ----- DrawPath ----------------------------------------------------------------------------- + + public void DrawPath(XPen pen, XBrush brush, XGraphicsPath path) + { + if (pen == null && brush == null) + throw new ArgumentNullException("pen"); + +#if CORE + Realize(pen, brush); + AppendPath(path._corePath); + AppendStrokeFill(pen, brush, path.FillMode, false); +#endif +#if GDI && !WPF + Realize(pen, brush); + AppendPath(path._gdipPath); + AppendStrokeFill(pen, brush, path.FillMode, false); +#endif +#if WPF && !GDI + Realize(pen, brush); + AppendPath(path._pathGeometry); + AppendStrokeFill(pen, brush, path.FillMode, false); +#endif +#if WPF && GDI + Realize(pen, brush); + if (_gfx.TargetContext == XGraphicTargetContext.GDI) + AppendPath(path._gdipPath); + else + AppendPath(path._pathGeometry); + AppendStrokeFill(pen, brush, path.FillMode, false); +#endif +#if NETFX_CORE + Realize(pen, brush); + AppendPath(path._pathGeometry); + AppendStrokeFill(pen, brush, path.FillMode, false); +#endif + } + + // ----- DrawString --------------------------------------------------------------------------- + + public void DrawString(string s, XFont font, XBrush brush, XRect rect, XStringFormat format) + { + double x = rect.X; + double y = rect.Y; + + double lineSpace = font.GetHeight(); + double cyAscent = lineSpace * font.CellAscent / font.CellSpace; + double cyDescent = lineSpace * font.CellDescent / font.CellSpace; + double width = _gfx.MeasureString(s, font).Width; + + bool italicSimulation = (font.GlyphTypeface.StyleSimulations & XStyleSimulations.ItalicSimulation) != 0; + bool boldSimulation = (font.GlyphTypeface.StyleSimulations & XStyleSimulations.BoldSimulation) != 0; + bool strikeout = (font.Style & XFontStyle.Strikeout) != 0; + bool underline = (font.Style & XFontStyle.Underline) != 0; + + Realize(font, brush, boldSimulation ? 2 : 0); + + switch (format.Alignment) + { + case XStringAlignment.Near: + // nothing to do + break; + + case XStringAlignment.Center: + x += (rect.Width - width) / 2; + break; + + case XStringAlignment.Far: + x += rect.Width - width; + break; + } + if (Gfx.PageDirection == XPageDirection.Downwards) + { + switch (format.LineAlignment) + { + case XLineAlignment.Near: + y += cyAscent; + break; + + case XLineAlignment.Center: + // TODO: Use CapHeight. PDFlib also uses 3/4 of ascent + y += (cyAscent * 3 / 4) / 2 + rect.Height / 2; + break; + + case XLineAlignment.Far: + y += -cyDescent + rect.Height; + break; + + case XLineAlignment.BaseLine: + // Nothing to do. + break; + } + } + else + { + switch (format.LineAlignment) + { + case XLineAlignment.Near: + y += cyDescent; + break; + + case XLineAlignment.Center: + // TODO: Use CapHeight. PDFlib also uses 3/4 of ascent + y += -(cyAscent * 3 / 4) / 2 + rect.Height / 2; + break; + + case XLineAlignment.Far: + y += -cyAscent + rect.Height; + break; + + case XLineAlignment.BaseLine: + // Nothing to do. + break; + } + } + + PdfFont realizedFont = _gfxState._realizedFont; + Debug.Assert(realizedFont != null); + realizedFont.AddChars(s); + + const string format2 = Config.SignificantFigures4; + OpenTypeDescriptor descriptor = realizedFont.FontDescriptor._descriptor; + + string text = null; + if (font.Unicode) + { + StringBuilder sb = new StringBuilder(); + bool isSymbolFont = descriptor.FontFace.cmap.symbol; + for (int idx = 0; idx < s.Length; idx++) + { + char ch = s[idx]; + if (isSymbolFont) + { + // Remap ch for symbol fonts. + ch = (char)(ch | (descriptor.FontFace.os2.usFirstCharIndex & 0xFF00)); // @@@ refactor + } + int glyphID = descriptor.CharCodeToGlyphIndex(ch); + sb.Append((char)glyphID); + } + s = sb.ToString(); + + byte[] bytes = PdfEncoders.RawUnicodeEncoding.GetBytes(s); + bytes = PdfEncoders.FormatStringLiteral(bytes, true, false, true, null); + text = PdfEncoders.RawEncoding.GetString(bytes, 0, bytes.Length); + } + else + { + byte[] bytes = PdfEncoders.WinAnsiEncoding.GetBytes(s); + text = PdfEncoders.ToStringLiteral(bytes, false, null); + } + + // Map absolute position to PDF world space. + XPoint pos = new XPoint(x, y); + pos = WorldToView(pos); + + double verticalOffset = 0; + if (boldSimulation) + { + // Adjust baseline in case of bold simulation??? + // No, because this would change the center of the glyphs. + //verticalOffset = font.Size * Const.BoldEmphasis / 2; + } + +#if ITALIC_SIMULATION + if (italicSimulation) + { + if (_gfxState.ItalicSimulationOn) + { + AdjustTdOffset(ref pos, verticalOffset, true); + AppendFormatArgs("{0:" + format2 + "} {1:" + format2 + "} Td\n{2} Tj\n", pos.X, pos.Y, text); + } + else + { + // Italic simulation is done by skewing characters 20° to the right. + XMatrix m = new XMatrix(1, 0, Const.ItalicSkewAngleSinus, 1, pos.X, pos.Y); + AppendFormatArgs("{0:" + format2 + "} {1:" + format2 + "} {2:" + format2 + "} {3:" + format2 + "} {4:" + format2 + "} {5:" + format2 + "} Tm\n{6} Tj\n", + m.M11, m.M12, m.M21, m.M22, m.OffsetX, m.OffsetY, text); + _gfxState.ItalicSimulationOn = true; + AdjustTdOffset(ref pos, verticalOffset, false); + } + } + else + { + if (_gfxState.ItalicSimulationOn) + { + XMatrix m = new XMatrix(1, 0, 0, 1, pos.X, pos.Y); + AppendFormatArgs("{0:" + format2 + "} {1:" + format2 + "} {2:" + format2 + "} {3:" + format2 + "} {4:" + format2 + "} {5:" + format2 + "} Tm\n{6} Tj\n", + m.M11, m.M12, m.M21, m.M22, m.OffsetX, m.OffsetY, text); + _gfxState.ItalicSimulationOn = false; + AdjustTdOffset(ref pos, verticalOffset, false); + } + else + { + AdjustTdOffset(ref pos, verticalOffset, false); + AppendFormatArgs("{0:" + format2 + "} {1:" + format2 + "} Td {2} Tj\n", pos.X, pos.Y, text); + } + } +#else + AdjustTextMatrix(ref pos); + AppendFormat2("{0:" + format2 + "} {1:" + format2 + "} Td {2} Tj\n", pos.X, pos.Y, text); +#endif + if (underline) + { + double underlinePosition = lineSpace * realizedFont.FontDescriptor._descriptor.UnderlinePosition / font.CellSpace; + double underlineThickness = lineSpace * realizedFont.FontDescriptor._descriptor.UnderlineThickness / font.CellSpace; + //DrawRectangle(null, brush, x, y - underlinePosition, width, underlineThickness); + double underlineRectY = Gfx.PageDirection == XPageDirection.Downwards + ? y - underlinePosition + : y + underlinePosition - underlineThickness; + DrawRectangle(null, brush, x, underlineRectY, width, underlineThickness); + } + + if (strikeout) + { + double strikeoutPosition = lineSpace * realizedFont.FontDescriptor._descriptor.StrikeoutPosition / font.CellSpace; + double strikeoutSize = lineSpace * realizedFont.FontDescriptor._descriptor.StrikeoutSize / font.CellSpace; + //DrawRectangle(null, brush, x, y - strikeoutPosition - strikeoutSize, width, strikeoutSize); + double strikeoutRectY = Gfx.PageDirection == XPageDirection.Downwards + ? y - strikeoutPosition + : y + strikeoutPosition - strikeoutSize; + DrawRectangle(null, brush, x, strikeoutRectY, width, strikeoutSize); + } + } + + // ----- DrawImage ---------------------------------------------------------------------------- + + //public void DrawImage(Image image, Point point); + //public void DrawImage(Image image, PointF point); + //public void DrawImage(Image image, Point[] destPoints); + //public void DrawImage(Image image, PointF[] destPoints); + //public void DrawImage(Image image, Rectangle rect); + //public void DrawImage(Image image, RectangleF rect); + //public void DrawImage(Image image, int x, int y); + //public void DrawImage(Image image, float x, float y); + //public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit); + //public void DrawImage(Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit); + //public void DrawImage(Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit); + //public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit); + //public void DrawImage(Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit); + //public void DrawImage(Image image, float x, float y, RectangleF srcRect, GraphicsUnit srcUnit); + //public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr); + //public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr); + //public void DrawImage(Image image, int x, int y, int width, int height); + //public void DrawImage(Image image, float x, float y, float width, float height); + //public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback); + //public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback); + //public void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit); + //public void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit); + //public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData); + //public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData); + //public void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr); + //public void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs); + //public void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback); + //public void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback); + //public void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData); + //public void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes + + public void DrawImage(XImage image, double x, double y, double width, double height) + { + const string format = Config.SignificantFigures4; + + string name = Realize(image); + if (!(image is XForm)) + { + if (_gfx.PageDirection == XPageDirection.Downwards) + { + AppendFormatImage("q {2:" + format + "} 0 0 {3:" + format + "} {0:" + format + "} {1:" + format + "} cm {4} Do Q\n", + x, y + height, width, height, name); + } + else + { + AppendFormatImage("q {2:" + format + "} 0 0 {3:" + format + "} {0:" + format + "} {1:" + format + "} cm {4} Do Q\n", + x, y, width, height, name); + } + } + else + { + BeginPage(); + + XForm form = (XForm)image; + form.Finish(); + + PdfFormXObject pdfForm = Owner.FormTable.GetForm(form); + + double cx = width / image.PointWidth; + double cy = height / image.PointHeight; + + if (cx != 0 && cy != 0) + { + XPdfForm xForm = image as XPdfForm; + if (_gfx.PageDirection == XPageDirection.Downwards) + { + // If we have an XPdfForm, then we take the MediaBox into account. + double xDraw = x; + double yDraw = y; + if (xForm != null) + { + // Yes, it is an XPdfForm - adjust the position where the page will be drawn. + xDraw -= xForm.Page.MediaBox.X1; + yDraw += xForm.Page.MediaBox.Y1; + } + AppendFormatImage("q {2:" + format + "} 0 0 {3:" + format + "} {0:" + format + "} {1:" + format + "} cm 100 Tz {4} Do Q\n", + xDraw, yDraw + height, cx, cy, name); + } + else + { + // TODO Translation for MediaBox. + AppendFormatImage("q {2:" + format + "} 0 0 {3:" + format + "} {0:" + format + "} {1:" + format + "} cm {4} Do Q\n", + x, y, cx, cy, name); + } + } + } + } + + // TODO: incomplete - srcRect not used + public void DrawImage(XImage image, XRect destRect, XRect srcRect, XGraphicsUnit srcUnit) + { + const string format = Config.SignificantFigures4; + + double x = destRect.X; + double y = destRect.Y; + double width = destRect.Width; + double height = destRect.Height; + + string name = Realize(image); + if (!(image is XForm)) + { + if (_gfx.PageDirection == XPageDirection.Downwards) + { + AppendFormatImage("q {2:" + format + "} 0 0 {3:" + format + "} {0:" + format + "} {1:" + format + "} cm {4} Do\nQ\n", + x, y + height, width, height, name); + } + else + { + AppendFormatImage("q {2:" + format + "} 0 0 {3:" + format + "} {0:" + format + "} {1:" + format + "} cm {4} Do Q\n", + x, y, width, height, name); + } + } + else + { + BeginPage(); + + XForm form = (XForm)image; + form.Finish(); + + PdfFormXObject pdfForm = Owner.FormTable.GetForm(form); + + double cx = width / image.PointWidth; + double cy = height / image.PointHeight; + + if (cx != 0 && cy != 0) + { + XPdfForm xForm = image as XPdfForm; + if (_gfx.PageDirection == XPageDirection.Downwards) + { + double xDraw = x; + double yDraw = y; + if (xForm != null) + { + // Yes, it is an XPdfForm - adjust the position where the page will be drawn. + xDraw -= xForm.Page.MediaBox.X1; + yDraw += xForm.Page.MediaBox.Y1; + } + AppendFormatImage("q {2:" + format + "} 0 0 {3:" + format + "} {0:" + format + "} {1:" + format + "} cm {4} Do Q\n", + xDraw, yDraw + height, cx, cy, name); + } + else + { + // TODO Translation for MediaBox. + AppendFormatImage("q {2:" + format + "} 0 0 {3:" + format + "} {0:" + format + "} {1:" + format + "} cm {4} Do Q\n", + x, y, cx, cy, name); + } + } + } + } + + #endregion + + // -------------------------------------------------------------------------------------------- + + #region Save and Restore + + /// + /// Clones the current graphics state and push it on a stack. + /// + public void Save(XGraphicsState state) + { + // Before saving, the current transformation matrix must be completely realized. + BeginGraphicMode(); + RealizeTransform(); + // Associate the XGraphicsState with the current PdgGraphicsState. + _gfxState.InternalState = state.InternalState; + SaveState(); + } + + public void Restore(XGraphicsState state) + { + BeginGraphicMode(); + RestoreState(state.InternalState); + } + + public void BeginContainer(XGraphicsContainer container, XRect dstrect, XRect srcrect, XGraphicsUnit unit) + { + // Before saving, the current transformation matrix must be completely realized. + BeginGraphicMode(); + RealizeTransform(); + _gfxState.InternalState = container.InternalState; + SaveState(); + } + + public void EndContainer(XGraphicsContainer container) + { + BeginGraphicMode(); + RestoreState(container.InternalState); + } + + #endregion + + // -------------------------------------------------------------------------------------------- + + #region Transformation + + //public void SetPageTransform(XPageDirection direction, XPoint origion, XGraphicsUnit unit) + //{ + // if (_gfxStateStack.Count > 0) + // throw new InvalidOperationException("PageTransformation can be modified only when the graphics stack is empty."); + + // throw new NotImplementedException("SetPageTransform"); + //} + + public XMatrix Transform + { + get + { + if (_gfxState.UnrealizedCtm.IsIdentity) + return _gfxState.EffectiveCtm; + return _gfxState.UnrealizedCtm * _gfxState.RealizedCtm; + } + } + + public void AddTransform(XMatrix value, XMatrixOrder matrixOrder) + { + _gfxState.AddTransform(value, matrixOrder); + } + + #endregion + + // -------------------------------------------------------------------------------------------- + + #region Clipping + + public void SetClip(XGraphicsPath path, XCombineMode combineMode) + { + if (path == null) + throw new NotImplementedException("SetClip with no path."); + + // Ensure that the graphics state stack level is at least 2, because otherwise an error + // occurs when someone set the clip region before something was drawn. + if (_gfxState.Level < GraphicsStackLevelWorldSpace) + RealizeTransform(); // TODO: refactor this function + + if (combineMode == XCombineMode.Replace) + { + if (_clipLevel != 0) + { + if (_clipLevel != _gfxState.Level) + throw new NotImplementedException("Cannot set new clip region in an inner graphic state level."); + else + ResetClip(); + } + _clipLevel = _gfxState.Level; + } + else if (combineMode == XCombineMode.Intersect) + { + if (_clipLevel == 0) + _clipLevel = _gfxState.Level; + } + else + { + Debug.Assert(false, "Invalid XCombineMode in internal function."); + } + _gfxState.SetAndRealizeClipPath(path); + } + + /// + /// Sets the clip path empty. Only possible if graphic state level has the same value as it has when + /// the first time SetClip was invoked. + /// + public void ResetClip() + { + // No clip level means no clipping occurs and nothing is to do. + if (_clipLevel == 0) + return; + + // Only at the clipLevel the clipping can be reset. + if (_clipLevel != _gfxState.Level) + throw new NotImplementedException("Cannot reset clip region in an inner graphic state level."); + + // Must be in graphical mode before popping the graphics state. + BeginGraphicMode(); + + // Save InternalGraphicsState and transformation of the current graphical state. + InternalGraphicsState state = _gfxState.InternalState; + XMatrix ctm = _gfxState.EffectiveCtm; + // Empty clip path by switching back to the previous state. + RestoreState(); + SaveState(); + // Save internal state + _gfxState.InternalState = state; + // Restore CTM + // TODO: check rest of clip + //GfxState.Transform = ctm; + } + + /// + /// The nesting level of the PDF graphics state stack when the clip region was set to non empty. + /// Because of the way PDF is made the clip region can only be reset at this level. + /// + int _clipLevel; + + #endregion + + // -------------------------------------------------------------------------------------------- + + #region Miscellaneous + + /// + /// Writes a comment to the PDF content stream. May be useful for debugging purposes. + /// + public void WriteComment(string comment) + { + comment = comment.Replace("\n", "\n% "); + // TODO: Some more checks necessary? + Append("% " + comment + "\n"); + } + + #endregion + + // -------------------------------------------------------------------------------------------- + + #region Append to PDF stream + + /// + /// Appends one or up to five Bézier curves that interpolate the arc. + /// + void AppendPartialArc(double x, double y, double width, double height, double startAngle, double sweepAngle, PathStart pathStart, XMatrix matrix) + { + // Normalize the angles + double α = startAngle; + if (α < 0) + α = α + (1 + Math.Floor((Math.Abs(α) / 360))) * 360; + else if (α > 360) + α = α - Math.Floor(α / 360) * 360; + Debug.Assert(α >= 0 && α <= 360); + + double β = sweepAngle; + if (β < -360) + β = -360; + else if (β > 360) + β = 360; + + if (α == 0 && β < 0) + α = 360; + else if (α == 360 && β > 0) + α = 0; + + // Is it possible that the arc is small starts and ends in same quadrant? + bool smallAngle = Math.Abs(β) <= 90; + + β = α + β; + if (β < 0) + β = β + (1 + Math.Floor((Math.Abs(β) / 360))) * 360; + + bool clockwise = sweepAngle > 0; + int startQuadrant = Quadrant(α, true, clockwise); + int endQuadrant = Quadrant(β, false, clockwise); + + if (startQuadrant == endQuadrant && smallAngle) + AppendPartialArcQuadrant(x, y, width, height, α, β, pathStart, matrix); + else + { + int currentQuadrant = startQuadrant; + bool firstLoop = true; + do + { + if (currentQuadrant == startQuadrant && firstLoop) + { + double ξ = currentQuadrant * 90 + (clockwise ? 90 : 0); + AppendPartialArcQuadrant(x, y, width, height, α, ξ, pathStart, matrix); + } + else if (currentQuadrant == endQuadrant) + { + double ξ = currentQuadrant * 90 + (clockwise ? 0 : 90); + AppendPartialArcQuadrant(x, y, width, height, ξ, β, PathStart.Ignore1st, matrix); + } + else + { + double ξ1 = currentQuadrant * 90 + (clockwise ? 0 : 90); + double ξ2 = currentQuadrant * 90 + (clockwise ? 90 : 0); + AppendPartialArcQuadrant(x, y, width, height, ξ1, ξ2, PathStart.Ignore1st, matrix); + } + + // Don't stop immediately if arc is greater than 270 degrees + if (currentQuadrant == endQuadrant && smallAngle) + break; + + smallAngle = true; + + if (clockwise) + currentQuadrant = currentQuadrant == 3 ? 0 : currentQuadrant + 1; + else + currentQuadrant = currentQuadrant == 0 ? 3 : currentQuadrant - 1; + + firstLoop = false; + } while (true); + } + } + + /// + /// Gets the quadrant (0 through 3) of the specified angle. If the angle lies on an edge + /// (0, 90, 180, etc.) the result depends on the details how the angle is used. + /// + int Quadrant(double φ, bool start, bool clockwise) + { + Debug.Assert(φ >= 0); + if (φ > 360) + φ = φ - Math.Floor(φ / 360) * 360; + + int quadrant = (int)(φ / 90); + if (quadrant * 90 == φ) + { + if ((start && !clockwise) || (!start && clockwise)) + quadrant = quadrant == 0 ? 3 : quadrant - 1; + } + else + quadrant = clockwise ? ((int)Math.Floor(φ / 90)) % 4 : (int)Math.Floor(φ / 90); + return quadrant; + } + + /// + /// Appends a Bézier curve for an arc within a quadrant. + /// + void AppendPartialArcQuadrant(double x, double y, double width, double height, double α, double β, PathStart pathStart, XMatrix matrix) + { + Debug.Assert(α >= 0 && α <= 360); + Debug.Assert(β >= 0); + if (β > 360) + β = β - Math.Floor(β / 360) * 360; + Debug.Assert(Math.Abs(α - β) <= 90); + + // Scanling factor + double δx = width / 2; + double δy = height / 2; + + // Center of ellipse + double x0 = x + δx; + double y0 = y + δy; + + // We have the following quarters: + // | + // 2 | 3 + // ----+----- + // 1 | 0 + // | + // If the angles lie in quarter 2 or 3, their values are subtracted by 180 and the + // resulting curve is reflected at the center. This algorithm works as expected (simply tried out). + // There may be a mathematically more elegant solution... + bool reflect = false; + if (α >= 180 && β >= 180) + { + α -= 180; + β -= 180; + reflect = true; + } + + double sinα, sinβ; + if (width == height) + { + // Circular arc needs no correction. + α = α * Calc.Deg2Rad; + β = β * Calc.Deg2Rad; + } + else + { + // Elliptic arc needs the angles to be adjusted such that the scaling transformation is compensated. + α = α * Calc.Deg2Rad; + sinα = Math.Sin(α); + if (Math.Abs(sinα) > 1E-10) + α = Math.PI / 2 - Math.Atan(δy * Math.Cos(α) / (δx * sinα)); + β = β * Calc.Deg2Rad; + sinβ = Math.Sin(β); + if (Math.Abs(sinβ) > 1E-10) + β = Math.PI / 2 - Math.Atan(δy * Math.Cos(β) / (δx * sinβ)); + } + + double κ = 4 * (1 - Math.Cos((α - β) / 2)) / (3 * Math.Sin((β - α) / 2)); + sinα = Math.Sin(α); + double cosα = Math.Cos(α); + sinβ = Math.Sin(β); + double cosβ = Math.Cos(β); + + const string format = Config.SignificantFigures3; + XPoint pt1, pt2, pt3; + if (!reflect) + { + // Calculation for quarter 0 and 1 + switch (pathStart) + { + case PathStart.MoveTo1st: + pt1 = matrix.Transform(new XPoint(x0 + δx * cosα, y0 + δy * sinα)); + AppendFormatPoint("{0:" + format + "} {1:" + format + "} m\n", pt1.X, pt1.Y); + break; + + case PathStart.LineTo1st: + pt1 = matrix.Transform(new XPoint(x0 + δx * cosα, y0 + δy * sinα)); + AppendFormatPoint("{0:" + format + "} {1:" + format + "} l\n", pt1.X, pt1.Y); + break; + + case PathStart.Ignore1st: + break; + } + pt1 = matrix.Transform(new XPoint(x0 + δx * (cosα - κ * sinα), y0 + δy * (sinα + κ * cosα))); + pt2 = matrix.Transform(new XPoint(x0 + δx * (cosβ + κ * sinβ), y0 + δy * (sinβ - κ * cosβ))); + pt3 = matrix.Transform(new XPoint(x0 + δx * cosβ, y0 + δy * sinβ)); + AppendFormat3Points("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", + pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y); + } + else + { + // Calculation for quarter 2 and 3. + switch (pathStart) + { + case PathStart.MoveTo1st: + pt1 = matrix.Transform(new XPoint(x0 - δx * cosα, y0 - δy * sinα)); + AppendFormatPoint("{0:" + format + "} {1:" + format + "} m\n", pt1.X, pt1.Y); + break; + + case PathStart.LineTo1st: + pt1 = matrix.Transform(new XPoint(x0 - δx * cosα, y0 - δy * sinα)); + AppendFormatPoint("{0:" + format + "} {1:" + format + "} l\n", pt1.X, pt1.Y); + break; + + case PathStart.Ignore1st: + break; + } + pt1 = matrix.Transform(new XPoint(x0 - δx * (cosα - κ * sinα), y0 - δy * (sinα + κ * cosα))); + pt2 = matrix.Transform(new XPoint(x0 - δx * (cosβ + κ * sinβ), y0 - δy * (sinβ - κ * cosβ))); + pt3 = matrix.Transform(new XPoint(x0 - δx * cosβ, y0 - δy * sinβ)); + AppendFormat3Points("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", + pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y); + } + } + +#if WPF || NETFX_CORE + void AppendPartialArc(SysPoint point1, SysPoint point2, double rotationAngle, + SysSize size, bool isLargeArc, SweepDirection sweepDirection, PathStart pathStart) + { + const string format = Config.SignificantFigures4; + + Debug.Assert(pathStart == PathStart.Ignore1st); + + int pieces; + PointCollection points = GeometryHelper.ArcToBezier(point1.X, point1.Y, size.Width, size.Height, rotationAngle, isLargeArc, + sweepDirection == SweepDirection.Clockwise, point2.X, point2.Y, out pieces); + + int count = points.Count; + int start = count % 3 == 1 ? 1 : 0; + if (start == 1) + AppendFormatPoint("{0:" + format + "} {1:" + format + "} m\n", points[0].X, points[0].Y); + for (int idx = start; idx < count; idx += 3) + AppendFormat3Points("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", + points[idx].X, points[idx].Y, + points[idx + 1].X, points[idx + 1].Y, + points[idx + 2].X, points[idx + 2].Y); + } +#endif + + /// + /// Appends a Bézier curve for a cardinal spline through pt1 and pt2. + /// + void AppendCurveSegment(XPoint pt0, XPoint pt1, XPoint pt2, XPoint pt3, double tension3) + { + const string format = Config.SignificantFigures4; + AppendFormat3Points("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", + pt1.X + tension3 * (pt2.X - pt0.X), pt1.Y + tension3 * (pt2.Y - pt0.Y), + pt2.X - tension3 * (pt3.X - pt1.X), pt2.Y - tension3 * (pt3.Y - pt1.Y), + pt2.X, pt2.Y); + } + +#if CORE_ + /// + /// Appends the content of a GraphicsPath object. + /// + internal void AppendPath(GraphicsPath path) + { + int count = path.PointCount; + if (count == 0) + return; + PointF[] points = path.PathPoints; + Byte[] types = path.PathTypes; + + for (int idx = 0; idx < count; idx++) + { + // From GDI+ documentation: + const byte PathPointTypeStart = 0; // move + const byte PathPointTypeLine = 1; // line + const byte PathPointTypeBezier = 3; // default Bezier (= cubic Bezier) + const byte PathPointTypePathTypeMask = 0x07; // type mask (lowest 3 bits). + //const byte PathPointTypeDashMode = 0x10; // currently in dash mode. + //const byte PathPointTypePathMarker = 0x20; // a marker for the path. + const byte PathPointTypeCloseSubpath = 0x80; // closed flag + + byte type = types[idx]; + switch (type & PathPointTypePathTypeMask) + { + case PathPointTypeStart: + //PDF_moveto(pdf, points[idx].X, points[idx].Y); + AppendFormat("{0:" + format + "} {1:" + format + "} m\n", points[idx].X, points[idx].Y); + break; + + case PathPointTypeLine: + //PDF_lineto(pdf, points[idx].X, points[idx].Y); + AppendFormat("{0:" + format + "} {1:" + format + "} l\n", points[idx].X, points[idx].Y); + if ((type & PathPointTypeCloseSubpath) != 0) + Append("h\n"); + break; + + case PathPointTypeBezier: + Debug.Assert(idx + 2 < count); + //PDF_curveto(pdf, points[idx].X, points[idx].Y, + // points[idx + 1].X, points[idx + 1].Y, + // points[idx + 2].X, points[idx + 2].Y); + AppendFormat("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", points[idx].X, points[idx].Y, + points[++idx].X, points[idx].Y, points[++idx].X, points[idx].Y); + if ((types[idx] & PathPointTypeCloseSubpath) != 0) + Append("h\n"); + break; + } + } + } +#endif + +#if CORE + /// + /// Appends the content of a GraphicsPath object. + /// + internal void AppendPath(CoreGraphicsPath path) + { + AppendPath(path.PathPoints, path.PathTypes); + //XPoint[] points = path.PathPoints; + //Byte[] types = path.PathTypes; + + //int count = points.Length; + //if (count == 0) + // return; + + //for (int idx = 0; idx < count; idx++) + //{ + // // From GDI+ documentation: + // const byte PathPointTypeStart = 0; // move + // const byte PathPointTypeLine = 1; // line + // const byte PathPointTypeBezier = 3; // default Bezier (= cubic Bezier) + // const byte PathPointTypePathTypeMask = 0x07; // type mask (lowest 3 bits). + // //const byte PathPointTypeDashMode = 0x10; // currently in dash mode. + // //const byte PathPointTypePathMarker = 0x20; // a marker for the path. + // const byte PathPointTypeCloseSubpath = 0x80; // closed flag + + // byte type = types[idx]; + // switch (type & PathPointTypePathTypeMask) + // { + // case PathPointTypeStart: + // //PDF_moveto(pdf, points[idx].X, points[idx].Y); + // AppendFormat("{0:" + format + "} {1:" + format + "} m\n", points[idx].X, points[idx].Y); + // break; + + // case PathPointTypeLine: + // //PDF_lineto(pdf, points[idx].X, points[idx].Y); + // AppendFormat("{0:" + format + "} {1:" + format + "} l\n", points[idx].X, points[idx].Y); + // if ((type & PathPointTypeCloseSubpath) != 0) + // Append("h\n"); + // break; + + // case PathPointTypeBezier: + // Debug.Assert(idx + 2 < count); + // //PDF_curveto(pdf, points[idx].X, points[idx].Y, + // // points[idx + 1].X, points[idx + 1].Y, + // // points[idx + 2].X, points[idx + 2].Y); + // AppendFormat("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", points[idx].X, points[idx].Y, + // points[++idx].X, points[idx].Y, points[++idx].X, points[idx].Y); + // if ((types[idx] & PathPointTypeCloseSubpath) != 0) + // Append("h\n"); + // break; + // } + //} + } +#endif + +#if GDI + /// + /// Appends the content of a GraphicsPath object. + /// + internal void AppendPath(GraphicsPath path) + { +#if true + AppendPath(XGraphics.MakeXPointArray(path.PathPoints, 0, path.PathPoints.Length), path.PathTypes); +#else + int count = path.PointCount; + if (count == 0) + return; + PointF[] points = path.PathPoints; + Byte[] types = path.PathTypes; + + for (int idx = 0; idx < count; idx++) + { + // From GDI+ documentation: + const byte PathPointTypeStart = 0; // move + const byte PathPointTypeLine = 1; // line + const byte PathPointTypeBezier = 3; // default Bezier (= cubic Bezier) + const byte PathPointTypePathTypeMask = 0x07; // type mask (lowest 3 bits). + //const byte PathPointTypeDashMode = 0x10; // currently in dash mode. + //const byte PathPointTypePathMarker = 0x20; // a marker for the path. + const byte PathPointTypeCloseSubpath = 0x80; // closed flag + + byte type = types[idx]; + switch (type & PathPointTypePathTypeMask) + { + case PathPointTypeStart: + //PDF_moveto(pdf, points[idx].X, points[idx].Y); + AppendFormat("{0:" + format + "} {1:" + format + "} m\n", points[idx].X, points[idx].Y); + break; + + case PathPointTypeLine: + //PDF_lineto(pdf, points[idx].X, points[idx].Y); + AppendFormat("{0:" + format + "} {1:" + format + "} l\n", points[idx].X, points[idx].Y); + if ((type & PathPointTypeCloseSubpath) != 0) + Append("h\n"); + break; + + case PathPointTypeBezier: + Debug.Assert(idx + 2 < count); + //PDF_curveto(pdf, points[idx].X, points[idx].Y, + // points[idx + 1].X, points[idx + 1].Y, + // points[idx + 2].X, points[idx + 2].Y); + AppendFormat("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", points[idx].X, points[idx].Y, + points[++idx].X, points[idx].Y, points[++idx].X, points[idx].Y); + if ((types[idx] & PathPointTypeCloseSubpath) != 0) + Append("h\n"); + break; + } + } +#endif + } +#endif + +#if CORE || GDI + void AppendPath(XPoint[] points, Byte[] types) + { + const string format = Config.SignificantFigures4; + int count = points.Length; + if (count == 0) + return; + + for (int idx = 0; idx < count; idx++) + { + // ReSharper disable InconsistentNaming + // From GDI+ documentation: + const byte PathPointTypeStart = 0; // move + const byte PathPointTypeLine = 1; // line + const byte PathPointTypeBezier = 3; // default Bezier (= cubic Bezier) + const byte PathPointTypePathTypeMask = 0x07; // type mask (lowest 3 bits). + //const byte PathPointTypeDashMode = 0x10; // currently in dash mode. + //const byte PathPointTypePathMarker = 0x20; // a marker for the path. + const byte PathPointTypeCloseSubpath = 0x80; // closed flag + // ReSharper restore InconsistentNaming + + byte type = types[idx]; + switch (type & PathPointTypePathTypeMask) + { + case PathPointTypeStart: + //PDF_moveto(pdf, points[idx].X, points[idx].Y); + AppendFormatPoint("{0:" + format + "} {1:" + format + "} m\n", points[idx].X, points[idx].Y); + break; + + case PathPointTypeLine: + //PDF_lineto(pdf, points[idx].X, points[idx].Y); + AppendFormatPoint("{0:" + format + "} {1:" + format + "} l\n", points[idx].X, points[idx].Y); + if ((type & PathPointTypeCloseSubpath) != 0) + Append("h\n"); + break; + + case PathPointTypeBezier: + Debug.Assert(idx + 2 < count); + //PDF_curveto(pdf, points[idx].X, points[idx].Y, + // points[idx + 1].X, points[idx + 1].Y, + // points[idx + 2].X, points[idx + 2].Y); + AppendFormat3Points("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", points[idx].X, points[idx].Y, + points[++idx].X, points[idx].Y, points[++idx].X, points[idx].Y); + if ((types[idx] & PathPointTypeCloseSubpath) != 0) + Append("h\n"); + break; + } + } + } +#endif + +#if WPF || NETFX_CORE + /// + /// Appends the content of a PathGeometry object. + /// + internal void AppendPath(PathGeometry geometry) + { + const string format = Config.SignificantFigures4; + + foreach (PathFigure figure in geometry.Figures) + { +#if DEBUG + //#warning For DdlGBE_Chart_Layout (WPF) execution stucks at this Assertion. + // The empty Figure is added via XGraphicsPath.CurrentPathFigure Getter. + // Some methods like XGraphicsPath.AddRectangle() or AddLine() use this emtpy Figure to add Segments, others like AddEllipse() don't. + // Here, _pathGeometry.AddGeometry() of course ignores this first Figure and adds a second. + // Encapsulate relevant Add methods to delete a first emty Figure or move the Addition of an first empty Figure to a GetOrCreateCurrentPathFigure() or simply remove Assertion? + // Look for: + // MAOS4STLA: CurrentPathFigure. + + + if (figure.Segments.Count == 0) + 42.GetType(); + Debug.Assert(figure.Segments.Count > 0); +#endif + // Skip the Move if the segment is empty. Workaround for empty segments. Empty segments should not occur (see Debug.Assert above). + if (figure.Segments.Count > 0) + { + // Move to start point. + SysPoint currentPoint = figure.StartPoint; + AppendFormatPoint("{0:" + format + "} {1:" + format + "} m\n", currentPoint.X, currentPoint.Y); + + foreach (PathSegment segment in figure.Segments) + { + Type type = segment.GetType(); + if (type == typeof(LineSegment)) + { + // Draw a single line. + SysPoint point = ((LineSegment)segment).Point; + currentPoint = point; + AppendFormatPoint("{0:" + format + "} {1:" + format + "} l\n", point.X, point.Y); + } + else if (type == typeof(PolyLineSegment)) + { + // Draw connected lines. + PointCollection points = ((PolyLineSegment)segment).Points; + foreach (SysPoint point in points) + { + currentPoint = point; // I forced myself not to optimize this assignment. + AppendFormatPoint("{0:" + format + "} {1:" + format + "} l\n", point.X, point.Y); + } + } + else if (type == typeof(BezierSegment)) + { + // Draw Bézier curve. + BezierSegment seg = (BezierSegment)segment; + SysPoint point1 = seg.Point1; + SysPoint point2 = seg.Point2; + SysPoint point3 = seg.Point3; + AppendFormat3Points("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", + point1.X, point1.Y, point2.X, point2.Y, point3.X, point3.Y); + currentPoint = point3; + } + else if (type == typeof(PolyBezierSegment)) + { + // Draw connected Bézier curves. + PointCollection points = ((PolyBezierSegment)segment).Points; + int count = points.Count; + if (count > 0) + { + Debug.Assert(count % 3 == 0, "Number of Points in PolyBezierSegment are not a multiple of 3."); + for (int idx = 0; idx < count - 2; idx += 3) + { + SysPoint point1 = points[idx]; + SysPoint point2 = points[idx + 1]; + SysPoint point3 = points[idx + 2]; + AppendFormat3Points("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} c\n", + point1.X, point1.Y, point2.X, point2.Y, point3.X, point3.Y); + } + currentPoint = points[count - 1]; + } + } + else if (type == typeof(ArcSegment)) + { + // Draw arc. + ArcSegment seg = (ArcSegment)segment; + AppendPartialArc(currentPoint, seg.Point, seg.RotationAngle, seg.Size, seg.IsLargeArc, seg.SweepDirection, PathStart.Ignore1st); + currentPoint = seg.Point; + } + else if (type == typeof(QuadraticBezierSegment)) + { + QuadraticBezierSegment seg = (QuadraticBezierSegment)segment; + currentPoint = seg.Point2; + // TODOWPF: Undone because XGraphics has no such curve type + throw new NotImplementedException("AppendPath with QuadraticBezierSegment."); + } + else if (type == typeof(PolyQuadraticBezierSegment)) + { + PolyQuadraticBezierSegment seg = (PolyQuadraticBezierSegment)segment; + currentPoint = seg.Points[seg.Points.Count - 1]; + // TODOWPF: Undone because XGraphics has no such curve type + throw new NotImplementedException("AppendPath with PolyQuadraticBezierSegment."); + } + } + if (figure.IsClosed) + Append("h\n"); + } + } + } +#endif + + internal void Append(string value) + { + _content.Append(value); + } + + internal void AppendFormatArgs(string format, params object[] args) + { + _content.AppendFormat(CultureInfo.InvariantCulture, format, args); +#if DEBUG + string dummy = _content.ToString(); + dummy = dummy.Substring(Math.Max(0, dummy.Length - 100)); + dummy.GetType(); +#endif + } + + internal void AppendFormatString(string format, string s) + { + _content.AppendFormat(CultureInfo.InvariantCulture, format, s); + } + + internal void AppendFormatFont(string format, string s, double d) + { + _content.AppendFormat(CultureInfo.InvariantCulture, format, s, d); + } + + internal void AppendFormatInt(string format, int n) + { + _content.AppendFormat(CultureInfo.InvariantCulture, format, n); + } + + internal void AppendFormatDouble(string format, double d) + { + _content.AppendFormat(CultureInfo.InvariantCulture, format, d); + } + + internal void AppendFormatPoint(string format, double x, double y) + { + XPoint result = WorldToView(new XPoint(x, y)); + _content.AppendFormat(CultureInfo.InvariantCulture, format, result.X, result.Y); + } + + internal void AppendFormatRect(string format, double x, double y, double width, double height) + { + XPoint point1 = WorldToView(new XPoint(x, y)); + _content.AppendFormat(CultureInfo.InvariantCulture, format, point1.X, point1.Y, width, height); + } + + internal void AppendFormat3Points(string format, double x1, double y1, double x2, double y2, double x3, double y3) + { + XPoint point1 = WorldToView(new XPoint(x1, y1)); + XPoint point2 = WorldToView(new XPoint(x2, y2)); + XPoint point3 = WorldToView(new XPoint(x3, y3)); + _content.AppendFormat(CultureInfo.InvariantCulture, format, point1.X, point1.Y, point2.X, point2.Y, point3.X, point3.Y); + } + + internal void AppendFormat(string format, XPoint point) + { + XPoint result = WorldToView(point); + _content.AppendFormat(CultureInfo.InvariantCulture, format, result.X, result.Y); + } + + internal void AppendFormat(string format, double x, double y, string s) + { + XPoint result = WorldToView(new XPoint(x, y)); + _content.AppendFormat(CultureInfo.InvariantCulture, format, result.X, result.Y, s); + } + + internal void AppendFormatImage(string format, double x, double y, double width, double height, string name) + { + XPoint result = WorldToView(new XPoint(x, y)); + _content.AppendFormat(CultureInfo.InvariantCulture, format, result.X, result.Y, width, height, name); + } + + void AppendStrokeFill(XPen pen, XBrush brush, XFillMode fillMode, bool closePath) + { + if (closePath) + _content.Append("h "); + + if (fillMode == XFillMode.Winding) + { + if (pen != null && brush != null) + _content.Append("B\n"); + else if (pen != null) + _content.Append("S\n"); + else + _content.Append("f\n"); + } + else + { + if (pen != null && brush != null) + _content.Append("B*\n"); + else if (pen != null) + _content.Append("S\n"); + else + _content.Append("f*\n"); + } + } + #endregion + + // -------------------------------------------------------------------------------------------- + + #region Realizing graphical state + + /// + /// Initializes the default view transformation, i.e. the transformation from the user page + /// space to the PDF page space. + /// + void BeginPage() + { + if (_gfxState.Level == GraphicsStackLevelInitial) + { + // TODO: Is PageOriging and PageScale (== Viewport) useful? Or just public DefaultViewMatrix (like Presentation Manager has had) + // May be a BeginContainer(windows, viewport) is useful for userer that are not familar with maxtrix transformations. + + // Flip page horizontally and mirror text. + + // PDF uses a standard right-handed Cartesian coordinate system with the y axis directed up + // and the rotation counterclockwise. Windows uses the opposite convertion with y axis + // directed down and rotation clockwise. When I started with PDFsharp I flipped pages horizontally + // and then mirrored text to compensate the effect that the fipping turns text upside down. + // I found this technique during analysis of PDF documents generated with PDFlib. Unfortunately + // this technique leads to several problems with programms that compose or view PDF documents + // generated with PDFsharp. + // In PDFsharp 1.4 I implement a revised technique that does not need text mirroring any more. + + DefaultViewMatrix = new XMatrix(); + if (_gfx.PageDirection == XPageDirection.Downwards) + { + // Take TrimBox into account. + PageHeightPt = Size.Height; + XPoint trimOffset = new XPoint(); + if (_page != null && _page.TrimMargins.AreSet) + { + PageHeightPt += _page.TrimMargins.Top.Point + _page.TrimMargins.Bottom.Point; + trimOffset = new XPoint(_page.TrimMargins.Left.Point, _page.TrimMargins.Top.Point); + } + + // Scale with page units. + switch (_gfx.PageUnit) + { + case XGraphicsUnit.Point: + // Factor is 1. + // DefaultViewMatrix.ScalePrepend(XUnit.PointFactor); + break; + + case XGraphicsUnit.Presentation: + DefaultViewMatrix.ScalePrepend(XUnit.PresentationFactor); + break; + + case XGraphicsUnit.Inch: + DefaultViewMatrix.ScalePrepend(XUnit.InchFactor); + break; + + case XGraphicsUnit.Millimeter: + DefaultViewMatrix.ScalePrepend(XUnit.MillimeterFactor); + break; + + case XGraphicsUnit.Centimeter: + DefaultViewMatrix.ScalePrepend(XUnit.CentimeterFactor); + break; + } + + if (trimOffset != new XPoint()) + { + Debug.Assert(_gfx.PageUnit == XGraphicsUnit.Point, "With TrimMargins set the page units must be Point. Ohter cases nyi."); + DefaultViewMatrix.TranslatePrepend(trimOffset.X, -trimOffset.Y); + } + + // Save initial graphic state. + SaveState(); + + // Set default page transformation, if any. + if (!DefaultViewMatrix.IsIdentity) + { + Debug.Assert(_gfxState.RealizedCtm.IsIdentity); + //_gfxState.RealizedCtm = DefaultViewMatrix; + const string format = Config.SignificantFigures7; + double[] cm = DefaultViewMatrix.GetElements(); + AppendFormatArgs("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} cm ", + cm[0], cm[1], cm[2], cm[3], cm[4], cm[5]); + } + + // Set page transformation + //double[] cm = DefaultViewMatrix.GetElements(); + //AppendFormat("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} cm ", + // cm[0], cm[1], cm[2], cm[3], cm[4], cm[5]); + } + else + { + // Scale with page units. + switch (_gfx.PageUnit) + { + case XGraphicsUnit.Point: + // Factor is 1. + // DefaultViewMatrix.ScalePrepend(XUnit.PointFactor); + break; + + case XGraphicsUnit.Presentation: + DefaultViewMatrix.ScalePrepend(XUnit.PresentationFactor); + break; + + case XGraphicsUnit.Inch: + DefaultViewMatrix.ScalePrepend(XUnit.InchFactor); + break; + + case XGraphicsUnit.Millimeter: + DefaultViewMatrix.ScalePrepend(XUnit.MillimeterFactor); + break; + + case XGraphicsUnit.Centimeter: + DefaultViewMatrix.ScalePrepend(XUnit.CentimeterFactor); + break; + } + + // Save initial graphic state. + SaveState(); + // Set page transformation. + const string format = Config.SignificantFigures7; + double[] cm = DefaultViewMatrix.GetElements(); + AppendFormat3Points("{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "} cm ", + cm[0], cm[1], cm[2], cm[3], cm[4], cm[5]); + } + } + } + + /// + /// Ends the content stream, i.e. ends the text mode and balances the graphic state stack. + /// + void EndPage() + { + if (_streamMode == StreamMode.Text) + { + _content.Append("ET\n"); + _streamMode = StreamMode.Graphic; + } + + while (_gfxStateStack.Count != 0) + RestoreState(); + } + + /// + /// Begins the graphic mode (i.e. ends the text mode). + /// + internal void BeginGraphicMode() + { + if (_streamMode != StreamMode.Graphic) + { + if (_streamMode == StreamMode.Text) + _content.Append("ET\n"); + + _streamMode = StreamMode.Graphic; + } + } + + /// + /// Begins the graphic mode (i.e. ends the text mode). + /// + internal void BeginTextMode() + { + if (_streamMode != StreamMode.Text) + { + _streamMode = StreamMode.Text; + _content.Append("BT\n"); + // Text matrix is empty after BT + _gfxState.RealizedTextPosition = new XPoint(); + _gfxState.ItalicSimulationOn = false; + } + } + + StreamMode _streamMode; + + /// + /// Makes the specified pen and brush to the current graphics objects. + /// + private void Realize(XPen pen, XBrush brush) + { + BeginPage(); + BeginGraphicMode(); + RealizeTransform(); + + if (pen != null) + _gfxState.RealizePen(pen, _colorMode); // page.document.Options.ColorMode); + + if (brush != null) + { + // Render mode is 0 except for bold simulation. + _gfxState.RealizeBrush(brush, _colorMode, 0, 0); // page.document.Options.ColorMode); + } + } + + /// + /// Makes the specified pen to the current graphics object. + /// + void Realize(XPen pen) + { + Realize(pen, null); + } + + /// + /// Makes the specified brush to the current graphics object. + /// + void Realize(XBrush brush) + { + Realize(null, brush); + } + + /// + /// Makes the specified font and brush to the current graphics objects. + /// + void Realize(XFont font, XBrush brush, int renderingMode) + { + BeginPage(); + RealizeTransform(); + BeginTextMode(); + _gfxState.RealizeFont(font, brush, renderingMode); + } + + /// + /// PDFsharp uses the Td operator to set the text position. Td just sets the offset of the text matrix + /// and produces lesser code as Tm. + /// + /// The absolute text position. + /// The dy. + /// true if skewing for italic simulation is currently on. + void AdjustTdOffset(ref XPoint pos, double dy, bool adjustSkew) + { + pos.Y += dy; + // Reference: TABLE 5.5 Text-positioning operators / Page 406 + XPoint posSave = pos; + // Map from absolute to relative position. + pos = pos - new XVector(_gfxState.RealizedTextPosition.X, _gfxState.RealizedTextPosition.Y); + if (adjustSkew) + { + // In case that italic simulation is on X must be adjusted according to Y offset. Weird but works :-) + pos.X -= Const.ItalicSkewAngleSinus * pos.Y; + } + _gfxState.RealizedTextPosition = posSave; + } + + /// + /// Makes the specified image to the current graphics object. + /// + string Realize(XImage image) + { + BeginPage(); + BeginGraphicMode(); + RealizeTransform(); + + // The transparency set for a brush also applies to images. Set opacity to 100% so image will be drawn without transparency. + _gfxState.RealizeNonStrokeTransparency(1, _colorMode); + + XForm form = image as XForm; + return form != null ? GetFormName(form) : GetImageName(image); + } + + /// + /// Realizes the current transformation matrix, if necessary. + /// + void RealizeTransform() + { + BeginPage(); + + if (_gfxState.Level == GraphicsStackLevelPageSpace) + { + BeginGraphicMode(); + SaveState(); + } + + //if (gfxState.MustRealizeCtm) + if (!_gfxState.UnrealizedCtm.IsIdentity) + { + BeginGraphicMode(); + _gfxState.RealizeCtm(); + } + } + + /// + /// Convert a point from Windows world space to PDF world space. + /// + internal XPoint WorldToView(XPoint point) + { + // If EffectiveCtm is not yet realized InverseEffectiveCtm is invalid. + Debug.Assert(_gfxState.UnrealizedCtm.IsIdentity, "Somewhere a RealizeTransform is missing."); +#if true + // See in #else case why this is correct. + XPoint pt = _gfxState.WorldTransform.Transform(point); + return _gfxState.InverseEffectiveCtm.Transform(new XPoint(pt.X, PageHeightPt / DefaultViewMatrix.M22 - pt.Y)); +#else + // Get inverted PDF world transform matrix. + XMatrix invers = _gfxState.EffectiveCtm; + invers.Invert(); + + // Apply transform in Windows world space. + XPoint pt1 = _gfxState.WorldTransform.Transform(point); +#if true + // Do the transformation (see #else case) in one step. + XPoint pt2 = new XPoint(pt1.X, PageHeightPt / DefaultViewMatrix.M22 - pt1.Y); +#else + // Replicable version + + // Apply default transformation. + pt1.X = pt1.X * DefaultViewMatrix.M11; + pt1.Y = pt1.Y * DefaultViewMatrix.M22; + + // Convert from Windows space to PDF space. + XPoint pt2 = new XPoint(pt1.X, PageHeightPt - pt1.Y); + + pt2.X = pt2.X / DefaultViewMatrix.M11; + pt2.Y = pt2.Y / DefaultViewMatrix.M22; +#endif + XPoint pt3 = invers.Transform(pt2); + return pt3; +#endif + } + #endregion + +#if GDI + [Conditional("DEBUG")] + void DumpPathData(PathData pathData) + { + XPoint[] points = new XPoint[pathData.Points.Length]; + for (int i = 0; i < points.Length; i++) + points[i] = new XPoint(pathData.Points[i].X, pathData.Points[i].Y); + + DumpPathData(points, pathData.Types); + } +#endif +#if CORE || GDI + [Conditional("DEBUG")] + void DumpPathData(XPoint[] points, byte[] types) + { + int count = points.Length; + for (int idx = 0; idx < count; idx++) + { + string info = PdfEncoders.Format("{0:X} {1:####0.000} {2:####0.000}", types[idx], points[idx].X, points[idx].Y); + Debug.WriteLine(info, "PathData"); + } + } +#endif + + /// + /// Gets the owning PdfDocument of this page or form. + /// + internal PdfDocument Owner + { + get + { + if (_page != null) + return _page.Owner; + return _form.Owner; + } + } + + internal XGraphics Gfx + { + get { return _gfx; } + } + + /// + /// Gets the PdfResources of this page or form. + /// + internal PdfResources Resources + { + get + { + if (_page != null) + return _page.Resources; + return _form.Resources; + } + } + + /// + /// Gets the size of this page or form. + /// + internal XSize Size + { + get + { + if (_page != null) + return new XSize(_page.Width, _page.Height); + return _form.Size; + } + } + + /// + /// Gets the resource name of the specified font within this page or form. + /// + internal string GetFontName(XFont font, out PdfFont pdfFont) + { + if (_page != null) + return _page.GetFontName(font, out pdfFont); + return _form.GetFontName(font, out pdfFont); + } + + /// + /// Gets the resource name of the specified image within this page or form. + /// + internal string GetImageName(XImage image) + { + if (_page != null) + return _page.GetImageName(image); + return _form.GetImageName(image); + } + + /// + /// Gets the resource name of the specified form within this page or form. + /// + internal string GetFormName(XForm form) + { + if (_page != null) + return _page.GetFormName(form); + return _form.GetFormName(form); + } + + internal PdfPage _page; + internal XForm _form; + internal PdfColorMode _colorMode; + XGraphicsPdfPageOptions _options; + XGraphics _gfx; + readonly StringBuilder _content; + + /// + /// The q/Q nesting level is 0. + /// + const int GraphicsStackLevelInitial = 0; + + /// + /// The q/Q nesting level is 1. + /// + const int GraphicsStackLevelPageSpace = 1; + + /// + /// The q/Q nesting level is 2. + /// + const int GraphicsStackLevelWorldSpace = 2; + + #region PDF Graphics State + + /// + /// Saves the current graphical state. + /// + void SaveState() + { + Debug.Assert(_streamMode == StreamMode.Graphic, "Cannot save state in text mode."); + + _gfxStateStack.Push(_gfxState); + _gfxState = _gfxState.Clone(); + _gfxState.Level = _gfxStateStack.Count; + Append("q\n"); + } + + /// + /// Restores the previous graphical state. + /// + void RestoreState() + { + Debug.Assert(_streamMode == StreamMode.Graphic, "Cannot restore state in text mode."); + + _gfxState = _gfxStateStack.Pop(); + Append("Q\n"); + } + + PdfGraphicsState RestoreState(InternalGraphicsState state) + { + int count = 1; + PdfGraphicsState top = _gfxStateStack.Pop(); + while (top.InternalState != state) + { + Append("Q\n"); + count++; + top = _gfxStateStack.Pop(); + } + Append("Q\n"); + _gfxState = top; + return top; + } + + /// + /// The current graphical state. + /// + PdfGraphicsState _gfxState; + + /// + /// The graphical state stack. + /// + readonly Stack _gfxStateStack = new Stack(); + + #endregion + + /// + /// The height of the PDF page in point including the trim box. + /// + public double PageHeightPt; + + /// + /// The final transformation from the world space to the default page space. + /// + public XMatrix DefaultViewMatrix; + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing.Pdf/enums/DirtyFlags.cs b/PdfSharp/Drawing.Pdf/enums/DirtyFlags.cs new file mode 100644 index 0000000..7af789d --- /dev/null +++ b/PdfSharp/Drawing.Pdf/enums/DirtyFlags.cs @@ -0,0 +1,44 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Drawing.Pdf +{ + [Flags] + enum DirtyFlags + { + Ctm = 0x00000001, + ClipPath = 0x00000002, + LineWidth = 0x00000010, + LineJoin = 0x00000020, + MiterLimit = 0x00000040, + StrokeFill = 0x00000070, + } +} diff --git a/PdfSharp/Drawing.Pdf/enums/StreamMode.cs b/PdfSharp/Drawing.Pdf/enums/StreamMode.cs new file mode 100644 index 0000000..e6d920c --- /dev/null +++ b/PdfSharp/Drawing.Pdf/enums/StreamMode.cs @@ -0,0 +1,47 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing.Pdf +{ + /// + /// Indicates whether we are within a BT/ET block. + /// + enum StreamMode + { + /// + /// Graphic mode. This is default. + /// + Graphic, + + /// + /// Text mode. + /// + Text, + } +} diff --git a/PdfSharp/Drawing/CoreGraphicsPath.cs b/PdfSharp/Drawing/CoreGraphicsPath.cs new file mode 100644 index 0000000..65d88fd --- /dev/null +++ b/PdfSharp/Drawing/CoreGraphicsPath.cs @@ -0,0 +1,302 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion +using System; +using System.Collections.Generic; +using System.Diagnostics; +using PdfSharp.Internal; + +namespace PdfSharp.Drawing +{ + /// + /// Represents a graphics path that uses the same notation as GDI+. + /// + internal class CoreGraphicsPath + { + // Same values as GDI+ uses. + const byte PathPointTypeStart = 0; // move + const byte PathPointTypeLine = 1; // line + const byte PathPointTypeBezier = 3; // default Bezier (= cubic Bezier) + const byte PathPointTypePathTypeMask = 0x07; // type mask (lowest 3 bits). + const byte PathPointTypeCloseSubpath = 0x80; // closed flag + + public CoreGraphicsPath() + { } + + public CoreGraphicsPath(CoreGraphicsPath path) + { + _points = new List(path._points); + _types = new List(path._types); + } + + public void MoveOrLineTo(double x, double y) + { + // Make a MoveTo if there is no previous subpath or the previous subpath was closed. + // Otherwise make a LineTo. + if (_types.Count == 0 || (_types[_types.Count - 1] & PathPointTypeCloseSubpath) == PathPointTypeCloseSubpath) + MoveTo(x, y); + else + LineTo(x, y, false); + } + + public void MoveTo(double x, double y) + { + _points.Add(new XPoint(x, y)); + _types.Add(PathPointTypeStart); + } + + public void LineTo(double x, double y, bool closeSubpath) + { + if (_points.Count > 0 && _points[_points.Count - 1].Equals(new XPoint(x, y))) + return; + + _points.Add(new XPoint(x, y)); + _types.Add((byte)(PathPointTypeLine | (closeSubpath ? PathPointTypeCloseSubpath : 0))); + } + + public void BezierTo(double x1, double y1, double x2, double y2, double x3, double y3, bool closeSubpath) + { + _points.Add(new XPoint(x1, y1)); + _types.Add(PathPointTypeBezier); + _points.Add(new XPoint(x2, y2)); + _types.Add(PathPointTypeBezier); + _points.Add(new XPoint(x3, y3)); + _types.Add((byte)(PathPointTypeBezier | (closeSubpath ? PathPointTypeCloseSubpath : 0))); + } + + /// + /// Adds an arc that fills exactly one quadrant (quarter) of an ellipse. + /// Just a quick hack to draw rounded rectangles before AddArc is fully implemented. + /// + public void QuadrantArcTo(double x, double y, double width, double height, int quadrant, bool clockwise) + { + if (width < 0) + throw new ArgumentOutOfRangeException("width"); + if (height < 0) + throw new ArgumentOutOfRangeException("height"); + + double w = Const.κ * width; + double h = Const.κ * height; + double x1, y1, x2, y2, x3, y3; + switch (quadrant) + { + case 1: + if (clockwise) + { + x1 = x + w; + y1 = y - height; + x2 = x + width; + y2 = y - h; + x3 = x + width; + y3 = y; + } + else + { + x1 = x + width; + y1 = y - h; + x2 = x + w; + y2 = y - height; + x3 = x; + y3 = y - height; + } + break; + + case 2: + if (clockwise) + { + x1 = x - width; + y1 = y - h; + x2 = x - w; + y2 = y - height; + x3 = x; + y3 = y - height; + } + else + { + x1 = x - w; + y1 = y - height; + x2 = x - width; + y2 = y - h; + x3 = x - width; + y3 = y; + } + break; + + case 3: + if (clockwise) + { + x1 = x - w; + y1 = y + height; + x2 = x - width; + y2 = y + h; + x3 = x - width; + y3 = y; + } + else + { + x1 = x - width; + y1 = y + h; + x2 = x - w; + y2 = y + height; + x3 = x; + y3 = y + height; + } + break; + + case 4: + if (clockwise) + { + x1 = x + width; + y1 = y + h; + x2 = x + w; + y2 = y + height; + x3 = x; + y3 = y + height; + } + else + { + x1 = x + w; + y1 = y + height; + x2 = x + width; + y2 = y + h; + x3 = x + width; + y3 = y; + } + break; + + default: + throw new ArgumentOutOfRangeException("quadrant"); + } + BezierTo(x1, y1, x2, y2, x3, y3, false); + } + + /// + /// Closes the current subpath. + /// + public void CloseSubpath() + { + int count = _types.Count; + if (count > 0) + _types[count - 1] |= PathPointTypeCloseSubpath; + } + + /// + /// Gets or sets the current fill mode (alternate or winding). + /// + XFillMode FillMode + { + get { return _fillMode; } + set { _fillMode = value; } + } + XFillMode _fillMode; + + public void AddArc(double x, double y, double width, double height, double startAngle, double sweepAngle) + { + XMatrix matrix = XMatrix.Identity; + List points = GeometryHelper.BezierCurveFromArc(x, y, width, height, startAngle, sweepAngle, PathStart.MoveTo1st, ref matrix); + int count = points.Count; + Debug.Assert((count + 2) % 3 == 0); + + MoveOrLineTo(points[0].X, points[0].Y); + for (int idx = 1; idx < count; idx += 3) + BezierTo(points[idx].X, points[idx].Y, points[idx + 1].X, points[idx + 1].Y, points[idx + 2].X, points[idx + 2].Y, false); + } + + public void AddArc(XPoint point1, XPoint point2, XSize size, double rotationAngle, bool isLargeArg, XSweepDirection sweepDirection) + { + List points = GeometryHelper.BezierCurveFromArc(point1, point2, size, rotationAngle, isLargeArg, + sweepDirection == XSweepDirection.Clockwise, PathStart.MoveTo1st); + int count = points.Count; + Debug.Assert((count + 2) % 3 == 0); + + MoveOrLineTo(points[0].X, points[0].Y); + for (int idx = 1; idx < count; idx += 3) + BezierTo(points[idx].X, points[idx].Y, points[idx + 1].X, points[idx + 1].Y, points[idx + 2].X, points[idx + 2].Y, false); + } + + public void AddCurve(XPoint[] points, double tension) + { + int count = points.Length; + if (count < 2) + throw new ArgumentException("AddCurve requires two or more points.", "points"); + + tension /= 3; + MoveOrLineTo(points[0].X, points[0].Y); + if (count == 2) + { + //figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[1], tension)); + ToCurveSegment(points[0], points[0], points[1], points[1], tension); + } + else + { + //figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[2], tension)); + ToCurveSegment(points[0], points[0], points[1], points[2], tension); + for (int idx = 1; idx < count - 2; idx++) + { + //figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension)); + ToCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension); + } + //figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[count - 1], tension)); + ToCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[count - 1], tension); + } + } + + ///// + ///// Appends a Bézier curve for a cardinal spline through pt1 and pt2. + ///// + //void ToCurveSegment(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, double tension3, bool closeSubpath) + //{ + // BezierTo( + // x1 + tension3 * (x2 - x0), y1 + tension3 * (y2 - y0), + // x2 - tension3 * (x3 - x1), y2 - tension3 * (y3 - y1), + // x2, y2, closeSubpath); + //} + + void ToCurveSegment(XPoint pt0, XPoint pt1, XPoint pt2, XPoint pt3, double tension3) + { + BezierTo( + pt1.X + tension3 * (pt2.X - pt0.X), pt1.Y + tension3 * (pt2.Y - pt0.Y), + pt2.X - tension3 * (pt3.X - pt1.X), pt2.Y - tension3 * (pt3.Y - pt1.Y), + pt2.X, pt2.Y, + false); + } + + /// + /// Gets the path points in GDI+ style. + /// + public XPoint[] PathPoints { get { return _points.ToArray(); } } + + /// + /// Gets the path types in GDI+ style. + /// + public byte[] PathTypes { get { return _types.ToArray(); } } + + readonly List _points = new List(); + readonly List _types = new List(); + } +} diff --git a/PdfSharp/Drawing/FontFamilyCache.cs b/PdfSharp/Drawing/FontFamilyCache.cs new file mode 100644 index 0000000..296cd20 --- /dev/null +++ b/PdfSharp/Drawing/FontFamilyCache.cs @@ -0,0 +1,142 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Text; +#if CORE || GDI +using System.Drawing; +using GdiFontFamily = System.Drawing.FontFamily; +#endif +#if WPF +using System.Windows.Media; +using System.Windows.Markup; +using WpfFontFamily = System.Windows.Media.FontFamily; +#endif +using PdfSharp.Fonts; +using PdfSharp.Fonts.OpenType; +using PdfSharp.Internal; +using PdfSharp.Pdf; + +namespace PdfSharp.Drawing +{ + /// + /// Global cache of all internal font family objects. + /// + internal sealed class FontFamilyCache + { + FontFamilyCache() + { + _familiesByName = new Dictionary(StringComparer.OrdinalIgnoreCase); + } + + public static FontFamilyInternal GetFamilyByName(string familyName) + { + try + { + Lock.EnterFontFactory(); + FontFamilyInternal family; + Singleton._familiesByName.TryGetValue(familyName, out family); + return family; + } + finally { Lock.ExitFontFactory(); } + } + + /// + /// Caches the font family or returns a previously cached one. + /// + public static FontFamilyInternal CacheOrGetFontFamily(FontFamilyInternal fontFamily) + { + try + { + Lock.EnterFontFactory(); + // Recall that a font family is uniquely identified by its case insensitive name. + FontFamilyInternal existingFontFamily; + if (Singleton._familiesByName.TryGetValue(fontFamily.Name, out existingFontFamily)) + { +#if DEBUG_ + if (fontFamily.Name == "xxx") + fontFamily.GetType(); +#endif + return existingFontFamily; + } + Singleton._familiesByName.Add(fontFamily.Name, fontFamily); + return fontFamily; + } + finally { Lock.ExitFontFactory(); } + } + + /// + /// Gets the singleton. + /// + static FontFamilyCache Singleton + { + get + { + // ReSharper disable once InvertIf + if (_singleton == null) + { + try + { + Lock.EnterFontFactory(); + if (_singleton == null) + _singleton = new FontFamilyCache(); + } + finally { Lock.ExitFontFactory(); } + } + return _singleton; + } + } + static volatile FontFamilyCache _singleton; + + internal static string GetCacheState() + { + StringBuilder state = new StringBuilder(); + state.Append("====================\n"); + state.Append("Font families by name\n"); + Dictionary.KeyCollection familyKeys = Singleton._familiesByName.Keys; + int count = familyKeys.Count; + string[] keys = new string[count]; + familyKeys.CopyTo(keys, 0); + Array.Sort(keys, StringComparer.OrdinalIgnoreCase); + foreach (string key in keys) + state.AppendFormat(" {0}: {1}\n", key, Singleton._familiesByName[key].DebuggerDisplay); + state.Append("\n"); + return state.ToString(); + } + + /// + /// Maps family name to internal font family. + /// + readonly Dictionary _familiesByName; + } +} diff --git a/PdfSharp/Drawing/FontFamilyInternal.cs b/PdfSharp/Drawing/FontFamilyInternal.cs new file mode 100644 index 0000000..576e882 --- /dev/null +++ b/PdfSharp/Drawing/FontFamilyInternal.cs @@ -0,0 +1,208 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using System.Globalization; +using PdfSharp.Internal; +#if CORE || GDI +using System.Drawing; +using GdiFontFamily = System.Drawing.FontFamily; +#endif +#if WPF +using System.Windows.Media; +using System.Windows.Markup; +using WpfFontFamily = System.Windows.Media.FontFamily; +#endif + +// ReSharper disable ConvertToAutoProperty +// ReSharper disable ConvertPropertyToExpressionBody + +namespace PdfSharp.Drawing +{ + /// + /// Internal implementation class of XFontFamily. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + internal class FontFamilyInternal + { + // Implementation Notes + // FontFamilyInternal implements an XFontFamily. + // + // * Each XFontFamily object is just a handle to its FontFamilyInternal singleton. + // + // * A FontFamilyInternal is uniquely identified by its name. It + // is not possible to use two different fonts that have the same + // family name. + + FontFamilyInternal(string familyName, bool createPlatformObjects) + { + _sourceName = _name = familyName; +#if CORE || GDI + if (createPlatformObjects) + { + _gdiFontFamily = new GdiFontFamily(familyName); + _name = _gdiFontFamily.Name; + } +#endif +#if WPF && !SILVERLIGHT + if (createPlatformObjects) + { + _wpfFontFamily = new WpfFontFamily(familyName); + _name = _wpfFontFamily.FamilyNames[FontHelper.XmlLanguageEnUs]; + } +#endif +#if SILVERLIGHT + _wpfFontFamily = new WpfFontFamily(_name); + _name = _wpfFontFamily.Source; // Not expected to change _name. +#endif + } + +#if CORE || GDI + FontFamilyInternal(GdiFontFamily gdiFontFamily) + { + _sourceName = _name = gdiFontFamily.Name; + _gdiFontFamily = gdiFontFamily; +#if WPF + // Hybrid build only. + _wpfFontFamily = new WpfFontFamily(gdiFontFamily.Name); +#endif + } +#endif + +#if WPF + FontFamilyInternal(WpfFontFamily wpfFontFamily) + { +#if !SILVERLIGHT + _sourceName = wpfFontFamily.Source; + _name = wpfFontFamily.FamilyNames[FontHelper.XmlLanguageEnUs]; + _wpfFontFamily = wpfFontFamily; +#else + _sourceName = _name = wpfFontFamily.Source; + _wpfFontFamily = wpfFontFamily; +#endif +#if GDI + // Hybrid build only. + _gdiFontFamily = new GdiFontFamily(_sourceName); +#endif + } +#endif + + internal static FontFamilyInternal GetOrCreateFromName(string familyName, bool createPlatformObject) + { + try + { + Lock.EnterFontFactory(); + FontFamilyInternal family = FontFamilyCache.GetFamilyByName(familyName); + if (family == null) + { + family = new FontFamilyInternal(familyName, createPlatformObject); + family = FontFamilyCache.CacheOrGetFontFamily(family); + } + return family; + } + finally { Lock.ExitFontFactory(); } + } + +#if CORE || GDI + internal static FontFamilyInternal GetOrCreateFromGdi(GdiFontFamily gdiFontFamily) + { + try + { + Lock.EnterFontFactory(); + FontFamilyInternal fontFamily = new FontFamilyInternal(gdiFontFamily); + fontFamily = FontFamilyCache.CacheOrGetFontFamily(fontFamily); + return fontFamily; + } + finally { Lock.ExitFontFactory(); } + } +#endif + +#if WPF + internal static FontFamilyInternal GetOrCreateFromWpf(WpfFontFamily wpfFontFamily) + { + FontFamilyInternal fontFamily = new FontFamilyInternal(wpfFontFamily); + fontFamily = FontFamilyCache.CacheOrGetFontFamily(fontFamily); + return fontFamily; + } +#endif + + /// + /// Gets the family name this family was originally created with. + /// + public string SourceName + { + get { return _sourceName; } + } + readonly string _sourceName; + + /// + /// Gets the name that uniquely identifies this font family. + /// + public string Name + { + // In WPF this is the Win32FamilyName, not the WPF family name. + get { return _name; } + } + readonly string _name; + +#if CORE || GDI + /// + /// Gets the underlying GDI+ font family object. + /// Is null if the font was created by a font resolver. + /// + public GdiFontFamily GdiFamily + { + get { return _gdiFontFamily; } + } + readonly GdiFontFamily _gdiFontFamily; +#endif + +#if WPF + /// + /// Gets the underlying WPF font family object. + /// Is null if the font was created by a font resolver. + /// + public WpfFontFamily WpfFamily + { + get { return _wpfFontFamily; } + } + readonly WpfFontFamily _wpfFontFamily; +#endif + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + // ReSha rper disable UnusedMember.Local + internal string DebuggerDisplay + // ReShar per restore UnusedMember.Local + { + get { return string.Format(CultureInfo.InvariantCulture, "FontFamily: '{0}'", Name); } + } + } +} diff --git a/PdfSharp/Drawing/FontHelper.cs b/PdfSharp/Drawing/FontHelper.cs new file mode 100644 index 0000000..ea677dc --- /dev/null +++ b/PdfSharp/Drawing/FontHelper.cs @@ -0,0 +1,344 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +#if CORE || GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using GdiFontFamily = System.Drawing.FontFamily; +using GdiFont = System.Drawing.Font; +using GdiFontStyle = System.Drawing.FontStyle; +#endif +#if WPF +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; +using System.Windows.Markup; +using WpfFontStyle = System.Windows.FontStyle; +using WpfFontWeight = System.Windows.FontWeight; +using WpfBrush = System.Windows.Media.Brush; +using WpfFontFamily = System.Windows.Media.FontFamily; +using WpfTypeface = System.Windows.Media.Typeface; +using WpfGlyphTypeface = System.Windows.Media.GlyphTypeface; +#endif +#if NETFX_CORE +using Windows.UI.Text; +using Windows.UI.Xaml.Media; +#endif +using PdfSharp.Fonts; +using PdfSharp.Fonts.OpenType; + +namespace PdfSharp.Drawing +{ + /// + /// A bunch of functions that do not have a better place. + /// + static class FontHelper + { + /// + /// Measure string directly from font data. + /// + public static XSize MeasureString(string text, XFont font, XStringFormat stringFormat_notyetused) + { + XSize size = new XSize(); + + OpenTypeDescriptor descriptor = FontDescriptorCache.GetOrCreateDescriptorFor(font) as OpenTypeDescriptor; + if (descriptor != null) + { + // Height is the sum of ascender and descender. + size.Height = (descriptor.Ascender + descriptor.Descender) * font.Size / font.UnitsPerEm; + Debug.Assert(descriptor.Ascender > 0); + + bool symbol = descriptor.FontFace.cmap.symbol; + int length = text.Length; + int width = 0; + for (int idx = 0; idx < length; idx++) + { + char ch = text[idx]; + // HACK: Unclear what to do here. + if (ch < 32) + continue; + + if (symbol) + { + // Remap ch for symbol fonts. + ch = (char)(ch | (descriptor.FontFace.os2.usFirstCharIndex & 0xFF00)); // @@@ refactor + // Used | instead of + because of: http://pdfsharp.codeplex.com/workitem/15954 + } + int glyphIndex = descriptor.CharCodeToGlyphIndex(ch); + width += descriptor.GlyphIndexToWidth(glyphIndex); + } + // What? size.Width = width * font.Size * (font.Italic ? 1 : 1) / descriptor.UnitsPerEm; + size.Width = width * font.Size / descriptor.UnitsPerEm; + + // Adjust bold simulation. + if ((font.GlyphTypeface.StyleSimulations & XStyleSimulations.BoldSimulation) == XStyleSimulations.BoldSimulation) + { + // Add 2% of the em-size for each character. + // Unsure how to deal with white space. Currently count as regular character. + size.Width += length * font.Size * Const.BoldEmphasis; + } + } + Debug.Assert(descriptor != null, "No OpenTypeDescriptor."); + return size; + } + +#if CORE || GDI + public static GdiFont CreateFont(string familyName, double emSize, GdiFontStyle style, out XFontSource fontSource) + { + fontSource = null; + // ReSharper disable once JoinDeclarationAndInitializer + GdiFont font; + + // Use font resolver in CORE build. XPrivateFontCollection exists only in GDI and WPF build. +#if GDI + // Try private font collection first. + font = XPrivateFontCollection.TryCreateFont(familyName, emSize, style, out fontSource); + if (font != null) + { + // Get font source is different for this font because Win32 does not know it. + return font; + } +#endif + // Create ordinary Win32 font. + font = new GdiFont(familyName, (float)emSize, style, GraphicsUnit.World); + return font; + } +#endif + +#if WPF +#if !SILVERLIGHT + public static readonly CultureInfo CultureInfoEnUs = CultureInfo.GetCultureInfo("en-US"); + public static readonly XmlLanguage XmlLanguageEnUs = XmlLanguage.GetLanguage("en-US"); +#endif + /// + /// Creates a typeface. + /// + public static Typeface CreateTypeface(WpfFontFamily family, XFontStyle style) + { + // BUG: does not work with fonts that have others than the four default styles + WpfFontStyle fontStyle = FontStyleFromStyle(style); + WpfFontWeight fontWeight = FontWeightFromStyle(style); +#if !SILVERLIGHT + WpfTypeface typeface = new WpfTypeface(family, fontStyle, fontWeight, FontStretches.Normal); +#else + WpfTypeface typeface = null; +#endif + return typeface; + } + +#if !SILVERLIGHT + /// + /// Creates the formatted text. + /// + public static FormattedText CreateFormattedText(string text, Typeface typeface, double emSize, WpfBrush brush) + { + //FontFamily fontFamily = new FontFamily(testFontName); + //typeface = new Typeface(fontFamily, FontStyles.Normal, FontWeights.Bold, FontStretches.Condensed); + //List typefaces = new List(fontFamily.GetTypefaces()); + //typefaces.GetType(); + //typeface = s_typefaces[0]; + + // BUG: does not work with fonts that have others than the four default styles + FormattedText formattedText = new FormattedText(text, new CultureInfo("en-us"), FlowDirection.LeftToRight, typeface, emSize, brush); + // .NET 4.0 feature new NumberSubstitution(), TextFormattingMode.Display); + //formattedText.SetFontWeight(FontWeights.Bold); + //formattedText.SetFontStyle(FontStyles.Oblique); + //formattedText.SetFontStretch(FontStretches.Condensed); + return formattedText; + } +#endif + +#if SILVERLIGHT_ + /// + /// Creates the TextBlock. + /// + public static TextBlock CreateTextBlock(string text, XGlyphTypeface glyphTypeface, double emSize, Brush brush) + { + TextBlock textBlock = new TextBlock(); + textBlock.FontFamily = glyphTypeface.FontFamily; + textBlock.FontSource = glyphTypeface.FontSource; + textBlock.FontSize = emSize; + textBlock.FontWeight = glyphTypeface.IsBold ? FontWeights.Bold : FontWeights.Normal; + textBlock.FontStyle = glyphTypeface.IsItalic ? FontStyles.Italic : FontStyles.Normal; + textBlock.Foreground = brush; + textBlock.Text = text; + + return textBlock; + } +#endif + + /// + /// Simple hack to make it work... + /// Returns Normal or Italic - bold, underline and such get lost here. + /// + public static WpfFontStyle FontStyleFromStyle(XFontStyle style) + { + switch (style & XFontStyle.BoldItalic) // Mask out Underline, Strikeout, etc. + { + case XFontStyle.Regular: + return FontStyles.Normal; + + case XFontStyle.Bold: + return FontStyles.Normal; + + case XFontStyle.Italic: + return FontStyles.Italic; + + case XFontStyle.BoldItalic: + return FontStyles.Italic; + } + return FontStyles.Normal; + } + + /// + /// Simple hack to make it work... + /// + public static FontWeight FontWeightFromStyle(XFontStyle style) + { + switch (style & XFontStyle.BoldItalic) // Mask out Underline, Strikeout, etc. + { + case XFontStyle.Regular: + return FontWeights.Normal; + + case XFontStyle.Bold: + return FontWeights.Bold; + + case XFontStyle.Italic: + return FontWeights.Normal; + + case XFontStyle.BoldItalic: + return FontWeights.Bold; + } + return FontWeights.Normal; + } + + /// + /// Determines whether the style is available as a glyph type face in the specified font family, i.e. the specified style is not simulated. + /// + public static bool IsStyleAvailable(XFontFamily family, XGdiFontStyle style) + { + style &= XGdiFontStyle.BoldItalic; +#if !SILVERLIGHT + // TODOWPF: check for correctness + // FontDescriptor descriptor = FontDescriptorCache.GetOrCreateDescriptor(family.Name, style); + //XFontMetrics metrics = descriptor.FontMetrics; + + // style &= XFontStyle.Regular | XFontStyle.Bold | XFontStyle.Italic | XFontStyle.BoldItalic; // same as XFontStyle.BoldItalic + List typefaces = new List(family.WpfFamily.GetTypefaces()); + foreach (WpfTypeface typeface in typefaces) + { + bool bold = typeface.Weight == FontWeights.Bold; + bool italic = typeface.Style == FontStyles.Italic; + switch (style) + { + case XGdiFontStyle.Regular: + if (!bold && !italic) + return true; + break; + + case XGdiFontStyle.Bold: + if (bold && !italic) + return true; + break; + + case XGdiFontStyle.Italic: + if (!bold && italic) + return true; + break; + + case XGdiFontStyle.BoldItalic: + if (bold && italic) + return true; + break; + } + ////// typeface.sty + ////// bool available = false; + ////// GlyphTypeface glyphTypeface; + ////// if (typeface.TryGetGlyphTypeface(out glyphTypeface)) + ////// { + //////#if DEBUG_ + ////// glyphTypeface.GetType(); + //////#endif + ////// available = true; + ////// } + ////// if (available) + ////// return true; + } + return false; +#else + return true; // AGHACK +#endif + } +#endif + + /// + /// Calculates an Adler32 checksum combined with the buffer length + /// in a 64 bit unsigned integer. + /// + public static ulong CalcChecksum(byte[] buffer) + { + if (buffer == null) + throw new ArgumentNullException("buffer"); + + const uint prime = 65521; // largest prime smaller than 65536 + uint s1 = 0; + uint s2 = 0; + int length = buffer.Length; + int offset = 0; + while (length > 0) + { + int n = 3800; + if (n > length) + n = length; + length -= n; + while (--n >= 0) + { + s1 += buffer[offset++]; + s2 = s2 + s1; + } + s1 %= prime; + s2 %= prime; + } + //return ((ulong)((ulong)(((ulong)s2 << 16) | (ulong)s1)) << 32) | (ulong)buffer.Length; + ulong ul1 = (ulong)s2 << 16; + ul1 = ul1 | s1; + ulong ul2 = (ulong)buffer.Length; + return (ul1 << 32) | ul2; + } + + public static XFontStyle CreateStyle(bool isBold, bool isItalic) + { + return (isBold ? XFontStyle.Bold : 0) | (isItalic ? XFontStyle.Italic : 0); + } + } +} diff --git a/PdfSharp/Drawing/GeometryHelper.cs b/PdfSharp/Drawing/GeometryHelper.cs new file mode 100644 index 0000000..3bc9567 --- /dev/null +++ b/PdfSharp/Drawing/GeometryHelper.cs @@ -0,0 +1,874 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Collections.Generic; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows.Media; +using SysPoint = System.Windows.Point; +using SysSize = System.Windows.Size; +#endif +#if NETFX_CORE || UWP +using Windows.UI.Xaml.Media; +using SysPoint = Windows.Foundation.Point; +using SysSize = Windows.Foundation.Size; +#endif +using PdfSharp.Internal; + +// ReSharper disable RedundantNameQualifier +// ReSharper disable CompareOfFloatsByEqualityOperator + +namespace PdfSharp.Drawing +{ + /// + /// Helper class for Geometry paths. + /// + static class GeometryHelper + { +#if WPF || NETFX_CORE + /// + /// Appends a Bézier segment from a curve. + /// + public static BezierSegment CreateCurveSegment(XPoint pt0, XPoint pt1, XPoint pt2, XPoint pt3, double tension3) + { +#if !SILVERLIGHT && !NETFX_CORE + return new BezierSegment( + new SysPoint(pt1.X + tension3 * (pt2.X - pt0.X), pt1.Y + tension3 * (pt2.Y - pt0.Y)), + new SysPoint(pt2.X - tension3 * (pt3.X - pt1.X), pt2.Y - tension3 * (pt3.Y - pt1.Y)), + new SysPoint(pt2.X, pt2.Y), true); +#else + BezierSegment bezierSegment = new BezierSegment(); + bezierSegment.Point1 = new SysPoint(pt1.X + tension3 * (pt2.X - pt0.X), pt1.Y + tension3 * (pt2.Y - pt0.Y)); + bezierSegment.Point2 = new SysPoint(pt2.X - tension3 * (pt3.X - pt1.X), pt2.Y - tension3 * (pt3.Y - pt1.Y)); + bezierSegment.Point3 = new SysPoint(pt2.X, pt2.Y); + return bezierSegment; +#endif + } +#endif + +#if WPF || NETFX_CORE + /// + /// Creates a path geometry from a polygon. + /// + public static PathGeometry CreatePolygonGeometry(SysPoint[] points, XFillMode fillMode, bool closed) + { + PolyLineSegment seg = new PolyLineSegment(); + int count = points.Length; + // For correct drawing the start point of the segment must not be the same as the first point. + for (int idx = 1; idx < count; idx++) + seg.Points.Add(new SysPoint(points[idx].X, points[idx].Y)); +#if !SILVERLIGHT && !NETFX_CORE + seg.IsStroked = true; +#endif + PathFigure fig = new PathFigure(); + fig.StartPoint = new SysPoint(points[0].X, points[0].Y); + fig.Segments.Add(seg); + fig.IsClosed = closed; + PathGeometry geo = new PathGeometry(); + geo.FillRule = fillMode == XFillMode.Winding ? FillRule.Nonzero : FillRule.EvenOdd; + geo.Figures.Add(fig); + return geo; + } +#endif + +#if WPF || NETFX_CORE + /// + /// Creates a path geometry from a polygon. + /// + public static PolyLineSegment CreatePolyLineSegment(SysPoint[] points, XFillMode fillMode, bool closed) + { + PolyLineSegment seg = new PolyLineSegment(); + int count = points.Length; + // For correct drawing the start point of the segment must not be the same as the first point. + for (int idx = 1; idx < count; idx++) + seg.Points.Add(new SysPoint(points[idx].X, points[idx].Y)); +#if !SILVERLIGHT && !NETFX_CORE + seg.IsStroked = true; +#endif + return seg; + } +#endif + +#if WPF || NETFX_CORE + /// + /// Creates the arc segment from parameters of the GDI+ DrawArc function. + /// + public static ArcSegment CreateArcSegment(double x, double y, double width, double height, double startAngle, + double sweepAngle, out SysPoint startPoint) + { + // Normalize the angles. + double α = startAngle; + if (α < 0) + α = α + (1 + Math.Floor((Math.Abs(α) / 360))) * 360; + else if (α > 360) + α = α - Math.Floor(α / 360) * 360; + Debug.Assert(α >= 0 && α <= 360); + + if (Math.Abs(sweepAngle) >= 360) + sweepAngle = Math.Sign(sweepAngle) * 360; + double β = startAngle + sweepAngle; + if (β < 0) + β = β + (1 + Math.Floor((Math.Abs(β) / 360))) * 360; + else if (β > 360) + β = β - Math.Floor(β / 360) * 360; + + if (α == 0 && β < 0) + α = 360; + else if (α == 360 && β > 0) + α = 0; + + // Scanling factor. + double δx = width / 2; + double δy = height / 2; + + // Center of ellipse. + double x0 = x + δx; + double y0 = y + δy; + + double cosα, cosβ, sinα, sinβ; + if (width == height) + { + // Circular arc needs no correction. + α = α * Calc.Deg2Rad; + β = β * Calc.Deg2Rad; + } + else + { + // Elliptic arc needs the angles to be adjusted such that the scaling transformation is compensated. + α = α * Calc.Deg2Rad; + sinα = Math.Sin(α); + if (Math.Abs(sinα) > 1E-10) + { + if (α < Math.PI) + α = Math.PI / 2 - Math.Atan(δy * Math.Cos(α) / (δx * sinα)); + else + α = 3 * Math.PI / 2 - Math.Atan(δy * Math.Cos(α) / (δx * sinα)); + } + //α = Calc.πHalf - Math.Atan(δy * Math.Cos(α) / (δx * sinα)); + β = β * Calc.Deg2Rad; + sinβ = Math.Sin(β); + if (Math.Abs(sinβ) > 1E-10) + { + if (β < Math.PI) + β = Math.PI / 2 - Math.Atan(δy * Math.Cos(β) / (δx * sinβ)); + else + β = 3 * Math.PI / 2 - Math.Atan(δy * Math.Cos(β) / (δx * sinβ)); + } + //β = Calc.πHalf - Math.Atan(δy * Math.Cos(β) / (δx * sinβ)); + } + + sinα = Math.Sin(α); + cosα = Math.Cos(α); + sinβ = Math.Sin(β); + cosβ = Math.Cos(β); + + startPoint = new SysPoint(x0 + δx * cosα, y0 + δy * sinα); + SysPoint destPoint = new SysPoint(x0 + δx * cosβ, y0 + δy * sinβ); + SysSize size = new SysSize(δx, δy); + bool isLargeArc = Math.Abs(sweepAngle) >= 180; + SweepDirection sweepDirection = sweepAngle > 0 ? SweepDirection.Clockwise : SweepDirection.Counterclockwise; +#if !SILVERLIGHT && !NETFX_CORE + bool isStroked = true; + ArcSegment seg = new ArcSegment(destPoint, size, 0, isLargeArc, sweepDirection, isStroked); +#else + ArcSegment seg = new ArcSegment(); + seg.Point = destPoint; + seg.Size = size; + seg.RotationAngle = 0; + seg.IsLargeArc = isLargeArc; + seg.SweepDirection = sweepDirection; + // isStroked does not exist in Silverlight 3 +#endif + return seg; + } +#endif + + /// + /// Creates between 1 and 5 Béziers curves from parameters specified like in GDI+. + /// + public static List BezierCurveFromArc(double x, double y, double width, double height, double startAngle, double sweepAngle, + PathStart pathStart, ref XMatrix matrix) + { + List points = new List(); + + // Normalize the angles. + double α = startAngle; + if (α < 0) + α = α + (1 + Math.Floor((Math.Abs(α) / 360))) * 360; + else if (α > 360) + α = α - Math.Floor(α / 360) * 360; + Debug.Assert(α >= 0 && α <= 360); + + double β = sweepAngle; + if (β < -360) + β = -360; + else if (β > 360) + β = 360; + + if (α == 0 && β < 0) + α = 360; + else if (α == 360 && β > 0) + α = 0; + + // Is it possible that the arc is small starts and ends in same quadrant? + bool smallAngle = Math.Abs(β) <= 90; + + β = α + β; + if (β < 0) + β = β + (1 + Math.Floor((Math.Abs(β) / 360))) * 360; + + bool clockwise = sweepAngle > 0; + int startQuadrant = Quadrant(α, true, clockwise); + int endQuadrant = Quadrant(β, false, clockwise); + + if (startQuadrant == endQuadrant && smallAngle) + AppendPartialArcQuadrant(points, x, y, width, height, α, β, pathStart, matrix); + else + { + int currentQuadrant = startQuadrant; + bool firstLoop = true; + do + { + if (currentQuadrant == startQuadrant && firstLoop) + { + double ξ = currentQuadrant * 90 + (clockwise ? 90 : 0); + AppendPartialArcQuadrant(points, x, y, width, height, α, ξ, pathStart, matrix); + } + else if (currentQuadrant == endQuadrant) + { + double ξ = currentQuadrant * 90 + (clockwise ? 0 : 90); + AppendPartialArcQuadrant(points, x, y, width, height, ξ, β, PathStart.Ignore1st, matrix); + } + else + { + double ξ1 = currentQuadrant * 90 + (clockwise ? 0 : 90); + double ξ2 = currentQuadrant * 90 + (clockwise ? 90 : 0); + AppendPartialArcQuadrant(points, x, y, width, height, ξ1, ξ2, PathStart.Ignore1st, matrix); + } + + // Don't stop immediately if arc is greater than 270 degrees. + if (currentQuadrant == endQuadrant && smallAngle) + break; + smallAngle = true; + + if (clockwise) + currentQuadrant = currentQuadrant == 3 ? 0 : currentQuadrant + 1; + else + currentQuadrant = currentQuadrant == 0 ? 3 : currentQuadrant - 1; + + firstLoop = false; + } while (true); + } + return points; + } + + /// + /// Calculates the quadrant (0 through 3) of the specified angle. If the angle lies on an edge + /// (0, 90, 180, etc.) the result depends on the details how the angle is used. + /// + static int Quadrant(double φ, bool start, bool clockwise) + { + Debug.Assert(φ >= 0); + if (φ > 360) + φ = φ - Math.Floor(φ / 360) * 360; + + int quadrant = (int)(φ / 90); + if (quadrant * 90 == φ) + { + if ((start && !clockwise) || (!start && clockwise)) + quadrant = quadrant == 0 ? 3 : quadrant - 1; + } + else + quadrant = clockwise ? ((int)Math.Floor(φ / 90)) % 4 : (int)Math.Floor(φ / 90); + return quadrant; + } + + /// + /// Appends a Bézier curve for an arc within a full quadrant. + /// + static void AppendPartialArcQuadrant(List points, double x, double y, double width, double height, double α, double β, PathStart pathStart, XMatrix matrix) + { + Debug.Assert(α >= 0 && α <= 360); + Debug.Assert(β >= 0); + if (β > 360) + β = β - Math.Floor(β / 360) * 360; + Debug.Assert(Math.Abs(α - β) <= 90); + + // Scanling factor. + double δx = width / 2; + double δy = height / 2; + + // Center of ellipse. + double x0 = x + δx; + double y0 = y + δy; + + // We have the following quarters: + // | + // 2 | 3 + // ----+----- + // 1 | 0 + // | + // If the angles lie in quarter 2 or 3, their values are subtracted by 180 and the + // resulting curve is reflected at the center. This algorithm works as expected (simply tried out). + // There may be a mathematically more elegant solution... + bool reflect = false; + if (α >= 180 && β >= 180) + { + α -= 180; + β -= 180; + reflect = true; + } + + double cosα, cosβ, sinα, sinβ; + if (width == height) + { + // Circular arc needs no correction. + α = α * Calc.Deg2Rad; + β = β * Calc.Deg2Rad; + } + else + { + // Elliptic arc needs the angles to be adjusted such that the scaling transformation is compensated. + α = α * Calc.Deg2Rad; + sinα = Math.Sin(α); + if (Math.Abs(sinα) > 1E-10) + α = Math.PI / 2 - Math.Atan(δy * Math.Cos(α) / (δx * sinα)); + β = β * Calc.Deg2Rad; + sinβ = Math.Sin(β); + if (Math.Abs(sinβ) > 1E-10) + β = Math.PI / 2 - Math.Atan(δy * Math.Cos(β) / (δx * sinβ)); + } + + double κ = 4 * (1 - Math.Cos((α - β) / 2)) / (3 * Math.Sin((β - α) / 2)); + sinα = Math.Sin(α); + cosα = Math.Cos(α); + sinβ = Math.Sin(β); + cosβ = Math.Cos(β); + + //XPoint pt1, pt2, pt3; + if (!reflect) + { + // Calculation for quarter 0 and 1. + switch (pathStart) + { + case PathStart.MoveTo1st: + points.Add(matrix.Transform(new XPoint(x0 + δx * cosα, y0 + δy * sinα))); + break; + + case PathStart.LineTo1st: + points.Add(matrix.Transform(new XPoint(x0 + δx * cosα, y0 + δy * sinα))); + break; + + case PathStart.Ignore1st: + break; + } + points.Add(matrix.Transform(new XPoint(x0 + δx * (cosα - κ * sinα), y0 + δy * (sinα + κ * cosα)))); + points.Add(matrix.Transform(new XPoint(x0 + δx * (cosβ + κ * sinβ), y0 + δy * (sinβ - κ * cosβ)))); + points.Add(matrix.Transform(new XPoint(x0 + δx * cosβ, y0 + δy * sinβ))); + } + else + { + // Calculation for quarter 2 and 3. + switch (pathStart) + { + case PathStart.MoveTo1st: + points.Add(matrix.Transform(new XPoint(x0 - δx * cosα, y0 - δy * sinα))); + break; + + case PathStart.LineTo1st: + points.Add(matrix.Transform(new XPoint(x0 - δx * cosα, y0 - δy * sinα))); + break; + + case PathStart.Ignore1st: + break; + } + points.Add(matrix.Transform(new XPoint(x0 - δx * (cosα - κ * sinα), y0 - δy * (sinα + κ * cosα)))); + points.Add(matrix.Transform(new XPoint(x0 - δx * (cosβ + κ * sinβ), y0 - δy * (sinβ - κ * cosβ)))); + points.Add(matrix.Transform(new XPoint(x0 - δx * cosβ, y0 - δy * sinβ))); + } + } + + /// + /// Creates between 1 and 5 Béziers curves from parameters specified like in WPF. + /// + public static List BezierCurveFromArc(XPoint point1, XPoint point2, XSize size, + double rotationAngle, bool isLargeArc, bool clockwise, PathStart pathStart) + { + // See also http://www.charlespetzold.com/blog/blog.xml from January 2, 2008: + // http://www.charlespetzold.com/blog/2008/01/Mathematics-of-ArcSegment.html + double δx = size.Width; + double δy = size.Height; + Debug.Assert(δx * δy > 0); + double factor = δy / δx; + bool isCounterclockwise = !clockwise; + + // Adjust for different radii and rotation angle. + XMatrix matrix = new XMatrix(); + matrix.RotateAppend(-rotationAngle); + matrix.ScaleAppend(δy / δx, 1); + XPoint pt1 = matrix.Transform(point1); + XPoint pt2 = matrix.Transform(point2); + + // Get info about chord that connects both points. + XPoint midPoint = new XPoint((pt1.X + pt2.X) / 2, (pt1.Y + pt2.Y) / 2); + XVector vect = pt2 - pt1; + double halfChord = vect.Length / 2; + + // Get vector from chord to center. + XVector vectRotated; + + // (comparing two Booleans here!) + if (isLargeArc == isCounterclockwise) + vectRotated = new XVector(-vect.Y, vect.X); + else + vectRotated = new XVector(vect.Y, -vect.X); + + vectRotated.Normalize(); + + // Distance from chord to center. + double centerDistance = Math.Sqrt(δy * δy - halfChord * halfChord); + if (double.IsNaN(centerDistance)) + centerDistance = 0; + + // Calculate center point. + XPoint center = midPoint + centerDistance * vectRotated; + + // Get angles from center to the two points. + double α = Math.Atan2(pt1.Y - center.Y, pt1.X - center.X); + double β = Math.Atan2(pt2.Y - center.Y, pt2.X - center.X); + + // (another comparison of two Booleans!) + if (isLargeArc == (Math.Abs(β - α) < Math.PI)) + { + if (α < β) + α += 2 * Math.PI; + else + β += 2 * Math.PI; + } + + // Invert matrix for final point calculation. + matrix.Invert(); + double sweepAngle = β - α; + + // Let the algorithm of GDI+ DrawArc to Bézier curves do the rest of the job + return BezierCurveFromArc(center.X - δx * factor, center.Y - δy, 2 * δx * factor, 2 * δy, + α / Calc.Deg2Rad, sweepAngle / Calc.Deg2Rad, pathStart, ref matrix); + } + + + + + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + // The code below comes from WPF source code, because I was not able to convert an arc + // to a series of Bezier curves exactly the way WPF renders the arc. I tested my own code + // with the MinBar Test Suite from QualityLogic and could not find out why it does not match. + // My Bezier curves came very close to the arc, but in some cases they do simply not match. + // So I gave up and use the WPF code. +#if WPF || NETFX_CORE + + // ReSharper disable InconsistentNaming + const double FUZZ = 1e-6; // Relative 0 + // ReSharper restore InconsistentNaming + + //+------------------------------------------------------------------------------------------------- + + // + // Function: GetArcAngle + // + // Synopsis: Get the number of Bezier arcs, and sine & cosine of each + // + // Notes: This is a private utility used by ArcToBezier + // We break the arc into pieces so that no piece will span more than 90 degrees. + // The input points are on the unit circle + // + //------------------------------------------------------------------------------------------------- + public static void + GetArcAngle( + XPoint startPoint, // Start point + XPoint endPoint, // End point + bool isLargeArc, // Choose the larger of the 2 possible arcs if TRUE + //SweepDirection sweepDirection, // Direction n which to sweep the arc. + bool isClockwise, + out double cosArcAngle, // Cosine of a the sweep angle of one arc piece + out double sinArcAngle, // Sine of a the sweep angle of one arc piece + out int pieces) // Out: The number of pieces + { + double angle; + + // The points are on the unit circle, so: + cosArcAngle = startPoint.X * endPoint.X + startPoint.Y * endPoint.Y; + sinArcAngle = startPoint.X * endPoint.Y - startPoint.Y * endPoint.X; + + if (cosArcAngle >= 0) + { + if (isLargeArc) + { + // The angle is between 270 and 360 degrees, so + pieces = 4; + } + else + { + // The angle is between 0 and 90 degrees, so + pieces = 1; + return; // We already have the cosine and sine of the angle + } + } + else + { + if (isLargeArc) + { + // The angle is between 180 and 270 degrees, so + pieces = 3; + } + else + { + // The angle is between 90 and 180 degrees, so + pieces = 2; + } + } + + // We have to chop the arc into the computed number of pieces. For cPieces=2 and 4 we could + // have uses the half-angle trig formulas, but for pieces=3 it requires solving a cubic + // equation; the performance difference is not worth the extra code, so we'll get the angle, + // divide it, and get its sine and cosine. + + Debug.Assert(pieces > 0); + angle = Math.Atan2(sinArcAngle, cosArcAngle); + + if (isClockwise) + { + if (angle < 0) + angle += Math.PI * 2; + } + else + { + if (angle > 0) + angle -= Math.PI * 2; + } + + angle /= pieces; + cosArcAngle = Math.Cos(angle); + sinArcAngle = Math.Sin(angle); + } + + /******************************************************************************\ + * + * Function Description: + * + * Get the distance from a circular arc's endpoints to the control points of the + * Bezier arc that approximates it, as a fraction of the arc's radius. + * + * Since the result is relative to the arc's radius, it depends strictly on the + * arc's angle. The arc is assumed to be of 90 degrees of less, so the angle is + * determined by the cosine of that angle, which is derived from rDot = the dot + * product of two radius vectors. We need the Bezier curve that agrees with + * the arc's points and tangents at the ends and midpoint. Here we compute the + * distance from the curve's endpoints to its control points. + * + * Since we are looking for the relative distance, we can work on the unit + * circle. Place the center of the circle at the origin, and put the X axis as + * the bisector between the 2 vectors. Let a be the angle between the vectors. + * Then the X coordinates of the 1st & last points are cos(a/2). Let x be the X + * coordinate of the 2nd & 3rd points. At t=1/2 we have a point at (1,0). + * But the terms of the polynomial there are all equal: + * + * (1-t)^3 = t*(1-t)^2 = 2^2*(1-t) = t^3 = 1/8, + * + * so from the Bezier formula there we have: + * + * 1 = (1/8) * (cos(a/2) + 3x + 3x + cos(a/2)), + * hence + * x = (1 - cos(a/2)) / 3 + * + * The X difference between that and the 1st point is: + * + * DX = x - cos(a/2) = 4(1 - cos(a/2)) / 3. + * + * But DX = distance / sin(a/2), hence the distance is + * + * dist = (4/3)*(1 - cos(a/2)) / sin(a/2). + * + * Created: 5/29/2001 [....] + * + /*****************************************************************************/ + public static double + GetBezierDistance( // Return the distance as a fraction of the radius + double dot, // In: The dot product of the two radius vectors + double radius) // In: The radius of the arc's circle (optional=1) + { + double radSquared = radius * radius; // Squared radius + + Debug.Assert(dot >= -radSquared * .1); // angle < 90 degrees + Debug.Assert(dot <= radSquared * 1.1); // as dot product of 2 radius vectors + + double dist = 0; // Acceptable fallback value + + /* Rather than the angle a, we are given rDot = R^2 * cos(a), so we + multiply top and bottom by R: + + dist = (4/3)*(R - Rcos(a/2)) / Rsin(a/2) + + and use some trig: + __________ + cos(a/2) = \/1 + cos(a) / 2 + ________________ __________ + R*cos(a/2) = \/R^2 + R^2 cos(a) / 2 = \/R^2 + rDot / 2 */ + + double cos = (radSquared + dot) / 2; // =(R*cos(a))^2 + if (cos < 0) + return dist; + // __________________ + // R*sin(a/2) = \/R^2 - R^2 cos(a/2) + + double sin = radSquared - cos; // =(R*sin(a))^2 + if (sin <= 0) + return dist; + + sin = Math.Sqrt(sin); // = R*cos(a) + cos = Math.Sqrt(cos); // = R*sin(a) + + dist = 4 * (radius - cos) / 3; + if (dist <= sin * FUZZ) + dist = 0; + else + dist = 4 * (radius - cos) / sin / 3; + + return dist; + } + + //+------------------------------------------------------------------------------------------------- + // + // Function: ArcToBezier + // + // Synopsis: Compute the Bezier approximation of an arc + // + // Notes: This utilitycomputes the Bezier approximation for an elliptical arc as it is defined + // in the SVG arc spec. The ellipse from which the arc is carved is axis-aligned in its + // own coordinates, and defined there by its x and y radii. The rotation angle defines + // how the ellipse's axes are rotated relative to our x axis. The start and end points + // define one of 4 possible arcs; the sweep and large-arc flags determine which one of + // these arcs will be chosen. See SVG spec for details. + // + // Returning pieces = 0 indicates a line instead of an arc + // pieces = -1 indicates that the arc degenerates to a point + // + //-------------------------------------------------------------------------------------------------- + public static PointCollection ArcToBezier(double xStart, double yStart, double xRadius, double yRadius, double rotationAngle, + bool isLargeArc, bool isClockwise, double xEnd, double yEnd, out int pieces) + { + double cosArcAngle, sinArcAngle, xCenter, yCenter, r, bezDist; + XVector vecToBez1, vecToBez2; + XMatrix matToEllipse; + + double fuzz2 = FUZZ * FUZZ; + bool isZeroCenter = false; + + pieces = -1; + + // In the following, the line segment between between the arc's start and + // end points is referred to as "the chord". + + // Transform 1: Shift the origin to the chord's midpoint + double x = (xEnd - xStart) / 2; + double y = (yEnd - yStart) / 2; + + double halfChord2 = x * x + y * y; // (half chord length)^2 + + // Degenerate case: single point + if (halfChord2 < fuzz2) + { + // The chord degeneartes to a point, the arc will be ignored + return null; + } + + // Degenerate case: straight line + if (!AcceptRadius(halfChord2, fuzz2, ref xRadius) || !AcceptRadius(halfChord2, fuzz2, ref yRadius)) + { + // We have a zero radius, add a straight line segment instead of an arc + pieces = 0; + return null; + } + + if (xRadius == 0 || yRadius == 0) + { + // We have a zero radius, add a straight line segment instead of an arc + pieces = 0; + return null; + } + + // Transform 2: Rotate to the ellipse's coordinate system + rotationAngle = -rotationAngle * Calc.Deg2Rad; + + double cos = Math.Cos(rotationAngle); + double sin = Math.Sin(rotationAngle); + + r = x * cos - y * sin; + y = x * sin + y * cos; + x = r; + + // Transform 3: Scale so that the ellipse will become a unit circle + x /= xRadius; + y /= yRadius; + + // We get to the center of that circle along a verctor perpendicular to the chord + // from the origin, which is the chord's midpoint. By Pythagoras, the length of that + // vector is sqrt(1 - (half chord)^2). + + halfChord2 = x * x + y * y; // now in the circle coordinates + + if (halfChord2 > 1) + { + // The chord is longer than the circle's diameter; we scale the radii uniformly so + // that the chord will be a diameter. The center will then be the chord's midpoint, + // which is now the origin. + r = Math.Sqrt(halfChord2); + xRadius *= r; + yRadius *= r; + xCenter = yCenter = 0; + isZeroCenter = true; + + // Adjust the unit-circle coordinates x and y + x /= r; + y /= r; + } + else + { + // The length of (-y,x) or (x,-y) is sqrt(rHalfChord2), and we want a vector + // of length sqrt(1 - rHalfChord2), so we'll multiply it by: + r = Math.Sqrt((1 - halfChord2) / halfChord2); + //if (isLargeArc != (eSweepDirection == SweepDirection.Clockwise)) + if (isLargeArc != isClockwise) + // Going to the center from the origin=chord-midpoint + { + // in the direction of (-y, x) + xCenter = -r * y; + yCenter = r * x; + } + else + { + // in the direction of (y, -x) + xCenter = r * y; + yCenter = -r * x; + } + } + + // Transformation 4: shift the origin to the center of the circle, which then becomes + // the unit circle. Since the chord's midpoint is the origin, the start point is (-x, -y) + // and the endpoint is (x, y). + XPoint ptStart = new XPoint(-x - xCenter, -y - yCenter); + XPoint ptEnd = new XPoint(x - xCenter, y - yCenter); + + // Set up the matrix that will take us back to our coordinate system. This matrix is + // the inverse of the combination of transformation 1 thru 4. + matToEllipse = new XMatrix(cos * xRadius, -sin * xRadius, + sin * yRadius, cos * yRadius, + (xEnd + xStart) / 2, (yEnd + yStart) / 2); + + if (!isZeroCenter) + { + // Prepend the translation that will take the origin to the circle's center + matToEllipse.OffsetX += (matToEllipse.M11 * xCenter + matToEllipse.M21 * yCenter); + matToEllipse.OffsetY += (matToEllipse.M12 * xCenter + matToEllipse.M22 * yCenter); + } + + // Get the sine & cosine of the angle that will generate the arc pieces + GetArcAngle(ptStart, ptEnd, isLargeArc, isClockwise, out cosArcAngle, out sinArcAngle, out pieces); + + // Get the vector to the first Bezier control point + bezDist = GetBezierDistance(cosArcAngle, 1); + + //if (eSweepDirection == SweepDirection.Counterclockwise) + if (!isClockwise) + bezDist = -bezDist; + + vecToBez1 = new XVector(-bezDist * ptStart.Y, bezDist * ptStart.X); + + PointCollection result = new PointCollection(); + + // Add the arc pieces, except for the last + for (int idx = 1; idx < pieces; idx++) + { + // Get the arc piece's endpoint + XPoint ptPieceEnd = new XPoint(ptStart.X * cosArcAngle - ptStart.Y * sinArcAngle, ptStart.X * sinArcAngle + ptStart.Y * cosArcAngle); + vecToBez2 = new XVector(-bezDist * ptPieceEnd.Y, bezDist * ptPieceEnd.X); + + result.Add(matToEllipse.Transform(ptStart + vecToBez1)); + result.Add(matToEllipse.Transform(ptPieceEnd - vecToBez2)); + result.Add(matToEllipse.Transform(ptPieceEnd)); + + // Move on to the next arc + ptStart = ptPieceEnd; + vecToBez1 = vecToBez2; + } + + // Last arc - we know the endpoint + vecToBez2 = new XVector(-bezDist * ptEnd.Y, bezDist * ptEnd.X); + + result.Add(matToEllipse.Transform(ptStart + vecToBez1)); + result.Add(matToEllipse.Transform(ptEnd - vecToBez2)); + result.Add(new XPoint(xEnd, yEnd)); + + return result; + } + + /// + /// Gets a value indicating whether radius large enough compared to the chord length. + /// + /// (1/2 chord length)squared + /// Squared fuzz. + /// The radius to accept (or not). + static bool AcceptRadius(double halfChord2, double fuzz2, ref double radius) + { + Debug.Assert(halfChord2 >= fuzz2); // Otherewise we have no guarantee that the radius is not 0, and we need to divide by the radius + bool accept = radius * radius > halfChord2 * fuzz2; + if (accept) + { + if (radius < 0) + radius = 0; + } + return accept; + } +#endif + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing/GraphicsStateStack.cs b/PdfSharp/Drawing/GraphicsStateStack.cs new file mode 100644 index 0000000..7412fd6 --- /dev/null +++ b/PdfSharp/Drawing/GraphicsStateStack.cs @@ -0,0 +1,98 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Represents a stack of XGraphicsState and XGraphicsContainer objects. + /// + internal class GraphicsStateStack + { + public GraphicsStateStack(XGraphics gfx) + { + _current = new InternalGraphicsState(gfx); + } + + public int Count + { + get { return _stack.Count; } + } + + public void Push(InternalGraphicsState state) + { + _stack.Push(state); + state.Pushed(); + } + + public int Restore(InternalGraphicsState state) + { + if (!_stack.Contains(state)) + throw new ArgumentException("State not on stack.", "state"); + if (state.Invalid) + throw new ArgumentException("State already restored.", "state"); + + int count = 1; + InternalGraphicsState top = _stack.Pop(); + top.Popped(); + while (top != state) + { + count++; + state.Invalid = true; + top = _stack.Pop(); + top.Popped(); + } + state.Invalid = true; + return count; + } + + public InternalGraphicsState Current + { + get + { + if (_stack.Count == 0) + return _current; + return _stack.Peek(); + } + } + + readonly InternalGraphicsState _current; + + readonly Stack _stack = new Stack(); + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing/IXGraphicsRenderer.cs b/PdfSharp/Drawing/IXGraphicsRenderer.cs new file mode 100644 index 0000000..9e47f63 --- /dev/null +++ b/PdfSharp/Drawing/IXGraphicsRenderer.cs @@ -0,0 +1,190 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Represents an abstract drawing surface for PdfPages. + /// + internal interface IXGraphicsRenderer + { + void Close(); + + #region Drawing + + ///// + ///// Fills the entire drawing surface with the specified color. + ///// + //[Obsolete("Will be removed.")] + //void Clear(XColor color); + + /// + /// Draws a straight line. + /// + void DrawLine(XPen pen, double x1, double y1, double x2, double y2); + + /// + /// Draws a series of straight lines. + /// + void DrawLines(XPen pen, XPoint[] points); + + /// + /// Draws a Bzier spline. + /// + void DrawBezier(XPen pen, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4); + + /// + /// Draws a series of Bzier splines. + /// + void DrawBeziers(XPen pen, XPoint[] points); + + /// + /// Draws a cardinal spline. + /// + void DrawCurve(XPen pen, XPoint[] points, double tension); + + /// + /// Draws an arc. + /// + void DrawArc(XPen pen, double x, double y, double width, double height, double startAngle, double sweepAngle); + + /// + /// Draws a rectangle. + /// + void DrawRectangle(XPen pen, XBrush brush, double x, double y, double width, double height); + + /// + /// Draws a series of rectangles. + /// + void DrawRectangles(XPen pen, XBrush brush, XRect[] rects); + + /// + /// Draws a rectangle with rounded corners. + /// + void DrawRoundedRectangle(XPen pen, XBrush brush, double x, double y, double width, double height, double ellipseWidth, double ellipseHeight); + + /// + /// Draws an ellipse. + /// + void DrawEllipse(XPen pen, XBrush brush, double x, double y, double width, double height); + + /// + /// Draws a polygon. + /// + void DrawPolygon(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode); + + /// + /// Draws a pie. + /// + void DrawPie(XPen pen, XBrush brush, double x, double y, double width, double height, double startAngle, double sweepAngle); + + /// + /// Draws a cardinal spline. + /// + void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points, double tension, XFillMode fillmode); + + /// + /// Draws a graphical path. + /// + void DrawPath(XPen pen, XBrush brush, XGraphicsPath path); + + /// + /// Draws a series of glyphs identified by the specified text and font. + /// + void DrawString(string s, XFont font, XBrush brush, XRect layoutRectangle, XStringFormat format); + + /// + /// Draws an image. + /// + void DrawImage(XImage image, double x, double y, double width, double height); + void DrawImage(XImage image, XRect destRect, XRect srcRect, XGraphicsUnit srcUnit); + + #endregion + + #region Save and Restore + + /// + /// Saves the current graphics state without changing it. + /// + void Save(XGraphicsState state); + + /// + /// Restores the specified graphics state. + /// + void Restore(XGraphicsState state); + + /// + /// + /// + void BeginContainer(XGraphicsContainer container, XRect dstrect, XRect srcrect, XGraphicsUnit unit); + + /// + /// + /// + void EndContainer(XGraphicsContainer container); + + #endregion + + #region Transformation + + /// + /// Gets or sets the transformation matrix. + /// + //XMatrix Transform {get; set;} + + void AddTransform(XMatrix transform, XMatrixOrder matrixOrder); + + #endregion + + #region Clipping + + void SetClip(XGraphicsPath path, XCombineMode combineMode); + + void ResetClip(); + + #endregion + + #region Miscellaneous + + /// + /// Writes a comment to the output stream. Comments have no effect on the rendering of the output. + /// + void WriteComment(string comment); + + #endregion + } +} diff --git a/PdfSharp/Drawing/ImageHelper.cs b/PdfSharp/Drawing/ImageHelper.cs new file mode 100644 index 0000000..c4accdc --- /dev/null +++ b/PdfSharp/Drawing/ImageHelper.cs @@ -0,0 +1,136 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.IO; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Imaging; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Helper class for processing image files. + /// + static class ImageHelper + { +#if WPF && GDI + /// + /// Creates a WPF bitmap source from an GDI image. + /// + public static BitmapSource CreateBitmapSource(Image image) + { + MemoryStream stream = new MemoryStream(); + //int width = image.Width; + //int height = image.Height; + //double dpiX = image.HorizontalResolution; + //double dpiY = image.VerticalResolution; + //System.Windows.Media.PixelFormat pixelformat = PixelFormats.Default; + BitmapSource bitmapSource = null; + + try + { + string guid = image.RawFormat.Guid.ToString("B").ToUpper(); + switch (guid) + { + case "{B96B3CAA-0728-11D3-9D7B-0000F81EF32E}": // memoryBMP + case "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}": // bmp + image.Save(stream, ImageFormat.Bmp); + stream.Position = 0; + BmpBitmapDecoder bmpDecoder = new BmpBitmapDecoder(stream, BitmapCreateOptions.None, BitmapCacheOption.Default); + bitmapSource = bmpDecoder.Frames[0]; + break; + + case "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}": // png + image.Save(stream, ImageFormat.Png); + stream.Position = 0; + PngBitmapDecoder pngDecoder = new PngBitmapDecoder(stream, BitmapCreateOptions.None, BitmapCacheOption.Default); + bitmapSource = pngDecoder.Frames[0]; + break; + + case "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}": // jpeg + image.Save(stream, ImageFormat.Jpeg); + JpegBitmapDecoder jpegDecoder = new JpegBitmapDecoder(stream, BitmapCreateOptions.None, BitmapCacheOption.Default); + stream.Position = 0; + bitmapSource = jpegDecoder.Frames[0]; + break; + + case "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}": // gif + image.Save(stream, ImageFormat.Gif); + GifBitmapDecoder gifDecoder = new GifBitmapDecoder(stream, BitmapCreateOptions.None, BitmapCacheOption.Default); + stream.Position = 0; + bitmapSource = gifDecoder.Frames[0]; + break; + + case "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}": // tiff + image.Save(stream, ImageFormat.Tiff); + TiffBitmapDecoder tiffDecoder = new TiffBitmapDecoder(stream, BitmapCreateOptions.None, BitmapCacheOption.Default); + stream.Position = 0; + bitmapSource = tiffDecoder.Frames[0]; + break; + + case "{B96B3CB5-0728-11D3-9D7B-0000F81EF32E}": // icon + image.Save(stream, ImageFormat.Icon); + IconBitmapDecoder iconDecoder = new IconBitmapDecoder(stream, BitmapCreateOptions.None, BitmapCacheOption.Default); + stream.Position = 0; + bitmapSource = iconDecoder.Frames[0]; + break; + + case "{B96B3CAC-0728-11D3-9D7B-0000F81EF32E}": // emf + case "{B96B3CAD-0728-11D3-9D7B-0000F81EF32E}": // wmf + case "{B96B3CB2-0728-11D3-9D7B-0000F81EF32E}": // exif + case "{B96B3CB3-0728-11D3-9D7B-0000F81EF32E}": // photoCD + case "{B96B3CB4-0728-11D3-9D7B-0000F81EF32E}": // flashPIX + + default: + throw new InvalidOperationException("Unsupported image format."); + } + } + catch (Exception ex) + { + Debug.WriteLine("ImageHelper.CreateBitmapSource failed:" + ex.Message); + } + finally + { + //if (stream != null) + // stream.Close(); + } + return bitmapSource; + } +#endif + } +} diff --git a/PdfSharp/Drawing/InternalGraphicsState.cs b/PdfSharp/Drawing/InternalGraphicsState.cs new file mode 100644 index 0000000..f3a06ae --- /dev/null +++ b/PdfSharp/Drawing/InternalGraphicsState.cs @@ -0,0 +1,192 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing +{ + // In GDI+ the functions Save/Restore, BeginContainer/EndContainer, Transform, SetClip and ResetClip + // can be combined in any order. E.g. you can set a clip region, save the graphics state, empty the + // clip region and draw without clipping. Then you can restore to the previous clip region. With PDF + // this behavior is hard to implement. To solve this problem I first an automaton that keeps track + // of all clipping paths and the current transformation when the clip path was set. The automation + // manages a PDF graphics state stack to calculate the desired bahaviour. It also takes into consideration + // not to multiply with inverse matrixes when the user sets a new transformation matrix. + // After the design works on pager I decided not to implement it because it is much to large-scale. + // Instead I lay down some rules how to use the XGraphics class. + // + // * Before you set a transformation matrix save the graphics state (Save) or begin a new container + // (BeginContainer). + // + // * Instead of resetting the transformation matrix, call Restore or EndContainer. If you reset the + // transformation, in PDF must be multiplied with the inverse matrix. That leads to round off errors + // because in PDF file only 3 digits are used and Acrobat internally uses fixed point numbers (until + // versioin 6 or 7 I think). + // + // * When no clip path is defined, you can set or intersect a new path. + // + // * When a clip path is already defined, you can always intersect with a new one (wich leads in general + // to a smaller clip region). + // + // * When a clip path is already defined, you can only reset it to the empty region (ResetClip) when + // the graphics state stack is at the same position as it had when the clip path was defined. Otherwise + // an error occurs. + // + // Keeping these rules leads to easy to read code and best results in PDF output. + + /// + /// Represents the internal state of an XGraphics object. + /// Used when the state is saved and restored. + /// + internal class InternalGraphicsState + { + public InternalGraphicsState(XGraphics gfx) + { + _gfx = gfx; + } + + public InternalGraphicsState(XGraphics gfx, XGraphicsState state) + { + _gfx = gfx; + State = state; + State.InternalState = this; + } + + public InternalGraphicsState(XGraphics gfx, XGraphicsContainer container) + { + _gfx = gfx; + container.InternalState = this; + } + + /// + /// Gets or sets the current transformation matrix. + /// + public XMatrix Transform + { + get { return _transform; } + set { _transform = value; } + } + XMatrix _transform; + + /// + /// Called after this instanced was pushed on the internal graphics stack. + /// + public void Pushed() + { +#if GDI + // Nothing to do. +#endif +#if WPF && !SILVERLIGHT + // Nothing to do. +#endif +#if SILVERLIGHT + // Save current level of Canvas stack. + _stackLevel = _gfx._dc.Level; + // Create new Canvas for subsequent UIElements. + _gfx._dc.PushCanvas(); +#endif + } + + /// + /// Called after this instanced was popped from the internal graphics stack. + /// + public void Popped() + { + Invalid = true; +#if GDI + // Nothing to do. +#endif +#if WPF && !SILVERLIGHT + // Pop all objects pushed in this state. + if (_gfx.TargetContext == XGraphicTargetContext.WPF) + { + for (int idx = 0; idx < _transformPushLevel; idx++) + _gfx._dc.Pop(); + _transformPushLevel = 0; + for (int idx = 0; idx < _geometryPushLevel; idx++) + _gfx._dc.Pop(); + _geometryPushLevel = 0; + } +#endif +#if SILVERLIGHT + // Pop all Canvas objects created in this state. + _gfx._dc.Pop(_gfx._dc.Level - _stackLevel); +#endif + } + + public bool Invalid; + +#if GDI_ + /// + /// The GDI+ GraphicsState if contructed from XGraphicsState. + /// + public GraphicsState GdiGraphicsState; +#endif + +#if WPF && !SILVERLIGHT + public void PushTransform(MatrixTransform transform) + { + _gfx._dc.PushTransform(transform); + _transformPushLevel++; + } + int _transformPushLevel; + + public void PushClip(Geometry geometry) + { + _gfx._dc.PushClip(geometry); + _geometryPushLevel++; + } + int _geometryPushLevel; +#endif + +#if SILVERLIGHT + public void PushTransform(MatrixTransform transform) + { + _gfx._dc.PushTransform(transform); + } + + public void PushClip(Geometry geometry) + { + _gfx._dc.PushClip(geometry); + } + + int _stackLevel; +#endif + + readonly XGraphics _gfx; + + internal XGraphicsState State; + } +} diff --git a/PdfSharp/Drawing/PdfFontOptions.cs b/PdfSharp/Drawing/PdfFontOptions.cs new file mode 100644 index 0000000..312df9a --- /dev/null +++ b/PdfSharp/Drawing/PdfFontOptions.cs @@ -0,0 +1,108 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows.Media; +#endif +using PdfSharp.Pdf; + +namespace PdfSharp.Drawing +{ + /// + /// Specifies details about how the font is used in PDF creation. + /// + public class XPdfFontOptions + { + internal XPdfFontOptions() { } + + /// + /// Initializes a new instance of the class. + /// + [Obsolete("Must not specify an embedding option anymore.")] + public XPdfFontOptions(PdfFontEncoding encoding, PdfFontEmbedding embedding) + { + _fontEncoding = encoding; + } + + /// + /// Initializes a new instance of the class. + /// + public XPdfFontOptions(PdfFontEncoding encoding) + { + _fontEncoding = encoding; + } + + /// + /// Initializes a new instance of the class. + /// + [Obsolete("Must not specify an embedding option anymore.")] + public XPdfFontOptions(PdfFontEmbedding embedding) + { + _fontEncoding = PdfFontEncoding.WinAnsi; + } + + /// + /// Gets a value indicating the font embedding. + /// + public PdfFontEmbedding FontEmbedding + { + get { return PdfFontEmbedding.Always; } + } + + /// + /// Gets a value indicating how the font is encoded. + /// + public PdfFontEncoding FontEncoding + { + get { return _fontEncoding; } + } + readonly PdfFontEncoding _fontEncoding; + + /// + /// Gets the default options with WinAnsi encoding and always font embedding. + /// + public static XPdfFontOptions WinAnsiDefault + { + get { return new XPdfFontOptions(PdfFontEncoding.WinAnsi); } + } + + /// + /// Gets the default options with Unicode encoding and always font embedding. + /// + public static XPdfFontOptions UnicodeDefault + { + get { return new XPdfFontOptions(PdfFontEncoding.Unicode); } + } + } +} diff --git a/PdfSharp/Drawing/XBitmapDecoder.cs b/PdfSharp/Drawing/XBitmapDecoder.cs new file mode 100644 index 0000000..127fdf0 --- /dev/null +++ b/PdfSharp/Drawing/XBitmapDecoder.cs @@ -0,0 +1,70 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if CORE +#endif +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Imaging; +#endif +#if NETFX_CORE +using Windows.UI.Xaml.Media.Imaging; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Provides functionality to load a bitmap image encoded in a specific format. + /// + public class XBitmapDecoder + { + internal XBitmapDecoder() + { } + + /// + /// Gets a new instance of the PNG image decoder. + /// + public static XBitmapDecoder GetPngDecoder() + { + return new XPngBitmapDecoder(); + } + } + + internal sealed class XPngBitmapDecoder : XBitmapDecoder + { + internal XPngBitmapDecoder() + { } + } +} diff --git a/PdfSharp/Drawing/XBitmapEncoder.cs b/PdfSharp/Drawing/XBitmapEncoder.cs new file mode 100644 index 0000000..ae877b0 --- /dev/null +++ b/PdfSharp/Drawing/XBitmapEncoder.cs @@ -0,0 +1,122 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.IO; +using PdfSharp.Internal; +#if CORE +#endif +#if CORE_WITH_GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +#endif +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Imaging; +#endif +#if NETFX_CORE +using Windows.UI.Xaml.Media.Imaging; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Provides functionality to save a bitmap image in a specific format. + /// + public abstract class XBitmapEncoder + { + internal XBitmapEncoder() + { + // Prevent external deriving. + } + + /// + /// Gets a new instance of the PNG image encoder. + /// + public static XBitmapEncoder GetPngEncoder() + { + return new XPngBitmapEncoder(); + } + + /// + /// Gets or sets the bitmap source to be encoded. + /// + public XBitmapSource Source + { + get { return _source; } + set { _source = value; } + } + XBitmapSource _source; + + /// + /// When overridden in a derived class saves the image on the specified stream + /// in the respective format. + /// + public abstract void Save(Stream stream); + } + + internal sealed class XPngBitmapEncoder : XBitmapEncoder + { + internal XPngBitmapEncoder() + { } + + /// + /// Saves the image on the specified stream in PNG format. + /// + public override void Save(Stream stream) + { + if (Source == null) + throw new InvalidOperationException("No image source."); +#if CORE_WITH_GDI || GDI + if (Source.AssociatedGraphics != null) + { + Source.DisassociateWithGraphics(); + Debug.Assert(Source.AssociatedGraphics == null); + } + try + { + Lock.EnterGdiPlus(); + Source._gdiImage.Save(stream, ImageFormat.Png); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF + DiagnosticsHelper.ThrowNotImplementedException("Save..."); +#endif + } + } +} diff --git a/PdfSharp/Drawing/XBitmapImage.cs b/PdfSharp/Drawing/XBitmapImage.cs new file mode 100644 index 0000000..cf3b730 --- /dev/null +++ b/PdfSharp/Drawing/XBitmapImage.cs @@ -0,0 +1,109 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if CORE +#endif +#if CORE_WITH_GDI +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +using PdfSharp.Internal; + +#endif +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +using PdfSharp.Internal; + +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Imaging; +#if !GDI +using PdfSharp.Internal; +#endif + +#endif +#if NETFX_CORE +using Windows.UI.Xaml.Media.Imaging; +using PdfSharp.Internal; + +#endif + +// WPFHACK +#pragma warning disable 0169 +#pragma warning disable 0649 + +namespace PdfSharp.Drawing +{ + /// + /// Defines a pixel based bitmap image. + /// + public sealed class XBitmapImage : XBitmapSource + { + // TODO: Move code from XImage to this class. + + /// + /// Initializes a new instance of the class. + /// + internal XBitmapImage(int width, int height) + { +#if GDI || CORE_WITH_GDI + try + { + Lock.EnterGdiPlus(); + // Create a default 24 bit ARGB bitmap. + _gdiImage = new Bitmap(width, height); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF + DiagnosticsHelper.ThrowNotImplementedException("CreateBitmap"); +#endif +#if NETFX_CORE + DiagnosticsHelper.ThrowNotImplementedException("CreateBitmap"); +#endif +#if CORE || GDI && !WPF // Prevent unreachable code error + Initialize(); +#endif + } + + /// + /// Creates a default 24 bit ARGB bitmap with the specified pixel size. + /// + public static XBitmapSource CreateBitmap(int width, int height) + { + // Create a default 24 bit ARGB bitmap. + return new XBitmapImage(width, height); + } + } +} diff --git a/PdfSharp/Drawing/XBitmapSource.cs b/PdfSharp/Drawing/XBitmapSource.cs new file mode 100644 index 0000000..1c26cc3 --- /dev/null +++ b/PdfSharp/Drawing/XBitmapSource.cs @@ -0,0 +1,123 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if CORE +#endif + +using System.Diagnostics; +using PdfSharp.Internal; + +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Imaging; +#endif +#if NETFX_CORE +using Windows.UI.Xaml.Media.Imaging; +#endif + +// WPFHACK +#pragma warning disable 0169 +#pragma warning disable 0649 + +namespace PdfSharp.Drawing +{ + /// + /// Defines an abstract base class for pixel based images. + /// + public abstract class XBitmapSource : XImage + { + // TODO: Move code from XImage to this class. + + /// + /// Gets the width of the image in pixels. + /// + public override int PixelWidth + { + get + { +#if (CORE_WITH_GDI || GDI) && !WPF + try + { + Lock.EnterGdiPlus(); + return _gdiImage.Width; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if GDI && WPF + int gdiWidth = _gdiImage.Width; + int wpfWidth = _wpfImage.PixelWidth; + Debug.Assert(gdiWidth == wpfWidth); + return wpfWidth; +#endif +#if WPF && !GDI + return _wpfImage.PixelWidth; +#endif +#if NETFX_CORE || UWP + return _wrtImage.PixelWidth; +#endif + } + } + + /// + /// Gets the height of the image in pixels. + /// + public override int PixelHeight + { + get + { +#if (CORE_WITH_GDI || GDI) && !WPF + try + { + Lock.EnterGdiPlus(); + return _gdiImage.Height; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if GDI && WPF + int gdiHeight = _gdiImage.Height; + int wpfHeight = _wpfImage.PixelHeight; + Debug.Assert(gdiHeight == wpfHeight); + return wpfHeight; +#endif +#if WPF && !GDI + return _wpfImage.PixelHeight; +#endif +#if NETFX_CORE || UWP + return _wrtImage.PixelHeight; +#endif + } + } + } +} diff --git a/PdfSharp/Drawing/XBrush.cs b/PdfSharp/Drawing/XBrush.cs new file mode 100644 index 0000000..60374bc --- /dev/null +++ b/PdfSharp/Drawing/XBrush.cs @@ -0,0 +1,87 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows.Media; +#endif +#if UWP +using Microsoft.Graphics.Canvas.Brushes; +using UwpColor = Windows.UI.Color; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Classes derived from this abstract base class define objects used to fill the + /// interiors of paths. + /// + public abstract class XBrush + { +#if GDI + internal abstract System.Drawing.Brush RealizeGdiBrush(); + +#if UseGdiObjects + /// + /// Converts from a System.Drawing.Brush. + /// + public static implicit operator XBrush(Brush brush) + { + XBrush xbrush; + SolidBrush solidBrush; + LinearGradientBrush lgBrush; + if ((solidBrush = brush as SolidBrush) != null) + { + xbrush = new XSolidBrush(solidBrush.Color); + } + else if ((lgBrush = brush as LinearGradientBrush) != null) + { + // TODO: xbrush = new LinearGradientBrush(lgBrush.Rectangle, lgBrush.co(solidBrush.Color); + throw new NotImplementedException("Brush type not yet supported by PDFsharp."); + } + else + { + throw new NotImplementedException("Brush type not supported by PDFsharp."); + } + return xbrush; + } +#endif +#endif +#if WPF + internal abstract System.Windows.Media.Brush RealizeWpfBrush(); +#endif +#if UWP + internal abstract ICanvasBrush RealizeCanvasBrush(); +#endif + } +} diff --git a/PdfSharp/Drawing/XBrushes.cs b/PdfSharp/Drawing/XBrushes.cs new file mode 100644 index 0000000..2466ad2 --- /dev/null +++ b/PdfSharp/Drawing/XBrushes.cs @@ -0,0 +1,1595 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// ReSharper disable UnusedMember.Global + +#define USE_CACHE_is_not_thread_safe + +namespace PdfSharp.Drawing +{ + /// + /// Brushes for all the pre-defined colors. + /// + public static class XBrushes + { + /// Gets a pre-defined XBrush object. + public static XSolidBrush AliceBlue + { +#if USE_CACHE + get { return _aliceBlue ?? (_aliceBlue = new XSolidBrush(XColors.AliceBlue, true)); } +#else + get { return new XSolidBrush(XColors.AliceBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush AntiqueWhite + { +#if USE_CACHE + get { return _antiqueWhite ?? (_antiqueWhite = new XSolidBrush(XColors.AntiqueWhite, true)); } +#else + get { return new XSolidBrush(XColors.AntiqueWhite, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Aqua + { +#if USE_CACHE + get { return _aqua ?? (_aqua = new XSolidBrush(XColors.Aqua, true)); } +#else + get { return new XSolidBrush(XColors.Aqua, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Aquamarine + { +#if USE_CACHE + get { return _aquamarine ?? (_aquamarine = new XSolidBrush(XColors.Aquamarine, true)); } +#else + get { return new XSolidBrush(XColors.Aquamarine, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Azure + { +#if USE_CACHE + get { return _azure ?? (_azure = new XSolidBrush(XColors.Azure, true)); } +#else + get { return new XSolidBrush(XColors.Azure, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Beige + { +#if USE_CACHE + get { return _beige ?? (_beige = new XSolidBrush(XColors.Beige, true)); } +#else + get { return new XSolidBrush(XColors.Beige, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Bisque + { +#if USE_CACHE + get { return _bisque ?? (_bisque = new XSolidBrush(XColors.Bisque, true)); } +#else + get { return new XSolidBrush(XColors.Bisque, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Black + { +#if USE_CACHE + get { return _black ?? (_black = new XSolidBrush(XColors.Black, true)); } +#else + get { return new XSolidBrush(XColors.Black, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush BlanchedAlmond + { +#if USE_CACHE + get { return _blanchedAlmond ?? (_blanchedAlmond = new XSolidBrush(XColors.BlanchedAlmond, true)); } +#else + get { return new XSolidBrush(XColors.BlanchedAlmond, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Blue + { +#if USE_CACHE + get { return _blue ?? (_blue = new XSolidBrush(XColors.Blue, true)); } +#else + get { return new XSolidBrush(XColors.Blue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush BlueViolet + { +#if USE_CACHE + get { return _blueViolet ?? (_blueViolet = new XSolidBrush(XColors.BlueViolet, true)); } +#else + get { return new XSolidBrush(XColors.BlueViolet, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Brown + { +#if USE_CACHE + get { return _brown ?? (_brown = new XSolidBrush(XColors.Brown, true)); } +#else + get { return new XSolidBrush(XColors.Brown, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush BurlyWood + { +#if USE_CACHE + get { return _burlyWood ?? (_burlyWood = new XSolidBrush(XColors.BurlyWood, true)); } +#else + get { return new XSolidBrush(XColors.BurlyWood, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush CadetBlue + { +#if USE_CACHE + get { return _cadetBlue ?? (_cadetBlue = new XSolidBrush(XColors.CadetBlue, true)); } +#else + get { return new XSolidBrush(XColors.CadetBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Chartreuse + { +#if USE_CACHE + get { return _chartreuse ?? (_chartreuse = new XSolidBrush(XColors.Chartreuse, true)); } +#else + get { return new XSolidBrush(XColors.Chartreuse, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Chocolate + { +#if USE_CACHE + get { return _chocolate ?? (_chocolate = new XSolidBrush(XColors.Chocolate, true)); } +#else + get { return new XSolidBrush(XColors.Chocolate, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Coral + { +#if USE_CACHE + get { return _coral ?? (_coral = new XSolidBrush(XColors.Coral, true)); } +#else + get { return new XSolidBrush(XColors.Coral, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush CornflowerBlue + { +#if USE_CACHE + get { return _cornflowerBlue ?? (_cornflowerBlue = new XSolidBrush(XColors.CornflowerBlue, true)); } +#else + get { return new XSolidBrush(XColors.CornflowerBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Cornsilk + { +#if USE_CACHE + get { return _cornsilk ?? (_cornsilk = new XSolidBrush(XColors.Cornsilk, true)); } +#else + get { return new XSolidBrush(XColors.Cornsilk, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Crimson + { +#if USE_CACHE + get { return _crimson ?? (_crimson = new XSolidBrush(XColors.Crimson, true)); } +#else + get { return new XSolidBrush(XColors.Crimson, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Cyan + { +#if USE_CACHE + get { return _cyan ?? (_cyan = new XSolidBrush(XColors.Cyan, true)); } +#else + get { return new XSolidBrush(XColors.Cyan, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkBlue + { +#if USE_CACHE + get { return _darkBlue ?? (_darkBlue = new XSolidBrush(XColors.DarkBlue, true)); } +#else + get { return new XSolidBrush(XColors.DarkBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkCyan + { +#if USE_CACHE + get { return _darkCyan ?? (_darkCyan = new XSolidBrush(XColors.DarkCyan, true)); } +#else + get { return new XSolidBrush(XColors.DarkCyan, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkGoldenrod + { +#if USE_CACHE + get { return _darkGoldenrod ?? (_darkGoldenrod = new XSolidBrush(XColors.DarkGoldenrod, true)); } +#else + get { return new XSolidBrush(XColors.DarkGoldenrod, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkGray + { +#if USE_CACHE + get { return _darkGray ?? (_darkGray = new XSolidBrush(XColors.DarkGray, true)); } +#else + get { return new XSolidBrush(XColors.DarkGray, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkGreen + { +#if USE_CACHE + get { return _darkGreen ?? (_darkGreen = new XSolidBrush(XColors.DarkGreen, true)); } +#else + get { return new XSolidBrush(XColors.DarkGreen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkKhaki + { +#if USE_CACHE + get { return _darkKhaki ?? (_darkKhaki = new XSolidBrush(XColors.DarkKhaki, true)); } +#else + get { return new XSolidBrush(XColors.DarkKhaki, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkMagenta + { +#if USE_CACHE + get { return _darkMagenta ?? (_darkMagenta = new XSolidBrush(XColors.DarkMagenta, true)); } +#else + get { return new XSolidBrush(XColors.DarkMagenta, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkOliveGreen + { +#if USE_CACHE + get { return _darkOliveGreen ?? (_darkOliveGreen = new XSolidBrush(XColors.DarkOliveGreen, true)); } +#else + get { return new XSolidBrush(XColors.DarkOliveGreen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkOrange + { +#if USE_CACHE + get { return _darkOrange ?? (_darkOrange = new XSolidBrush(XColors.DarkOrange, true)); } +#else + get { return new XSolidBrush(XColors.DarkOrange, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkOrchid + { +#if USE_CACHE + get { return _darkOrchid ?? (_darkOrchid = new XSolidBrush(XColors.DarkOrchid, true)); } +#else + get { return new XSolidBrush(XColors.DarkOrchid, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkRed + { +#if USE_CACHE + get { return _darkRed ?? (_darkRed = new XSolidBrush(XColors.DarkRed, true)); } +#else + get { return new XSolidBrush(XColors.DarkRed, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkSalmon + { +#if USE_CACHE + get { return _darkSalmon ?? (_darkSalmon = new XSolidBrush(XColors.DarkSalmon, true)); } +#else + get { return new XSolidBrush(XColors.DarkSalmon, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkSeaGreen + { +#if USE_CACHE + get { return _darkSeaGreen ?? (_darkSeaGreen = new XSolidBrush(XColors.DarkSeaGreen, true)); } +#else + get { return new XSolidBrush(XColors.DarkSeaGreen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkSlateBlue + { +#if USE_CACHE + get { return _darkSlateBlue ?? (_darkSlateBlue = new XSolidBrush(XColors.DarkSlateBlue, true)); } +#else + get { return new XSolidBrush(XColors.DarkSlateBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkSlateGray + { +#if USE_CACHE + get { return _darkSlateGray ?? (_darkSlateGray = new XSolidBrush(XColors.DarkSlateGray, true)); } +#else + get { return new XSolidBrush(XColors.DarkSlateGray, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkTurquoise + { +#if USE_CACHE + get { return _darkTurquoise ?? (_darkTurquoise = new XSolidBrush(XColors.DarkTurquoise, true)); } +#else + get { return new XSolidBrush(XColors.DarkTurquoise, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DarkViolet + { +#if USE_CACHE + get { return _darkViolet ?? (_darkViolet = new XSolidBrush(XColors.DarkViolet, true)); } +#else + get { return new XSolidBrush(XColors.DarkViolet, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DeepPink + { +#if USE_CACHE + get { return _deepPink ?? (_deepPink = new XSolidBrush(XColors.DeepPink, true)); } +#else + get { return new XSolidBrush(XColors.DeepPink, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DeepSkyBlue + { +#if USE_CACHE + get { return _deepSkyBlue ?? (_deepSkyBlue = new XSolidBrush(XColors.DeepSkyBlue, true)); } +#else + get { return new XSolidBrush(XColors.DeepSkyBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DimGray + { +#if USE_CACHE + get { return _dimGray ?? (_dimGray = new XSolidBrush(XColors.DimGray, true)); } +#else + get { return new XSolidBrush(XColors.DimGray, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush DodgerBlue + { +#if USE_CACHE + get { return _dodgerBlue ?? (_dodgerBlue = new XSolidBrush(XColors.DodgerBlue, true)); } +#else + get { return new XSolidBrush(XColors.DodgerBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Firebrick + { +#if USE_CACHE + get { return _firebrick ?? (_firebrick = new XSolidBrush(XColors.Firebrick, true)); } +#else + get { return new XSolidBrush(XColors.Firebrick, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush FloralWhite + { +#if USE_CACHE + get { return _floralWhite ?? (_floralWhite = new XSolidBrush(XColors.FloralWhite, true)); } +#else + get { return new XSolidBrush(XColors.FloralWhite, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush ForestGreen + { +#if USE_CACHE + get { return _forestGreen ?? (_forestGreen = new XSolidBrush(XColors.ForestGreen, true)); } +#else + get { return new XSolidBrush(XColors.ForestGreen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Fuchsia + { +#if USE_CACHE + get { return _fuchsia ?? (_fuchsia = new XSolidBrush(XColors.Fuchsia, true)); } +#else + get { return new XSolidBrush(XColors.Fuchsia, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Gainsboro + { +#if USE_CACHE + get { return _gainsboro ?? (_gainsboro = new XSolidBrush(XColors.Gainsboro, true)); } +#else + get { return new XSolidBrush(XColors.Gainsboro, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush GhostWhite + { +#if USE_CACHE + get { return _ghostWhite ?? (_ghostWhite = new XSolidBrush(XColors.GhostWhite, true)); } +#else + get { return new XSolidBrush(XColors.GhostWhite, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Gold + { +#if USE_CACHE + get { return _gold ?? (_gold = new XSolidBrush(XColors.Gold, true)); } +#else + get { return new XSolidBrush(XColors.Gold, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Goldenrod + { +#if USE_CACHE + get { return _goldenrod ?? (_goldenrod = new XSolidBrush(XColors.Goldenrod, true)); } +#else + get { return new XSolidBrush(XColors.Goldenrod, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Gray + { +#if USE_CACHE + get { return _gray ?? (_gray = new XSolidBrush(XColors.Gray, true)); } +#else + get { return new XSolidBrush(XColors.Gray, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Green + { +#if USE_CACHE + get { return _green ?? (_green = new XSolidBrush(XColors.Green, true)); } +#else + get { return new XSolidBrush(XColors.Green, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush GreenYellow + { +#if USE_CACHE + get { return _greenYellow ?? (_greenYellow = new XSolidBrush(XColors.GreenYellow, true)); } +#else + get { return new XSolidBrush(XColors.GreenYellow, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Honeydew + { +#if USE_CACHE + get { return _honeydew ?? (_honeydew = new XSolidBrush(XColors.Honeydew, true)); } +#else + get { return new XSolidBrush(XColors.Honeydew, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush HotPink + { +#if USE_CACHE + get { return _hotPink ?? (_hotPink = new XSolidBrush(XColors.HotPink, true)); } +#else + get { return new XSolidBrush(XColors.HotPink, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush IndianRed + { +#if USE_CACHE + get { return _indianRed ?? (_indianRed = new XSolidBrush(XColors.IndianRed, true)); } +#else + get { return new XSolidBrush(XColors.IndianRed, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Indigo + { +#if USE_CACHE + get { return _indigo ?? (_indigo = new XSolidBrush(XColors.Indigo, true)); } +#else + get { return new XSolidBrush(XColors.Indigo, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Ivory + { +#if USE_CACHE + get { return _ivory ?? (_ivory = new XSolidBrush(XColors.Ivory, true)); } +#else + get { return new XSolidBrush(XColors.Ivory, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Khaki + { +#if USE_CACHE + get { return _khaki ?? (_khaki = new XSolidBrush(XColors.Khaki, true)); } +#else + get { return new XSolidBrush(XColors.Khaki, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Lavender + { +#if USE_CACHE + get { return _lavender ?? (_lavender = new XSolidBrush(XColors.Lavender, true)); } +#else + get { return new XSolidBrush(XColors.Lavender, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LavenderBlush + { +#if USE_CACHE + get { return _lavenderBlush ?? (_lavenderBlush = new XSolidBrush(XColors.LavenderBlush, true)); } +#else + get { return new XSolidBrush(XColors.LavenderBlush, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LawnGreen + { +#if USE_CACHE + get { return _lawnGreen ?? (_lawnGreen = new XSolidBrush(XColors.LawnGreen, true)); } +#else + get { return new XSolidBrush(XColors.LawnGreen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LemonChiffon + { +#if USE_CACHE + get { return _lemonChiffon ?? (_lemonChiffon = new XSolidBrush(XColors.LemonChiffon, true)); } +#else + get { return new XSolidBrush(XColors.LemonChiffon, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LightBlue + { +#if USE_CACHE + get { return _lightBlue ?? (_lightBlue = new XSolidBrush(XColors.LightBlue, true)); } +#else + get { return new XSolidBrush(XColors.LightBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LightCoral + { +#if USE_CACHE + get { return _lightCoral ?? (_lightCoral = new XSolidBrush(XColors.LightCoral, true)); } +#else + get { return new XSolidBrush(XColors.LightCoral, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LightCyan + { +#if USE_CACHE + get { return _lightCyan ?? (_lightCyan = new XSolidBrush(XColors.LightCyan, true)); } +#else + get { return new XSolidBrush(XColors.LightCyan, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LightGoldenrodYellow + { +#if USE_CACHE + get { return _lightGoldenrodYellow ?? (_lightGoldenrodYellow = new XSolidBrush(XColors.LightGoldenrodYellow, true)); } +#else + get { return new XSolidBrush(XColors.LightGoldenrodYellow, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LightGray + { +#if USE_CACHE + get { return _lightGray ?? (_lightGray = new XSolidBrush(XColors.LightGray, true)); } +#else + get { return new XSolidBrush(XColors.LightGray, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LightGreen + { +#if USE_CACHE + get { return _lightGreen ?? (_lightGreen = new XSolidBrush(XColors.LightGreen, true)); } +#else + get { return new XSolidBrush(XColors.LightGreen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LightPink + { +#if USE_CACHE + get { return _lightPink ?? (_lightPink = new XSolidBrush(XColors.LightPink, true)); } +#else + get { return new XSolidBrush(XColors.LightPink, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LightSalmon + { +#if USE_CACHE + get { return _lightSalmon ?? (_lightSalmon = new XSolidBrush(XColors.LightSalmon, true)); } +#else + get { return new XSolidBrush(XColors.LightSalmon, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LightSeaGreen + { +#if USE_CACHE + get { return _lightSeaGreen ?? (_lightSeaGreen = new XSolidBrush(XColors.LightSeaGreen, true)); } +#else + get { return new XSolidBrush(XColors.LightSeaGreen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LightSkyBlue + { +#if USE_CACHE + get { return _lightSkyBlue ?? (_lightSkyBlue = new XSolidBrush(XColors.LightSkyBlue, true)); } +#else + get { return new XSolidBrush(XColors.LightSkyBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LightSlateGray + { +#if USE_CACHE + get { return _lightSlateGray ?? (_lightSlateGray = new XSolidBrush(XColors.LightSlateGray, true)); } +#else + get { return new XSolidBrush(XColors.LightSlateGray, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LightSteelBlue + { +#if USE_CACHE + get { return _lightSteelBlue ?? (_lightSteelBlue = new XSolidBrush(XColors.LightSteelBlue, true)); } +#else + get { return new XSolidBrush(XColors.LightSteelBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LightYellow + { +#if USE_CACHE + get { return _lightYellow ?? (_lightYellow = new XSolidBrush(XColors.LightYellow, true)); } +#else + get { return new XSolidBrush(XColors.LightYellow, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Lime + { +#if USE_CACHE + get { return _lime ?? (_lime = new XSolidBrush(XColors.Lime, true)); } +#else + get { return new XSolidBrush(XColors.Lime, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush LimeGreen + { +#if USE_CACHE + get { return _limeGreen ?? (_limeGreen = new XSolidBrush(XColors.LimeGreen, true)); } +#else + get { return new XSolidBrush(XColors.LimeGreen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Linen + { +#if USE_CACHE + get { return _linen ?? (_linen = new XSolidBrush(XColors.Linen, true)); } +#else + get { return new XSolidBrush(XColors.Linen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Magenta + { +#if USE_CACHE + get { return _magenta ?? (_magenta = new XSolidBrush(XColors.Magenta, true)); } +#else + get { return new XSolidBrush(XColors.Magenta, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Maroon + { +#if USE_CACHE + get { return _maroon ?? (_maroon = new XSolidBrush(XColors.Maroon, true)); } +#else + get { return new XSolidBrush(XColors.Maroon, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush MediumAquamarine + { +#if USE_CACHE + get { return _mediumAquamarine ?? (_mediumAquamarine = new XSolidBrush(XColors.MediumAquamarine, true)); } +#else + get { return new XSolidBrush(XColors.MediumAquamarine, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush MediumBlue + { +#if USE_CACHE + get { return _mediumBlue ?? (_mediumBlue = new XSolidBrush(XColors.MediumBlue, true)); } +#else + get { return new XSolidBrush(XColors.MediumBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush MediumOrchid + { +#if USE_CACHE + get { return _mediumOrchid ?? (_mediumOrchid = new XSolidBrush(XColors.MediumOrchid, true)); } +#else + get { return new XSolidBrush(XColors.MediumOrchid, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush MediumPurple + { +#if USE_CACHE + get { return _mediumPurple ?? (_mediumPurple = new XSolidBrush(XColors.MediumPurple, true)); } +#else + get { return new XSolidBrush(XColors.MediumPurple, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush MediumSeaGreen + { +#if USE_CACHE + get { return _mediumSeaGreen ?? (_mediumSeaGreen = new XSolidBrush(XColors.MediumSeaGreen, true)); } +#else + get { return new XSolidBrush(XColors.MediumSeaGreen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush MediumSlateBlue + { +#if USE_CACHE + get { return _mediumSlateBlue ?? (_mediumSlateBlue = new XSolidBrush(XColors.MediumSlateBlue, true)); } +#else + get { return new XSolidBrush(XColors.MediumSlateBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush MediumSpringGreen + { +#if USE_CACHE + get { return _mediumSpringGreen ?? (_mediumSpringGreen = new XSolidBrush(XColors.MediumSpringGreen, true)); } +#else + get { return new XSolidBrush(XColors.MediumSpringGreen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush MediumTurquoise + { +#if USE_CACHE + get { return _mediumTurquoise ?? (_mediumTurquoise = new XSolidBrush(XColors.MediumTurquoise, true)); } +#else + get { return new XSolidBrush(XColors.MediumTurquoise, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush MediumVioletRed + { +#if USE_CACHE + get { return _mediumVioletRed ?? (_mediumVioletRed = new XSolidBrush(XColors.MediumVioletRed, true)); } +#else + get { return new XSolidBrush(XColors.MediumVioletRed, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush MidnightBlue + { +#if USE_CACHE + get { return _midnightBlue ?? (_midnightBlue = new XSolidBrush(XColors.MidnightBlue, true)); } +#else + get { return new XSolidBrush(XColors.MidnightBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush MintCream + { +#if USE_CACHE + get { return _mintCream ?? (_mintCream = new XSolidBrush(XColors.MintCream, true)); } +#else + get { return new XSolidBrush(XColors.MintCream, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush MistyRose + { +#if USE_CACHE + get { return _mistyRose ?? (_mistyRose = new XSolidBrush(XColors.MistyRose, true)); } +#else + get { return new XSolidBrush(XColors.MistyRose, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Moccasin + { +#if USE_CACHE + get { return _moccasin ?? (_moccasin = new XSolidBrush(XColors.Moccasin, true)); } +#else + get { return new XSolidBrush(XColors.Moccasin, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush NavajoWhite + { +#if USE_CACHE + get { return _navajoWhite ?? (_navajoWhite = new XSolidBrush(XColors.NavajoWhite, true)); } +#else + get { return new XSolidBrush(XColors.NavajoWhite, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Navy + { +#if USE_CACHE + get { return _navy ?? (_navy = new XSolidBrush(XColors.Navy, true)); } +#else + get { return new XSolidBrush(XColors.Navy, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush OldLace + { +#if USE_CACHE + get { return _oldLace ?? (_oldLace = new XSolidBrush(XColors.OldLace, true)); } +#else + get { return new XSolidBrush(XColors.OldLace, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Olive + { +#if USE_CACHE + get { return _olive ?? (_olive = new XSolidBrush(XColors.Olive, true)); } +#else + get { return new XSolidBrush(XColors.Olive, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush OliveDrab + { +#if USE_CACHE + get { return _oliveDrab ?? (_oliveDrab = new XSolidBrush(XColors.OliveDrab, true)); } +#else + get { return new XSolidBrush(XColors.OliveDrab, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Orange + { +#if USE_CACHE + get { return _orange ?? (_orange = new XSolidBrush(XColors.Orange, true)); } +#else + get { return new XSolidBrush(XColors.Orange, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush OrangeRed + { +#if USE_CACHE + get { return _orangeRed ?? (_orangeRed = new XSolidBrush(XColors.OrangeRed, true)); } +#else + get { return new XSolidBrush(XColors.OrangeRed, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Orchid + { +#if USE_CACHE + get { return _orchid ?? (_orchid = new XSolidBrush(XColors.Orchid, true)); } +#else + get { return new XSolidBrush(XColors.Orchid, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush PaleGoldenrod + { +#if USE_CACHE + get { return _paleGoldenrod ?? (_paleGoldenrod = new XSolidBrush(XColors.PaleGoldenrod, true)); } +#else + get { return new XSolidBrush(XColors.PaleGoldenrod, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush PaleGreen + { +#if USE_CACHE + get { return _paleGreen ?? (_paleGreen = new XSolidBrush(XColors.PaleGreen, true)); } +#else + get { return new XSolidBrush(XColors.PaleGreen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush PaleTurquoise + { +#if USE_CACHE + get { return _paleTurquoise ?? (_paleTurquoise = new XSolidBrush(XColors.PaleTurquoise, true)); } +#else + get { return new XSolidBrush(XColors.PaleTurquoise, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush PaleVioletRed + { +#if USE_CACHE + get { return _paleVioletRed ?? (_paleVioletRed = new XSolidBrush(XColors.PaleVioletRed, true)); } +#else + get { return new XSolidBrush(XColors.PaleVioletRed, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush PapayaWhip + { +#if USE_CACHE + get { return _papayaWhip ?? (_papayaWhip = new XSolidBrush(XColors.PapayaWhip, true)); } +#else + get { return new XSolidBrush(XColors.PapayaWhip, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush PeachPuff + { +#if USE_CACHE + get { return _peachPuff ?? (_peachPuff = new XSolidBrush(XColors.PeachPuff, true)); } +#else + get { return new XSolidBrush(XColors.PeachPuff, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Peru + { +#if USE_CACHE + get { return _peru ?? (_peru = new XSolidBrush(XColors.Peru, true)); } +#else + get { return new XSolidBrush(XColors.Peru, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Pink + { +#if USE_CACHE + get { return _pink ?? (_pink = new XSolidBrush(XColors.Pink, true)); } +#else + get { return new XSolidBrush(XColors.Pink, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Plum + { +#if USE_CACHE + get { return _plum ?? (_plum = new XSolidBrush(XColors.Plum, true)); } +#else + get { return new XSolidBrush(XColors.Plum, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush PowderBlue + { +#if USE_CACHE + get { return _powderBlue ?? (_powderBlue = new XSolidBrush(XColors.PowderBlue, true)); } +#else + get { return new XSolidBrush(XColors.PowderBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Purple + { +#if USE_CACHE + get { return _purple ?? (_purple = new XSolidBrush(XColors.Purple, true)); } +#else + get { return new XSolidBrush(XColors.Purple, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Red + { +#if USE_CACHE + get { return _red ?? (_red = new XSolidBrush(XColors.Red, true)); } +#else + get { return new XSolidBrush(XColors.Red, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush RosyBrown + { +#if USE_CACHE + get { return _rosyBrown ?? (_rosyBrown = new XSolidBrush(XColors.RosyBrown, true)); } +#else + get { return new XSolidBrush(XColors.RosyBrown, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush RoyalBlue + { +#if USE_CACHE + get { return _royalBlue ?? (_royalBlue = new XSolidBrush(XColors.RoyalBlue, true)); } +#else + get { return new XSolidBrush(XColors.RoyalBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush SaddleBrown + { +#if USE_CACHE + get { return _saddleBrown ?? (_saddleBrown = new XSolidBrush(XColors.SaddleBrown, true)); } +#else + get { return new XSolidBrush(XColors.SaddleBrown, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Salmon + { +#if USE_CACHE + get { return _salmon ?? (_salmon = new XSolidBrush(XColors.Salmon, true)); } +#else + get { return new XSolidBrush(XColors.Salmon, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush SandyBrown + { +#if USE_CACHE + get { return _sandyBrown ?? (_sandyBrown = new XSolidBrush(XColors.SandyBrown, true)); } +#else + get { return new XSolidBrush(XColors.SandyBrown, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush SeaGreen + { +#if USE_CACHE + get { return _seaGreen ?? (_seaGreen = new XSolidBrush(XColors.SeaGreen, true)); } +#else + get { return new XSolidBrush(XColors.SeaGreen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush SeaShell + { +#if USE_CACHE + get { return _seaShell ?? (_seaShell = new XSolidBrush(XColors.SeaShell, true)); } +#else + get { return new XSolidBrush(XColors.SeaShell, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Sienna + { +#if USE_CACHE + get { return _sienna ?? (_sienna = new XSolidBrush(XColors.Sienna, true)); } +#else + get { return new XSolidBrush(XColors.Sienna, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Silver + { +#if USE_CACHE + get { return _silver ?? (_silver = new XSolidBrush(XColors.Silver, true)); } +#else + get { return new XSolidBrush(XColors.Silver, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush SkyBlue + { +#if USE_CACHE + get { return _skyBlue ?? (_skyBlue = new XSolidBrush(XColors.SkyBlue, true)); } +#else + get { return new XSolidBrush(XColors.SkyBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush SlateBlue + { +#if USE_CACHE + get { return _slateBlue ?? (_slateBlue = new XSolidBrush(XColors.SlateBlue, true)); } +#else + get { return new XSolidBrush(XColors.SlateBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush SlateGray + { +#if USE_CACHE + get { return _slateGray ?? (_slateGray = new XSolidBrush(XColors.SlateGray, true)); } +#else + get { return new XSolidBrush(XColors.SlateGray, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Snow + { +#if USE_CACHE + get { return _snow ?? (_snow = new XSolidBrush(XColors.Snow, true)); } +#else + get { return new XSolidBrush(XColors.Snow, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush SpringGreen + { +#if USE_CACHE + get { return _springGreen ?? (_springGreen = new XSolidBrush(XColors.SpringGreen, true)); } +#else + get { return new XSolidBrush(XColors.SpringGreen, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush SteelBlue + { +#if USE_CACHE + get { return _steelBlue ?? (_steelBlue = new XSolidBrush(XColors.SteelBlue, true)); } +#else + get { return new XSolidBrush(XColors.SteelBlue, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Tan + { +#if USE_CACHE + get { return _tan ?? (_tan = new XSolidBrush(XColors.Tan, true)); } +#else + get { return new XSolidBrush(XColors.Tan, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Teal + { +#if USE_CACHE + get { return _teal ?? (_teal = new XSolidBrush(XColors.Teal, true)); } +#else + get { return new XSolidBrush(XColors.Teal, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Thistle + { +#if USE_CACHE + get { return _thistle ?? (_thistle = new XSolidBrush(XColors.Thistle, true)); } +#else + get { return new XSolidBrush(XColors.Thistle, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Tomato + { +#if USE_CACHE + get { return _tomato ?? (_tomato = new XSolidBrush(XColors.Tomato, true)); } +#else + get { return new XSolidBrush(XColors.Tomato, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Transparent + { +#if USE_CACHE + get { return _transparent ?? (_transparent = new XSolidBrush(XColors.Transparent, true)); } +#else + get { return new XSolidBrush(XColors.Transparent, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Turquoise + { +#if USE_CACHE + get { return _turquoise ?? (_turquoise = new XSolidBrush(XColors.Turquoise, true)); } +#else + get { return new XSolidBrush(XColors.Turquoise, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Violet + { +#if USE_CACHE + get { return _violet ?? (_violet = new XSolidBrush(XColors.Violet, true)); } +#else + get { return new XSolidBrush(XColors.Violet, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Wheat + { +#if USE_CACHE + get { return _wheat ?? (_wheat = new XSolidBrush(XColors.Wheat, true)); } +#else + get { return new XSolidBrush(XColors.Wheat, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush White + { +#if USE_CACHE + get { return _white ?? (_white = new XSolidBrush(XColors.White, true)); } +#else + get { return new XSolidBrush(XColors.White, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush WhiteSmoke + { +#if USE_CACHE + get { return _whiteSmoke ?? (_whiteSmoke = new XSolidBrush(XColors.WhiteSmoke, true)); } +#else + get { return new XSolidBrush(XColors.WhiteSmoke, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush Yellow + { +#if USE_CACHE + get { return _yellow ?? (_yellow = new XSolidBrush(XColors.Yellow, true)); } +#else + get { return new XSolidBrush(XColors.Yellow, true); } +#endif + } + + /// Gets a pre-defined XBrush object. + public static XSolidBrush YellowGreen + { +#if USE_CACHE + get { return _yellowGreen ?? (_yellowGreen = new XSolidBrush(XColors.YellowGreen, true)); } +#else + get { return new XSolidBrush(XColors.YellowGreen, true); } +#endif + } + +#if USE_CACHE + static XSolidBrush _aliceBlue; + static XSolidBrush _antiqueWhite; + static XSolidBrush _aqua; + static XSolidBrush _aquamarine; + static XSolidBrush _azure; + static XSolidBrush _beige; + static XSolidBrush _bisque; + static XSolidBrush _black; + static XSolidBrush _blanchedAlmond; + static XSolidBrush _blue; + static XSolidBrush _blueViolet; + static XSolidBrush _brown; + static XSolidBrush _burlyWood; + static XSolidBrush _cadetBlue; + static XSolidBrush _chartreuse; + static XSolidBrush _chocolate; + static XSolidBrush _coral; + static XSolidBrush _cornflowerBlue; + static XSolidBrush _cornsilk; + static XSolidBrush _crimson; + static XSolidBrush _cyan; + static XSolidBrush _darkBlue; + static XSolidBrush _darkCyan; + static XSolidBrush _darkGoldenrod; + static XSolidBrush _darkGray; + static XSolidBrush _darkGreen; + static XSolidBrush _darkKhaki; + static XSolidBrush _darkMagenta; + static XSolidBrush _darkOliveGreen; + static XSolidBrush _darkOrange; + static XSolidBrush _darkOrchid; + static XSolidBrush _darkRed; + static XSolidBrush _darkSalmon; + static XSolidBrush _darkSeaGreen; + static XSolidBrush _darkSlateBlue; + static XSolidBrush _darkSlateGray; + static XSolidBrush _darkTurquoise; + static XSolidBrush _darkViolet; + static XSolidBrush _deepPink; + static XSolidBrush _deepSkyBlue; + static XSolidBrush _dimGray; + static XSolidBrush _dodgerBlue; + static XSolidBrush _firebrick; + static XSolidBrush _floralWhite; + static XSolidBrush _forestGreen; + static XSolidBrush _fuchsia; + static XSolidBrush _gainsboro; + static XSolidBrush _ghostWhite; + static XSolidBrush _gold; + static XSolidBrush _goldenrod; + static XSolidBrush _gray; + static XSolidBrush _green; + static XSolidBrush _greenYellow; + static XSolidBrush _honeydew; + static XSolidBrush _hotPink; + static XSolidBrush _indianRed; + static XSolidBrush _indigo; + static XSolidBrush _ivory; + static XSolidBrush _khaki; + static XSolidBrush _lavender; + static XSolidBrush _lavenderBlush; + static XSolidBrush _lawnGreen; + static XSolidBrush _lemonChiffon; + static XSolidBrush _lightBlue; + static XSolidBrush _lightCoral; + static XSolidBrush _lightCyan; + static XSolidBrush _lightGoldenrodYellow; + static XSolidBrush _lightGray; + static XSolidBrush _lightGreen; + static XSolidBrush _lightPink; + static XSolidBrush _lightSalmon; + static XSolidBrush _lightSeaGreen; + static XSolidBrush _lightSkyBlue; + static XSolidBrush _lightSlateGray; + static XSolidBrush _lightSteelBlue; + static XSolidBrush _lightYellow; + static XSolidBrush _lime; + static XSolidBrush _limeGreen; + static XSolidBrush _linen; + static XSolidBrush _magenta; + static XSolidBrush _maroon; + static XSolidBrush _mediumAquamarine; + static XSolidBrush _mediumBlue; + static XSolidBrush _mediumOrchid; + static XSolidBrush _mediumPurple; + static XSolidBrush _mediumSeaGreen; + static XSolidBrush _mediumSlateBlue; + static XSolidBrush _mediumSpringGreen; + static XSolidBrush _mediumTurquoise; + static XSolidBrush _mediumVioletRed; + static XSolidBrush _midnightBlue; + static XSolidBrush _mintCream; + static XSolidBrush _mistyRose; + static XSolidBrush _moccasin; + static XSolidBrush _navajoWhite; + static XSolidBrush _navy; + static XSolidBrush _oldLace; + static XSolidBrush _olive; + static XSolidBrush _oliveDrab; + static XSolidBrush _orange; + static XSolidBrush _orangeRed; + static XSolidBrush _orchid; + static XSolidBrush _paleGoldenrod; + static XSolidBrush _paleGreen; + static XSolidBrush _paleTurquoise; + static XSolidBrush _paleVioletRed; + static XSolidBrush _papayaWhip; + static XSolidBrush _peachPuff; + static XSolidBrush _peru; + static XSolidBrush _pink; + static XSolidBrush _plum; + static XSolidBrush _powderBlue; + static XSolidBrush _purple; + static XSolidBrush _red; + static XSolidBrush _rosyBrown; + static XSolidBrush _royalBlue; + static XSolidBrush _saddleBrown; + static XSolidBrush _salmon; + static XSolidBrush _sandyBrown; + static XSolidBrush _seaGreen; + static XSolidBrush _seaShell; + static XSolidBrush _sienna; + static XSolidBrush _silver; + static XSolidBrush _skyBlue; + static XSolidBrush _slateBlue; + static XSolidBrush _slateGray; + static XSolidBrush _snow; + static XSolidBrush _springGreen; + static XSolidBrush _steelBlue; + static XSolidBrush _tan; + static XSolidBrush _teal; + static XSolidBrush _thistle; + static XSolidBrush _tomato; + static XSolidBrush _transparent; + static XSolidBrush _turquoise; + static XSolidBrush _violet; + static XSolidBrush _wheat; + static XSolidBrush _white; + static XSolidBrush _whiteSmoke; + static XSolidBrush _yellow; + static XSolidBrush _yellowGreen; +#endif + } +} diff --git a/PdfSharp/Drawing/XColor.cs b/PdfSharp/Drawing/XColor.cs new file mode 100644 index 0000000..122a50d --- /dev/null +++ b/PdfSharp/Drawing/XColor.cs @@ -0,0 +1,824 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using System.ComponentModel; +#if GDI +using System.Drawing; +#endif +#if WPF +using WpfColor = System.Windows.Media.Color; +#endif +#if UWP +using UwpColor = Windows.UI.Color; +#endif + + +// ReSharper disable RedundantNameQualifier + +namespace PdfSharp.Drawing +{ + /// + /// Represents a RGB, CMYK, or gray scale color. + /// + [DebuggerDisplay("clr=(A={A}, R={R}, G={G}, B={B} C={C}, M={M}, Y={Y}, K={K})")] + public struct XColor + { + XColor(uint argb) + { + _cs = XColorSpace.Rgb; + _a = (byte)((argb >> 24) & 0xff) / 255f; + _r = (byte)((argb >> 16) & 0xff); + _g = (byte)((argb >> 8) & 0xff); + _b = (byte)(argb & 0xff); + _c = 0; + _m = 0; + _y = 0; + _k = 0; + _gs = 0; + RgbChanged(); + //_cs.GetType(); // Suppress warning + } + + XColor(byte alpha, byte red, byte green, byte blue) + { + _cs = XColorSpace.Rgb; + _a = alpha / 255f; + _r = red; + _g = green; + _b = blue; + _c = 0; + _m = 0; + _y = 0; + _k = 0; + _gs = 0; + RgbChanged(); + //_cs.GetType(); // Suppress warning + } + + XColor(double alpha, double cyan, double magenta, double yellow, double black) + { + _cs = XColorSpace.Cmyk; + _a = (float)(alpha > 1 ? 1 : (alpha < 0 ? 0 : alpha)); + _c = (float)(cyan > 1 ? 1 : (cyan < 0 ? 0 : cyan)); + _m = (float)(magenta > 1 ? 1 : (magenta < 0 ? 0 : magenta)); + _y = (float)(yellow > 1 ? 1 : (yellow < 0 ? 0 : yellow)); + _k = (float)(black > 1 ? 1 : (black < 0 ? 0 : black)); + _r = 0; + _g = 0; + _b = 0; + _gs = 0f; + CmykChanged(); + } + + XColor(double cyan, double magenta, double yellow, double black) + : this(1.0, cyan, magenta, yellow, black) + { } + + XColor(double gray) + { + _cs = XColorSpace.GrayScale; + if (gray < 0) + _gs = 0; + else if (gray > 1) + _gs = 1; + else + _gs = (float)gray; + + _a = 1; + _r = 0; + _g = 0; + _b = 0; + _c = 0; + _m = 0; + _y = 0; + _k = 0; + GrayChanged(); + } + +#if GDI + XColor(System.Drawing.Color color) + : this(color.A, color.R, color.G, color.B) + { } +#endif + +#if WPF + XColor(WpfColor color) + : this(color.A, color.R, color.G, color.B) + { } +#endif + +#if GDI + XColor(KnownColor knownColor) + : this(System.Drawing.Color.FromKnownColor(knownColor)) + { } +#endif + +#if UWP + XColor(UwpColor color) + : this(color.A, color.R, color.G, color.B) + { } +#endif + + internal XColor(XKnownColor knownColor) + : this(XKnownColorTable.KnownColorToArgb(knownColor)) + { } + + /// + /// Creates an XColor structure from a 32-bit ARGB value. + /// + public static XColor FromArgb(int argb) + { + return new XColor((byte)(argb >> 24), (byte)(argb >> 16), (byte)(argb >> 8), (byte)(argb)); + } + + /// + /// Creates an XColor structure from a 32-bit ARGB value. + /// + public static XColor FromArgb(uint argb) + { + return new XColor((byte)(argb >> 24), (byte)(argb >> 16), (byte)(argb >> 8), (byte)(argb)); + } + + // from System.Drawing.Color + //public static XColor FromArgb(int alpha, Color baseColor); + //public static XColor FromArgb(int red, int green, int blue); + //public static XColor FromArgb(int alpha, int red, int green, int blue); + //public static XColor FromKnownColor(KnownColor color); + //public static XColor FromName(string name); + + /// + /// Creates an XColor structure from the specified 8-bit color values (red, green, and blue). + /// The alpha value is implicitly 255 (fully opaque). + /// + public static XColor FromArgb(int red, int green, int blue) + { + CheckByte(red, "red"); + CheckByte(green, "green"); + CheckByte(blue, "blue"); + return new XColor(255, (byte)red, (byte)green, (byte)blue); + } + + /// + /// Creates an XColor structure from the four ARGB component (alpha, red, green, and blue) values. + /// + public static XColor FromArgb(int alpha, int red, int green, int blue) + { + CheckByte(alpha, "alpha"); + CheckByte(red, "red"); + CheckByte(green, "green"); + CheckByte(blue, "blue"); + return new XColor((byte)alpha, (byte)red, (byte)green, (byte)blue); + } + +#if GDI + /// + /// Creates an XColor structure from the specified System.Drawing.Color. + /// + public static XColor FromArgb(System.Drawing.Color color) + { + return new XColor(color); + } +#endif + +#if WPF + /// + /// Creates an XColor structure from the specified System.Drawing.Color. + /// + public static XColor FromArgb(WpfColor color) + { + return new XColor(color); + } +#endif + +#if UWP + /// + /// Creates an XColor structure from the specified Windows.UI.Color. + /// + public static XColor FromArgb(UwpColor color) + { + return new XColor(color); + } +#endif + + /// + /// Creates an XColor structure from the specified alpha value and color. + /// + public static XColor FromArgb(int alpha, XColor color) + { + color.A = ((byte)alpha) / 255.0; + return color; + } + +#if GDI + /// + /// Creates an XColor structure from the specified alpha value and color. + /// + public static XColor FromArgb(int alpha, System.Drawing.Color color) + { + // Cast required to use correct constructor. + return new XColor((byte)alpha, color.R, color.G, color.B); + } +#endif + +#if WPF + /// + /// Creates an XColor structure from the specified alpha value and color. + /// + public static XColor FromArgb(int alpha, WpfColor color) + { + // Cast required to use correct constructor. + return new XColor((byte)alpha, color.R, color.G, color.B); + } +#endif + +#if UWP + /// + /// Creates an XColor structure from the specified alpha value and color. + /// + public static XColor FromArgb(int alpha, UwpColor color) + { + // Cast required to use correct constructor. + return new XColor((byte)alpha, color.R, color.G, color.B); + } +#endif + + /// + /// Creates an XColor structure from the specified CMYK values. + /// + public static XColor FromCmyk(double cyan, double magenta, double yellow, double black) + { + return new XColor(cyan, magenta, yellow, black); + } + + /// + /// Creates an XColor structure from the specified CMYK values. + /// + public static XColor FromCmyk(double alpha, double cyan, double magenta, double yellow, double black) + { + return new XColor(alpha, cyan, magenta, yellow, black); + } + + /// + /// Creates an XColor structure from the specified gray value. + /// + public static XColor FromGrayScale(double grayScale) + { + return new XColor(grayScale); + } + + /// + /// Creates an XColor from the specified pre-defined color. + /// + public static XColor FromKnownColor(XKnownColor color) + { + return new XColor(color); + } + +#if GDI + /// + /// Creates an XColor from the specified pre-defined color. + /// + public static XColor FromKnownColor(KnownColor color) + { + return new XColor(color); + } +#endif + + /// + /// Creates an XColor from the specified name of a pre-defined color. + /// + public static XColor FromName(string name) + { +#if GDI + // The implementation in System.Drawing.dll is interesting. It uses a ColorConverter + // with hash tables, locking mechanisms etc. I'm not sure what problems that solves. + // So I don't use the source, but the reflection. + try + { + return new XColor((KnownColor)Enum.Parse(typeof(KnownColor), name, true)); + } + // ReSharper disable EmptyGeneralCatchClause + catch { } + // ReSharper restore EmptyGeneralCatchClause +#endif + return Empty; + } + + /// + /// Gets or sets the color space to be used for PDF generation. + /// + public XColorSpace ColorSpace + { + get { return _cs; } + set + { + if (!Enum.IsDefined(typeof(XColorSpace), value)) + throw new InvalidEnumArgumentException("value", (int)value, typeof(XColorSpace)); + _cs = value; + } + } + + /// + /// Indicates whether this XColor structure is uninitialized. + /// + public bool IsEmpty + { + get { return this == Empty; } + } + +#if GDI +#if UseGdiObjects + /// + /// Implicit conversion from Color to XColor + /// + public static implicit operator XColor(Color color) + { + return new XColor(color); + } +#endif + + /// + /// Creates a System.Drawing.Color object from this color. + /// + public System.Drawing.Color ToGdiColor() + { + return System.Drawing.Color.FromArgb((int)(_a * 255), _r, _g, _b); + } +#endif + +#if WPF + /// + /// Creates a WpfColor object from this color. + /// + public WpfColor ToWpfColor() + { + return WpfColor.FromArgb((byte)(_a * 255), _r, _g, _b); + } +#endif + +#if UWP + /// + /// Creates a Windows.UI.Color object from this color. + /// + public UwpColor ToUwpColor() + { + return UwpColor.FromArgb((byte)(_a * 255), _r, _g, _b); + } +#endif + + /// + /// Determines whether the specified object is a Color structure and is equivalent to this + /// Color structure. + /// + public override bool Equals(object obj) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + if (obj is XColor) + { + XColor color = (XColor)obj; + if (_r == color._r && _g == color._g && _b == color._b && + _c == color._c && _m == color._m && _y == color._y && _k == color._k && + _gs == color._gs) + { + return _a == color._a; + } + } + return false; + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Returns the hash code for this instance. + /// + public override int GetHashCode() + { + // ReSharper disable NonReadonlyFieldInGetHashCode + return ((byte)(_a * 255)) ^ _r ^ _g ^ _b; + // ReSharper restore NonReadonlyFieldInGetHashCode + } + + /// + /// Determines whether two colors are equal. + /// + public static bool operator ==(XColor left, XColor right) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + if (left._r == right._r && left._g == right._g && left._b == right._b && + left._c == right._c && left._m == right._m && left._y == right._y && left._k == right._k && + left._gs == right._gs) + { + return left._a == right._a; + } + return false; + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Determines whether two colors are not equal. + /// + public static bool operator !=(XColor left, XColor right) + { + return !(left == right); + } + + /// + /// Gets a value indicating whether this color is a known color. + /// + public bool IsKnownColor + { + get { return XKnownColorTable.IsKnownColor(Argb); } + } + + /// + /// Gets the hue-saturation-brightness (HSB) hue value, in degrees, for this color. + /// + /// The hue, in degrees, of this color. The hue is measured in degrees, ranging from 0 through 360, in HSB color space. + public double GetHue() + { + // ReSharper disable CompareOfFloatsByEqualityOperator + if ((_r == _g) && (_g == _b)) + return 0; + + double value1 = _r / 255.0; + double value2 = _g / 255.0; + double value3 = _b / 255.0; + double value7 = 0; + double value4 = value1; + double value5 = value1; + if (value2 > value4) + value4 = value2; + + if (value3 > value4) + value4 = value3; + + if (value2 < value5) + value5 = value2; + + if (value3 < value5) + value5 = value3; + + double value6 = value4 - value5; + if (value1 == value4) + value7 = (value2 - value3) / value6; + else if (value2 == value4) + value7 = 2f + ((value3 - value1) / value6); + else if (value3 == value4) + value7 = 4f + ((value1 - value2) / value6); + + value7 *= 60; + if (value7 < 0) + value7 += 360; + return value7; + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Gets the hue-saturation-brightness (HSB) saturation value for this color. + /// + /// The saturation of this color. The saturation ranges from 0 through 1, where 0 is grayscale and 1 is the most saturated. + public double GetSaturation() + { + // ReSharper disable CompareOfFloatsByEqualityOperator + double value1 = _r / 255.0; + double value2 = _g / 255.0; + double value3 = _b / 255.0; + double value7 = 0; + double value4 = value1; + double value5 = value1; + if (value2 > value4) + value4 = value2; + + if (value3 > value4) + value4 = value3; + + if (value2 < value5) + value5 = value2; + + if (value3 < value5) + value5 = value3; + + if (value4 == value5) + return value7; + + double value6 = (value4 + value5) / 2; + if (value6 <= 0.5) + return (value4 - value5) / (value4 + value5); + return (value4 - value5) / ((2f - value4) - value5); + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Gets the hue-saturation-brightness (HSB) brightness value for this color. + /// + /// The brightness of this color. The brightness ranges from 0 through 1, where 0 represents black and 1 represents white. + public double GetBrightness() + { + double value1 = _r / 255.0; + double value2 = _g / 255.0; + double value3 = _b / 255.0; + double value4 = value1; + double value5 = value1; + if (value2 > value4) + value4 = value2; + + if (value3 > value4) + value4 = value3; + + if (value2 < value5) + value5 = value2; + + if (value3 < value5) + value5 = value3; + + return (value4 + value5) / 2; + } + + /// + /// One of the RGB values changed; recalculate other color representations. + /// + void RgbChanged() + { + // ReSharper disable LocalVariableHidesMember + _cs = XColorSpace.Rgb; + int c = 255 - _r; + int m = 255 - _g; + int y = 255 - _b; + int k = Math.Min(c, Math.Min(m, y)); + if (k == 255) + _c = _m = _y = 0; + else + { + float black = 255f - k; + _c = (c - k) / black; + _m = (m - k) / black; + _y = (y - k) / black; + } + _k = _gs = k / 255f; + // ReSharper restore LocalVariableHidesMember + } + + /// + /// One of the CMYK values changed; recalculate other color representations. + /// + void CmykChanged() + { + _cs = XColorSpace.Cmyk; + float black = _k * 255; + float factor = 255f - black; + _r = (byte)(255 - Math.Min(255f, _c * factor + black)); + _g = (byte)(255 - Math.Min(255f, _m * factor + black)); + _b = (byte)(255 - Math.Min(255f, _y * factor + black)); + _gs = (float)(1 - Math.Min(1.0, 0.3f * _c + 0.59f * _m + 0.11 * _y + _k)); + } + + /// + /// The gray scale value changed; recalculate other color representations. + /// + void GrayChanged() + { + _cs = XColorSpace.GrayScale; + _r = (byte)(_gs * 255); + _g = (byte)(_gs * 255); + _b = (byte)(_gs * 255); + _c = 0; + _m = 0; + _y = 0; + _k = 1 - _gs; + } + + // Properties + + /// + /// Gets or sets the alpha value the specifies the transparency. + /// The value is in the range from 1 (opaque) to 0 (completely transparent). + /// + public double A + { + get { return _a; } + set + { + if (value < 0) + _a = 0; + else if (value > 1) + _a = 1; + else + _a = (float)value; + } + } + + /// + /// Gets or sets the red value. + /// + public byte R + { + get { return _r; } + set { _r = value; RgbChanged(); } + } + + /// + /// Gets or sets the green value. + /// + public byte G + { + get { return _g; } + set { _g = value; RgbChanged(); } + } + + /// + /// Gets or sets the blue value. + /// + public byte B + { + get { return _b; } + set { _b = value; RgbChanged(); } + } + + /// + /// Gets the RGB part value of the color. Internal helper function. + /// + internal uint Rgb + { + get { return ((uint)_r << 16) | ((uint)_g << 8) | _b; } + } + + /// + /// Gets the ARGB part value of the color. Internal helper function. + /// + internal uint Argb + { + get { return ((uint)(_a * 255) << 24) | ((uint)_r << 16) | ((uint)_g << 8) | _b; } + } + + /// + /// Gets or sets the cyan value. + /// + public double C + { + get { return _c; } + set + { + if (value < 0) + _c = 0; + else if (value > 1) + _c = 1; + else + _c = (float)value; + CmykChanged(); + } + } + + /// + /// Gets or sets the magenta value. + /// + public double M + { + get { return _m; } + set + { + if (value < 0) + _m = 0; + else if (value > 1) + _m = 1; + else + _m = (float)value; + CmykChanged(); + } + } + + /// + /// Gets or sets the yellow value. + /// + public double Y + { + get { return _y; } + set + { + if (value < 0) + _y = 0; + else if (value > 1) + _y = 1; + else + _y = (float)value; + CmykChanged(); + } + } + + /// + /// Gets or sets the black (or key) value. + /// + public double K + { + get { return _k; } + set + { + if (value < 0) + _k = 0; + else if (value > 1) + _k = 1; + else + _k = (float)value; + CmykChanged(); + } + } + + /// + /// Gets or sets the gray scale value. + /// + // ReSharper disable InconsistentNaming + public double GS + // ReSharper restore InconsistentNaming + { + get { return _gs; } + set + { + if (value < 0) + _gs = 0; + else if (value > 1) + _gs = 1; + else + _gs = (float)value; + GrayChanged(); + } + } + + /// + /// Represents the null color. + /// + public static XColor Empty; + + /// + /// Special property for XmlSerializer only. + /// + public string RgbCmykG + { + get + { + return String.Format(CultureInfo.InvariantCulture, + "{0};{1};{2};{3};{4};{5};{6};{7};{8}", _r, _g, _b, _c, _m, _y, _k, _gs, _a); + } + set + { + string[] values = value.Split(';'); + _r = byte.Parse(values[0], CultureInfo.InvariantCulture); + _g = byte.Parse(values[1], CultureInfo.InvariantCulture); + _b = byte.Parse(values[2], CultureInfo.InvariantCulture); + _c = float.Parse(values[3], CultureInfo.InvariantCulture); + _m = float.Parse(values[4], CultureInfo.InvariantCulture); + _y = float.Parse(values[5], CultureInfo.InvariantCulture); + _k = float.Parse(values[6], CultureInfo.InvariantCulture); + _gs = float.Parse(values[7], CultureInfo.InvariantCulture); + _a = float.Parse(values[8], CultureInfo.InvariantCulture); + } + } + + static void CheckByte(int val, string name) + { + if (val < 0 || val > 0xFF) + throw new ArgumentException(PSSR.InvalidValue(val, name, 0, 255)); + } + + XColorSpace _cs; + + float _a; // alpha + + byte _r; // \ + byte _g; // |--- RGB + byte _b; // / + + float _c; // \ + float _m; // |--- CMYK + float _y; // | + float _k; // / + + float _gs; // >--- gray scale + } +} diff --git a/PdfSharp/Drawing/XColorResourceManager.cs b/PdfSharp/Drawing/XColorResourceManager.cs new file mode 100644 index 0000000..24a5d1d --- /dev/null +++ b/PdfSharp/Drawing/XColorResourceManager.cs @@ -0,0 +1,361 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Globalization; +using System.ComponentModel; +using System.Threading; +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Manages the localization of the color class. + /// + public class XColorResourceManager + { + /// + /// Initializes a new instance of the class. + /// + public XColorResourceManager() +#if !NETFX_CORE && !UWP + : this(Thread.CurrentThread.CurrentUICulture) +#else + : this(CultureInfo.CurrentUICulture) +#endif + { } + + /// + /// Initializes a new instance of the class. + /// + /// The culture info. + public XColorResourceManager(CultureInfo cultureInfo) + { + _cultureInfo = cultureInfo; + } + + readonly CultureInfo _cultureInfo; + +#if DEBUG_ + static public void Test() + { + int kcc = XKnownColorTable.colorTable.Length; + + for (int idx = 0; idx < kcc; idx++) + { + uint argb = XKnownColorTable.colorTable[idx]; + ColorResourceInfo info = GetColorInfo((XKnownColor)idx); + if ((int)info.KnownColor == -1) + { + kcc.GetType(); + } + else + { + if (argb != info.Argb) + { + kcc.GetType(); + } + } + } + + for (int idx = 0; idx < colorInfos.Length; idx++) + { + ColorResourceInfo c2 = colorInfos[idx]; + if (c2.Argb != c2.Color.Rgb) + c2.GetType(); + } + } +#endif + + /// + /// Gets a known color from an ARGB value. Throws an ArgumentException if the value is not a known color. + /// + public static XKnownColor GetKnownColor(uint argb) + { + XKnownColor knownColor = XKnownColorTable.GetKnownColor(argb); + if ((int)knownColor == -1) + throw new ArgumentException("The argument is not a known color", "argb"); + return knownColor; + } + + /// + /// Gets all known colors. + /// + /// Indicates whether to include the color Transparent. + public static XKnownColor[] GetKnownColors(bool includeTransparent) + { + int count = colorInfos.Length; + XKnownColor[] knownColor = new XKnownColor[count - (includeTransparent ? 0 : 1)]; + for (int idxIn = includeTransparent ? 0 : 1, idxOut = 0; idxIn < count; idxIn++, idxOut++) + knownColor[idxOut] = colorInfos[idxIn].KnownColor; + return knownColor; + } + + /// + /// Converts a known color to a localized color name. + /// + public string ToColorName(XKnownColor knownColor) + { + ColorResourceInfo colorInfo = GetColorInfo(knownColor); + + // Currently German only + if (_cultureInfo.TwoLetterISOLanguageName == "de") + return colorInfo.NameDE; + + return colorInfo.Name; + } + + /// + /// Converts a color to a localized color name or an ARGB value. + /// + public string ToColorName(XColor color) + { + string name; + if (color.IsKnownColor) + name = ToColorName(XKnownColorTable.GetKnownColor(color.Argb)); + else + name = String.Format("{0}, {1}, {2}, {3}", (int)(255 * color.A), color.R, color.G, color.B); + return name; + } + + static ColorResourceInfo GetColorInfo(XKnownColor knownColor) + { + for (int idx = 0; idx < colorInfos.Length; idx++) + { + ColorResourceInfo colorInfo = colorInfos[idx]; + if (colorInfo.KnownColor == knownColor) + return colorInfo; + } + throw new InvalidEnumArgumentException("Enum is not an XKnownColor."); + } + + // I found no official translation for the 140 pre-defined colors. Some folks made their own translations. + // http://unnecessary.de/wuest/farbtab/farbtabelle-w.html + // http://blog.patrickkempf.de/archives/2004/04/10/html-farben/ + // http://www.grafikwunder.de/Grafikecke/Farbtabelle/farbtabelle-006.php + // Silke changed some German translations (women know more colors than men :-) + internal static ColorResourceInfo[] colorInfos = new ColorResourceInfo[] + { + new ColorResourceInfo(XKnownColor.Transparent, XColors.Transparent, 0x00FFFFFF, "Transparent", "Transparent"), + new ColorResourceInfo(XKnownColor.Black, XColors.Black, 0xFF000000, "Black", "Schwarz"), + new ColorResourceInfo(XKnownColor.DarkSlateGray, XColors.DarkSlateGray, 0xFF8FBC8F, "Darkslategray", "Dunkles Schiefergrau"), + new ColorResourceInfo(XKnownColor.SlateGray, XColors.SlateGray, 0xFF708090, "Slategray", "Schiefergrau"), + new ColorResourceInfo(XKnownColor.LightSlateGray, XColors.LightSlateGray, 0xFF778899, "Lightslategray", "Helles Schiefergrau"), + new ColorResourceInfo(XKnownColor.LightSteelBlue, XColors.LightSteelBlue, 0xFFB0C4DE, "Lightsteelblue", "Helles Stahlblau"), + //new ColorResourceInfo(XKnownColor.DimGray, XColors.DimGray, 0xFF696969, "Dimgray", "Mattes Grau"), + new ColorResourceInfo(XKnownColor.DimGray, XColors.DimGray, 0xFF696969, "Dimgray", "Gedecktes Grau"), + new ColorResourceInfo(XKnownColor.Gray, XColors.Gray, 0xFF808080, "Gray", "Grau"), + new ColorResourceInfo(XKnownColor.DarkGray, XColors.DarkGray, 0xFFA9A9A9, "Darkgray", "Dunkelgrau"), + new ColorResourceInfo(XKnownColor.Silver, XColors.Silver, 0xFFC0C0C0, "Silver", "Silber"), + //new ColorResourceInfo(XKnownColor.Gainsboro, XColors.Gainsboro, 0xFFDCDCDC, "Gainsboro", "Gainsboro"), + new ColorResourceInfo(XKnownColor.Gainsboro, XColors.Gainsboro, 0xFFDCDCDC, "Gainsboro", "Helles Blaugrau"), + //new ColorResourceInfo(XKnownColor.WhiteSmoke, XColors.WhiteSmoke, 0xFFF5F5F5, "Whitesmoke", "Rauchiges Weiß"), + new ColorResourceInfo(XKnownColor.WhiteSmoke, XColors.WhiteSmoke, 0xFFF5F5F5, "Whitesmoke", "Rauchweiß"), + //new ColorResourceInfo(XKnownColor.GhostWhite, XColors.GhostWhite, 0xFFF8F8FF, "Ghostwhite", "Geisterweiß"), + new ColorResourceInfo(XKnownColor.GhostWhite, XColors.GhostWhite, 0xFFF8F8FF, "Ghostwhite", "Schattenweiß"), + new ColorResourceInfo(XKnownColor.White, XColors.White, 0xFFFFFFFF, "White", "Weiß"), + new ColorResourceInfo(XKnownColor.Snow, XColors.Snow, 0xFFFFFAFA, "Snow", "Schneeweiß"), + new ColorResourceInfo(XKnownColor.Ivory, XColors.Ivory, 0xFFFFFFF0, "Ivory", "Elfenbein"), + new ColorResourceInfo(XKnownColor.FloralWhite, XColors.FloralWhite, 0xFFFFFAF0, "Floralwhite", "Blütenweiß"), + new ColorResourceInfo(XKnownColor.SeaShell, XColors.SeaShell, 0xFFFFF5EE, "Seashell", "Muschel"), + //new ColorResourceInfo(XKnownColor.OldLace, XColors.OldLace, 0xFFFDF5E6, "Oldlace", "Altgold"), + new ColorResourceInfo(XKnownColor.OldLace, XColors.OldLace, 0xFFFDF5E6, "Oldlace", "Altweiß"), + //new ColorResourceInfo(XKnownColor.Linen, XColors.Linen, 0xFFFAF0E6, "Linen", "Leinenfarbe"), + new ColorResourceInfo(XKnownColor.Linen, XColors.Linen, 0xFFFAF0E6, "Linen", "Leinen"), + new ColorResourceInfo(XKnownColor.AntiqueWhite, XColors.AntiqueWhite, 0xFFFAEBD7, "Antiquewhite", "Antikes Weiß"), + new ColorResourceInfo(XKnownColor.BlanchedAlmond, XColors.BlanchedAlmond, 0xFFFFEBCD, "Blanchedalmond", "Mandelweiß"), + //new ColorResourceInfo(XKnownColor.PapayaWhip, XColors.PapayaWhip, 0xFFFFEFD5, "Papayawhip", "Cremiges Papaya"), + new ColorResourceInfo(XKnownColor.PapayaWhip, XColors.PapayaWhip, 0xFFFFEFD5, "Papayawhip", "Papayacreme"), + new ColorResourceInfo(XKnownColor.Beige, XColors.Beige, 0xFFF5F5DC, "Beige", "Beige"), + new ColorResourceInfo(XKnownColor.Cornsilk, XColors.Cornsilk, 0xFFFFF8DC, "Cornsilk", "Mais"), + //new ColorResourceInfo(XKnownColor.LightGoldenrodYellow, XColors.LightGoldenrodYellow, 0xFFFAFAD2, "Lightgoldenrodyellow", "Helles Goldrutengelb"), + new ColorResourceInfo(XKnownColor.LightGoldenrodYellow, XColors.LightGoldenrodYellow, 0xFFFAFAD2, "Lightgoldenrodyellow", "Helles Goldgelb"), + new ColorResourceInfo(XKnownColor.LightYellow, XColors.LightYellow, 0xFFFFFFE0, "Lightyellow", "Hellgelb"), + new ColorResourceInfo(XKnownColor.LemonChiffon, XColors.LemonChiffon, 0xFFFFFACD, "Lemonchiffon", "Pastellgelb"), + //new ColorResourceInfo(XKnownColor.PaleGoldenrod, XColors.PaleGoldenrod, 0xFFEEE8AA, "Palegoldenrod", "Blasse Goldrutenfarbe"), + new ColorResourceInfo(XKnownColor.PaleGoldenrod, XColors.PaleGoldenrod, 0xFFEEE8AA, "Palegoldenrod", "Blasses Goldgelb"), + new ColorResourceInfo(XKnownColor.Khaki, XColors.Khaki, 0xFFF0E68C, "Khaki", "Khaki"), + new ColorResourceInfo(XKnownColor.Yellow, XColors.Yellow, 0xFFFFFF00, "Yellow", "Gelb"), + new ColorResourceInfo(XKnownColor.Gold, XColors.Gold, 0xFFFFD700, "Gold", "Gold"), + new ColorResourceInfo(XKnownColor.Orange, XColors.Orange, 0xFFFFA500, "Orange", "Orange"), + new ColorResourceInfo(XKnownColor.DarkOrange, XColors.DarkOrange, 0xFFFF8C00, "Darkorange", "Dunkles Orange"), + //new ColorResourceInfo(XKnownColor.Goldenrod, XColors.Goldenrod, 0xFFDAA520, "Goldenrod", "Goldrute"), + new ColorResourceInfo(XKnownColor.Goldenrod, XColors.Goldenrod, 0xFFDAA520, "Goldenrod", "Goldgelb"), + //new ColorResourceInfo(XKnownColor.DarkGoldenrod, XColors.DarkGoldenrod, 0xFFB8860B, "Darkgoldenrod", "Dunkle Goldrutenfarbe"), + new ColorResourceInfo(XKnownColor.DarkGoldenrod, XColors.DarkGoldenrod, 0xFFB8860B, "Darkgoldenrod", "Dunkles Goldgelb"), + new ColorResourceInfo(XKnownColor.Peru, XColors.Peru, 0xFFCD853F, "Peru", "Peru"), + new ColorResourceInfo(XKnownColor.Chocolate, XColors.Chocolate, 0xFFD2691E, "Chocolate", "Schokolade"), + new ColorResourceInfo(XKnownColor.SaddleBrown, XColors.SaddleBrown, 0xFF8B4513, "Saddlebrown", "Sattelbraun"), + new ColorResourceInfo(XKnownColor.Sienna, XColors.Sienna, 0xFFA0522D, "Sienna", "Ocker"), + new ColorResourceInfo(XKnownColor.Brown, XColors.Brown, 0xFFA52A2A, "Brown", "Braun"), + new ColorResourceInfo(XKnownColor.DarkRed, XColors.DarkRed, 0xFF8B0000, "Darkred", "Dunkelrot"), + new ColorResourceInfo(XKnownColor.Maroon, XColors.Maroon, 0xFF800000, "Maroon", "Kastanienbraun"), + new ColorResourceInfo(XKnownColor.PaleTurquoise, XColors.PaleTurquoise, 0xFFAFEEEE, "Paleturquoise", "Blasses Türkis"), + //new ColorResourceInfo(XKnownColor.Firebrick, XColors.Firebrick, 0xFFB22222, "Firebrick", "Ziegelfarbe"), + new ColorResourceInfo(XKnownColor.Firebrick, XColors.Firebrick, 0xFFB22222, "Firebrick", "Ziegel"), + new ColorResourceInfo(XKnownColor.IndianRed, XColors.IndianRed, 0xFFCD5C5C, "Indianred", "Indischrot"), + new ColorResourceInfo(XKnownColor.Crimson, XColors.Crimson, 0xFFDC143C, "Crimson", "Karmesinrot"), + new ColorResourceInfo(XKnownColor.Red, XColors.Red, 0xFFFF0000, "Red", "Rot"), + //new ColorResourceInfo(XKnownColor.OrangeRed, XColors.OrangeRed, 0xFFFF4500, "Orangered", "Orangenrot"), + new ColorResourceInfo(XKnownColor.OrangeRed, XColors.OrangeRed, 0xFFFF4500, "Orangered", "Orangerot"), + //new ColorResourceInfo(XKnownColor.Tomato, XColors.Tomato, 0xFFFF6347, "Tomato", "Tomatenrot"), + new ColorResourceInfo(XKnownColor.Tomato, XColors.Tomato, 0xFFFF6347, "Tomato", "Tomate"), + new ColorResourceInfo(XKnownColor.Coral, XColors.Coral, 0xFFFF7F50, "Coral", "Koralle"), + new ColorResourceInfo(XKnownColor.Salmon, XColors.Salmon, 0xFFFA8072, "Salmon", "Lachs"), + new ColorResourceInfo(XKnownColor.LightCoral, XColors.LightCoral, 0xFFF08080, "Lightcoral", "Helles Korallenrot"), + //new ColorResourceInfo(XKnownColor.DarkSalmon, XColors.DarkSalmon, 0xFFE9967A, "Darksalmon", "Dunkle Lachsfarbe"), + new ColorResourceInfo(XKnownColor.DarkSalmon, XColors.DarkSalmon, 0xFFE9967A, "Darksalmon", "Dunkles Lachs"), + //new ColorResourceInfo(XKnownColor.LightSalmon, XColors.LightSalmon, 0xFFFFA07A, "Lightsalmon", "Helle Lachsfarbe"), + new ColorResourceInfo(XKnownColor.LightSalmon, XColors.LightSalmon, 0xFFFFA07A, "Lightsalmon", "Helles Lachs"), + new ColorResourceInfo(XKnownColor.SandyBrown, XColors.SandyBrown, 0xFFF4A460, "Sandybrown", "Sandbraun"), + //new ColorResourceInfo(XKnownColor.RosyBrown, XColors.RosyBrown, 0xFFBC8F8F, "Rosybrown", "Rosiges Braun"), + new ColorResourceInfo(XKnownColor.RosyBrown, XColors.RosyBrown, 0xFFBC8F8F, "Rosybrown", "Rotbraun"), + new ColorResourceInfo(XKnownColor.Tan, XColors.Tan, 0xFFD2B48C, "Tan", "Gelbbraun"), + //new ColorResourceInfo(XKnownColor.BurlyWood, XColors.BurlyWood, 0xFFDEB887, "Burlywood", "Grobes Braun"), + new ColorResourceInfo(XKnownColor.BurlyWood, XColors.BurlyWood, 0xFFDEB887, "Burlywood", "Kräftiges Sandbraun"), + new ColorResourceInfo(XKnownColor.Wheat, XColors.Wheat, 0xFFF5DEB3, "Wheat", "Weizen"), + new ColorResourceInfo(XKnownColor.PeachPuff, XColors.PeachPuff, 0xFFFFDAB9, "Peachpuff", "Pfirsich"), + //new ColorResourceInfo(XKnownColor.NavajoWhite, XColors.NavajoWhite, 0xFFFFDEAD, "Navajowhite", "Navajoweiß"), + new ColorResourceInfo(XKnownColor.NavajoWhite, XColors.NavajoWhite, 0xFFFFDEAD, "Navajowhite", "Orangeweiß"), + //new ColorResourceInfo(XKnownColor.Bisque, XColors.Bisque, 0xFFFFE4C4, "Bisque", "Tomatencreme"), + new ColorResourceInfo(XKnownColor.Bisque, XColors.Bisque, 0xFFFFE4C4, "Bisque", "Blasses Rotbraun"), + //new ColorResourceInfo(XKnownColor.Moccasin, XColors.Moccasin, 0xFFFFE4B5, "Moccasin", "Moccasin"), + new ColorResourceInfo(XKnownColor.Moccasin, XColors.Moccasin, 0xFFFFE4B5, "Moccasin", "Mokassin"), + //new ColorResourceInfo(XKnownColor.LavenderBlush, XColors.LavenderBlush, 0xFFFFF0F5, "Lavenderblush", "Rosige Lavenderfarbe"), + new ColorResourceInfo(XKnownColor.LavenderBlush, XColors.LavenderBlush, 0xFFFFF0F5, "Lavenderblush", "Roter Lavendel"), + new ColorResourceInfo(XKnownColor.MistyRose, XColors.MistyRose, 0xFFFFE4E1, "Mistyrose", "Altrosa"), + new ColorResourceInfo(XKnownColor.Pink, XColors.Pink, 0xFFFFC0CB, "Pink", "Rosa"), + new ColorResourceInfo(XKnownColor.LightPink, XColors.LightPink, 0xFFFFB6C1, "Lightpink", "Hellrosa"), + new ColorResourceInfo(XKnownColor.HotPink, XColors.HotPink, 0xFFFF69B4, "Hotpink", "Leuchtendes Rosa"), + //// XKnownColor.Fuchsia removed because the same as XKnownColor.Magenta + ////new ColorResourceInfo(XKnownColor.Fuchsia, XColors.Fuchsia, 0xFFFF00FF, "Fuchsia", "Fuchsie"), + new ColorResourceInfo(XKnownColor.Magenta, XColors.Magenta, 0xFFFF00FF, "Magenta", "Magentarot"), + new ColorResourceInfo(XKnownColor.DeepPink, XColors.DeepPink, 0xFFFF1493, "Deeppink", "Tiefrosa"), + new ColorResourceInfo(XKnownColor.MediumVioletRed, XColors.MediumVioletRed, 0xFFC71585, "Mediumvioletred", "Mittleres Violettrot"), + new ColorResourceInfo(XKnownColor.PaleVioletRed, XColors.PaleVioletRed, 0xFFDB7093, "Palevioletred", "Blasses Violettrot"), + new ColorResourceInfo(XKnownColor.Plum, XColors.Plum, 0xFFDDA0DD, "Plum", "Pflaume"), + new ColorResourceInfo(XKnownColor.Thistle, XColors.Thistle, 0xFFD8BFD8, "Thistle", "Distel"), + //new ColorResourceInfo(XKnownColor.Lavender, XColors.Lavender, 0xFFE6E6FA, "Lavender", "Lavendelfarbe"), + new ColorResourceInfo(XKnownColor.Lavender, XColors.Lavender, 0xFFE6E6FA, "Lavender", "Lavendel"), + new ColorResourceInfo(XKnownColor.Violet, XColors.Violet, 0xFFEE82EE, "Violet", "Violett"), + new ColorResourceInfo(XKnownColor.Orchid, XColors.Orchid, 0xFFDA70D6, "Orchid", "Orchidee"), + new ColorResourceInfo(XKnownColor.DarkMagenta, XColors.DarkMagenta, 0xFF8B008B, "Darkmagenta", "Dunkles Magentarot"), + new ColorResourceInfo(XKnownColor.Purple, XColors.Purple, 0xFF800080, "Purple", "Violett"), + new ColorResourceInfo(XKnownColor.Indigo, XColors.Indigo, 0xFF4B0082, "Indigo", "Indigo"), + new ColorResourceInfo(XKnownColor.BlueViolet, XColors.BlueViolet, 0xFF8A2BE2, "Blueviolet", "Blauviolett"), + new ColorResourceInfo(XKnownColor.DarkViolet, XColors.DarkViolet, 0xFF9400D3, "Darkviolet", "Dunkles Violett"), + //new ColorResourceInfo(XKnownColor.DarkOrchid, XColors.DarkOrchid, 0xFF9932CC, "Darkorchid", "Dunkle Orchideenfarbe"), + new ColorResourceInfo(XKnownColor.DarkOrchid, XColors.DarkOrchid, 0xFF9932CC, "Darkorchid", "Dunkle Orchidee"), + new ColorResourceInfo(XKnownColor.MediumPurple, XColors.MediumPurple, 0xFF9370DB, "Mediumpurple", "Mittleres Violett"), + //new ColorResourceInfo(XKnownColor.MediumOrchid, XColors.MediumOrchid, 0xFFBA55D3, "Mediumorchid", "Mittlere Orchideenfarbe"), + new ColorResourceInfo(XKnownColor.MediumOrchid, XColors.MediumOrchid, 0xFFBA55D3, "Mediumorchid", "Mittlere Orchidee"), + new ColorResourceInfo(XKnownColor.MediumSlateBlue, XColors.MediumSlateBlue, 0xFF7B68EE, "Mediumslateblue", "Mittleres Schieferblau"), + new ColorResourceInfo(XKnownColor.SlateBlue, XColors.SlateBlue, 0xFF6A5ACD, "Slateblue", "Schieferblau"), + new ColorResourceInfo(XKnownColor.DarkSlateBlue, XColors.DarkSlateBlue, 0xFF483D8B, "Darkslateblue", "Dunkles Schiefergrau"), + new ColorResourceInfo(XKnownColor.MidnightBlue, XColors.MidnightBlue, 0xFF191970, "Midnightblue", "Mitternachtsblau"), + new ColorResourceInfo(XKnownColor.Navy, XColors.Navy, 0xFF000080, "Navy", "Marineblau"), + new ColorResourceInfo(XKnownColor.DarkBlue, XColors.DarkBlue, 0xFF00008B, "Darkblue", "Dunkelblau"), + new ColorResourceInfo(XKnownColor.LightGray, XColors.LightGray, 0xFFD3D3D3, "Lightgray", "Hellgrau"), + new ColorResourceInfo(XKnownColor.MediumBlue, XColors.MediumBlue, 0xFF0000CD, "Mediumblue", "Mittelblau"), + new ColorResourceInfo(XKnownColor.Blue, XColors.Blue, 0xFF0000FF, "Blue", "Blau"), + new ColorResourceInfo(XKnownColor.RoyalBlue, XColors.RoyalBlue, 0xFF4169E1, "Royalblue", "Königsblau"), + new ColorResourceInfo(XKnownColor.SteelBlue, XColors.SteelBlue, 0xFF4682B4, "Steelblue", "Stahlblau"), + new ColorResourceInfo(XKnownColor.CornflowerBlue, XColors.CornflowerBlue, 0xFF6495ED, "Cornflowerblue", "Kornblumenblau"), + new ColorResourceInfo(XKnownColor.DodgerBlue, XColors.DodgerBlue, 0xFF1E90FF, "Dodgerblue", "Dodger-Blau"), + new ColorResourceInfo(XKnownColor.DeepSkyBlue, XColors.DeepSkyBlue, 0xFF00BFFF, "Deepskyblue", "Tiefes Himmelblau"), + new ColorResourceInfo(XKnownColor.LightSkyBlue, XColors.LightSkyBlue, 0xFF87CEFA, "Lightskyblue", "Helles Himmelblau"), + new ColorResourceInfo(XKnownColor.SkyBlue, XColors.SkyBlue, 0xFF87CEEB, "Skyblue", "Himmelblau"), + new ColorResourceInfo(XKnownColor.LightBlue, XColors.LightBlue, 0xFFADD8E6, "Lightblue", "Hellblau"), + //// XKnownColor.Aqua removed because the same as XKnownColor.Cyan + ////new ColorResourceInfo(XKnownColor.Aqua, XColors.Aqua, 0xFF00FFFF, "Aqua", "Blaugrün"), + new ColorResourceInfo(XKnownColor.Cyan, XColors.Cyan, 0xFF00FFFF, "Cyan", "Zyan"), + new ColorResourceInfo(XKnownColor.PowderBlue, XColors.PowderBlue, 0xFFB0E0E6, "Powderblue", "Taubenblau"), + new ColorResourceInfo(XKnownColor.LightCyan, XColors.LightCyan, 0xFFE0FFFF, "Lightcyan", "Helles Cyanblau"), + new ColorResourceInfo(XKnownColor.AliceBlue, XColors.AliceBlue, 0xFFA0CE00, "Aliceblue", "Aliceblau"), + new ColorResourceInfo(XKnownColor.Azure, XColors.Azure, 0xFFF0FFFF, "Azure", "Himmelblau"), + //new ColorResourceInfo(XKnownColor.MintCream, XColors.MintCream, 0xFFF5FFFA, "Mintcream", "Cremige Pfefferminzfarbe"), + new ColorResourceInfo(XKnownColor.MintCream, XColors.MintCream, 0xFFF5FFFA, "Mintcream", "Helles Pfefferminzgrün"), + new ColorResourceInfo(XKnownColor.Honeydew, XColors.Honeydew, 0xFFF0FFF0, "Honeydew", "Honigmelone"), + new ColorResourceInfo(XKnownColor.Aquamarine, XColors.Aquamarine, 0xFF7FFFD4, "Aquamarine", "Aquamarinblau"), + new ColorResourceInfo(XKnownColor.Turquoise, XColors.Turquoise, 0xFF40E0D0, "Turquoise", "Türkis"), + new ColorResourceInfo(XKnownColor.MediumTurquoise, XColors.MediumTurquoise, 0xFF48D1CC, "Mediumturqoise", "Mittleres Türkis"), + new ColorResourceInfo(XKnownColor.DarkTurquoise, XColors.DarkTurquoise, 0xFF00CED1, "Darkturquoise", "Dunkles Türkis"), + new ColorResourceInfo(XKnownColor.MediumAquamarine, XColors.MediumAquamarine, 0xFF66CDAA, "Mediumaquamarine", "Mittleres Aquamarinblau"), + new ColorResourceInfo(XKnownColor.LightSeaGreen, XColors.LightSeaGreen, 0xFF20B2AA, "Lightseagreen", "Helles Seegrün"), + new ColorResourceInfo(XKnownColor.DarkCyan, XColors.DarkCyan, 0xFF008B8B, "Darkcyan", "Dunkles Zyanblau"), + //new ColorResourceInfo(XKnownColor.Teal, XColors.Teal, 0xFF008080, "Teal", "Entenbraun"), + new ColorResourceInfo(XKnownColor.Teal, XColors.Teal, 0xFF008080, "Teal", "Entenblau"), + new ColorResourceInfo(XKnownColor.CadetBlue, XColors.CadetBlue, 0xFF5F9EA0, "Cadetblue", "Kadettblau"), + new ColorResourceInfo(XKnownColor.MediumSeaGreen, XColors.MediumSeaGreen, 0xFF3CB371, "Mediumseagreen", "Mittleres Seegrün"), + new ColorResourceInfo(XKnownColor.DarkSeaGreen, XColors.DarkSeaGreen, 0xFF8FBC8F, "Darkseagreen", "Dunkles Seegrün"), + new ColorResourceInfo(XKnownColor.LightGreen, XColors.LightGreen, 0xFF90EE90, "Lightgreen", "Hellgrün"), + new ColorResourceInfo(XKnownColor.PaleGreen, XColors.PaleGreen, 0xFF98FB98, "Palegreen", "Blassgrün"), + new ColorResourceInfo(XKnownColor.MediumSpringGreen, XColors.MediumSpringGreen, 0xFF00FA9A, "Mediumspringgreen", "Mittleres Frühlingsgrün"), + new ColorResourceInfo(XKnownColor.SpringGreen, XColors.SpringGreen, 0xFF00FF7F, "Springgreen", "Frühlingsgrün"), + new ColorResourceInfo(XKnownColor.Lime, XColors.Lime, 0xFF00FF00, "Lime", "Zitronengrün"), + new ColorResourceInfo(XKnownColor.LimeGreen, XColors.LimeGreen, 0xFF32CD32, "Limegreen", "Gelbgrün"), + new ColorResourceInfo(XKnownColor.SeaGreen, XColors.SeaGreen, 0xFF2E8B57, "Seagreen", "Seegrün"), + new ColorResourceInfo(XKnownColor.ForestGreen, XColors.ForestGreen, 0xFF228B22, "Forestgreen", "Waldgrün"), + new ColorResourceInfo(XKnownColor.Green, XColors.Green, 0xFF008000, "Green", "Grün"), + new ColorResourceInfo(XKnownColor.LawnGreen, XColors.LawnGreen, 0xFF008000, "LawnGreen", "Grasgrün"), + new ColorResourceInfo(XKnownColor.DarkGreen, XColors.DarkGreen, 0xFF006400, "Darkgreen", "Dunkelgrün"), + //new ColorResourceInfo(XKnownColor.OliveDrab, XColors.OliveDrab, 0xFF6B8E23, "Olivedrab", "Olivfarbiges Graubraun"), + new ColorResourceInfo(XKnownColor.OliveDrab, XColors.OliveDrab, 0xFF6B8E23, "Olivedrab", "Reife Olive"), + new ColorResourceInfo(XKnownColor.DarkOliveGreen, XColors.DarkOliveGreen, 0xFF556B2F, "Darkolivegreen", "Dunkles Olivgrün"), + new ColorResourceInfo(XKnownColor.Olive, XColors.Olive, 0xFF808000, "Olive", "Olivgrün"), + new ColorResourceInfo(XKnownColor.DarkKhaki, XColors.DarkKhaki, 0xFFBDB76B, "Darkkhaki", "Dunkles Khaki"), + new ColorResourceInfo(XKnownColor.YellowGreen, XColors.YellowGreen, 0xFF9ACD32, "Yellowgreen", "Gelbgrün"), + new ColorResourceInfo(XKnownColor.Chartreuse, XColors.Chartreuse, 0xFF7FFF00, "Chartreuse", "Hellgrün"), + new ColorResourceInfo(XKnownColor.GreenYellow, XColors.GreenYellow, 0xFFADFF2F, "Greenyellow", "Grüngelb"), + }; + + internal struct ColorResourceInfo + { + public ColorResourceInfo(XKnownColor knownColor, XColor color, uint argb, string name, string nameDE) + { + KnownColor = knownColor; + Color = color; + Argb = argb; + Name = name; + NameDE = nameDE; + } + public XKnownColor KnownColor; + public XColor Color; + public uint Argb; + public string Name; + // ReSharper disable once InconsistentNaming + public string NameDE; + } + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing/XColors.cs b/PdfSharp/Drawing/XColors.cs new file mode 100644 index 0000000..f5ddefd --- /dev/null +++ b/PdfSharp/Drawing/XColors.cs @@ -0,0 +1,468 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Represents a set of 141 pre-defined RGB colors. Incidentally the values are the same + /// as in System.Drawing.Color. + /// + public static class XColors + { + ///Gets a predefined color. + public static XColor AliceBlue { get { return new XColor(XKnownColor.AliceBlue); } } + + ///Gets a predefined color. + public static XColor AntiqueWhite { get { return new XColor(XKnownColor.AntiqueWhite); } } + + ///Gets a predefined color. + public static XColor Aqua { get { return new XColor(XKnownColor.Aqua); } } + + ///Gets a predefined color. + public static XColor Aquamarine { get { return new XColor(XKnownColor.Aquamarine); } } + + ///Gets a predefined color. + public static XColor Azure { get { return new XColor(XKnownColor.Azure); } } + + ///Gets a predefined color. + public static XColor Beige { get { return new XColor(XKnownColor.Beige); } } + + ///Gets a predefined color. + public static XColor Bisque { get { return new XColor(XKnownColor.Bisque); } } + + ///Gets a predefined color. + public static XColor Black { get { return new XColor(XKnownColor.Black); } } + + ///Gets a predefined color. + public static XColor BlanchedAlmond { get { return new XColor(XKnownColor.BlanchedAlmond); } } + + ///Gets a predefined color. + public static XColor Blue { get { return new XColor(XKnownColor.Blue); } } + + ///Gets a predefined color. + public static XColor BlueViolet { get { return new XColor(XKnownColor.BlueViolet); } } + + ///Gets a predefined color. + public static XColor Brown { get { return new XColor(XKnownColor.Brown); } } + + ///Gets a predefined color. + public static XColor BurlyWood { get { return new XColor(XKnownColor.BurlyWood); } } + + ///Gets a predefined color. + public static XColor CadetBlue { get { return new XColor(XKnownColor.CadetBlue); } } + + ///Gets a predefined color. + public static XColor Chartreuse { get { return new XColor(XKnownColor.Chartreuse); } } + + ///Gets a predefined color. + public static XColor Chocolate { get { return new XColor(XKnownColor.Chocolate); } } + + ///Gets a predefined color. + public static XColor Coral { get { return new XColor(XKnownColor.Coral); } } + + ///Gets a predefined color. + public static XColor CornflowerBlue { get { return new XColor(XKnownColor.CornflowerBlue); } } + + ///Gets a predefined color. + public static XColor Cornsilk { get { return new XColor(XKnownColor.Cornsilk); } } + + ///Gets a predefined color. + public static XColor Crimson { get { return new XColor(XKnownColor.Crimson); } } + + ///Gets a predefined color. + public static XColor Cyan { get { return new XColor(XKnownColor.Cyan); } } + + ///Gets a predefined color. + public static XColor DarkBlue { get { return new XColor(XKnownColor.DarkBlue); } } + + ///Gets a predefined color. + public static XColor DarkCyan { get { return new XColor(XKnownColor.DarkCyan); } } + + ///Gets a predefined color. + public static XColor DarkGoldenrod { get { return new XColor(XKnownColor.DarkGoldenrod); } } + + ///Gets a predefined color. + public static XColor DarkGray { get { return new XColor(XKnownColor.DarkGray); } } + + ///Gets a predefined color. + public static XColor DarkGreen { get { return new XColor(XKnownColor.DarkGreen); } } + + ///Gets a predefined color. + public static XColor DarkKhaki { get { return new XColor(XKnownColor.DarkKhaki); } } + + ///Gets a predefined color. + public static XColor DarkMagenta { get { return new XColor(XKnownColor.DarkMagenta); } } + + ///Gets a predefined color. + public static XColor DarkOliveGreen { get { return new XColor(XKnownColor.DarkOliveGreen); } } + + ///Gets a predefined color. + public static XColor DarkOrange { get { return new XColor(XKnownColor.DarkOrange); } } + + ///Gets a predefined color. + public static XColor DarkOrchid { get { return new XColor(XKnownColor.DarkOrchid); } } + + ///Gets a predefined color. + public static XColor DarkRed { get { return new XColor(XKnownColor.DarkRed); } } + + ///Gets a predefined color. + public static XColor DarkSalmon { get { return new XColor(XKnownColor.DarkSalmon); } } + + ///Gets a predefined color. + public static XColor DarkSeaGreen { get { return new XColor(XKnownColor.DarkSeaGreen); } } + + ///Gets a predefined color. + public static XColor DarkSlateBlue { get { return new XColor(XKnownColor.DarkSlateBlue); } } + + ///Gets a predefined color. + public static XColor DarkSlateGray { get { return new XColor(XKnownColor.DarkSlateGray); } } + + ///Gets a predefined color. + public static XColor DarkTurquoise { get { return new XColor(XKnownColor.DarkTurquoise); } } + + ///Gets a predefined color. + public static XColor DarkViolet { get { return new XColor(XKnownColor.DarkViolet); } } + + ///Gets a predefined color. + public static XColor DeepPink { get { return new XColor(XKnownColor.DeepPink); } } + + ///Gets a predefined color. + public static XColor DeepSkyBlue { get { return new XColor(XKnownColor.DeepSkyBlue); } } + + ///Gets a predefined color. + public static XColor DimGray { get { return new XColor(XKnownColor.DimGray); } } + + ///Gets a predefined color. + public static XColor DodgerBlue { get { return new XColor(XKnownColor.DodgerBlue); } } + + ///Gets a predefined color. + public static XColor Firebrick { get { return new XColor(XKnownColor.Firebrick); } } + + ///Gets a predefined color. + public static XColor FloralWhite { get { return new XColor(XKnownColor.FloralWhite); } } + + ///Gets a predefined color. + public static XColor ForestGreen { get { return new XColor(XKnownColor.ForestGreen); } } + + ///Gets a predefined color. + public static XColor Fuchsia { get { return new XColor(XKnownColor.Fuchsia); } } + + ///Gets a predefined color. + public static XColor Gainsboro { get { return new XColor(XKnownColor.Gainsboro); } } + + ///Gets a predefined color. + public static XColor GhostWhite { get { return new XColor(XKnownColor.GhostWhite); } } + + ///Gets a predefined color. + public static XColor Gold { get { return new XColor(XKnownColor.Gold); } } + + ///Gets a predefined color. + public static XColor Goldenrod { get { return new XColor(XKnownColor.Goldenrod); } } + + ///Gets a predefined color. + public static XColor Gray { get { return new XColor(XKnownColor.Gray); } } + + ///Gets a predefined color. + public static XColor Green { get { return new XColor(XKnownColor.Green); } } + + ///Gets a predefined color. + public static XColor GreenYellow { get { return new XColor(XKnownColor.GreenYellow); } } + + ///Gets a predefined color. + public static XColor Honeydew { get { return new XColor(XKnownColor.Honeydew); } } + + ///Gets a predefined color. + public static XColor HotPink { get { return new XColor(XKnownColor.HotPink); } } + + ///Gets a predefined color. + public static XColor IndianRed { get { return new XColor(XKnownColor.IndianRed); } } + + ///Gets a predefined color. + public static XColor Indigo { get { return new XColor(XKnownColor.Indigo); } } + + ///Gets a predefined color. + public static XColor Ivory { get { return new XColor(XKnownColor.Ivory); } } + + ///Gets a predefined color. + public static XColor Khaki { get { return new XColor(XKnownColor.Khaki); } } + + ///Gets a predefined color. + public static XColor Lavender { get { return new XColor(XKnownColor.Lavender); } } + + ///Gets a predefined color. + public static XColor LavenderBlush { get { return new XColor(XKnownColor.LavenderBlush); } } + + ///Gets a predefined color. + public static XColor LawnGreen { get { return new XColor(XKnownColor.LawnGreen); } } + + ///Gets a predefined color. + public static XColor LemonChiffon { get { return new XColor(XKnownColor.LemonChiffon); } } + + ///Gets a predefined color. + public static XColor LightBlue { get { return new XColor(XKnownColor.LightBlue); } } + + ///Gets a predefined color. + public static XColor LightCoral { get { return new XColor(XKnownColor.LightCoral); } } + + ///Gets a predefined color. + public static XColor LightCyan { get { return new XColor(XKnownColor.LightCyan); } } + + ///Gets a predefined color. + public static XColor LightGoldenrodYellow { get { return new XColor(XKnownColor.LightGoldenrodYellow); } } + + ///Gets a predefined color. + public static XColor LightGray { get { return new XColor(XKnownColor.LightGray); } } + + ///Gets a predefined color. + public static XColor LightGreen { get { return new XColor(XKnownColor.LightGreen); } } + + ///Gets a predefined color. + public static XColor LightPink { get { return new XColor(XKnownColor.LightPink); } } + + ///Gets a predefined color. + public static XColor LightSalmon { get { return new XColor(XKnownColor.LightSalmon); } } + + ///Gets a predefined color. + public static XColor LightSeaGreen { get { return new XColor(XKnownColor.LightSeaGreen); } } + + ///Gets a predefined color. + public static XColor LightSkyBlue { get { return new XColor(XKnownColor.LightSkyBlue); } } + + ///Gets a predefined color. + public static XColor LightSlateGray { get { return new XColor(XKnownColor.LightSlateGray); } } + + ///Gets a predefined color. + public static XColor LightSteelBlue { get { return new XColor(XKnownColor.LightSteelBlue); } } + + ///Gets a predefined color. + public static XColor LightYellow { get { return new XColor(XKnownColor.LightYellow); } } + + ///Gets a predefined color. + public static XColor Lime { get { return new XColor(XKnownColor.Lime); } } + + ///Gets a predefined color. + public static XColor LimeGreen { get { return new XColor(XKnownColor.LimeGreen); } } + + ///Gets a predefined color. + public static XColor Linen { get { return new XColor(XKnownColor.Linen); } } + + ///Gets a predefined color. + public static XColor Magenta { get { return new XColor(XKnownColor.Magenta); } } + + ///Gets a predefined color. + public static XColor Maroon { get { return new XColor(XKnownColor.Maroon); } } + + ///Gets a predefined color. + public static XColor MediumAquamarine { get { return new XColor(XKnownColor.MediumAquamarine); } } + + ///Gets a predefined color. + public static XColor MediumBlue { get { return new XColor(XKnownColor.MediumBlue); } } + + ///Gets a predefined color. + public static XColor MediumOrchid { get { return new XColor(XKnownColor.MediumOrchid); } } + + ///Gets a predefined color. + public static XColor MediumPurple { get { return new XColor(XKnownColor.MediumPurple); } } + + ///Gets a predefined color. + public static XColor MediumSeaGreen { get { return new XColor(XKnownColor.MediumSeaGreen); } } + + ///Gets a predefined color. + public static XColor MediumSlateBlue { get { return new XColor(XKnownColor.MediumSlateBlue); } } + + ///Gets a predefined color. + public static XColor MediumSpringGreen { get { return new XColor(XKnownColor.MediumSpringGreen); } } + + ///Gets a predefined color. + public static XColor MediumTurquoise { get { return new XColor(XKnownColor.MediumTurquoise); } } + + ///Gets a predefined color. + public static XColor MediumVioletRed { get { return new XColor(XKnownColor.MediumVioletRed); } } + + ///Gets a predefined color. + public static XColor MidnightBlue { get { return new XColor(XKnownColor.MidnightBlue); } } + + ///Gets a predefined color. + public static XColor MintCream { get { return new XColor(XKnownColor.MintCream); } } + + ///Gets a predefined color. + public static XColor MistyRose { get { return new XColor(XKnownColor.MistyRose); } } + + ///Gets a predefined color. + public static XColor Moccasin { get { return new XColor(XKnownColor.Moccasin); } } + + ///Gets a predefined color. + public static XColor NavajoWhite { get { return new XColor(XKnownColor.NavajoWhite); } } + + ///Gets a predefined color. + public static XColor Navy { get { return new XColor(XKnownColor.Navy); } } + + ///Gets a predefined color. + public static XColor OldLace { get { return new XColor(XKnownColor.OldLace); } } + + ///Gets a predefined color. + public static XColor Olive { get { return new XColor(XKnownColor.Olive); } } + + ///Gets a predefined color. + public static XColor OliveDrab { get { return new XColor(XKnownColor.OliveDrab); } } + + ///Gets a predefined color. + public static XColor Orange { get { return new XColor(XKnownColor.Orange); } } + + ///Gets a predefined color. + public static XColor OrangeRed { get { return new XColor(XKnownColor.OrangeRed); } } + + ///Gets a predefined color. + public static XColor Orchid { get { return new XColor(XKnownColor.Orchid); } } + + ///Gets a predefined color. + public static XColor PaleGoldenrod { get { return new XColor(XKnownColor.PaleGoldenrod); } } + + ///Gets a predefined color. + public static XColor PaleGreen { get { return new XColor(XKnownColor.PaleGreen); } } + + ///Gets a predefined color. + public static XColor PaleTurquoise { get { return new XColor(XKnownColor.PaleTurquoise); } } + + ///Gets a predefined color. + public static XColor PaleVioletRed { get { return new XColor(XKnownColor.PaleVioletRed); } } + + ///Gets a predefined color. + public static XColor PapayaWhip { get { return new XColor(XKnownColor.PapayaWhip); } } + + ///Gets a predefined color. + public static XColor PeachPuff { get { return new XColor(XKnownColor.PeachPuff); } } + + ///Gets a predefined color. + public static XColor Peru { get { return new XColor(XKnownColor.Peru); } } + + ///Gets a predefined color. + public static XColor Pink { get { return new XColor(XKnownColor.Pink); } } + + ///Gets a predefined color. + public static XColor Plum { get { return new XColor(XKnownColor.Plum); } } + + ///Gets a predefined color. + public static XColor PowderBlue { get { return new XColor(XKnownColor.PowderBlue); } } + + ///Gets a predefined color. + public static XColor Purple { get { return new XColor(XKnownColor.Purple); } } + + ///Gets a predefined color. + public static XColor Red { get { return new XColor(XKnownColor.Red); } } + + ///Gets a predefined color. + public static XColor RosyBrown { get { return new XColor(XKnownColor.RosyBrown); } } + + ///Gets a predefined color. + public static XColor RoyalBlue { get { return new XColor(XKnownColor.RoyalBlue); } } + + ///Gets a predefined color. + public static XColor SaddleBrown { get { return new XColor(XKnownColor.SaddleBrown); } } + + ///Gets a predefined color. + public static XColor Salmon { get { return new XColor(XKnownColor.Salmon); } } + + ///Gets a predefined color. + public static XColor SandyBrown { get { return new XColor(XKnownColor.SandyBrown); } } + + ///Gets a predefined color. + public static XColor SeaGreen { get { return new XColor(XKnownColor.SeaGreen); } } + + ///Gets a predefined color. + public static XColor SeaShell { get { return new XColor(XKnownColor.SeaShell); } } + + ///Gets a predefined color. + public static XColor Sienna { get { return new XColor(XKnownColor.Sienna); } } + + ///Gets a predefined color. + public static XColor Silver { get { return new XColor(XKnownColor.Silver); } } + + ///Gets a predefined color. + public static XColor SkyBlue { get { return new XColor(XKnownColor.SkyBlue); } } + + ///Gets a predefined color. + public static XColor SlateBlue { get { return new XColor(XKnownColor.SlateBlue); } } + + ///Gets a predefined color. + public static XColor SlateGray { get { return new XColor(XKnownColor.SlateGray); } } + + ///Gets a predefined color. + public static XColor Snow { get { return new XColor(XKnownColor.Snow); } } + + ///Gets a predefined color. + public static XColor SpringGreen { get { return new XColor(XKnownColor.SpringGreen); } } + + ///Gets a predefined color. + public static XColor SteelBlue { get { return new XColor(XKnownColor.SteelBlue); } } + + ///Gets a predefined color. + public static XColor Tan { get { return new XColor(XKnownColor.Tan); } } + + ///Gets a predefined color. + public static XColor Teal { get { return new XColor(XKnownColor.Teal); } } + + ///Gets a predefined color. + public static XColor Thistle { get { return new XColor(XKnownColor.Thistle); } } + + ///Gets a predefined color. + public static XColor Tomato { get { return new XColor(XKnownColor.Tomato); } } + + ///Gets a predefined color. + public static XColor Transparent { get { return new XColor(XKnownColor.Transparent); } } + + ///Gets a predefined color. + public static XColor Turquoise { get { return new XColor(XKnownColor.Turquoise); } } + + ///Gets a predefined color. + public static XColor Violet { get { return new XColor(XKnownColor.Violet); } } + + ///Gets a predefined color. + public static XColor Wheat { get { return new XColor(XKnownColor.Wheat); } } + + ///Gets a predefined color. + public static XColor White { get { return new XColor(XKnownColor.White); } } + + ///Gets a predefined color. + public static XColor WhiteSmoke { get { return new XColor(XKnownColor.WhiteSmoke); } } + + ///Gets a predefined color. + public static XColor Yellow { get { return new XColor(XKnownColor.Yellow); } } + + ///Gets a predefined color. + public static XColor YellowGreen { get { return new XColor(XKnownColor.YellowGreen); } } + } +} diff --git a/PdfSharp/Drawing/XConvert.cs b/PdfSharp/Drawing/XConvert.cs new file mode 100644 index 0000000..7232b50 --- /dev/null +++ b/PdfSharp/Drawing/XConvert.cs @@ -0,0 +1,97 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if CORE +#endif +#if CORE +#endif +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Converts XGraphics enums to GDI+ enums. + /// + internal static class XConvert + { +#if GDI +//#if UseGdiObjects + /// + /// Converts XLineJoin to LineJoin. + /// + public static LineJoin ToLineJoin(XLineJoin lineJoin) + { + return GdiLineJoin[(int)lineJoin]; + } + static readonly LineJoin[] GdiLineJoin = new LineJoin[] { LineJoin.Miter, LineJoin.Round, LineJoin.Bevel }; +//#endif +#endif + +#if GDI +//#if UseGdiObjects + /// + /// Converts XLineCap to LineCap. + /// + public static LineCap ToLineCap(XLineCap lineCap) + { + return _gdiLineCap[(int)lineCap]; + } + static readonly LineCap[] _gdiLineCap = new LineCap[] { LineCap.Flat, LineCap.Round, LineCap.Square }; + //#endif +#endif + +#if WPF + /// + /// Converts XLineJoin to PenLineJoin. + /// + public static PenLineJoin ToPenLineJoin(XLineJoin lineJoin) + { + return WpfLineJoin[(int)lineJoin]; + } + static readonly PenLineJoin[] WpfLineJoin = new PenLineJoin[] { PenLineJoin.Miter, PenLineJoin.Round, PenLineJoin.Bevel }; +#endif + +#if WPF + /// + /// Converts XLineCap to PenLineCap. + /// + public static PenLineCap ToPenLineCap(XLineCap lineCap) + { + return WpfLineCap[(int)lineCap]; + } + static readonly PenLineCap[] WpfLineCap = new PenLineCap[] { PenLineCap.Flat, PenLineCap.Round, PenLineCap.Square }; +#endif + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing/XFont.cs b/PdfSharp/Drawing/XFont.cs new file mode 100644 index 0000000..a97f64e --- /dev/null +++ b/PdfSharp/Drawing/XFont.cs @@ -0,0 +1,862 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// #??? Clean up + +using System; +using System.Diagnostics; +using System.Globalization; +using System.ComponentModel; +#if CORE || GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using GdiFontFamily = System.Drawing.FontFamily; +using GdiFont = System.Drawing.Font; +using GdiFontStyle = System.Drawing.FontStyle; +#endif +#if WPF +using System.Windows.Markup; +using WpfFontFamily = System.Windows.Media.FontFamily; +using WpfTypeface = System.Windows.Media.Typeface; +using WpfGlyphTypeface = System.Windows.Media.GlyphTypeface; +#endif +#if UWP +using UwpFontFamily = Windows.UI.Xaml.Media.FontFamily; +#endif +using PdfSharp.Fonts; +using PdfSharp.Fonts.OpenType; +using PdfSharp.Internal; +using PdfSharp.Pdf; + +#if SILVERLIGHT +#pragma warning disable 649 +#endif +// ReSharper disable ConvertToAutoProperty + +namespace PdfSharp.Drawing +{ + /// + /// Defines an object used to draw text. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + public sealed class XFont + { + /// + /// Initializes a new instance of the class. + /// + /// Name of the font family. + /// The em size. + public XFont(string familyName, double emSize) + : this(familyName, emSize, XFontStyle.Regular, new XPdfFontOptions(GlobalFontSettings.DefaultFontEncoding)) + { } + + /// + /// Initializes a new instance of the class. + /// + /// Name of the font family. + /// The em size. + /// The font style. + public XFont(string familyName, double emSize, XFontStyle style) + : this(familyName, emSize, style, new XPdfFontOptions(GlobalFontSettings.DefaultFontEncoding)) + { } + + /// + /// Initializes a new instance of the class. + /// + /// Name of the font family. + /// The em size. + /// The font style. + /// Additional PDF options. + public XFont(string familyName, double emSize, XFontStyle style, XPdfFontOptions pdfOptions) + { + _familyName = familyName; + _emSize = emSize; + _style = style; + _pdfOptions = pdfOptions; + Initialize(); + } + + /// + /// Initializes a new instance of the class with enforced style simulation. + /// Only for testing PDFsharp. + /// + internal XFont(string familyName, double emSize, XFontStyle style, XPdfFontOptions pdfOptions, XStyleSimulations styleSimulations) + { + _familyName = familyName; + _emSize = emSize; + _style = style; + _pdfOptions = pdfOptions; + OverrideStyleSimulations = true; + StyleSimulations = styleSimulations; + Initialize(); + } + +#if CORE || GDI + /// + /// Initializes a new instance of the class from a System.Drawing.FontFamily. + /// + /// The System.Drawing.FontFamily. + /// The em size. + /// The font style. + public XFont(GdiFontFamily fontFamily, double emSize, XFontStyle style) + : this(fontFamily, emSize, style, new XPdfFontOptions(GlobalFontSettings.DefaultFontEncoding)) + { } + + /// + /// Initializes a new instance of the class from a System.Drawing.FontFamily. + /// + /// The System.Drawing.FontFamily. + /// The em size. + /// The font style. + /// Additional PDF options. + public XFont(GdiFontFamily fontFamily, double emSize, XFontStyle style, XPdfFontOptions pdfOptions) + { + _familyName = fontFamily.Name; + _gdiFontFamily = fontFamily; + _emSize = emSize; + _style = style; + _pdfOptions = pdfOptions; + InitializeFromGdi(); + } + + /// + /// Initializes a new instance of the class from a System.Drawing.Font. + /// + /// The System.Drawing.Font. + public XFont(GdiFont font) + : this(font, new XPdfFontOptions(GlobalFontSettings.DefaultFontEncoding)) + { } + + /// + /// Initializes a new instance of the class from a System.Drawing.Font. + /// + /// The System.Drawing.Font. + /// Additional PDF options. + public XFont(GdiFont font, XPdfFontOptions pdfOptions) + { + if (font.Unit != GraphicsUnit.World) + throw new ArgumentException("Font must use GraphicsUnit.World."); + _gdiFont = font; + Debug.Assert(font.Name == font.FontFamily.Name); + _familyName = font.Name; + _emSize = font.Size; + _style = FontStyleFrom(font); + _pdfOptions = pdfOptions; + InitializeFromGdi(); + } +#endif + +#if WPF && !SILVERLIGHT + /// + /// Initializes a new instance of the class from a System.Windows.Media.FontFamily. + /// + /// The System.Windows.Media.FontFamily. + /// The em size. + /// The font style. + public XFont(WpfFontFamily fontFamily, double emSize, XFontStyle style) + : this(fontFamily, emSize, style, new XPdfFontOptions(GlobalFontSettings.DefaultFontEncoding)) + { } + + /// + /// Initializes a new instance of the class from a System.Drawing.FontFamily. + /// + /// The System.Windows.Media.FontFamily. + /// The em size. + /// The font style. + /// Additional PDF options. + public XFont(WpfFontFamily fontFamily, double emSize, XFontStyle style, XPdfFontOptions pdfOptions) + { +#if !SILVERLIGHT + _familyName = fontFamily.FamilyNames[XmlLanguage.GetLanguage("en-US")]; +#else + // Best we can do in Silverlight. + _familyName = fontFamily.Source; +#endif + _wpfFontFamily = fontFamily; + _emSize = emSize; + _style = style; + _pdfOptions = pdfOptions; + InitializeFromWpf(); + } + + /// + /// Initializes a new instance of the class from a System.Windows.Media.Typeface. + /// + /// The System.Windows.Media.Typeface. + /// The em size. + public XFont(WpfTypeface typeface, double emSize) + : this(typeface, emSize, new XPdfFontOptions(GlobalFontSettings.DefaultFontEncoding)) + { } + + /// + /// Initializes a new instance of the class from a System.Windows.Media.Typeface. + /// + /// The System.Windows.Media.Typeface. + /// The em size. + /// Additional PDF options. + public XFont(WpfTypeface typeface, double emSize, XPdfFontOptions pdfOptions) + { + _wpfTypeface = typeface; + //Debug.Assert(font.Name == font.FontFamily.Name); + //_familyName = font.Name; + _emSize = emSize; + _pdfOptions = pdfOptions; + InitializeFromWpf(); + } +#endif + +#if UWP_ + /// + /// Initializes a new instance of the class from a System.Drawing.FontFamily. + /// + /// The System.Drawing.FontFamily. + /// The em size. + /// The font style. + public XFont(UwpFontFamily fontFamily, double emSize, XFontStyle style) + : this(fontFamily, emSize, style, new XPdfFontOptions(GlobalFontSettings.DefaultFontEncoding)) + { } + + /// + /// Initializes a new instance of the class from a System.Drawing.FontFamily. + /// + /// The System.Drawing.FontFamily. + /// The em size. + /// The font style. + /// Additional PDF options. + public XFont(UwpFontFamily fontFamily, double emSize, XFontStyle style, XPdfFontOptions pdfOptions) + { + _familyName = fontFamily.Source; + _gdiFontFamily = fontFamily; + _emSize = emSize; + _style = style; + _pdfOptions = pdfOptions; + InitializeFromGdi(); + } + + /// + /// Initializes a new instance of the class from a System.Drawing.Font. + /// + /// The System.Drawing.Font. + public XFont(GdiFont font) + : this(font, new XPdfFontOptions(GlobalFontSettings.DefaultFontEncoding)) + { } + + /// + /// Initializes a new instance of the class from a System.Drawing.Font. + /// + /// The System.Drawing.Font. + /// Additional PDF options. + public XFont(GdiFont font, XPdfFontOptions pdfOptions) + { + if (font.Unit != GraphicsUnit.World) + throw new ArgumentException("Font must use GraphicsUnit.World."); + _gdiFont = font; + Debug.Assert(font.Name == font.FontFamily.Name); + _familyName = font.Name; + _emSize = font.Size; + _style = FontStyleFrom(font); + _pdfOptions = pdfOptions; + InitializeFromGdi(); + } +#endif + + //// Methods + //public Font(Font prototype, FontStyle newStyle); + //public Font(FontFamily family, float emSize); + //public Font(string familyName, float emSize); + //public Font(FontFamily family, float emSize, FontStyle style); + //public Font(FontFamily family, float emSize, GraphicsUnit unit); + //public Font(string familyName, float emSize, FontStyle style); + //public Font(string familyName, float emSize, GraphicsUnit unit); + //public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit); + //public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit); + ////public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet); + ////public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet); + ////public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont); + ////public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont); + //public object Clone(); + //private static FontFamily CreateFontFamilyWithFallback(string familyName); + //private void Dispose(bool disposing); + //public override bool Equals(object obj); + //protected override void Finalize(); + //public static Font FromHdc(IntPtr hdc); + //public static Font FromHfont(IntPtr hfont); + //public static Font FromLogFont(object lf); + //public static Font FromLogFont(object lf, IntPtr hdc); + //public override int GetHashCode(); + + /// + /// Initializes this instance by computing the glyph typeface, font family, font source and TrueType fontface. + /// (PDFsharp currently only deals with TrueType fonts.) + /// + void Initialize() + { +//#if DEBUG +// if (_familyName == "Segoe UI Semilight" && (_style & XFontStyle.BoldItalic) == XFontStyle.Italic) +// GetType(); +//#endif + + FontResolvingOptions fontResolvingOptions = OverrideStyleSimulations + ? new FontResolvingOptions(_style, StyleSimulations) + : new FontResolvingOptions(_style); + + // HACK: 'PlatformDefault' is used in unit test code. + if (StringComparer.OrdinalIgnoreCase.Compare(_familyName, GlobalFontSettings.DefaultFontName) == 0) + { +#if CORE || GDI || WPF + _familyName = "Calibri"; +#endif + } + + // In principle an XFont is an XGlyphTypeface plus an em-size. + _glyphTypeface = XGlyphTypeface.GetOrCreateFrom(_familyName, fontResolvingOptions); +#if GDI // TODO: In CORE build it is not necessary to create a GDI font at all + // Create font by using font family. + XFontSource fontSource; // Not needed here. + _gdiFont = FontHelper.CreateFont(_familyName, (float)_emSize, (GdiFontStyle)(_style & XFontStyle.BoldItalic), out fontSource); +#endif +#if WPF && !SILVERLIGHT // Pure WPF + _wpfFontFamily = _glyphTypeface.FontFamily.WpfFamily; + _wpfTypeface = _glyphTypeface.WpfTypeface; + + if (_wpfFontFamily == null) + _wpfFontFamily = new WpfFontFamily(Name); + + if (_wpfTypeface == null) + _wpfTypeface = FontHelper.CreateTypeface(WpfFontFamily, _style); +#endif +#if WPF && SILVERLIGHT_ // Pure Silverlight 5 + if (GlyphTypeface == null) + { + //Debug.Assert(Typeface == null); + // #P F C + //GlyphTypeface = XPrivateFontCollection.TryGetXGlyphTypeface(Name, _style); + //if (GlyphTypeface == null) + //{ + // // HACK: Just make it work... + // GlyphTypeface = GlobalFontSettings.TryGetXGlyphTypeface(Name, _style, out Data); + //} +#if DEBUG + if (GlyphTypeface == null) + throw new Exception("No font: " + Name); +#endif + _wpfFamily = GlyphTypeface.FontFamily; + } + + //if (Family == null) + // Family = new System.Windows.Media.FontFamily(Name); + + //if (Typeface == null) + // Typeface = FontHelper.CreateTypeface(Family, _style); +#endif + CreateDescriptorAndInitializeFontMetrics(); + } + +#if CORE || GDI + /// + /// A GDI+ font object is used to setup the internal font objects. + /// + void InitializeFromGdi() + { + try + { + Lock.EnterFontFactory(); + if (_gdiFontFamily != null) + { + // Create font based on its family. + _gdiFont = new Font(_gdiFontFamily, (float)_emSize, (GdiFontStyle)_style, GraphicsUnit.World); + } + + if (_gdiFont != null) + { +#if DEBUG_ + string name1 = _gdiFont.Name; + string name2 = _gdiFont.OriginalFontName; + string name3 = _gdiFont.SystemFontName; +#endif + _familyName = _gdiFont.FontFamily.Name; + // TODO: _glyphTypeface = XGlyphTypeface.GetOrCreateFrom(_gdiFont); + } + else + { + Debug.Assert(false); + } + + if (_glyphTypeface == null) + _glyphTypeface = XGlyphTypeface.GetOrCreateFromGdi(_gdiFont); + + CreateDescriptorAndInitializeFontMetrics(); + } + finally { Lock.ExitFontFactory(); } + } +#endif + +#if WPF && !SILVERLIGHT + void InitializeFromWpf() + { + if (_wpfFontFamily != null) + { + _wpfTypeface = FontHelper.CreateTypeface(_wpfFontFamily, _style); + } + + if (_wpfTypeface != null) + { + _familyName = _wpfTypeface.FontFamily.FamilyNames[XmlLanguage.GetLanguage("en-US")]; + _glyphTypeface = XGlyphTypeface.GetOrCreateFromWpf(_wpfTypeface); + } + else + { + Debug.Assert(false); + } + + if (_glyphTypeface == null) + _glyphTypeface = XGlyphTypeface.GetOrCreateFrom(_familyName, new FontResolvingOptions(_style)); + + CreateDescriptorAndInitializeFontMetrics(); + } +#endif + + /// + /// Code separated from Metric getter to make code easier to debug. + /// (Setup properties in their getters caused side effects during debugging because Visual Studio calls a getter + /// to early to show its value in a debugger window.) + /// + void CreateDescriptorAndInitializeFontMetrics() // TODO: refactor + { + Debug.Assert(_fontMetrics == null, "InitializeFontMetrics() was already called."); + _descriptor = (OpenTypeDescriptor)FontDescriptorCache.GetOrCreateDescriptorFor(this); //_familyName, _style, _glyphTypeface.Fontface); + _fontMetrics = new XFontMetrics(_descriptor.FontName, _descriptor.UnitsPerEm, _descriptor.Ascender, _descriptor.Descender, + _descriptor.Leading, _descriptor.LineSpacing, _descriptor.CapHeight, _descriptor.XHeight, _descriptor.StemV, 0, 0, 0, + _descriptor.UnderlinePosition, _descriptor.UnderlineThickness, _descriptor.StrikeoutPosition, _descriptor.StrikeoutSize); + + XFontMetrics fm = Metrics; + + // Already done in CreateDescriptorAndInitializeFontMetrics. + //if (_descriptor == null) + // _descriptor = (OpenTypeDescriptor)FontDescriptorStock.Global.CreateDescriptor(this); //(Name, (XGdiFontStyle)Font.Style); + + UnitsPerEm = _descriptor.UnitsPerEm; + CellAscent = _descriptor.Ascender; + CellDescent = _descriptor.Descender; + CellSpace = _descriptor.LineSpacing; + +#if DEBUG_ && GDI + int gdiValueUnitsPerEm = Font.FontFamily.GetEmHeight(Font.Style); + Debug.Assert(gdiValueUnitsPerEm == UnitsPerEm); + int gdiValueAscent = Font.FontFamily.GetCellAscent(Font.Style); + Debug.Assert(gdiValueAscent == CellAscent); + int gdiValueDescent = Font.FontFamily.GetCellDescent(Font.Style); + Debug.Assert(gdiValueDescent == CellDescent); + int gdiValueLineSpacing = Font.FontFamily.GetLineSpacing(Font.Style); + Debug.Assert(gdiValueLineSpacing == CellSpace); +#endif +#if DEBUG_ && WPF && !SILVERLIGHT + int wpfValueLineSpacing = (int)Math.Round(Family.LineSpacing * _descriptor.UnitsPerEm); + Debug.Assert(wpfValueLineSpacing == CellSpace); +#endif + Debug.Assert(fm.UnitsPerEm == _descriptor.UnitsPerEm); + } + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + + /// + /// Gets the XFontFamily object associated with this XFont object. + /// + [Browsable(false)] + public XFontFamily FontFamily + { + get { return _glyphTypeface.FontFamily; } + } + + /// + /// WRONG: Gets the face name of this Font object. + /// Indeed it returns the font family name. + /// + // [Obsolete("This function returns the font family name, not the face name. Use xxx.FontFamily.Name or xxx.FaceName")] + public string Name + { + get { return _glyphTypeface.FontFamily.Name; } + } + + internal string FaceName + { + get { return _glyphTypeface.FaceName; } + } + + /// + /// Gets the em-size of this font measured in the unit of this font object. + /// + public double Size + { + get { return _emSize; } + } + readonly double _emSize; + + /// + /// Gets style information for this Font object. + /// + [Browsable(false)] + public XFontStyle Style + { + get { return _style; } + } + readonly XFontStyle _style; + + /// + /// Indicates whether this XFont object is bold. + /// + public bool Bold + { + get { return (_style & XFontStyle.Bold) == XFontStyle.Bold; } + } + + /// + /// Indicates whether this XFont object is italic. + /// + public bool Italic + { + get { return (_style & XFontStyle.Italic) == XFontStyle.Italic; } + } + + /// + /// Indicates whether this XFont object is stroke out. + /// + public bool Strikeout + { + get { return (_style & XFontStyle.Strikeout) == XFontStyle.Strikeout; } + } + + /// + /// Indicates whether this XFont object is underlined. + /// + public bool Underline + { + get { return (_style & XFontStyle.Underline) == XFontStyle.Underline; } + } + + /// + /// Temporary HACK for XPS to PDF converter. + /// + internal bool IsVertical + { + get { return _isVertical; } + set { _isVertical = value; } + } + bool _isVertical; + + + /// + /// Gets the PDF options of the font. + /// + public XPdfFontOptions PdfOptions + { + get { return _pdfOptions ?? (_pdfOptions = new XPdfFontOptions()); } + } + XPdfFontOptions _pdfOptions; + + /// + /// Indicates whether this XFont is encoded as Unicode. + /// + internal bool Unicode + { + get { return _pdfOptions != null && _pdfOptions.FontEncoding == PdfFontEncoding.Unicode; } + } + + /// + /// Gets the cell space for the font. The CellSpace is the line spacing, the sum of CellAscent and CellDescent and optionally some extra space. + /// + public int CellSpace + { + get { return _cellSpace; } + internal set { _cellSpace = value; } + } + int _cellSpace; + + /// + /// Gets the cell ascent, the area above the base line that is used by the font. + /// + public int CellAscent + { + get { return _cellAscent; } + internal set { _cellAscent = value; } + } + int _cellAscent; + + /// + /// Gets the cell descent, the area below the base line that is used by the font. + /// + public int CellDescent + { + get { return _cellDescent; } + internal set { _cellDescent = value; } + } + int _cellDescent; + + /// + /// Gets the font metrics. + /// + /// The metrics. + public XFontMetrics Metrics + { + get + { + // Code moved to InitializeFontMetrics(). + //if (_fontMetrics == null) + //{ + // FontDescriptor descriptor = FontDescriptorStock.Global.CreateDescriptor(this); + // _fontMetrics = new XFontMetrics(descriptor.FontName, descriptor.UnitsPerEm, descriptor.Ascender, descriptor.Descender, + // descriptor.Leading, descriptor.LineSpacing, descriptor.CapHeight, descriptor.XHeight, descriptor.StemV, 0, 0, 0); + //} + Debug.Assert(_fontMetrics != null, "InitializeFontMetrics() not yet called."); + return _fontMetrics; + } + } + XFontMetrics _fontMetrics; + + /// + /// Returns the line spacing, in pixels, of this font. The line spacing is the vertical distance + /// between the base lines of two consecutive lines of text. Thus, the line spacing includes the + /// blank space between lines along with the height of the character itself. + /// + public double GetHeight() + { + double value = CellSpace * _emSize / UnitsPerEm; +#if CORE || NETFX_CORE || UWP + return value; +#endif +#if GDI && !WPF +#if DEBUG_ + double gdiValue = Font.GetHeight(); + Debug.Assert(DoubleUtil.AreRoughlyEqual(gdiValue, value, 5)); +#endif + return value; +#endif +#if WPF && !GDI + return value; +#endif +#if WPF && GDI // Testing only + return value; +#endif + } + + /// + /// Returns the line spacing, in the current unit of a specified Graphics object, of this font. + /// The line spacing is the vertical distance between the base lines of two consecutive lines of + /// text. Thus, the line spacing includes the blank space between lines along with the height of + /// + [Obsolete("Use GetHeight() without parameter.")] + public double GetHeight(XGraphics graphics) + { +#if true + throw new InvalidOperationException("Honestly: Use GetHeight() without parameter!"); +#else +#if CORE || NETFX_CORE + double value = CellSpace * _emSize / UnitsPerEm; + return value; +#endif +#if GDI && !WPF + if (graphics._gfx != null) // #MediumTrust + { + double value = Font.GetHeight(graphics._gfx); + Debug.Assert(value == Font.GetHeight(graphics._gfx.DpiY)); + double value2 = CellSpace * _emSize / UnitsPerEm; + Debug.Assert(value - value2 < 1e-3, "??"); + return Font.GetHeight(graphics._gfx); + } + return CellSpace * _emSize / UnitsPerEm; +#endif +#if WPF && !GDI + double value = CellSpace * _emSize / UnitsPerEm; + return value; +#endif +#if GDI && WPF // Testing only + if (graphics.TargetContext == XGraphicTargetContext.GDI) + { +#if DEBUG + double value = Font.GetHeight(graphics._gfx); + + // 2355*(0.3/2048)*96 = 33.11719 + double myValue = CellSpace * (_emSize / (96 * UnitsPerEm)) * 96; + myValue = CellSpace * _emSize / UnitsPerEm; + //Debug.Assert(value == myValue, "??"); + //Debug.Assert(value - myValue < 1e-3, "??"); +#endif + return Font.GetHeight(graphics._gfx); + } + + if (graphics.TargetContext == XGraphicTargetContext.WPF) + { + double value = CellSpace * _emSize / UnitsPerEm; + return value; + } + // ReSharper disable HeuristicUnreachableCode + Debug.Fail("Either GDI or WPF."); + return 0; + // ReSharper restore HeuristicUnreachableCode +#endif +#endif + } + + /// + /// Gets the line spacing of this font. + /// + [Browsable(false)] + public int Height + { + // Implementation from System.Drawing.Font.cs + get { return (int)Math.Ceiling(GetHeight()); } + } + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + internal XGlyphTypeface GlyphTypeface + { + get { return _glyphTypeface; } + } + XGlyphTypeface _glyphTypeface; + + + internal OpenTypeDescriptor Descriptor + { + get { return _descriptor; } + private set { _descriptor = value; } + } + OpenTypeDescriptor _descriptor; + + + internal string FamilyName + { + get { return _familyName; } + } + string _familyName; + + + internal int UnitsPerEm + { + get { return _unitsPerEm; } + private set { _unitsPerEm = value; } + } + internal int _unitsPerEm; + + /// + /// Override style simulations by using the value of StyleSimulations. + /// + internal bool OverrideStyleSimulations; + + /// + /// Used to enforce style simulations by renderer. For development purposes only. + /// + internal XStyleSimulations StyleSimulations; + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + +#if CORE || GDI + /// + /// Gets the GDI family. + /// + /// The GDI family. + public GdiFontFamily GdiFontFamily + { + get { return _gdiFontFamily; } + } + readonly GdiFontFamily _gdiFontFamily; + + internal GdiFont GdiFont + { + get { return _gdiFont; } + } + Font _gdiFont; + + internal static XFontStyle FontStyleFrom(GdiFont font) + { + return + (font.Bold ? XFontStyle.Bold : 0) | + (font.Italic ? XFontStyle.Italic : 0) | + (font.Strikeout ? XFontStyle.Strikeout : 0) | + (font.Underline ? XFontStyle.Underline : 0); + } + +#if true || UseGdiObjects + /// + /// Implicit conversion form Font to XFont + /// + public static implicit operator XFont(GdiFont font) + { + return new XFont(font); + } +#endif +#endif + +#if WPF + /// + /// Gets the WPF font family. + /// Can be null. + /// + internal WpfFontFamily WpfFontFamily + { + get { return _wpfFontFamily; } + } + WpfFontFamily _wpfFontFamily; + + internal WpfTypeface WpfTypeface + { + get { return _wpfTypeface; } + } + WpfTypeface _wpfTypeface; +#endif + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + + /// + /// Cache PdfFontTable.FontSelector to speed up finding the right PdfFont + /// if this font is used more than once. + /// + internal string Selector + { + get { return _selector; } + set { _selector = value; } + } + string _selector; + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + // ReSharper disable UnusedMember.Local + string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get { return String.Format(CultureInfo.InvariantCulture, "font=('{0}' {1:0.##})", Name, Size); } + } + } +} diff --git a/PdfSharp/Drawing/XFontFamily.cs b/PdfSharp/Drawing/XFontFamily.cs new file mode 100644 index 0000000..b259d46 --- /dev/null +++ b/PdfSharp/Drawing/XFontFamily.cs @@ -0,0 +1,319 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if CORE || GDI +using System.Drawing; +using GdiFont = System.Drawing.Font; +using GdiFontFamily = System.Drawing.FontFamily; +using GdiFontStyle = System.Drawing.FontStyle; +#endif +#if WPF +using System.Windows.Media; +using System.Windows.Markup; +using WpfFontFamily = System.Windows.Media.FontFamily; +using WpfFontStyle = System.Windows.FontStyle; +#endif +using PdfSharp.Fonts; +using PdfSharp.Fonts.OpenType; + +namespace PdfSharp.Drawing +{ + /// + /// Defines a group of typefaces having a similar basic design and certain variations in styles. + /// + public sealed class XFontFamily + { + /// + /// Initializes a new instance of the class. + /// + /// The family name of a font. + public XFontFamily(string familyName) + { + FamilyInternal = FontFamilyInternal.GetOrCreateFromName(familyName, true); + } + + internal XFontFamily(string familyName, bool createPlatformObjects) + { + FamilyInternal = FontFamilyInternal.GetOrCreateFromName(familyName, createPlatformObjects); + } + + /// + /// Initializes a new instance of the class from FontFamilyInternal. + /// + XFontFamily(FontFamilyInternal fontFamilyInternal) + { + FamilyInternal = fontFamilyInternal; + } + +#if CORE || GDI + //public XFontFamily(GdiFontFamily gdiFontFamily) + //{ + // FamilyInternal = FontFamilyInternal.GetOrCreateFromGdi(gdiFontFamily); + //} +#endif + +#if WPF + //public XFontFamily(WpfFontFamily wpfFontFamily) + //{ + // FamilyInternal = FontFamilyInternal.GetOrCreateFromWpf(wpfFontFamily); + // //// HACK + // //int idxHash = _name.LastIndexOf('#'); + // //if (idxHash > 0) + // // _name = _name.Substring(idxHash + 1); + // //_wpfFamily = family; + //} +#endif + + internal static XFontFamily CreateFromName_not_used(string name, bool createPlatformFamily) + { + XFontFamily fontFamily = new XFontFamily(name); + if (createPlatformFamily) + { +#if GDI + //fontFamily._gdiFamily = new System.Drawing.FontFamily(name); +#endif +#if WPF + //fontFamily._wpfFamily = new System.Windows.Media.FontFamily(name); +#endif + } + return fontFamily; + } + + /// + /// An XGlyphTypeface for a font source that comes from a custom font resolver + /// creates a solitary font family exclusively for it. + /// + internal static XFontFamily GetOrCreateFontFamily(string name) + { + // Custom font resolver face names must not clash with platform family names. + FontFamilyInternal fontFamilyInternal = FontFamilyCache.GetFamilyByName(name); + if (fontFamilyInternal == null) + { + fontFamilyInternal = FontFamilyInternal.GetOrCreateFromName(name, false); + fontFamilyInternal = FontFamilyCache.CacheOrGetFontFamily(fontFamilyInternal); + } + + // Create font family and save it in cache. Do not try to create platform objects. + return new XFontFamily(fontFamilyInternal); + } + +#if CORE || GDI + internal static XFontFamily GetOrCreateFromGdi(GdiFont font) + { + FontFamilyInternal fontFamilyInternal = FontFamilyInternal.GetOrCreateFromGdi(font.FontFamily); + return new XFontFamily(fontFamilyInternal); + } +#endif + +#if WPF + internal static XFontFamily GetOrCreateFromWpf(WpfFontFamily wpfFontFamily) + { + FontFamilyInternal fontFamilyInternal = FontFamilyInternal.GetOrCreateFromWpf(wpfFontFamily); + return new XFontFamily(fontFamilyInternal); + } +#endif +#if SILVERLIGHT + //internal static XFontFamily CreateFromWpf(System.Windows.Media.FontFamily wpfFontFamily) + //{ + // XFontFamily fontFamily = new XFontFamily(wpfFontFamily.FamilyNames[XmlLanguage.GetLanguage("en")]); + // fontFamily._wpfFamily = wpfFontFamily; + // return fontFamily; + //} +#endif + + /// + /// Gets the name of the font family. + /// + public string Name + { + get { return FamilyInternal.Name; } + } + +#if true__ + public double LineSpacing + { + get + { + WpfFamily.FamilyTypefaces[0].UnderlineThickness + } + } + +#endif + + /// + /// Returns the cell ascent, in design units, of the XFontFamily object of the specified style. + /// + public int GetCellAscent(XFontStyle style) + { + OpenTypeDescriptor descriptor = (OpenTypeDescriptor)FontDescriptorCache.GetOrCreateDescriptor(Name, style); + int result = descriptor.Ascender; +#if DEBUG_ && GDI + int gdiValue = _gdiFamily.GetCellAscent((FontStyle)style); + Debug.Assert(gdiValue == result); +#endif + return result; + } + + /// + /// Returns the cell descent, in design units, of the XFontFamily object of the specified style. + /// + public int GetCellDescent(XFontStyle style) + { + OpenTypeDescriptor descriptor = (OpenTypeDescriptor)FontDescriptorCache.GetOrCreateDescriptor(Name, style); + int result = descriptor.Descender; +#if DEBUG_ && GDI + int gdiValue = _gdiFamily.GetCellDescent((FontStyle)style); + Debug.Assert(gdiValue == result); +#endif + return result; + } + + /// + /// Gets the height, in font design units, of the em square for the specified style. + /// + public int GetEmHeight(XFontStyle style) + { + OpenTypeDescriptor descriptor = (OpenTypeDescriptor)FontDescriptorCache.GetOrCreateDescriptor(Name, style); + int result = descriptor.UnitsPerEm; +#if DEBUG_ && GDI + int gdiValue = _gdiFamily.GetEmHeight((FontStyle)style); + Debug.Assert(gdiValue == result); +#endif +#if DEBUG_ + int headValue = descriptor.FontFace.head.unitsPerEm; + Debug.Assert(headValue == result); +#endif + return result; + } + + /// + /// Returns the line spacing, in design units, of the FontFamily object of the specified style. + /// The line spacing is the vertical distance between the base lines of two consecutive lines of text. + /// + public int GetLineSpacing(XFontStyle style) + { + OpenTypeDescriptor descriptor = (OpenTypeDescriptor)FontDescriptorCache.GetOrCreateDescriptor(Name, style); + int result = descriptor.LineSpacing; +#if DEBUG_ && GDI + int gdiValue = _gdiFamily.GetLineSpacing((FontStyle)style); + Debug.Assert(gdiValue == result); +#endif +#if DEBUG_ && WPF && !SILVERLIGHT + int wpfValue = (int)Math.Round(_wpfFamily.LineSpacing * GetEmHeight(style)); + Debug.Assert(wpfValue == result); +#endif + return result; + } + + //public string GetName(int language); + + /// + /// Indicates whether the specified FontStyle enumeration is available. + /// + public bool IsStyleAvailable(XFontStyle style) + { + XGdiFontStyle xStyle = ((XGdiFontStyle)style) & XGdiFontStyle.BoldItalic; +#if CORE + throw new InvalidOperationException("In CORE build it is the responsibility of the developer to provide all required font faces."); +#endif +#if GDI && !WPF + if (GdiFamily != null) + return GdiFamily.IsStyleAvailable((GdiFontStyle)xStyle); + return false; +#endif +#if WPF && !GDI + if (WpfFamily != null) + return FontHelper.IsStyleAvailable(this, xStyle); + return false; +#endif +#if WPF && GDI +#if DEBUG + //bool gdiResult = _gdiFamily.IsStyle Available((FontStyle)style); + //bool wpfResult = FontHelper.IsStyle Available(this, style); + //// TODOWPF: check when fails + //Debug.Assert(gdiResult == wpfResult, "GDI+ and WPF provide different values."); +#endif + return FontHelper.IsStyleAvailable(this, xStyle); +#endif +#if NETFX_CORE || UWP + throw new InvalidOperationException("In NETFX_CORE build it is the responsibility of the developer to provide all required font faces."); +#endif + } + + /// + /// Returns an array that contains all the FontFamily objects associated with the current graphics context. + /// + [Obsolete("Use platform API directly.")] + public static XFontFamily[] Families + { + get + { + throw new InvalidOperationException("Obsolete and not implemted any more."); + } + } + + /// + /// Returns an array that contains all the FontFamily objects available for the specified + /// graphics context. + /// + [Obsolete("Use platform API directly.")] + public static XFontFamily[] GetFamilies(XGraphics graphics) + { + throw new InvalidOperationException("Obsolete and not implemted any more."); + } + +#if GDI + /// + /// Gets the underlying GDI+ font family object. + /// Is null if the font was created by a font resolver. + /// + internal GdiFontFamily GdiFamily + { + get { return FamilyInternal.GdiFamily; } + } +#endif + +#if WPF + /// + /// Gets the underlying WPF font family object. + /// Is null if the font was created by a font resolver. + /// + internal WpfFontFamily WpfFamily + { + get { return FamilyInternal.WpfFamily; } + } +#endif + + /// + /// The implementation sigleton of font family; + /// + internal FontFamilyInternal FamilyInternal; + } +} diff --git a/PdfSharp/Drawing/XFontMetrics.cs b/PdfSharp/Drawing/XFontMetrics.cs new file mode 100644 index 0000000..23fee88 --- /dev/null +++ b/PdfSharp/Drawing/XFontMetrics.cs @@ -0,0 +1,203 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Collects information of a font. + /// + public sealed class XFontMetrics + { + internal XFontMetrics(string name, int unitsPerEm, int ascent, int descent, int leading, int lineSpacing, + int capHeight, int xHeight, int stemV, int stemH, int averageWidth, int maxWidth , + int underlinePosition, int underlineThickness, int strikethroughPosition, int strikethroughThickness) + { + _name = name; + _unitsPerEm = unitsPerEm; + _ascent = ascent; + _descent = descent; + _leading = leading; + _lineSpacing = lineSpacing; + _capHeight = capHeight; + _xHeight = xHeight; + _stemV = stemV; + _stemH = stemH; + _averageWidth = averageWidth; + _maxWidth = maxWidth; + _underlinePosition = underlinePosition; + _underlineThickness = underlineThickness; + _strikethroughPosition = strikethroughPosition; + _strikethroughThickness = strikethroughThickness; + } + + /// + /// Gets the font name. + /// + public string Name + { + get { return _name; } + } + readonly string _name; + + /// + /// Gets the ascent value. + /// + public int UnitsPerEm + { + get { return _unitsPerEm; } + } + readonly int _unitsPerEm; + + /// + /// Gets the ascent value. + /// + public int Ascent + { + get { return _ascent; } + } + readonly int _ascent; + + /// + /// Gets the descent value. + /// + public int Descent + { + get { return _descent; } + } + readonly int _descent; + + /// + /// Gets the average width. + /// + public int AverageWidth + { + get { return _averageWidth; } + } + readonly int _averageWidth; + + /// + /// Gets the height of capital letters. + /// + public int CapHeight + { + get { return _capHeight; } + } + readonly int _capHeight; + + /// + /// Gets the leading value. + /// + public int Leading + { + get { return _leading; } + } + readonly int _leading; + + /// + /// Gets the line spacing value. + /// + public int LineSpacing + { + get { return _lineSpacing; } + } + readonly int _lineSpacing; + + /// + /// Gets the maximum width of a character. + /// + public int MaxWidth + { + get { return _maxWidth; } + } + readonly int _maxWidth; + + /// + /// Gets an internal value. + /// + public int StemH + { + get { return _stemH; } + } + readonly int _stemH; + + /// + /// Gets an internal value. + /// + public int StemV + { + get { return _stemV; } + } + readonly int _stemV; + + /// + /// Gets the height of a lower-case character. + /// + public int XHeight + { + get { return _xHeight; } + } + readonly int _xHeight; + + /// + /// Gets the underline position. + /// + public int UnderlinePosition + { + get { return _underlinePosition; } + } + readonly int _underlinePosition; + + /// + /// Gets the underline thicksness. + /// + public int UnderlineThickness + { + get { return _underlineThickness; } + } + readonly int _underlineThickness; + + /// + /// Gets the strikethrough position. + /// + public int StrikethroughPosition + { + get { return _strikethroughPosition; } + } + readonly int _strikethroughPosition; + + /// + /// Gets the strikethrough thicksness. + /// + public int StrikethroughThickness + { + get { return _strikethroughThickness; } + } + readonly int _strikethroughThickness; + } +} diff --git a/PdfSharp/Drawing/XFontSource.cs b/PdfSharp/Drawing/XFontSource.cs new file mode 100644 index 0000000..9c11422 --- /dev/null +++ b/PdfSharp/Drawing/XFontSource.cs @@ -0,0 +1,299 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Runtime.InteropServices; +using PdfSharp.Fonts; +#if CORE || GDI +using GdiFont = System.Drawing.Font; +using GdiFontStyle = System.Drawing.FontStyle; +#endif +#if WPF +using System.Windows; +using System.Windows.Documents; +using System.Windows.Media; +using WpfFontFamily = System.Windows.Media.FontFamily; +using WpfTypeface = System.Windows.Media.Typeface; +using WpfGlyphTypeface = System.Windows.Media.GlyphTypeface; +#endif +using PdfSharp.Internal; +using PdfSharp.Fonts.OpenType; + +namespace PdfSharp.Drawing +{ + /// + /// The bytes of a font file. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + internal class XFontSource + { + // Implementation Notes + // + // * XFontSource represents a single font (file) in memory. + // * An XFontSource hold a reference to it OpenTypeFontface. + // * To prevent large heap fragmentation this class must exists only once. + // * TODO: ttcf + + // Signature of a true type collection font. + const uint ttcf = 0x66637474; + + XFontSource(byte[] bytes, ulong key) + { + _fontName = null; + _bytes = bytes; + _key = key; + } + + /// + /// Gets an existing font source or creates a new one. + /// A new font source is cached in font factory. + /// + public static XFontSource GetOrCreateFrom(byte[] bytes) + { + ulong key = FontHelper.CalcChecksum(bytes); + XFontSource fontSource; + if (!FontFactory.TryGetFontSourceByKey(key, out fontSource)) + { + fontSource = new XFontSource(bytes, key); + // Theoretically the font source could be created by a differend thread in the meantime. + fontSource = FontFactory.CacheFontSource(fontSource); + } + return fontSource; + } + +#if CORE || GDI + internal static XFontSource GetOrCreateFromGdi(string typefaceKey, GdiFont gdiFont) + { + byte[] bytes = ReadFontBytesFromGdi(gdiFont); + XFontSource fontSource = GetOrCreateFrom(typefaceKey, bytes); + return fontSource; + } + + static byte[] ReadFontBytesFromGdi(GdiFont gdiFont) + { + // Weird: LastError is always 123 or 127. Comment out Debug.Assert. + int error = Marshal.GetLastWin32Error(); + //Debug.Assert(error == 0); + error = Marshal.GetLastWin32Error(); + //Debug.Assert(error == 0); + + IntPtr hfont = gdiFont.ToHfont(); +#if true + IntPtr hdc = NativeMethods.GetDC(IntPtr.Zero); +#else + NativeMethods.LOGFONT logFont = new NativeMethods.LOGFONT(); + logFont.lfHeight = 30; + logFont.lfWidth = 0; + logFont.lfEscapement = 0; + logFont.lfOrientation = 0; + logFont.lfWeight = 400; + logFont.lfItalic = 0; + logFont.lfUnderline = 0; + logFont.lfStrikeOut = 0; + logFont.lfCharSet = 0; + logFont.lfOutPrecision = 0; + logFont.lfClipPrecision = 0; + logFont.lfQuality = 0; + logFont.lfPitchAndFamily = 0; + logFont.lfFaceName = "Arial"; + + gdiFont.ToLogFont(logFont); + + hfont = NativeMethods.CreateFontIndirect(logFont); + + + // IntPtr hdc = NativeMethods.CreateDC("DISPLAY", null, null, IntPtr.Zero); + IntPtr hdc = NativeMethods.CreateCompatibleDC(IntPtr.Zero); +#endif + error = Marshal.GetLastWin32Error(); + //Debug.Assert(error == 0); + + IntPtr oldFont = NativeMethods.SelectObject(hdc, hfont); + error = Marshal.GetLastWin32Error(); + //Debug.Assert(error == 0); + + // Get size of the font file. + bool isTtcf = false; + // In Azure I get 0xc0000022 + int size = NativeMethods.GetFontData(hdc, 0, 0, null, 0); + + // Check for ntstatus.h: #define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L) + if ((uint)size == 0xc0000022) + throw new InvalidOperationException("Microsoft Azure returns STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L) from GetFontData. This is a bug in Azure. You must implement a FontResolver to circumvent this issue."); + + if (size == NativeMethods.GDI_ERROR) + { + // Assume that the font file is a true type collection. + size = NativeMethods.GetFontData(hdc, ttcf, 0, null, 0); + isTtcf = true; + } + error = Marshal.GetLastWin32Error(); + //Debug.Assert(error == 0); + + if (size == 0) + throw new InvalidOperationException("Cannot retrieve font data."); + + byte[] bytes = new byte[size]; + int effectiveSize = NativeMethods.GetFontData(hdc, isTtcf ? ttcf : 0, 0, bytes, size); + Debug.Assert(size == effectiveSize); + // Clean up. + NativeMethods.SelectObject(hdc, oldFont); + NativeMethods.ReleaseDC(IntPtr.Zero, hdc); + + return bytes; + } +#endif + +#if WPF && !SILVERLIGHT + internal static XFontSource GetOrCreateFromWpf(string typefaceKey, WpfGlyphTypeface wpfGlyphTypeface) + { + byte[] bytes = ReadFontBytesFromWpf(wpfGlyphTypeface); + XFontSource fontSource = GetOrCreateFrom(typefaceKey, bytes); + return fontSource; + } + + internal static byte[] ReadFontBytesFromWpf(WpfGlyphTypeface wpfGlyphTypeface) + { + using (Stream fontStream = wpfGlyphTypeface.GetFontStream()) + { + if (fontStream == null) + throw new InvalidOperationException("Cannot retrieve font data."); + int size = (int)fontStream.Length; + byte[] bytes = new byte[size]; + fontStream.Read(bytes, 0, size); + return bytes; + } + } +#endif + + static XFontSource GetOrCreateFrom(string typefaceKey, byte[] fontBytes) + { + XFontSource fontSource; + ulong key = FontHelper.CalcChecksum(fontBytes); + if (FontFactory.TryGetFontSourceByKey(key, out fontSource)) + { + // The font source already exists, but is not yet cached under the specified typeface key. + FontFactory.CacheExistingFontSourceWithNewTypefaceKey(typefaceKey, fontSource); + } + else + { + // No font source exists. Create new one and cache it. + fontSource = new XFontSource(fontBytes, key); + FontFactory.CacheNewFontSource(typefaceKey, fontSource); + } + return fontSource; + } + + public static XFontSource CreateCompiledFont(byte[] bytes) + { + XFontSource fontSource = new XFontSource(bytes, 0); + return fontSource; + } + + /// + /// Gets or sets the fontface. + /// + internal OpenTypeFontface Fontface + { + get { return _fontface; } + set + { + _fontface = value; + _fontName = value.name.FullFontName; + } + } + OpenTypeFontface _fontface; + + /// + /// Gets the key that uniquely identifies this font source. + /// + internal ulong Key + { + get + { + if (_key == 0) + _key = FontHelper.CalcChecksum(Bytes); + return _key; + } + } + ulong _key; + + public void IncrementKey() + { + // HACK: Depends on implementation of CalcChecksum. + // Increment check sum and keep length untouched. + _key += 1ul << 32; + } + + /// + /// Gets the name of the font's name table. + /// + public string FontName + { + get { return _fontName; } + } + string _fontName; + + /// + /// Gets the bytes of the font. + /// + public byte[] Bytes + { + get { return _bytes; } + } + readonly byte[] _bytes; + + public override int GetHashCode() + { + return (int)((Key >> 32) ^ Key); + } + + public override bool Equals(object obj) + { + XFontSource fontSource = obj as XFontSource; + if (fontSource == null) + return false; + return Key == fontSource.Key; + } + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + // ReSha rper disable UnusedMember.Local + internal string DebuggerDisplay + // ReShar per restore UnusedMember.Local + { + // The key is converted to a value a human can remember during debugging. + get { return String.Format(CultureInfo.InvariantCulture, "XFontSource: '{0}', keyhash={1}", FontName, Key % 99991 /* largest prime number less than 100000 */); } + } + } +} diff --git a/PdfSharp/Drawing/XFontStretch.cs b/PdfSharp/Drawing/XFontStretch.cs new file mode 100644 index 0000000..5c8ef58 --- /dev/null +++ b/PdfSharp/Drawing/XFontStretch.cs @@ -0,0 +1,53 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ +#if PDFSHARP20 + enum FontStretchValues + { + UltraCondensed = 1, + ExtraCondensed = 2, + Condensed = 3, + SemiCondensed = 4, + Normal = 5, + SemiExpanded = 6, + Expanded = 7, + ExtraExpanded = 8, + UltraExpanded = 9, + } + + /// + /// NYI. Reserved for future extensions of PDFsharp. + /// + // [DebuggerDisplay("'{Name}', {Size}")] + public class XFontStretch + { } +#endif +} diff --git a/PdfSharp/Drawing/XFontWeight.cs b/PdfSharp/Drawing/XFontWeight.cs new file mode 100644 index 0000000..ea1f785 --- /dev/null +++ b/PdfSharp/Drawing/XFontWeight.cs @@ -0,0 +1,174 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +#endif + +// Not used in PDFsharp 1.x. + +namespace PdfSharp.Drawing +{ +#if true_ // PDFSHARP20 + /// + /// Defines the density of a typeface, in terms of the lightness or heaviness of the strokes. + /// + [DebuggerDisplay("'{Weight}'")] + public class XFontWeight : IFormattable + { + internal XFontWeight(int weight) + { + _weight = weight; + } + + /// + /// Gets the weight of the font, a value between 1 and 999. + /// + public int Weight + { + get { return (_weight); } + } + private readonly int _weight; + + //public static XFontWeight FromOpenTypeWeight(int weightValue) + //{ + // if (weightValue < 1 || weightValue > 999) + // throw new ArgumentOutOfRangeException("weightValue", "Parameter must be between 1 and 999."); + // return new XFontWeight(weightValue); + //} + + /// + /// Compares the specified font weights. + /// + public static int Compare(XFontWeight left, XFontWeight right) + { + return left._weight - right._weight; + } + + /// + /// Implements the operator <. + /// + public static bool operator <(XFontWeight left, XFontWeight right) + { + return Compare(left, right) < 0; + } + + /// + /// Implements the operator <=. + /// + public static bool operator <=(XFontWeight left, XFontWeight right) + { + return Compare(left, right) <= 0; + } + + /// + /// Implements the operator >. + /// + public static bool operator >(XFontWeight left, XFontWeight right) + { + return Compare(left, right) > 0; + } + + /// + /// Implements the operator >=. + /// + public static bool operator >=(XFontWeight left, XFontWeight right) + { + return Compare(left, right) >= 0; + } + + /// + /// Implements the operator ==. + /// + public static bool operator ==(XFontWeight left, XFontWeight right) + { + return Compare(left, right) == 0; + } + + /// + /// Implements the operator !=. + /// + public static bool operator !=(XFontWeight left, XFontWeight right) + { + return !(left == right); + } + + /// + /// Determines whether the specified is equal to the current . + /// + public bool Equals(XFontWeight obj) + { + return this == obj; + } + + /// + /// Determines whether the specified is equal to the current . + /// + public override bool Equals(object obj) + { + return (obj is XFontWeight) && this == ((XFontWeight)obj); + } + + /// + /// Serves as a hash function for this type. + /// + public override int GetHashCode() + { + return Weight; + } + + /// + /// Returns a that represents the current . + /// + public override string ToString() + { + return ConvertToString(null, null); + } + + string IFormattable.ToString(string format, IFormatProvider provider) + { + return ConvertToString(format, provider); + } + + internal string ConvertToString(string format, IFormatProvider provider) + { + provider = provider ?? CultureInfo.InvariantCulture; + string str; + if (!XFontWeights.FontWeightToString(Weight, out str)) + return Weight.ToString(format, provider); + return str; + } + } +#endif +} diff --git a/PdfSharp/Drawing/XFontWeights.cs b/PdfSharp/Drawing/XFontWeights.cs new file mode 100644 index 0000000..f2bdea2 --- /dev/null +++ b/PdfSharp/Drawing/XFontWeights.cs @@ -0,0 +1,309 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// Not used in PDFsharp 1.x. + +namespace PdfSharp.Drawing +{ + enum FontWeightValues + { + Thin = 100, + ExtraLight = 200, + Light = 300, + Normal = 400, + Medium = 500, + SemiBold = 600, + Bold = 700, + ExtraBold = 800, + Black = 900, + ExtraBlack = 950, + } + +#if true_ // PDFSHARP20 + /// + /// Defines a set of static predefined XFontWeight values. + /// + public static class XFontWeights + { + internal static bool FontWeightStringToKnownWeight(string s, IFormatProvider provider, ref XFontWeight fontWeight) + { + int num; + switch (s.ToLower()) + { + case "thin": + fontWeight = Thin; + return true; + + case "extralight": + fontWeight = ExtraLight; + return true; + + case "ultralight": + fontWeight = UltraLight; + return true; + + case "light": + fontWeight = Light; + return true; + + case "normal": + fontWeight = Normal; + return true; + + case "regular": + fontWeight = Regular; + return true; + + case "medium": + fontWeight = Medium; + return true; + + case "semibold": + fontWeight = SemiBold; + return true; + + case "demibold": + fontWeight = DemiBold; + return true; + + case "bold": + fontWeight = Bold; + return true; + + case "extrabold": + fontWeight = ExtraBold; + return true; + + case "ultrabold": + fontWeight = UltraBold; + return true; + + case "heavy": + fontWeight = Heavy; + return true; + + case "black": + fontWeight = Black; + return true; + + case "extrablack": + fontWeight = ExtraBlack; + return true; + + case "ultrablack": + fontWeight = UltraBlack; + return true; + } + + if (Int32.TryParse(s, NumberStyles.Integer, provider, out num)) + { + fontWeight = new XFontWeight(num); + return true; + } + return false; + } + + internal static bool FontWeightToString(int weight, out string convertedValue) + { + switch (weight) + { + case 100: + convertedValue = "Thin"; + return true; + + case 200: + convertedValue = "ExtraLight"; + return true; + + case 300: + convertedValue = "Light"; + return true; + + case 400: + convertedValue = "Normal"; + return true; + + case 500: + convertedValue = "Medium"; + return true; + + case 600: + convertedValue = "SemiBold"; + return true; + + case 700: + convertedValue = "Bold"; + return true; + + case 800: + convertedValue = "ExtraBold"; + return true; + + case 900: + convertedValue = "Black"; + return true; + + case 950: + convertedValue = "ExtraBlack"; + return true; + } + convertedValue = null; + return false; + } + + /// + /// Specifies a "Thin" font weight. + /// + public static XFontWeight Thin + { + get { return new XFontWeight(100); } + } + + /// + /// Specifies a "ExtraLight" font weight. + /// + public static XFontWeight ExtraLight + { + get { return new XFontWeight(200); } + } + + /// + /// Specifies a "UltraLight" font weight. + /// + public static XFontWeight UltraLight + { + get { return new XFontWeight(200); } + } + + /// + /// Specifies a "Light" font weight. + /// + public static XFontWeight Light + { + get { return new XFontWeight(300); } + } + + /// + /// Specifies a "Normal" font weight. + /// + public static XFontWeight Normal + { + get { return new XFontWeight(400); } + } + + /// + /// Specifies a "Regular" font weight. + /// + public static XFontWeight Regular + { + get { return new XFontWeight(400); } + } + + /// + /// Specifies a "Medium" font weight. + /// + public static XFontWeight Medium + { + get { return new XFontWeight(500); } + } + + /// + /// Specifies a "SemiBold" font weight. + /// + public static XFontWeight SemiBold + { + get { return new XFontWeight(600); } + } + + /// + /// Specifies a "DemiBold" font weight. + /// + public static XFontWeight DemiBold + { + get { return new XFontWeight(600); } + } + + /// + /// Specifies a "Bold" font weight. + /// + public static XFontWeight Bold + { + get { return new XFontWeight(700); } + } + + /// + /// Specifies a "ExtraBold" font weight. + /// + public static XFontWeight ExtraBold + { + get { return new XFontWeight(800); } + } + + /// + /// Specifies a "UltraBold" font weight. + /// + public static XFontWeight UltraBold + { + get { return new XFontWeight(800); } + } + + /// + /// Specifies a "Heavy" font weight. + /// + public static XFontWeight Heavy + { + get { return new XFontWeight(900); } + } + + /// + /// Specifies a "Black" font weight. + /// + public static XFontWeight Black + { + get { return new XFontWeight(900); } + } + + /// + /// Specifies a "ExtraBlack" font weight. + /// + public static XFontWeight ExtraBlack + { + get { return new XFontWeight(950); } + } + + /// + /// Specifies a "UltraBlack" font weight. + /// + public static XFontWeight UltraBlack + { + get { return new XFontWeight(950); } + } + } +#endif +} \ No newline at end of file diff --git a/PdfSharp/Drawing/XForm.cs b/PdfSharp/Drawing/XForm.cs new file mode 100644 index 0000000..47a6e80 --- /dev/null +++ b/PdfSharp/Drawing/XForm.cs @@ -0,0 +1,570 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.IO; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows.Media; +#endif +using PdfSharp.Drawing.Pdf; +using PdfSharp.Pdf; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.Filters; + +namespace PdfSharp.Drawing +{ + /// + /// Represents a graphical object that can be used to render retained graphics on it. + /// In GDI+ it is represented by a Metafile, in WPF by a DrawingVisual, and in PDF by a Form XObjects. + /// + public class XForm : XImage, IContentStream + { + internal enum FormState + { + /// + /// The form is an imported PDF page. + /// + NotATemplate, + + /// + /// The template is just created. + /// + Created, + + /// + /// XGraphics.FromForm() was called. + /// + UnderConstruction, + + /// + /// The form was drawn at least once and is 'frozen' now. + /// + Finished, + } + + /// + /// Initializes a new instance of the class. + /// + protected XForm() + { } + +#if GDI + /// + /// Initializes a new instance of the XForm class such that it can be drawn on the specified graphics + /// object. + /// + /// The graphics object that later is used to draw this form. + /// The size in points of the form. + public XForm(XGraphics gfx, XSize size) + { + if (gfx == null) + throw new ArgumentNullException("gfx"); + if (size.Width < 1 || size.Height < 1) + throw new ArgumentNullException("size", "The size of the XPdfForm is to small."); + + _formState = FormState.Created; + //templateSize = size; + _viewBox.Width = size.Width; + _viewBox.Height = size.Height; + + // If gfx belongs to a PdfPage also create the PdfFormXObject + if (gfx.PdfPage != null) + { + _document = gfx.PdfPage.Owner; + _pdfForm = new PdfFormXObject(_document, this); + PdfRectangle rect = new PdfRectangle(new XPoint(), size); + _pdfForm.Elements.SetRectangle(PdfFormXObject.Keys.BBox, rect); + } + } +#endif + +#if GDI + /// + /// Initializes a new instance of the XForm class such that it can be drawn on the specified graphics + /// object. + /// + /// The graphics object that later is used to draw this form. + /// The width of the form. + /// The height of the form. + public XForm(XGraphics gfx, XUnit width, XUnit height) + : this(gfx, new XSize(width, height)) + { } +#endif + + /// + /// Initializes a new instance of the class that represents a page of a PDF document. + /// + /// The PDF document. + /// The view box of the page. + public XForm(PdfDocument document, XRect viewBox) + { + if (viewBox.Width < 1 || viewBox.Height < 1) + throw new ArgumentNullException("viewBox", "The size of the XPdfForm is to small."); + // I must tie the XPdfForm to a document immediately, because otherwise I would have no place where + // to store the resources. + if (document == null) + throw new ArgumentNullException("document", "An XPdfForm template must be associated with a document at creation time."); + + _formState = FormState.Created; + _document = document; + _pdfForm = new PdfFormXObject(document, this); + //_templateSize = size; + _viewBox = viewBox; + PdfRectangle rect = new PdfRectangle(viewBox); + _pdfForm.Elements.SetRectangle(PdfFormXObject.Keys.BBox, rect); + } + + /// + /// Initializes a new instance of the class that represents a page of a PDF document. + /// + /// The PDF document. + /// The size of the page. + public XForm(PdfDocument document, XSize size) + : this(document, new XRect(0, 0, size.Width, size.Height)) + { + ////if (size.width < 1 || size.height < 1) + //// throw new ArgumentNullException("size", "The size of the XPdfForm is to small."); + ////// I must tie the XPdfForm to a document immediately, because otherwise I would have no place where + ////// to store the resources. + ////if (document == null) + //// throw new ArgumentNullException("document", "An XPdfForm template must be associated with a document."); + + ////_formState = FormState.Created; + ////_document = document; + ////pdfForm = new PdfFormXObject(document, this); + ////templateSize = size; + ////PdfRectangle rect = new PdfRectangle(new XPoint(), size); + ////pdfForm.Elements.SetRectangle(PdfFormXObject.Keys.BBox, rect); + } + + /// + /// Initializes a new instance of the class that represents a page of a PDF document. + /// + /// The PDF document. + /// The width of the page. + /// The height of the page + public XForm(PdfDocument document, XUnit width, XUnit height) + : this(document, new XRect(0, 0, width, height)) + { } + + /// + /// This function should be called when drawing the content of this form is finished. + /// The XGraphics object used for drawing the content is disposed by this function and + /// cannot be used for any further drawing operations. + /// PDFsharp automatically calls this function when this form was used the first time + /// in a DrawImage function. + /// + public void DrawingFinished() + { + if (_formState == FormState.Finished) + return; + + if (_formState == FormState.NotATemplate) + throw new InvalidOperationException("This object is an imported PDF page and you cannot finish drawing on it because you must not draw on it at all."); + + Finish(); + } + + /// + /// Called from XGraphics constructor that creates an instance that work on this form. + /// + internal void AssociateGraphics(XGraphics gfx) + { + if (_formState == FormState.NotATemplate) + throw new NotImplementedException("The current version of PDFsharp cannot draw on an imported page."); + + if (_formState == FormState.UnderConstruction) + throw new InvalidOperationException("An XGraphics object already exists for this form."); + + if (_formState == FormState.Finished) + throw new InvalidOperationException("After drawing a form it cannot be modified anymore."); + + Debug.Assert(_formState == FormState.Created); + _formState = FormState.UnderConstruction; + Gfx = gfx; + } + internal XGraphics Gfx; + + /// + /// Disposes this instance. + /// + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + } + + /// + /// Sets the form in the state FormState.Finished. + /// + internal virtual void Finish() + { +#if GDI + if (_formState == FormState.NotATemplate || _formState == FormState.Finished) + return; + + if (Gfx.Metafile != null) + _gdiImage = Gfx.Metafile; + + Debug.Assert(_formState == FormState.Created || _formState == FormState.UnderConstruction); + _formState = FormState.Finished; + Gfx.Dispose(); + Gfx = null; + + if (PdfRenderer != null) + { + //pdfForm.CreateStream(PdfEncoders.RawEncoding.GetBytes(PdfRenderer.GetContent())); + PdfRenderer.Close(); + Debug.Assert(PdfRenderer == null); + + if (_document.Options.CompressContentStreams) + { + _pdfForm.Stream.Value = Filtering.FlateDecode.Encode(_pdfForm.Stream.Value, _document.Options.FlateEncodeMode); + _pdfForm.Elements["/Filter"] = new PdfName("/FlateDecode"); + } + int length = _pdfForm.Stream.Length; + _pdfForm.Elements.SetInteger("/Length", length); + } +#endif +#if WPF +#endif + } + + /// + /// Gets the owning document. + /// + internal PdfDocument Owner + { + get { return _document; } + } + PdfDocument _document; + + /// + /// Gets the color model used in the underlying PDF document. + /// + internal PdfColorMode ColorMode + { + get + { + if (_document == null) + return PdfColorMode.Undefined; + return _document.Options.ColorMode; + } + } + + /// + /// Gets a value indicating whether this instance is a template. + /// + internal bool IsTemplate + { + get { return _formState != FormState.NotATemplate; } + } + internal FormState _formState; + + /// + /// Get the width of the page identified by the property PageNumber. + /// + [Obsolete("Use either PixelWidth or PointWidth. Temporarily obsolete because of rearrangements for WPF. Currently same as PixelWidth, but will become PointWidth in future releases of PDFsharp.")] + public override double Width + { + //get { return templateSize.width; } + get { return _viewBox.Width; } + } + + /// + /// Get the width of the page identified by the property PageNumber. + /// + [Obsolete("Use either PixelHeight or PointHeight. Temporarily obsolete because of rearrangements for WPF. Currently same as PixelHeight, but will become PointHeight in future releases of PDFsharp.")] + public override double Height + { + //get { return templateSize.height; } + get { return _viewBox.Height; } + } + + /// + /// Get the width in point of this image. + /// + public override double PointWidth + { + //get { return templateSize.width; } + get { return _viewBox.Width; } + } + + /// + /// Get the height in point of this image. + /// + public override double PointHeight + { + //get { return templateSize.height; } + get { return _viewBox.Height; } + } + + /// + /// Get the width of the page identified by the property PageNumber. + /// + public override int PixelWidth + { + //get { return (int)templateSize.width; } + get { return (int)_viewBox.Width; } + } + + /// + /// Get the height of the page identified by the property PageNumber. + /// + public override int PixelHeight + { + //get { return (int)templateSize.height; } + get { return (int)_viewBox.Height; } + } + + /// + /// Get the size of the page identified by the property PageNumber. + /// + public override XSize Size + { + //get { return templateSize; } + get { return _viewBox.Size; } + } + //XSize templateSize; + + /// + /// Gets the view box of the form. + /// + public XRect ViewBox + { + get { return _viewBox; } + } + XRect _viewBox; + + /// + /// Gets 72, the horizontal resolution by design of a form object. + /// + public override double HorizontalResolution + { + get { return 72; } + } + + /// + /// Gets 72 always, the vertical resolution by design of a form object. + /// + public override double VerticalResolution + { + get { return 72; } + } + + /// + /// Gets or sets the bounding box. + /// + public XRect BoundingBox + { + get { return _boundingBox; } + set { _boundingBox = value; } // TODO: pdfForm = null + } + XRect _boundingBox; + + /// + /// Gets or sets the transformation matrix. + /// + public virtual XMatrix Transform + { + get { return _transform; } + set + { + if (_formState == FormState.Finished) + throw new InvalidOperationException("After a XPdfForm was once drawn it must not be modified."); + _transform = value; + } + } + internal XMatrix _transform; + + internal PdfResources Resources + { + get + { + Debug.Assert(IsTemplate, "This function is for form templates only."); + return PdfForm.Resources; + //if (resources == null) + // resources = (PdfResources)pdfForm.Elements.GetValue(PdfFormXObject.Keys.Resources, VCF.Create); // VCF.CreateIndirect + //return resources; + } + } + //PdfResources resources; + + /// + /// Implements the interface because the primary function is internal. + /// + PdfResources IContentStream.Resources + { + get { return Resources; } + } + + /// + /// Gets the resource name of the specified font within this form. + /// + internal string GetFontName(XFont font, out PdfFont pdfFont) + { + Debug.Assert(IsTemplate, "This function is for form templates only."); + pdfFont = _document.FontTable.GetFont(font); + Debug.Assert(pdfFont != null); + string name = Resources.AddFont(pdfFont); + return name; + } + + string IContentStream.GetFontName(XFont font, out PdfFont pdfFont) + { + return GetFontName(font, out pdfFont); + } + + /// + /// Tries to get the resource name of the specified font data within this form. + /// Returns null if no such font exists. + /// + internal string TryGetFontName(string idName, out PdfFont pdfFont) + { + Debug.Assert(IsTemplate, "This function is for form templates only."); + pdfFont = _document.FontTable.TryGetFont(idName); + string name = null; + if (pdfFont != null) + name = Resources.AddFont(pdfFont); + return name; + } + + /// + /// Gets the resource name of the specified font data within this form. + /// + internal string GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) + { + Debug.Assert(IsTemplate, "This function is for form templates only."); + pdfFont = _document.FontTable.GetFont(idName, fontData); + //pdfFont = new PdfType0Font(Owner, idName, fontData); + //pdfFont.Document = _document; + Debug.Assert(pdfFont != null); + string name = Resources.AddFont(pdfFont); + return name; + } + + string IContentStream.GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) + { + return GetFontName(idName, fontData, out pdfFont); + } + + /// + /// Gets the resource name of the specified image within this form. + /// + internal string GetImageName(XImage image) + { + Debug.Assert(IsTemplate, "This function is for form templates only."); + PdfImage pdfImage = _document.ImageTable.GetImage(image); + Debug.Assert(pdfImage != null); + string name = Resources.AddImage(pdfImage); + return name; + } + + /// + /// Implements the interface because the primary function is internal. + /// + string IContentStream.GetImageName(XImage image) + { + return GetImageName(image); + } + + internal PdfFormXObject PdfForm + { + get + { + Debug.Assert(IsTemplate, "This function is for form templates only."); + if (_pdfForm.Reference == null) + _document._irefTable.Add(_pdfForm); + return _pdfForm; + } + } + + /// + /// Gets the resource name of the specified form within this form. + /// + internal string GetFormName(XForm form) + { + Debug.Assert(IsTemplate, "This function is for form templates only."); + PdfFormXObject pdfForm = _document.FormTable.GetForm(form); + Debug.Assert(pdfForm != null); + string name = Resources.AddForm(pdfForm); + return name; + } + + /// + /// Implements the interface because the primary function is internal. + /// + string IContentStream.GetFormName(XForm form) + { + return GetFormName(form); + } + + /// + /// The PdfFormXObject gets invalid when PageNumber or transform changed. This is because a modification + /// of an XPdfForm must not change objects that are already been drawn. + /// + internal PdfFormXObject _pdfForm; // TODO: make private + + internal XGraphicsPdfRenderer PdfRenderer; + +#if WPF && !SILVERLIGHT + /// + /// Gets a value indicating whether this image is cmyk. + /// + /// true if this image is cmyk; otherwise, false. + internal override bool IsCmyk + { + get { return false; } // not supported and not relevant + } + + /// + /// Gets a value indicating whether this image is JPEG. + /// + /// true if this image is JPEG; otherwise, false. + internal override bool IsJpeg + { + get { return base.IsJpeg; }// not supported and not relevant + } + + /// + /// Gets the JPEG memory stream (if IsJpeg returns true). + /// + /// The memory. + public override MemoryStream Memory + { + get { throw new NotImplementedException(); } + } +#endif + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing/XGlyphTypeface.cs b/PdfSharp/Drawing/XGlyphTypeface.cs new file mode 100644 index 0000000..01dded1 --- /dev/null +++ b/PdfSharp/Drawing/XGlyphTypeface.cs @@ -0,0 +1,602 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +#if CORE || GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using GdiFontFamily = System.Drawing.FontFamily; +using GdiFont = System.Drawing.Font; +using GdiFontStyle = System.Drawing.FontStyle; +#endif +#if WPF +using System.Windows; +using System.Windows.Documents; +using System.Windows.Media; +using WpfFontFamily = System.Windows.Media.FontFamily; +using WpfTypeface = System.Windows.Media.Typeface; +using WpfGlyphTypeface = System.Windows.Media.GlyphTypeface; +using WpfStyleSimulations = System.Windows.Media.StyleSimulations; +#endif +#if UWP +using Windows.UI.Xaml.Media; +#endif +using PdfSharp.Fonts; +using PdfSharp.Fonts.OpenType; +using PdfSharp.Internal; + +#pragma warning disable 649 +#if SILVERLIGHT +#pragma warning disable 219 +#endif +#if NETFX_CORE +#pragma warning disable 649 +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Specifies a physical font face that corresponds to a font file on the disk or in memory. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + internal sealed class XGlyphTypeface + { + // Implementation Notes + // XGlyphTypeface is the centerpiece for font management. There is a one to one relationship + // between XFont an XGlyphTypeface. + // + // * Each XGlyphTypeface can belong to one or more XFont objects. + // * An XGlyphTypeface hold an XFontFamily. + // * XGlyphTypeface hold a reference to an OpenTypeFontface. + // * + // + + const string KeyPrefix = "tk:"; // "typeface key" + +#if CORE || GDI + XGlyphTypeface(string key, XFontFamily fontFamily, XFontSource fontSource, XStyleSimulations styleSimulations, GdiFont gdiFont) + { + _key = key; + _fontFamily = fontFamily; + _fontSource = fontSource; + + _fontface = OpenTypeFontface.CetOrCreateFrom(fontSource); + Debug.Assert(ReferenceEquals(_fontSource.Fontface, _fontface)); + + _gdiFont = gdiFont; + + _styleSimulations = styleSimulations; + Initialize(); + } +#endif + +#if GDI + /// + /// Initializes a new instance of the class by a font source. + /// + public XGlyphTypeface(XFontSource fontSource) + { + string familyName = fontSource.Fontface.name.Name; + _fontFamily = new XFontFamily(familyName, false); + _fontface = fontSource.Fontface; + _isBold = _fontface.os2.IsBold; + _isItalic = _fontface.os2.IsItalic; + + _key = ComputeKey(familyName, _isBold, _isItalic); + //_fontFamily =xfont FontFamilyCache.GetFamilyByName(familyName); + _fontSource = fontSource; + + Initialize(); + } +#endif + +#if WPF + XGlyphTypeface(string key, XFontFamily fontFamily, XFontSource fontSource, XStyleSimulations styleSimulations, WpfTypeface wpfTypeface, WpfGlyphTypeface wpfGlyphTypeface) + { + _key = key; + _fontFamily = fontFamily; + _fontSource = fontSource; + _styleSimulations = styleSimulations; + + _fontface = OpenTypeFontface.CetOrCreateFrom(fontSource); + Debug.Assert(ReferenceEquals(_fontSource.Fontface, _fontface)); + + _wpfTypeface = wpfTypeface; + _wpfGlyphTypeface = wpfGlyphTypeface; + + Initialize(); + } +#endif + +#if NETFX_CORE || UWP + XGlyphTypeface(string key, XFontFamily fontFamily, XFontSource fontSource, XStyleSimulations styleSimulations) + { + _key = key; + _fontFamily = fontFamily; + _fontSource = fontSource; + _styleSimulations = styleSimulations; + + _fontface = OpenTypeFontface.CetOrCreateFrom(fontSource); + Debug.Assert(ReferenceEquals(_fontSource.Fontface, _fontface)); + + //_wpfTypeface = wpfTypeface; + //_wpfGlyphTypeface = wpfGlyphTypeface; + + Initialize(); + } +#endif + + public static XGlyphTypeface GetOrCreateFrom(string familyName, FontResolvingOptions fontResolvingOptions) + { + // Check cache for requested type face. + string typefaceKey = ComputeKey(familyName, fontResolvingOptions); + XGlyphTypeface glyphTypeface; + try + { + // Lock around TryGetGlyphTypeface and AddGlyphTypeface. + Lock.EnterFontFactory(); + if (GlyphTypefaceCache.TryGetGlyphTypeface(typefaceKey, out glyphTypeface)) + { + // Just return existing one. + return glyphTypeface; + } + + // Resolve typeface by FontFactory. + FontResolverInfo fontResolverInfo = FontFactory.ResolveTypeface(familyName, fontResolvingOptions, typefaceKey); + if (fontResolverInfo == null) + { + // No fallback - just stop. + throw new InvalidOperationException("No appropriate font found."); + } + +#if CORE || GDI + GdiFont gdiFont = null; +#endif +#if WPF + WpfFontFamily wpfFontFamily = null; + WpfTypeface wpfTypeface = null; + WpfGlyphTypeface wpfGlyphTypeface = null; +#endif +#if UWP + // Nothing to do. +#endif + // Now create the font family at the first. + XFontFamily fontFamily; + PlatformFontResolverInfo platformFontResolverInfo = fontResolverInfo as PlatformFontResolverInfo; + if (platformFontResolverInfo != null) + { + // Case: fontResolverInfo was created by platform font resolver + // and contains platform specific objects that are reused. +#if CORE || GDI + // Reuse GDI+ font from platform font resolver. + gdiFont = platformFontResolverInfo.GdiFont; + fontFamily = XFontFamily.GetOrCreateFromGdi(gdiFont); +#endif +#if WPF +#if !SILVERLIGHT + // Reuse WPF font family created from platform font resolver. + wpfFontFamily = platformFontResolverInfo.WpfFontFamily; + wpfTypeface = platformFontResolverInfo.WpfTypeface; + wpfGlyphTypeface = platformFontResolverInfo.WpfGlyphTypeface; + fontFamily = XFontFamily.GetOrCreateFromWpf(wpfFontFamily); +#else + fontFamily = XFontFamily.GetOrCreateFromWpf(new WpfFontFamily(familyName)); +#endif +#endif +#if NETFX_CORE || UWP + fontFamily = null; +#endif + } + else + { + // Case: fontResolverInfo was created by custom font resolver. + + // Get or create font family for custom font resolver retrieved font source. + fontFamily = XFontFamily.GetOrCreateFontFamily(familyName); + } + + // We have a valid font resolver info. That means we also have an XFontSource object loaded in the cache. + XFontSource fontSource = FontFactory.GetFontSourceByFontName(fontResolverInfo.FaceName); + Debug.Assert(fontSource != null); + + // Each font source already contains its OpenTypeFontface. +#if CORE || GDI + glyphTypeface = new XGlyphTypeface(typefaceKey, fontFamily, fontSource, fontResolverInfo.StyleSimulations, gdiFont); +#endif +#if WPF + glyphTypeface = new XGlyphTypeface(typefaceKey, fontFamily, fontSource, fontResolverInfo.StyleSimulations, wpfTypeface, wpfGlyphTypeface); +#endif +#if NETFX_CORE || UWP + glyphTypeface = new XGlyphTypeface(typefaceKey, fontFamily, fontSource, fontResolverInfo.StyleSimulations); +#endif + GlyphTypefaceCache.AddGlyphTypeface(glyphTypeface); + } + finally { Lock.ExitFontFactory(); } + return glyphTypeface; + } + +#if CORE || GDI + public static XGlyphTypeface GetOrCreateFromGdi(GdiFont gdiFont) + { + // $TODO THHO Lock??? + string typefaceKey = ComputeKey(gdiFont); + XGlyphTypeface glyphTypeface; + if (GlyphTypefaceCache.TryGetGlyphTypeface(typefaceKey, out glyphTypeface)) + { + // We have the glyph typeface already in cache. + return glyphTypeface; + } + + XFontFamily fontFamily = XFontFamily.GetOrCreateFromGdi(gdiFont); + XFontSource fontSource = XFontSource.GetOrCreateFromGdi(typefaceKey, gdiFont); + + // Check if styles must be simulated. + XStyleSimulations styleSimulations = XStyleSimulations.None; + if (gdiFont.Bold && !fontSource.Fontface.os2.IsBold) + styleSimulations |= XStyleSimulations.BoldSimulation; + if (gdiFont.Italic && !fontSource.Fontface.os2.IsItalic) + styleSimulations |= XStyleSimulations.ItalicSimulation; + + glyphTypeface = new XGlyphTypeface(typefaceKey, fontFamily, fontSource, styleSimulations, gdiFont); + GlyphTypefaceCache.AddGlyphTypeface(glyphTypeface); + + return glyphTypeface; + } +#endif + +#if WPF && !SILVERLIGHT + public static XGlyphTypeface GetOrCreateFromWpf(WpfTypeface wpfTypeface) + { +#if DEBUG + if (wpfTypeface.FontFamily.Source == "Segoe UI Semilight") + wpfTypeface.GetType(); +#endif + //string typefaceKey = ComputeKey(wpfTypeface); + //XGlyphTypeface glyphTypeface; + //if (GlyphTypefaceCache.TryGetGlyphTypeface(typefaceKey, out glyphTypeface)) + //{ + // // We have the glyph typeface already in cache. + // return glyphTypeface; + //} + + // Lock around TryGetGlyphTypeface and AddGlyphTypeface. + try + { + Lock.EnterFontFactory(); + + // Create WPF glyph typeface. + WpfGlyphTypeface wpfGlyphTypeface; + if (!wpfTypeface.TryGetGlyphTypeface(out wpfGlyphTypeface)) + return null; + + string typefaceKey = ComputeKey(wpfGlyphTypeface); + + string name1 = wpfGlyphTypeface.DesignerNames[FontHelper.CultureInfoEnUs]; + string name2 = wpfGlyphTypeface.FaceNames[FontHelper.CultureInfoEnUs]; + string name3 = wpfGlyphTypeface.FamilyNames[FontHelper.CultureInfoEnUs]; + string name4 = wpfGlyphTypeface.ManufacturerNames[FontHelper.CultureInfoEnUs]; + string name5 = wpfGlyphTypeface.Win32FaceNames[FontHelper.CultureInfoEnUs]; + string name6 = wpfGlyphTypeface.Win32FamilyNames[FontHelper.CultureInfoEnUs]; + + XGlyphTypeface glyphTypeface; + if (GlyphTypefaceCache.TryGetGlyphTypeface(typefaceKey, out glyphTypeface)) + { + // We have the glyph typeface already in cache. + return glyphTypeface; + } + + XFontFamily fontFamily = XFontFamily.GetOrCreateFromWpf(wpfTypeface.FontFamily); + XFontSource fontSource = XFontSource.GetOrCreateFromWpf(typefaceKey, wpfGlyphTypeface); + + glyphTypeface = new XGlyphTypeface(typefaceKey, fontFamily, fontSource, + (XStyleSimulations)wpfGlyphTypeface.StyleSimulations, + wpfTypeface, wpfGlyphTypeface); + GlyphTypefaceCache.AddGlyphTypeface(glyphTypeface); + + return glyphTypeface; + } + finally { Lock.ExitFontFactory(); } + } +#endif + + public XFontFamily FontFamily + { + get { return _fontFamily; } + } + readonly XFontFamily _fontFamily; + + internal OpenTypeFontface Fontface + { + get { return _fontface; } + } + readonly OpenTypeFontface _fontface; + + public XFontSource FontSource + { + get { return _fontSource; } + } + readonly XFontSource _fontSource; + + void Initialize() + { + _familyName = _fontface.name.Name; + if (string.IsNullOrEmpty(_faceName) || _faceName.StartsWith("?")) + _faceName = _familyName; + _styleName = _fontface.name.Style; + _displayName = _fontface.name.FullFontName; + if (string.IsNullOrEmpty(_displayName)) + { + _displayName = _familyName; + if (string.IsNullOrEmpty(_styleName)) + _displayName += " (" + _styleName + ")"; + } + + // Bold, as defined in OS/2 table. + _isBold = _fontface.os2.IsBold; + // Debug.Assert(_isBold == (_fontface.os2.usWeightClass > 400), "Check font weight."); + + // Italic, as defined in OS/2 table. + _isItalic = _fontface.os2.IsItalic; + } + + /// + /// Gets the name of the font face. This can be a file name, an uri, or a GUID. + /// + internal string FaceName + { + get { return _faceName; } + } + string _faceName; + + /// + /// Gets the English family name of the font, for example "Arial". + /// + public string FamilyName + { + get { return _familyName; } + } + string _familyName; + + /// + /// Gets the English subfamily name of the font, + /// for example "Bold". + /// + public string StyleName + { + get { return _styleName; } + } + string _styleName; + + /// + /// Gets the English display name of the font, + /// for example "Arial italic". + /// + public string DisplayName + { + get { return _displayName; } + } + string _displayName; + + /// + /// Gets a value indicating whether the font weight is bold. + /// + public bool IsBold + { + get { return _isBold; } + } + bool _isBold; + + /// + /// Gets a value indicating whether the font style is italic. + /// + public bool IsItalic + { + get { return _isItalic; } + } + bool _isItalic; + + public XStyleSimulations StyleSimulations + { + get { return _styleSimulations; } + } + XStyleSimulations _styleSimulations; + + /// + /// Gets the suffix of the face name in a PDF font and font descriptor. + /// The name based on the effective value of bold and italic from the OS/2 table. + /// + string GetFaceNameSuffix() + { + // Use naming of Microsoft Word. + if (IsBold) + return IsItalic ? ",BoldItalic" : ",Bold"; + return IsItalic ? ",Italic" : ""; + } + + internal string GetBaseName() + { + string name = DisplayName; + int ich = name.IndexOf("bold", StringComparison.OrdinalIgnoreCase); + if (ich > 0) + name = name.Substring(0, ich) + name.Substring(ich + 4, name.Length - ich - 4); + ich = name.IndexOf("italic", StringComparison.OrdinalIgnoreCase); + if (ich > 0) + name = name.Substring(0, ich) + name.Substring(ich + 6, name.Length - ich - 6); + //name = name.Replace(" ", ""); + name = name.Trim(); + name += GetFaceNameSuffix(); + return name; + } + + /// + /// Computes the bijective key for a typeface. + /// + internal static string ComputeKey(string familyName, FontResolvingOptions fontResolvingOptions) + { + // Compute a human readable key. + string simulationSuffix = ""; + if (fontResolvingOptions.OverrideStyleSimulations) + { + switch (fontResolvingOptions.StyleSimulations) + { + case XStyleSimulations.BoldSimulation: simulationSuffix = "|b+/i-"; break; + case XStyleSimulations.ItalicSimulation: simulationSuffix = "|b-/i+"; break; + case XStyleSimulations.BoldItalicSimulation: simulationSuffix = "|b+/i+"; break; + case XStyleSimulations.None: break; + default: throw new ArgumentOutOfRangeException("fontResolvingOptions"); + } + } + string key = KeyPrefix + familyName.ToLowerInvariant() + + (fontResolvingOptions.IsItalic ? "/i" : "/n") // normal / oblique / italic + + (fontResolvingOptions.IsBold ? "/700" : "/400") + "/5" // Stretch.Normal + + simulationSuffix; + return key; + } + + /// + /// Computes the bijective key for a typeface. + /// + internal static string ComputeKey(string familyName, bool isBold, bool isItalic) + { + return ComputeKey(familyName, new FontResolvingOptions(FontHelper.CreateStyle(isBold, isItalic))); + } + +#if CORE || GDI + internal static string ComputeKey(GdiFont gdiFont) + { + string name1 = gdiFont.Name; + string name2 = gdiFont.OriginalFontName; + string name3 = gdiFont.SystemFontName; + + string name = name1; + GdiFontStyle style = gdiFont.Style; + + string key = KeyPrefix + name.ToLowerInvariant() + ((style & GdiFontStyle.Italic) == GdiFontStyle.Italic ? "/i" : "/n") + ((style & GdiFontStyle.Bold) == GdiFontStyle.Bold ? "/700" : "/400") + "/5"; // Stretch.Normal + return key; + } +#endif +#if WPF && !SILVERLIGHT + internal static string ComputeKey(WpfGlyphTypeface wpfGlyphTypeface) + { + string name1 = wpfGlyphTypeface.DesignerNames[FontHelper.CultureInfoEnUs]; + string faceName = wpfGlyphTypeface.FaceNames[FontHelper.CultureInfoEnUs]; + string familyName = wpfGlyphTypeface.FamilyNames[FontHelper.CultureInfoEnUs]; + string name4 = wpfGlyphTypeface.ManufacturerNames[FontHelper.CultureInfoEnUs]; + string name5 = wpfGlyphTypeface.Win32FaceNames[FontHelper.CultureInfoEnUs]; + string name6 = wpfGlyphTypeface.Win32FamilyNames[FontHelper.CultureInfoEnUs]; + + + string name = familyName.ToLower() + '/' + faceName.ToLowerInvariant(); + string style = wpfGlyphTypeface.Style.ToString(); + string weight = wpfGlyphTypeface.Weight.ToString(); + string stretch = wpfGlyphTypeface.Stretch.ToString(); + string simulations = wpfGlyphTypeface.StyleSimulations.ToString(); + + //string key = name + '/' + style + '/' + weight + '/' + stretch + '/' + simulations; + + string key = KeyPrefix + name + '/' + style.Substring(0, 1) + '/' + wpfGlyphTypeface.Weight.ToOpenTypeWeight().ToString(CultureInfo.InvariantCulture) + '/' + wpfGlyphTypeface.Stretch.ToOpenTypeStretch().ToString(CultureInfo.InvariantCulture); + switch (wpfGlyphTypeface.StyleSimulations) + { + case WpfStyleSimulations.BoldSimulation: key += "|b+/i-"; break; + case WpfStyleSimulations.ItalicSimulation: key += "|b-/i+"; break; + case WpfStyleSimulations.BoldItalicSimulation: key += "|b+/i+"; break; + case WpfStyleSimulations.None: break; + } + return key.ToLowerInvariant(); + } +#endif + + public string Key + { + get { return _key; } + } + readonly string _key; + +#if CORE || GDI + internal GdiFont GdiFont + { + get { return _gdiFont; } + } + + private readonly GdiFont _gdiFont; +#endif + +#if WPF + internal WpfTypeface WpfTypeface + { + get { return _wpfTypeface; } + } + readonly WpfTypeface _wpfTypeface; + + internal WpfGlyphTypeface WpfGlyphTypeface + { + get { return _wpfGlyphTypeface; } + } + readonly WpfGlyphTypeface _wpfGlyphTypeface; +#endif + +#if SILVERLIGHT_ + /// + /// Gets the FontSource object used in Silverlight 4. + /// + public FontSource FontSource + { + get + { + if (_fontSource == null) + { +#if true + MemoryStream stream = new MemoryStream(_fontface.FontData.Bytes); + _fontSource = new FontSource(stream); +#else + using (MemoryStream stream = new MemoryStream(_fontface.Data)) + { + _fontSource = new FontSource(stream); + } +#endif + } + return _fontSource; + } + } + FontSource _fontSource; +#endif + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + // ReSharper disable UnusedMember.Local + internal string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get { return string.Format(CultureInfo.InvariantCulture, "{0} - {1} ({2})", FamilyName, StyleName, FaceName); } + } + } +} diff --git a/PdfSharp/Drawing/XGraphics.cs b/PdfSharp/Drawing/XGraphics.cs new file mode 100644 index 0000000..7f30791 --- /dev/null +++ b/PdfSharp/Drawing/XGraphics.cs @@ -0,0 +1,5312 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.IO; +using System.Text; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +using GdiPoint = System.Drawing.Point; +using GdiSize = System.Drawing.Size; +using GdiRect = System.Drawing.Rectangle; +using GdiPointF = System.Drawing.PointF; +using GdiSizeF = System.Drawing.SizeF; +using GdiRectF = System.Drawing.RectangleF; +using GdiMatrix = System.Drawing.Drawing2D.Matrix; +#endif +#if WPF +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; +using PdfSharp.Windows; +using SysPoint = System.Windows.Point; +using SysSize = System.Windows.Size; +using SysRect = System.Windows.Rect; +using SysMatrix = System.Windows.Media.Matrix; +using WpfBrush = System.Windows.Media.Brush; +using WpfPen = System.Windows.Media.Pen; +#if !SILVERLIGHT +using WpfBrushes = System.Windows.Media.Brushes; +#endif +#endif +#if NETFX_CORE +using Windows.UI.Xaml.Media; +using SysPoint = Windows.Foundation.Point; +using SysSize = Windows.Foundation.Size; +using SysRect = Windows.Foundation.Rect; +#endif +#if UWP +using System.Numerics; +using Windows.UI; +using Windows.UI.Xaml.Controls; +using Microsoft.Graphics.Canvas; +using Microsoft.Graphics.Canvas.Geometry; +using SysPoint = Windows.Foundation.Point; +using SysSize = Windows.Foundation.Size; +using SysRect = Windows.Foundation.Rect; +#endif +using PdfSharp.Pdf; +using PdfSharp.Drawing.Pdf; +using PdfSharp.Internal; +using PdfSharp.Pdf.Advanced; + +#pragma warning disable 1587 +// ReSharper disable UseNullPropagation +// ReSharper disable RedundantNameQualifier +// ReSharper disable UseNameofExpression + +namespace PdfSharp.Drawing // #??? Clean up +{ + /// + /// Holds information about the current state of the XGraphics object. + /// + [Flags] + enum InternalGraphicsMode + { + DrawingGdiGraphics, + DrawingPdfContent, + DrawingBitmap, + } + + /// + /// Represents a drawing surface for a fixed size page. + /// + public sealed class XGraphics : IDisposable + { +#if CORE + // TODO: Implement better concept of a measure context. +#endif + +#if GDI + /// + /// Initializes a new instance of the XGraphics class. + /// + /// The gfx. + /// The size. + /// The page unit. + /// The page direction. + XGraphics(Graphics gfx, XSize size, XGraphicsUnit pageUnit, XPageDirection pageDirection) + { + if (gfx == null) + { + // MigraDoc comes here when creating a MeasureContext. + try + { + Lock.EnterGdiPlus(); + gfx = Graphics.FromHwnd(IntPtr.Zero); // BUG: Use measure image + } + finally { Lock.ExitGdiPlus(); } + } + + _gsStack = new GraphicsStateStack(this); + TargetContext = XGraphicTargetContext.GDI; + _gfx = gfx; + _drawGraphics = true; + _pageSize = new XSize(size.Width, size.Height); + _pageUnit = pageUnit; + switch (pageUnit) + { + case XGraphicsUnit.Point: + _pageSizePoints = new XSize(size.Width, size.Height); + break; + + case XGraphicsUnit.Inch: + _pageSizePoints = new XSize(XUnit.FromInch(size.Width), XUnit.FromInch(size.Height)); + break; + + case XGraphicsUnit.Millimeter: + _pageSizePoints = new XSize(XUnit.FromMillimeter(size.Width), XUnit.FromMillimeter(size.Height)); + break; + + case XGraphicsUnit.Centimeter: + _pageSizePoints = new XSize(XUnit.FromCentimeter(size.Width), XUnit.FromCentimeter(size.Height)); + break; + + case XGraphicsUnit.Presentation: + _pageSizePoints = new XSize(XUnit.FromPresentation(size.Width), XUnit.FromPresentation(size.Height)); + break; + + default: + throw new NotImplementedException("unit"); + } + + _pageDirection = pageDirection; + Initialize(); + } +#endif + +#if WPF && !SILVERLIGHT + /// + /// Initializes a new instance of the XGraphics class. + /// + /// The drawing context. + /// The size. + /// The page unit. + /// The page direction. + XGraphics(DrawingContext dc, XSize size, XGraphicsUnit pageUnit, XPageDirection pageDirection) + { + if (dc == null) + { + //throw new ArgumentNullException("dc"); + _dv = new DrawingVisual(); + dc = _dv.RenderOpen(); + } + + _gsStack = new GraphicsStateStack(this); + TargetContext = XGraphicTargetContext.WPF; + _dc = dc; + _drawGraphics = true; + _pageSize = new XSize(size.Width, size.Height); + _pageUnit = pageUnit; + switch (pageUnit) + { + case XGraphicsUnit.Point: + _pageSizePoints = new XSize(size.Width, size.Height); + break; + + case XGraphicsUnit.Inch: + _pageSizePoints = new XSize(XUnit.FromInch(size.Width), XUnit.FromInch(size.Height)); + break; + + case XGraphicsUnit.Millimeter: + _pageSizePoints = new XSize(XUnit.FromMillimeter(size.Width), XUnit.FromMillimeter(size.Height)); + break; + + case XGraphicsUnit.Centimeter: + _pageSizePoints = new XSize(XUnit.FromCentimeter(size.Width), XUnit.FromCentimeter(size.Height)); + break; + + case XGraphicsUnit.Presentation: + _pageSizePoints = new XSize(XUnit.FromPresentation(size.Width), XUnit.FromPresentation(size.Height)); + break; + + default: + throw new NotImplementedException("unit"); + } + + _pageDirection = pageDirection; + Initialize(); + } +#endif + +#if WPF + /// + /// Initializes a new instance of the XGraphics class. + /// + /// The canvas. + /// The size. + /// The page unit. + /// The page direction. + XGraphics(Canvas canvas, XSize size, XGraphicsUnit pageUnit, XPageDirection pageDirection) + { + //throw new ArgumentNullException("canvas"); + if (canvas == null) + canvas = new Canvas(); + +#if !SILVERLIGHT + // Create DrawingVisual as container for the content of the page. + _dv = new DrawingVisual(); + // Create a host that shows the visual. + VisualPresenter vp = new VisualPresenter(); + vp.Children.Add(_dv); + // The canvas only contains the host of the DrawingVisual. + canvas.Children.Add(vp); + _dc = _dv.RenderOpen(); + TargetContext = XGraphicTargetContext.WPF; + //////VisualBrush brush = new VisualBrush(_dv); + ////////brush.ViewboxUnits = BrushMappingMode. + //////brush.Viewport=new Rect(new Point(), size.ToSize()); + //////brush.Viewbox=new Rect(new Point(), size.ToSize()); + ////////brush.Viewport=new Rect(new Point(), (Size)size); + //////brush.AutoLayoutContent = true; + //////canvas.Background = brush; +#else + _dc = new AgDrawingContext(canvas); +#endif + + _gsStack = new GraphicsStateStack(this); + TargetContext = XGraphicTargetContext.WPF; + + _drawGraphics = true; + _pageSize = new XSize(size.Width, size.Height); + _pageUnit = pageUnit; + switch (pageUnit) + { + case XGraphicsUnit.Point: + _pageSizePoints = new XSize(size.Width, size.Height); + break; + + case XGraphicsUnit.Inch: + _pageSizePoints = new XSize(XUnit.FromInch(size.Width), XUnit.FromInch(size.Height)); + break; + + case XGraphicsUnit.Millimeter: + _pageSizePoints = new XSize(XUnit.FromMillimeter(size.Width), XUnit.FromMillimeter(size.Height)); + break; + + case XGraphicsUnit.Centimeter: + _pageSizePoints = new XSize(XUnit.FromCentimeter(size.Width), XUnit.FromCentimeter(size.Height)); + break; + + case XGraphicsUnit.Presentation: + _pageSizePoints = new XSize(XUnit.FromPresentation(size.Width), XUnit.FromPresentation(size.Height)); + break; + + default: + throw new NotImplementedException("unit"); + } + + _pageDirection = pageDirection; + Initialize(); + } +#endif + +#if UWP + /// + /// Initializes a new instance of the XGraphics class. + /// + /// The canvas. + /// The size. + /// The page unit. + /// The page direction. + XGraphics(CanvasDrawingSession canvasDrawingSession, XSize size, XGraphicsUnit pageUnit, XPageDirection pageDirection) + { + if (canvasDrawingSession == null) + throw new ArgumentNullException("canvasDrawingSession"); + + _cds = canvasDrawingSession; + + _gsStack = new GraphicsStateStack(this); + TargetContext = XGraphicTargetContext.WPF; + + _drawGraphics = true; + _pageSize = new XSize(size.Width, size.Height); + _pageUnit = pageUnit; + switch (pageUnit) + { + case XGraphicsUnit.Point: + _pageSizePoints = new XSize(size.Width, size.Height); + break; + + case XGraphicsUnit.Inch: + _pageSizePoints = new XSize(XUnit.FromInch(size.Width), XUnit.FromInch(size.Height)); + break; + + case XGraphicsUnit.Millimeter: + _pageSizePoints = new XSize(XUnit.FromMillimeter(size.Width), XUnit.FromMillimeter(size.Height)); + break; + + case XGraphicsUnit.Centimeter: + _pageSizePoints = new XSize(XUnit.FromCentimeter(size.Width), XUnit.FromCentimeter(size.Height)); + break; + + case XGraphicsUnit.Presentation: + _pageSizePoints = new XSize(XUnit.FromPresentation(size.Width), XUnit.FromPresentation(size.Height)); + break; + + default: + throw new NotImplementedException("unit"); + } + + _pageDirection = pageDirection; + Initialize(); + } +#endif + + /// + /// Initializes a new instance of the XGraphics class for drawing on a PDF page. + /// + XGraphics(PdfPage page, XGraphicsPdfPageOptions options, XGraphicsUnit pageUnit, XPageDirection pageDirection) + { + if (page == null) + throw new ArgumentNullException("page"); + + if (page.Owner == null) + throw new ArgumentException("You cannot draw on a page that is not owned by a PdfDocument object.", "page"); + + if (page.RenderContent != null) + throw new InvalidOperationException("An XGraphics object already exists for this page and must be disposed before a new one can be created."); + + if (page.Owner.IsReadOnly) + throw new InvalidOperationException("Cannot create XGraphics for a page of a document that cannot be modified. Use PdfDocumentOpenMode.Modify."); + + _gsStack = new GraphicsStateStack(this); + PdfContent content = null; + switch (options) + { + case XGraphicsPdfPageOptions.Replace: + page.Contents.Elements.Clear(); + goto case XGraphicsPdfPageOptions.Append; + + case XGraphicsPdfPageOptions.Prepend: + content = page.Contents.PrependContent(); + break; + + case XGraphicsPdfPageOptions.Append: + content = page.Contents.AppendContent(); + break; + } + page.RenderContent = content; + +#if CORE + TargetContext = XGraphicTargetContext.CORE; +#endif +#if GDI + // HACK: This does not work with #MediumTrust + //_gfx = Graphics.FromHwnd(IntPtr.Zero); // _gfx should not be necessary anymore. + _gfx = null; + TargetContext = XGraphicTargetContext.GDI; +#endif +#if WPF && !SILVERLIGHT + _dv = new DrawingVisual(); + _dc = _dv.RenderOpen(); + TargetContext = XGraphicTargetContext.WPF; +#endif +#if SILVERLIGHT + _dc = new AgDrawingContext(new Canvas()); + TargetContext = XGraphicTargetContext.WPF; +#endif +#if GDI && WPF + TargetContext = PdfSharp.Internal.TargetContextHelper.TargetContext; +#endif + _renderer = new PdfSharp.Drawing.Pdf.XGraphicsPdfRenderer(page, this, options); + _pageSizePoints = new XSize(page.Width, page.Height); + switch (pageUnit) + { + case XGraphicsUnit.Point: + _pageSize = new XSize(page.Width, page.Height); + break; + + case XGraphicsUnit.Inch: + _pageSize = new XSize(XUnit.FromPoint(page.Width).Inch, XUnit.FromPoint(page.Height).Inch); + break; + + case XGraphicsUnit.Millimeter: + _pageSize = new XSize(XUnit.FromPoint(page.Width).Millimeter, XUnit.FromPoint(page.Height).Millimeter); + break; + + case XGraphicsUnit.Centimeter: + _pageSize = new XSize(XUnit.FromPoint(page.Width).Centimeter, XUnit.FromPoint(page.Height).Centimeter); + break; + + case XGraphicsUnit.Presentation: + _pageSize = new XSize(XUnit.FromPoint(page.Width).Presentation, XUnit.FromPoint(page.Height).Presentation); + break; + + default: + throw new NotImplementedException("unit"); + } + _pageUnit = pageUnit; + _pageDirection = pageDirection; + + Initialize(); + } + + /// + /// Initializes a new instance of the XGraphics class used for drawing on a form. + /// + XGraphics(XForm form) + { + if (form == null) + throw new ArgumentNullException("form"); + + _form = form; + form.AssociateGraphics(this); + + _gsStack = new GraphicsStateStack(this); +#if CORE + TargetContext = XGraphicTargetContext.CORE; + _drawGraphics = false; + if (form.Owner != null) + _renderer = new XGraphicsPdfRenderer(form, this); + _pageSize = form.Size; + Initialize(); +#endif +#if GDI && !WPF + try + { + Lock.EnterGdiPlus(); + TargetContext = XGraphicTargetContext.GDI; + // If form.Owner is null create a meta file. + if (form.Owner == null) + { + MemoryStream stream = new MemoryStream(); + // BUG: This Windows 1.0 technique issued an exception under Microsoft Azure. // #??? + using (Graphics refgfx = Graphics.FromHwnd(IntPtr.Zero)) + { + IntPtr hdc = refgfx.GetHdc(); +#if true_ + // This code comes from my C++ RenderContext and checks some confusing details in connection + // with metafiles. + // Display | LaserJet + // DPI 96 : 120 | 300 + // physical device size in MM --------------------------------------------- + int horzSizeMM = NativeMethods.GetDeviceCaps(hdc, NativeMethods.HORZSIZE); // = 360 : 360 | 198 (not 210) + int vertSizeMM = NativeMethods.GetDeviceCaps(hdc, NativeMethods.VERTSIZE); // = 290 : 290 | 288 (hot 297) + // Cool: + // My monitor is a Sony SDM-N80 and its size is EXACTLY 360mm x 290mm!! + // It is an 18.1" Flat Panel LCD from 2002 and these are the values + // an older display drivers reports in about 2003: + // Display + // DPI 96 : 120 + // -------------- + // 330 : 254 + // 254 : 203 + // Obviously my ATI driver reports the exact size of the monitor. + + + // device size in pixel + int horzSizePixel = NativeMethods.GetDeviceCaps(hdc, NativeMethods.HORZRES); // = 1280 : 1280 | 4676 + int vertSizePixel = NativeMethods.GetDeviceCaps(hdc, NativeMethods.VERTRES); // = 1024 : 1024 | 6814 + + // 'logical' device resolution in DPI + int logResX = NativeMethods.GetDeviceCaps(hdc, NativeMethods.LOGPIXELSX); // = 96 : 120 | 600 + int logResY = NativeMethods.GetDeviceCaps(hdc, NativeMethods.LOGPIXELSY); // = 96 : 120 | 600 + + // now we can get the 'physical' device resolution... + float phyResX = horzSizePixel / (horzSizeMM / 25.4f); // = 98.521210 : 128.00000 | 599.85052 + float phyResY = vertSizePixel / (vertSizeMM / 25.4f); // = 102.40000 : 128.12611 | 600.95691 + + // ...and rescale the size of the meta rectangle. + float magicX = logResX / phyResX; // = 0.97440946 : 0.93750000 | 1.0002491 + float magicY = logResY / phyResY; // = 0.93750000 : 0.93657720 | 0.99840766 + + // use A4 page in point + // adjust size of A4 page so that meta file fits with DrawImage... + //GdiRectF rcMagic = new GdiRectF(0, 0, magicX * form.Width, magicY * form.Height); + //m_PreviewMetafile = new Metafile(hdc, rcMagic, MetafileFrameUnitPoint, + // EmfTypeEmfPlusOnly, L"some description"); +#endif + GdiRectF rect = new GdiRectF(0, 0, form.PixelWidth, form.PixelHeight); + Metafile = new Metafile(stream, hdc, rect, MetafileFrameUnit.Pixel); //, EmfType.EmfPlusOnly); + + // Petzold disposes the refgfx object, although the hdc is in use of the metafile + refgfx.ReleaseHdc(hdc); + } // refgfx.Dispose(); + + _gfx = Graphics.FromImage(Metafile); + _gfx.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; + _drawGraphics = true; + } + else + { + Metafile = null; + _gfx = Graphics.FromHwnd(IntPtr.Zero); + } + if (form.Owner != null) + _renderer = new PdfSharp.Drawing.Pdf.XGraphicsPdfRenderer(form, this); + _pageSize = form.Size; + } + finally { Lock.ExitGdiPlus(); } + Initialize(); +#endif +#if WPF && !GDI + TargetContext = XGraphicTargetContext.WPF; +#if !SILVERLIGHT + // If form.Owner is null create a meta file. + if (form.Owner == null) + { + _dv = new DrawingVisual(); + _dc = _dv.RenderOpen(); + _drawGraphics = true; + } + else + { + _dv = new DrawingVisual(); + _dc = _dv.RenderOpen(); + } + if (form.Owner != null) + _renderer = new PdfSharp.Drawing.Pdf.XGraphicsPdfRenderer(form, this); + _pageSize = form.Size; + Initialize(); +#else + throw new NotImplementedException(); // AGHACK + //Initialize(); +#endif +#endif + } + + /// + /// Creates the measure context. This is a graphics context created only for querying measures of text. + /// Drawing on a measure context has no effect. + /// + public static XGraphics CreateMeasureContext(XSize size, XGraphicsUnit pageUnit, XPageDirection pageDirection) + { +#if CORE + //throw new InvalidOperationException("No measure context in CORE build."); + PdfDocument dummy = new PdfDocument(); + PdfPage page = dummy.AddPage(); + //XGraphics gfx = new XGraphics(((System.Drawing.Graphics)null, size, pageUnit, pageDirection); + XGraphics gfx = XGraphics.FromPdfPage(page, XGraphicsPdfPageOptions.Append, pageUnit, pageDirection); + return gfx; +#endif +#if GDI && !WPF + //XGraphics gfx = new XGraphics((System.Drawing.Graphics)null, size, pageUnit, pageDirection); + XGraphics gfx = new XGraphics((System.Drawing.Graphics)null, size, pageUnit, pageDirection); + return gfx; +#endif +#if WPF && !SILVERLIGHT + XGraphics gfx = new XGraphics((System.Windows.Media.DrawingContext)null, size, pageUnit, pageDirection); + return gfx; +#endif +#if SILVERLIGHT + XGraphics gfx = new XGraphics(new Canvas(), size, pageUnit, pageDirection); + return gfx; +#endif +#if NETFX_CORE || UWP // NETFX_CORE_TODO + return null; +#endif + } + +#if GDI + /// + /// Creates a new instance of the XGraphics class from a System.Drawing.Graphics object. + /// + public static XGraphics FromGraphics(Graphics graphics, XSize size) + { + // Creating a new instance is by design. + return new XGraphics(graphics, size, XGraphicsUnit.Point, XPageDirection.Downwards); + } + + /// + /// Creates a new instance of the XGraphics class from a System.Drawing.Graphics object. + /// + public static XGraphics FromGraphics(Graphics graphics, XSize size, XGraphicsUnit unit) + { + // Creating a new instance is by design. + return new XGraphics(graphics, size, unit, XPageDirection.Downwards); + } + + ///// + ///// Creates a new instance of the XGraphics class from a System.Drawing.Graphics object. + ///// + //public static XGraphics FromGraphics(Graphics graphics, XSize size, XPageDirection pageDirection) + //{ + // // Creating a new instance is by design. + // return new XGraphics(graphics, size, XGraphicsUnit.Point, pageDirection); + //} + + ///// + ///// Creates a new instance of the XGraphics class from a System.Drawing.Graphics object. + ///// + //public static XGraphics FromGraphics(Graphics graphics, XSize size, XGraphicsUnit unit, XPageDirection pageDirection) + //{ + // // Creating a new instance is by design. + // return new XGraphics(graphics, size, XGraphicsUnit.Point, pageDirection); + //} +#endif + +#if WPF && !SILVERLIGHT + /// + /// Creates a new instance of the XGraphics class from a System.Windows.Media.DrawingContext object. + /// + public static XGraphics FromDrawingContext(DrawingContext drawingContext, XSize size, XGraphicsUnit unit) + { + return new XGraphics(drawingContext, size, unit, XPageDirection.Downwards); + } +#endif + +#if WPF + /// + /// Creates a new instance of the XGraphics class from a System.Windows.Media.DrawingContext object. + /// + public static XGraphics FromCanvas(Canvas canvas, XSize size, XGraphicsUnit unit) + { + return new XGraphics(canvas, size, unit, XPageDirection.Downwards); + } +#endif + +#if UWP + /// + /// Creates a new instance of the XGraphics class from a Microsoft.Graphics.Canvas.CanvasDrawingSession object. + /// + public static XGraphics FromCanvasDrawingSession(CanvasDrawingSession drawingSession, XSize size, XGraphicsUnit unit) + { + return new XGraphics(drawingSession, size, unit, XPageDirection.Downwards); + } +#endif + + /// + /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. + /// + public static XGraphics FromPdfPage(PdfPage page) + { + return new XGraphics(page, XGraphicsPdfPageOptions.Append, XGraphicsUnit.Point, XPageDirection.Downwards); + } + + /// + /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. + /// + public static XGraphics FromPdfPage(PdfPage page, XGraphicsUnit unit) + { + return new XGraphics(page, XGraphicsPdfPageOptions.Append, unit, XPageDirection.Downwards); + } + + /// + /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. + /// + public static XGraphics FromPdfPage(PdfPage page, XPageDirection pageDirection) + { + return new XGraphics(page, XGraphicsPdfPageOptions.Append, XGraphicsUnit.Point, pageDirection); + } + + /// + /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. + /// + public static XGraphics FromPdfPage(PdfPage page, XGraphicsPdfPageOptions options) + { + return new XGraphics(page, options, XGraphicsUnit.Point, XPageDirection.Downwards); + } + + /// + /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. + /// + public static XGraphics FromPdfPage(PdfPage page, XGraphicsPdfPageOptions options, XPageDirection pageDirection) + { + return new XGraphics(page, options, XGraphicsUnit.Point, pageDirection); + } + + /// + /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. + /// + public static XGraphics FromPdfPage(PdfPage page, XGraphicsPdfPageOptions options, XGraphicsUnit unit) + { + return new XGraphics(page, options, unit, XPageDirection.Downwards); + } + + /// + /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. + /// + public static XGraphics FromPdfPage(PdfPage page, XGraphicsPdfPageOptions options, XGraphicsUnit unit, XPageDirection pageDirection) + { + return new XGraphics(page, options, unit, pageDirection); + } + + /// + /// Creates a new instance of the XGraphics class from a PdfSharp.Drawing.XPdfForm object. + /// + public static XGraphics FromPdfForm(XPdfForm form) + { + if (form.Gfx != null) + return form.Gfx; + + return new XGraphics(form); + } + + /// + /// Creates a new instance of the XGraphics class from a PdfSharp.Drawing.XForm object. + /// + public static XGraphics FromForm(XForm form) + { + if (form.Gfx != null) + return form.Gfx; + + return new XGraphics(form); + } + + /// + /// Creates a new instance of the XGraphics class from a PdfSharp.Drawing.XForm object. + /// + public static XGraphics FromImage(XImage image) + { + return FromImage(image, XGraphicsUnit.Point); + } + + /// + /// Creates a new instance of the XGraphics class from a PdfSharp.Drawing.XImage object. + /// + public static XGraphics FromImage(XImage image, XGraphicsUnit unit) + { + if (image == null) + throw new ArgumentNullException("image"); + + XBitmapImage bmImage = image as XBitmapImage; + if (bmImage != null) + { +#if CORE + return null; +#endif +#if GDI && !WPF + Graphics gfx = Graphics.FromImage(image._gdiImage); + image.XImageState = image.XImageState | XImageState.UsedInDrawingContext; + return new XGraphics(gfx, new XSize(image.PixelWidth, image.PixelHeight), unit, XPageDirection.Downwards); +#endif +#if WPF && !GDI + DiagnosticsHelper.ThrowNotImplementedException("WPF image"); + return null; +#endif +#if NETFX_CORE + DiagnosticsHelper.ThrowNotImplementedException("NETFX_CORE image"); + return null; +#endif + } + return null; + } + + /// + /// Internal setup. + /// + void Initialize() + { + _pageOrigin = new XPoint(); + + double pageHeight = _pageSize.Height; + PdfPage targetPage = PdfPage; + XPoint trimOffset = new XPoint(); + if (targetPage != null && targetPage.TrimMargins.AreSet) + { + pageHeight += targetPage.TrimMargins.Top.Point + targetPage.TrimMargins.Bottom.Point; + trimOffset = new XPoint(targetPage.TrimMargins.Left.Point, targetPage.TrimMargins.Top.Point); + } + + XMatrix matrix = new XMatrix(); +#if CORE + // Nothing to do here. + Debug.Assert(TargetContext == XGraphicTargetContext.CORE); +#endif +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterFontFactory(); + if (_gfx != null) + matrix = _gfx.Transform; + + if (_pageUnit != XGraphicsUnit.Point) + { + switch (_pageUnit) + { + case XGraphicsUnit.Inch: + matrix.ScalePrepend(XUnit.InchFactor); + break; + + case XGraphicsUnit.Millimeter: + matrix.ScalePrepend(XUnit.MillimeterFactor); + break; + + case XGraphicsUnit.Centimeter: + matrix.ScalePrepend(XUnit.CentimeterFactor); + break; + + case XGraphicsUnit.Presentation: + matrix.ScalePrepend(XUnit.PresentationFactor); + break; + } + if (_gfx != null) + _gfx.Transform = (GdiMatrix)matrix; + } + } + finally { Lock.ExitFontFactory(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + if (_pageUnit != XGraphicsUnit.Presentation) + { + switch (_pageUnit) + { + case XGraphicsUnit.Point: + matrix.ScalePrepend(XUnit.PointFactorWpf); + break; + + case XGraphicsUnit.Inch: + matrix.ScalePrepend(XUnit.InchFactorWpf); + break; + + case XGraphicsUnit.Millimeter: + matrix.ScalePrepend(XUnit.MillimeterFactorWpf); + break; + + case XGraphicsUnit.Centimeter: + matrix.ScalePrepend(XUnit.CentimeterFactorWpf); + break; + } + if (!matrix.IsIdentity) + { +#if !SILVERLIGHT + MatrixTransform transform = new MatrixTransform((SysMatrix)matrix); + _dc.PushTransform(transform); +#else + MatrixTransform transform2 = new MatrixTransform(); + transform2.Matrix = (SysMatrix)matrix; + _dc.PushTransform(transform2); +#endif + } + } + } +#endif + if (_pageDirection != XPageDirection.Downwards) + matrix.Prepend(new XMatrix(1, 0, 0, -1, 0, pageHeight)); + + if (trimOffset != new XPoint()) + matrix.TranslatePrepend(trimOffset.X, -trimOffset.Y); + + DefaultViewMatrix = matrix; + _transform = new XMatrix(); + } + + /// + /// Releases all resources used by this object. + /// + public void Dispose() + { + Dispose(true); + } + + void Dispose(bool disposing) + { + if (!_disposed) + { + _disposed = true; + if (disposing) + { + // Dispose managed resources. + if (_associatedImage != null) + { + _associatedImage.DisassociateWithGraphics(this); + _associatedImage = null; + } + } + + if (_form != null) + _form.Finish(); +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + // GDI+ requires this to disassociate it from metafiles. + if (_gfx != null) + _gfx.Dispose(); + _gfx = null; + Metafile = null; + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (_dc != null) + { + _dc.Close(); +#if !SILVERLIGHT + // Free resources. Only needed when running on a server, but does no harm with desktop applications. + // Needed on server, but causes harm with WPF desktop application. So now what? + //_dc.Dispatcher.InvokeShutdown(); + + _dv = null; +#endif + } +#endif + _drawGraphics = false; + + if (_renderer != null) + { + _renderer.Close(); + _renderer = null; + } + } + } + bool _disposed; + + /// + /// Internal hack for MigraDoc. Will be removed in further releases. + /// Unicode support requires a global refactoring of MigraDoc and will be done in further releases. + /// + // ReSharper disable once InconsistentNaming + // ReSharper disable once ConvertToAutoProperty + public PdfFontEncoding MUH // MigraDoc Unicode Hack... + { + get { return _muh; } + set { _muh = value; } + } + PdfFontEncoding _muh; + + /// + /// A value indicating whether GDI+ or WPF is used as context. + /// + internal XGraphicTargetContext TargetContext; + + /// + /// Gets or sets the unit of measure used for page coordinates. + /// CURRENTLY ONLY POINT IS IMPLEMENTED. + /// + public XGraphicsUnit PageUnit + { + get { return _pageUnit; } + //set + //{ + // // TODO: other page units + // if (value != XGraphicsUnit.Point) + // throw new NotImplementedException("PageUnit must be XGraphicsUnit.Point in current implementation."); + //} + } + readonly XGraphicsUnit _pageUnit; + + /// + /// Gets or sets the a value indicating in which direction y-value grow. + /// + public XPageDirection PageDirection + { + get { return _pageDirection; } + set + { + // Is there really anybody who needs the concept of XPageDirection.Upwards? + if (value != XPageDirection.Downwards) + throw new NotImplementedException("PageDirection must be XPageDirection.Downwards in current implementation."); + } + } + readonly XPageDirection _pageDirection; + + /// + /// Gets the current page origin. Setting the origin is not yet implemented. + /// + public XPoint PageOrigin + { + get { return _pageOrigin; } + set + { + // Is there really anybody who needs to set the page origin? + if (value != new XPoint()) + throw new NotImplementedException("PageOrigin cannot be modified in current implementation."); + } + } + XPoint _pageOrigin; + + /// + /// Gets the current size of the page. + /// + public XSize PageSize + { + get { return _pageSize; } + //set + //{ + // //TODO + // throw new NotImplementedException("PageSize cannot be modified in current implementation."); + //} + } + XSize _pageSize; + XSize _pageSizePoints; + + #region Drawing + + // ----- DrawLine ----------------------------------------------------------------------------- + +#if GDI + /// + /// Draws a line connecting two Point structures. + /// + public void DrawLine(XPen pen, GdiPoint pt1, GdiPoint pt2) + { + // Because of overloading the cast is NOT redundant. + DrawLine(pen, (double)pt1.X, (double)pt1.Y, (double)pt2.X, (double)pt2.Y); + } +#endif + +#if WPF + /// + /// Draws a line connecting two Point structures. + /// + public void DrawLine(XPen pen, SysPoint pt1, SysPoint pt2) + { + DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y); + } +#endif + +#if GDI + /// + /// Draws a line connecting two GdiPointF structures. + /// + public void DrawLine(XPen pen, GdiPointF pt1, GdiPointF pt2) + { + DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y); + } +#endif + + /// + /// Draws a line connecting two XPoint structures. + /// + public void DrawLine(XPen pen, XPoint pt1, XPoint pt2) + { + DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y); + } + + /// + /// Draws a line connecting the two points specified by coordinate pairs. + /// + public void DrawLine(XPen pen, double x1, double y1, double x2, double y2) + { + if (pen == null) + throw new ArgumentNullException("pen"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.DrawLine(pen.RealizeGdiPen(), (float)x1, (float)y1, (float)x2, (float)y2); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + _dc.DrawLine(pen.RealizeWpfPen(), new SysPoint(x1, y1), new SysPoint(x2, y2)); +#endif +#if UWP + _cds.DrawLine(new Vector2((float)x1, (float)x2), new Vector2((float)x2, (float)y2), Colors.Red, (float)pen.Width); +#endif + } + + if (_renderer != null) + _renderer.DrawLines(pen, new[] { new XPoint(x1, y1), new XPoint(x2, y2) }); + } + + // ----- DrawLines ---------------------------------------------------------------------------- + +#if GDI + /// + /// Draws a series of line segments that connect an array of points. + /// + public void DrawLines(XPen pen, GdiPoint[] points) + { + DrawLines(pen, MakePointFArray(points, 0, points.Length)); + } +#endif + +#if WPF || NETFX_CORE + /// + /// Draws a series of line segments that connect an array of points. + /// + public void DrawLines(XPen pen, SysPoint[] points) + { + DrawLines(pen, XGraphics.MakeXPointArray(points, 0, points.Length)); + } +#endif + +#if GDI + /// + /// Draws a series of line segments that connect an array of points. + /// + public void DrawLines(XPen pen, GdiPointF[] points) + { + if (pen == null) + throw new ArgumentNullException("pen"); + if (points == null) + throw new ArgumentNullException("points"); + if (points.Length < 2) + throw new ArgumentException(PSSR.PointArrayAtLeast(2), "points"); + + if (_drawGraphics) + { + try + { + Lock.EnterGdiPlus(); + _gfx.DrawLines(pen.RealizeGdiPen(), points); + } + finally { Lock.ExitGdiPlus(); } + } + + if (_renderer != null) + _renderer.DrawLines(pen, MakeXPointArray(points, 0, points.Length)); + } +#endif + + /// + /// Draws a series of line segments that connect an array of points. + /// + public void DrawLines(XPen pen, XPoint[] points) + { + if (pen == null) + throw new ArgumentNullException("pen"); + if (points == null) + throw new ArgumentNullException("points"); + if (points.Length < 2) + throw new ArgumentException(PSSR.PointArrayAtLeast(2), "points"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.DrawLines(pen.RealizeGdiPen(), XGraphics.MakePointFArray(points)); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { +#if !SILVERLIGHT + PolyLineSegment seg = new PolyLineSegment(XGraphics.MakePointArray(points), true); +#else + Point[] pts = XGraphics.MakePointArray(points); + PointCollection collection = new PointCollection(); + foreach (Point point in pts) + collection.Add(point); + PolyLineSegment seg = new PolyLineSegment(); + seg.Points = collection; +#endif + PathFigure figure = new PathFigure(); + figure.IsFilled = false; + figure.StartPoint = new SysPoint(points[0].X, points[0].Y); + figure.Segments.Add(seg); + PathGeometry geo = new PathGeometry(); + geo.Figures.Add(figure); + _dc.DrawGeometry(null, pen.RealizeWpfPen(), geo); + } +#endif +#if UWP + var pathBuilder = new CanvasPathBuilder(_cds.Device); + pathBuilder.BeginFigure((float)points[0].X, (float)points[0].Y, CanvasFigureFill.DoesNotAffectFills); + int length = points.Length; + for (int idx = 1; idx < length; idx++) + pathBuilder.AddLine((float)points[idx].X, (float)points[idx].Y); + pathBuilder.EndFigure(CanvasFigureLoop.Open); + var geometry = CanvasGeometry.CreatePath(pathBuilder); + _cds.DrawGeometry(geometry, Colors.Red); +#endif + } + + if (_renderer != null) + _renderer.DrawLines(pen, points); + } + + /// + /// Draws a series of line segments that connect an array of x and y pairs. + /// + public void DrawLines(XPen pen, double x, double y, params double[] value) + { + if (pen == null) + throw new ArgumentNullException("pen"); + if (value == null) + throw new ArgumentNullException("value"); + + int length = value.Length; + XPoint[] points = new XPoint[length / 2 + 1]; + points[0].X = x; + points[0].Y = y; + for (int idx = 0; idx < length / 2; idx++) + { + points[idx + 1].X = value[2 * idx]; + points[idx + 1].Y = value[2 * idx + 1]; + } + DrawLines(pen, points); + } + + // ----- DrawBezier --------------------------------------------------------------------------- + +#if GDI + /// + /// Draws a Bzier spline defined by four points. + /// + public void DrawBezier(XPen pen, GdiPoint pt1, GdiPoint pt2, GdiPoint pt3, GdiPoint pt4) + { + // ReSharper disable RedundantCast because it is required + DrawBezier(pen, (double)pt1.X, (double)pt1.Y, (double)pt2.X, (double)pt2.Y, + (double)pt3.X, (double)pt3.Y, (double)pt4.X, (double)pt4.Y); + // ReSharper restore RedundantCast + } +#endif + +#if WPF + /// + /// Draws a Bzier spline defined by four points. + /// + public void DrawBezier(XPen pen, SysPoint pt1, SysPoint pt2, SysPoint pt3, SysPoint pt4) + { + DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y); + } +#endif + +#if GDI + /// + /// Draws a Bzier spline defined by four points. + /// + public void DrawBezier(XPen pen, GdiPointF pt1, GdiPointF pt2, GdiPointF pt3, GdiPointF pt4) + { + DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y); + } +#endif + + /// + /// Draws a Bzier spline defined by four points. + /// + public void DrawBezier(XPen pen, XPoint pt1, XPoint pt2, XPoint pt3, XPoint pt4) + { + DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y); + } + + /// + /// Draws a Bzier spline defined by four points. + /// + public void DrawBezier(XPen pen, double x1, double y1, double x2, double y2, + double x3, double y3, double x4, double y4) + { + if (pen == null) + throw new ArgumentNullException("pen"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.DrawBezier(pen.RealizeGdiPen(), (float)x1, (float)y1, (float)x2, (float)y2, (float)x3, (float)y3, (float)x4, (float)y4); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { +#if !SILVERLIGHT + BezierSegment seg = new BezierSegment(new SysPoint(x2, y2), new SysPoint(x3, y3), new SysPoint(x4, y4), true); +#else + BezierSegment seg = new BezierSegment(); + seg.Point1 = new SysPoint(x2, y2); + seg.Point2 = new SysPoint(x3, y3); + seg.Point3 = new SysPoint(x4, y4); +#endif + PathFigure figure = new PathFigure(); + figure.StartPoint = new SysPoint(x1, y1); + figure.Segments.Add(seg); + PathGeometry geo = new PathGeometry(); + geo.Figures.Add(figure); + _dc.DrawGeometry(null, pen.RealizeWpfPen(), geo); + } +#endif + } + + if (_renderer != null) + _renderer.DrawBeziers(pen, + new XPoint[] { new XPoint(x1, y1), new XPoint(x2, y2), new XPoint(x3, y3), new XPoint(x4, y4) }); + } + + // ----- DrawBeziers -------------------------------------------------------------------------- + +#if GDI + /// + /// Draws a series of Bzier splines from an array of points. + /// + public void DrawBeziers(XPen pen, GdiPoint[] points) + { + DrawBeziers(pen, MakeXPointArray(points, 0, points.Length)); + } +#endif + +#if WPF + /// + /// Draws a series of Bzier splines from an array of points. + /// + public void DrawBeziers(XPen pen, SysPoint[] points) + { + DrawBeziers(pen, MakeXPointArray(points, 0, points.Length)); + } +#endif + +#if GDI + /// + /// Draws a series of Bzier splines from an array of points. + /// + public void DrawBeziers(XPen pen, GdiPointF[] points) + { + DrawBeziers(pen, MakeXPointArray(points, 0, points.Length)); + } +#endif + + /// + /// Draws a series of Bzier splines from an array of points. + /// + public void DrawBeziers(XPen pen, XPoint[] points) + { + if (pen == null) + throw new ArgumentNullException("pen"); + + int count = points.Length; + if (count == 0) + return; + + if ((count - 1) % 3 != 0) + throw new ArgumentException("Invalid number of points for bezier curves. Number must fulfill 4+3n.", "points"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.DrawBeziers(pen.RealizeGdiPen(), MakePointFArray(points)); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + PathFigure figure = new PathFigure(); + figure.StartPoint = new SysPoint(points[0].X, points[0].Y); + for (int idx = 1; idx < count; idx += 3) + { +#if !SILVERLIGHT + BezierSegment seg = new BezierSegment( + new SysPoint(points[idx].X, points[idx].Y), + new SysPoint(points[idx + 1].X, points[idx + 1].Y), + new SysPoint(points[idx + 2].X, points[idx + 2].Y), true); +#else + BezierSegment seg = new BezierSegment(); + seg.Point1 = new SysPoint(points[idx].X, points[idx].Y); + seg.Point2 = new SysPoint(points[idx + 1].X, points[idx + 1].Y); + seg.Point3 = new SysPoint(points[idx + 2].X, points[idx + 2].Y); +#endif + figure.Segments.Add(seg); + } + PathGeometry geo = new PathGeometry(); + geo.Figures.Add(figure); + _dc.DrawGeometry(null, pen.RealizeWpfPen(), geo); + } +#endif + } + + if (_renderer != null) + _renderer.DrawBeziers(pen, points); + } + + // ----- DrawCurve ---------------------------------------------------------------------------- + +#if GDI + /// + /// Draws a cardinal spline through a specified array of points. + /// + public void DrawCurve(XPen pen, GdiPoint[] points) + { + DrawCurve(pen, MakePointFArray(points, 0, points.Length), 0.5); + } + + /// + /// Draws a cardinal spline through a specified array of point using a specified tension. + /// The drawing begins offset from the beginning of the array. + /// + public void DrawCurve(XPen pen, GdiPoint[] points, int offset, int numberOfSegments, double tension) + { + DrawCurve(pen, MakePointFArray(points, offset, numberOfSegments), tension); + } +#endif + +#if WPF + /// + /// Draws a cardinal spline through a specified array of points. + /// + public void DrawCurve(XPen pen, SysPoint[] points) + { + DrawCurve(pen, MakeXPointArray(points, 0, points.Length), 0.5); + } + + /// + /// Draws a cardinal spline through a specified array of point. The drawing begins offset from the beginning of the array. + /// + public void DrawCurve(XPen pen, SysPoint[] points, int offset, int numberOfSegments) + { + DrawCurve(pen, MakeXPointArray(points, offset, numberOfSegments), 0.5); + } +#endif + +#if GDI + /// + /// Draws a cardinal spline through a specified array of points. + /// + public void DrawCurve(XPen pen, GdiPointF[] points) + { + DrawCurve(pen, MakeXPointArray(points, 0, points.Length), 0.5); + } +#endif + + /// + /// Draws a cardinal spline through a specified array of points. + /// + public void DrawCurve(XPen pen, XPoint[] points) + { + DrawCurve(pen, points, 0.5); + } + +#if GDI + /// + /// Draws a cardinal spline through a specified array of points using a specified tension. + /// + public void DrawCurve(XPen pen, GdiPoint[] points, double tension) + { + DrawCurve(pen, MakeXPointArray(points, 0, points.Length), tension); + } +#endif + +#if WPF + /// + /// Draws a cardinal spline through a specified array of points using a specified tension. + /// + public void DrawCurve(XPen pen, SysPoint[] points, double tension) + { + DrawCurve(pen, MakeXPointArray(points, 0, points.Length), tension); + } + + /// + /// Draws a cardinal spline through a specified array of point using a specified tension. + /// The drawing begins offset from the beginning of the array. + /// + public void DrawCurve(XPen pen, SysPoint[] points, int offset, int numberOfSegments, double tension) + { + DrawCurve(pen, MakeXPointArray(points, offset, numberOfSegments), tension); + } +#endif + +#if GDI + /// + /// Draws a cardinal spline through a specified array of points using a specified tension. + /// + public void DrawCurve(XPen pen, GdiPointF[] points, double tension) + { + DrawCurve(pen, MakeXPointArray(points, 0, points.Length), tension); + } + + /// + /// Draws a cardinal spline through a specified array of point. The drawing begins offset from the beginning of the array. + /// + public void DrawCurve(XPen pen, GdiPointF[] points, int offset, int numberOfSegments) + { + DrawCurve(pen, MakeXPointArray(points, offset, numberOfSegments), 0.5); + } + + /// + /// Draws a cardinal spline through a specified array of point using a specified tension. + /// The drawing begins offset from the beginning of the array. + /// + public void DrawCurve(XPen pen, GdiPointF[] points, int offset, int numberOfSegments, double tension) + { + DrawCurve(pen, MakeXPointArray(points, offset, numberOfSegments), tension); + } +#endif + + /// + /// Draws a cardinal spline through a specified array of point using a specified tension. + /// The drawing begins offset from the beginning of the array. + /// + public void DrawCurve(XPen pen, XPoint[] points, int offset, int numberOfSegments, double tension) + { + XPoint[] points2 = new XPoint[numberOfSegments]; + Array.Copy(points, offset, points2, 0, numberOfSegments); + DrawCurve(pen, points2, tension); + } + + /// + /// Draws a cardinal spline through a specified array of points using a specified tension. + /// + public void DrawCurve(XPen pen, XPoint[] points, double tension) + { + if (pen == null) + throw new ArgumentNullException("pen"); + if (points == null) + throw new ArgumentNullException("points"); + + int count = points.Length; + if (count < 2) + throw new ArgumentException("DrawCurve requires two or more points.", "points"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.DrawCurve(pen.RealizeGdiPen(), MakePointFArray(points), (float)tension); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + tension /= 3; + + PathFigure figure = new PathFigure(); + figure.StartPoint = new SysPoint(points[0].X, points[0].Y); + if (count == 2) + { + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[1], tension)); + } + else + { + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[2], tension)); + for (int idx = 1; idx < count - 2; idx++) + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension)); + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[count - 1], tension)); + } + PathGeometry geo = new PathGeometry(); + geo.Figures.Add(figure); + _dc.DrawGeometry(null, pen.RealizeWpfPen(), geo); + } +#endif + } + + if (_renderer != null) + _renderer.DrawCurve(pen, points, tension); + } + + // ----- DrawArc ------------------------------------------------------------------------------ + +#if GDI + /// + /// Draws an arc representing a portion of an ellipse. + /// + public void DrawArc(XPen pen, Rectangle rect, double startAngle, double sweepAngle) + { + // Because of overloading the cast is NOT redundant. + DrawArc(pen, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, startAngle, sweepAngle); + } +#endif + +#if GDI + /// + /// Draws an arc representing a portion of an ellipse. + /// + public void DrawArc(XPen pen, GdiRectF rect, double startAngle, double sweepAngle) + { + DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } +#endif + + /// + /// Draws an arc representing a portion of an ellipse. + /// + public void DrawArc(XPen pen, XRect rect, double startAngle, double sweepAngle) + { + DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } + + /// + /// Draws an arc representing a portion of an ellipse. + /// + public void DrawArc(XPen pen, double x, double y, double width, double height, double startAngle, double sweepAngle) + { + if (pen == null) + throw new ArgumentNullException("pen"); + + if (Math.Abs(sweepAngle) >= 360) + { + DrawEllipse(pen, x, y, width, height); + } + else + { + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.DrawArc(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + SysPoint startPoint; + ArcSegment seg = GeometryHelper.CreateArcSegment(x, y, width, height, startAngle, sweepAngle, out startPoint); + PathFigure figure = new PathFigure(); + figure.StartPoint = startPoint; + figure.Segments.Add(seg); + PathGeometry geo = new PathGeometry(); + geo.Figures.Add(figure); + _dc.DrawGeometry(null, pen.RealizeWpfPen(), geo); + } +#endif + } + + if (_renderer != null) + _renderer.DrawArc(pen, x, y, width, height, startAngle, sweepAngle); + } + } + + // ----- DrawRectangle ------------------------------------------------------------------------ + + // ----- stroke ----- + +#if GDI + /// + /// Draws a rectangle. + /// + public void DrawRectangle(XPen pen, Rectangle rect) + { + // Because of overloading the cast is NOT redundant. + DrawRectangle(pen, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height); + } +#endif + +#if GDI + /// + /// Draws a rectangle. + /// + public void DrawRectangle(XPen pen, GdiRectF rect) + { + DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + + /// + /// Draws a rectangle. + /// + public void DrawRectangle(XPen pen, XRect rect) + { + DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height); + } + + /// + /// Draws a rectangle. + /// + public void DrawRectangle(XPen pen, double x, double y, double width, double height) + { + if (pen == null) + throw new ArgumentNullException("pen"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.DrawRectangle(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + _dc.DrawRectangle(null, pen.RealizeWpfPen(), new Rect(x, y, width, height)); + } +#endif +#if UWP + if (TargetContext == XGraphicTargetContext.UWP) + { + _cds.DrawRectangle((float)x, (float)y, (float)width, (float)height, pen.Color.ToUwpColor()); + } +#endif + } + + if (_renderer != null) + _renderer.DrawRectangle(pen, null, x, y, width, height); + } + + // ----- fill ----- + +#if GDI + /// + /// Draws a rectangle. + /// + public void DrawRectangle(XBrush brush, Rectangle rect) + { + // Because of overloading the cast is NOT redundant. + DrawRectangle(brush, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height); + } +#endif + +#if GDI + /// + /// Draws a rectangle. + /// + public void DrawRectangle(XBrush brush, GdiRectF rect) + { + DrawRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + + /// + /// Draws a rectangle. + /// + public void DrawRectangle(XBrush brush, XRect rect) + { + DrawRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height); + } + + /// + /// Draws a rectangle. + /// + public void DrawRectangle(XBrush brush, double x, double y, double width, double height) + { + if (brush == null) + throw new ArgumentNullException("brush"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.FillRectangle(brush.RealizeGdiBrush(), (float)x, (float)y, (float)width, (float)height); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + _dc.DrawRectangle(brush.RealizeWpfBrush(), null, new Rect(x, y, width, height)); +#endif +#if UWP + if (TargetContext == XGraphicTargetContext.UWP) + { + _cds.DrawRectangle((float)x, (float)y, (float)width, (float)height, brush.RealizeCanvasBrush()); + } +#endif + } + + if (_renderer != null) + _renderer.DrawRectangle(null, brush, x, y, width, height); + } + + // ----- stroke and fill ----- + +#if GDI + /// + /// Draws a rectangle. + /// + public void DrawRectangle(XPen pen, XBrush brush, Rectangle rect) + { + // Because of overloading the cast is NOT redundant. + DrawRectangle(pen, brush, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height); + } +#endif + +#if GDI + /// + /// Draws a rectangle. + /// + public void DrawRectangle(XPen pen, XBrush brush, GdiRectF rect) + { + DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + + /// + /// Draws a rectangle. + /// + public void DrawRectangle(XPen pen, XBrush brush, XRect rect) + { + DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); + } + + /// + /// Draws a rectangle. + /// + public void DrawRectangle(XPen pen, XBrush brush, double x, double y, double width, double height) + { + if (pen == null && brush == null) + throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + if (brush != null) + _gfx.FillRectangle(brush.RealizeGdiBrush(), (float)x, (float)y, (float)width, (float)height); + if (pen != null) + _gfx.DrawRectangle(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + _dc.DrawRectangle( + brush != null ? brush.RealizeWpfBrush() : null, + pen != null ? pen.RealizeWpfPen() : null, + new Rect(x, y, width, height)); +#endif + } + + if (_renderer != null) + _renderer.DrawRectangle(pen, brush, x, y, width, height); + } + + // ----- DrawRectangles ----------------------------------------------------------------------- + + // ----- stroke ----- + +#if GDI + /// + /// Draws a series of rectangles. + /// + public void DrawRectangles(XPen pen, GdiRect[] rectangles) + { + if (pen == null) + throw new ArgumentNullException("pen"); + if (rectangles == null) + throw new ArgumentNullException("rectangles"); + + DrawRectangles(pen, null, rectangles); + } +#endif + +#if GDI + /// + /// Draws a series of rectangles. + /// + public void DrawRectangles(XPen pen, GdiRectF[] rectangles) + { + if (pen == null) + throw new ArgumentNullException("pen"); + if (rectangles == null) + throw new ArgumentNullException("rectangles"); + + DrawRectangles(pen, null, rectangles); + } +#endif + + /// + /// Draws a series of rectangles. + /// + public void DrawRectangles(XPen pen, XRect[] rectangles) + { + if (pen == null) + throw new ArgumentNullException("pen"); + if (rectangles == null) + throw new ArgumentNullException("rectangles"); + + DrawRectangles(pen, null, rectangles); + } + + // ----- fill ----- + +#if GDI + /// + /// Draws a series of rectangles. + /// + public void DrawRectangles(XBrush brush, GdiRect[] rectangles) + { + if (brush == null) + throw new ArgumentNullException("brush"); + if (rectangles == null) + throw new ArgumentNullException("rectangles"); + + DrawRectangles(null, brush, rectangles); + } +#endif + +#if GDI + /// + /// Draws a series of rectangles. + /// + public void DrawRectangles(XBrush brush, GdiRectF[] rectangles) + { + if (brush == null) + throw new ArgumentNullException("brush"); + if (rectangles == null) + throw new ArgumentNullException("rectangles"); + + DrawRectangles(null, brush, rectangles); + } +#endif + + /// + /// Draws a series of rectangles. + /// + public void DrawRectangles(XBrush brush, XRect[] rectangles) + { + if (brush == null) + throw new ArgumentNullException("brush"); + if (rectangles == null) + throw new ArgumentNullException("rectangles"); + + DrawRectangles(null, brush, rectangles); + } + + // ----- stroke and fill ----- + +#if GDI + /// + /// Draws a series of rectangles. + /// + public void DrawRectangles(XPen pen, XBrush brush, Rectangle[] rectangles) + { + if (pen == null && brush == null) + throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); + if (rectangles == null) + throw new ArgumentNullException("rectangles"); + + if (_drawGraphics) + { + try + { + Lock.EnterGdiPlus(); + if (brush != null) + _gfx.FillRectangles(brush.RealizeGdiBrush(), rectangles); + if (pen != null) + _gfx.DrawRectangles(pen.RealizeGdiPen(), rectangles); + } + finally { Lock.ExitGdiPlus(); } + } + if (_renderer != null) + { + int count = rectangles.Length; + for (int idx = 0; idx < count; idx++) + { + Rectangle rect = rectangles[idx]; + _renderer.DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); + } + } + } +#endif + +#if GDI + /// + /// Draws a series of rectangles. + /// + public void DrawRectangles(XPen pen, XBrush brush, GdiRectF[] rectangles) + { + if (pen == null && brush == null) + throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); + if (rectangles == null) + throw new ArgumentNullException("rectangles"); + + if (_drawGraphics) + { + try + { + Lock.EnterGdiPlus(); + if (brush != null) + _gfx.FillRectangles(brush.RealizeGdiBrush(), rectangles); + if (pen != null) + _gfx.DrawRectangles(pen.RealizeGdiPen(), rectangles); + } + finally { Lock.ExitGdiPlus(); } + } + if (_renderer != null) + { + int count = rectangles.Length; + for (int idx = 0; idx < count; idx++) + { + GdiRectF rect = rectangles[idx]; + _renderer.DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); + } + } + } +#endif + + /// + /// Draws a series of rectangles. + /// + public void DrawRectangles(XPen pen, XBrush brush, XRect[] rectangles) + { + if (pen == null && brush == null) + throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); + if (rectangles == null) + throw new ArgumentNullException("rectangles"); + + int count = rectangles.Length; + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + GdiRectF[] rects = MakeRectangleFArray(rectangles, 0, rectangles.Length); + try + { + Lock.EnterGdiPlus(); + if (brush != null) + _gfx.FillRectangles(brush.RealizeGdiBrush(), rects); + if (pen != null) + _gfx.DrawRectangles(pen.RealizeGdiPen(), rects); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + WpfBrush wpfBrush = brush != null ? brush.RealizeWpfBrush() : null; + WpfPen wpfPen = pen != null ? pen.RealizeWpfPen() : null; + for (int idx = 0; idx < count; idx++) + { + XRect rect = rectangles[idx]; + _dc.DrawRectangle(wpfBrush, wpfPen, new SysRect(new SysPoint(rect.X, rect.Y), new SysSize(rect.Width, rect.Height))); + } + } +#endif + } + + if (_renderer != null) + { + for (int idx = 0; idx < count; idx++) + { + XRect rect = rectangles[idx]; + _renderer.DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); + } + } + } + + // ----- DrawRoundedRectangle ----------------------------------------------------------------- + + // ----- stroke ----- + +#if GDI + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XPen pen, Rectangle rect, GdiSize ellipseSize) + { + DrawRoundedRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } +#endif + +#if WPF + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XPen pen, Rect rect, SysSize ellipseSize) + { + DrawRoundedRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } +#endif + +#if GDI + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XPen pen, GdiRectF rect, SizeF ellipseSize) + { + DrawRoundedRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } +#endif + + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XPen pen, XRect rect, XSize ellipseSize) + { + DrawRoundedRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } + + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XPen pen, double x, double y, double width, double height, double ellipseWidth, double ellipseHeight) + { + if (pen == null) + throw new ArgumentNullException("pen"); + + DrawRoundedRectangle(pen, null, x, y, width, height, ellipseWidth, ellipseHeight); + } + + // ----- fill ----- + +#if GDI + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XBrush brush, Rectangle rect, GdiSize ellipseSize) + { + DrawRoundedRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } +#endif + +#if WPF + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XBrush brush, Rect rect, SysSize ellipseSize) + { + DrawRoundedRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } +#endif + +#if GDI + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XBrush brush, GdiRectF rect, SizeF ellipseSize) + { + DrawRoundedRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } +#endif + + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XBrush brush, XRect rect, XSize ellipseSize) + { + DrawRoundedRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } + + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XBrush brush, double x, double y, double width, double height, double ellipseWidth, double ellipseHeight) + { + if (brush == null) + throw new ArgumentNullException("brush"); + + DrawRoundedRectangle(null, brush, x, y, width, height, ellipseWidth, ellipseHeight); + } + + // ----- stroke and fill ----- + +#if GDI + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XPen pen, XBrush brush, Rectangle rect, GdiSize ellipseSize) + { + // ReSharper disable RedundantCast because it is required + DrawRoundedRectangle(pen, brush, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, + (double)ellipseSize.Width, (double)ellipseSize.Height); + // ReSharper restore RedundantCast + } +#endif + +#if WPF + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XPen pen, XBrush brush, Rect rect, SysSize ellipseSize) + { + DrawRoundedRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } +#endif + +#if GDI + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XPen pen, XBrush brush, GdiRectF rect, SizeF ellipseSize) + { + DrawRoundedRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } +#endif + + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XPen pen, XBrush brush, XRect rect, XSize ellipseSize) + { + DrawRoundedRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } + + /// + /// Draws a rectangles with round corners. + /// + public void DrawRoundedRectangle(XPen pen, XBrush brush, double x, double y, double width, double height, + double ellipseWidth, double ellipseHeight) + { + if (pen == null && brush == null) + throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + XGraphicsPath path = new XGraphicsPath(); + path.AddRoundedRectangle(x, y, width, height, ellipseWidth, ellipseHeight); + DrawPath(pen, brush, path); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + _dc.DrawRoundedRectangle( + brush != null ? brush.RealizeWpfBrush() : null, + pen != null ? pen.RealizeWpfPen() : null, + new Rect(x, y, width, height), ellipseWidth / 2, ellipseHeight / 2); + } +#endif + } + + if (_renderer != null) + _renderer.DrawRoundedRectangle(pen, brush, x, y, width, height, ellipseWidth, ellipseHeight); + } + + // ----- DrawEllipse -------------------------------------------------------------------------- + + // ----- stroke ----- + +#if GDI + /// + /// Draws an ellipse defined by a bounding rectangle. + /// + public void DrawEllipse(XPen pen, Rectangle rect) + { + DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + +#if GDI + /// + /// Draws an ellipse defined by a bounding rectangle. + /// + public void DrawEllipse(XPen pen, GdiRectF rect) + { + DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + + /// + /// Draws an ellipse defined by a bounding rectangle. + /// + public void DrawEllipse(XPen pen, XRect rect) + { + DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height); + } + + /// + /// Draws an ellipse defined by a bounding rectangle. + /// + public void DrawEllipse(XPen pen, double x, double y, double width, double height) + { + if (pen == null) + throw new ArgumentNullException("pen"); + + // No DrawArc defined? + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.DrawArc(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height, 0, 360); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + double radiusX = width / 2; + double radiusY = height / 2; + _dc.DrawEllipse(null, pen.RealizeWpfPen(), new SysPoint(x + radiusX, y + radiusY), radiusX, radiusY); + } +#endif + } + + if (_renderer != null) + _renderer.DrawEllipse(pen, null, x, y, width, height); + } + + // ----- fill ----- + +#if GDI + /// + /// Draws an ellipse defined by a bounding rectangle. + /// + public void DrawEllipse(XBrush brush, Rectangle rect) + { + DrawEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + +#if GDI + /// + /// Draws an ellipse defined by a bounding rectangle. + /// + public void DrawEllipse(XBrush brush, GdiRectF rect) + { + DrawEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + + /// + /// Draws an ellipse defined by a bounding rectangle. + /// + public void DrawEllipse(XBrush brush, XRect rect) + { + DrawEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height); + } + + /// + /// Draws an ellipse defined by a bounding rectangle. + /// + public void DrawEllipse(XBrush brush, double x, double y, double width, double height) + { + if (brush == null) + throw new ArgumentNullException("brush"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.FillEllipse(brush.RealizeGdiBrush(), (float)x, (float)y, (float)width, (float)height); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + double radiusX = width / 2; + double radiusY = height / 2; + _dc.DrawEllipse(brush.RealizeWpfBrush(), null, new SysPoint(x + radiusX, y + radiusY), radiusX, radiusY); + } +#endif + } + + if (_renderer != null) + _renderer.DrawEllipse(null, brush, x, y, width, height); + } + + // ----- stroke and fill ----- + +#if GDI + /// + /// Draws an ellipse defined by a bounding rectangle. + /// + public void DrawEllipse(XPen pen, XBrush brush, Rectangle rect) + { + DrawEllipse(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + +#if GDI + /// + /// Draws an ellipse defined by a bounding rectangle. + /// + public void DrawEllipse(XPen pen, XBrush brush, GdiRectF rect) + { + DrawEllipse(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + + /// + /// Draws an ellipse defined by a bounding rectangle. + /// + public void DrawEllipse(XPen pen, XBrush brush, XRect rect) + { + DrawEllipse(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); + } + + /// + /// Draws an ellipse defined by a bounding rectangle. + /// + public void DrawEllipse(XPen pen, XBrush brush, double x, double y, double width, double height) + { + if (pen == null && brush == null) + throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + if (brush != null) + _gfx.FillEllipse(brush.RealizeGdiBrush(), (float)x, (float)y, (float)width, (float)height); + if (pen != null) + _gfx.DrawArc(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height, 0, 360); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + double radiusX = width / 2; + double radiusY = height / 2; + _dc.DrawEllipse( + brush != null ? brush.RealizeWpfBrush() : null, + pen != null ? pen.RealizeWpfPen() : null, + new SysPoint(x + radiusX, y + radiusY), radiusX, radiusY); + } +#endif +#if UWP + //var cds = new CanvasDrawingSession(); + //cds.DrawCachedGeometry(); + + if (TargetContext == XGraphicTargetContext.UWP) + { + var radiusX = (float)width / 2; + var radiusY = (float)height / 2; + + //var geometry = CanvasGeometry.CreateEllipse(_cds.Device, (float)x + radiusX, (float)y + radiusY, radiusX, radiusY); + + if (brush != null) + _cds.FillEllipse((float)x + radiusX, (float)y + radiusY, radiusX, radiusY, Colors.Blue); + if (pen != null) + _cds.DrawEllipse((float)x + radiusX, (float)y + radiusY, radiusX, radiusY, pen.Color.ToUwpColor()); + } +#endif + } + + if (_renderer != null) + _renderer.DrawEllipse(pen, brush, x, y, width, height); + } + + // ----- DrawPolygon -------------------------------------------------------------------------- + + // ----- stroke ----- + +#if GDI + /// + /// Draws a polygon defined by an array of points. + /// + public void DrawPolygon(XPen pen, GdiPoint[] points) + { + DrawPolygon(pen, MakeXPointArray(points, 0, points.Length)); + } +#endif + +#if WPF + /// + /// Draws a polygon defined by an array of points. + /// + public void DrawPolygon(XPen pen, SysPoint[] points) + { + DrawPolygon(pen, MakeXPointArray(points, 0, points.Length)); + } +#endif + +#if GDI + /// + /// Draws a polygon defined by an array of points. + /// + public void DrawPolygon(XPen pen, GdiPointF[] points) + { + DrawPolygon(pen, MakeXPointArray(points, 0, points.Length)); + } +#endif + + /// + /// Draws a polygon defined by an array of points. + /// + public void DrawPolygon(XPen pen, XPoint[] points) + { + if (pen == null) + throw new ArgumentNullException("pen"); + if (points == null) + throw new ArgumentNullException("points"); + if (points.Length < 2) + throw new ArgumentException(PSSR.PointArrayAtLeast(2), "points"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.DrawPolygon(pen.RealizeGdiPen(), MakePointFArray(points)); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + _dc.DrawGeometry(null, pen.RealizeWpfPen(), GeometryHelper.CreatePolygonGeometry(MakePointArray(points), XFillMode.Alternate, true)); + } +#endif + } + + if (_renderer != null) + _renderer.DrawPolygon(pen, null, points, XFillMode.Alternate); // XFillMode is ignored + } + + // ----- fill ----- + +#if GDI + /// + /// Draws a polygon defined by an array of points. + /// + public void DrawPolygon(XBrush brush, GdiPoint[] points, XFillMode fillmode) + { + DrawPolygon(brush, MakeXPointArray(points, 0, points.Length), fillmode); + } +#endif + +#if WPF + /// + /// Draws a polygon defined by an array of points. + /// + public void DrawPolygon(XBrush brush, SysPoint[] points, XFillMode fillmode) + { + DrawPolygon(brush, MakeXPointArray(points, 0, points.Length), fillmode); + } +#endif + +#if GDI + /// + /// Draws a polygon defined by an array of points. + /// + public void DrawPolygon(XBrush brush, GdiPointF[] points, XFillMode fillmode) + { + DrawPolygon(brush, MakeXPointArray(points, 0, points.Length), fillmode); + } +#endif + + /// + /// Draws a polygon defined by an array of points. + /// + public void DrawPolygon(XBrush brush, XPoint[] points, XFillMode fillmode) + { + if (brush == null) + throw new ArgumentNullException("brush"); + if (points == null) + throw new ArgumentNullException("points"); + if (points.Length < 2) + throw new ArgumentException(PSSR.PointArrayAtLeast(2), "points"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.FillPolygon(brush.RealizeGdiBrush(), MakePointFArray(points), (FillMode)fillmode); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + _dc.DrawGeometry(brush.RealizeWpfBrush(), null, GeometryHelper.CreatePolygonGeometry(MakePointArray(points), fillmode, true)); +#endif + } + + if (_renderer != null) + _renderer.DrawPolygon(null, brush, points, fillmode); + } + + // ----- stroke and fill ----- + +#if GDI + /// + /// Draws a polygon defined by an array of points. + /// + public void DrawPolygon(XPen pen, XBrush brush, GdiPoint[] points, XFillMode fillmode) + { + DrawPolygon(pen, brush, MakeXPointArray(points, 0, points.Length), fillmode); + } +#endif + +#if WPF + /// + /// Draws a polygon defined by an array of points. + /// + public void DrawPolygon(XPen pen, XBrush brush, SysPoint[] points, XFillMode fillmode) + { + DrawPolygon(pen, brush, MakeXPointArray(points, 0, points.Length), fillmode); + } +#endif + +#if GDI + /// + /// Draws a polygon defined by an array of points. + /// + public void DrawPolygon(XPen pen, XBrush brush, GdiPointF[] points, XFillMode fillmode) + { + DrawPolygon(pen, brush, MakeXPointArray(points, 0, points.Length), fillmode); + } +#endif + + /// + /// Draws a polygon defined by an array of points. + /// + public void DrawPolygon(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode) + { + if (pen == null && brush == null) + throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); + if (points == null) + throw new ArgumentNullException("points"); + if (points.Length < 2) + throw new ArgumentException(PSSR.PointArrayAtLeast(2), "points"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + GdiPointF[] pts = MakePointFArray(points); + try + { + Lock.EnterGdiPlus(); + if (brush != null) + _gfx.FillPolygon(brush.RealizeGdiBrush(), pts, (FillMode)fillmode); + if (pen != null) + _gfx.DrawPolygon(pen.RealizeGdiPen(), pts); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + WpfBrush wpfBrush = brush != null ? brush.RealizeWpfBrush() : null; + WpfPen wpfPen = brush != null ? pen.RealizeWpfPen() : null; + _dc.DrawGeometry(wpfBrush, wpfPen, GeometryHelper.CreatePolygonGeometry(MakePointArray(points), fillmode, true)); + } +#endif + } + + if (_renderer != null) + _renderer.DrawPolygon(pen, brush, points, fillmode); + } + + // ----- DrawPie ------------------------------------------------------------------------------ + + // ----- stroke ----- + +#if GDI + /// + /// Draws a pie defined by an ellipse. + /// + public void DrawPie(XPen pen, Rectangle rect, double startAngle, double sweepAngle) + { + // ReSharper disable RedundantCast because it is required + DrawPie(pen, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, startAngle, sweepAngle); + // ReSharper restore RedundantCast + } +#endif + +#if GDI + /// + /// Draws a pie defined by an ellipse. + /// + public void DrawPie(XPen pen, GdiRectF rect, double startAngle, double sweepAngle) + { + DrawPie(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } +#endif + + /// + /// Draws a pie defined by an ellipse. + /// + public void DrawPie(XPen pen, XRect rect, double startAngle, double sweepAngle) + { + DrawPie(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } + + /// + /// Draws a pie defined by an ellipse. + /// + public void DrawPie(XPen pen, double x, double y, double width, double height, double startAngle, double sweepAngle) + { + if (pen == null) + throw new ArgumentNullException("pen", PSSR.NeedPenOrBrush); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.DrawPie(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + DrawPie(pen, null, x, y, width, height, startAngle, sweepAngle); +#endif + } + + if (_renderer != null) + _renderer.DrawPie(pen, null, x, y, width, height, startAngle, sweepAngle); + } + + // ----- fill ----- + +#if GDI + /// + /// Draws a pie defined by an ellipse. + /// + public void DrawPie(XBrush brush, Rectangle rect, double startAngle, double sweepAngle) + { + // Because of overloading the cast is NOT redundant. + DrawPie(brush, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, startAngle, sweepAngle); + } +#endif + +#if GDI + /// + /// Draws a pie defined by an ellipse. + /// + public void DrawPie(XBrush brush, GdiRectF rect, double startAngle, double sweepAngle) + { + DrawPie(brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } +#endif + + /// + /// Draws a pie defined by an ellipse. + /// + public void DrawPie(XBrush brush, XRect rect, double startAngle, double sweepAngle) + { + DrawPie(brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } + + /// + /// Draws a pie defined by an ellipse. + /// + public void DrawPie(XBrush brush, double x, double y, double width, double height, double startAngle, double sweepAngle) + { + if (brush == null) + throw new ArgumentNullException("brush", PSSR.NeedPenOrBrush); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.FillPie(brush.RealizeGdiBrush(), (float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + DrawPie(null, brush, x, y, width, height, startAngle, sweepAngle); +#endif + } + + if (_renderer != null) + _renderer.DrawPie(null, brush, x, y, width, height, startAngle, sweepAngle); + } + + // ----- stroke and fill ----- + +#if GDI + /// + /// Draws a pie defined by an ellipse. + /// + public void DrawPie(XPen pen, XBrush brush, Rectangle rect, double startAngle, double sweepAngle) + { + DrawPie(pen, brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } +#endif + +#if GDI + /// + /// Draws a pie defined by an ellipse. + /// + public void DrawPie(XPen pen, XBrush brush, GdiRectF rect, double startAngle, double sweepAngle) + { + DrawPie(pen, brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } +#endif + + /// + /// Draws a pie defined by an ellipse. + /// + public void DrawPie(XPen pen, XBrush brush, XRect rect, double startAngle, double sweepAngle) + { + DrawPie(pen, brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } + + /// + /// Draws a pie defined by an ellipse. + /// + public void DrawPie(XPen pen, XBrush brush, double x, double y, double width, double height, double startAngle, double sweepAngle) + { + if (pen == null && brush == null) + throw new ArgumentNullException("pen", PSSR.NeedPenOrBrush); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + if (brush != null) + _gfx.FillPie(brush.RealizeGdiBrush(), (float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); + if (pen != null) + _gfx.DrawPie(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + WpfBrush wpfBrush = brush != null ? brush.RealizeWpfBrush() : null; + WpfPen wpfPen = pen != null ? pen.RealizeWpfPen() : null; + SysPoint center = new SysPoint(x + width / 2, y + height / 2); + SysPoint startArc; + ArcSegment arc = GeometryHelper.CreateArcSegment(x, y, width, height, startAngle, sweepAngle, out startArc); + PathFigure figure = new PathFigure(); + figure.StartPoint = center; +#if !SILVERLIGHT + LineSegment seg = new LineSegment(startArc, true); +#else + LineSegment seg = new LineSegment { Point = startArc }; +#endif + figure.Segments.Add(seg); + figure.Segments.Add(arc); + figure.IsClosed = true; + PathGeometry geo = new PathGeometry(); + geo.Figures.Add(figure); + _dc.DrawGeometry(wpfBrush, wpfPen, geo); + } +#endif + } + + if (_renderer != null) + _renderer.DrawPie(pen, brush, x, y, width, height, startAngle, sweepAngle); + } + + // ----- DrawClosedCurve ---------------------------------------------------------------------- + + // ----- stroke ----- + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, GdiPoint[] points) + { + DrawClosedCurve(pen, null, MakeXPointArray(points, 0, points.Length), XFillMode.Alternate, 0.5); + } +#endif + +#if WPF + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, SysPoint[] points) + { + DrawClosedCurve(pen, null, MakeXPointArray(points, 0, points.Length), XFillMode.Alternate, 0.5); + } +#endif + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, GdiPointF[] points) + { + DrawClosedCurve(pen, null, MakeXPointArray(points, 0, points.Length), XFillMode.Alternate, 0.5); + } +#endif + + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XPoint[] points) + { + DrawClosedCurve(pen, null, points, XFillMode.Alternate, 0.5); + } + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, GdiPoint[] points, double tension) + { + DrawClosedCurve(pen, null, MakeXPointArray(points, 0, points.Length), XFillMode.Alternate, tension); + } +#endif + +#if WPF + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, SysPoint[] points, double tension) + { + DrawClosedCurve(pen, null, MakeXPointArray(points, 0, points.Length), XFillMode.Alternate, tension); + } +#endif + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, GdiPointF[] points, double tension) + { + DrawClosedCurve(pen, null, MakeXPointArray(points, 0, points.Length), XFillMode.Alternate, tension); + } +#endif + + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XPoint[] points, double tension) + { + DrawClosedCurve(pen, null, points, XFillMode.Alternate, tension); + } + + // ----- fill ----- + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XBrush brush, GdiPoint[] points) + { + DrawClosedCurve(null, brush, MakeXPointArray(points, 0, points.Length), XFillMode.Alternate, 0.5); + } +#endif + +#if WPF + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XBrush brush, SysPoint[] points) + { + DrawClosedCurve(null, brush, MakeXPointArray(points, 0, points.Length), XFillMode.Alternate, 0.5); + } +#endif + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XBrush brush, GdiPointF[] points) + { + DrawClosedCurve(null, brush, MakeXPointArray(points, 0, points.Length), XFillMode.Alternate, 0.5); + } +#endif + + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XBrush brush, XPoint[] points) + { + DrawClosedCurve(null, brush, points, XFillMode.Alternate, 0.5); + } + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XBrush brush, GdiPoint[] points, XFillMode fillmode) + { + DrawClosedCurve(null, brush, MakeXPointArray(points, 0, points.Length), fillmode, 0.5); + } +#endif + +#if WPF + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XBrush brush, SysPoint[] points, XFillMode fillmode) + { + DrawClosedCurve(null, brush, MakeXPointArray(points, 0, points.Length), fillmode, 0.5); + } +#endif + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XBrush brush, GdiPointF[] points, XFillMode fillmode) + { + DrawClosedCurve(null, brush, MakeXPointArray(points, 0, points.Length), fillmode, 0.5); + } +#endif + + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XBrush brush, XPoint[] points, XFillMode fillmode) + { + DrawClosedCurve(null, brush, points, fillmode, 0.5); + } + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XBrush brush, GdiPoint[] points, XFillMode fillmode, double tension) + { + DrawClosedCurve(null, brush, MakeXPointArray(points, 0, points.Length), fillmode, tension); + } +#endif + +#if WPF + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XBrush brush, SysPoint[] points, XFillMode fillmode, double tension) + { + DrawClosedCurve(null, brush, MakeXPointArray(points, 0, points.Length), fillmode, tension); + } +#endif + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XBrush brush, GdiPointF[] points, XFillMode fillmode, double tension) + { + DrawClosedCurve(null, brush, MakeXPointArray(points, 0, points.Length), fillmode, tension); + } +#endif + + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XBrush brush, XPoint[] points, XFillMode fillmode, double tension) + { + DrawClosedCurve(null, brush, points, fillmode, tension); + } + + // ----- stroke and fill ----- + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XBrush brush, GdiPoint[] points) + { + DrawClosedCurve(pen, brush, MakeXPointArray(points, 0, points.Length), XFillMode.Alternate, 0.5); + } +#endif + +#if WPF + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XBrush brush, SysPoint[] points) + { + DrawClosedCurve(pen, brush, MakeXPointArray(points, 0, points.Length), XFillMode.Alternate, 0.5); + } +#endif + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XBrush brush, GdiPointF[] points) + { + DrawClosedCurve(pen, brush, MakeXPointArray(points, 0, points.Length), XFillMode.Alternate, 0.5); + } +#endif + + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points) + { + DrawClosedCurve(pen, brush, points, XFillMode.Alternate, 0.5); + } + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XBrush brush, GdiPoint[] points, XFillMode fillmode) + { + DrawClosedCurve(pen, brush, MakeXPointArray(points, 0, points.Length), fillmode, 0.5); + } +#endif + +#if WPF + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XBrush brush, SysPoint[] points, XFillMode fillmode) + { + DrawClosedCurve(pen, brush, MakeXPointArray(points, 0, points.Length), fillmode, 0.5); + } +#endif + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XBrush brush, GdiPointF[] points, XFillMode fillmode) + { + DrawClosedCurve(pen, brush, MakeXPointArray(points, 0, points.Length), fillmode, 0.5); + } +#endif + + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode) + { + DrawClosedCurve(pen, brush, points, fillmode, 0.5); + } + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XBrush brush, GdiPoint[] points, XFillMode fillmode, double tension) + { + DrawClosedCurve(pen, brush, MakeXPointArray(points, 0, points.Length), fillmode, tension); + } +#endif + +#if WPF + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XBrush brush, SysPoint[] points, XFillMode fillmode, double tension) + { + DrawClosedCurve(pen, brush, MakeXPointArray(points, 0, points.Length), fillmode, tension); + } +#endif + +#if GDI + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XBrush brush, GdiPointF[] points, XFillMode fillmode, double tension) + { + DrawClosedCurve(pen, brush, MakeXPointArray(points, 0, points.Length), fillmode, tension); + } +#endif + + /// + /// Draws a closed cardinal spline defined by an array of points. + /// + public void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode, double tension) + { + if (pen == null && brush == null) + { + // ReSharper disable once NotResolvedInText + throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); + } + + int count = points.Length; + if (count == 0) + return; + if (count < 2) + throw new ArgumentException("Not enough points.", "points"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + if (brush != null) + _gfx.FillClosedCurve(brush.RealizeGdiBrush(), MakePointFArray(points), (FillMode)fillmode, (float)tension); + if (pen != null) + { + // The fillmode is not used by DrawClosedCurve. + _gfx.DrawClosedCurve(pen.RealizeGdiPen(), MakePointFArray(points), (float)tension, (FillMode)fillmode); + } + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + tension /= 3; // Simply tried out. Not proofed why it is correct. + + PathFigure figure = new PathFigure(); + figure.IsClosed = true; + figure.StartPoint = new SysPoint(points[0].X, points[0].Y); + if (count == 2) + { + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[1], tension)); + } + else + { + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 1], points[0], points[1], points[2], tension)); + for (int idx = 1; idx < count - 2; idx++) + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension)); + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[0], tension)); + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 2], points[count - 1], points[0], points[1], tension)); + } + PathGeometry geo = new PathGeometry(); + geo.FillRule = fillmode == XFillMode.Alternate ? FillRule.EvenOdd : FillRule.Nonzero; + geo.Figures.Add(figure); + WpfBrush wpfBrush = brush != null ? brush.RealizeWpfBrush() : null; + WpfPen wpfPen = pen != null ? pen.RealizeWpfPen() : null; + _dc.DrawGeometry(wpfBrush, wpfPen, geo); + } +#endif + } + + if (_renderer != null) + _renderer.DrawClosedCurve(pen, brush, points, tension, fillmode); + } + + // ----- DrawPath ----------------------------------------------------------------------------- + + // ----- stroke ----- + + /// + /// Draws a graphical path. + /// + public void DrawPath(XPen pen, XGraphicsPath path) + { + if (pen == null) + throw new ArgumentNullException("pen"); + if (path == null) + throw new ArgumentNullException("path"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.DrawPath(pen.RealizeGdiPen(), path._gdipPath); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + _dc.DrawGeometry(null, pen.RealizeWpfPen(), path._pathGeometry); +#endif + } + + if (_renderer != null) + _renderer.DrawPath(pen, null, path); + } + + // ----- fill ----- + + /// + /// Draws a graphical path. + /// + public void DrawPath(XBrush brush, XGraphicsPath path) + { + if (brush == null) + throw new ArgumentNullException("brush"); + if (path == null) + throw new ArgumentNullException("path"); + + if (_drawGraphics) + { +#if GDI + // $TODO THHO Lock??? + if (TargetContext == XGraphicTargetContext.GDI) + _gfx.FillPath(brush.RealizeGdiBrush(), path._gdipPath); +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + _dc.DrawGeometry(brush.RealizeWpfBrush(), null, path._pathGeometry); +#endif + } + + if (_renderer != null) + _renderer.DrawPath(null, brush, path); + } + + // ----- stroke and fill ----- + + /// + /// Draws a graphical path. + /// + public void DrawPath(XPen pen, XBrush brush, XGraphicsPath path) + { + if (pen == null && brush == null) + { + // ReSharper disable once NotResolvedInText + throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); + } + if (path == null) + throw new ArgumentNullException("path"); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + if (brush != null) + _gfx.FillPath(brush.RealizeGdiBrush(), path._gdipPath); + if (pen != null) + _gfx.DrawPath(pen.RealizeGdiPen(), path._gdipPath); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + WpfBrush wpfBrush = brush != null ? brush.RealizeWpfBrush() : null; + WpfPen wpfPen = pen != null ? pen.RealizeWpfPen() : null; + _dc.DrawGeometry(wpfBrush, wpfPen, path._pathGeometry); + } +#endif + } + + if (_renderer != null) + _renderer.DrawPath(pen, brush, path); + } + + // ----- DrawString --------------------------------------------------------------------------- + +#if GDI + /// + /// Draws the specified text string. + /// + public void DrawString(string s, XFont font, XBrush brush, GdiPointF point) + { + DrawString(s, font, brush, new XRect(point.X, point.Y, 0, 0), XStringFormats.Default); + } +#endif + + /// + /// Draws the specified text string. + /// + public void DrawString(string s, XFont font, XBrush brush, XPoint point) + { + DrawString(s, font, brush, new XRect(point.X, point.Y, 0, 0), XStringFormats.Default); + } + +#if GDI + /// + /// Draws the specified text string. + /// + public void DrawString(string s, XFont font, XBrush brush, GdiPointF point, XStringFormat format) + { + DrawString(s, font, brush, new XRect(point.X, point.Y, 0, 0), format); + } +#endif + + /// + /// Draws the specified text string. + /// + public void DrawString(string s, XFont font, XBrush brush, XPoint point, XStringFormat format) + { + DrawString(s, font, brush, new XRect(point.X, point.Y, 0, 0), format); + } + + /// + /// Draws the specified text string. + /// + public void DrawString(string s, XFont font, XBrush brush, double x, double y) + { + DrawString(s, font, brush, new XRect(x, y, 0, 0), XStringFormats.Default); + } + + /// + /// Draws the specified text string. + /// + public void DrawString(string s, XFont font, XBrush brush, double x, double y, XStringFormat format) + { + DrawString(s, font, brush, new XRect(x, y, 0, 0), format); + } + +#if GDI + /// + /// Draws the specified text string. + /// + public void DrawString(string s, XFont font, XBrush brush, GdiRectF layoutRectangle) + { + DrawString(s, font, brush, new XRect(layoutRectangle), XStringFormats.Default); + } +#endif + + /// + /// Draws the specified text string. + /// + public void DrawString(string s, XFont font, XBrush brush, XRect layoutRectangle) + { + DrawString(s, font, brush, layoutRectangle, XStringFormats.Default); + } + +#if GDI + /// + /// Draws the specified text string. + /// + public void DrawString(string s, XFont font, XBrush brush, GdiRectF layoutRectangle, XStringFormat format) + { + DrawString(s, font, brush, new XRect(layoutRectangle), format); + } +#endif + + /// + /// Draws the specified text string. + /// + public void DrawString(string text, XFont font, XBrush brush, XRect layoutRectangle, XStringFormat format) + { + if (text == null) + throw new ArgumentNullException("text"); + if (font == null) + throw new ArgumentNullException("font"); + if (brush == null) + throw new ArgumentNullException("brush"); + + if (format != null && format.LineAlignment == XLineAlignment.BaseLine && layoutRectangle.Height != 0) + throw new InvalidOperationException("DrawString: With XLineAlignment.BaseLine the height of the layout rectangle must be 0."); + + if (text.Length == 0) + return; + + if (format == null) + format = XStringFormats.Default; + // format cannot be null below this line. + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + // Was font created with font resolver? + if (font.GdiFont == null) + throw new InvalidOperationException("This font cannot be used by GDI+."); + + try + { + Lock.EnterGdiPlus(); + GdiRectF rect = layoutRectangle.ToRectangleF(); + if (format.LineAlignment == XLineAlignment.BaseLine) + { + double lineSpace = font.GetHeight(); //old: font.GetHeight(this); + int cellSpace = font.FontFamily.GetLineSpacing(font.Style); + int cellAscent = font.FontFamily.GetCellAscent(font.Style); + int cellDescent = font.FontFamily.GetCellDescent(font.Style); + double cyAscent = lineSpace * cellAscent / cellSpace; + cyAscent = lineSpace * font.CellAscent / font.CellSpace; + rect.Offset(0, (float)-cyAscent); + } + //_gfx.DrawString(text, font.Realize_GdiFont(), brush.RealizeGdiBrush(), rect, + // format != null ? format.RealizeGdiStringFormat() : null); + _gfx.DrawString(text, font.GdiFont, brush.RealizeGdiBrush(), rect, + format.RealizeGdiStringFormat()); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { +#if !SILVERLIGHT + double x = layoutRectangle.X; + double y = layoutRectangle.Y; + + double lineSpace = font.GetHeight(); // old: font.GetHeight(this); + double cyAscent = lineSpace * font.CellAscent / font.CellSpace; + double cyDescent = lineSpace * font.CellDescent / font.CellSpace; + + bool bold = (font.Style & XFontStyle.Bold) != 0; + bool italic = (font.Style & XFontStyle.Italic) != 0; + bool strikeout = (font.Style & XFontStyle.Strikeout) != 0; + bool underline = (font.Style & XFontStyle.Underline) != 0; + + //GlyphRun glyphRun=new GlyphRun(font.GlyphTypeface , 0,); +#if DEBUG_ + if (font.WpfTypeface.FontFamily.Source == "Segoe UI Light") + GetType(); +#endif + FormattedText formattedText = FontHelper.CreateFormattedText(text, font.WpfTypeface, font.Size, brush.RealizeWpfBrush()); + + //formattedText.SetTextDecorations(TextDecorations.OverLine); + switch (format.Alignment) + { + case XStringAlignment.Near: + // nothing to do, this is the default + //formattedText.TextAlignment = TextAlignment.Left; + break; + + case XStringAlignment.Center: + x += layoutRectangle.Width / 2; + formattedText.TextAlignment = TextAlignment.Center; + break; + + case XStringAlignment.Far: + x += layoutRectangle.Width; + formattedText.TextAlignment = TextAlignment.Right; + break; + } + if (PageDirection == XPageDirection.Downwards) + { + switch (format.LineAlignment) + { + case XLineAlignment.Near: + //y += cyAscent; + break; + + case XLineAlignment.Center: + // TODO use CapHeight. PDFlib also uses 3/4 of ascent + y += -formattedText.Baseline + (cyAscent * 1 / 3) + layoutRectangle.Height / 2; + //y += -formattedText.Baseline + (font.Size * font.Metrics.CapHeight / font.unitsPerEm / 2) + layoutRectangle.Height / 2; + break; + + case XLineAlignment.Far: + y += -formattedText.Baseline - cyDescent + layoutRectangle.Height; + break; + + case XLineAlignment.BaseLine: + y -= formattedText.Baseline; + break; + } + } + else + { + // TODOWPF: make unit test + switch (format.LineAlignment) + { + case XLineAlignment.Near: + //y += cyDescent; + break; + + case XLineAlignment.Center: + // TODO use CapHeight. PDFlib also uses 3/4 of ascent + //y += -(cyAscent * 3 / 4) / 2 + rect.Height / 2; + break; + + case XLineAlignment.Far: + //y += -cyAscent + rect.Height; + break; + + case XLineAlignment.BaseLine: + // nothing to do + break; + } + } + + // BoldSimulation and ItalicSimulation is done only in PDF, not in UI. + + if (underline) + { + formattedText.SetTextDecorations(TextDecorations.Underline); + //double underlinePosition = lineSpace * realizedFont.FontDescriptor.descriptor.UnderlinePosition / font.cellSpace; + //double underlineThickness = lineSpace * realizedFont.FontDescriptor.descriptor.UnderlineThickness / font.cellSpace; + //DrawRectangle(null, brush, x, y - underlinePosition, width, underlineThickness); + } + + if (strikeout) + { + formattedText.SetTextDecorations(TextDecorations.Strikethrough); + //double strikeoutPosition = lineSpace * realizedFont.FontDescriptor.descriptor.StrikeoutPosition / font.cellSpace; + //double strikeoutSize = lineSpace * realizedFont.FontDescriptor.descriptor.StrikeoutSize / font.cellSpace; + //DrawRectangle(null, brush, x, y - strikeoutPosition - strikeoutSize, width, strikeoutSize); + } + + //_dc.DrawText(formattedText, layoutRectangle.Location.ToPoint()); + _dc.DrawText(formattedText, new SysPoint(x, y)); +#else + _dc.DrawString(this, text, font, brush, layoutRectangle, format); +#endif + } +#endif + } + + if (_renderer != null) + _renderer.DrawString(text, font, brush, layoutRectangle, format); + } + + // ----- MeasureString ------------------------------------------------------------------------ + + /// + /// Measures the specified string when drawn with the specified font. + /// + public XSize MeasureString(string text, XFont font, XStringFormat stringFormat) + { + if (text == null) + throw new ArgumentNullException("text"); + if (font == null) + throw new ArgumentNullException("font"); + if (stringFormat == null) + throw new ArgumentNullException("stringFormat"); +#if true + return FontHelper.MeasureString(text, font, stringFormat); +#else + +#if GDI && !WPF + //XSize gdiSize; // #MediumTrust + //if (_gfx != null) + // gdiSize = XSize.FromSizeF(_gfx.MeasureString(text, font.Realize_GdiFont(), new GdiPointF(0, 0), stringFormat.RealizeGdiStringFormat())); + //else + // gdiSize = FontHelper.MeasureString(text, font, XStringFormats.Default); // TODO 4STLA: Why is parameter stringFormat not used here? +#if DEBUG_ + XSize edfSize = FontHelper.MeasureString(text, font, XStringFormats.Default); + //Debug.Assert(gdiSize == edfSize, "Measure string failed."); + if (gdiSize != edfSize) + { + double dx = Math.Abs(gdiSize.Width - edfSize.Width); + double dy = Math.Abs(gdiSize.Height - edfSize.Height); + Debug.Assert(dx < .05 * gdiSize.Width, "MeasureString: width differs."); + Debug.Assert(dy < .05 * gdiSize.Height, "MeasureString: height differs."); + } +#endif + return FontHelper.MeasureString(text, font, XStringFormats.Default); +#endif +#if WPF && !GDI +#if !SILVERLIGHT +#if DEBUG + FormattedText formattedText = FontHelper.CreateFormattedText(text, font.WpfTypeface, font.Size, WpfBrushes.Black); + XSize size1 = FontHelper.MeasureString(text, font, null); + XSize size2 = new XSize(formattedText.WidthIncludingTrailingWhitespace, formattedText.Height); + //Debug.Assert(Math.Abs((size1.Height - size2.Height) * 10) < 1.0); + return size1; +#else + // Same as above, but without code needed for Debug.Assert. + XSize size1 = FontHelper.MeasureString(text, font, null); + return size1; +#endif +#else + // Use the WPF code also for Silverlight. + XSize size1 = FontHelper.MeasureString(text, font, null); + return size1; +#endif + +#endif +#if WPF && GDI +#if true_ + if (TargetContext == XGraphicTargetContext.GDI) + { + XSize gdiSize = XSize.FromSizeF(_gfx.MeasureString(text, font.Realize_GdiFont(), new GdiPointF(0, 0), stringFormat.RealizeGdiStringFormat())); +#if DEBUG +#if GDI + { + //Debug.WriteLine(gdiSize); + XSize edfSize = FontHelper14.MeasureStringGdi(_gfx, text, font, XStringFormats.Default); + //Debug.WriteLine(edfSize); + //Debug.Assert(gdiSize == edfSize, "Measure string failed."); + if (gdiSize.Width != edfSize.Width) + { + Debug.WriteLine(String.Format("Width: {0}, {1} : {2}", gdiSize.Width, edfSize.Width, gdiSize.Width / edfSize.Width)); + } + if (gdiSize.Height != edfSize.Height) + { + Debug.WriteLine(String.Format("Height: {0}, {1}", gdiSize.Height, edfSize.Height)); + } + + //double lineSpace = font.GetHeight(this); + //int cellSpace = font.cellSpace; // font.FontFamily.GetLineSpacing(font.Style); + //int cellAscent = font.cellAscent; // font.FontFamily.GetCellAscent(font.Style); + //int cellDescent = font.cellDescent; // font.FontFamily.GetCellDescent(font.Style); + //double cyAscent = lineSpace * cellAscent / cellSpace; + //double cyDescent = lineSpace * cellDescent / cellSpace; + } +#endif +#if WPF + { + //Debug.WriteLine(gdiSize); + XSize edfSize = FontHelper14.MeasureStringWpf(text, font, XStringFormats.Default); + //Debug.WriteLine(edfSize); + //Debug.Assert(gdiSize == edfSize, "Measure string failed."); + if (gdiSize.Width != edfSize.Width) + { + Debug.WriteLine(String.Format("Width: {0}, {1} : {2}", gdiSize.Width, edfSize.Width, gdiSize.Width / edfSize.Width)); + } + if (gdiSize.Height != edfSize.Height) + { + Debug.WriteLine(String.Format("Height: {0}, {1}", gdiSize.Height, edfSize.Height)); + } + + //double lineSpace = font.GetHeight(this); + //int cellSpace = font.cellSpace; // font.FontFamily.GetLineSpacing(font.Style); + //int cellAscent = font.cellAscent; // font.FontFamily.GetCellAscent(font.Style); + //int cellDescent = font.cellDescent; // font.FontFamily.GetCellDescent(font.Style); + //double cyAscent = lineSpace * cellAscent / cellSpace; + //double cyDescent = lineSpace * cellDescent / cellSpace; + } +#endif +#endif + return gdiSize; + } + if (TargetContext == XGraphicTargetContext.WPF) + { + //double h = font.Height; + //FormattedText formattedText = new FormattedText(text, new CultureInfo("en-us"), + // FlowDirection.LeftToRight, font.typeface, font.Size, WpfBrushes.Black); + FormattedText formattedText = FontHelper.CreateFormattedText(text, font.Typeface, font.Size, WpfBrushes.Black); + XSize wpfSize = new XSize(formattedText.WidthIncludingTrailingWhitespace, formattedText.Height); +#if DEBUG + Debug.WriteLine(wpfSize); +#endif + return wpfSize; + } + Debug.Assert(false); + return XSize.Empty; +#else + XSize size23 = FontHelper.MeasureString(text, font, XStringFormats.Default); + return size23; +#endif +#endif +#if CORE || NETFX_CORE || UWP + XSize size = FontHelper.MeasureString(text, font, XStringFormats.Default); + return size; +#endif +#endif + } + + /// + /// Measures the specified string when drawn with the specified font. + /// + public XSize MeasureString(string text, XFont font) + { + return MeasureString(text, font, XStringFormats.Default); + } + + // ----- DrawImage ---------------------------------------------------------------------------- + +#if GDI + /// + /// Draws the specified image. + /// + public void DrawImage(XImage image, GdiPoint point) + { + DrawImage(image, point.X, point.Y); + } +#endif + +#if WPF + /// + /// Draws the specified image. + /// + public void DrawImage(XImage image, SysPoint point) + { + DrawImage(image, point.X, point.Y); + } +#endif + +#if GDI + /// + /// Draws the specified image. + /// + public void DrawImage(XImage image, GdiPointF point) + { + DrawImage(image, point.X, point.Y); + } +#endif + + /// + /// Draws the specified image. + /// + public void DrawImage(XImage image, XPoint point) + { + DrawImage(image, point.X, point.Y); + } + + /// + /// Draws the specified image. + /// + public void DrawImage(XImage image, double x, double y) + { + if (image == null) + throw new ArgumentNullException("image"); + + CheckXPdfFormConsistence(image); + + double width = image.PointWidth; + double height = image.PointHeight; + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + if (image._gdiImage != null) + { + InterpolationMode interpolationMode = InterpolationMode.Invalid; + if (!image.Interpolate) + { + interpolationMode = _gfx.InterpolationMode; + _gfx.InterpolationMode = InterpolationMode.NearestNeighbor; + } + + _gfx.DrawImage(image._gdiImage, (float)x, (float)y, (float)width, (float)height); + + if (!image.Interpolate) + _gfx.InterpolationMode = interpolationMode; + } + else + { + DrawMissingImageRect(new XRect(x, y, width, height)); + //_gfx.DrawRectangle(Pens.Red, (float)x, (float)y, (float)width, (float)height); + //_gfx.DrawLine(Pens.Red, (float)x, (float)y, (float)(x + width), (float)(y + height)); + //_gfx.DrawLine(Pens.Red, (float)(x + width), (float)y, (float)x, (float)(y + height)); + } + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + if (image._wpfImage != null) + { + _dc.DrawImage(image._wpfImage, new Rect(x, y, image.PointWidth, image.PointHeight)); + } + else + { + DrawMissingImageRect(new XRect(x, y, width, height)); + } + } +#endif + } + + if (_renderer != null) + _renderer.DrawImage(image, x, y, image.PointWidth, image.PointHeight); + //image.Width * 72 / image.HorizontalResolution, + //image.Height * 72 / image.HorizontalResolution); + } + +#if GDI + /// + /// Draws the specified image. + /// + public void DrawImage(XImage image, Rectangle rect) + { + // Because of overloading the cast is NOT redundant. + DrawImage(image, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height); + } +#endif + +#if GDI + /// + /// Draws the specified image. + /// + public void DrawImage(XImage image, GdiRectF rect) + { + DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + + /// + /// Draws the specified image. + /// + public void DrawImage(XImage image, XRect rect) + { + DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height); + } + + /// + /// Draws the specified image. + /// + public void DrawImage(XImage image, double x, double y, double width, double height) + { + if (image == null) + throw new ArgumentNullException("image"); + + CheckXPdfFormConsistence(image); + + if (_drawGraphics) + { + // THHO4STLA: Platform-independent images cannot be drawn here, can they? => They can. Lazy create platform-dependent image and draw that. +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + if (image._gdiImage != null) + { + InterpolationMode interpolationMode = InterpolationMode.Invalid; + if (!image.Interpolate) + { + interpolationMode = _gfx.InterpolationMode; + _gfx.InterpolationMode = InterpolationMode.NearestNeighbor; + } + + _gfx.DrawImage(image._gdiImage, (float)x, (float)y, (float)width, (float)height); + + if (!image.Interpolate) + _gfx.InterpolationMode = interpolationMode; + } + else + { + XImage placeholder = null; + XPdfForm pdfForm = image as XPdfForm; + if (pdfForm != null) + { + //XPdfForm pf = pdfForm; + if (pdfForm.PlaceHolder != null) + placeholder = pdfForm.PlaceHolder; + } + if (placeholder != null) + _gfx.DrawImage(placeholder._gdiImage, (float)x, (float)y, (float)width, + (float)height); + else + { + DrawMissingImageRect(new XRect(x, y, width, height)); + } + } + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + if (image._wpfImage != null) + { + //InterpolationMode interpolationMode = InterpolationMode.Invalid; + //if (!image.Interpolate) + //{ + // interpolationMode = gfx.InterpolationMode; + // gfx.InterpolationMode = InterpolationMode.NearestNeighbor; + //} + + _dc.DrawImage(image._wpfImage, new Rect(x, y, width, height)); + + //if (!image.Interpolate) + // gfx.InterpolationMode = interpolationMode; + } + else + { + XImage placeholder = null; + if (image is XPdfForm) + { + XPdfForm pf = image as XPdfForm; + if (pf.PlaceHolder != null) + placeholder = pf.PlaceHolder; + } + if (placeholder != null) + _dc.DrawImage(placeholder._wpfImage, new Rect(x, y, width, height)); + else + DrawMissingImageRect(new XRect(x, y, width, height)); + } + } +#endif + } + + if (_renderer != null) + _renderer.DrawImage(image, x, y, width, height); + } + + // TODO: calculate destination size + //public void DrawImage(XImage image, double x, double y, GdiRectF srcRect, XGraphicsUnit srcUnit) + //public void DrawImage(XImage image, double x, double y, XRect srcRect, XGraphicsUnit srcUnit) + +#if GDI + /// + /// Draws the specified image. + /// + public void DrawImage(XImage image, Rectangle destRect, Rectangle srcRect, XGraphicsUnit srcUnit) + { + XRect destRectX = new XRect(destRect.X, destRect.Y, destRect.Width, destRect.Height); + XRect srcRectX = new XRect(srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height); + DrawImage(image, destRectX, srcRectX, srcUnit); + } +#endif + +#if GDI + /// + /// Draws the specified image. + /// + public void DrawImage(XImage image, GdiRectF destRect, GdiRectF srcRect, XGraphicsUnit srcUnit) + { + XRect destRectX = new XRect(destRect.X, destRect.Y, destRect.Width, destRect.Height); + XRect srcRectX = new XRect(srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height); + DrawImage(image, destRectX, srcRectX, srcUnit); + } +#endif + + /// + /// Draws the specified image. + /// + public void DrawImage(XImage image, XRect destRect, XRect srcRect, XGraphicsUnit srcUnit) + { + if (image == null) + throw new ArgumentNullException("image"); + + CheckXPdfFormConsistence(image); + + if (_drawGraphics) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + if (image._gdiImage != null) + { + InterpolationMode interpolationMode = InterpolationMode.Invalid; + if (!image.Interpolate) + { + interpolationMode = _gfx.InterpolationMode; + _gfx.InterpolationMode = InterpolationMode.NearestNeighbor; + } + + GdiRectF destRectF = new GdiRectF((float)destRect.X, (float)destRect.Y, + (float)destRect.Width, (float)destRect.Height); + GdiRectF srcRectF = new GdiRectF((float)srcRect.X, (float)srcRect.Y, + (float)srcRect.Width, (float)srcRect.Height); + _gfx.DrawImage(image._gdiImage, destRectF, srcRectF, GraphicsUnit.Pixel); + + if (!image.Interpolate) + _gfx.InterpolationMode = interpolationMode; + } + else + { + DrawMissingImageRect(new XRect(destRect.X, destRect.Y, destRect.Width, destRect.Height)); + } + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + if (image._wpfImage != null) + { + //InterpolationMode interpolationMode = InterpolationMode.Invalid; + //if (!image.Interpolate) + //{ + // interpolationMode = gfx.InterpolationMode; + // //gfx.InterpolationMode = InterpolationMode.NearestNeighbor; + //} + + // HACK: srcRect is ignored + //double x = destRect.X; + //double y = destRect.Y; + _dc.DrawImage(image._wpfImage, new SysRect(destRect.X, destRect.Y, destRect.Width, destRect.Height)); + + //if (!image.Interpolate) + // gfx.InterpolationMode = interpolationMode; + } + else + { + DrawMissingImageRect(destRect); + } + } +#endif + } + + if (_renderer != null) + _renderer.DrawImage(image, destRect, srcRect, srcUnit); + } + + //TODO? + //public void DrawImage(XImage image, Rectangle destRect, double srcX, double srcY, double srcWidth, double srcHeight, GraphicsUnit srcUnit); + //public void DrawImage(XImage image, Rectangle destRect, double srcX, double srcY, double srcWidth, double srcHeight, GraphicsUnit srcUnit); + + void DrawMissingImageRect(XRect rect) + { +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + float x = (float)rect.X; + float y = (float)rect.Y; + float width = (float)rect.Width; + float height = (float)rect.Height; + _gfx.DrawRectangle(Pens.Red, x, y, width, height); + _gfx.DrawLine(Pens.Red, x, y, x + width, y + height); + _gfx.DrawLine(Pens.Red, x + width, y, x, y + height); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + double x = rect.X; + double y = rect.Y; + double width = rect.Width; + double height = rect.Height; +#if !SILVERLIGHT + WpfPen pen = new WpfPen(WpfBrushes.Red, 1); +#else + WpfPen pen = new WpfPen(); + pen.Brush = new SolidColorBrush(Colors.Red); + pen.Thickness = 1; +#endif + _dc.DrawRectangle(null, pen, new Rect(x, y, width, height)); + _dc.DrawLine(pen, new SysPoint(x, y), new SysPoint(x + width, y + height)); + _dc.DrawLine(pen, new SysPoint(x + width, y), new SysPoint(x, y + height)); + } +#endif + } + + /// + /// Checks whether drawing is allowed and disposes the XGraphics object, if necessary. + /// + void CheckXPdfFormConsistence(XImage image) + { + XForm xForm = image as XForm; + if (xForm != null) + { + // Force disposing of XGraphics that draws the content + xForm.Finish(); + + // ReSharper disable once MergeSequentialChecks + if (_renderer != null && (_renderer as XGraphicsPdfRenderer) != null) + { + if (xForm.Owner != null && xForm.Owner != ((XGraphicsPdfRenderer)_renderer).Owner) + throw new InvalidOperationException( + "A XPdfForm object is always bound to the document it was created for and cannot be drawn in the context of another document."); + + if (xForm == ((XGraphicsPdfRenderer)_renderer)._form) + throw new InvalidOperationException( + "A XPdfForm cannot be drawn on itself."); + } + } + } + + // ----- DrawBarCode -------------------------------------------------------------------------- + + /// + /// Draws the specified bar code. + /// + public void DrawBarCode(BarCodes.BarCode barcode, XPoint position) + { + barcode.Render(this, XBrushes.Black, null, position); + } + + /// + /// Draws the specified bar code. + /// + public void DrawBarCode(BarCodes.BarCode barcode, XBrush brush, XPoint position) + { + barcode.Render(this, brush, null, position); + } + + /// + /// Draws the specified bar code. + /// + public void DrawBarCode(BarCodes.BarCode barcode, XBrush brush, XFont font, XPoint position) + { + barcode.Render(this, brush, font, position); + } + + // ----- DrawMatrixCode ----------------------------------------------------------------------- + + /// + /// Draws the specified data matrix code. + /// + public void DrawMatrixCode(BarCodes.MatrixCode matrixcode, XPoint position) + { + matrixcode.Render(this, XBrushes.Black, position); + } + + /// + /// Draws the specified data matrix code. + /// + public void DrawMatrixCode(BarCodes.MatrixCode matrixcode, XBrush brush, XPoint position) + { + matrixcode.Render(this, brush, position); + } + + #endregion + + // -------------------------------------------------------------------------------------------- + + #region Save and Restore + + /// + /// Saves the current state of this XGraphics object and identifies the saved state with the + /// returned XGraphicsState object. + /// + public XGraphicsState Save() + { + XGraphicsState xState = null; +#if CORE || NETFX_CORE + if (TargetContext == XGraphicTargetContext.CORE || TargetContext == XGraphicTargetContext.NONE) + { + xState = new XGraphicsState(); + InternalGraphicsState iState = new InternalGraphicsState(this, xState); + iState.Transform = _transform; + _gsStack.Push(iState); + } + else + { + Debug.Assert(false, "XGraphicTargetContext must be XGraphicTargetContext.CORE."); + } +#endif +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + xState = new XGraphicsState(_gfx != null ? _gfx.Save() : null); + InternalGraphicsState iState = new InternalGraphicsState(this, xState); + iState.Transform = _transform; + _gsStack.Push(iState); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + xState = new XGraphicsState(); + InternalGraphicsState iState = new InternalGraphicsState(this, xState); + iState.Transform = _transform; + _gsStack.Push(iState); + } +#endif + + if (_renderer != null) + _renderer.Save(xState); + + return xState; + } + + /// + /// Restores the state of this XGraphics object to the state represented by the specified + /// XGraphicsState object. + /// + public void Restore(XGraphicsState state) + { + if (state == null) + throw new ArgumentNullException("state"); + +#if CORE + if (TargetContext == XGraphicTargetContext.CORE) + { + _gsStack.Restore(state.InternalState); + _transform = state.InternalState.Transform; + } +#endif +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gsStack.Restore(state.InternalState); + if (_gfx != null) + _gfx.Restore(state.GdiState); + _transform = state.InternalState.Transform; + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { + _gsStack.Restore(state.InternalState); + _transform = state.InternalState.Transform; + } +#endif + + if (_renderer != null) + _renderer.Restore(state); + } + + /// + /// Restores the state of this XGraphics object to the state before the most recently call of Save. + /// + public void Restore() + { + if (_gsStack.Count == 0) + throw new InvalidOperationException("Cannot restore without preceding save operation."); + Restore(_gsStack.Current.State); + } + + /// + /// Saves a graphics container with the current state of this XGraphics and + /// opens and uses a new graphics container. + /// + public XGraphicsContainer BeginContainer() + { + return BeginContainer(new XRect(0, 0, 1, 1), new XRect(0, 0, 1, 1), XGraphicsUnit.Point); + } + +#if GDI + /// + /// Saves a graphics container with the current state of this XGraphics and + /// opens and uses a new graphics container. + /// + public XGraphicsContainer BeginContainer(Rectangle dstrect, Rectangle srcrect, XGraphicsUnit unit) + { + return BeginContainer(new XRect(dstrect), new XRect(dstrect), unit); + } +#endif + +#if GDI + /// + /// Saves a graphics container with the current state of this XGraphics and + /// opens and uses a new graphics container. + /// + public XGraphicsContainer BeginContainer(GdiRectF dstrect, GdiRectF srcrect, XGraphicsUnit unit) + { + return BeginContainer(new XRect(dstrect), new XRect(dstrect), unit); + } +#endif + +#if WPF + /// + /// Saves a graphics container with the current state of this XGraphics and + /// opens and uses a new graphics container. + /// + public XGraphicsContainer BeginContainer(Rect dstrect, Rect srcrect, XGraphicsUnit unit) + { + return BeginContainer(new XRect(dstrect), new XRect(dstrect), unit); + } +#endif + + /// + /// Saves a graphics container with the current state of this XGraphics and + /// opens and uses a new graphics container. + /// + public XGraphicsContainer BeginContainer(XRect dstrect, XRect srcrect, XGraphicsUnit unit) + { + // TODO: unit + if (unit != XGraphicsUnit.Point) + throw new ArgumentException("The current implementation supports XGraphicsUnit.Point only.", "unit"); + + XGraphicsContainer xContainer = null; +#if CORE + if (TargetContext == XGraphicTargetContext.CORE) + xContainer = new XGraphicsContainer(); +#endif +#if GDI + // _gfx can be null if drawing applies to PDF page only. + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + xContainer = new XGraphicsContainer(_gfx != null ? _gfx.Save() : null); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + xContainer = new XGraphicsContainer(); +#endif + InternalGraphicsState iState = new InternalGraphicsState(this, xContainer); + iState.Transform = _transform; + + _gsStack.Push(iState); + + if (_renderer != null) + _renderer.BeginContainer(xContainer, dstrect, srcrect, unit); + + XMatrix matrix = new XMatrix(); + double scaleX = dstrect.Width / srcrect.Width; + double scaleY = dstrect.Height / srcrect.Height; + matrix.TranslatePrepend(-srcrect.X, -srcrect.Y); + matrix.ScalePrepend(scaleX, scaleY); + matrix.TranslatePrepend(dstrect.X / scaleX, dstrect.Y / scaleY); + AddTransform(matrix, XMatrixOrder.Prepend); + + return xContainer; + } + + /// + /// Closes the current graphics container and restores the state of this XGraphics + /// to the state saved by a call to the BeginContainer method. + /// + public void EndContainer(XGraphicsContainer container) + { + if (container == null) + throw new ArgumentNullException("container"); + + _gsStack.Restore(container.InternalState); +#if CORE + // nothing to do +#endif +#if GDI + if (TargetContext == XGraphicTargetContext.GDI && _gfx != null) + { + try + { + Lock.EnterGdiPlus(); + _gfx.Restore(container.GdiState); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + // nothing to do +#endif + _transform = container.InternalState.Transform; + + if (_renderer != null) + _renderer.EndContainer(container); + } + + /// + /// Gets the current graphics state level. The default value is 0. Each call of Save or BeginContainer + /// increased and each call of Restore or EndContainer decreased the value by 1. + /// + public int GraphicsStateLevel + { + get { return _gsStack.Count; } + } + + #endregion + + // -------------------------------------------------------------------------------------------- + + #region Properties + + /// + /// Gets or sets the smoothing mode. + /// + /// The smoothing mode. + public XSmoothingMode SmoothingMode + { + get + { +#if CORE + // nothing to do +#endif +#if GDI + if (TargetContext == XGraphicTargetContext.GDI && + _gfx != null) + { + try + { + Lock.EnterGdiPlus(); + return (XSmoothingMode)_gfx.SmoothingMode; + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + // nothing to do +#endif + return _smoothingMode; + } + set + { + _smoothingMode = value; +#if CORE + // nothing to do +#endif +#if GDI + if (TargetContext == XGraphicTargetContext.GDI && + _gfx != null) + { + try + { + Lock.EnterGdiPlus(); + _gfx.SmoothingMode = (SmoothingMode)value; + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + // nothing to do +#endif + } + } + XSmoothingMode _smoothingMode; + + //public Region Clip { get; set; } + //public GdiRectF ClipBounds { get; } + //public CompositingMode CompositingMode { get; set; } + //public CompositingQuality CompositingQuality { get; set; } + //public float DpiX { get; } + //public float DpiY { get; } + //public InterpolationMode InterpolationMode { get; set; } + //public bool IsClipEmpty { get; } + //public bool IsVisibleClipEmpty { get; } + //public float PageScale { get; set; } + //public GraphicsUnit PageUnit { get; set; } + //public PixelOffsetMode PixelOffsetMode { get; set; } + //public Point RenderingOrigin { get; set; } + //public SmoothingMode SmoothingMode { get; set; } + //public int TextContrast { get; set; } + //public TextRenderingHint TextRenderingHint { get; set; } + //public Matrix Transform { get; set; } + //public GdiRectF VisibleClipBounds { get; } + + #endregion + + // -------------------------------------------------------------------------------------------- + + #region Transformation + + /// + /// Applies the specified translation operation to the transformation matrix of this object by + /// prepending it to the object's transformation matrix. + /// + public void TranslateTransform(double dx, double dy) + { + AddTransform(XMatrix.CreateTranslation(dx, dy), XMatrixOrder.Prepend); + } + + /// + /// Applies the specified translation operation to the transformation matrix of this object + /// in the specified order. + /// + public void TranslateTransform(double dx, double dy, XMatrixOrder order) + { + XMatrix matrix = new XMatrix(); + matrix.TranslatePrepend(dx, dy); + AddTransform(matrix, order); + } + + /// + /// Applies the specified scaling operation to the transformation matrix of this object by + /// prepending it to the object's transformation matrix. + /// + public void ScaleTransform(double scaleX, double scaleY) + { + AddTransform(XMatrix.CreateScaling(scaleX, scaleY), XMatrixOrder.Prepend); + } + + /// + /// Applies the specified scaling operation to the transformation matrix of this object + /// in the specified order. + /// + public void ScaleTransform(double scaleX, double scaleY, XMatrixOrder order) + { + XMatrix matrix = new XMatrix(); + matrix.ScalePrepend(scaleX, scaleY); + AddTransform(matrix, order); + } + + /// + /// Applies the specified scaling operation to the transformation matrix of this object by + /// prepending it to the object's transformation matrix. + /// + // ReSharper disable once InconsistentNaming + public void ScaleTransform(double scaleXY) + { + ScaleTransform(scaleXY, scaleXY); + } + + /// + /// Applies the specified scaling operation to the transformation matrix of this object + /// in the specified order. + /// + // ReSharper disable once InconsistentNaming + public void ScaleTransform(double scaleXY, XMatrixOrder order) + { + ScaleTransform(scaleXY, scaleXY, order); + } + + /// + /// Applies the specified scaling operation to the transformation matrix of this object by + /// prepending it to the object's transformation matrix. + /// + public void ScaleAtTransform(double scaleX, double scaleY, double centerX, double centerY) + { + AddTransform(XMatrix.CreateScaling(scaleX, scaleY, centerX, centerY), XMatrixOrder.Prepend); + } + + /// + /// Applies the specified scaling operation to the transformation matrix of this object by + /// prepending it to the object's transformation matrix. + /// + public void ScaleAtTransform(double scaleX, double scaleY, XPoint center) + { + AddTransform(XMatrix.CreateScaling(scaleX, scaleY, center.X, center.Y), XMatrixOrder.Prepend); + } + + /// + /// Applies the specified rotation operation to the transformation matrix of this object by + /// prepending it to the object's transformation matrix. + /// + public void RotateTransform(double angle) + { + AddTransform(XMatrix.CreateRotationRadians(angle * Const.Deg2Rad), XMatrixOrder.Prepend); + } + + /// + /// Applies the specified rotation operation to the transformation matrix of this object + /// in the specified order. The angle unit of measure is degree. + /// + public void RotateTransform(double angle, XMatrixOrder order) + { + XMatrix matrix = new XMatrix(); + matrix.RotatePrepend(angle); + AddTransform(matrix, order); + } + + /// + /// Applies the specified rotation operation to the transformation matrix of this object by + /// prepending it to the object's transformation matrix. + /// + public void RotateAtTransform(double angle, XPoint point) + { + AddTransform(XMatrix.CreateRotationRadians(angle * Const.Deg2Rad, point.X, point.Y), XMatrixOrder.Prepend); + } + + /// + /// Applies the specified rotation operation to the transformation matrix of this object by + /// prepending it to the object's transformation matrix. + /// + public void RotateAtTransform(double angle, XPoint point, XMatrixOrder order) + { + AddTransform(XMatrix.CreateRotationRadians(angle * Const.Deg2Rad, point.X, point.Y), order); + } + + /// + /// Applies the specified shearing operation to the transformation matrix of this object by + /// prepending it to the object's transformation matrix. + /// ShearTransform is a synonym for SkewAtTransform. + /// Parameter shearX specifies the horizontal skew which is measured in degrees counterclockwise from the y-axis. + /// Parameter shearY specifies the vertical skew which is measured in degrees counterclockwise from the x-axis. + /// + public void ShearTransform(double shearX, double shearY) + { + AddTransform(XMatrix.CreateSkewRadians(shearX * Const.Deg2Rad, shearY * Const.Deg2Rad), XMatrixOrder.Prepend); + } + + /// + /// Applies the specified shearing operation to the transformation matrix of this object + /// in the specified order. + /// ShearTransform is a synonym for SkewAtTransform. + /// Parameter shearX specifies the horizontal skew which is measured in degrees counterclockwise from the y-axis. + /// Parameter shearY specifies the vertical skew which is measured in degrees counterclockwise from the x-axis. + /// + public void ShearTransform(double shearX, double shearY, XMatrixOrder order) + { + AddTransform(XMatrix.CreateSkewRadians(shearX * Const.Deg2Rad, shearY * Const.Deg2Rad), order); + } + + /// + /// Applies the specified shearing operation to the transformation matrix of this object by + /// prepending it to the object's transformation matrix. + /// ShearTransform is a synonym for SkewAtTransform. + /// Parameter shearX specifies the horizontal skew which is measured in degrees counterclockwise from the y-axis. + /// Parameter shearY specifies the vertical skew which is measured in degrees counterclockwise from the x-axis. + /// + public void SkewAtTransform(double shearX, double shearY, double centerX, double centerY) + { + AddTransform(XMatrix.CreateSkewRadians(shearX * Const.Deg2Rad, shearY * Const.Deg2Rad, centerX, centerY), XMatrixOrder.Prepend); + } + + /// + /// Applies the specified shearing operation to the transformation matrix of this object by + /// prepending it to the object's transformation matrix. + /// ShearTransform is a synonym for SkewAtTransform. + /// Parameter shearX specifies the horizontal skew which is measured in degrees counterclockwise from the y-axis. + /// Parameter shearY specifies the vertical skew which is measured in degrees counterclockwise from the x-axis. + /// + public void SkewAtTransform(double shearX, double shearY, XPoint center) + { + AddTransform(XMatrix.CreateSkewRadians(shearX * Const.Deg2Rad, shearY * Const.Deg2Rad, center.X, center.Y), XMatrixOrder.Prepend); + } + + /// + /// Multiplies the transformation matrix of this object and specified matrix. + /// + public void MultiplyTransform(XMatrix matrix) + { + AddTransform(matrix, XMatrixOrder.Prepend); + } + + /// + /// Multiplies the transformation matrix of this object and specified matrix in the specified order. + /// + public void MultiplyTransform(XMatrix matrix, XMatrixOrder order) + { + AddTransform(matrix, order); + } + + /// + /// Gets the current transformation matrix. + /// The transformation matrix cannot be set. Instead use Save/Restore or BeginContainer/EndContainer to + /// save the state before Transform is called and later restore to the previous transform. + /// + public XMatrix Transform + { + get { return _transform; } + } + + /// + /// Applies a new transformation to the current transformation matrix. + /// + void AddTransform(XMatrix transform, XMatrixOrder order) + { + XMatrix matrix = _transform; + matrix.Multiply(transform, order); + _transform = matrix; + matrix = DefaultViewMatrix; + matrix.Multiply(_transform, XMatrixOrder.Prepend); +#if CORE + if (TargetContext == XGraphicTargetContext.CORE) + { + GetType(); + // TODO: _gsStack... + } +#endif +#if GDI + if (TargetContext == XGraphicTargetContext.GDI) + { + if (_gfx != null) + { + try + { + Lock.EnterGdiPlus(); + _gfx.Transform = (GdiMatrix)matrix; + } + finally { Lock.ExitGdiPlus(); } + } + } +#endif +#if WPF + if (TargetContext == XGraphicTargetContext.WPF) + { +#if !SILVERLIGHT + MatrixTransform mt = new MatrixTransform(transform.ToWpfMatrix()); +#else + MatrixTransform mt = new MatrixTransform(); + mt.Matrix = transform.ToWpfMatrix(); +#endif + if (order == XMatrixOrder.Append) + mt = (MatrixTransform)mt.Inverse; + _gsStack.Current.PushTransform(mt); + } +#endif + if (_renderer != null) + _renderer.AddTransform(transform, XMatrixOrder.Prepend); + } + + //public void TransformPoints(CoordinateSpace destSpace, CoordinateSpace srcSpace, Point[] points) + //{ + //} + // + //public void TransformPoints(CoordinateSpace destSpace, CoordinateSpace srcSpace, GdiPointF[] points) + //{ + //} + + #endregion + + // -------------------------------------------------------------------------------------------- + + #region Clipping + +#if GDI + /// + /// Updates the clip region of this XGraphics to the intersection of the + /// current clip region and the specified rectangle. + /// + public void IntersectClip(Rectangle rect) + { + XGraphicsPath path = new XGraphicsPath(); + path.AddRectangle(rect); + IntersectClip(path); + } +#endif + +#if GDI + /// + /// Updates the clip region of this XGraphics to the intersection of the + /// current clip region and the specified rectangle. + /// + public void IntersectClip(GdiRectF rect) + { + XGraphicsPath path = new XGraphicsPath(); + path.AddRectangle(rect); + IntersectClip(path); + } +#endif + + /// + /// Updates the clip region of this XGraphics to the intersection of the + /// current clip region and the specified rectangle. + /// + public void IntersectClip(XRect rect) + { + XGraphicsPath path = new XGraphicsPath(); + path.AddRectangle(rect); + IntersectClip(path); + } + + /// + /// Updates the clip region of this XGraphics to the intersection of the + /// current clip region and the specified graphical path. + /// + public void IntersectClip(XGraphicsPath path) + { + if (path == null) + throw new ArgumentNullException("path"); + + if (_drawGraphics) + { +#if GDI && !WPF + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.SetClip(path._gdipPath, CombineMode.Intersect); + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF && !GDI + if (TargetContext == XGraphicTargetContext.WPF) + _gsStack.Current.PushClip(path._pathGeometry); +#endif +#if GDI && WPF + if (TargetContext == XGraphicTargetContext.GDI) + { + try + { + Lock.EnterGdiPlus(); + _gfx.SetClip(path._gdipPath, CombineMode.Intersect); + } + finally { Lock.ExitGdiPlus(); } + } + else + { + _gsStack.Current.PushClip(path._pathGeometry); + } +#endif + } + + if (_renderer != null) + _renderer.SetClip(path, XCombineMode.Intersect); + } + + //public void SetClip(Graphics g); + //public void SetClip(Graphics g, CombineMode combineMode); + //public void SetClip(GraphicsPath path, CombineMode combineMode); + //public void SetClip(Rectangle rect, CombineMode combineMode); + //public void SetClip(GdiRectF rect, CombineMode combineMode); + //public void SetClip(Region region, CombineMode combineMode); + //public void IntersectClip(Region region); + //public void ExcludeClip(Region region); + + #endregion + + // -------------------------------------------------------------------------------------------- + + #region Miscellaneous + + /// + /// Writes a comment to the output stream. Comments have no effect on the rendering of the output. + /// They may be useful to mark a position in a content stream of a PDF document. + /// + public void WriteComment(string comment) + { + if (comment == null) + throw new ArgumentNullException("comment"); + + if (_drawGraphics) + { + // TODO: Do something if metafile? + } + + if (_renderer != null) + _renderer.WriteComment(comment); + } + + /// + /// Permits access to internal data. + /// + public XGraphicsInternals Internals + { + get { return _internals ?? (_internals = new XGraphicsInternals(this)); } + } + XGraphicsInternals _internals; + + /// + /// (Under construction. May change in future versions.) + /// + public SpaceTransformer Transformer + { + get { return _transformer ?? (_transformer = new SpaceTransformer(this)); } + } + SpaceTransformer _transformer; + + #endregion + + // -------------------------------------------------------------------------------------------- + + #region Internal Helper Functions + +#if GDI + /// + /// Converts a GdiPoint[] into a GdiPointF[]. + /// + internal static GdiPointF[] MakePointFArray(GdiPoint[] points, int offset, int count) + { + if (points == null) + return null; + + //int length = points.Length; + GdiPointF[] result = new GdiPointF[count]; + for (int idx = 0, srcIdx = offset; idx < count; idx++, srcIdx++) + { + result[idx].X = points[srcIdx].X; + result[idx].Y = points[srcIdx].Y; + } + return result; + } +#endif + +#if GDI + /// + /// Converts a XPoint[] into a GdiPointF[]. + /// + internal static GdiPointF[] MakePointFArray(XPoint[] points) + { + if (points == null) + return null; + + int count = points.Length; + GdiPointF[] result = new GdiPointF[count]; + for (int idx = 0; idx < count; idx++) + { + result[idx].X = (float)points[idx].X; + result[idx].Y = (float)points[idx].Y; + } + return result; + } +#endif + +#if GDI + /// + /// Converts a Point[] into a XPoint[]. + /// + internal static XPoint[] MakeXPointArray(GdiPoint[] points, int offset, int count) + { + if (points == null) + return null; + + //int lengh = points.Length; + XPoint[] result = new XPoint[count]; + for (int idx = 0, srcIdx = offset; idx < count; idx++, srcIdx++) + { + result[idx].X = points[srcIdx].X; + result[idx].Y = points[srcIdx].Y; + } + return result; + } +#endif + +#if WPF || NETFX_CORE + /// + /// Converts a Point[] into a XPoint[]. + /// + internal static XPoint[] MakeXPointArray(SysPoint[] points, int offset, int count) + { + if (points == null) + return null; + + //int length = points.Length; + XPoint[] result = new XPoint[count]; + for (int idx = 0, srcIdx = offset; idx < count; idx++, srcIdx++) + { + result[idx].X = points[srcIdx].X; + result[idx].Y = points[srcIdx].Y; + } + return result; + } +#endif + +#if GDI + /// + /// Converts a GdiPointF[] into a XPoint[]. + /// + internal static XPoint[] MakeXPointArray(GdiPointF[] points, int offset, int count) + { + if (points == null) + return null; + + //int length = points.Length; + XPoint[] result = new XPoint[count]; + for (int idx = 0, srcIdx = offset; idx < count; idx++, srcIdx++) + { + result[idx].X = points[srcIdx].X; + result[idx].Y = points[srcIdx].Y; + } + return result; + } +#endif + +#if GDI + /// + /// Converts a XRect[] into a GdiRectF[]. + /// + internal static GdiRectF[] MakeRectangleFArray(XRect[] rects, int offset, int count) + { + if (rects == null) + return null; + + //int length = rects.Length; + GdiRectF[] result = new GdiRectF[count]; + for (int idx = 0, srcIdx = offset; idx < count; idx++, srcIdx++) + { + XRect rect = rects[srcIdx]; + result[idx] = new GdiRectF((float)rect.X, (float)rect.Y, (float)rect.Width, (float)rect.Height); + } + return result; + } +#endif + +#if WPF || NETFX_CORE + /// + /// Converts an XPoint[] into a Point[]. + /// + internal static SysPoint[] MakePointArray(XPoint[] points) + { + if (points == null) + return null; + + int count = points.Length; + SysPoint[] result = new SysPoint[count]; + for (int idx = 0; idx < count; idx++) + { + result[idx].X = points[idx].X; + result[idx].Y = points[idx].Y; + } + return result; + } +#endif + + #endregion + + ///// + ///// Testcode + ///// + //public void TestXObject(PdfDocument thisDoc, PdfPage thisPage, int page, + // PdfDocument externalDoc, ImportedObjectTable impDoc) + //{ + // PdfPage impPage = externalDoc.Pages[page]; + // // impDoc.ImportPage(impPage); + // PdfFormXObject form = new PdfFormXObject(thisDoc, impDoc, impPage); + // thisDoc.xrefTable.Add(form); + + // PdfDictionary xobjects = new PdfDictionary(); + // xobjects.Elements["/X42"] = form.XRef; + // thisPage.Resources.Elements[PdfResources.Keys.XObject] = xobjects; + // ((XGraphicsPdfRenderer)renderer).DrawXObject("/X42"); + //} + + internal void DisassociateImage() + { + if (_associatedImage == null) + throw new InvalidOperationException("No image associated."); + + Dispose(); + } + + internal InternalGraphicsMode InternalGraphicsMode + { + get { return _internalGraphicsMode; } + set { _internalGraphicsMode = value; } + } + InternalGraphicsMode _internalGraphicsMode; + + internal XImage AssociatedImage + { + get { return _associatedImage; } + set { _associatedImage = value; } + } + XImage _associatedImage; + +#if GDI + /// + /// Always defined System.Drawing.Graphics object. Used as 'query context' for PDF pages. + /// + internal Graphics _gfx; +#endif + +#if WPF + /// + /// Always defined System.Drawing.Graphics object. Used as 'query context' for PDF pages. + /// +#if !SILVERLIGHT + DrawingVisual _dv; + internal DrawingContext _dc; +#else + internal AgDrawingContext _dc; +#endif +#endif + +#if UWP + readonly CanvasDrawingSession _cds; +#endif + + /// + /// The transformation matrix from the XGraphics page space to the Graphics world space. + /// (The name 'default view matrix' comes from Microsoft OS/2 Presentation Manager. I choose + /// this name because I have no better one.) + /// + internal XMatrix DefaultViewMatrix; + + /// + /// Indicates whether to send drawing operations to _gfx or _dc. + /// + bool _drawGraphics; + + readonly XForm _form; + +#if GDI + internal Metafile Metafile; +#endif + + /// + /// Interface to an (optional) renderer. Currently it is the XGraphicsPdfRenderer, if defined. + /// + IXGraphicsRenderer _renderer; + + /// + /// The transformation matrix from XGraphics world space to page unit space. + /// + XMatrix _transform; + + /// + /// The graphics state stack. + /// + readonly GraphicsStateStack _gsStack; + + /// + /// Gets the PDF page that serves as drawing surface if PDF is rendered, + /// or null, if no such object exists. + /// + public PdfPage PdfPage + { + get + { + XGraphicsPdfRenderer renderer = _renderer as PdfSharp.Drawing.Pdf.XGraphicsPdfRenderer; + return renderer != null ? renderer._page : null; + } + } + +#if GDI + /// + /// Gets the System.Drawing.Graphics objects that serves as drawing surface if no PDF is rendered, + /// or null, if no such object exists. + /// + public Graphics Graphics + { + get { return _gfx; } + } +#endif + + //#if CORE || GDI + // /// + // /// Critical section used to serialize access to GDI+. + // /// This may be necessary to use PDFsharp safely in a Web application. + // /// + // internal static readonly object GdiPlus = new object(); + //#endif + + /// + /// Provides access to internal data structures of the XGraphics class. + /// + public class XGraphicsInternals + { + internal XGraphicsInternals(XGraphics gfx) + { + _gfx = gfx; + } + readonly XGraphics _gfx; + +#if GDI + /// + /// Gets the underlying Graphics object. + /// + public Graphics Graphics + { + get { return _gfx._gfx; } + } +#endif + } + + /// + /// (This class is under construction.) + /// Currently used in MigraDoc + /// + public class SpaceTransformer + { + internal SpaceTransformer(XGraphics gfx) + { + _gfx = gfx; + } + readonly XGraphics _gfx; + + /// + /// Gets the smallest rectangle in default page space units that completely encloses the specified rect + /// in world space units. + /// + public XRect WorldToDefaultPage(XRect rect) + { + XPoint[] points = new XPoint[4]; + points[0] = new XPoint(rect.X, rect.Y); + points[1] = new XPoint(rect.X + rect.Width, rect.Y); + points[2] = new XPoint(rect.X, rect.Y + rect.Height); + points[3] = new XPoint(rect.X + rect.Width, rect.Y + rect.Height); + + XMatrix matrix = _gfx.Transform; + matrix.TransformPoints(points); + + double height = _gfx.PageSize.Height; + points[0].Y = height - points[0].Y; + points[1].Y = height - points[1].Y; + points[2].Y = height - points[2].Y; + points[3].Y = height - points[3].Y; + + double xmin = Math.Min(Math.Min(points[0].X, points[1].X), Math.Min(points[2].X, points[3].X)); + double xmax = Math.Max(Math.Max(points[0].X, points[1].X), Math.Max(points[2].X, points[3].X)); + double ymin = Math.Min(Math.Min(points[0].Y, points[1].Y), Math.Min(points[2].Y, points[3].Y)); + double ymax = Math.Max(Math.Max(points[0].Y, points[1].Y), Math.Max(points[2].Y, points[3].Y)); + + return new XRect(xmin, ymin, xmax - xmin, ymax - ymin); + } + } + } +} diff --git a/PdfSharp/Drawing/XGraphicsContainer.cs b/PdfSharp/Drawing/XGraphicsContainer.cs new file mode 100644 index 0000000..1218af6 --- /dev/null +++ b/PdfSharp/Drawing/XGraphicsContainer.cs @@ -0,0 +1,58 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Represents the internal state of an XGraphics object. + /// + public sealed class XGraphicsContainer + { +#if GDI + internal XGraphicsContainer(GraphicsState state) + { + GdiState = state; + } + internal GraphicsState GdiState; +#endif +#if WPF + internal XGraphicsContainer() + { } +#endif + internal InternalGraphicsState InternalState; + } +} diff --git a/PdfSharp/Drawing/XGraphicsPath.cs b/PdfSharp/Drawing/XGraphicsPath.cs new file mode 100644 index 0000000..4113765 --- /dev/null +++ b/PdfSharp/Drawing/XGraphicsPath.cs @@ -0,0 +1,2289 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +using SysPoint = System.Windows.Point; +using SysSize = System.Windows.Size; +using SysRect = System.Windows.Rect; +#if !SILVERLIGHT +using WpfBrushes = System.Windows.Media.Brushes; +#endif +#endif +#if NETFX_CORE +using Windows.UI.Xaml.Media; +using SysPoint = Windows.Foundation.Point; +using SysSize = Windows.Foundation.Size; +using SysRect = Windows.Foundation.Rect; +#endif +using PdfSharp.Internal; + +namespace PdfSharp.Drawing +{ + /// + /// Represents a series of connected lines and curves. + /// + public sealed class XGraphicsPath + { + /// + /// Initializes a new instance of the class. + /// + public XGraphicsPath() + { +#if CORE + _corePath = new CoreGraphicsPath(); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath = new GraphicsPath(); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE + _pathGeometry = new PathGeometry(); +#endif + } + +#if GDI + /// + /// Initializes a new instance of the class. + /// + public XGraphicsPath(PointF[] points, byte[] types, XFillMode fillMode) + { +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath = new GraphicsPath(points, types, (FillMode)fillMode); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF // Is true only in Hybrid build. + _pathGeometry = new PathGeometry(); + _pathGeometry.FillRule = FillRule.EvenOdd; +#endif + } +#endif + +#if WPF || NETFX_CORE + /// + /// Gets the current path figure. + /// + PathFigure CurrentPathFigure + { + get + { + int count = _pathGeometry.Figures.Count; + if (count == 0) + { + // Create new figure if there is none. + _pathGeometry.Figures.Add(new PathFigure()); + count++; + } + else + { + PathFigure lastFigure = _pathGeometry.Figures[count - 1]; + if (lastFigure.IsClosed) + { + if (lastFigure.Segments.Count > 0) + { + // Create new figure if previous one was closed. + _pathGeometry.Figures.Add(new PathFigure()); + count++; + } + else + { + Debug.Assert(false); + } + } + } + // Return last figure in collection. + return _pathGeometry.Figures[count - 1]; + } + } + + /// + /// Gets the current path figure, but never created a new one. + /// + PathFigure PeekCurrentFigure + { + get + { + int count = _pathGeometry.Figures.Count; + return count == 0 ? null : _pathGeometry.Figures[count - 1]; + } + } +#endif + + /// + /// Clones this instance. + /// + public XGraphicsPath Clone() + { + XGraphicsPath path = (XGraphicsPath)MemberwiseClone(); +#if CORE + _corePath = new CoreGraphicsPath(_corePath); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + path._gdipPath = _gdipPath.Clone() as GraphicsPath; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE +#if !SILVERLIGHT && !NETFX_CORE + path._pathGeometry = _pathGeometry.Clone(); +#else + // AG-HACK + throw new InvalidOperationException("Silverlight cannot clone geometry objects."); + // TODO: make it manually... +#pragma warning disable 0162 +#endif +#endif + return path; + } + + // ----- AddLine ------------------------------------------------------------------------------ + +#if GDI + /// + /// Adds a line segment to current figure. + /// + public void AddLine(System.Drawing.Point pt1, System.Drawing.Point pt2) + { + AddLine(pt1.X, pt1.Y, pt2.X, pt2.Y); + } +#endif + +#if WPF + /// + /// Adds a line segment to current figure. + /// + public void AddLine(SysPoint pt1, SysPoint pt2) + { + AddLine(pt1.X, pt1.Y, pt2.X, pt2.Y); + } +#endif + +#if GDI + /// + /// Adds a line segment to current figure. + /// + public void AddLine(PointF pt1, PointF pt2) + { + AddLine(pt1.X, pt1.Y, pt2.X, pt2.Y); + } +#endif + + /// + /// Adds a line segment to current figure. + /// + public void AddLine(XPoint pt1, XPoint pt2) + { + AddLine(pt1.X, pt1.Y, pt2.X, pt2.Y); + } + + /// + /// Adds a line segment to current figure. + /// + public void AddLine(double x1, double y1, double x2, double y2) + { +#if CORE + _corePath.MoveOrLineTo(x1, y1); + _corePath.LineTo(x2, y2, false); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddLine((float)x1, (float)y1, (float)x2, (float)y2); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF + PathFigure figure = CurrentPathFigure; + if (figure.Segments.Count == 0) + { + figure.StartPoint = new SysPoint(x1, y1); +#if !SILVERLIGHT + var lineSegment = new LineSegment(new SysPoint(x2, y2), true); +#else + var lineSegment = new LineSegment { Point = new Point(x2, y2) }; +#endif + figure.Segments.Add(lineSegment); + } + else + { +#if !SILVERLIGHT + var lineSegment1 = new LineSegment(new SysPoint(x1, y1), true); + var lineSegment2 = new LineSegment(new SysPoint(x2, y2), true); +#else + var lineSegment1 = new LineSegment { Point = new Point(x1, y1) }; + var lineSegment2 = new LineSegment { Point = new Point(x2, y2) }; +#endif + figure.Segments.Add(lineSegment1); + figure.Segments.Add(lineSegment2); + } +#endif + } + + // ----- AddLines ----------------------------------------------------------------------------- + +#if GDI + /// + /// Adds a series of connected line segments to current figure. + /// + public void AddLines(System.Drawing.Point[] points) + { + AddLines(XGraphics.MakeXPointArray(points, 0, points.Length)); + } +#endif + +#if WPF + /// + /// Adds a series of connected line segments to current figure. + /// + public void AddLines(SysPoint[] points) + { + AddLines(XGraphics.MakeXPointArray(points, 0, points.Length)); + } +#endif + +#if GDI + /// + /// Adds a series of connected line segments to current figure. + /// + public void AddLines(PointF[] points) + { + AddLines(XGraphics.MakeXPointArray(points, 0, points.Length)); + } +#endif + + /// + /// Adds a series of connected line segments to current figure. + /// + public void AddLines(XPoint[] points) + { + if (points == null) + throw new ArgumentNullException("points"); + + int count = points.Length; + if (count == 0) + return; +#if CORE + _corePath.MoveOrLineTo(points[0].X, points[0].Y); + for (int idx = 1; idx < count; idx++) + _corePath.LineTo(points[idx].X, points[idx].Y, false); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddLines(XGraphics.MakePointFArray(points)); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF + PathFigure figure = CurrentPathFigure; + if (figure.Segments.Count == 0) + { + figure.StartPoint = new SysPoint(points[0].X, points[0].Y); + for (int idx = 1; idx < count; idx++) + { +#if !SILVERLIGHT + LineSegment lineSegment = new LineSegment(new SysPoint(points[idx].X, points[idx].Y), true); +#else + LineSegment lineSegment = new LineSegment(); + lineSegment.Point = new Point(points[idx].X, points[idx].Y); // ,true? +#endif + figure.Segments.Add(lineSegment); + } + } + else + { + for (int idx = 0; idx < count; idx++) + { + // figure.Segments.Add(new LineSegment(new SysPoint(points[idx].x, points[idx].y), true)); +#if !SILVERLIGHT + LineSegment lineSegment = new LineSegment(new SysPoint(points[idx].X, points[idx].Y), true); +#else + LineSegment lineSegment = new LineSegment(); + lineSegment.Point = new Point(points[idx].X, points[idx].Y); // ,true? +#endif + figure.Segments.Add(lineSegment); + } + } +#endif + } + + // ----- AddBezier ---------------------------------------------------------------------------- + +#if GDI + /// + /// Adds a cubic Bzier curve to the current figure. + /// + public void AddBezier(System.Drawing.Point pt1, System.Drawing.Point pt2, System.Drawing.Point pt3, System.Drawing.Point pt4) + { + AddBezier(pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y); + } +#endif + +#if WPF + /// + /// Adds a cubic Bzier curve to the current figure. + /// + public void AddBezier(SysPoint pt1, SysPoint pt2, SysPoint pt3, SysPoint pt4) + { + AddBezier(pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y); + } +#endif + +#if GDI + /// + /// Adds a cubic Bzier curve to the current figure. + /// + public void AddBezier(PointF pt1, PointF pt2, PointF pt3, PointF pt4) + { + AddBezier(pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y); + } +#endif + + /// + /// Adds a cubic Bzier curve to the current figure. + /// + public void AddBezier(XPoint pt1, XPoint pt2, XPoint pt3, XPoint pt4) + { + AddBezier(pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y); + } + + /// + /// Adds a cubic Bzier curve to the current figure. + /// + public void AddBezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) + { +#if CORE + _corePath.MoveOrLineTo(x1, y1); + _corePath.BezierTo(x2, y2, x3, y3, x4, y4, false); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddBezier((float)x1, (float)y1, (float)x2, (float)y2, (float)x3, (float)y3, (float)x4, (float)y4); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF + PathFigure figure = CurrentPathFigure; + if (figure.Segments.Count == 0) + figure.StartPoint = new SysPoint(x1, y1); + else + { + // figure.Segments.Add(new LineSegment(new SysPoint(x1, y1), true)); +#if !SILVERLIGHT + LineSegment lineSegment = new LineSegment(new SysPoint(x1, y1), true); +#else + LineSegment lineSegment = new LineSegment(); + lineSegment.Point = new Point(x1, y1); +#endif + figure.Segments.Add(lineSegment); + } + //figure.Segments.Add(new BezierSegment( + // new SysPoint(x2, y2), + // new SysPoint(x3, y3), + // new SysPoint(x4, y4), true)); +#if !SILVERLIGHT + BezierSegment bezierSegment = new BezierSegment( + new SysPoint(x2, y2), + new SysPoint(x3, y3), + new SysPoint(x4, y4), true); +#else + BezierSegment bezierSegment = new BezierSegment(); + bezierSegment.Point1 = new Point(x2, y2); + bezierSegment.Point2 = new Point(x3, y3); + bezierSegment.Point3 = new Point(x4, y4); +#endif + figure.Segments.Add(bezierSegment); +#endif + } + + // ----- AddBeziers --------------------------------------------------------------------------- + +#if GDI + /// + /// Adds a sequence of connected cubic Bzier curves to the current figure. + /// + public void AddBeziers(System.Drawing.Point[] points) + { + AddBeziers(XGraphics.MakeXPointArray(points, 0, points.Length)); + } +#endif + +#if WPF + /// + /// Adds a sequence of connected cubic Bzier curves to the current figure. + /// + public void AddBeziers(SysPoint[] points) + { + AddBeziers(XGraphics.MakeXPointArray(points, 0, points.Length)); + } +#endif + +#if GDI + /// + /// Adds a sequence of connected cubic Bzier curves to the current figure. + /// + public void AddBeziers(PointF[] points) + { + AddBeziers(XGraphics.MakeXPointArray(points, 0, points.Length)); + } +#endif + + /// + /// Adds a sequence of connected cubic Bzier curves to the current figure. + /// + public void AddBeziers(XPoint[] points) + { + if (points == null) + throw new ArgumentNullException("points"); + + int count = points.Length; + if (count < 4) + throw new ArgumentException("At least four points required for bezier curve.", "points"); + + if ((count - 1) % 3 != 0) + throw new ArgumentException("Invalid number of points for bezier curve. Number must fulfil 4+3n.", + "points"); + +#if CORE + _corePath.MoveOrLineTo(points[0].X, points[0].Y); + for (int idx = 1; idx < count; idx += 3) + { + _corePath.BezierTo(points[idx].X, points[idx].Y, points[idx + 1].X, points[idx + 1].Y, + points[idx + 2].X, points[idx + 2].Y, false); + } +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddBeziers(XGraphics.MakePointFArray(points)); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF + PathFigure figure = CurrentPathFigure; + if (figure.Segments.Count == 0) + figure.StartPoint = new SysPoint(points[0].X, points[0].Y); + else + { + // figure.Segments.Add(new LineSegment(new SysPoint(points[0].x, points[0].y), true)); +#if !SILVERLIGHT + LineSegment lineSegment = new LineSegment(new SysPoint(points[0].X, points[0].Y), true); +#else + LineSegment lineSegment = new LineSegment(); + lineSegment.Point = new Point(points[0].X, points[0].Y); +#endif + figure.Segments.Add(lineSegment); + } + for (int idx = 1; idx < count; idx += 3) + { + //figure.Segments.Add(new BezierSegment( + // new SysPoint(points[idx].x, points[idx].y), + // new SysPoint(points[idx + 1].x, points[idx + 1].y), + // new SysPoint(points[idx + 2].x, points[idx + 2].y), true)); +#if !SILVERLIGHT + BezierSegment bezierSegment = new BezierSegment( + new SysPoint(points[idx].X, points[idx].Y), + new SysPoint(points[idx + 1].X, points[idx + 1].Y), + new SysPoint(points[idx + 2].X, points[idx + 2].Y), true); +#else + BezierSegment bezierSegment = new BezierSegment(); + bezierSegment.Point1 = new Point(points[idx].X, points[idx].Y); + bezierSegment.Point2 = new Point(points[idx + 1].X, points[idx + 1].Y); + bezierSegment.Point3 = new Point(points[idx + 2].X, points[idx + 2].Y); +#endif + figure.Segments.Add(bezierSegment); + } +#endif + } + + // ----- AddCurve ----------------------------------------------------------------------- + +#if GDI + /// + /// Adds a spline curve to the current figure. + /// + public void AddCurve(System.Drawing.Point[] points) + { + AddCurve(XGraphics.MakeXPointArray(points, 0, points.Length)); + } +#endif + +#if WPF + /// + /// Adds a spline curve to the current figure. + /// + public void AddCurve(SysPoint[] points) + { + AddCurve(XGraphics.MakeXPointArray(points, 0, points.Length)); + } +#endif + +#if GDI + /// + /// Adds a spline curve to the current figure. + /// + public void AddCurve(PointF[] points) + { + AddCurve(XGraphics.MakeXPointArray(points, 0, points.Length)); + } +#endif + + /// + /// Adds a spline curve to the current figure. + /// + public void AddCurve(XPoint[] points) + { + AddCurve(points, 0.5); + } + +#if GDI + /// + /// Adds a spline curve to the current figure. + /// + public void AddCurve(System.Drawing.Point[] points, double tension) + { + AddCurve(XGraphics.MakeXPointArray(points, 0, points.Length), tension); + } +#endif + +#if WPF + /// + /// Adds a spline curve to the current figure. + /// + public void AddCurve(SysPoint[] points, double tension) + { + AddCurve(XGraphics.MakeXPointArray(points, 0, points.Length), tension); + } +#endif + +#if GDI + /// + /// Adds a spline curve to the current figure. + /// + public void AddCurve(PointF[] points, double tension) + { + AddCurve(XGraphics.MakeXPointArray(points, 0, points.Length), tension); + } +#endif + + /// + /// Adds a spline curve to the current figure. + /// + public void AddCurve(XPoint[] points, double tension) + { + int count = points.Length; + if (count < 2) + throw new ArgumentException("AddCurve requires two or more points.", "points"); +#if CORE + _corePath.AddCurve(points, tension); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddCurve(XGraphics.MakePointFArray(points), (float)tension); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF + tension /= 3; + + PathFigure figure = CurrentPathFigure; + if (figure.Segments.Count == 0) + figure.StartPoint = new SysPoint(points[0].X, points[0].Y); + else + { + // figure.Segments.Add(new LineSegment(new SysPoint(points[0].x, points[0].y), true)); +#if !SILVERLIGHT + LineSegment lineSegment = new LineSegment(new SysPoint(points[0].X, points[0].Y), true); +#else + LineSegment lineSegment = new LineSegment(); + lineSegment.Point = new Point(points[0].X, points[0].Y); +#endif + figure.Segments.Add(lineSegment); + } + + if (count == 2) + { + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[1], tension)); + } + else + { + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[2], tension)); + for (int idx = 1; idx < count - 2; idx++) + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension)); + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[count - 1], tension)); + } +#endif + } + +#if GDI + /// + /// Adds a spline curve to the current figure. + /// + public void AddCurve(System.Drawing.Point[] points, int offset, int numberOfSegments, float tension) + { + AddCurve(XGraphics.MakeXPointArray(points, 0, points.Length), offset, numberOfSegments, tension); + } +#endif + +#if WPF + /// + /// Adds a spline curve to the current figure. + /// + public void AddCurve(SysPoint[] points, int offset, int numberOfSegments, float tension) + { + AddCurve(XGraphics.MakeXPointArray(points, 0, points.Length), offset, numberOfSegments, tension); + } +#endif + +#if GDI + /// + /// Adds a spline curve to the current figure. + /// + public void AddCurve(PointF[] points, int offset, int numberOfSegments, float tension) + { + AddCurve(XGraphics.MakeXPointArray(points, 0, points.Length), offset, numberOfSegments, tension); + } +#endif + + /// + /// Adds a spline curve to the current figure. + /// + public void AddCurve(XPoint[] points, int offset, int numberOfSegments, double tension) + { +#if CORE + throw new NotImplementedException("AddCurve not yet implemented."); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddCurve(XGraphics.MakePointFArray(points), offset, numberOfSegments, (float)tension); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF + throw new NotImplementedException("AddCurve not yet implemented."); +#endif + } + + // ----- AddArc ------------------------------------------------------------------------------- + +#if GDI + /// + /// Adds an elliptical arc to the current figure. + /// + public void AddArc(Rectangle rect, double startAngle, double sweepAngle) + { + AddArc(rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } +#endif + +#if GDI + /// + /// Adds an elliptical arc to the current figure. + /// + public void AddArc(RectangleF rect, double startAngle, double sweepAngle) + { + AddArc(rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } +#endif + + /// + /// Adds an elliptical arc to the current figure. + /// + public void AddArc(XRect rect, double startAngle, double sweepAngle) + { + AddArc(rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } + + /// + /// Adds an elliptical arc to the current figure. + /// + public void AddArc(double x, double y, double width, double height, double startAngle, double sweepAngle) + { +#if CORE + _corePath.AddArc(x, y, width, height, startAngle, sweepAngle); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddArc((float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF + PathFigure figure = CurrentPathFigure; + SysPoint startPoint; + ArcSegment seg = GeometryHelper.CreateArcSegment(x, y, width, height, startAngle, sweepAngle, out startPoint); + if (figure.Segments.Count == 0) + figure.StartPoint = startPoint; + else + { + //#if !SILVERLIGHT + // LineSegment lineSegment = new LineSegment(startPoint, true); + //#else + LineSegment lineSegment = new LineSegment(); + lineSegment.Point = startPoint; + //#endif + figure.Segments.Add(lineSegment); + } + + figure.Segments.Add(seg); + + //figure.Segments.Add( + //if (figure.Segments.Count == 0) + // figure.StartPoint = new SysPoint(points[0].x, points[0].y); + //else + // figure.Segments.Add(new LineSegment(new SysPoint(points[0].x, points[0].y), true)); + + //for (int idx = 1; idx < 5555; idx += 3) + // figure.Segments.Add(new BezierSegment( + // new SysPoint(points[idx].x, points[idx].y), + // new SysPoint(points[idx + 1].x, points[idx + 1].y), + // new SysPoint(points[idx + 2].x, points[idx + 2].y), true)); +#endif + } + + /// + /// Adds an elliptical arc to the current figure. The arc is specified WPF like. + /// + public void AddArc(XPoint point1, XPoint point2, XSize size, double rotationAngle, bool isLargeArg, XSweepDirection sweepDirection) + { +#if CORE + _corePath.AddArc(point1, point2, size, rotationAngle, isLargeArg, sweepDirection); +#endif +#if GDI + DiagnosticsHelper.HandleNotImplemented("XGraphicsPath.AddArc"); +#endif +#if WPF + PathFigure figure = CurrentPathFigure; + if (figure.Segments.Count == 0) + figure.StartPoint = point1.ToPoint(); + else + { + // figure.Segments.Add(new LineSegment(point1.ToPoint(), true)); +#if !SILVERLIGHT + LineSegment lineSegment = new LineSegment(point1.ToPoint(), true); +#else + LineSegment lineSegment = new LineSegment(); + lineSegment.Point = point1.ToPoint(); +#endif + figure.Segments.Add(lineSegment); + } + + // figure.Segments.Add(new ArcSegment(point2.ToPoint(), size.ToSize(), rotationAngle, isLargeArg, sweepDirection, true)); +#if !SILVERLIGHT + ArcSegment arcSegment = new ArcSegment(point2.ToPoint(), size.ToSize(), rotationAngle, isLargeArg, (SweepDirection)sweepDirection, true); +#else + ArcSegment arcSegment = new ArcSegment(); + arcSegment.Point = point2.ToPoint(); + arcSegment.Size = size.ToSize(); + arcSegment.RotationAngle = rotationAngle; + arcSegment.IsLargeArc = isLargeArg; + arcSegment.SweepDirection = (SweepDirection)sweepDirection; +#endif + figure.Segments.Add(arcSegment); +#endif + } + + // ----- AddRectangle ------------------------------------------------------------------------- + +#if GDI + /// + /// Adds a rectangle to this path. + /// + public void AddRectangle(Rectangle rect) + { + AddRectangle(new XRect(rect)); + } +#endif + +#if GDI + /// + /// Adds a rectangle to this path. + /// + public void AddRectangle(RectangleF rect) + { + AddRectangle(new XRect(rect)); + } +#endif + + /// + /// Adds a rectangle to this path. + /// + public void AddRectangle(XRect rect) + { +#if CORE + _corePath.MoveTo(rect.X, rect.Y); + _corePath.LineTo(rect.X + rect.Width, rect.Y, false); + _corePath.LineTo(rect.X + rect.Width, rect.Y + rect.Height, false); + _corePath.LineTo(rect.X, rect.Y + rect.Height, true); + _corePath.CloseSubpath(); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + // If rect is empty GDI+ removes the rect from the path. + // This is not intended if the path is used for clipping. + // See http://forum.pdfsharp.net/viewtopic.php?p=9433#p9433 + // _gdipPath.AddRectangle(rect.ToRectangleF()); + + // Draw the rectangle manually. + _gdipPath.StartFigure(); + _gdipPath.AddLines(new PointF[] { rect.TopLeft.ToPointF(), rect.TopRight.ToPointF(), rect.BottomRight.ToPointF(), rect.BottomLeft.ToPointF() }); + _gdipPath.CloseFigure(); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF + StartFigure(); + PathFigure figure = CurrentPathFigure; + figure.StartPoint = new SysPoint(rect.X, rect.Y); + + // figure.Segments.Add(new LineSegment(new SysPoint(rect.x + rect.width, rect.y), true)); + // figure.Segments.Add(new LineSegment(new SysPoint(rect.x + rect.width, rect.y + rect.height), true)); + // figure.Segments.Add(new LineSegment(new SysPoint(rect.x, rect.y + rect.height), true)); +#if !SILVERLIGHT + LineSegment lineSegment1 = new LineSegment(new SysPoint(rect.X + rect.Width, rect.Y), true); + LineSegment lineSegment2 = new LineSegment(new SysPoint(rect.X + rect.Width, rect.Y + rect.Height), true); + LineSegment lineSegment3 = new LineSegment(new SysPoint(rect.X, rect.Y + rect.Height), true); +#else + LineSegment lineSegment1 = new LineSegment(); + lineSegment1.Point = new Point(rect.X + rect.Width, rect.Y); + LineSegment lineSegment2 = new LineSegment(); + lineSegment2.Point = new Point(rect.X + rect.Width, rect.Y + rect.Height); + LineSegment lineSegment3 = new LineSegment(); + lineSegment3.Point = new Point(rect.X, rect.Y + rect.Height); +#endif + figure.Segments.Add(lineSegment1); + figure.Segments.Add(lineSegment2); + figure.Segments.Add(lineSegment3); + CloseFigure(); +#endif + } + + /// + /// Adds a rectangle to this path. + /// + public void AddRectangle(double x, double y, double width, double height) + { + AddRectangle(new XRect(x, y, width, height)); + } + + // ----- AddRectangles ------------------------------------------------------------------------ + +#if GDI + /// + /// Adds a series of rectangles to this path. + /// + public void AddRectangles(Rectangle[] rects) + { + int count = rects.Length; + for (int idx = 0; idx < count; idx++) + AddRectangle(rects[idx]); + + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddRectangles(rects); + } + finally { Lock.ExitGdiPlus(); } + } +#endif + +#if GDI + /// + /// Adds a series of rectangles to this path. + /// + public void AddRectangles(RectangleF[] rects) + { + int count = rects.Length; + for (int idx = 0; idx < count; idx++) + AddRectangle(rects[idx]); + + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddRectangles(rects); + } + finally { Lock.ExitGdiPlus(); } + } +#endif + + /// + /// Adds a series of rectangles to this path. + /// + public void AddRectangles(XRect[] rects) + { + int count = rects.Length; + for (int idx = 0; idx < count; idx++) + { +#if CORE + AddRectangle(rects[idx]); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddRectangle(rects[idx].ToRectangleF()); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF + StartFigure(); + PathFigure figure = CurrentPathFigure; + XRect rect = rects[idx]; + figure.StartPoint = new SysPoint(rect.X, rect.Y); + + // figure.Segments.Add(new LineSegment(new SysPoint(rect.x + rect.width, rect.y), true)); + // figure.Segments.Add(new LineSegment(new SysPoint(rect.x + rect.width, rect.y + rect.height), true)); + // figure.Segments.Add(new LineSegment(new SysPoint(rect.x, rect.y + rect.height), true)); +#if !SILVERLIGHT + LineSegment lineSegment1 = new LineSegment(new SysPoint(rect.X + rect.Width, rect.Y), true); + LineSegment lineSegment2 = new LineSegment(new SysPoint(rect.X + rect.Width, rect.Y + rect.Height), true); + LineSegment lineSegment3 = new LineSegment(new SysPoint(rect.X, rect.Y + rect.Height), true); +#else + LineSegment lineSegment1 = new LineSegment(); + lineSegment1.Point = new Point(rect.X + rect.Width, rect.Y); + LineSegment lineSegment2 = new LineSegment(); + lineSegment2.Point = new Point(rect.X + rect.Width, rect.Y + rect.Height); + LineSegment lineSegment3 = new LineSegment(); + lineSegment3.Point = new Point(rect.X, rect.Y + rect.Height); +#endif + figure.Segments.Add(lineSegment1); + figure.Segments.Add(lineSegment2); + figure.Segments.Add(lineSegment3); + CloseFigure(); +#endif + } + } + + // ----- AddRoundedRectangle ------------------------------------------------------------------ + +#if GDI + /// + /// Adds a rectangle with rounded corners to this path. + /// + public void AddRoundedRectangle(Rectangle rect, System.Drawing.Size ellipseSize) + { + AddRoundedRectangle(rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } +#endif + +#if WPF || NETFX_CORE + /// + /// Adds a rectangle with rounded corners to this path. + /// + public void AddRoundedRectangle(SysRect rect, SysSize ellipseSize) + { + AddRoundedRectangle(rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } +#endif + +#if GDI + /// + /// Adds a rectangle with rounded corners to this path. + /// + public void AddRoundedRectangle(RectangleF rect, SizeF ellipseSize) + { + AddRoundedRectangle(rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } +#endif + +#if GDI + /// + /// Adds a rectangle with rounded corners to this path. + /// + public void AddRoundedRectangle(XRect rect, SizeF ellipseSize) + { + AddRoundedRectangle(rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); + } +#endif + + /// + /// Adds a rectangle with rounded corners to this path. + /// + public void AddRoundedRectangle(double x, double y, double width, double height, double ellipseWidth, double ellipseHeight) + { +#if CORE +#if true + double arcWidth = ellipseWidth / 2; + double arcHeight = ellipseHeight / 2; +#if true // Clockwise + _corePath.MoveTo(x + width - arcWidth, y); + _corePath.QuadrantArcTo(x + width - arcWidth, y + arcHeight, arcWidth, arcHeight, 1, true); + + _corePath.LineTo(x + width, y + height - arcHeight, false); + _corePath.QuadrantArcTo(x + width - arcWidth, y + height - arcHeight, arcWidth, arcHeight, 4, true); + + _corePath.LineTo(x + arcWidth, y + height, false); + _corePath.QuadrantArcTo(x + arcWidth, y + height - arcHeight, arcWidth, arcHeight, 3, true); + + _corePath.LineTo(x, y + arcHeight, false); + _corePath.QuadrantArcTo(x + arcWidth, y + arcHeight, arcWidth, arcHeight, 2, true); + + _corePath.CloseSubpath(); +#else // Counterclockwise + _corePath.MoveTo(x + arcWidth, y); + _corePath.QuadrantArcTo(x + arcWidth, y + arcHeight, arcWidth, arcHeight, 2, false); + + _corePath.LineTo(x, y + height - arcHeight, false); + _corePath.QuadrantArcTo(x + arcWidth, y + height - arcHeight, arcWidth, arcHeight, 3, false); + + _corePath.LineTo(x + width - arcWidth, y + height, false); + _corePath.QuadrantArcTo(x + width - arcWidth, y + height - arcHeight, arcWidth, arcHeight, 4, false); + + _corePath.LineTo(x + width, y + arcHeight, false); + _corePath.QuadrantArcTo(x + width - arcWidth, y + arcHeight, arcWidth, arcHeight, 1, false); + + _corePath.CloseSubpath(); +#endif +#else + // AddArc not yet implemented + AddArc((float)(x + width - ellipseWidth), (float)y, (float)ellipseWidth, (float)ellipseHeight, -90, 90); + AddArc((float)(x + width - ellipseWidth), (float)(y + height - ellipseHeight), (float)ellipseWidth, + (float)ellipseHeight, 0, 90); + AddArc((float)x, (float)(y + height - ellipseHeight), (float)ellipseWidth, (float)ellipseHeight, 90, 90); + AddArc((float)x, (float)y, (float)ellipseWidth, (float)ellipseHeight, 180, 90); + CloseFigure(); +#endif +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.StartFigure(); + _gdipPath.AddArc((float)(x + width - ellipseWidth), (float)y, (float)ellipseWidth, (float)ellipseHeight, -90, 90); + _gdipPath.AddArc((float)(x + width - ellipseWidth), (float)(y + height - ellipseHeight), (float)ellipseWidth, (float)ellipseHeight, 0, 90); + _gdipPath.AddArc((float)x, (float)(y + height - ellipseHeight), (float)ellipseWidth, (float)ellipseHeight, 90, 90); + _gdipPath.AddArc((float)x, (float)y, (float)ellipseWidth, (float)ellipseHeight, 180, 90); + _gdipPath.CloseFigure(); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE + double ex = ellipseWidth / 2; + double ey = ellipseHeight / 2; + StartFigure(); + PathFigure figure = CurrentPathFigure; + figure.StartPoint = new SysPoint(x + ex, y); + + //#if !SILVERLIGHT + // figure.Segments.Add(new LineSegment(new SysPoint(x + width - ex, y), true)); + // // TODOWPF XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx + // figure.Segments.Add(new ArcSegment(new SysPoint(x + width, y + ey), new SysSize(ex, ey), 0, false, SweepDirection.Clockwise, true)); + // //figure.Segments.Add(new LineSegment(new SysPoint(x + width, y + ey), true)); + + // figure.Segments.Add(new LineSegment(new SysPoint(x + width, y + height - ey), true)); + // // TODOWPF + // figure.Segments.Add(new ArcSegment(new SysPoint(x + width - ex, y + height), new SysSize(ex, ey), 0, false, SweepDirection.Clockwise, true)); + // //figure.Segments.Add(new LineSegment(new SysPoint(x + width - ex, y + height), true)); + + // figure.Segments.Add(new LineSegment(new SysPoint(x + ex, y + height), true)); + // // TODOWPF + // figure.Segments.Add(new ArcSegment(new SysPoint(x, y + height - ey), new SysSize(ex, ey), 0, false, SweepDirection.Clockwise, true)); + // //figure.Segments.Add(new LineSegment(new SysPoint(x, y + height - ey), true)); + + // figure.Segments.Add(new LineSegment(new SysPoint(x, y + ey), true)); + // // TODOWPF + // figure.Segments.Add(new ArcSegment(new SysPoint(x + ex, y), new SysSize(ex, ey), 0, false, SweepDirection.Clockwise, true)); + // //figure.Segments.Add(new LineSegment(new SysPoint(x + ex, y), true)); + //#else + +#if !SILVERLIGHT && !NETFX_CORE + figure.Segments.Add(new LineSegment(new SysPoint(x + width - ex, y), true)); +#else + figure.Segments.Add(new LineSegment { Point = new SysPoint(x + width - ex, y) }); +#endif + + // TODOWPF XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx +#if !SILVERLIGHT && !NETFX_CORE + figure.Segments.Add(new ArcSegment(new SysPoint(x + width, y + ey), new SysSize(ex, ey), 0, false, SweepDirection.Clockwise, true)); + //figure.Segments.Add(new LineSegment(new SysPoint(x + width, y + ey), true)); +#else + figure.Segments.Add(new ArcSegment + { + Point = new SysPoint(x + width, y + ey), + Size = new SysSize(ex, ey), + //RotationAngle = 0, + //IsLargeArc = false, + SweepDirection = SweepDirection.Clockwise + }); +#endif + +#if !SILVERLIGHT && !NETFX_CORE + figure.Segments.Add(new LineSegment(new SysPoint(x + width, y + height - ey), true)); +#else + figure.Segments.Add(new LineSegment { Point = new SysPoint(x + width, y + height - ey) }); +#endif + + // TODOWPF +#if !SILVERLIGHT && !NETFX_CORE + figure.Segments.Add(new ArcSegment(new SysPoint(x + width - ex, y + height), new SysSize(ex, ey), 0, false, SweepDirection.Clockwise, true)); + //figure.Segments.Add(new LineSegment(new SysPoint(x + width - ex, y + height), true)); +#else + figure.Segments.Add(new ArcSegment + { + Point = new SysPoint(x + width - ex, y + height), + Size = new SysSize(ex, ey), + //RotationAngle = 0, + //IsLargeArc = false, + SweepDirection = SweepDirection.Clockwise + }); +#endif + +#if !SILVERLIGHT && !NETFX_CORE + figure.Segments.Add(new LineSegment(new SysPoint(x + ex, y + height), true)); +#else + figure.Segments.Add(new LineSegment { Point = new SysPoint(x + ex, y + height) }); +#endif + + // TODOWPF +#if !SILVERLIGHT && !NETFX_CORE + figure.Segments.Add(new ArcSegment(new SysPoint(x, y + height - ey), new SysSize(ex, ey), 0, false, SweepDirection.Clockwise, true)); + //figure.Segments.Add(new LineSegment(new SysPoint(x, y + height - ey), true)); +#else + figure.Segments.Add(new ArcSegment + { + Point = new SysPoint(x, y + height - ey), + Size = new SysSize(ex, ey), + //RotationAngle = 0, + //IsLargeArc = false, + SweepDirection = SweepDirection.Clockwise + }); +#endif + +#if !SILVERLIGHT && !NETFX_CORE + figure.Segments.Add(new LineSegment(new SysPoint(x, y + ey), true)); +#else + figure.Segments.Add(new LineSegment { Point = new SysPoint(x, y + ey) }); +#endif + + // TODOWPF +#if !SILVERLIGHT && !NETFX_CORE + figure.Segments.Add(new ArcSegment(new SysPoint(x + ex, y), new SysSize(ex, ey), 0, false, SweepDirection.Clockwise, true)); + //figure.Segments.Add(new LineSegment(new SysPoint(x + ex, y), true)); +#else + figure.Segments.Add(new ArcSegment + { + Point = new SysPoint(x + ex, y), + Size = new SysSize(ex, ey), + //RotationAngle = 0, + //IsLargeArc = false, + SweepDirection = SweepDirection.Clockwise + }); +#endif + CloseFigure(); +#endif + } + + // ----- AddEllipse --------------------------------------------------------------------------- + +#if GDI + /// + /// Adds an ellipse to the current path. + /// + public void AddEllipse(Rectangle rect) + { + AddEllipse(rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + +#if GDI + /// + /// Adds an ellipse to the current path. + /// + public void AddEllipse(RectangleF rect) + { + AddEllipse(rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + + /// + /// Adds an ellipse to the current path. + /// + public void AddEllipse(XRect rect) + { + AddEllipse(rect.X, rect.Y, rect.Width, rect.Height); + } + + /// + /// Adds an ellipse to the current path. + /// + public void AddEllipse(double x, double y, double width, double height) + { +#if CORE + double w = width / 2; + double h = height / 2; + double xc = x + w; + double yc = y + h; + _corePath.MoveTo(x + w, y); + _corePath.QuadrantArcTo(xc, yc, w, h, 1, true); + _corePath.QuadrantArcTo(xc, yc, w, h, 4, true); + _corePath.QuadrantArcTo(xc, yc, w, h, 3, true); + _corePath.QuadrantArcTo(xc, yc, w, h, 2, true); + _corePath.CloseSubpath(); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddEllipse((float)x, (float)y, (float)width, (float)height); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE +#if !SILVERLIGHT && !NETFX_CORE + _pathGeometry.AddGeometry(new EllipseGeometry(new Rect(x, y, width, height))); +#else + var figure = new PathFigure(); + figure.StartPoint = new SysPoint(x, y + height / 2); + var segment = new ArcSegment + { + Point = new SysPoint(x + width, y + height / 2), + Size = new SysSize(width / 2, height / 2), + IsLargeArc = true, + RotationAngle = 180, + SweepDirection = SweepDirection.Clockwise, + }; + figure.Segments.Add(segment); + segment = new ArcSegment + { + Point = figure.StartPoint, + Size = new SysSize(width / 2, height / 2), + IsLargeArc = true, + RotationAngle = 180, + SweepDirection = SweepDirection.Clockwise, + }; + figure.Segments.Add(segment); + _pathGeometry.Figures.Add(figure); +#endif + // StartFigure() isn't needed because AddGeometry() implicitly starts a new figure, + // but CloseFigure() is needed for the next adding not to continue this figure. + CloseFigure(); +#endif + } + + // ----- AddPolygon --------------------------------------------------------------------------- + +#if GDI + /// + /// Adds a polygon to this path. + /// + public void AddPolygon(System.Drawing.Point[] points) + { + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddPolygon(points); + } + finally { Lock.ExitGdiPlus(); } + } +#endif + +#if WPF || NETFX_CORE + /// + /// Adds a polygon to this path. + /// + public void AddPolygon(SysPoint[] points) + { + // TODO: fill mode unclear here +#if !SILVERLIGHT && !NETFX_CORE + _pathGeometry.AddGeometry(GeometryHelper.CreatePolygonGeometry(points, XFillMode.Alternate, true)); + CloseFigure(); // StartFigure() isn't needed because AddGeometry() implicitly starts a new figure, but CloseFigure() is needed for the next adding not to continue this figure. +#else + AddPolygon(XGraphics.MakeXPointArray(points, 0, points.Length)); +#endif + } +#endif + +#if GDI + /// + /// Adds a polygon to this path. + /// + public void AddPolygon(PointF[] points) + { + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddPolygon(points); + } + finally { Lock.ExitGdiPlus(); } + } +#endif + + /// + /// Adds a polygon to this path. + /// + public void AddPolygon(XPoint[] points) + { +#if CORE + int count = points.Length; + if (count == 0) + return; + + _corePath.MoveTo(points[0].X, points[0].Y); + for (int idx = 0; idx < count - 1; idx++) + _corePath.LineTo(points[idx].X, points[idx].Y, false); + _corePath.LineTo(points[count - 1].X, points[count - 1].Y, true); + _corePath.CloseSubpath(); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddPolygon(XGraphics.MakePointFArray(points)); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE +#if !SILVERLIGHT && !NETFX_CORE + _pathGeometry.AddGeometry(GeometryHelper.CreatePolygonGeometry(XGraphics.MakePointArray(points), XFillMode.Alternate, true)); +#else + var figure = new PathFigure(); + figure.StartPoint = new SysPoint(points[0].X, points[0].Y); + figure.IsClosed = true; + + PolyLineSegment segment = new PolyLineSegment(); + int count = points.Length; + // For correct drawing the start point of the segment must not be the same as the first point. + for (int idx = 1; idx < count; idx++) + segment.Points.Add(new SysPoint(points[idx].X, points[idx].Y)); +#if !SILVERLIGHT && !NETFX_CORE + seg.IsStroked = true; +#endif + figure.Segments.Add(segment); + _pathGeometry.Figures.Add(figure); +#endif + // TODO: NOT NEEDED + //CloseFigure(); // StartFigure() isn't needed because AddGeometry() implicitly starts a new figure, but CloseFigure() is needed for the next adding not to continue this figure. +#endif + } + + // ----- AddPie ------------------------------------------------------------------------------- + +#if GDI + /// + /// Adds the outline of a pie shape to this path. + /// + public void AddPie(Rectangle rect, double startAngle, double sweepAngle) + { + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddPie(rect, (float)startAngle, (float)sweepAngle); + } + finally { Lock.ExitGdiPlus(); } + } +#endif + +#if GDI + /// + /// Adds the outline of a pie shape to this path. + /// + public void AddPie(RectangleF rect, double startAngle, double sweepAngle) + { + AddPie(rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } +#endif + + /// + /// Adds the outline of a pie shape to this path. + /// + public void AddPie(XRect rect, double startAngle, double sweepAngle) + { + AddPie(rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); + } + + /// + /// Adds the outline of a pie shape to this path. + /// + public void AddPie(double x, double y, double width, double height, double startAngle, double sweepAngle) + { +#if CORE + DiagnosticsHelper.HandleNotImplemented("XGraphicsPath.AddPie"); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddPie((float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE + DiagnosticsHelper.HandleNotImplemented("XGraphicsPath.AddPie"); +#endif + } + + // ----- AddClosedCurve ------------------------------------------------------------------------ + +#if GDI + /// + /// Adds a closed curve to this path. + /// + public void AddClosedCurve(System.Drawing.Point[] points) + { + AddClosedCurve(XGraphics.MakeXPointArray(points, 0, points.Length), 0.5); + } +#endif + +#if WPF || NETFX_CORE + /// + /// Adds a closed curve to this path. + /// + public void AddClosedCurve(SysPoint[] points) + { + AddClosedCurve(XGraphics.MakeXPointArray(points, 0, points.Length), 0.5); + } +#endif + +#if GDI + /// + /// Adds a closed curve to this path. + /// + public void AddClosedCurve(PointF[] points) + { + AddClosedCurve(XGraphics.MakeXPointArray(points, 0, points.Length), 0.5); + } +#endif + + /// + /// Adds a closed curve to this path. + /// + public void AddClosedCurve(XPoint[] points) + { + AddClosedCurve(points, 0.5); + } + +#if GDI + /// + /// Adds a closed curve to this path. + /// + public void AddClosedCurve(System.Drawing.Point[] points, double tension) + { + AddClosedCurve(XGraphics.MakeXPointArray(points, 0, points.Length), tension); + } +#endif + +#if WPF || NETFX_CORE + /// + /// Adds a closed curve to this path. + /// + public void AddClosedCurve(SysPoint[] points, double tension) + { + AddClosedCurve(XGraphics.MakeXPointArray(points, 0, points.Length), tension); + } +#endif + +#if GDI + /// + /// Adds a closed curve to this path. + /// + public void AddClosedCurve(PointF[] points, double tension) + { + AddClosedCurve(XGraphics.MakeXPointArray(points, 0, points.Length), tension); + } +#endif + + /// + /// Adds a closed curve to this path. + /// + public void AddClosedCurve(XPoint[] points, double tension) + { + if (points == null) + throw new ArgumentNullException("points"); + int count = points.Length; + if (count == 0) + return; + if (count < 2) + throw new ArgumentException("Not enough points.", "points"); + +#if CORE + DiagnosticsHelper.HandleNotImplemented("XGraphicsPath.AddClosedCurve"); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddClosedCurve(XGraphics.MakePointFArray(points), (float)tension); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF ||NETFX_CORE + tension /= 3; + + StartFigure(); + PathFigure figure = CurrentPathFigure; + figure.StartPoint = new SysPoint(points[0].X, points[0].Y); + + if (count == 2) + { + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[1], tension)); + } + else + { + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 1], points[0], points[1], points[2], tension)); + for (int idx = 1; idx < count - 2; idx++) + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension)); + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[0], tension)); + figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 2], points[count - 1], points[0], points[1], tension)); + } +#endif + } + + // ----- AddPath ------------------------------------------------------------------------------ + + /// + /// Adds the specified path to this path. + /// + public void AddPath(XGraphicsPath path, bool connect) + { +#if CORE + DiagnosticsHelper.HandleNotImplemented("XGraphicsPath.AddPath"); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddPath(path._gdipPath, connect); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE +#if !SILVERLIGHT && !NETFX_CORE + _pathGeometry.AddGeometry(path._pathGeometry); +#else + // AG-HACK: No AddGeometry in Silverlight version of PathGeometry + throw new InvalidOperationException("Silverlight/WinRT cannot merge geometry objects."); + // TODO: make it manually by using a GeometryGroup +#endif +#endif + } + + // ----- AddString ---------------------------------------------------------------------------- + +#if GDI + /// + /// Adds a text string to this path. + /// + public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, System.Drawing.Point origin, XStringFormat format) + { + AddString(s, family, style, emSize, new XRect(origin.X, origin.Y, 0, 0), format); + } +#endif + +#if WPF || NETFX_CORE + /// + /// Adds a text string to this path. + /// + public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, SysPoint origin, XStringFormat format) + { + AddString(s, family, style, emSize, new XPoint(origin), format); + } +#endif + +#if GDI + /// + /// Adds a text string to this path. + /// + public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, PointF origin, XStringFormat format) + { + AddString(s, family, style, emSize, new XRect(origin.X, origin.Y, 0, 0), format); + } +#endif + + /// + /// Adds a text string to this path. + /// + public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, XPoint origin, + XStringFormat format) + { + try + { +#if CORE + DiagnosticsHelper.HandleNotImplemented("XGraphicsPath.AddString"); +#endif +#if GDI + if (family.GdiFamily == null) + throw new NotFiniteNumberException(PSSR.NotImplementedForFontsRetrievedWithFontResolver(family.Name)); + + PointF p = origin.ToPointF(); + p.Y += SimulateBaselineOffset(family, style, emSize, format); + + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddString(s, family.GdiFamily, (int)style, (float)emSize, p, format.RealizeGdiStringFormat()); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF + if (family.WpfFamily == null) + throw new NotFiniteNumberException(PSSR.NotImplementedForFontsRetrievedWithFontResolver(family.Name)); +#if !SILVERLIGHT + XFont font = new XFont(family.Name, emSize, style); + + double x = origin.X; + double y = origin.Y; + + double lineSpace = font.GetHeight(); + double cyAscent = lineSpace * font.CellAscent / font.CellSpace; + double cyDescent = lineSpace * font.CellDescent / font.CellSpace; + + Typeface typeface = FontHelper.CreateTypeface(family.WpfFamily, style); + FormattedText formattedText = FontHelper.CreateFormattedText(s, typeface, emSize, WpfBrushes.Black); + + switch (format.Alignment) + { + case XStringAlignment.Near: + // nothing to do, this is the default + //formattedText.TextAlignment = TextAlignment.Left; + break; + + case XStringAlignment.Center: + formattedText.TextAlignment = TextAlignment.Center; + break; + + case XStringAlignment.Far: + formattedText.TextAlignment = TextAlignment.Right; + break; + } + switch (format.LineAlignment) + { + case XLineAlignment.Near: + //y += cyAscent; + break; + + case XLineAlignment.Center: + // TODO use CapHeight. PDFlib also uses 3/4 of ascent + y += -lineSpace / 2; //-formattedText.Baseline + (cyAscent * 2 / 4); + break; + + case XLineAlignment.Far: + y += -formattedText.Baseline - cyDescent; + break; + + case XLineAlignment.BaseLine: + y -= formattedText.Baseline; + break; + } + + Geometry geo = formattedText.BuildGeometry(new XPoint(x, y)); + _pathGeometry.AddGeometry(geo); +#else + // AG-HACK + throw new InvalidOperationException("Silverlight cannot create geometry of glyphs."); + // TODO: Get the outline directly from the font. +#endif +#endif + } + catch + { + throw; + } + } + +#if GDI + /// + /// Adds a text string to this path. + /// + public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, Rectangle layoutRect, XStringFormat format) + { + if (family.GdiFamily == null) + throw new NotFiniteNumberException(PSSR.NotImplementedForFontsRetrievedWithFontResolver(family.Name)); + + Rectangle rect = new Rectangle(layoutRect.X, layoutRect.Y, layoutRect.Width, layoutRect.Height); + rect.Offset(new System.Drawing.Point(0, (int)SimulateBaselineOffset(family, style, emSize, format))); + + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddString(s, family.GdiFamily, (int)style, (float)emSize, rect, format.RealizeGdiStringFormat()); + } + finally { Lock.ExitGdiPlus(); } + } + + /// + /// Adds a text string to this path. + /// + public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, RectangleF layoutRect, XStringFormat format) + { + if (family.GdiFamily == null) + throw new NotFiniteNumberException(PSSR.NotImplementedForFontsRetrievedWithFontResolver(family.Name)); + + RectangleF rect = new RectangleF(layoutRect.X, layoutRect.Y, layoutRect.Width, layoutRect.Height); + rect.Offset(new PointF(0, SimulateBaselineOffset(family, style, emSize, format))); + + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddString(s, family.GdiFamily, (int)style, (float)emSize, layoutRect, format.RealizeGdiStringFormat()); + } + finally { Lock.ExitGdiPlus(); } + } + + /// + /// Calculates the offset for BaseLine positioning simulation: + /// In GDI we have only Near, Center and Far as LineAlignment and no BaseLine. For XLineAlignment.BaseLine StringAlignment.Near is returned. + /// We now return the negative drawed ascender height. + /// This has to be added to the LayoutRect/Origin before each _gdipPath.AddString(). + /// + /// + /// + /// + /// + /// + private float SimulateBaselineOffset(XFontFamily family, XFontStyle style, double emSize, XStringFormat format) + { + XFont font = new XFont(family.Name, emSize, style); + + if (format.LineAlignment == XLineAlignment.BaseLine) + { + double lineSpace = font.GetHeight(); + int cellSpace = font.FontFamily.GetLineSpacing(font.Style); + int cellAscent = font.FontFamily.GetCellAscent(font.Style); + int cellDescent = font.FontFamily.GetCellDescent(font.Style); + double cyAscent = lineSpace * cellAscent / cellSpace; + cyAscent = lineSpace * font.CellAscent / font.CellSpace; + return (float)-cyAscent; + } + return 0; + } + +#endif + +#if WPF + /// + /// Adds a text string to this path. + /// + public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, Rect rect, XStringFormat format) + { + //gdip Path.AddString(s, family.gdiFamily, (int)style, (float)emSize, layoutRect, format.RealizeGdiStringFormat()); + AddString(s, family, style, emSize, new XRect(rect), format); + } +#endif + + /// + /// Adds a text string to this path. + /// + public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, XRect layoutRect, + XStringFormat format) + { + if (s == null) + throw new ArgumentNullException("s"); + + if (family == null) + throw new ArgumentNullException("family"); + + if (format == null) + format = XStringFormats.Default; + + if (format.LineAlignment == XLineAlignment.BaseLine && layoutRect.Height != 0) + throw new InvalidOperationException( + "DrawString: With XLineAlignment.BaseLine the height of the layout rectangle must be 0."); + + if (s.Length == 0) + return; + + XFont font = new XFont(family.Name, emSize, style); +#if CORE + DiagnosticsHelper.HandleNotImplemented("XGraphicsPath.AddString"); +#endif +#if (GDI || CORE_) && !WPF + //Gfx.DrawString(text, font.Realize_GdiFont(), brush.RealizeGdiBrush(), rect, + // format != null ? format.RealizeGdiStringFormat() : null); + + if (family.GdiFamily == null) + throw new NotFiniteNumberException(PSSR.NotImplementedForFontsRetrievedWithFontResolver(family.Name)); + + RectangleF rect = layoutRect.ToRectangleF(); + rect.Offset(new PointF(0, SimulateBaselineOffset(family, style, emSize, format))); + + try + { + Lock.EnterGdiPlus(); + _gdipPath.AddString(s, family.GdiFamily, (int)style, (float)emSize, rect, format.RealizeGdiStringFormat()); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF && !GDI + if (family.WpfFamily == null) + throw new NotFiniteNumberException(PSSR.NotImplementedForFontsRetrievedWithFontResolver(family.Name)); +#if !SILVERLIGHT + // Just a first sketch, but currently we do not need it and there is enough to do... + double x = layoutRect.X; + double y = layoutRect.Y; + + //double lineSpace = font.GetHeight(this); + //double cyAscent = lineSpace * font.cellAscent / font.cellSpace; + //double cyDescent = lineSpace * font.cellDescent / font.cellSpace; + + //double cyAscent = family.GetCellAscent(style) * family.GetLineSpacing(style) / family.getl; //fontlineSpace * font.cellAscent / font.cellSpace; + //double cyDescent =family.GetCellDescent(style); // lineSpace * font.cellDescent / font.cellSpace; + double lineSpace = font.GetHeight(); + double cyAscent = lineSpace * font.CellAscent / font.CellSpace; + double cyDescent = lineSpace * font.CellDescent / font.CellSpace; + + bool bold = (style & XFontStyle.Bold) != 0; + bool italic = (style & XFontStyle.Italic) != 0; + bool strikeout = (style & XFontStyle.Strikeout) != 0; + bool underline = (style & XFontStyle.Underline) != 0; + + Typeface typeface = FontHelper.CreateTypeface(family.WpfFamily, style); + //FormattedText formattedText = new FormattedText(s, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, typeface, emSize, WpfBrushes.Black); + FormattedText formattedText = FontHelper.CreateFormattedText(s, typeface, emSize, WpfBrushes.Black); + + switch (format.Alignment) + { + case XStringAlignment.Near: + // nothing to do, this is the default + //formattedText.TextAlignment = TextAlignment.Left; + break; + + case XStringAlignment.Center: + x += layoutRect.Width / 2; + formattedText.TextAlignment = TextAlignment.Center; + break; + + case XStringAlignment.Far: + x += layoutRect.Width; + formattedText.TextAlignment = TextAlignment.Right; + break; + } + //if (PageDirection == XPageDirection.Downwards) + //{ + switch (format.LineAlignment) + { + case XLineAlignment.Near: + //y += cyAscent; + break; + + case XLineAlignment.Center: + // TO/DO use CapHeight. PDFlib also uses 3/4 of ascent + //y += -formattedText.Baseline + (cyAscent * 2 / 4) + layoutRect.Height / 2; + + // GDI seems to make it this simple: + // TODO: Check WPF's vertical alignment and make all implementations fit. $MaOs + y += layoutRect.Height / 2 - lineSpace / 2; + break; + + case XLineAlignment.Far: + y += -formattedText.Baseline - cyDescent + layoutRect.Height; + break; + + case XLineAlignment.BaseLine: + y -= formattedText.Baseline; + break; + } + //} + //else + //{ + // // TODOWPF + // switch (format.LineAlignment) + // { + // case XLineAlignment.Near: + // //y += cyDescent; + // break; + + // case XLineAlignment.Center: + // // TODO use CapHeight. PDFlib also uses 3/4 of ascent + // //y += -(cyAscent * 3 / 4) / 2 + rect.Height / 2; + // break; + + // case XLineAlignment.Far: + // //y += -cyAscent + rect.Height; + // break; + + // case XLineAlignment.BaseLine: + // // nothing to do + // break; + // } + //} + + //if (bold && !descriptor.IsBoldFace) + //{ + // // TODO: emulate bold by thicker outline + //} + + //if (italic && !descriptor.IsItalicFace) + //{ + // // TODO: emulate italic by shearing transformation + //} + + if (underline) + { + //double underlinePosition = lineSpace * realizedFont.FontDescriptor.descriptor.UnderlinePosition / font.cellSpace; + //double underlineThickness = lineSpace * realizedFont.FontDescriptor.descriptor.UnderlineThickness / font.cellSpace; + //DrawRectangle(null, brush, x, y - underlinePosition, width, underlineThickness); + } + + if (strikeout) + { + //double strikeoutPosition = lineSpace * realizedFont.FontDescriptor.descriptor.StrikeoutPosition / font.cellSpace; + //double strikeoutSize = lineSpace * realizedFont.FontDescriptor.descriptor.StrikeoutSize / font.cellSpace; + //DrawRectangle(null, brush, x, y - strikeoutPosition - strikeoutSize, width, strikeoutSize); + } + + //dc.DrawText(formattedText, layoutRectangle.Location.ToPoint()); + //dc.DrawText(formattedText, new SysPoint(x, y)); + + Geometry geo = formattedText.BuildGeometry(new Point(x, y)); + _pathGeometry.AddGeometry(geo); +#else + // AG-HACK + throw new InvalidOperationException("Silverlight cannot create geometry of glyphs."); + // TODO: no, yagni +#endif +#endif + } + + // -------------------------------------------------------------------------------------------- + + /// + /// Closes the current figure and starts a new figure. + /// + public void CloseFigure() + { +#if CORE + _corePath.CloseSubpath(); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.CloseFigure(); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE + PathFigure figure = PeekCurrentFigure; + if (figure != null && figure.Segments.Count != 0) + figure.IsClosed = true; +#endif + } + + /// + /// Starts a new figure without closing the current figure. + /// + public void StartFigure() + { +#if CORE + // TODO: ??? +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.StartFigure(); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE + PathFigure figure = CurrentPathFigure; + if (figure.Segments.Count != 0) + { + figure = new PathFigure(); + _pathGeometry.Figures.Add(figure); + } +#endif + } + + // -------------------------------------------------------------------------------------------- + + /// + /// Gets or sets an XFillMode that determines how the interiors of shapes are filled. + /// + public XFillMode FillMode + { + get { return _fillMode; } + set + { + _fillMode = value; +#if CORE + // Nothing to do. +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.FillMode = (FillMode)value; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE + _pathGeometry.FillRule = value == XFillMode.Winding ? FillRule.Nonzero : FillRule.EvenOdd; +#endif + } + } + + private XFillMode _fillMode; + + // -------------------------------------------------------------------------------------------- + + /// + /// Converts each curve in this XGraphicsPath into a sequence of connected line segments. + /// + public void Flatten() + { +#if CORE + // Just do nothing. +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.Flatten(); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE +#if !SILVERLIGHT && !NETFX_CORE + _pathGeometry = _pathGeometry.GetFlattenedPathGeometry(); +#else + // AGHACK + throw new InvalidOperationException("Silverlight/WinrRT cannot flatten a geometry."); + // TODO: no, yagni +#endif +#endif + } + + /// + /// Converts each curve in this XGraphicsPath into a sequence of connected line segments. + /// + public void Flatten(XMatrix matrix) + { +#if CORE + // Just do nothing. +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.Flatten(matrix.ToGdiMatrix()); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE +#if !SILVERLIGHT && !NETFX_CORE + _pathGeometry = _pathGeometry.GetFlattenedPathGeometry(); + _pathGeometry.Transform = new MatrixTransform(matrix.ToWpfMatrix()); +#else + // AGHACK + throw new InvalidOperationException("Silverlight/WinRT cannot flatten a geometry."); + // TODO: no, yagni +#endif +#endif + } + + /// + /// Converts each curve in this XGraphicsPath into a sequence of connected line segments. + /// + public void Flatten(XMatrix matrix, double flatness) + { +#if CORE + // Just do nothing. +#endif +#if CORE___ + throw new NotImplementedException("XGraphicsPath.Flatten"); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.Flatten(matrix.ToGdiMatrix(), (float)flatness); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE +#if !SILVERLIGHT && !NETFX_CORE + _pathGeometry = _pathGeometry.GetFlattenedPathGeometry(); + // TODO: matrix handling not yet tested + if (!matrix.IsIdentity) + _pathGeometry.Transform = new MatrixTransform(matrix.ToWpfMatrix()); +#else + // AG-HACK + throw new InvalidOperationException("Silverlight/WinRT cannot flatten a geometry."); + // TODO: no, yagni +#endif +#endif + } + + // -------------------------------------------------------------------------------------------- + + /// + /// Replaces this path with curves that enclose the area that is filled when this path is drawn + /// by the specified pen. + /// + public void Widen(XPen pen) + { +#if CORE + // Just do nothing. +#endif +#if CORE___ + throw new NotImplementedException("XGraphicsPath.Widen"); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.Widen(pen.RealizeGdiPen()); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE +#if !SILVERLIGHT && !NETFX_CORE + _pathGeometry = _pathGeometry.GetWidenedPathGeometry(pen.RealizeWpfPen()); +#else + // AG-HACK + throw new InvalidOperationException("Silverlight/WinRT cannot widen a geometry."); + // TODO: no, yagni +#endif +#endif + } + + /// + /// Replaces this path with curves that enclose the area that is filled when this path is drawn + /// by the specified pen. + /// + public void Widen(XPen pen, XMatrix matrix) + { +#if CORE + // Just do nothing. +#endif +#if CORE + throw new NotImplementedException("XGraphicsPath.Widen"); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.Widen(pen.RealizeGdiPen(), matrix.ToGdiMatrix()); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE +#if !SILVERLIGHT && !NETFX_CORE + _pathGeometry = _pathGeometry.GetWidenedPathGeometry(pen.RealizeWpfPen()); +#else + // AG-HACK + throw new InvalidOperationException("Silverlight/WinRT cannot widen a geometry."); + // TODO: no, yagni +#endif +#endif + } + + /// + /// Replaces this path with curves that enclose the area that is filled when this path is drawn + /// by the specified pen. + /// + public void Widen(XPen pen, XMatrix matrix, double flatness) + { +#if CORE + // Just do nothing. +#endif +#if CORE__ + throw new NotImplementedException("XGraphicsPath.Widen"); +#endif +#if GDI + try + { + Lock.EnterGdiPlus(); + _gdipPath.Widen(pen.RealizeGdiPen(), matrix.ToGdiMatrix(), (float)flatness); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF || NETFX_CORE +#if !SILVERLIGHT && !NETFX_CORE + _pathGeometry = _pathGeometry.GetWidenedPathGeometry(pen.RealizeWpfPen()); +#else + // AG-HACK + throw new InvalidOperationException("Silverlight/WinRT cannot widen a geometry."); + // TODO: no, yagni +#endif +#endif + } + + /// + /// Grants access to internal objects of this class. + /// + public XGraphicsPathInternals Internals + { + get { return new XGraphicsPathInternals(this); } + } + +#if CORE + /// + /// Gets access to underlying Core graphics path. + /// + internal CoreGraphicsPath _corePath; +#endif + +#if GDI + /// + /// Gets access to underlying GDI+ graphics path. + /// + internal GraphicsPath _gdipPath; +#endif + +#if WPF || NETFX_CORE + /// + /// Gets access to underlying WPF/WinRT path geometry. + /// + internal PathGeometry _pathGeometry; +#endif + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing/XGraphicsPathInternals.cs b/PdfSharp/Drawing/XGraphicsPathInternals.cs new file mode 100644 index 0000000..e8ac222 --- /dev/null +++ b/PdfSharp/Drawing/XGraphicsPathInternals.cs @@ -0,0 +1,76 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +#endif +#if NETFX_CORE +using Windows.UI.Xaml.Media; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Provides access to the internal data structures of XGraphicsPath. + /// This class prevents the public interface from pollution with internal functions. + /// + public sealed class XGraphicsPathInternals + { + internal XGraphicsPathInternals(XGraphicsPath path) + { + _path = path; + } + XGraphicsPath _path; + +#if GDI + /// + /// Gets the underlying GDI+ path object. + /// + public GraphicsPath GdiPath + { + get { return _path._gdipPath; } + } +#endif + +#if WPF || NETFX_CORE + /// + /// Gets the underlying WPF path geometry object. + /// + public PathGeometry WpfPath + { + get { return _path._pathGeometry; } + } +#endif + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing/XGraphicsPathItem.cs b/PdfSharp/Drawing/XGraphicsPathItem.cs new file mode 100644 index 0000000..07d0e46 --- /dev/null +++ b/PdfSharp/Drawing/XGraphicsPathItem.cs @@ -0,0 +1,77 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing +{ +#if true_ // unused + /// + /// Represents a segment of a path defined by a type and a set of points. + /// + internal sealed class XGraphicsPathItem + { + public XGraphicsPathItem(XGraphicsPathItemType type) + { + Type = type; + Points = null; + } + +#if GDI + public XGraphicsPathItem(XGraphicsPathItemType type, params PointF[] points) + { + Type = type; + Points = XGraphics.MakeXPointArray(points, 0, points.Length); + } +#endif + + public XGraphicsPathItem(XGraphicsPathItemType type, params XPoint[] points) + { + Type = type; + Points = (XPoint[])points.Clone(); + } + + public XGraphicsPathItem Clone() + { + XGraphicsPathItem item = (XGraphicsPathItem)MemberwiseClone(); + item.Points = (XPoint[])Points.Clone(); + return item; + } + + public XGraphicsPathItemType Type; + public XPoint[] Points; + } +#endif +} \ No newline at end of file diff --git a/PdfSharp/Drawing/XGraphicsState.cs b/PdfSharp/Drawing/XGraphicsState.cs new file mode 100644 index 0000000..7fb163b --- /dev/null +++ b/PdfSharp/Drawing/XGraphicsState.cs @@ -0,0 +1,65 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Represents the internal state of an XGraphics object. + /// This class is used as a handle for restoring the context. + /// + public sealed class XGraphicsState + { + // This class is simply a wrapper of InternalGraphicsState. +#if CORE + internal XGraphicsState() + { } +#endif +#if GDI + internal XGraphicsState(GraphicsState state) + { + GdiState = state; + } + + internal GraphicsState GdiState; +#endif +#if WPF + internal XGraphicsState() + { } +#endif + internal InternalGraphicsState InternalState; + } +} diff --git a/PdfSharp/Drawing/XImage.cs b/PdfSharp/Drawing/XImage.cs new file mode 100644 index 0000000..d94632b --- /dev/null +++ b/PdfSharp/Drawing/XImage.cs @@ -0,0 +1,1560 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.IO; +using PdfSharp.Pdf; +#if CORE +using System.Drawing; +#endif +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Imaging; +#endif +#if NETFX_CORE || UWP +using Windows.UI.Xaml.Media.Imaging; +#endif +using PdfSharp.Drawing.Internal; +using PdfSharp.Internal; +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.Advanced; + +// WPFHACK +#pragma warning disable 0169 +#pragma warning disable 0649 + +namespace PdfSharp.Drawing +{ + [Flags] + internal enum XImageState + { + UsedInDrawingContext = 0x00000001, + + StateMask = 0x0000FFFF, + } + + /// + /// Defines an object used to draw image files (bmp, png, jpeg, gif) and PDF forms. + /// An abstract base class that provides functionality for the Bitmap and Metafile descended classes. + /// + public class XImage : IDisposable + { + // The hierarchy is adapted to WPF/Silverlight/WinRT + // + // XImage <-- ImageSource + // XForm + // PdfForm + // XBitmapSource <-- BitmapSource + // XBitmapImage <-- BitmapImage + + // ??? + //public bool Disposed + //{ + // get { return _disposed; } + // set { _disposed = value; } + //} + + + /// + /// Initializes a new instance of the class. + /// + protected XImage() + { } + +#if GDI || CORE || WPF + /// + /// Initializes a new instance of the class from an image read by ImageImporter. + /// + /// The image. + /// image + XImage(ImportedImage image) + { + if (image == null) + throw new ArgumentNullException("image"); + + _importedImage = image; + Initialize(); + } +#endif + +#if GDI + /// + /// Initializes a new instance of the class from a GDI+ image. + /// + XImage(Image image) + { + _gdiImage = image; +#if WPF // Is defined in hybrid build. + _wpfImage = ImageHelper.CreateBitmapSource(image); +#endif + Initialize(); + } +#endif + +#if WPF + /// + /// Initializes a new instance of the class from a WPF image. + /// + XImage(BitmapSource image) + { + _wpfImage = image; + Initialize(); + } +#endif + +#if WPF + XImage(Uri uri) + { + //var uriSource = new Uri(@"/WpfApplication1;component/Untitled.png", UriKind.Relative); foo.Source = new BitmapImage(uriSource); + + _wpfImage = BitmapFromUri(uri); + + //throw new NotImplementedException("XImage from Uri."); + // WPF + //Image finalImage = new Image(); + //finalImage.Width = 80; + //...BitmapImage logo = new BitmapImage() + //logo.BeginInit();logo.UriSource = new Uri("pack://application:,,,/ApplicationName;component/Resources/logo.png"); + //logo.EndInit(); + //...finalImage.Source = logo; + } + + /// + /// Creates an BitmapImage from URI. Sets BitmapCacheOption.OnLoad for WPF to prevent image file from being locked. + /// + public static BitmapImage BitmapFromUri(Uri uri) + { +#if !SILVERLIGHT + // Using new BitmapImage(uri) will leave a lock on the file, leading to problems with temporary image files in server environments. + // We use BitmapCacheOption.OnLoad to prevent this lock. + BitmapImage bitmap = new BitmapImage(); + bitmap.BeginInit(); + bitmap.UriSource = uri; + bitmap.CacheOption = BitmapCacheOption.OnLoad; + bitmap.EndInit(); + return bitmap; +#else + return new BitmapImage(uri); +#endif + } +#endif + +#if NETFX_CORE + /// + /// Initializes a new instance of the class from a WinRT image. + /// + XImage(BitmapSource image) + { + _wrtImage = image; + Initialize(); + } +#endif + + // Useful stuff here: http://stackoverflow.com/questions/350027/setting-wpf-image-source-in-code + XImage(string path) + { +#if !NETFX_CORE && !UWP + path = Path.GetFullPath(path); + if (!File.Exists(path)) + throw new FileNotFoundException(PSSR.FileNotFound(path)); + //throw new FileNotFoundException(PSSR.FileNotFound(path), path); +#endif + _path = path; + + //FileStream file = new FileStream(filename, FileMode.Open); + //BitsLength = (int)file.Length; + //Bits = new byte[BitsLength]; + //file.Read(Bits, 0, BitsLength); + //file.Close(); +#if CORE_WITH_GDI || GDI + try + { + Lock.EnterGdiPlus(); + _gdiImage = Image.FromFile(path); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF && !SILVERLIGHT + //BitmapSource.Create() + // BUG: BitmapImage locks the file + //_wpfImage = new BitmapImage(new Uri(path)); // AGHACK + // Suggested change from forum to prevent locking. + _wpfImage = BitmapFromUri(new Uri(path)); +#endif +#if WPF && SILVERLIGHT + //BitmapSource.Create() + // BUG: BitmapImage locks the file + //_wpfImage = new BitmapImage(new Uri(path)); // AGHACK + //Debug-Break.Break(); +#endif + +#if true_ + float vres = image.VerticalResolution; + float hres = image.HorizontalResolution; + SizeF size = image.PhysicalDimension; + int flags = image.Flags; + Size sz = image.Size; + GraphicsUnit units = GraphicsUnit.Millimeter; + RectangleF rect = image.GetBounds(ref units); + int width = image.Width; +#endif + Initialize(); + } + + XImage(Stream stream) + { + // Create a dummy unique path. + _path = "*" + Guid.NewGuid().ToString("B"); + + // TODO: Create a fingerprint of the bytes in the stream to identify identical images. + // TODO: Merge code for CORE_WITH_GDI and GDI. +#if CORE_WITH_GDI + // Create a GDI+ image. + try + { + Lock.EnterGdiPlus(); + _gdiImage = Image.FromStream(stream); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if GDI + // Create a GDI+ image. + try + { + Lock.EnterGdiPlus(); + _gdiImage = Image.FromStream(stream); + } + finally { Lock.ExitGdiPlus(); } +#endif +#if WPF && !SILVERLIGHT + // Create a WPF BitmapImage. + BitmapImage bmi = new BitmapImage(); + bmi.BeginInit(); + bmi.StreamSource = stream; + bmi.EndInit(); + _wpfImage = bmi; +#endif +#if SILVERLIGHT + int length = (int)stream.Length; + stream.Seek(0, SeekOrigin.Begin); + //_bytes = new byte[length]; + //stream.Read(_bytes, 0, length); + //stream.Seek(0, SeekOrigin.Begin); + + // Create a Silverlight BitmapImage. + _wpfImage = new BitmapImage(); + _wpfImage.SetSource(stream); +#endif + +#if true_ + float vres = image.VerticalResolution; + float hres = image.HorizontalResolution; + SizeF size = image.PhysicalDimension; + int flags = image.Flags; + Size sz = image.Size; + GraphicsUnit units = GraphicsUnit.Millimeter; + RectangleF rect = image.GetBounds(ref units); + int width = image.Width; +#endif + // Must assign _stream before Initialize(). + _stream = stream; + Initialize(); + } + +#if GDI //|| CORE +#if UseGdiObjects + /// + /// Implicit conversion from Image to XImage. + /// + public static implicit operator XImage(Image image) + { + return new XImage(image); + } +#endif + + /// + /// Conversion from Image to XImage. + /// + public static XImage FromGdiPlusImage(Image image) + { + return new XImage(image); + } +#endif + +#if WPF + /// + /// Conversion from BitmapSource to XImage. + /// + public static XImage FromBitmapSource(BitmapSource image) + { + return new XImage(image); + } +#endif + +#if NETFX_CORE + /// + /// Conversion from BitmapSource to XImage. + /// + public static XImage FromBitmapSource(BitmapSource image) + { + return new XImage(image); + } +#endif + + /// + /// Creates an image from the specified file. + /// + /// The path to a BMP, PNG, GIF, JPEG, TIFF, or PDF file. + public static XImage FromFile(string path) + { + if (PdfReader.TestPdfFile(path) > 0) + return new XPdfForm(path); + return new XImage(path); + } + + /// + /// Creates an image from the specified stream.
+ /// Silverlight supports PNG and JPEG only. + ///
+ /// The stream containing a BMP, PNG, GIF, JPEG, TIFF, or PDF file. + public static XImage FromStream(Stream stream) + { + if (stream == null) + throw new ArgumentNullException("stream"); + + if (PdfReader.TestPdfFile(stream) > 0) + return new XPdfForm(stream); + return new XImage(stream); + } + +#if DEBUG +#if CORE || GDI || WPF + /// + /// Creates an image from the specified file. + /// + /// The path to a BMP, PNG, GIF, JPEG, TIFF, or PDF file. + /// Uses an platform-independent implementation if set to true. + /// The platform-dependent implementation, if available, will support more image formats. + /// The document used to obtain the options. + internal static XImage FromFile(string path, bool platformIndependent, PdfDocument document) + { + if (!platformIndependent) + return FromFile(path); + + // TODO: Check PDF file. + + ImageImporter ii = ImageImporter.GetImageImporter(); + ImportedImage i = ii.ImportImage(path, document); + + if (i == null) + throw new InvalidOperationException("Unsupported image format."); + + XImage image = new XImage(i); + image._path = path; + return image; + } + + /// + /// Creates an image from the specified stream.
+ /// Silverlight supports PNG and JPEF only. + ///
+ /// The stream containing a BMP, PNG, GIF, JPEG, TIFF, or PDF file. + /// Uses an platform-independent implementation if set to true. + /// The platform-dependent implementation, if available, will support more image formats. + /// The document used to obtain the options. + internal static XImage FromStream(Stream stream, bool platformIndependent, PdfDocument document) + { + if (!platformIndependent) + return FromStream(stream); + + // TODO: Check PDF file. + + ImageImporter ii = ImageImporter.GetImageImporter(); + ImportedImage i = ii.ImportImage(stream, document); + + if (i == null) + throw new InvalidOperationException("Unsupported image format."); + + XImage image = new XImage(i); + image._stream = stream; + return image; + } +#endif +#endif + +#if DEBUG +#if CORE || GDI || WPF + /// + /// Creates an image. + /// + /// The imported image. + [Obsolete("THHO4THHO Internal test code.")] + internal static XImage FromImportedImage(ImportedImage image) + { + if (image == null) + throw new ArgumentNullException("image"); + + return new XImage(image); + } +#endif +#endif + + /// + /// Tests if a file exist. Supports PDF files with page number suffix. + /// + /// The path to a BMP, PNG, GIF, JPEG, TIFF, or PDF file. + public static bool ExistsFile(string path) + { + // Support for "base64:" pseudo protocol is a MigraDoc feature, currently completely implemented in MigraDoc files. TODO: Does support for "base64:" make sense for PDFsharp? Probably not as PDFsharp can handle images from streams. + //if (path.StartsWith("base64:")) // The Image is stored in the string here, so the file exists. + // return true; + + if (PdfReader.TestPdfFile(path) > 0) + return true; +#if !NETFX_CORE && !UWP + return File.Exists(path); +#else + return false; +#endif + } + + internal XImageState XImageState + { + get { return _xImageState; } + set { _xImageState = value; } + } + XImageState _xImageState; + + internal void Initialize() + { +#if CORE || GDI || WPF + if (_importedImage != null) + { + ImportedImageJpeg iiJpeg = _importedImage as ImportedImageJpeg; + // In PDF there are two formats: JPEG and PDF bitmap. + if (iiJpeg != null) + _format = XImageFormat.Jpeg; + else + _format = XImageFormat.Png; + return; + } +#endif + +#if CORE_WITH_GDI + if (_gdiImage != null) + { + // ImageFormat has no overridden Equals function. + string guid; + try + { + Lock.EnterGdiPlus(); + guid = _gdiImage.RawFormat.Guid.ToString("B").ToUpper(); + } + finally + { + Lock.ExitGdiPlus(); + } + + switch (guid) + { + case "{B96B3CAA-0728-11D3-9D7B-0000F81EF32E}": // memoryBMP + case "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}": // bmp + case "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}": // png + _format = XImageFormat.Png; + break; + + case "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}": // jpeg + _format = XImageFormat.Jpeg; + break; + + case "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}": // gif + _format = XImageFormat.Gif; + break; + + case "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}": // tiff + _format = XImageFormat.Tiff; + break; + + case "{B96B3CB5-0728-11D3-9D7B-0000F81EF32E}": // icon + _format = XImageFormat.Icon; + break; + + case "{B96B3CAC-0728-11D3-9D7B-0000F81EF32E}": // emf + case "{B96B3CAD-0728-11D3-9D7B-0000F81EF32E}": // wmf + case "{B96B3CB2-0728-11D3-9D7B-0000F81EF32E}": // exif + case "{B96B3CB3-0728-11D3-9D7B-0000F81EF32E}": // photoCD + case "{B96B3CB4-0728-11D3-9D7B-0000F81EF32E}": // flashPIX + + default: + throw new InvalidOperationException("Unsupported image format."); + } + return; + } +#endif +#if GDI + if (_gdiImage != null) + { + // ImageFormat has no overridden Equals function. + string guid; + try + { + Lock.EnterGdiPlus(); + guid = _gdiImage.RawFormat.Guid.ToString("B").ToUpper(); + } + finally { Lock.ExitGdiPlus(); } + + switch (guid) + { + case "{B96B3CAA-0728-11D3-9D7B-0000F81EF32E}": // memoryBMP + case "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}": // bmp + case "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}": // png + _format = XImageFormat.Png; + break; + + case "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}": // jpeg + _format = XImageFormat.Jpeg; + break; + + case "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}": // gif + _format = XImageFormat.Gif; + break; + + case "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}": // tiff + _format = XImageFormat.Tiff; + break; + + case "{B96B3CB5-0728-11D3-9D7B-0000F81EF32E}": // icon + _format = XImageFormat.Icon; + break; + + case "{B96B3CAC-0728-11D3-9D7B-0000F81EF32E}": // emf + case "{B96B3CAD-0728-11D3-9D7B-0000F81EF32E}": // wmf + case "{B96B3CB2-0728-11D3-9D7B-0000F81EF32E}": // exif + case "{B96B3CB3-0728-11D3-9D7B-0000F81EF32E}": // photoCD + case "{B96B3CB4-0728-11D3-9D7B-0000F81EF32E}": // flashPIX + + default: + throw new InvalidOperationException("Unsupported image format."); + } + return; + } +#endif +#if WPF +#if !SILVERLIGHT + if (_wpfImage != null) + { + //string filename = GetImageFilename(_wpfImage); + // WPF treats all images as images. + // We give JPEG images a special treatment. + // Test if it's a JPEG. + bool isJpeg = IsJpeg; // TestJpeg(filename); + if (isJpeg) + { + _format = XImageFormat.Jpeg; + return; + } + + string pixelFormat = _wpfImage.Format.ToString(); + switch (pixelFormat) + { + case "Bgr32": + case "Bgra32": + case "Pbgra32": + _format = XImageFormat.Png; + break; + + //case "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}": // jpeg + // format = XImageFormat.Jpeg; + // break; + + //case "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}": // gif + case "BlackWhite": + case "Indexed1": + case "Indexed4": + case "Indexed8": + case "Gray8": + _format = XImageFormat.Gif; + break; + + //case "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}": // tiff + // format = XImageFormat.Tiff; + // break; + + //case "{B96B3CB5-0728-11D3-9D7B-0000F81EF32E}": // icon + // format = XImageFormat.Icon; + // break; + + //case "{B96B3CAC-0728-11D3-9D7B-0000F81EF32E}": // emf + //case "{B96B3CAD-0728-11D3-9D7B-0000F81EF32E}": // wmf + //case "{B96B3CB2-0728-11D3-9D7B-0000F81EF32E}": // exif + //case "{B96B3CB3-0728-11D3-9D7B-0000F81EF32E}": // photoCD + //case "{B96B3CB4-0728-11D3-9D7B-0000F81EF32E}": // flashPIX + + default: + Debug.Assert(false, "Unknown pixel format: " + pixelFormat); + _format = XImageFormat.Gif; + break;// throw new InvalidOperationException("Unsupported image format."); + } + } +#else + if (_wpfImage != null) + { + // TODO improve implementation for Silverlight. + + //string pixelFormat = "jpg"; //_wpfImage...Format.ToString(); + //string filename = GetImageFilename(_wpfImage); + // WPF treats all images as images. + // We give JPEG images a special treatment. + // Test if it's a JPEG: + bool isJpeg = true; // IsJpeg; // TestJpeg(filename); + if (isJpeg) + { + _format = XImageFormat.Jpeg; + return; + } + + /* + switch (pixelFormat) + { + case "Bgr32": + case "Bgra32": + case "Pbgra32": + _format = XImageFormat.Png; + break; + + //case "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}": // jpeg + // format = XImageFormat.Jpeg; + // break; + + //case "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}": // gif + case "BlackWhite": + case "Indexed1": + case "Indexed4": + case "Indexed8": + case "Gray8": + _format = XImageFormat.Gif; + break; + + //case "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}": // tiff + // format = XImageFormat.Tiff; + // break; + + //case "{B96B3CB5-0728-11D3-9D7B-0000F81EF32E}": // icon + // format = XImageFormat.Icon; + // break; + + //case "{B96B3CAC-0728-11D3-9D7B-0000F81EF32E}": // emf + //case "{B96B3CAD-0728-11D3-9D7B-0000F81EF32E}": // wmf + //case "{B96B3CB2-0728-11D3-9D7B-0000F81EF32E}": // exif + //case "{B96B3CB3-0728-11D3-9D7B-0000F81EF32E}": // photoCD + //case "{B96B3CB4-0728-11D3-9D7B-0000F81EF32E}": // flashPIX + + default: + Debug.Assert(false, "Unknown pixel format: " + pixelFormat); + _format = XImageFormat.Gif; + break;// throw new InvalidOperationException("Unsupported image format."); + } + */ + } +#endif +#endif + } + +#if WPF + /// + /// Gets the image filename. + /// + /// The bitmap source. + internal static string GetImageFilename(BitmapSource bitmapSource) + { + string filename = bitmapSource.ToString(); + filename = UrlDecodeStringFromStringInternal(filename); + if (filename.StartsWith("file:///")) + filename = filename.Substring(8); // Remove all 3 slashes! + else if (filename.StartsWith("file://")) + filename = filename.Substring(5); // Keep 2 slashes (UNC path) + return filename; + } + + private static string UrlDecodeStringFromStringInternal(string s/*, Encoding e*/) + { + int length = s.Length; + string result = ""; + for (int i = 0; i < length; i++) + { + char ch = s[i]; + if (ch == '+') + { + ch = ' '; + } + else if ((ch == '%') && (i < (length - 2))) + { + if ((s[i + 1] == 'u') && (i < (length - 5))) + { + int num3 = HexToInt(s[i + 2]); + int num4 = HexToInt(s[i + 3]); + int num5 = HexToInt(s[i + 4]); + int num6 = HexToInt(s[i + 5]); + if (((num3 < 0) || (num4 < 0)) || ((num5 < 0) || (num6 < 0))) + { + goto AddByte; + } + ch = (char)((((num3 << 12) | (num4 << 8)) | (num5 << 4)) | num6); + i += 5; + result += ch; + continue; + } + int num7 = HexToInt(s[i + 1]); + int num8 = HexToInt(s[i + 2]); + if ((num7 >= 0) && (num8 >= 0)) + { + byte b = (byte)((num7 << 4) | num8); + i += 2; + result += (char)b; + continue; + } + } + AddByte: + if ((ch & 0xff80) == 0) + { + result += ch; + } + else + { + result += ch; + } + } + return result; + } + + private static int HexToInt(char h) + { + if (h >= '0' && h <= '9') + return (h - '0'); + if (h >= 'a' && h <= 'f') + return ((h - 'a') + 10); + if (h >= 'A' && h <= 'F') + return (h - 'A') + 10; + return -1; + } +#endif + +#if WPF + /// + /// Tests if a file is a JPEG. + /// + /// The filename. + internal static bool TestJpeg(string filename) + { + byte[] imageBits = null; + return ReadJpegFile(filename, 16, ref imageBits); + } + + /// + /// Tests if a file is a JPEG. + /// + /// The filename. + internal static bool TestJpeg(Stream stream) + { + byte[] imageBits = null; + return ReadJpegFile(stream, 16, ref imageBits) == true; + } + + /// + /// Reads the JPEG file. + /// + /// The filename. + /// The maximum count of bytes to be read. + /// The bytes read from the file. + /// False, if file could not be read or is not a JPEG file. + internal static bool ReadJpegFile(string filename, int maxRead, ref byte[] imageBits) + { + if (File.Exists(filename)) + { + FileStream fs = null; + try + { + fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + } + catch + { + return false; + } + + bool? test = ReadJpegFile(fs, maxRead, ref imageBits); + // Treat test result as definite. + if (test == false || test == true) + { + fs.Close(); + return test.Value; + } + // Test result is maybe. + // Hack: store the file in PDF if extension matches ... + string str = filename.ToLower(); + if (str.EndsWith(".jpg") || str.EndsWith(".jpeg")) + return true; + } + return false; + } + + /// + /// Reads the JPEG file. + /// + /// The stream. + /// The maximum count of bytes to be read. + /// The bytes read from the file. + /// False, if file could not be read or is not a JPEG file. + internal static bool? ReadJpegFile(Stream stream, int maxRead, ref byte[] imageBits) + { + if (!stream.CanSeek) + return false; + stream.Seek(0, SeekOrigin.Begin); + + if (stream.Length < 16) + { + return false; + } + int len = maxRead == -1 ? (int)stream.Length : maxRead; + imageBits = new byte[len]; + stream.Read(imageBits, 0, len); + if (imageBits[0] == 0xff && + imageBits[1] == 0xd8 && + imageBits[2] == 0xff && + imageBits[3] == 0xe0 && + imageBits[6] == 0x4a && + imageBits[7] == 0x46 && + imageBits[8] == 0x49 && + imageBits[9] == 0x46 && + imageBits[10] == 0x0) + { + return true; + } + // TODO: Exif: find JFIF header + if (imageBits[0] == 0xff && + imageBits[1] == 0xd8 && + imageBits[2] == 0xff && + imageBits[3] == 0xe1 /*&& + imageBits[6] == 0x4a && + imageBits[7] == 0x46 && + imageBits[8] == 0x49 && + imageBits[9] == 0x46 && + imageBits[10] == 0x0*/) + { + // Hack: store the file in PDF if extension matches ... + return null; + } + return false; + } +#endif + + /// + /// Under construction + /// + public void Dispose() + { + Dispose(true); + //GC.SuppressFinalize(this); + } + + /// + /// Disposes underlying GDI+ object. + /// + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + _disposed = true; + +#if CORE || GDI || WPF + //if (_importedImage != null) + { + _importedImage = null; + } +#endif + +#if CORE_WITH_GDI || GDI + if (_gdiImage != null) + { + try + { + Lock.EnterGdiPlus(); + _gdiImage.Dispose(); + _gdiImage = null; + } + finally { Lock.ExitGdiPlus(); } + } +#endif +#if WPF + _wpfImage = null; +#endif + } + bool _disposed; + + /// + /// Gets the width of the image. + /// + [Obsolete("Use either PixelWidth or PointWidth. Temporarily obsolete because of rearrangements for WPF. Currently same as PixelWidth, but will become PointWidth in future releases of PDFsharp.")] + public virtual double Width + { + get + { +#if CORE || GDI || WPF + if (_importedImage != null) + { + return _importedImage.Information.Width; + } +#endif + +#if (CORE_WITH_GDI || GDI) && !WPF + try + { + Lock.EnterGdiPlus(); + return _gdiImage.Width; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if GDI && WPF + double gdiWidth = _gdiImage.Width; + double wpfWidth = _wpfImage.PixelWidth; + Debug.Assert(gdiWidth == wpfWidth); + return wpfWidth; +#endif + //#if GDI && !WPF + // return _gdiImage.Width; + //#endif +#if WPF && !GDI + return _wpfImage.PixelWidth; +#endif +#if NETFX_CORE || UWP + return 100; +#endif + } + } + + /// + /// Gets the height of the image. + /// + [Obsolete("Use either PixelHeight or PointHeight. Temporarily obsolete because of rearrangements for WPF. Currently same as PixelHeight, but will become PointHeight in future releases of PDFsharp.")] + public virtual double Height + { + get + { +#if CORE_WITH_GDI || GDI || WPF + if (_importedImage != null) + { + return _importedImage.Information.Height; + } +#endif + +#if (CORE_WITH_GDI || GDI) && !WPF && !WPF + try + { + Lock.EnterGdiPlus(); + return _gdiImage.Height; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if GDI && WPF + double gdiHeight = _gdiImage.Height; + double wpfHeight = _wpfImage.PixelHeight; + Debug.Assert(gdiHeight == wpfHeight); + return wpfHeight; +#endif + //#if GDI && !WPF + // return _gdiImage.Height; + //#endif +#if WPF && !GDI + return _wpfImage.PixelHeight; +#endif +#if NETFX_CORE || UWP + return _wrtImage.PixelHeight; +#endif + } + } + +#if CORE || GDI || WPF + /// + /// The factor for conversion from DPM to PointWidth or PointHeight. + /// 72 points per inch, 1000 mm per meter, 25.4 mm per inch => 72 * 1000 / 25.4. + /// + private const decimal FactorDPM72 = 72000 / 25.4m; + + /// + /// The factor for conversion from DPM to PointWidth or PointHeight. + /// 1000 mm per meter, 25.4 mm per inch => 1000 / 25.4. + /// + private const decimal FactorDPM = 1000 / 25.4m; +#endif + + /// + /// Gets the width of the image in point. + /// + public virtual double PointWidth + { + get + { +#if CORE || GDI || WPF + if (_importedImage != null) + { + if (_importedImage.Information.HorizontalDPM > 0) + return (double)(_importedImage.Information.Width * FactorDPM72 / _importedImage.Information.HorizontalDPM); + if (_importedImage.Information.HorizontalDPI > 0) + return (double)(_importedImage.Information.Width * 72 / _importedImage.Information.HorizontalDPI); + // Assume 72 DPI if information not available. + return _importedImage.Information.Width; + } +#endif + +#if (CORE_WITH_GDI || GDI) && !WPF + try + { + Lock.EnterGdiPlus(); + return _gdiImage.Width * 72 / _gdiImage.HorizontalResolution; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if GDI && WPF + double gdiWidth = _gdiImage.Width * 72 / _gdiImage.HorizontalResolution; + double wpfWidth = _wpfImage.Width * 72.0 / 96.0; + //Debug.Assert(gdiWidth == wpfWidth); + Debug.Assert(DoubleUtil.AreRoughlyEqual(gdiWidth, wpfWidth, 5)); + return wpfWidth; +#endif + //#if GDI && !WPF + // return _gdiImage.Width * 72 / _gdiImage.HorizontalResolution; + //#endif +#if WPF && !GDI +#if !SILVERLIGHT + Debug.Assert(Math.Abs(_wpfImage.PixelWidth * 72 / _wpfImage.DpiX - _wpfImage.Width * 72.0 / 96.0) < 0.001); + return _wpfImage.Width * 72.0 / 96.0; +#else + // AGHACK + return _wpfImage.PixelWidth * 72 / 96.0; +#endif +#endif +#if NETFX_CORE || UWP + //var wb = new WriteableBitmap(); + //GetImagePropertiesAsync + return 100; +#endif + } + } + + /// + /// Gets the height of the image in point. + /// + public virtual double PointHeight + { + get + { +#if CORE || GDI || WPF + if (_importedImage != null) + { + if (_importedImage.Information.VerticalDPM > 0) + return (double)(_importedImage.Information.Height * FactorDPM72 / _importedImage.Information.VerticalDPM); + if (_importedImage.Information.VerticalDPI > 0) + return (double)(_importedImage.Information.Height * 72 / _importedImage.Information.VerticalDPI); + // Assume 72 DPI if information not available. + return _importedImage.Information.Width; + } +#endif + +#if (CORE_WITH_GDI || GDI) && !WPF + try + { + Lock.EnterGdiPlus(); + return _gdiImage.Height * 72 / _gdiImage.HorizontalResolution; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if GDI && WPF + double gdiHeight = _gdiImage.Height * 72 / _gdiImage.HorizontalResolution; + double wpfHeight = _wpfImage.Height * 72.0 / 96.0; + Debug.Assert(DoubleUtil.AreRoughlyEqual(gdiHeight, wpfHeight, 5)); + return wpfHeight; +#endif + //#if GDI && !WPF + // return _gdiImage.Height * 72 / _gdiImage.HorizontalResolution; + //#endif +#if WPF && !GDI +#if !SILVERLIGHT + Debug.Assert(Math.Abs(_wpfImage.PixelHeight * 72 / _wpfImage.DpiY - _wpfImage.Height * 72.0 / 96.0) < 0.001); + return _wpfImage.Height * 72.0 / 96.0; +#else + // AGHACK + return _wpfImage.PixelHeight * 72 / 96.0; +#endif +#endif +#if NETFX_CORE || UWP + return _wrtImage.PixelHeight; //_gdi Image.Width * 72 / _gdiImage.HorizontalResolution; +#endif + } + } + + /// + /// Gets the width of the image in pixels. + /// + public virtual int PixelWidth + { + get + { +#if CORE || GDI || WPF + if (_importedImage != null) + return (int)_importedImage.Information.Width; +#endif + +#if CORE_WITH_GDI + try + { + Lock.EnterGdiPlus(); + return _gdiImage.Width; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if GDI && !WPF + try + { + Lock.EnterGdiPlus(); + return _gdiImage.Width; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if GDI && WPF + int gdiWidth = _gdiImage.Width; + int wpfWidth = _wpfImage.PixelWidth; + Debug.Assert(gdiWidth == wpfWidth); + return wpfWidth; +#endif + //#if GDI && !WPF + // return _gdiImage.Width; + //#endif +#if WPF && !GDI + return _wpfImage.PixelWidth; +#endif +#if NETFX_CORE || UWP + return _wrtImage.PixelWidth; +#endif + } + } + + /// + /// Gets the height of the image in pixels. + /// + public virtual int PixelHeight + { + get + { +#if CORE || GDI || WPF + if (_importedImage != null) + return (int)_importedImage.Information.Height; +#endif + +#if CORE_WITH_GDI + try + { + Lock.EnterGdiPlus(); + return _gdiImage.Height; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if GDI && !WPF + try + { + Lock.EnterGdiPlus(); + return _gdiImage.Height; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if GDI && WPF + int gdiHeight = _gdiImage.Height; + int wpfHeight = _wpfImage.PixelHeight; + Debug.Assert(gdiHeight == wpfHeight); + return wpfHeight; +#endif + //#if GDI && !WPF + // return _gdiImage.Height; + //#endif +#if WPF && !GDI + return _wpfImage.PixelHeight; +#endif +#if NETFX_CORE || UWP + return _wrtImage.PixelHeight; +#endif + } + } + + /// + /// Gets the size in point of the image. + /// + public virtual XSize Size + { + get { return new XSize(PointWidth, PointHeight); } + } + + /// + /// Gets the horizontal resolution of the image. + /// + public virtual double HorizontalResolution + { + get + { +#if CORE || GDI || WPF + if (_importedImage != null) + { + if (_importedImage.Information.HorizontalDPI > 0) + return (double)_importedImage.Information.HorizontalDPI; + if (_importedImage.Information.HorizontalDPM > 0) + return (double)(_importedImage.Information.HorizontalDPM / FactorDPM); + return 72; + } +#endif + +#if (CORE_WITH_GDI || GDI) && !WPF + try + { + Lock.EnterGdiPlus(); + return _gdiImage.HorizontalResolution; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if GDI && WPF + double gdiResolution = _gdiImage.HorizontalResolution; + double wpfResolution = _wpfImage.PixelWidth * 96.0 / _wpfImage.Width; + Debug.Assert(gdiResolution == wpfResolution); + return wpfResolution; +#endif + //#if GDI && !WPF + // return _gdiImage.HorizontalResolution; + //#endif +#if WPF && !GDI +#if !SILVERLIGHT + return _wpfImage.DpiX; //.PixelWidth * 96.0 / _wpfImage.Width; +#else + // AGHACK + return 96; +#endif +#endif +#if NETFX_CORE || UWP + return 96; +#endif + } + } + + /// + /// Gets the vertical resolution of the image. + /// + public virtual double VerticalResolution + { + get + { +#if CORE || GDI || WPF + if (_importedImage != null) + { + if (_importedImage.Information.VerticalDPI > 0) + return (double)_importedImage.Information.VerticalDPI; + if (_importedImage.Information.VerticalDPM > 0) + return (double)(_importedImage.Information.VerticalDPM / FactorDPM); + return 72; + } +#endif + +#if (CORE_WITH_GDI || GDI) && !WPF + try + { + Lock.EnterGdiPlus(); + return _gdiImage.VerticalResolution; + } + finally { Lock.ExitGdiPlus(); } +#endif +#if GDI && WPF + double gdiResolution = _gdiImage.VerticalResolution; + double wpfResolution = _wpfImage.PixelHeight * 96.0 / _wpfImage.Height; + Debug.Assert(gdiResolution == wpfResolution); + return wpfResolution; +#endif + //#if GDI && !WPF + // return _gdiImage.VerticalResolution; + //#endif +#if WPF && !GDI +#if !SILVERLIGHT + return _wpfImage.DpiY; //.PixelHeight * 96.0 / _wpfImage.Height; +#else + // AGHACK + return 96; +#endif +#endif +#if NETFX_CORE || UWP + return 96; +#endif + } + } + + /// + /// Gets or sets a flag indicating whether image interpolation is to be performed. + /// + public virtual bool Interpolate + { + get { return _interpolate; } + set { _interpolate = value; } + } + bool _interpolate = true; + + /// + /// Gets the format of the image. + /// + public XImageFormat Format + { + get { return _format; } + } + XImageFormat _format; + +#if WPF + /// + /// Gets a value indicating whether this image is JPEG. + /// + internal virtual bool IsJpeg + { +#if !SILVERLIGHT + //get { if (!isJpeg.HasValue) InitializeGdiHelper(); return isJpeg.HasValue ? isJpeg.Value : false; } + get + { + if (!_isJpeg.HasValue) + InitializeJpegQuickTest(); + return _isJpeg.HasValue ? _isJpeg.Value : false; + } + //set { isJpeg = value; } +#else + // AGHACK + get { return true; } +#endif + } + private bool? _isJpeg; + + /// + /// Gets a value indicating whether this image is cmyk. + /// + internal virtual bool IsCmyk + { +#if !SILVERLIGHT + get { if (!_isCmyk.HasValue) InitializeGdiHelper(); return _isCmyk.HasValue ? _isCmyk.Value : false; } + //set { isCmyk = value; } +#else + get { return false; } // AGHACK +#endif + } + private bool? _isCmyk; + +#if !SILVERLIGHT + /// + /// Gets the JPEG memory stream (if IsJpeg returns true). + /// + public virtual MemoryStream Memory + { + get + { + if (!_isCmyk.HasValue) InitializeGdiHelper(); + return _memory; + } + //set { memory = value; } + } + MemoryStream _memory; + + /// + /// Determines if an image is JPEG w/o creating an Image object. + /// + private void InitializeJpegQuickTest() + { + if (_stream != null) + _isJpeg = TestJpeg(_stream); + else + _isJpeg = TestJpeg(GetImageFilename(_wpfImage)); + } + + /// + /// Initializes the GDI helper. + /// We use GDI+ to detect if image is JPEG. + /// If so, we also determine if it's CMYK and we read the image bytes. + /// + private void InitializeGdiHelper() + { + if (!_isCmyk.HasValue) + { + try + { + string imageFilename = GetImageFilename(_wpfImage); + // To reduce exceptions, check if file exists. + if (!string.IsNullOrEmpty(imageFilename) && File.Exists(imageFilename)) + { + MemoryStream memory = new MemoryStream(); + using (FileStream file = new FileStream(imageFilename, FileMode.Open, FileAccess.Read, FileShare.Read)) + { + byte[] bytes = new byte[file.Length]; + file.Read(bytes, 0, (int)file.Length); + memory.Write(bytes, 0, (int)file.Length); + memory.Seek(0, SeekOrigin.Begin); + } + InitializeJpegHelper(memory); + } + else if (_stream != null) + { + MemoryStream memory = new MemoryStream(); + // If we have a stream, copy data from the stream. + if (_stream != null && _stream.CanSeek) + { + _stream.Seek(0, SeekOrigin.Begin); + byte[] buffer = new byte[32 * 1024]; // 32K buffer. + int bytesRead; + while ((bytesRead = _stream.Read(buffer, 0, buffer.Length)) > 0) + { + memory.Write(buffer, 0, bytesRead); + } + InitializeJpegHelper(memory); + } + } + } + catch { } + } + } + + private void InitializeJpegHelper(MemoryStream memory) + { + using (System.Drawing.Image image = new System.Drawing.Bitmap(memory)) + { + string guid = image.RawFormat.Guid.ToString("B").ToUpper(); + _isJpeg = guid == "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}"; + _isCmyk = (image.Flags & + ((int)System.Drawing.Imaging.ImageFlags.ColorSpaceCmyk | (int)System.Drawing.Imaging.ImageFlags.ColorSpaceYcck)) != 0; + if (_isJpeg.Value) + { + //_memory = new MemoryStream(); + //image.Save(_memory, System.Drawing.Imaging.ImageFormat.Jpeg); + if ((int)memory.Length != 0) + { + _memory = memory; + } + else + { + _memory = null; + } + } + } + } +#endif +#endif + +#if DEBUG_ + // TEST + internal void CreateAllImages(string name) + { + if (image != null) + { + image.Save(name + ".bmp", ImageFormat.Bmp); + image.Save(name + ".emf", ImageFormat.Emf); + image.Save(name + ".exif", ImageFormat.Exif); + image.Save(name + ".gif", ImageFormat.Gif); + image.Save(name + ".ico", ImageFormat.Icon); + image.Save(name + ".jpg", ImageFormat.Jpeg); + image.Save(name + ".png", ImageFormat.Png); + image.Save(name + ".tif", ImageFormat.Tiff); + image.Save(name + ".wmf", ImageFormat.Wmf); + image.Save(name + "2.bmp", ImageFormat.MemoryBmp); + } + } +#endif + + internal void AssociateWithGraphics(XGraphics gfx) + { + if (_associatedGraphics != null) + throw new InvalidOperationException("XImage already associated with XGraphics."); + _associatedGraphics = null; + } + + internal void DisassociateWithGraphics() + { + if (_associatedGraphics == null) + throw new InvalidOperationException("XImage not associated with XGraphics."); + _associatedGraphics.DisassociateImage(); + + Debug.Assert(_associatedGraphics == null); + } + + internal void DisassociateWithGraphics(XGraphics gfx) + { + if (_associatedGraphics != gfx) + throw new InvalidOperationException("XImage not associated with XGraphics."); + _associatedGraphics = null; + } + + internal XGraphics AssociatedGraphics + { + get { return _associatedGraphics; } + set { _associatedGraphics = value; } + } + XGraphics _associatedGraphics; + +#if CORE || GDI || WPF + internal ImportedImage _importedImage; +#endif + +#if CORE_WITH_GDI || GDI + internal Image _gdiImage; +#endif +#if WPF + internal BitmapSource _wpfImage; +#if SILVERLIGHT + //internal byte[] _bytes; +#endif +#endif +#if NETFX_CORE || UWP + internal BitmapSource _wrtImage; +#endif + + /// + /// If path starts with '*' the image is created from a stream and the path is a GUID. + /// + internal string _path; + + /// + /// Contains a reference to the original stream if image was created from a stream. + /// + internal Stream _stream; + + /// + /// Cache PdfImageTable.ImageSelector to speed up finding the right PdfImage + /// if this image is used more than once. + /// + internal PdfImageTable.ImageSelector _selector; + } +} diff --git a/PdfSharp/Drawing/XImageFormat.cs b/PdfSharp/Drawing/XImageFormat.cs new file mode 100644 index 0000000..b7aa58e --- /dev/null +++ b/PdfSharp/Drawing/XImageFormat.cs @@ -0,0 +1,141 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Drawing +{ + /// + /// Specifies the format of the image. + /// + public sealed class XImageFormat + { + XImageFormat(Guid guid) + { + _guid = guid; + } + + internal Guid Guid + { + get { return _guid; } + } + + /// + /// Determines whether the specified object is equal to the current object. + /// + public override bool Equals(object obj) + { + XImageFormat format = obj as XImageFormat; + if (format == null) + return false; + return _guid == format._guid; + } + + /// + /// Returns the hash code for this instance. + /// + public override int GetHashCode() + { + return _guid.GetHashCode(); + } + + /// + /// Gets the Portable Network Graphics (PNG) image format. + /// + public static XImageFormat Png + { + get { return _png; } + } + + /// + /// Gets the Graphics Interchange Format (GIF) image format. + /// + public static XImageFormat Gif + { + get { return _gif; } + } + + /// + /// Gets the Joint Photographic Experts Group (JPEG) image format. + /// + public static XImageFormat Jpeg + { + get { return _jpeg; } + } + + /// + /// Gets the Tag Image File Format (TIFF) image format. + /// + public static XImageFormat Tiff + { + get { return _tiff; } + } + + /// + /// Gets the Portable Document Format (PDF) image format + /// + public static XImageFormat Pdf + { + get { return _pdf; } + } + + /// + /// Gets the Windows icon image format. + /// + public static XImageFormat Icon + { + get { return _icon; } + } + + readonly Guid _guid; + + // Guids used in GDI+ + //ImageFormat.memoryBMP = new ImageFormat(new Guid("{b96b3caa-0728-11d3-9d7b-0000f81ef32e}")); + //ImageFormat.bmp = new ImageFormat(new Guid("{b96b3cab-0728-11d3-9d7b-0000f81ef32e}")); + //ImageFormat.emf = new ImageFormat(new Guid("{b96b3cac-0728-11d3-9d7b-0000f81ef32e}")); + //ImageFormat.wmf = new ImageFormat(new Guid("{b96b3cad-0728-11d3-9d7b-0000f81ef32e}")); + //ImageFormat.jpeg = new ImageFormat(new Guid("{b96b3cae-0728-11d3-9d7b-0000f81ef32e}")); + //ImageFormat.png = new ImageFormat(new Guid("{b96b3caf-0728-11d3-9d7b-0000f81ef32e}")); + //ImageFormat.gif = new ImageFormat(new Guid("{b96b3cb0-0728-11d3-9d7b-0000f81ef32e}")); + //ImageFormat.tiff = new ImageFormat(new Guid("{b96b3cb1-0728-11d3-9d7b-0000f81ef32e}")); + //ImageFormat.exif = new ImageFormat(new Guid("{b96b3cb2-0728-11d3-9d7b-0000f81ef32e}")); + //ImageFormat.photoCD = new ImageFormat(new Guid("{b96b3cb3-0728-11d3-9d7b-0000f81ef32e}")); + //ImageFormat.flashPIX = new ImageFormat(new Guid("{b96b3cb4-0728-11d3-9d7b-0000f81ef32e}")); + //ImageFormat.icon = new ImageFormat(new Guid("{b96b3cb5-0728-11d3-9d7b-0000f81ef32e}")); + + // #??? Why Guids? + private static readonly XImageFormat _png = new XImageFormat(new Guid("{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}")); + private static readonly XImageFormat _gif = new XImageFormat(new Guid("{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}")); + private static readonly XImageFormat _jpeg = new XImageFormat(new Guid("{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}")); + private static readonly XImageFormat _tiff = new XImageFormat(new Guid("{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}")); + private static readonly XImageFormat _icon = new XImageFormat(new Guid("{B96B3CB5-0728-11D3-9D7B-0000F81EF32E}")); + // not GDI+ conform + private static readonly XImageFormat _pdf = new XImageFormat(new Guid("{84570158-DBF0-4C6B-8368-62D6A3CA76E0}")); + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing/XKnownColorTable.cs b/PdfSharp/Drawing/XKnownColorTable.cs new file mode 100644 index 0000000..acf8c97 --- /dev/null +++ b/PdfSharp/Drawing/XKnownColorTable.cs @@ -0,0 +1,222 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing +{ + internal class XKnownColorTable + { + internal static uint[] ColorTable; + + public static uint KnownColorToArgb(XKnownColor color) + { + if (ColorTable == null) + InitColorTable(); + if (color <= XKnownColor.YellowGreen) + return ColorTable[(int)color]; + return 0; + } + + public static bool IsKnownColor(uint argb) + { + for (int idx = 0; idx < ColorTable.Length; idx++) + { + if (ColorTable[idx] == argb) + return true; + } + return false; + } + + public static XKnownColor GetKnownColor(uint argb) + { + for (int idx = 0; idx < ColorTable.Length; idx++) + { + if (ColorTable[idx] == argb) + return (XKnownColor)idx; + } + return (XKnownColor)(-1); + } + + private static void InitColorTable() + { + // Same values as in GDI+ and System.Windows.Media.XColors + // Note that Magenta is the same as Fuchsia and Zyan is the same as Aqua. + uint[] colors = new uint[141]; + colors[0] = 0xFFF0F8FF; // AliceBlue + colors[1] = 0xFFFAEBD7; // AntiqueWhite + colors[2] = 0xFF00FFFF; // Aqua + colors[3] = 0xFF7FFFD4; // Aquamarine + colors[4] = 0xFFF0FFFF; // Azure + colors[5] = 0xFFF5F5DC; // Beige + colors[6] = 0xFFFFE4C4; // Bisque + colors[7] = 0xFF000000; // Black + colors[8] = 0xFFFFEBCD; // BlanchedAlmond + colors[9] = 0xFF0000FF; // Blue + colors[10] = 0xFF8A2BE2; // BlueViolet + colors[11] = 0xFFA52A2A; // Brown + colors[12] = 0xFFDEB887; // BurlyWood + colors[13] = 0xFF5F9EA0; // CadetBlue + colors[14] = 0xFF7FFF00; // Chartreuse + colors[15] = 0xFFD2691E; // Chocolate + colors[16] = 0xFFFF7F50; // Coral + colors[17] = 0xFF6495ED; // CornflowerBlue + colors[18] = 0xFFFFF8DC; // Cornsilk + colors[19] = 0xFFDC143C; // Crimson + colors[20] = 0xFF00FFFF; // Cyan + colors[21] = 0xFF00008B; // DarkBlue + colors[22] = 0xFF008B8B; // DarkCyan + colors[23] = 0xFFB8860B; // DarkGoldenrod + colors[24] = 0xFFA9A9A9; // DarkGray + colors[25] = 0xFF006400; // DarkGreen + colors[26] = 0xFFBDB76B; // DarkKhaki + colors[27] = 0xFF8B008B; // DarkMagenta + colors[28] = 0xFF556B2F; // DarkOliveGreen + colors[29] = 0xFFFF8C00; // DarkOrange + colors[30] = 0xFF9932CC; // DarkOrchid + colors[31] = 0xFF8B0000; // DarkRed + colors[32] = 0xFFE9967A; // DarkSalmon + colors[33] = 0xFF8FBC8B; // DarkSeaGreen + colors[34] = 0xFF483D8B; // DarkSlateBlue + colors[35] = 0xFF2F4F4F; // DarkSlateGray + colors[36] = 0xFF00CED1; // DarkTurquoise + colors[37] = 0xFF9400D3; // DarkViolet + colors[38] = 0xFFFF1493; // DeepPink + colors[39] = 0xFF00BFFF; // DeepSkyBlue + colors[40] = 0xFF696969; // DimGray + colors[41] = 0xFF1E90FF; // DodgerBlue + colors[42] = 0xFFB22222; // Firebrick + colors[43] = 0xFFFFFAF0; // FloralWhite + colors[44] = 0xFF228B22; // ForestGreen + colors[45] = 0xFFFF00FF; // Fuchsia + colors[46] = 0xFFDCDCDC; // Gainsboro + colors[47] = 0xFFF8F8FF; // GhostWhite + colors[48] = 0xFFFFD700; // Gold + colors[49] = 0xFFDAA520; // Goldenrod + colors[50] = 0xFF808080; // Gray + colors[51] = 0xFF008000; // Green + colors[52] = 0xFFADFF2F; // GreenYellow + colors[53] = 0xFFF0FFF0; // Honeydew + colors[54] = 0xFFFF69B4; // HotPink + colors[55] = 0xFFCD5C5C; // IndianRed + colors[56] = 0xFF4B0082; // Indigo + colors[57] = 0xFFFFFFF0; // Ivory + colors[58] = 0xFFF0E68C; // Khaki + colors[59] = 0xFFE6E6FA; // Lavender + colors[60] = 0xFFFFF0F5; // LavenderBlush + colors[61] = 0xFF7CFC00; // LawnGreen + colors[62] = 0xFFFFFACD; // LemonChiffon + colors[63] = 0xFFADD8E6; // LightBlue + colors[64] = 0xFFF08080; // LightCoral + colors[65] = 0xFFE0FFFF; // LightCyan + colors[66] = 0xFFFAFAD2; // LightGoldenrodYellow + colors[67] = 0xFFD3D3D3; // LightGray + colors[68] = 0xFF90EE90; // LightGreen + colors[69] = 0xFFFFB6C1; // LightPink + colors[70] = 0xFFFFA07A; // LightSalmon + colors[71] = 0xFF20B2AA; // LightSeaGreen + colors[72] = 0xFF87CEFA; // LightSkyBlue + colors[73] = 0xFF778899; // LightSlateGray + colors[74] = 0xFFB0C4DE; // LightSteelBlue + colors[75] = 0xFFFFFFE0; // LightYellow + colors[76] = 0xFF00FF00; // Lime + colors[77] = 0xFF32CD32; // LimeGreen + colors[78] = 0xFFFAF0E6; // Linen + colors[79] = 0xFFFF00FF; // Magenta + colors[80] = 0xFF800000; // Maroon + colors[81] = 0xFF66CDAA; // MediumAquamarine + colors[82] = 0xFF0000CD; // MediumBlue + colors[83] = 0xFFBA55D3; // MediumOrchid + colors[84] = 0xFF9370DB; // MediumPurple + colors[85] = 0xFF3CB371; // MediumSeaGreen + colors[86] = 0xFF7B68EE; // MediumSlateBlue + colors[87] = 0xFF00FA9A; // MediumSpringGreen + colors[88] = 0xFF48D1CC; // MediumTurquoise + colors[89] = 0xFFC71585; // MediumVioletRed + colors[90] = 0xFF191970; // MidnightBlue + colors[91] = 0xFFF5FFFA; // MintCream + colors[92] = 0xFFFFE4E1; // MistyRose + colors[93] = 0xFFFFE4B5; // Moccasin + colors[94] = 0xFFFFDEAD; // NavajoWhite + colors[95] = 0xFF000080; // Navy + colors[96] = 0xFFFDF5E6; // OldLace + colors[97] = 0xFF808000; // Olive + colors[98] = 0xFF6B8E23; // OliveDrab + colors[99] = 0xFFFFA500; // Orange + colors[100] = 0xFFFF4500; // OrangeRed + colors[101] = 0xFFDA70D6; // Orchid + colors[102] = 0xFFEEE8AA; // PaleGoldenrod + colors[103] = 0xFF98FB98; // PaleGreen + colors[104] = 0xFFAFEEEE; // PaleTurquoise + colors[105] = 0xFFDB7093; // PaleVioletRed + colors[106] = 0xFFFFEFD5; // PapayaWhip + colors[107] = 0xFFFFDAB9; // PeachPuff + colors[108] = 0xFFCD853F; // Peru + colors[109] = 0xFFFFC0CB; // Pink + colors[110] = 0xFFDDA0DD; // Plum + colors[111] = 0xFFB0E0E6; // PowderBlue + colors[112] = 0xFF800080; // Purple + colors[113] = 0xFFFF0000; // Red + colors[114] = 0xFFBC8F8F; // RosyBrown + colors[115] = 0xFF4169E1; // RoyalBlue + colors[116] = 0xFF8B4513; // SaddleBrown + colors[117] = 0xFFFA8072; // Salmon + colors[118] = 0xFFF4A460; // SandyBrown + colors[119] = 0xFF2E8B57; // SeaGreen + colors[120] = 0xFFFFF5EE; // SeaShell + colors[121] = 0xFFA0522D; // Sienna + colors[122] = 0xFFC0C0C0; // Silver + colors[123] = 0xFF87CEEB; // SkyBlue + colors[124] = 0xFF6A5ACD; // SlateBlue + colors[125] = 0xFF708090; // SlateGray + colors[126] = 0xFFFFFAFA; // Snow + colors[127] = 0xFF00FF7F; // SpringGreen + colors[128] = 0xFF4682B4; // SteelBlue + colors[129] = 0xFFD2B48C; // Tan + colors[130] = 0xFF008080; // Teal + colors[131] = 0xFFD8BFD8; // Thistle + colors[132] = 0xFFFF6347; // Tomato + colors[133] = 0x00FFFFFF; // Transparent + colors[134] = 0xFF40E0D0; // Turquoise + colors[135] = 0xFFEE82EE; // Violet + colors[136] = 0xFFF5DEB3; // Wheat + colors[137] = 0xFFFFFFFF; // White + colors[138] = 0xFFF5F5F5; // WhiteSmoke + colors[139] = 0xFFFFFF00; // Yellow + colors[140] = 0xFF9ACD32; // YellowGreen + + ColorTable = colors; + } + } +} diff --git a/PdfSharp/Drawing/XLinearGradientBrush.cs b/PdfSharp/Drawing/XLinearGradientBrush.cs new file mode 100644 index 0000000..1b421a2 --- /dev/null +++ b/PdfSharp/Drawing/XLinearGradientBrush.cs @@ -0,0 +1,393 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.ComponentModel; +using PdfSharp.Internal; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using GdiLinearGradientBrush = System.Drawing.Drawing2D.LinearGradientBrush; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +using SysPoint = System.Windows.Point; +using SysSize = System.Windows.Size; +using SysRect = System.Windows.Rect; +using WpfBrush = System.Windows.Media.Brush; +using WpfLinearGradientBrush = System.Windows.Media.LinearGradientBrush; +#endif +#if UWP +using Windows.UI; +using Windows.UI.Xaml.Media; +using Microsoft.Graphics.Canvas; +using Microsoft.Graphics.Canvas.Brushes; +#endif + +// ReSharper disable RedundantNameQualifier because it is required for hybrid build + +namespace PdfSharp.Drawing +{ + /// + /// Defines a Brush with a linear gradient. + /// + public sealed class XLinearGradientBrush : XBrush + { +#if GDI + /// + /// Initializes a new instance of the class. + /// + public XLinearGradientBrush(System.Drawing.Point point1, System.Drawing.Point point2, XColor color1, XColor color2) + : this(new XPoint(point1), new XPoint(point2), color1, color2) + { } + + /// + /// Initializes a new instance of the class. + /// + public XLinearGradientBrush(PointF point1, PointF point2, XColor color1, XColor color2) + : this(new XPoint(point1), new XPoint(point2), color1, color2) + { } +#endif + +#if WPF + /// + /// Initializes a new instance of the class. + /// + public XLinearGradientBrush(SysPoint point1, SysPoint point2, XColor color1, XColor color2) + : this(new XPoint(point1), new XPoint(point2), color1, color2) + { } +#endif + + /// + /// Initializes a new instance of the class. + /// + public XLinearGradientBrush(XPoint point1, XPoint point2, XColor color1, XColor color2) + { + _point1 = point1; + _point2 = point2; + _color1 = color1; + _color2 = color2; + } + +#if GDI + /// + /// Initializes a new instance of the class. + /// + public XLinearGradientBrush(Rectangle rect, XColor color1, XColor color2, XLinearGradientMode linearGradientMode) + : this(new XRect(rect), color1, color2, linearGradientMode) + { } + + /// + /// Initializes a new instance of the class. + /// + public XLinearGradientBrush(RectangleF rect, XColor color1, XColor color2, XLinearGradientMode linearGradientMode) + : this(new XRect(rect), color1, color2, linearGradientMode) + { } +#endif + +#if WPF + /// + /// Initializes a new instance of the class. + /// + public XLinearGradientBrush(Rect rect, XColor color1, XColor color2, XLinearGradientMode linearGradientMode) + : this(new XRect(rect), color1, color2, linearGradientMode) + { } +#endif + + /// + /// Initializes a new instance of the class. + /// + public XLinearGradientBrush(XRect rect, XColor color1, XColor color2, XLinearGradientMode linearGradientMode) + { + if (!Enum.IsDefined(typeof(XLinearGradientMode), linearGradientMode)) + throw new InvalidEnumArgumentException("linearGradientMode", (int)linearGradientMode, typeof(XLinearGradientMode)); + + if (rect.Width == 0 || rect.Height == 0) + throw new ArgumentException("Invalid rectangle.", "rect"); + + _useRect = true; + _color1 = color1; + _color2 = color2; + _rect = rect; + _linearGradientMode = linearGradientMode; + } + + // TODO: + //public XLinearGradientBrush(Rectangle rect, XColor color1, XColor color2, double angle); + //public XLinearGradientBrush(RectangleF rect, XColor color1, XColor color2, double angle); + //public XLinearGradientBrush(Rectangle rect, XColor color1, XColor color2, double angle, bool isAngleScaleable); + //public XLinearGradientBrush(RectangleF rect, XColor color1, XColor color2, double angle, bool isAngleScaleable); + //public XLinearGradientBrush(RectangleF rect, XColor color1, XColor color2, double angle, bool isAngleScaleable); + + //private Blend _GetBlend(); + //private ColorBlend _GetInterpolationColors(); + //private XColor[] _GetLinearColors(); + //private RectangleF _GetRectangle(); + //private Matrix _GetTransform(); + //private WrapMode _GetWrapMode(); + //private void _SetBlend(Blend blend); + //private void _SetInterpolationColors(ColorBlend blend); + //private void _SetLinearColors(XColor color1, XColor color2); + //private void _SetTransform(Matrix matrix); + //private void _SetWrapMode(WrapMode wrapMode); + + //public override object Clone(); + + /// + /// Gets or sets an XMatrix that defines a local geometric transform for this LinearGradientBrush. + /// + public XMatrix Transform + { + get { return _matrix; } + set { _matrix = value; } + } + + /// + /// Translates the brush with the specified offset. + /// + public void TranslateTransform(double dx, double dy) + { + _matrix.TranslatePrepend(dx, dy); + } + + /// + /// Translates the brush with the specified offset. + /// + public void TranslateTransform(double dx, double dy, XMatrixOrder order) + { + _matrix.Translate(dx, dy, order); + } + + /// + /// Scales the brush with the specified scalars. + /// + public void ScaleTransform(double sx, double sy) + { + _matrix.ScalePrepend(sx, sy); + } + + /// + /// Scales the brush with the specified scalars. + /// + public void ScaleTransform(double sx, double sy, XMatrixOrder order) + { + _matrix.Scale(sx, sy, order); + } + + /// + /// Rotates the brush with the specified angle. + /// + public void RotateTransform(double angle) + { + _matrix.RotatePrepend(angle); + } + + /// + /// Rotates the brush with the specified angle. + /// + public void RotateTransform(double angle, XMatrixOrder order) + { + _matrix.Rotate(angle, order); + } + + /// + /// Multiply the brush transformation matrix with the specified matrix. + /// + public void MultiplyTransform(XMatrix matrix) + { + _matrix.Prepend(matrix); + } + + /// + /// Multiply the brush transformation matrix with the specified matrix. + /// + public void MultiplyTransform(XMatrix matrix, XMatrixOrder order) + { + _matrix.Multiply(matrix, order); + } + + /// + /// Resets the brush transformation matrix with identity matrix. + /// + public void ResetTransform() + { + _matrix = new XMatrix(); + } + + //public void SetBlendTriangularShape(double focus); + //public void SetBlendTriangularShape(double focus, double scale); + //public void SetSigmaBellShape(double focus); + //public void SetSigmaBellShape(double focus, double scale); + +#if GDI + internal override System.Drawing.Brush RealizeGdiBrush() + { + //if (dirty) + //{ + // if (brush == null) + // brush = new SolidBrush(color.ToGdiColor()); + // else + // { + // brush.Color = color.ToGdiColor(); + // } + // dirty = false; + //} + + // TODO: use dirty to optimize code + GdiLinearGradientBrush brush; + try + { + Lock.EnterGdiPlus(); + if (_useRect) + { + brush = new GdiLinearGradientBrush(_rect.ToRectangleF(), + _color1.ToGdiColor(), _color2.ToGdiColor(), (LinearGradientMode)_linearGradientMode); + } + else + { + brush = new GdiLinearGradientBrush( + _point1.ToPointF(), _point2.ToPointF(), + _color1.ToGdiColor(), _color2.ToGdiColor()); + } + if (!_matrix.IsIdentity) + brush.Transform = _matrix.ToGdiMatrix(); + //brush.WrapMode = WrapMode.Clamp; + } + finally { Lock.ExitGdiPlus(); } + return brush; + } +#endif + +#if WPF + internal override WpfBrush RealizeWpfBrush() + { + //if (dirty) + //{ + // if (brush == null) + // brush = new SolidBrush(color.ToGdiColor()); + // else + // { + // brush.Color = color.ToGdiColor(); + // } + // dirty = false; + //} + + WpfLinearGradientBrush brush; + if (_useRect) + { +#if !SILVERLIGHT + brush = new WpfLinearGradientBrush(_color1.ToWpfColor(), _color2.ToWpfColor(), new SysPoint(0, 0), new SysPoint(1, 1));// rect.TopLeft, this.rect.BottomRight); + //brush = new System.Drawing.Drawing2D.LinearGradientBrush(rect.ToRectangleF(), + // color1.ToGdiColor(), color2.ToGdiColor(), (LinearGradientMode)linearGradientMode); +#else + GradientStop gs1 = new GradientStop(); + gs1.Color = _color1.ToWpfColor(); + gs1.Offset = 0; + + GradientStop gs2 = new GradientStop(); + gs2.Color = _color2.ToWpfColor(); + gs2.Offset = 1; + + GradientStopCollection gsc = new GradientStopCollection(); + gsc.Add(gs1); + gsc.Add(gs2); + + brush = new LinearGradientBrush(gsc, 0); + brush.StartPoint = new Point(0, 0); + brush.EndPoint = new Point(1, 1); +#endif + } + else + { +#if !SILVERLIGHT + brush = new System.Windows.Media.LinearGradientBrush(_color1.ToWpfColor(), _color2.ToWpfColor(), _point1, _point2); + //brush = new System.Drawing.Drawing2D.LinearGradientBrush( + // point1.ToPointF(), point2.ToPointF(), + // color1.ToGdiColor(), color2.ToGdiColor()); +#else + GradientStop gs1 = new GradientStop(); + gs1.Color = _color1.ToWpfColor(); + gs1.Offset = 0; + + GradientStop gs2 = new GradientStop(); + gs2.Color = _color2.ToWpfColor(); + gs2.Offset = 1; + + GradientStopCollection gsc = new GradientStopCollection(); + gsc.Add(gs1); + gsc.Add(gs2); + + brush = new LinearGradientBrush(gsc, 0); + brush.StartPoint = _point1; + brush.EndPoint = _point2; +#endif + } + if (!_matrix.IsIdentity) + { +#if !SILVERLIGHT + brush.Transform = new MatrixTransform(_matrix.ToWpfMatrix()); +#else + MatrixTransform transform = new MatrixTransform(); + transform.Matrix = _matrix.ToWpfMatrix(); + brush.Transform = transform; +#endif + } + return brush; + } +#endif + +#if UWP + internal override ICanvasBrush RealizeCanvasBrush() + { + ICanvasBrush brush; + + brush = new CanvasSolidColorBrush(CanvasDevice.GetSharedDevice(), Colors.RoyalBlue); + + return brush; + } +#endif + + //public Blend Blend { get; set; } + //public bool GammaCorrection { get; set; } + //public ColorBlend InterpolationColors { get; set; } + //public XColor[] LinearColors { get; set; } + //public RectangleF Rectangle { get; } + //public WrapMode WrapMode { get; set; } + //private bool interpolationColorsWasSet; + + internal bool _useRect; + internal XPoint _point1, _point2; + internal XColor _color1, _color2; + internal XRect _rect; + internal XLinearGradientMode _linearGradientMode; + + internal XMatrix _matrix; + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing/XMatrix.cs b/PdfSharp/Drawing/XMatrix.cs new file mode 100644 index 0000000..1b555d6 --- /dev/null +++ b/PdfSharp/Drawing/XMatrix.cs @@ -0,0 +1,1557 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using System.Runtime.InteropServices; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +#endif +#if !EDF_CORE +using PdfSharp.Internal; +#else +using PdfSharp.Internal; +#endif + +// ReSharper disable RedundantNameQualifier +#if !EDF_CORE +namespace PdfSharp.Drawing +#else +namespace Edf.Drawing +#endif +{ + /// + /// Represents a 3-by-3 matrix that represents an affine 2D transformation. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + [Serializable, StructLayout(LayoutKind.Sequential)] //, TypeConverter(typeof(MatrixConverter)), ValueSerializer(typeof(MatrixValueSerializer))] + public struct XMatrix : IFormattable + { + [Flags] + internal enum XMatrixTypes + { + Identity = 0, + Translation = 1, + Scaling = 2, + Unknown = 4 + } + + /// + /// Initializes a new instance of the XMatrix struct. + /// + public XMatrix(double m11, double m12, double m21, double m22, double offsetX, double offsetY) + { + _m11 = m11; + _m12 = m12; + _m21 = m21; + _m22 = m22; + _offsetX = offsetX; + _offsetY = offsetY; + _type = XMatrixTypes.Unknown; + //_padding = 0; + DeriveMatrixType(); + } + + /// + /// Gets the identity matrix. + /// + public static XMatrix Identity + { + get { return s_identity; } + } + + /// + /// Sets this matrix into an identity matrix. + /// + public void SetIdentity() + { + _type = XMatrixTypes.Identity; + } + + /// + /// Gets a value indicating whether this matrix instance is the identity matrix. + /// + public bool IsIdentity + { + get + { + // ReSharper disable CompareOfFloatsByEqualityOperator + if (_type == XMatrixTypes.Identity) + return true; + if (_m11 == 1.0 && _m12 == 0 && _m21 == 0 && _m22 == 1.0 && _offsetX == 0 && _offsetY == 0) + { + _type = XMatrixTypes.Identity; + return true; + } + return false; + // ReSharper restore CompareOfFloatsByEqualityOperator + } + } + + ///// + ///// Gets an array of double values that represents the elements of this matrix. + ///// + //[Obsolete("Use GetElements().")] + //public double[] Elements + //{ + // get { return GetElements(); } + //} + + /// + /// Gets an array of double values that represents the elements of this matrix. + /// + public double[] GetElements() + { + if (_type == XMatrixTypes.Identity) + return new double[] { 1, 0, 0, 1, 0, 0 }; + return new double[] { _m11, _m12, _m21, _m22, _offsetX, _offsetY }; + } + + /// + /// Multiplies two matrices. + /// + public static XMatrix operator *(XMatrix trans1, XMatrix trans2) + { + MatrixHelper.MultiplyMatrix(ref trans1, ref trans2); + return trans1; + } + + /// + /// Multiplies two matrices. + /// + public static XMatrix Multiply(XMatrix trans1, XMatrix trans2) + { + MatrixHelper.MultiplyMatrix(ref trans1, ref trans2); + return trans1; + } + + /// + /// Appends the specified matrix to this matrix. + /// + public void Append(XMatrix matrix) + { + this *= matrix; + } + + /// + /// Prepends the specified matrix to this matrix. + /// + public void Prepend(XMatrix matrix) + { + this = matrix * this; + } + + /// + /// Appends the specified matrix to this matrix. + /// + [Obsolete("Use Append.")] + public void Multiply(XMatrix matrix) + { + Append(matrix); + } + + /// + /// Prepends the specified matrix to this matrix. + /// + [Obsolete("Use Prepend.")] + public void MultiplyPrepend(XMatrix matrix) + { + Prepend(matrix); + } + + /// + /// Multiplies this matrix with the specified matrix. + /// + public void Multiply(XMatrix matrix, XMatrixOrder order) + { + if (_type == XMatrixTypes.Identity) + this = CreateIdentity(); + + // Must use properties, the fields can be invalid if the matrix is identity matrix. + double t11 = M11; + double t12 = M12; + double t21 = M21; + double t22 = M22; + double tdx = OffsetX; + double tdy = OffsetY; + + if (order == XMatrixOrder.Append) + { + _m11 = t11 * matrix.M11 + t12 * matrix.M21; + _m12 = t11 * matrix.M12 + t12 * matrix.M22; + _m21 = t21 * matrix.M11 + t22 * matrix.M21; + _m22 = t21 * matrix.M12 + t22 * matrix.M22; + _offsetX = tdx * matrix.M11 + tdy * matrix.M21 + matrix.OffsetX; + _offsetY = tdx * matrix.M12 + tdy * matrix.M22 + matrix.OffsetY; + } + else + { + _m11 = t11 * matrix.M11 + t21 * matrix.M12; + _m12 = t12 * matrix.M11 + t22 * matrix.M12; + _m21 = t11 * matrix.M21 + t21 * matrix.M22; + _m22 = t12 * matrix.M21 + t22 * matrix.M22; + _offsetX = t11 * matrix.OffsetX + t21 * matrix.OffsetY + tdx; + _offsetY = t12 * matrix.OffsetX + t22 * matrix.OffsetY + tdy; + } + DeriveMatrixType(); + } + + /// + /// Appends a translation of the specified offsets to this matrix. + /// + [Obsolete("Use TranslateAppend or TranslatePrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] + public void Translate(double offsetX, double offsetY) + { + throw new InvalidOperationException("Temporarily out of order."); + //if (_type == XMatrixTypes.Identity) + //{ + // SetMatrix(1.0, 0, 0, 1.0, offsetX, offsetY, XMatrixTypes.Translation); + //} + //else if (_type == XMatrixTypes.Unknown) + //{ + // _offsetX += offsetX; + // _offsetY += offsetY; + //} + //else + //{ + // _offsetX += offsetX; + // _offsetY += offsetY; + // _type |= XMatrixTypes.Translation; + //} + } + + /// + /// Appends a translation of the specified offsets to this matrix. + /// + public void TranslateAppend(double offsetX, double offsetY) // TODO: will become default + { + if (_type == XMatrixTypes.Identity) + { + SetMatrix(1, 0, 0, 1, offsetX, offsetY, XMatrixTypes.Translation); + } + else if (_type == XMatrixTypes.Unknown) + { + _offsetX += offsetX; + _offsetY += offsetY; + } + else + { + _offsetX += offsetX; + _offsetY += offsetY; + _type |= XMatrixTypes.Translation; + } + } + + /// + /// Prepends a translation of the specified offsets to this matrix. + /// + public void TranslatePrepend(double offsetX, double offsetY) + { + this = CreateTranslation(offsetX, offsetY) * this; + } + + /// + /// Translates the matrix with the specified offsets. + /// + public void Translate(double offsetX, double offsetY, XMatrixOrder order) + { + if (_type == XMatrixTypes.Identity) + this = CreateIdentity(); + + if (order == XMatrixOrder.Append) + { + _offsetX += offsetX; + _offsetY += offsetY; + } + else + { + _offsetX += offsetX * _m11 + offsetY * _m21; + _offsetY += offsetX * _m12 + offsetY * _m22; + } + DeriveMatrixType(); + } + + /// + /// Appends the specified scale vector to this matrix. + /// + [Obsolete("Use ScaleAppend or ScalePrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] + public void Scale(double scaleX, double scaleY) + { + this = CreateScaling(scaleX, scaleY) * this; + } + + /// + /// Appends the specified scale vector to this matrix. + /// + public void ScaleAppend(double scaleX, double scaleY) // TODO: will become default + { + this *= CreateScaling(scaleX, scaleY); + } + + /// + /// Prepends the specified scale vector to this matrix. + /// + public void ScalePrepend(double scaleX, double scaleY) + { + this = CreateScaling(scaleX, scaleY) * this; + } + + /// + /// Scales the matrix with the specified scalars. + /// + public void Scale(double scaleX, double scaleY, XMatrixOrder order) + { + if (_type == XMatrixTypes.Identity) + this = CreateIdentity(); + + if (order == XMatrixOrder.Append) + { + _m11 *= scaleX; + _m12 *= scaleY; + _m21 *= scaleX; + _m22 *= scaleY; + _offsetX *= scaleX; + _offsetY *= scaleY; + } + else + { + _m11 *= scaleX; + _m12 *= scaleX; + _m21 *= scaleY; + _m22 *= scaleY; + } + DeriveMatrixType(); + } + + /// + /// Scales the matrix with the specified scalar. + /// + [Obsolete("Use ScaleAppend or ScalePrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] + // ReSharper disable InconsistentNaming + public void Scale(double scaleXY) + // ReSharper restore InconsistentNaming + { + throw new InvalidOperationException("Temporarily out of order."); + //Scale(scaleXY, scaleXY, XMatrixOrder.Prepend); + } + + /// + /// Appends the specified scale vector to this matrix. + /// + // ReSharper disable InconsistentNaming + public void ScaleAppend(double scaleXY) + // ReSharper restore InconsistentNaming + { + Scale(scaleXY, scaleXY, XMatrixOrder.Append); + } + + /// + /// Prepends the specified scale vector to this matrix. + /// + // ReSharper disable InconsistentNaming + public void ScalePrepend(double scaleXY) + // ReSharper restore InconsistentNaming + { + Scale(scaleXY, scaleXY, XMatrixOrder.Prepend); + } + + /// + /// Scales the matrix with the specified scalar. + /// + // ReSharper disable InconsistentNaming + public void Scale(double scaleXY, XMatrixOrder order) + // ReSharper restore InconsistentNaming + { + Scale(scaleXY, scaleXY, order); + } + + /// + /// Function is obsolete. + /// + [Obsolete("Use ScaleAtAppend or ScaleAtPrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] + public void ScaleAt(double scaleX, double scaleY, double centerX, double centerY) + { + throw new InvalidOperationException("Temporarily out of order."); + //this *= CreateScaling(scaleX, scaleY, centerX, centerY); + } + + /// + /// Apppends the specified scale about the specified point of this matrix. + /// + public void ScaleAtAppend(double scaleX, double scaleY, double centerX, double centerY) // TODO: will become default + { + this *= CreateScaling(scaleX, scaleY, centerX, centerY); + } + + /// + /// Prepends the specified scale about the specified point of this matrix. + /// + public void ScaleAtPrepend(double scaleX, double scaleY, double centerX, double centerY) + { + this = CreateScaling(scaleX, scaleY, centerX, centerY) * this; + } + + /// + /// Function is obsolete. + /// + [Obsolete("Use RotateAppend or RotatePrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] + public void Rotate(double angle) + { + throw new InvalidOperationException("Temporarily out of order."); + //angle = angle % 360.0; + //this *= CreateRotationRadians(angle * Const.Deg2Rad); + } + + /// + /// Appends a rotation of the specified angle to this matrix. + /// + public void RotateAppend(double angle) // TODO: will become default Rotate + { + angle = angle % 360.0; + this *= CreateRotationRadians(angle * Const.Deg2Rad); + } + + /// + /// Prepends a rotation of the specified angle to this matrix. + /// + public void RotatePrepend(double angle) + { + angle = angle % 360.0; + this = CreateRotationRadians(angle * Const.Deg2Rad) * this; + } + + /// + /// Rotates the matrix with the specified angle. + /// + public void Rotate(double angle, XMatrixOrder order) + { + if (_type == XMatrixTypes.Identity) + this = CreateIdentity(); + + angle = angle * Const.Deg2Rad; + double cos = Math.Cos(angle); + double sin = Math.Sin(angle); + if (order == XMatrixOrder.Append) + { + double t11 = _m11; + double t12 = _m12; + double t21 = _m21; + double t22 = _m22; + double tdx = _offsetX; + double tdy = _offsetY; + _m11 = t11 * cos - t12 * sin; + _m12 = t11 * sin + t12 * cos; + _m21 = t21 * cos - t22 * sin; + _m22 = t21 * sin + t22 * cos; + _offsetX = tdx * cos - tdy * sin; + _offsetY = tdx * sin + tdy * cos; + } + else + { + double t11 = _m11; + double t12 = _m12; + double t21 = _m21; + double t22 = _m22; + _m11 = t11 * cos + t21 * sin; + _m12 = t12 * cos + t22 * sin; + _m21 = -t11 * sin + t21 * cos; + _m22 = -t12 * sin + t22 * cos; + } + DeriveMatrixType(); + } + + /// + /// Function is obsolete. + /// + [Obsolete("Use RotateAtAppend or RotateAtPrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] + public void RotateAt(double angle, double centerX, double centerY) + { + throw new InvalidOperationException("Temporarily out of order."); + //angle = angle % 360.0; + //this *= CreateRotationRadians(angle * Const.Deg2Rad, centerX, centerY); + } + + /// + /// Appends a rotation of the specified angle at the specified point to this matrix. + /// + public void RotateAtAppend(double angle, double centerX, double centerY) // TODO: will become default + { + angle = angle % 360.0; + this *= CreateRotationRadians(angle * Const.Deg2Rad, centerX, centerY); + } + + /// + /// Prepends a rotation of the specified angle at the specified point to this matrix. + /// + public void RotateAtPrepend(double angle, double centerX, double centerY) + { + angle = angle % 360.0; + this = CreateRotationRadians(angle * Const.Deg2Rad, centerX, centerY) * this; + } + + /// + /// Rotates the matrix with the specified angle at the specified point. + /// + [Obsolete("Use RotateAtAppend or RotateAtPrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] + public void RotateAt(double angle, XPoint point) + { + throw new InvalidOperationException("Temporarily out of order."); + //RotateAt(angle, point, XMatrixOrder.Prepend); + } + + /// + /// Appends a rotation of the specified angle at the specified point to this matrix. + /// + public void RotateAtAppend(double angle, XPoint point) + { + RotateAt(angle, point, XMatrixOrder.Append); + } + + /// + /// Prepends a rotation of the specified angle at the specified point to this matrix. + /// + public void RotateAtPrepend(double angle, XPoint point) + { + RotateAt(angle, point, XMatrixOrder.Prepend); + } + + /// + /// Rotates the matrix with the specified angle at the specified point. + /// + public void RotateAt(double angle, XPoint point, XMatrixOrder order) + { + if (order == XMatrixOrder.Append) + { + angle = angle % 360.0; + this *= CreateRotationRadians(angle * Const.Deg2Rad, point.X, point.Y); + + //Translate(point.X, point.Y, order); + //Rotate(angle, order); + //Translate(-point.X, -point.Y, order); + } + else + { + angle = angle % 360.0; + this = CreateRotationRadians(angle * Const.Deg2Rad, point.X, point.Y) * this; + } + DeriveMatrixType(); + } + + /// + /// Function is obsolete. + /// + [Obsolete("Use ShearAppend or ShearPrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] + public void Shear(double shearX, double shearY) + { + throw new InvalidOperationException("Temporarily out of order."); + //Shear(shearX, shearY, XMatrixOrder.Prepend); + } + + /// + /// Appends a skew of the specified degrees in the x and y dimensions to this matrix. + /// + public void ShearAppend(double shearX, double shearY) // TODO: will become default + { + Shear(shearX, shearY, XMatrixOrder.Append); + } + + /// + /// Prepends a skew of the specified degrees in the x and y dimensions to this matrix. + /// + public void ShearPrepend(double shearX, double shearY) + { + Shear(shearX, shearY, XMatrixOrder.Prepend); + } + + /// + /// Shears the matrix with the specified scalars. + /// + public void Shear(double shearX, double shearY, XMatrixOrder order) + { + if (_type == XMatrixTypes.Identity) + this = CreateIdentity(); + + double t11 = _m11; + double t12 = _m12; + double t21 = _m21; + double t22 = _m22; + double tdx = _offsetX; + double tdy = _offsetY; + if (order == XMatrixOrder.Append) + { + _m11 += shearX * t12; + _m12 += shearY * t11; + _m21 += shearX * t22; + _m22 += shearY * t21; + _offsetX += shearX * tdy; + _offsetY += shearY * tdx; + } + else + { + _m11 += shearY * t21; + _m12 += shearY * t22; + _m21 += shearX * t11; + _m22 += shearX * t12; + } + DeriveMatrixType(); + } + + /// + /// Function is obsolete. + /// + [Obsolete("Use SkewAppend or SkewPrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] + public void Skew(double skewX, double skewY) + { + throw new InvalidOperationException("Temporarily out of order."); + //skewX = skewX % 360.0; + //skewY = skewY % 360.0; + //this *= CreateSkewRadians(skewX * Const.Deg2Rad, skewY * Const.Deg2Rad); + } + + /// + /// Appends a skew of the specified degrees in the x and y dimensions to this matrix. + /// + public void SkewAppend(double skewX, double skewY) + { + skewX = skewX % 360.0; + skewY = skewY % 360.0; + this *= CreateSkewRadians(skewX * Const.Deg2Rad, skewY * Const.Deg2Rad); + } + + /// + /// Prepends a skew of the specified degrees in the x and y dimensions to this matrix. + /// + public void SkewPrepend(double skewX, double skewY) + { + skewX = skewX % 360.0; + skewY = skewY % 360.0; + this = CreateSkewRadians(skewX * Const.Deg2Rad, skewY * Const.Deg2Rad) * this; + } + + /// + /// Transforms the specified point by this matrix and returns the result. + /// + public XPoint Transform(XPoint point) + { + double x = point.X; + double y = point.Y; + MultiplyPoint(ref x, ref y); + return new XPoint(x, y); + } + + /// + /// Transforms the specified points by this matrix. + /// + public void Transform(XPoint[] points) + { + if (points != null) + { + int count = points.Length; + for (int idx = 0; idx < count; idx++) + { + double x = points[idx].X; + double y = points[idx].Y; + MultiplyPoint(ref x, ref y); + points[idx].X = x; + points[idx].Y = y; + } + } + } + + /// + /// Multiplies all points of the specified array with the this matrix. + /// + public void TransformPoints(XPoint[] points) + { + if (points == null) + throw new ArgumentNullException("points"); + + if (IsIdentity) + return; + + int count = points.Length; + for (int idx = 0; idx < count; idx++) + { + double x = points[idx].X; + double y = points[idx].Y; + points[idx].X = x * _m11 + y * _m21 + _offsetX; + points[idx].Y = x * _m12 + y * _m22 + _offsetY; + } + } + +#if GDI + /// + /// Multiplies all points of the specified array with the this matrix. + /// + public void TransformPoints(System.Drawing.Point[] points) + { + if (points == null) + throw new ArgumentNullException("points"); + + if (IsIdentity) + return; + + int count = points.Length; + for (int idx = 0; idx < count; idx++) + { + double x = points[idx].X; + double y = points[idx].Y; + points[idx].X = (int)(x * _m11 + y * _m21 + _offsetX); + points[idx].Y = (int)(x * _m12 + y * _m22 + _offsetY); + } + } +#endif + +#if WPF + /// + /// Transforms an array of points. + /// + public void TransformPoints(System.Windows.Point[] points) + { + if (points == null) + throw new ArgumentNullException("points"); + + if (IsIdentity) + return; + + int count = points.Length; + for (int idx = 0; idx < count; idx++) + { + double x = points[idx].X; + double y = points[idx].Y; + points[idx].X = (int)(x * _m11 + y * _m21 + _offsetX); + points[idx].Y = (int)(x * _m12 + y * _m22 + _offsetY); + } + } +#endif + + /// + /// Transforms the specified vector by this Matrix and returns the result. + /// + public XVector Transform(XVector vector) + { + double x = vector.X; + double y = vector.Y; + MultiplyVector(ref x, ref y); + return new XVector(x, y); + } + + /// + /// Transforms the specified vectors by this matrix. + /// + public void Transform(XVector[] vectors) + { + if (vectors != null) + { + int count = vectors.Length; + for (int idx = 0; idx < count; idx++) + { + double x = vectors[idx].X; + double y = vectors[idx].Y; + MultiplyVector(ref x, ref y); + vectors[idx].X = x; + vectors[idx].Y = y; + } + } + } + +#if GDI + /// + /// Multiplies all vectors of the specified array with the this matrix. The translation elements + /// of this matrix (third row) are ignored. + /// + public void TransformVectors(PointF[] points) + { + if (points == null) + throw new ArgumentNullException("points"); + + if (IsIdentity) + return; + + int count = points.Length; + for (int idx = 0; idx < count; idx++) + { + double x = points[idx].X; + double y = points[idx].Y; + points[idx].X = (float)(x * _m11 + y * _m21 + _offsetX); + points[idx].Y = (float)(x * _m12 + y * _m22 + _offsetY); + } + } +#endif + + /// + /// Gets the determinant of this matrix. + /// + public double Determinant + { + get + { + switch (_type) + { + case XMatrixTypes.Identity: + case XMatrixTypes.Translation: + return 1.0; + + case XMatrixTypes.Scaling: + case XMatrixTypes.Scaling | XMatrixTypes.Translation: + return _m11 * _m22; + } + return (_m11 * _m22) - (_m12 * _m21); + } + } + + /// + /// Gets a value that indicates whether this matrix is invertible. + /// + public bool HasInverse + { + get { return !DoubleUtil.IsZero(Determinant); } + } + + /// + /// Inverts the matrix. + /// + public void Invert() + { + double determinant = Determinant; + if (DoubleUtil.IsZero(determinant)) + throw new InvalidOperationException("NotInvertible"); //SR.Get(SRID.Transform_NotInvertible, new object[0])); + + switch (_type) + { + case XMatrixTypes.Identity: + break; + + case XMatrixTypes.Translation: + _offsetX = -_offsetX; + _offsetY = -_offsetY; + return; + + case XMatrixTypes.Scaling: + _m11 = 1.0 / _m11; + _m22 = 1.0 / _m22; + return; + + case XMatrixTypes.Scaling | XMatrixTypes.Translation: + _m11 = 1.0 / _m11; + _m22 = 1.0 / _m22; + _offsetX = -_offsetX * _m11; + _offsetY = -_offsetY * _m22; + return; + + default: + { + double detInvers = 1.0 / determinant; + SetMatrix(_m22 * detInvers, -_m12 * detInvers, -_m21 * detInvers, _m11 * detInvers, (_m21 * _offsetY - _offsetX * _m22) * detInvers, (_offsetX * _m12 - _m11 * _offsetY) * detInvers, XMatrixTypes.Unknown); + break; + } + } + } + + /// + /// Gets or sets the value of the first row and first column of this matrix. + /// + public double M11 + { + get + { + if (_type == XMatrixTypes.Identity) + return 1.0; + return _m11; + } + set + { + if (_type == XMatrixTypes.Identity) + SetMatrix(value, 0, 0, 1, 0, 0, XMatrixTypes.Scaling); + else + { + _m11 = value; + if (_type != XMatrixTypes.Unknown) + _type |= XMatrixTypes.Scaling; + } + } + } + + /// + /// Gets or sets the value of the first row and second column of this matrix. + /// + public double M12 + { + get + { + if (_type == XMatrixTypes.Identity) + return 0; + return _m12; + } + set + { + if (_type == XMatrixTypes.Identity) + SetMatrix(1, value, 0, 1, 0, 0, XMatrixTypes.Unknown); + else + { + _m12 = value; + _type = XMatrixTypes.Unknown; + } + } + } + + /// + /// Gets or sets the value of the second row and first column of this matrix. + /// + public double M21 + { + get + { + if (_type == XMatrixTypes.Identity) + return 0; + return _m21; + } + set + { + if (_type == XMatrixTypes.Identity) + SetMatrix(1, 0, value, 1, 0, 0, XMatrixTypes.Unknown); + else + { + _m21 = value; + _type = XMatrixTypes.Unknown; + } + } + } + + /// + /// Gets or sets the value of the second row and second column of this matrix. + /// + public double M22 + { + get + { + if (_type == XMatrixTypes.Identity) + return 1.0; + return _m22; + } + set + { + if (_type == XMatrixTypes.Identity) + SetMatrix(1, 0, 0, value, 0, 0, XMatrixTypes.Scaling); + else + { + _m22 = value; + if (_type != XMatrixTypes.Unknown) + _type |= XMatrixTypes.Scaling; + } + } + } + + /// + /// Gets or sets the value of the third row and first column of this matrix. + /// + public double OffsetX + { + get + { + if (_type == XMatrixTypes.Identity) + return 0; + return _offsetX; + } + set + { + if (_type == XMatrixTypes.Identity) + SetMatrix(1, 0, 0, 1, value, 0, XMatrixTypes.Translation); + else + { + _offsetX = value; + if (_type != XMatrixTypes.Unknown) + _type |= XMatrixTypes.Translation; + } + } + } + + /// + /// Gets or sets the value of the third row and second column of this matrix. + /// + public double OffsetY + { + get + { + if (_type == XMatrixTypes.Identity) + return 0; + return _offsetY; + } + set + { + if (_type == XMatrixTypes.Identity) + SetMatrix(1, 0, 0, 1, 0, value, XMatrixTypes.Translation); + else + { + _offsetY = value; + if (_type != XMatrixTypes.Unknown) + _type |= XMatrixTypes.Translation; + } + } + } + +#if GDI +//#if UseGdiObjects + /// + /// Converts this matrix to a System.Drawing.Drawing2D.Matrix object. + /// + public System.Drawing.Drawing2D.Matrix ToGdiMatrix() + { + if (IsIdentity) + return new System.Drawing.Drawing2D.Matrix(); + + return new System.Drawing.Drawing2D.Matrix((float)_m11, (float)_m12, (float)_m21, (float)_m22, + (float)_offsetX, (float)_offsetY); + } +//#endif +#endif + +#if WPF + /// Converts this matrix to a System.Windows.Media.Matrix object. + /// + /// + public System.Windows.Media.Matrix ToWpfMatrix() + { + return (System.Windows.Media.Matrix)this; + //return new System.Windows.Media.Matrix(_m11, _m12, _m21, _m22, _offsetX, _offsetY); + } +#endif + +#if GDI + /// + /// Explicitly converts a XMatrix to a Matrix. + /// + public static explicit operator System.Drawing.Drawing2D.Matrix(XMatrix matrix) + { + if (matrix.IsIdentity) + return new System.Drawing.Drawing2D.Matrix(); + + return new System.Drawing.Drawing2D.Matrix( + (float)matrix._m11, (float)matrix._m12, + (float)matrix._m21, (float)matrix._m22, + (float)matrix._offsetX, (float)matrix._offsetY); + } +#endif + +#if WPF + /// + /// Explicitly converts an XMatrix to a Matrix. + /// + public static explicit operator System.Windows.Media.Matrix(XMatrix matrix) + { + if (matrix.IsIdentity) + return new System.Windows.Media.Matrix(); + + return new System.Windows.Media.Matrix( + matrix._m11, matrix._m12, + matrix._m21, matrix._m22, + matrix._offsetX, matrix._offsetY); + } +#endif + +#if GDI + /// + /// Implicitly converts a Matrix to an XMatrix. + /// + public static implicit operator XMatrix(System.Drawing.Drawing2D.Matrix matrix) + { + float[] elements = matrix.Elements; + return new XMatrix(elements[0], elements[1], elements[2], elements[3], elements[4], elements[5]); + } +#endif + +#if WPF + /// + /// Implicitly converts a Matrix to an XMatrix. + /// + public static implicit operator XMatrix(System.Windows.Media.Matrix matrix) + { + return new XMatrix(matrix.M11, matrix.M12, matrix.M21, matrix.M22, matrix.OffsetX, matrix.OffsetY); + } +#endif + + /// + /// Determines whether the two matrices are equal. + /// + public static bool operator ==(XMatrix matrix1, XMatrix matrix2) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + if (matrix1.IsDistinguishedIdentity || matrix2.IsDistinguishedIdentity) + return (matrix1.IsIdentity == matrix2.IsIdentity); + + return matrix1.M11 == matrix2.M11 && matrix1.M12 == matrix2.M12 && matrix1.M21 == matrix2.M21 && matrix1.M22 == matrix2.M22 && + matrix1.OffsetX == matrix2.OffsetX && matrix1.OffsetY == matrix2.OffsetY; + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Determines whether the two matrices are not equal. + /// + public static bool operator !=(XMatrix matrix1, XMatrix matrix2) + { + return !(matrix1 == matrix2); + } + + /// + /// Determines whether the two matrices are equal. + /// + public static bool Equals(XMatrix matrix1, XMatrix matrix2) + { + if (matrix1.IsDistinguishedIdentity || matrix2.IsDistinguishedIdentity) + return matrix1.IsIdentity == matrix2.IsIdentity; + + return matrix1.M11.Equals(matrix2.M11) && matrix1.M12.Equals(matrix2.M12) && + matrix1.M21.Equals(matrix2.M21) && matrix1.M22.Equals(matrix2.M22) && + matrix1.OffsetX.Equals(matrix2.OffsetX) && matrix1.OffsetY.Equals(matrix2.OffsetY); + } + + /// + /// Determines whether this matrix is equal to the specified object. + /// + public override bool Equals(object o) + { + if (!(o is XMatrix)) + return false; + return Equals(this, (XMatrix)o); + } + + /// + /// Determines whether this matrix is equal to the specified matrix. + /// + public bool Equals(XMatrix value) + { + return Equals(this, value); + } + + /// + /// Returns the hash code for this instance. + /// + public override int GetHashCode() + { + if (IsDistinguishedIdentity) + return 0; + return M11.GetHashCode() ^ M12.GetHashCode() ^ M21.GetHashCode() ^ M22.GetHashCode() ^ OffsetX.GetHashCode() ^ OffsetY.GetHashCode(); + } + + /// + /// Parses a matrix from a string. + /// + public static XMatrix Parse(string source) + { + IFormatProvider cultureInfo = CultureInfo.InvariantCulture; //.GetCultureInfo("en-us"); + TokenizerHelper helper = new TokenizerHelper(source, cultureInfo); + string str = helper.NextTokenRequired(); + XMatrix identity = str == "Identity" ? Identity : new XMatrix( + Convert.ToDouble(str, cultureInfo), + Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), + Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), + Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), + Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), + Convert.ToDouble(helper.NextTokenRequired(), cultureInfo)); + helper.LastTokenRequired(); + return identity; + } + + /// + /// Converts this XMatrix to a human readable string. + /// + public override string ToString() + { + return ConvertToString(null, null); + } + + /// + /// Converts this XMatrix to a human readable string. + /// + public string ToString(IFormatProvider provider) + { + return ConvertToString(null, provider); + } + + /// + /// Converts this XMatrix to a human readable string. + /// + string IFormattable.ToString(string format, IFormatProvider provider) + { + return ConvertToString(format, provider); + } + + internal string ConvertToString(string format, IFormatProvider provider) + { + if (IsIdentity) + return "Identity"; + + char numericListSeparator = TokenizerHelper.GetNumericListSeparator(provider); + provider = provider ?? CultureInfo.InvariantCulture; + // ReSharper disable FormatStringProblem + return string.Format(provider, "{1:" + format + "}{0}{2:" + format + "}{0}{3:" + format + "}{0}{4:" + format + "}{0}{5:" + format + "}{0}{6:" + format + "}", + new object[] { numericListSeparator, _m11, _m12, _m21, _m22, _offsetX, _offsetY }); + // ReSharper restore FormatStringProblem + } + + internal void MultiplyVector(ref double x, ref double y) + { + switch (_type) + { + case XMatrixTypes.Identity: + case XMatrixTypes.Translation: + return; + + case XMatrixTypes.Scaling: + case XMatrixTypes.Scaling | XMatrixTypes.Translation: + x *= _m11; + y *= _m22; + return; + } + double d1 = y * _m21; + double d2 = x * _m12; + x *= _m11; + x += d1; + y *= _m22; + y += d2; + } + + internal void MultiplyPoint(ref double x, ref double y) + { + switch (_type) + { + case XMatrixTypes.Identity: + return; + + case XMatrixTypes.Translation: + x += _offsetX; + y += _offsetY; + return; + + case XMatrixTypes.Scaling: + x *= _m11; + y *= _m22; + return; + + case (XMatrixTypes.Scaling | XMatrixTypes.Translation): + x *= _m11; + x += _offsetX; + y *= _m22; + y += _offsetY; + return; + } + double d1 = (y * _m21) + _offsetX; + double d2 = (x * _m12) + _offsetY; + x *= _m11; + x += d1; + y *= _m22; + y += d2; + } + + internal static XMatrix CreateTranslation(double offsetX, double offsetY) + { + XMatrix matrix = new XMatrix(); + matrix.SetMatrix(1, 0, 0, 1, offsetX, offsetY, XMatrixTypes.Translation); + return matrix; + } + + internal static XMatrix CreateRotationRadians(double angle) + { + return CreateRotationRadians(angle, 0, 0); + } + + internal static XMatrix CreateRotationRadians(double angle, double centerX, double centerY) + { + XMatrix matrix = new XMatrix(); + double sin = Math.Sin(angle); + double cos = Math.Cos(angle); + double offsetX = (centerX * (1.0 - cos)) + (centerY * sin); + double offsetY = (centerY * (1.0 - cos)) - (centerX * sin); + matrix.SetMatrix(cos, sin, -sin, cos, offsetX, offsetY, XMatrixTypes.Unknown); + return matrix; + } + + internal static XMatrix CreateScaling(double scaleX, double scaleY) + { + XMatrix matrix = new XMatrix(); + matrix.SetMatrix(scaleX, 0, 0, scaleY, 0, 0, XMatrixTypes.Scaling); + return matrix; + } + + internal static XMatrix CreateScaling(double scaleX, double scaleY, double centerX, double centerY) + { + XMatrix matrix = new XMatrix(); + matrix.SetMatrix(scaleX, 0, 0, scaleY, centerX - scaleX * centerX, centerY - scaleY * centerY, XMatrixTypes.Scaling | XMatrixTypes.Translation); + return matrix; + } + + internal static XMatrix CreateSkewRadians(double skewX, double skewY, double centerX, double centerY) + { + XMatrix matrix = new XMatrix(); + matrix.Append(CreateTranslation(-centerX, -centerY)); + matrix.Append(new XMatrix(1, Math.Tan(skewY), Math.Tan(skewX), 1, 0, 0)); + matrix.Append(CreateTranslation(centerX, centerY)); + return matrix; + } + + internal static XMatrix CreateSkewRadians(double skewX, double skewY) + { + XMatrix matrix = new XMatrix(); + matrix.SetMatrix(1, Math.Tan(skewY), Math.Tan(skewX), 1, 0, 0, XMatrixTypes.Unknown); + return matrix; + } + + static XMatrix CreateIdentity() + { + XMatrix matrix = new XMatrix(); + matrix.SetMatrix(1, 0, 0, 1, 0, 0, XMatrixTypes.Identity); + return matrix; + } + + /// + /// Sets the matrix. + /// + void SetMatrix(double m11, double m12, double m21, double m22, double offsetX, double offsetY, XMatrixTypes type) + { + _m11 = m11; + _m12 = m12; + _m21 = m21; + _m22 = m22; + _offsetX = offsetX; + _offsetY = offsetY; + _type = type; + } + + void DeriveMatrixType() + { + // ReSharper disable CompareOfFloatsByEqualityOperator + _type = XMatrixTypes.Identity; + if (_m12 != 0 || _m21 != 0) + { + _type = XMatrixTypes.Unknown; + } + else + { + if (_m11 != 1 || _m22 != 1) + _type = XMatrixTypes.Scaling; + + if (_offsetX != 0 || _offsetY != 0) + _type |= XMatrixTypes.Translation; + + if ((_type & (XMatrixTypes.Scaling | XMatrixTypes.Translation)) == XMatrixTypes.Identity) + _type = XMatrixTypes.Identity; + } + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + bool IsDistinguishedIdentity + { + get { return (_type == XMatrixTypes.Identity); } + } + + // Keep the fields private and force using the properties. + // This prevents using m11 and m22 by mistake when the matrix is identity. + double _m11; + double _m12; + double _m21; + double _m22; + double _offsetX; + double _offsetY; + XMatrixTypes _type; + static readonly XMatrix s_identity = CreateIdentity(); + + /// + /// Internal matrix helper. + /// + internal static class MatrixHelper + { + // Fast mutiplication taking matrix type into account. Reflectored from WPF. + internal static void MultiplyMatrix(ref XMatrix matrix1, ref XMatrix matrix2) + { + XMatrixTypes type1 = matrix1._type; + XMatrixTypes type2 = matrix2._type; + if (type2 != XMatrixTypes.Identity) + { + if (type1 == XMatrixTypes.Identity) + matrix1 = matrix2; + else if (type2 == XMatrixTypes.Translation) + { + matrix1._offsetX += matrix2._offsetX; + matrix1._offsetY += matrix2._offsetY; + if (type1 != XMatrixTypes.Unknown) + matrix1._type |= XMatrixTypes.Translation; + } + else if (type1 == XMatrixTypes.Translation) + { + double num = matrix1._offsetX; + double num2 = matrix1._offsetY; + matrix1 = matrix2; + matrix1._offsetX = num * matrix2._m11 + num2 * matrix2._m21 + matrix2._offsetX; + matrix1._offsetY = num * matrix2._m12 + num2 * matrix2._m22 + matrix2._offsetY; + if (type2 == XMatrixTypes.Unknown) + matrix1._type = XMatrixTypes.Unknown; + else + matrix1._type = XMatrixTypes.Scaling | XMatrixTypes.Translation; + } + else + { + switch ((((int)type1) << 4) | (int)type2) + { + case 0x22: + matrix1._m11 *= matrix2._m11; + matrix1._m22 *= matrix2._m22; + return; + + case 0x23: + matrix1._m11 *= matrix2._m11; + matrix1._m22 *= matrix2._m22; + matrix1._offsetX = matrix2._offsetX; + matrix1._offsetY = matrix2._offsetY; + matrix1._type = XMatrixTypes.Scaling | XMatrixTypes.Translation; + return; + + case 0x24: + case 0x34: + case 0x42: + case 0x43: + case 0x44: + matrix1 = new XMatrix( + matrix1._m11 * matrix2._m11 + matrix1._m12 * matrix2._m21, + matrix1._m11 * matrix2._m12 + matrix1._m12 * matrix2._m22, + matrix1._m21 * matrix2._m11 + matrix1._m22 * matrix2._m21, + matrix1._m21 * matrix2._m12 + matrix1._m22 * matrix2._m22, + matrix1._offsetX * matrix2._m11 + matrix1._offsetY * matrix2._m21 + matrix2._offsetX, + matrix1._offsetX * matrix2._m12 + matrix1._offsetY * matrix2._m22 + matrix2._offsetY); + return; + + case 50: + matrix1._m11 *= matrix2._m11; + matrix1._m22 *= matrix2._m22; + matrix1._offsetX *= matrix2._m11; + matrix1._offsetY *= matrix2._m22; + return; + + case 0x33: + matrix1._m11 *= matrix2._m11; + matrix1._m22 *= matrix2._m22; + matrix1._offsetX = matrix2._m11 * matrix1._offsetX + matrix2._offsetX; + matrix1._offsetY = matrix2._m22 * matrix1._offsetY + matrix2._offsetY; + return; + } + } + } + } + + internal static void PrependOffset(ref XMatrix matrix, double offsetX, double offsetY) + { + if (matrix._type == XMatrixTypes.Identity) + { + matrix = new XMatrix(1, 0, 0, 1, offsetX, offsetY); + matrix._type = XMatrixTypes.Translation; + } + else + { + matrix._offsetX += (matrix._m11 * offsetX) + (matrix._m21 * offsetY); + matrix._offsetY += (matrix._m12 * offsetX) + (matrix._m22 * offsetY); + if (matrix._type != XMatrixTypes.Unknown) + matrix._type |= XMatrixTypes.Translation; + } + } + + internal static void TransformRect(ref XRect rect, ref XMatrix matrix) + { + if (!rect.IsEmpty) + { + XMatrixTypes type = matrix._type; + if (type != XMatrixTypes.Identity) + { + if ((type & XMatrixTypes.Scaling) != XMatrixTypes.Identity) + { + rect.X *= matrix._m11; + rect.Y *= matrix._m22; + rect.Width *= matrix._m11; + rect.Height *= matrix._m22; + if (rect.Width < 0) + { + rect.X += rect.Width; + rect.Width = -rect.Width; + } + if (rect.Height < 0) + { + rect.Y += rect.Height; + rect.Height = -rect.Height; + } + } + if ((type & XMatrixTypes.Translation) != XMatrixTypes.Identity) + { + rect.X += matrix._offsetX; + rect.Y += matrix._offsetY; + } + if (type == XMatrixTypes.Unknown) + { + XPoint point1 = matrix.Transform(rect.TopLeft); + XPoint point2 = matrix.Transform(rect.TopRight); + XPoint point3 = matrix.Transform(rect.BottomRight); + XPoint point4 = matrix.Transform(rect.BottomLeft); + rect.X = Math.Min(Math.Min(point1.X, point2.X), Math.Min(point3.X, point4.X)); + rect.Y = Math.Min(Math.Min(point1.Y, point2.Y), Math.Min(point3.Y, point4.Y)); + rect.Width = Math.Max(Math.Max(point1.X, point2.X), Math.Max(point3.X, point4.X)) - rect.X; + rect.Height = Math.Max(Math.Max(point1.Y, point2.Y), Math.Max(point3.Y, point4.Y)) - rect.Y; + } + } + } + } + } + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + /// The debugger display. + // ReSharper disable UnusedMember.Local + string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get + { + if (IsIdentity) + return "matrix=(Identity)"; + + const string format = Config.SignificantFigures7; + + // Calculate the angle in degrees. + XPoint point = new XMatrix(_m11, _m12, _m21, _m22, 0, 0).Transform(new XPoint(1, 0)); + double φ = Math.Atan2(point.Y, point.X) / Const.Deg2Rad; + return String.Format(CultureInfo.InvariantCulture, + "matrix=({0:" + format + "}, {1:" + format + "}, {2:" + format + "}, {3:" + format + "}, {4:" + format + "}, {5:" + format + "}), φ={6:0.0#########}°", + _m11, _m12, _m21, _m22, _offsetX, _offsetY, φ); + } + } + } +} diff --git a/PdfSharp/Drawing/XPdfForm.cs b/PdfSharp/Drawing/XPdfForm.cs new file mode 100644 index 0000000..0b28d45 --- /dev/null +++ b/PdfSharp/Drawing/XPdfForm.cs @@ -0,0 +1,415 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.IO; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows.Media; +#endif +using PdfSharp.Internal; +using PdfSharp.Pdf; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Drawing +{ + /// + /// Represents a so called 'PDF form external object', which is typically an imported page of an external + /// PDF document. XPdfForm objects are used like images to draw an existing PDF page of an external + /// document in the current document. XPdfForm objects can only be placed in PDF documents. If you try + /// to draw them using a XGraphics based on an GDI+ context no action is taken if no placeholder image + /// is specified. Otherwise the place holder is drawn. + /// + public class XPdfForm : XForm + { + /// + /// Initializes a new instance of the XPdfForm class from the specified path to an external PDF document. + /// Although PDFsharp internally caches XPdfForm objects it is recommended to reuse XPdfForm objects + /// in your code and change the PageNumber property if more than one page is needed form the external + /// document. Furthermore, because XPdfForm can occupy very much memory, it is recommended to + /// dispose XPdfForm objects if not needed anymore. + /// + internal XPdfForm(string path) + { + int pageNumber; + path = ExtractPageNumber(path, out pageNumber); + +#if !NETFX_CORE + path = Path.GetFullPath(path); + if (!File.Exists(path)) + throw new FileNotFoundException(PSSR.FileNotFound(path)); +#endif + + if (PdfReader.TestPdfFile(path) == 0) + throw new ArgumentException("The specified file has no valid PDF file header.", "path"); + + _path = path; + if (pageNumber != 0) + PageNumber = pageNumber; + } + + /// + /// Initializes a new instance of the class from a stream. + /// + /// The stream. + internal XPdfForm(Stream stream) + { + // Create a dummy unique path + _path = "*" + Guid.NewGuid().ToString("B"); + + if (PdfReader.TestPdfFile(stream) == 0) + throw new ArgumentException("The specified stream has no valid PDF file header.", "stream"); + + _externalDocument = PdfReader.Open(stream); + } + + /// + /// Creates an XPdfForm from a file. + /// + public static new XPdfForm FromFile(string path) + { + // TODO: Same file should return same object (that's why the function is static). + return new XPdfForm(path); + } + + /// + /// Creates an XPdfForm from a stream. + /// + public static new XPdfForm FromStream(Stream stream) + { + return new XPdfForm(stream); + } + + /* + void Initialize() + { + // ImageFormat has no overridden Equals... + } + */ + + /// + /// Sets the form in the state FormState.Finished. + /// + internal override void Finish() + { + if (_formState == FormState.NotATemplate || _formState == FormState.Finished) + return; + + base.Finish(); + + //if (Gfx.metafile != null) + // image = Gfx.metafile; + + //Debug.Assert(_fromState == FormState.Created || _fromState == FormState.UnderConstruction); + //_fromState = FormState.Finished; + //Gfx.Dispose(); + //Gfx = null; + + //if (_pdfRenderer != null) + //{ + // _pdfForm.Stream = new PdfDictionary.PdfStream(PdfEncoders.RawEncoding.GetBytes(pdfRenderer.GetContent()), this.pdfForm); + + // if (_document.Options.CompressContentStreams) + // { + // _pdfForm.Stream.Value = Filtering.FlateDecode.Encode(pdfForm.Stream.Value); + // _pdfForm.Elements["/Filter"] = new PdfName("/FlateDecode"); + // } + // int length = _pdfForm.Stream.Length; + // _pdfForm.Elements.SetInteger("/Length", length); + //} + } + + /// + /// Frees the memory occupied by the underlying imported PDF document, even if other XPdfForm objects + /// refer to this document. A reuse of this object doesn't fail, because the underlying PDF document + /// is re-imported if necessary. + /// + // TODO: NYI: Dispose + protected override void Dispose(bool disposing) + { + if (!_disposed) + { + _disposed = true; + try + { + if (disposing) + { + //... + } + if (_externalDocument != null) + PdfDocument.Tls.DetachDocument(_externalDocument.Handle); + //... + } + finally + { + base.Dispose(disposing); + } + } + } + bool _disposed; + + /// + /// Gets or sets an image that is used for drawing if the current XGraphics object cannot handle + /// PDF forms. A place holder is useful for showing a preview of a page on the display, because + /// PDFsharp cannot render native PDF objects. + /// + public XImage PlaceHolder + { + get { return _placeHolder; } + set { _placeHolder = value; } + } + XImage _placeHolder; + + /// + /// Gets the underlying PdfPage (if one exists). + /// + public PdfPage Page + { + get + { + if (IsTemplate) + return null; + PdfPage page = ExternalDocument.Pages[_pageNumber - 1]; + return page; + } + } + + /// + /// Gets the number of pages in the PDF form. + /// + public int PageCount + { + get + { + if (IsTemplate) + return 1; + if (_pageCount == -1) + _pageCount = ExternalDocument.Pages.Count; + return _pageCount; + } + } + int _pageCount = -1; + + /// + /// Gets the width in point of the page identified by the property PageNumber. + /// + [Obsolete("Use either PixelWidth or PointWidth. Temporarily obsolete because of rearrangements for WPF.")] + public override double Width + { + get + { + PdfPage page = ExternalDocument.Pages[_pageNumber - 1]; + return page.Width; + } + } + + /// + /// Gets the height in point of the page identified by the property PageNumber. + /// + [Obsolete("Use either PixelHeight or PointHeight. Temporarily obsolete because of rearrangements for WPF.")] + public override double Height + { + get + { + PdfPage page = ExternalDocument.Pages[_pageNumber - 1]; + return page.Height; + } + } + + /// + /// Gets the width in point of the page identified by the property PageNumber. + /// + public override double PointWidth + { + get + { + PdfPage page = ExternalDocument.Pages[_pageNumber - 1]; + return page.Width; + } + } + + /// + /// Gets the height in point of the page identified by the property PageNumber. + /// + public override double PointHeight + { + get + { + PdfPage page = ExternalDocument.Pages[_pageNumber - 1]; + return page.Height; + } + } + + /// + /// Gets the width in point of the page identified by the property PageNumber. + /// + public override int PixelWidth + { + get + { + //PdfPage page = ExternalDocument.Pages[_pageNumber - 1]; + //return (int)page.Width; + return DoubleUtil.DoubleToInt(PointWidth); + } + } + + /// + /// Gets the height in point of the page identified by the property PageNumber. + /// + public override int PixelHeight + { + get + { + //PdfPage page = ExternalDocument.Pages[_pageNumber - 1]; + //return (int)page.Height; + return DoubleUtil.DoubleToInt(PointHeight); + } + } + + /// + /// Get the size of the page identified by the property PageNumber. + /// + public override XSize Size + { + get + { + PdfPage page = ExternalDocument.Pages[_pageNumber - 1]; + return new XSize(page.Width, page.Height); + } + } + + /// + /// Gets or sets the transformation matrix. + /// + public override XMatrix Transform + { + get { return _transform; } + set + { + if (_transform != value) + { + // discard PdfFromXObject when Transform changed + _pdfForm = null; + _transform = value; + } + } + } + + /// + /// Gets or sets the page number in the external PDF document this object refers to. The page number + /// is one-based, i.e. it is in the range from 1 to PageCount. The default value is 1. + /// + public int PageNumber + { + get { return _pageNumber; } + set + { + if (IsTemplate) + throw new InvalidOperationException("The page number of an XPdfForm template cannot be modified."); + + if (_pageNumber != value) + { + _pageNumber = value; + // dispose PdfFromXObject when number has changed + _pdfForm = null; + } + } + } + int _pageNumber = 1; + + /// + /// Gets or sets the page index in the external PDF document this object refers to. The page index + /// is zero-based, i.e. it is in the range from 0 to PageCount - 1. The default value is 0. + /// + public int PageIndex + { + get { return PageNumber - 1; } + set { PageNumber = value + 1; } + } + + /// + /// Gets the underlying document from which pages are imported. + /// + internal PdfDocument ExternalDocument + { + // The problem is that you can ask an XPdfForm about the number of its pages before it was + // drawn the first time. At this moment the XPdfForm doesn't know the document where it will + // be later draw on one of its pages. To prevent the import of the same document more than + // once, all imported documents of a thread are cached. The cache is local to the current + // thread and not to the appdomain, because I won't get problems in a multi-thread environment + // that I don't understand. + get + { + if (IsTemplate) + throw new InvalidOperationException("This XPdfForm is a template and not an imported PDF page; therefore it has no external document."); + + if (_externalDocument == null) + _externalDocument = PdfDocument.Tls.GetDocument(_path); + return _externalDocument; + } + } + internal PdfDocument _externalDocument; + + /// + /// Extracts the page number if the path has the form 'MyFile.pdf#123' and returns + /// the actual path without the number sign and the following digits. + /// + public static string ExtractPageNumber(string path, out int pageNumber) + { + if (path == null) + throw new ArgumentNullException("path"); + + pageNumber = 0; + int length = path.Length; + if (length != 0) + { + length--; + if (char.IsDigit(path, length)) + { + while (char.IsDigit(path, length) && length >= 0) + length--; + if (length > 0 && path[length] == '#') + { + // Must have at least one dot left of colon to distinguish from e.g. '#123' + if (path.IndexOf('.') != -1) + { + pageNumber = int.Parse(path.Substring(length + 1)); + path = path.Substring(0, length); + } + } + } + } + return path; + } + } +} diff --git a/PdfSharp/Drawing/XPen.cs b/PdfSharp/Drawing/XPen.cs new file mode 100644 index 0000000..052b4ba --- /dev/null +++ b/PdfSharp/Drawing/XPen.cs @@ -0,0 +1,404 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Internal; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using GdiPen = System.Drawing.Pen; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +using WpfPen =System.Windows.Media.Pen; +using WpfBrush =System.Windows.Media.Brush; +#endif +#if UWP +#endif + +namespace PdfSharp.Drawing +{ + // TODO Free GDI objects (pens, brushes, ...) automatically without IDisposable. + /// + /// Defines an object used to draw lines and curves. + /// + public sealed class XPen + { + /// + /// Initializes a new instance of the class. + /// + public XPen(XColor color) + : this(color, 1, false) + { } + + /// + /// Initializes a new instance of the class. + /// + public XPen(XColor color, double width) + : this(color, width, false) + { } + + internal XPen(XColor color, double width, bool immutable) + { + _color = color; + _width = width; + _lineJoin = XLineJoin.Miter; + _lineCap = XLineCap.Flat; + _dashStyle = XDashStyle.Solid; + _dashOffset = 0f; + _immutable = immutable; + } + + /// + /// Initializes a new instance of the class. + /// + public XPen(XPen pen) + { + _color = pen._color; + _width = pen._width; + _lineJoin = pen._lineJoin; + _lineCap = pen._lineCap; + _dashStyle = pen._dashStyle; + _dashOffset = pen._dashOffset; + _dashPattern = pen._dashPattern; + if (_dashPattern != null) + _dashPattern = (double[])_dashPattern.Clone(); + } + + /// + /// Clones this instance. + /// + public XPen Clone() + { + return new XPen(this); + } + + /// + /// Gets or sets the color. + /// + public XColor Color + { + get { return _color; } + set + { + if (_immutable) + throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); + _dirty = _dirty || _color != value; + _color = value; + } + } + internal XColor _color; + + /// + /// Gets or sets the width. + /// + public double Width + { + get { return _width; } + set + { + if (_immutable) + throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); + _dirty = _dirty || _width != value; + _width = value; + } + } + internal double _width; + + /// + /// Gets or sets the line join. + /// + public XLineJoin LineJoin + { + get { return _lineJoin; } + set + { + if (_immutable) + throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); + _dirty = _dirty || _lineJoin != value; + _lineJoin = value; + } + } + internal XLineJoin _lineJoin; + + /// + /// Gets or sets the line cap. + /// + public XLineCap LineCap + { + get { return _lineCap; } + set + { + if (_immutable) + throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); + _dirty = _dirty || _lineCap != value; + _lineCap = value; + } + } + internal XLineCap _lineCap; + + /// + /// Gets or sets the miter limit. + /// + public double MiterLimit + { + get { return _miterLimit; } + set + { + if (_immutable) + throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); + _dirty = _dirty || _miterLimit != value; + _miterLimit = value; + } + } + internal double _miterLimit; + + /// + /// Gets or sets the dash style. + /// + public XDashStyle DashStyle + { + get { return _dashStyle; } + set + { + if (_immutable) + throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); + _dirty = _dirty || _dashStyle != value; + _dashStyle = value; + } + } + internal XDashStyle _dashStyle; + + /// + /// Gets or sets the dash offset. + /// + public double DashOffset + { + get { return _dashOffset; } + set + { + if (_immutable) + throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); + _dirty = _dirty || _dashOffset != value; + _dashOffset = value; + } + } + internal double _dashOffset; + + /// + /// Gets or sets the dash pattern. + /// + public double[] DashPattern + { + get + { + if (_dashPattern == null) + _dashPattern = new double[0]; + return _dashPattern; + } + set + { + if (_immutable) + throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); + + int length = value.Length; + //if (length == 0) + // throw new ArgumentException("Dash pattern array must not be empty."); + + for (int idx = 0; idx < length; idx++) + { + if (value[idx] <= 0) + throw new ArgumentException("Dash pattern value must greater than zero."); + } + + _dirty = true; + _dashStyle = XDashStyle.Custom; + _dashPattern = (double[])value.Clone(); + } + } + internal double[] _dashPattern; + + /// + /// Gets or sets a value indicating whether the pen enables overprint when used in a PDF document. + /// Experimental, takes effect only on CMYK color mode. + /// + public bool Overprint + { + get { return _overprint; } + set + { + if (_immutable) + throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); + _overprint = value; + } + } + internal bool _overprint; + +#if GDI +#if UseGdiObjects + /// + /// Implicit conversion from Pen to XPen + /// + public static implicit operator XPen(Pen pen) + { + XPen xpen; + try + { + Lock.EnterGdiPlus(); + switch (pen.PenType) + { + case PenType.SolidColor: + xpen = new XPen(pen.Color, pen.Width); + xpen.LineJoin = (XLineJoin)pen.LineJoin; + xpen.DashStyle = (XDashStyle)pen.DashStyle; + xpen._miterLimit = pen.MiterLimit; + break; + + default: + throw new NotImplementedException("Pen type not supported by PDFsharp."); + } + // Bug fixed by drice2@ageone.de + if (pen.DashStyle == System.Drawing.Drawing2D.DashStyle.Custom) + { + int length = pen.DashPattern.Length; + double[] pattern = new double[length]; + for (int idx = 0; idx < length; idx++) + pattern[idx] = pen.DashPattern[idx]; + xpen.DashPattern = pattern; + xpen._dashOffset = pen.DashOffset; + } + } + finally { Lock.ExitGdiPlus(); } + return xpen; + } +#endif + + internal System.Drawing.Pen RealizeGdiPen() + { + if (_dirty) + { + if (_gdiPen == null) + _gdiPen = new System.Drawing.Pen(_color.ToGdiColor(), (float)_width); + else + { + _gdiPen.Color = _color.ToGdiColor(); + _gdiPen.Width = (float)_width; + } + LineCap lineCap = XConvert.ToLineCap(_lineCap); + _gdiPen.StartCap = lineCap; + _gdiPen.EndCap = lineCap; + _gdiPen.LineJoin = XConvert.ToLineJoin(_lineJoin); + _gdiPen.DashOffset = (float)_dashOffset; + if (_dashStyle == XDashStyle.Custom) + { + int len = _dashPattern == null ? 0 : _dashPattern.Length; + float[] pattern = new float[len]; + for (int idx = 0; idx < len; idx++) + pattern[idx] = (float)_dashPattern[idx]; + _gdiPen.DashPattern = pattern; + } + else + _gdiPen.DashStyle = (System.Drawing.Drawing2D.DashStyle)_dashStyle; + } + return _gdiPen; + } +#endif + +#if WPF + internal WpfPen RealizeWpfPen() + { +#if !SILVERLIGHT + if (_dirty || !_dirty) // TODOWPF: XPen is frozen by design, WPF Pen can change + { + //if (_wpfPen == null) + _wpfPen = new WpfPen(new SolidColorBrush(_color.ToWpfColor()), _width); + //else + //{ + // _wpfPen.Brush = new SolidColorBrush(_color.ToWpfColor()); + // _wpfPen.Thickness = _width; + //} + PenLineCap lineCap = XConvert.ToPenLineCap(_lineCap); + _wpfPen.StartLineCap = lineCap; + _wpfPen.EndLineCap = lineCap; + _wpfPen.LineJoin = XConvert.ToPenLineJoin(_lineJoin); + if (_dashStyle == XDashStyle.Custom) + { + // TODOWPF: does not work in all cases + _wpfPen.DashStyle = new System.Windows.Media.DashStyle(_dashPattern, _dashOffset); + } + else + { + switch (_dashStyle) + { + case XDashStyle.Solid: + _wpfPen.DashStyle = DashStyles.Solid; + break; + + case XDashStyle.Dash: + //_wpfPen.DashStyle = DashStyles.Dash; + _wpfPen.DashStyle = new System.Windows.Media.DashStyle(new double[] { 2, 2 }, 0); + break; + + case XDashStyle.Dot: + //_wpfPen.DashStyle = DashStyles.Dot; + _wpfPen.DashStyle = new System.Windows.Media.DashStyle(new double[] { 0, 2 }, 1.5); + break; + + case XDashStyle.DashDot: + //_wpfPen.DashStyle = DashStyles.DashDot; + _wpfPen.DashStyle = new System.Windows.Media.DashStyle(new double[] { 2, 2, 0, 2 }, 0); + break; + + case XDashStyle.DashDotDot: + //_wpfPen.DashStyle = DashStyles.DashDotDot; + _wpfPen.DashStyle = new System.Windows.Media.DashStyle(new double[] { 2, 2, 0, 2, 0, 2 }, 0); + break; + } + } + } +#else + _wpfPen = new System.Windows.Media.Pen(); + _wpfPen.Brush = new SolidColorBrush(_color.ToWpfColor()); + _wpfPen.Thickness = _width; +#endif + return _wpfPen; + } +#endif + + bool _dirty = true; + readonly bool _immutable; +#if GDI + GdiPen _gdiPen; +#endif +#if WPF + WpfPen _wpfPen; +#endif + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing/XPens.cs b/PdfSharp/Drawing/XPens.cs new file mode 100644 index 0000000..9c22775 --- /dev/null +++ b/PdfSharp/Drawing/XPens.cs @@ -0,0 +1,1595 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// ReSharper disable UnusedMember.Global + +#define USE_CACHE_is_not_thread_safe + +namespace PdfSharp.Drawing +{ + /// + /// Pens for all the pre-defined colors. + /// + public static class XPens + { + /// Gets a pre-defined XPen object. + public static XPen AliceBlue + { +#if USE_CACHE + get { return _aliceBlue ?? (_aliceBlue = new XPen(XColors.AliceBlue, 1, true)); } +#else + get { return new XPen(XColors.AliceBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen AntiqueWhite + { +#if USE_CACHE + get { return _antiqueWhite ?? (_antiqueWhite = new XPen(XColors.AntiqueWhite, 1, true)); } +#else + get { return new XPen(XColors.AntiqueWhite, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Aqua + { +#if USE_CACHE + get { return _aqua ?? (_aqua = new XPen(XColors.Aqua, 1, true)); } +#else + get { return new XPen(XColors.Aqua, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Aquamarine + { +#if USE_CACHE + get { return _aquamarine ?? (_aquamarine = new XPen(XColors.Aquamarine, 1, true)); } +#else + get { return new XPen(XColors.Aquamarine, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Azure + { +#if USE_CACHE + get { return _azure ?? (_azure = new XPen(XColors.Azure, 1, true)); } +#else + get { return new XPen(XColors.Azure, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Beige + { +#if USE_CACHE + get { return _beige ?? (_beige = new XPen(XColors.Beige, 1, true)); } +#else + get { return new XPen(XColors.Beige, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Bisque + { +#if USE_CACHE + get { return _bisque ?? (_bisque = new XPen(XColors.Bisque, 1, true)); } +#else + get { return new XPen(XColors.Bisque, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Black + { +#if USE_CACHE + get { return _black ?? (_black = new XPen(XColors.Black, 1, true)); } +#else + get { return new XPen(XColors.Black, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen BlanchedAlmond + { +#if USE_CACHE + get { return _blanchedAlmond ?? (_blanchedAlmond = new XPen(XColors.BlanchedAlmond, 1, true)); } +#else + get { return new XPen(XColors.BlanchedAlmond, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Blue + { +#if USE_CACHE + get { return _blue ?? (_blue = new XPen(XColors.Blue, 1, true)); } +#else + get { return new XPen(XColors.Blue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen BlueViolet + { +#if USE_CACHE + get { return _blueViolet ?? (_blueViolet = new XPen(XColors.BlueViolet, 1, true)); } +#else + get { return new XPen(XColors.BlueViolet, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Brown + { +#if USE_CACHE + get { return _brown ?? (_brown = new XPen(XColors.Brown, 1, true)); } +#else + get { return new XPen(XColors.Brown, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen BurlyWood + { +#if USE_CACHE + get { return _burlyWood ?? (_burlyWood = new XPen(XColors.BurlyWood, 1, true)); } +#else + get { return new XPen(XColors.BurlyWood, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen CadetBlue + { +#if USE_CACHE + get { return _cadetBlue ?? (_cadetBlue = new XPen(XColors.CadetBlue, 1, true)); } +#else + get { return new XPen(XColors.CadetBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Chartreuse + { +#if USE_CACHE + get { return _chartreuse ?? (_chartreuse = new XPen(XColors.Chartreuse, 1, true)); } +#else + get { return new XPen(XColors.Chartreuse, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Chocolate + { +#if USE_CACHE + get { return _chocolate ?? (_chocolate = new XPen(XColors.Chocolate, 1, true)); } +#else + get { return new XPen(XColors.Chocolate, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Coral + { +#if USE_CACHE + get { return _coral ?? (_coral = new XPen(XColors.Coral, 1, true)); } +#else + get { return new XPen(XColors.Coral, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen CornflowerBlue + { +#if USE_CACHE + get { return _cornflowerBlue ?? (_cornflowerBlue = new XPen(XColors.CornflowerBlue, 1, true)); } +#else + get { return new XPen(XColors.CornflowerBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Cornsilk + { +#if USE_CACHE + get { return _cornsilk ?? (_cornsilk = new XPen(XColors.Cornsilk, 1, true)); } +#else + get { return new XPen(XColors.Cornsilk, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Crimson + { +#if USE_CACHE + get { return _crimson ?? (_crimson = new XPen(XColors.Crimson, 1, true)); } +#else + get { return new XPen(XColors.Crimson, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Cyan + { +#if USE_CACHE + get { return _cyan ?? (_cyan = new XPen(XColors.Cyan, 1, true)); } +#else + get { return new XPen(XColors.Cyan, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkBlue + { +#if USE_CACHE + get { return _darkBlue ?? (_darkBlue = new XPen(XColors.DarkBlue, 1, true)); } +#else + get { return new XPen(XColors.DarkBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkCyan + { +#if USE_CACHE + get { return _darkCyan ?? (_darkCyan = new XPen(XColors.DarkCyan, 1, true)); } +#else + get { return new XPen(XColors.DarkCyan, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkGoldenrod + { +#if USE_CACHE + get { return _darkGoldenrod ?? (_darkGoldenrod = new XPen(XColors.DarkGoldenrod, 1, true)); } +#else + get { return new XPen(XColors.DarkGoldenrod, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkGray + { +#if USE_CACHE + get { return _darkGray ?? (_darkGray = new XPen(XColors.DarkGray, 1, true)); } +#else + get { return new XPen(XColors.DarkGray, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkGreen + { +#if USE_CACHE + get { return _darkGreen ?? (_darkGreen = new XPen(XColors.DarkGreen, 1, true)); } +#else + get { return new XPen(XColors.DarkGreen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkKhaki + { +#if USE_CACHE + get { return _darkKhaki ?? (_darkKhaki = new XPen(XColors.DarkKhaki, 1, true)); } +#else + get { return new XPen(XColors.DarkKhaki, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkMagenta + { +#if USE_CACHE + get { return _darkMagenta ?? (_darkMagenta = new XPen(XColors.DarkMagenta, 1, true)); } +#else + get { return new XPen(XColors.DarkMagenta, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkOliveGreen + { +#if USE_CACHE + get { return _darkOliveGreen ?? (_darkOliveGreen = new XPen(XColors.DarkOliveGreen, 1, true)); } +#else + get { return new XPen(XColors.DarkOliveGreen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkOrange + { +#if USE_CACHE + get { return _darkOrange ?? (_darkOrange = new XPen(XColors.DarkOrange, 1, true)); } +#else + get { return new XPen(XColors.DarkOrange, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkOrchid + { +#if USE_CACHE + get { return _darkOrchid ?? (_darkOrchid = new XPen(XColors.DarkOrchid, 1, true)); } +#else + get { return new XPen(XColors.DarkOrchid, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkRed + { +#if USE_CACHE + get { return _darkRed ?? (_darkRed = new XPen(XColors.DarkRed, 1, true)); } +#else + get { return new XPen(XColors.DarkRed, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkSalmon + { +#if USE_CACHE + get { return _darkSalmon ?? (_darkSalmon = new XPen(XColors.DarkSalmon, 1, true)); } +#else + get { return new XPen(XColors.DarkSalmon, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkSeaGreen + { +#if USE_CACHE + get { return _darkSeaGreen ?? (_darkSeaGreen = new XPen(XColors.DarkSeaGreen, 1, true)); } +#else + get { return new XPen(XColors.DarkSeaGreen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkSlateBlue + { +#if USE_CACHE + get { return _darkSlateBlue ?? (_darkSlateBlue = new XPen(XColors.DarkSlateBlue, 1, true)); } +#else + get { return new XPen(XColors.DarkSlateBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkSlateGray + { +#if USE_CACHE + get { return _darkSlateGray ?? (_darkSlateGray = new XPen(XColors.DarkSlateGray, 1, true)); } +#else + get { return new XPen(XColors.DarkSlateGray, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkTurquoise + { +#if USE_CACHE + get { return _darkTurquoise ?? (_darkTurquoise = new XPen(XColors.DarkTurquoise, 1, true)); } +#else + get { return new XPen(XColors.DarkTurquoise, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DarkViolet + { +#if USE_CACHE + get { return _darkViolet ?? (_darkViolet = new XPen(XColors.DarkViolet, 1, true)); } +#else + get { return new XPen(XColors.DarkViolet, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DeepPink + { +#if USE_CACHE + get { return _deepPink ?? (_deepPink = new XPen(XColors.DeepPink, 1, true)); } +#else + get { return new XPen(XColors.DeepPink, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DeepSkyBlue + { +#if USE_CACHE + get { return _deepSkyBlue ?? (_deepSkyBlue = new XPen(XColors.DeepSkyBlue, 1, true)); } +#else + get { return new XPen(XColors.DeepSkyBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DimGray + { +#if USE_CACHE + get { return _dimGray ?? (_dimGray = new XPen(XColors.DimGray, 1, true)); } +#else + get { return new XPen(XColors.DimGray, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen DodgerBlue + { +#if USE_CACHE + get { return _dodgerBlue ?? (_dodgerBlue = new XPen(XColors.DodgerBlue, 1, true)); } +#else + get { return new XPen(XColors.DodgerBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Firebrick + { +#if USE_CACHE + get { return _firebrick ?? (_firebrick = new XPen(XColors.Firebrick, 1, true)); } +#else + get { return new XPen(XColors.Firebrick, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen FloralWhite + { +#if USE_CACHE + get { return _floralWhite ?? (_floralWhite = new XPen(XColors.FloralWhite, 1, true)); } +#else + get { return new XPen(XColors.FloralWhite, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen ForestGreen + { +#if USE_CACHE + get { return _forestGreen ?? (_forestGreen = new XPen(XColors.ForestGreen, 1, true)); } +#else + get { return new XPen(XColors.ForestGreen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Fuchsia + { +#if USE_CACHE + get { return _fuchsia ?? (_fuchsia = new XPen(XColors.Fuchsia, 1, true)); } +#else + get { return new XPen(XColors.Fuchsia, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Gainsboro + { +#if USE_CACHE + get { return _gainsboro ?? (_gainsboro = new XPen(XColors.Gainsboro, 1, true)); } +#else + get { return new XPen(XColors.Gainsboro, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen GhostWhite + { +#if USE_CACHE + get { return _ghostWhite ?? (_ghostWhite = new XPen(XColors.GhostWhite, 1, true)); } +#else + get { return new XPen(XColors.GhostWhite, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Gold + { +#if USE_CACHE + get { return _gold ?? (_gold = new XPen(XColors.Gold, 1, true)); } +#else + get { return new XPen(XColors.Gold, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Goldenrod + { +#if USE_CACHE + get { return _goldenrod ?? (_goldenrod = new XPen(XColors.Goldenrod, 1, true)); } +#else + get { return new XPen(XColors.Goldenrod, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Gray + { +#if USE_CACHE + get { return _gray ?? (_gray = new XPen(XColors.Gray, 1, true)); } +#else + get { return new XPen(XColors.Gray, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Green + { +#if USE_CACHE + get { return _green ?? (_green = new XPen(XColors.Green, 1, true)); } +#else + get { return new XPen(XColors.Green, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen GreenYellow + { +#if USE_CACHE + get { return _greenYellow ?? (_greenYellow = new XPen(XColors.GreenYellow, 1, true)); } +#else + get { return new XPen(XColors.GreenYellow, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Honeydew + { +#if USE_CACHE + get { return _honeydew ?? (_honeydew = new XPen(XColors.Honeydew, 1, true)); } +#else + get { return new XPen(XColors.Honeydew, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen HotPink + { +#if USE_CACHE + get { return _hotPink ?? (_hotPink = new XPen(XColors.HotPink, 1, true)); } +#else + get { return new XPen(XColors.HotPink, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen IndianRed + { +#if USE_CACHE + get { return _indianRed ?? (_indianRed = new XPen(XColors.IndianRed, 1, true)); } +#else + get { return new XPen(XColors.IndianRed, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Indigo + { +#if USE_CACHE + get { return _indigo ?? (_indigo = new XPen(XColors.Indigo, 1, true)); } +#else + get { return new XPen(XColors.Indigo, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Ivory + { +#if USE_CACHE + get { return _ivory ?? (_ivory = new XPen(XColors.Ivory, 1, true)); } +#else + get { return new XPen(XColors.Ivory, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Khaki + { +#if USE_CACHE + get { return _khaki ?? (_khaki = new XPen(XColors.Khaki, 1, true)); } +#else + get { return new XPen(XColors.Khaki, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Lavender + { +#if USE_CACHE + get { return _lavender ?? (_lavender = new XPen(XColors.Lavender, 1, true)); } +#else + get { return new XPen(XColors.Lavender, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LavenderBlush + { +#if USE_CACHE + get { return _lavenderBlush ?? (_lavenderBlush = new XPen(XColors.LavenderBlush, 1, true)); } +#else + get { return new XPen(XColors.LavenderBlush, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LawnGreen + { +#if USE_CACHE + get { return _lawnGreen ?? (_lawnGreen = new XPen(XColors.LawnGreen, 1, true)); } +#else + get { return new XPen(XColors.LawnGreen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LemonChiffon + { +#if USE_CACHE + get { return _lemonChiffon ?? (_lemonChiffon = new XPen(XColors.LemonChiffon, 1, true)); } +#else + get { return new XPen(XColors.LemonChiffon, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LightBlue + { +#if USE_CACHE + get { return _lightBlue ?? (_lightBlue = new XPen(XColors.LightBlue, 1, true)); } +#else + get { return new XPen(XColors.LightBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LightCoral + { +#if USE_CACHE + get { return _lightCoral ?? (_lightCoral = new XPen(XColors.LightCoral, 1, true)); } +#else + get { return new XPen(XColors.LightCoral, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LightCyan + { +#if USE_CACHE + get { return _lightCyan ?? (_lightCyan = new XPen(XColors.LightCyan, 1, true)); } +#else + get { return new XPen(XColors.LightCyan, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LightGoldenrodYellow + { +#if USE_CACHE + get { return _lightGoldenrodYellow ?? (_lightGoldenrodYellow = new XPen(XColors.LightGoldenrodYellow, 1, true)); } +#else + get { return new XPen(XColors.LightGoldenrodYellow, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LightGray + { +#if USE_CACHE + get { return _lightGray ?? (_lightGray = new XPen(XColors.LightGray, 1, true)); } +#else + get { return new XPen(XColors.LightGray, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LightGreen + { +#if USE_CACHE + get { return _lightGreen ?? (_lightGreen = new XPen(XColors.LightGreen, 1, true)); } +#else + get { return new XPen(XColors.LightGreen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LightPink + { +#if USE_CACHE + get { return _lightPink ?? (_lightPink = new XPen(XColors.LightPink, 1, true)); } +#else + get { return new XPen(XColors.LightPink, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LightSalmon + { +#if USE_CACHE + get { return _lightSalmon ?? (_lightSalmon = new XPen(XColors.LightSalmon, 1, true)); } +#else + get { return new XPen(XColors.LightSalmon, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LightSeaGreen + { +#if USE_CACHE + get { return _lightSeaGreen ?? (_lightSeaGreen = new XPen(XColors.LightSeaGreen, 1, true)); } +#else + get { return new XPen(XColors.LightSeaGreen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LightSkyBlue + { +#if USE_CACHE + get { return _lightSkyBlue ?? (_lightSkyBlue = new XPen(XColors.LightSkyBlue, 1, true)); } +#else + get { return new XPen(XColors.LightSkyBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LightSlateGray + { +#if USE_CACHE + get { return _lightSlateGray ?? (_lightSlateGray = new XPen(XColors.LightSlateGray, 1, true)); } +#else + get { return new XPen(XColors.LightSlateGray, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LightSteelBlue + { +#if USE_CACHE + get { return _lightSteelBlue ?? (_lightSteelBlue = new XPen(XColors.LightSteelBlue, 1, true)); } +#else + get { return new XPen(XColors.LightSteelBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LightYellow + { +#if USE_CACHE + get { return _lightYellow ?? (_lightYellow = new XPen(XColors.LightYellow, 1, true)); } +#else + get { return new XPen(XColors.LightYellow, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Lime + { +#if USE_CACHE + get { return _lime ?? (_lime = new XPen(XColors.Lime, 1, true)); } +#else + get { return new XPen(XColors.Lime, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen LimeGreen + { +#if USE_CACHE + get { return _limeGreen ?? (_limeGreen = new XPen(XColors.LimeGreen, 1, true)); } +#else + get { return new XPen(XColors.LimeGreen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Linen + { +#if USE_CACHE + get { return _linen ?? (_linen = new XPen(XColors.Linen, 1, true)); } +#else + get { return new XPen(XColors.Linen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Magenta + { +#if USE_CACHE + get { return _magenta ?? (_magenta = new XPen(XColors.Magenta, 1, true)); } +#else + get { return new XPen(XColors.Magenta, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Maroon + { +#if USE_CACHE + get { return _maroon ?? (_maroon = new XPen(XColors.Maroon, 1, true)); } +#else + get { return new XPen(XColors.Maroon, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen MediumAquamarine + { +#if USE_CACHE + get { return _mediumAquamarine ?? (_mediumAquamarine = new XPen(XColors.MediumAquamarine, 1, true)); } +#else + get { return new XPen(XColors.MediumAquamarine, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen MediumBlue + { +#if USE_CACHE + get { return _mediumBlue ?? (_mediumBlue = new XPen(XColors.MediumBlue, 1, true)); } +#else + get { return new XPen(XColors.MediumBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen MediumOrchid + { +#if USE_CACHE + get { return _mediumOrchid ?? (_mediumOrchid = new XPen(XColors.MediumOrchid, 1, true)); } +#else + get { return new XPen(XColors.MediumOrchid, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen MediumPurple + { +#if USE_CACHE + get { return _mediumPurple ?? (_mediumPurple = new XPen(XColors.MediumPurple, 1, true)); } +#else + get { return new XPen(XColors.MediumPurple, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen MediumSeaGreen + { +#if USE_CACHE + get { return _mediumSeaGreen ?? (_mediumSeaGreen = new XPen(XColors.MediumSeaGreen, 1, true)); } +#else + get { return new XPen(XColors.MediumSeaGreen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen MediumSlateBlue + { +#if USE_CACHE + get { return _mediumSlateBlue ?? (_mediumSlateBlue = new XPen(XColors.MediumSlateBlue, 1, true)); } +#else + get { return new XPen(XColors.MediumSlateBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen MediumSpringGreen + { +#if USE_CACHE + get { return _mediumSpringGreen ?? (_mediumSpringGreen = new XPen(XColors.MediumSpringGreen, 1, true)); } +#else + get { return new XPen(XColors.MediumSpringGreen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen MediumTurquoise + { +#if USE_CACHE + get { return _mediumTurquoise ?? (_mediumTurquoise = new XPen(XColors.MediumTurquoise, 1, true)); } +#else + get { return new XPen(XColors.MediumTurquoise, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen MediumVioletRed + { +#if USE_CACHE + get { return _mediumVioletRed ?? (_mediumVioletRed = new XPen(XColors.MediumVioletRed, 1, true)); } +#else + get { return new XPen(XColors.MediumVioletRed, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen MidnightBlue + { +#if USE_CACHE + get { return _midnightBlue ?? (_midnightBlue = new XPen(XColors.MidnightBlue, 1, true)); } +#else + get { return new XPen(XColors.MidnightBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen MintCream + { +#if USE_CACHE + get { return _mintCream ?? (_mintCream = new XPen(XColors.MintCream, 1, true)); } +#else + get { return new XPen(XColors.MintCream, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen MistyRose + { +#if USE_CACHE + get { return _mistyRose ?? (_mistyRose = new XPen(XColors.MistyRose, 1, true)); } +#else + get { return new XPen(XColors.MistyRose, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Moccasin + { +#if USE_CACHE + get { return _moccasin ?? (_moccasin = new XPen(XColors.Moccasin, 1, true)); } +#else + get { return new XPen(XColors.Moccasin, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen NavajoWhite + { +#if USE_CACHE + get { return _navajoWhite ?? (_navajoWhite = new XPen(XColors.NavajoWhite, 1, true)); } +#else + get { return new XPen(XColors.NavajoWhite, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Navy + { +#if USE_CACHE + get { return _navy ?? (_navy = new XPen(XColors.Navy, 1, true)); } +#else + get { return new XPen(XColors.Navy, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen OldLace + { +#if USE_CACHE + get { return _oldLace ?? (_oldLace = new XPen(XColors.OldLace, 1, true)); } +#else + get { return new XPen(XColors.OldLace, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Olive + { +#if USE_CACHE + get { return _olive ?? (_olive = new XPen(XColors.Olive, 1, true)); } +#else + get { return new XPen(XColors.Olive, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen OliveDrab + { +#if USE_CACHE + get { return _oliveDrab ?? (_oliveDrab = new XPen(XColors.OliveDrab, 1, true)); } +#else + get { return new XPen(XColors.OliveDrab, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Orange + { +#if USE_CACHE + get { return _orange ?? (_orange = new XPen(XColors.Orange, 1, true)); } +#else + get { return new XPen(XColors.Orange, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen OrangeRed + { +#if USE_CACHE + get { return _orangeRed ?? (_orangeRed = new XPen(XColors.OrangeRed, 1, true)); } +#else + get { return new XPen(XColors.OrangeRed, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Orchid + { +#if USE_CACHE + get { return _orchid ?? (_orchid = new XPen(XColors.Orchid, 1, true)); } +#else + get { return new XPen(XColors.Orchid, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen PaleGoldenrod + { +#if USE_CACHE + get { return _paleGoldenrod ?? (_paleGoldenrod = new XPen(XColors.PaleGoldenrod, 1, true)); } +#else + get { return new XPen(XColors.PaleGoldenrod, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen PaleGreen + { +#if USE_CACHE + get { return _paleGreen ?? (_paleGreen = new XPen(XColors.PaleGreen, 1, true)); } +#else + get { return new XPen(XColors.PaleGreen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen PaleTurquoise + { +#if USE_CACHE + get { return _paleTurquoise ?? (_paleTurquoise = new XPen(XColors.PaleTurquoise, 1, true)); } +#else + get { return new XPen(XColors.PaleTurquoise, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen PaleVioletRed + { +#if USE_CACHE + get { return _paleVioletRed ?? (_paleVioletRed = new XPen(XColors.PaleVioletRed, 1, true)); } +#else + get { return new XPen(XColors.PaleVioletRed, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen PapayaWhip + { +#if USE_CACHE + get { return _papayaWhip ?? (_papayaWhip = new XPen(XColors.PapayaWhip, 1, true)); } +#else + get { return new XPen(XColors.PapayaWhip, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen PeachPuff + { +#if USE_CACHE + get { return _peachPuff ?? (_peachPuff = new XPen(XColors.PeachPuff, 1, true)); } +#else + get { return new XPen(XColors.PeachPuff, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Peru + { +#if USE_CACHE + get { return _peru ?? (_peru = new XPen(XColors.Peru, 1, true)); } +#else + get { return new XPen(XColors.Peru, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Pink + { +#if USE_CACHE + get { return _pink ?? (_pink = new XPen(XColors.Pink, 1, true)); } +#else + get { return new XPen(XColors.Pink, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Plum + { +#if USE_CACHE + get { return _plum ?? (_plum = new XPen(XColors.Plum, 1, true)); } +#else + get { return new XPen(XColors.Plum, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen PowderBlue + { +#if USE_CACHE + get { return _powderBlue ?? (_powderBlue = new XPen(XColors.PowderBlue, 1, true)); } +#else + get { return new XPen(XColors.PowderBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Purple + { +#if USE_CACHE + get { return _purple ?? (_purple = new XPen(XColors.Purple, 1, true)); } +#else + get { return new XPen(XColors.Purple, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Red + { +#if USE_CACHE + get { return _red ?? (_red = new XPen(XColors.Red, 1, true)); } +#else + get { return new XPen(XColors.Red, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen RosyBrown + { +#if USE_CACHE + get { return _rosyBrown ?? (_rosyBrown = new XPen(XColors.RosyBrown, 1, true)); } +#else + get { return new XPen(XColors.RosyBrown, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen RoyalBlue + { +#if USE_CACHE + get { return _royalBlue ?? (_royalBlue = new XPen(XColors.RoyalBlue, 1, true)); } +#else + get { return new XPen(XColors.RoyalBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen SaddleBrown + { +#if USE_CACHE + get { return _saddleBrown ?? (_saddleBrown = new XPen(XColors.SaddleBrown, 1, true)); } +#else + get { return new XPen(XColors.SaddleBrown, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Salmon + { +#if USE_CACHE + get { return _salmon ?? (_salmon = new XPen(XColors.Salmon, 1, true)); } +#else + get { return new XPen(XColors.Salmon, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen SandyBrown + { +#if USE_CACHE + get { return _sandyBrown ?? (_sandyBrown = new XPen(XColors.SandyBrown, 1, true)); } +#else + get { return new XPen(XColors.SandyBrown, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen SeaGreen + { +#if USE_CACHE + get { return _seaGreen ?? (_seaGreen = new XPen(XColors.SeaGreen, 1, true)); } +#else + get { return new XPen(XColors.SeaGreen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen SeaShell + { +#if USE_CACHE + get { return _seaShell ?? (_seaShell = new XPen(XColors.SeaShell, 1, true)); } +#else + get { return new XPen(XColors.SeaShell, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Sienna + { +#if USE_CACHE + get { return _sienna ?? (_sienna = new XPen(XColors.Sienna, 1, true)); } +#else + get { return new XPen(XColors.Sienna, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Silver + { +#if USE_CACHE + get { return _silver ?? (_silver = new XPen(XColors.Silver, 1, true)); } +#else + get { return new XPen(XColors.Silver, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen SkyBlue + { +#if USE_CACHE + get { return _skyBlue ?? (_skyBlue = new XPen(XColors.SkyBlue, 1, true)); } +#else + get { return new XPen(XColors.SkyBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen SlateBlue + { +#if USE_CACHE + get { return _slateBlue ?? (_slateBlue = new XPen(XColors.SlateBlue, 1, true)); } +#else + get { return new XPen(XColors.SlateBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen SlateGray + { +#if USE_CACHE + get { return _slateGray ?? (_slateGray = new XPen(XColors.SlateGray, 1, true)); } +#else + get { return new XPen(XColors.SlateGray, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Snow + { +#if USE_CACHE + get { return _snow ?? (_snow = new XPen(XColors.Snow, 1, true)); } +#else + get { return new XPen(XColors.Snow, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen SpringGreen + { +#if USE_CACHE + get { return _springGreen ?? (_springGreen = new XPen(XColors.SpringGreen, 1, true)); } +#else + get { return new XPen(XColors.SpringGreen, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen SteelBlue + { +#if USE_CACHE + get { return _steelBlue ?? (_steelBlue = new XPen(XColors.SteelBlue, 1, true)); } +#else + get { return new XPen(XColors.SteelBlue, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Tan + { +#if USE_CACHE + get { return _tan ?? (_tan = new XPen(XColors.Tan, 1, true)); } +#else + get { return new XPen(XColors.Tan, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Teal + { +#if USE_CACHE + get { return _teal ?? (_teal = new XPen(XColors.Teal, 1, true)); } +#else + get { return new XPen(XColors.Teal, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Thistle + { +#if USE_CACHE + get { return _thistle ?? (_thistle = new XPen(XColors.Thistle, 1, true)); } +#else + get { return new XPen(XColors.Thistle, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Tomato + { +#if USE_CACHE + get { return _tomato ?? (_tomato = new XPen(XColors.Tomato, 1, true)); } +#else + get { return new XPen(XColors.Tomato, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Transparent + { +#if USE_CACHE + get { return _transparent ?? (_transparent = new XPen(XColors.Transparent, 1, true)); } +#else + get { return new XPen(XColors.Transparent, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Turquoise + { +#if USE_CACHE + get { return _turquoise ?? (_turquoise = new XPen(XColors.Turquoise, 1, true)); } +#else + get { return new XPen(XColors.Turquoise, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Violet + { +#if USE_CACHE + get { return _violet ?? (_violet = new XPen(XColors.Violet, 1, true)); } +#else + get { return new XPen(XColors.Violet, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Wheat + { +#if USE_CACHE + get { return _wheat ?? (_wheat = new XPen(XColors.Wheat, 1, true)); } +#else + get { return new XPen(XColors.Wheat, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen White + { +#if USE_CACHE + get { return _white ?? (_white = new XPen(XColors.White, 1, true)); } +#else + get { return new XPen(XColors.White, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen WhiteSmoke + { +#if USE_CACHE + get { return _whiteSmoke ?? (_whiteSmoke = new XPen(XColors.WhiteSmoke, 1, true)); } +#else + get { return new XPen(XColors.WhiteSmoke, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen Yellow + { +#if USE_CACHE + get { return _yellow ?? (_yellow = new XPen(XColors.Yellow, 1, true)); } +#else + get { return new XPen(XColors.Yellow, 1, true); } +#endif + } + + /// Gets a pre-defined XPen object. + public static XPen YellowGreen + { +#if USE_CACHE + get { return _yellowGreen ?? (_yellowGreen = new XPen(XColors.YellowGreen, 1, true)); } +#else + get { return new XPen(XColors.YellowGreen, 1, true); } +#endif + } + +#if USE_CACHE + static XPen _aliceBlue; + static XPen _antiqueWhite; + static XPen _aqua; + static XPen _aquamarine; + static XPen _azure; + static XPen _beige; + static XPen _bisque; + static XPen _black; + static XPen _blanchedAlmond; + static XPen _blue; + static XPen _blueViolet; + static XPen _brown; + static XPen _burlyWood; + static XPen _cadetBlue; + static XPen _chartreuse; + static XPen _chocolate; + static XPen _coral; + static XPen _cornflowerBlue; + static XPen _cornsilk; + static XPen _crimson; + static XPen _cyan; + static XPen _darkBlue; + static XPen _darkCyan; + static XPen _darkGoldenrod; + static XPen _darkGray; + static XPen _darkGreen; + static XPen _darkKhaki; + static XPen _darkMagenta; + static XPen _darkOliveGreen; + static XPen _darkOrange; + static XPen _darkOrchid; + static XPen _darkRed; + static XPen _darkSalmon; + static XPen _darkSeaGreen; + static XPen _darkSlateBlue; + static XPen _darkSlateGray; + static XPen _darkTurquoise; + static XPen _darkViolet; + static XPen _deepPink; + static XPen _deepSkyBlue; + static XPen _dimGray; + static XPen _dodgerBlue; + static XPen _firebrick; + static XPen _floralWhite; + static XPen _forestGreen; + static XPen _fuchsia; + static XPen _gainsboro; + static XPen _ghostWhite; + static XPen _gold; + static XPen _goldenrod; + static XPen _gray; + static XPen _green; + static XPen _greenYellow; + static XPen _honeydew; + static XPen _hotPink; + static XPen _indianRed; + static XPen _indigo; + static XPen _ivory; + static XPen _khaki; + static XPen _lavender; + static XPen _lavenderBlush; + static XPen _lawnGreen; + static XPen _lemonChiffon; + static XPen _lightBlue; + static XPen _lightCoral; + static XPen _lightCyan; + static XPen _lightGoldenrodYellow; + static XPen _lightGray; + static XPen _lightGreen; + static XPen _lightPink; + static XPen _lightSalmon; + static XPen _lightSeaGreen; + static XPen _lightSkyBlue; + static XPen _lightSlateGray; + static XPen _lightSteelBlue; + static XPen _lightYellow; + static XPen _lime; + static XPen _limeGreen; + static XPen _linen; + static XPen _magenta; + static XPen _maroon; + static XPen _mediumAquamarine; + static XPen _mediumBlue; + static XPen _mediumOrchid; + static XPen _mediumPurple; + static XPen _mediumSeaGreen; + static XPen _mediumSlateBlue; + static XPen _mediumSpringGreen; + static XPen _mediumTurquoise; + static XPen _mediumVioletRed; + static XPen _midnightBlue; + static XPen _mintCream; + static XPen _mistyRose; + static XPen _moccasin; + static XPen _navajoWhite; + static XPen _navy; + static XPen _oldLace; + static XPen _olive; + static XPen _oliveDrab; + static XPen _orange; + static XPen _orangeRed; + static XPen _orchid; + static XPen _paleGoldenrod; + static XPen _paleGreen; + static XPen _paleTurquoise; + static XPen _paleVioletRed; + static XPen _papayaWhip; + static XPen _peachPuff; + static XPen _peru; + static XPen _pink; + static XPen _plum; + static XPen _powderBlue; + static XPen _purple; + static XPen _red; + static XPen _rosyBrown; + static XPen _royalBlue; + static XPen _saddleBrown; + static XPen _salmon; + static XPen _sandyBrown; + static XPen _seaGreen; + static XPen _seaShell; + static XPen _sienna; + static XPen _silver; + static XPen _skyBlue; + static XPen _slateBlue; + static XPen _slateGray; + static XPen _snow; + static XPen _springGreen; + static XPen _steelBlue; + static XPen _tan; + static XPen _teal; + static XPen _thistle; + static XPen _tomato; + static XPen _transparent; + static XPen _turquoise; + static XPen _violet; + static XPen _wheat; + static XPen _white; + static XPen _whiteSmoke; + static XPen _yellow; + static XPen _yellowGreen; +#endif + } +} diff --git a/PdfSharp/Drawing/XPoint.cs b/PdfSharp/Drawing/XPoint.cs new file mode 100644 index 0000000..85c866a --- /dev/null +++ b/PdfSharp/Drawing/XPoint.cs @@ -0,0 +1,434 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using System.Runtime.InteropServices; +#if CORE +#endif +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows; +using SysPoint = System.Windows.Point; +using SysSize = System.Windows.Size; +#endif +#if NETFX_CORE +using Windows.UI.Xaml.Media; +using SysPoint = Windows.Foundation.Point; +using SysSize = Windows.Foundation.Size; +#endif +#if !EDF_CORE +using PdfSharp.Internal; +#else +using PdfSharp.Internal; +#endif + +#if !EDF_CORE +namespace PdfSharp.Drawing +#else +namespace Edf.Drawing +#endif +{ + /// + /// Represents a pair of floating point x- and y-coordinates that defines a point + /// in a two-dimensional plane. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + [Serializable] + [StructLayout(LayoutKind.Sequential)] // TypeConverter(typeof(PointConverter)), ValueSerializer(typeof(PointValueSerializer))] + public struct XPoint : IFormattable + { + /// + /// Initializes a new instance of the XPoint class with the specified coordinates. + /// + public XPoint(double x, double y) + { + _x = x; + _y = y; + } + +#if GDI + /// + /// Initializes a new instance of the XPoint class with the specified point. + /// + public XPoint(System.Drawing.Point point) + { + _x = point.X; + _y = point.Y; + } +#endif + +#if WPF || NETFX_CORE + /// + /// Initializes a new instance of the XPoint class with the specified point. + /// + public XPoint(SysPoint point) + { + _x = point.X; + _y = point.Y; + } +#endif + +#if GDI + /// + /// Initializes a new instance of the XPoint class with the specified point. + /// + public XPoint(PointF point) + { + _x = point.X; + _y = point.Y; + } +#endif + + /// + /// Determines whether two points are equal. + /// + public static bool operator ==(XPoint point1, XPoint point2) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + return point1._x == point2._x && point1._y == point2._y; + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Determines whether two points are not equal. + /// + public static bool operator !=(XPoint point1, XPoint point2) + { + return !(point1 == point2); + } + + /// + /// Indicates whether the specified points are equal. + /// + public static bool Equals(XPoint point1, XPoint point2) + { + return point1.X.Equals(point2.X) && point1.Y.Equals(point2.Y); + } + + /// + /// Indicates whether this instance and a specified object are equal. + /// + public override bool Equals(object o) + { + if (!(o is XPoint)) + return false; + return Equals(this, (XPoint)o); + } + + /// + /// Indicates whether this instance and a specified point are equal. + /// + public bool Equals(XPoint value) + { + return Equals(this, value); + } + + /// + /// Returns the hash code for this instance. + /// + public override int GetHashCode() + { + return X.GetHashCode() ^ Y.GetHashCode(); + } + + /// + /// Parses the point from a string. + /// + public static XPoint Parse(string source) + { + CultureInfo cultureInfo = CultureInfo.InvariantCulture; + TokenizerHelper helper = new TokenizerHelper(source, cultureInfo); + string str = helper.NextTokenRequired(); + XPoint point = new XPoint(Convert.ToDouble(str, cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo)); + helper.LastTokenRequired(); + return point; + } + + /// + /// Parses an array of points from a string. + /// + public static XPoint[] ParsePoints(string value) + { + if (value == null) + throw new ArgumentNullException("value"); + // TODO: Reflect reliabel implementation from Avalon + // TODOWPF + string[] values = value.Split(' '); + int count = values.Length; + XPoint[] points = new XPoint[count]; + for (int idx = 0; idx < count; idx++) + points[idx] = Parse(values[idx]); + return points; + } + + /// + /// Gets the x-coordinate of this XPoint. + /// + public double X + { + get { return _x; } + set { _x = value; } + } + double _x; + + /// + /// Gets the x-coordinate of this XPoint. + /// + public double Y + { + get { return _y; } + set { _y = value; } + } + double _y; + +#if CORE +#if UseGdiObjects + /// + /// Converts this XPoint to a System.Drawing.Point. + /// + public PointF ToPointF() + { + return new PointF((float)_x, (float)_y); + } +#endif +#endif + +#if GDI + /// + /// Converts this XPoint to a System.Drawing.Point. + /// + public PointF ToPointF() + { + return new PointF((float)_x, (float)_y); + } +#endif + +#if WPF || NETFX_CORE + /// + /// Converts this XPoint to a System.Windows.Point. + /// + public SysPoint ToPoint() + { + return new SysPoint(_x, _y); + } +#endif + + /// + /// Converts this XPoint to a human readable string. + /// + public override string ToString() + { + return ConvertToString(null, null); + } + + /// + /// Converts this XPoint to a human readable string. + /// + public string ToString(IFormatProvider provider) + { + return ConvertToString(null, provider); + } + + /// + /// Converts this XPoint to a human readable string. + /// + string IFormattable.ToString(string format, IFormatProvider provider) + { + return ConvertToString(format, provider); + } + + /// + /// Implements ToString. + /// + internal string ConvertToString(string format, IFormatProvider provider) + { + char numericListSeparator = TokenizerHelper.GetNumericListSeparator(provider); + provider = provider ?? CultureInfo.InvariantCulture; + return string.Format(provider, "{1:" + format + "}{0}{2:" + format + "}", new object[] { numericListSeparator, _x, _y }); + } + + /// + /// Offsets the x and y value of this point. + /// + public void Offset(double offsetX, double offsetY) + { + _x += offsetX; + _y += offsetY; + } + + /// + /// Adds a point and a vector. + /// + public static XPoint operator +(XPoint point, XVector vector) + { + return new XPoint(point._x + vector.X, point._y + vector.Y); + } + + /// + /// Adds a point and a size. + /// + public static XPoint operator +(XPoint point, XSize size) // TODO: make obsolete + { + return new XPoint(point._x + size.Width, point._y + size.Height); + } + + /// + /// Adds a point and a vector. + /// + public static XPoint Add(XPoint point, XVector vector) + { + return new XPoint(point._x + vector.X, point._y + vector.Y); + } + + /// + /// Subtracts a vector from a point. + /// + public static XPoint operator -(XPoint point, XVector vector) + { + return new XPoint(point._x - vector.X, point._y - vector.Y); + } + + /// + /// Subtracts a vector from a point. + /// + public static XPoint Subtract(XPoint point, XVector vector) + { + return new XPoint(point._x - vector.X, point._y - vector.Y); + } + + /// + /// Subtracts a point from a point. + /// + public static XVector operator -(XPoint point1, XPoint point2) + { + return new XVector(point1._x - point2._x, point1._y - point2._y); + } + + /// + /// Subtracts a size from a point. + /// + [Obsolete("Use XVector instead of XSize as second parameter.")] + public static XPoint operator -(XPoint point, XSize size) // TODO: make obsolete + { + return new XPoint(point._x - size.Width, point._y - size.Height); + } + + /// + /// Subtracts a point from a point. + /// + public static XVector Subtract(XPoint point1, XPoint point2) + { + return new XVector(point1._x - point2._x, point1._y - point2._y); + } + + /// + /// Multiplies a point with a matrix. + /// + public static XPoint operator *(XPoint point, XMatrix matrix) + { + return matrix.Transform(point); + } + + /// + /// Multiplies a point with a matrix. + /// + public static XPoint Multiply(XPoint point, XMatrix matrix) + { + return matrix.Transform(point); + } + + /// + /// Multiplies a point with a scalar value. + /// + public static XPoint operator *(XPoint point, double value) + { + return new XPoint(point._x * value, point._y * value); + } + + /// + /// Multiplies a point with a scalar value. + /// + public static XPoint operator *(double value, XPoint point) + { + return new XPoint(value * point._x, value * point._y); + } + + /// + /// Performs an explicit conversion from XPoint to XSize. + /// + public static explicit operator XSize(XPoint point) + { + return new XSize(Math.Abs(point._x), Math.Abs(point._y)); + } + + /// + /// Performs an explicit conversion from XPoint to XVector. + /// + public static explicit operator XVector(XPoint point) + { + return new XVector(point._x, point._y); + } + +#if WPF || NETFX_CORE + /// + /// Performs an implicit conversion from XPoint to Point. + /// + public static implicit operator SysPoint(XPoint point) + { + return new SysPoint(point.X, point.Y); + } + + /// + /// Performs an implicit conversion from Point to XPoint. + /// + public static implicit operator XPoint(SysPoint point) + { + return new XPoint(point.X, point.Y); + } +#endif + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + // ReSharper disable UnusedMember.Local + string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get + { + const string format = Config.SignificantFigures10; + return String.Format(CultureInfo.InvariantCulture, "point=({0:" + format + "}, {1:" + format + "})", _x, _y); + } + } + } +} diff --git a/PdfSharp/Drawing/XPrivateFontCollection.cs b/PdfSharp/Drawing/XPrivateFontCollection.cs new file mode 100644 index 0000000..2b27685 --- /dev/null +++ b/PdfSharp/Drawing/XPrivateFontCollection.cs @@ -0,0 +1,441 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Runtime.InteropServices; +using PdfSharp.Fonts; +#if CORE || GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using GdiFontFamily = System.Drawing.FontFamily; +using GdiFont = System.Drawing.Font; +using GdiFontStyle = System.Drawing.FontStyle; +using GdiPrivateFontCollection = System.Drawing.Text.PrivateFontCollection; +#endif +#if WPF +using System.Windows.Markup; +using WpfFonts = System.Windows.Media.Fonts; +using WpfFontFamily = System.Windows.Media.FontFamily; +using WpfTypeface = System.Windows.Media.Typeface; +using WpfGlyphTypeface = System.Windows.Media.GlyphTypeface; +#endif + +namespace PdfSharp.Drawing +{ +#if true + /// + /// Makes fonts that are not installed on the system available within the current application domain.
+ /// In Silverlight required for all fonts used in PDF documents. + ///
+ public sealed class XPrivateFontCollection + { + // This one is global and can only grow. It is not possible to remove fonts that have been added. + + /// + /// Initializes a new instance of the class. + /// + XPrivateFontCollection() + { + // HACK: Use one global PrivateFontCollection in GDI+ + } + +#if GDI + //internal PrivateFontCollection PrivateFontCollection + //{ + // get { return privateFontCollection; } + // set { privateFontCollection = value; } + //} + + GdiPrivateFontCollection GetPrivateFontCollection() + { + // Create only if really needed. + if (_privateFontCollection == null) + _privateFontCollection = new GdiPrivateFontCollection(); + return _privateFontCollection; + } + + // PrivateFontCollection of GDI+ + private GdiPrivateFontCollection _privateFontCollection; +#endif + + /// + /// Gets the global font collection. + /// + internal static XPrivateFontCollection Singleton + { + get { return _singleton; } + } + internal static XPrivateFontCollection _singleton = new XPrivateFontCollection(); + +#if GDI + /// + /// Adds the font data to the font collections. + /// + [Obsolete("Use Add(Stream stream)")] + public void AddFont(byte[] data, string familyName) + { + if (String.IsNullOrEmpty(familyName)) + throw new ArgumentNullException("familyName"); + + //if (glyphTypeface == null) + // throw new ArgumentNullException("glyphTypeface"); + + // Add to GDI+ PrivateFontCollection + int length = data.Length; + + // Copy data without unsafe code + IntPtr ip = Marshal.AllocCoTaskMem(length); + Marshal.Copy(data, 0, ip, length); + GetPrivateFontCollection().AddMemoryFont(ip, length); + // Do not free the memory here, AddMemoryFont stores a pointer, not a copy! + //Marshal.FreeCoTaskMem(ip); + //privateFonts.Add(glyphTypeface); + } +#endif + + /// + /// Adds the specified font data to the global PrivateFontCollection. + /// Family name and style are automatically retrieved from the font. + /// +#if GDI + [Obsolete("Use Add(Stream stream)")] +#else + [Obsolete("Use the GDI build of PDFsharp and use Add(Stream stream)")] +#endif + public static void AddFont(string filename) + { + throw new NotImplementedException(); + //XGlyphTypeface glyphTypeface = new XGlyphTypeface(filename); + //Global.AddGlyphTypeface(glyphTypeface); + } + +#if GDI + /// + /// Adds the specified font data to the global PrivateFontCollection. + /// Family name and style are automatically retrieved from the font. + /// + [Obsolete("Use Add(stream).")] + public static void AddFont(Stream stream) + { + Add(stream); + } + + /// + /// Adds the specified font data to the global PrivateFontCollection. + /// Family name and style are automatically retrieved from the font. + /// + public static void Add(Stream stream) + { + int length = (int)stream.Length; + byte[] bytes = new byte[length]; + stream.Read(bytes, 0, length); + Add(bytes); + } + + /// + /// Adds the specified font data to the global PrivateFontCollection. + /// Family name and style are automatically retrieved from the font. + /// + public static void Add(byte[] font) + { + IntPtr unmanagedPointer = Marshal.AllocCoTaskMem(font.Length); + Marshal.Copy(font, 0, unmanagedPointer, font.Length); + Singleton.GetPrivateFontCollection().AddMemoryFont(unmanagedPointer, font.Length); + // Do not free the memory here, AddMemoryFont stores a pointer, not a copy! + //Marshal.FreeCoTaskMem(ip); + + XFontSource fontSource = XFontSource.GetOrCreateFrom(font); + + string familyName = fontSource.FontName; + + if (familyName.EndsWith(" Regular", StringComparison.OrdinalIgnoreCase)) + familyName = familyName.Substring(0, familyName.Length - 8); + + bool bold = fontSource.Fontface.os2.IsBold; + bool italic = fontSource.Fontface.os2.IsItalic; + IncompetentlyMakeAHackToFixAProblemYouWoldNeverHaveIfYouUseAFontResolver(fontSource, ref familyName, ref bold, ref italic); + string key = MakeKey(familyName, bold, italic); + Singleton._fontSources.Add(key, fontSource); + + string typefaceKey = XGlyphTypeface.ComputeKey(familyName, bold, italic); + FontFactory.CacheExistingFontSourceWithNewTypefaceKey(typefaceKey, fontSource); + } + + static void IncompetentlyMakeAHackToFixAProblemYouWoldNeverHaveIfYouUseAFontResolver(XFontSource fontSource, + ref string familyName, ref bool bold, ref bool italic) + { + const string regularSuffix = " Regular"; + const string boldSuffix = " Bold"; + const string italicSuffix = " Italic"; + const string boldItalicSuffix = " Bold Italic"; + const string italicBoldSuffix = " Italic Bold"; + + if (familyName.EndsWith(regularSuffix, StringComparison.OrdinalIgnoreCase)) + { + familyName = familyName.Substring(0, familyName.Length - regularSuffix.Length); + Debug.Assert(!bold && !italic); + bold = italic = false; + } + else if (familyName.EndsWith(boldItalicSuffix, StringComparison.OrdinalIgnoreCase) || familyName.EndsWith(italicBoldSuffix, StringComparison.OrdinalIgnoreCase)) + { + familyName = familyName.Substring(0, familyName.Length - boldItalicSuffix.Length); + Debug.Assert(bold && italic); + bold = italic = true; + } + else if (familyName.EndsWith(boldSuffix, StringComparison.OrdinalIgnoreCase)) + { + familyName = familyName.Substring(0, familyName.Length - boldSuffix.Length); + Debug.Assert(bold && !italic); + bold = true; + italic = false; + } + else if (familyName.EndsWith(italicSuffix, StringComparison.OrdinalIgnoreCase)) + { + familyName = familyName.Substring(0, familyName.Length - italicSuffix.Length); + Debug.Assert(!bold && italic); + bold = false; + italic = true; + } + else + { + Debug.Assert(!bold && !italic); + bold = false; + italic = false; + } + } +#endif + + /// + /// Adds the specified font data to the global PrivateFontCollection. + /// Family name and style are automatically retrieved from the font. + /// +#if GDI + [Obsolete("Use Add(Stream stream)")] +#else + [Obsolete("Use the GDI build of PDFsharp and use Add(Stream stream)")] +#endif + public static void AddFont(Stream stream, string facename) + { + throw new NotImplementedException(); + //XGlyphTypeface glyphTypeface = new XGlyphTypeface(stream, facename); + //Global.AddGlyphTypeface(glyphTypeface); + } + + // /// + // /// Adds XGlyphTypeface to internal collection. + // /// Family name and style are automatically retrieved from the font. + // /// + // void AddGlyphTypeface(XGlyphTypeface glyphTypeface) + // { + // string name = MakeName(glyphTypeface); + // if (_typefaces.ContainsKey(name)) + // throw new InvalidOperationException(PSSR.FontAlreadyAdded(glyphTypeface.DisplayName)); + + // _typefaces.Add(name, glyphTypeface); + // //Debug.WriteLine("Font added: " + name); + + //#if GDI + // // Add to GDI+ PrivateFontCollection singleton. + // byte[] data = glyphTypeface.Fontface.FontSource.Bytes; + // int length = data.Length; + + // IntPtr ip = Marshal.AllocCoTaskMem(length); + // Marshal.Copy(data, 0, ip, length); + // _privateFontCollection.AddMemoryFont(ip, length); + // // Do not free the memory here, AddMemoryFont stores a pointer, not a copy! + // // Marshal.FreeCoTaskMem(ip); + //#endif + + //#if WPF + //#endif + // } + +#if WPF + /// + /// Initializes a new instance of the FontFamily class from the specified font family name and an optional base uniform resource identifier (URI) value. + /// Sample: Add(new Uri("pack://application:,,,/"), "./myFonts/#FontFamilyName");) + /// + /// Specifies the base URI that is used to resolve familyName. + /// The family name or names that comprise the new FontFamily. Multiple family names should be separated by commas. + public static void Add(Uri baseUri, string familyName) + { + Uri uri = new Uri("pack://application:,,,/"); + + // TODO: What means 'Multiple family names should be separated by commas.'? + // does not work + + + if (String.IsNullOrEmpty(familyName)) + throw new ArgumentNullException("familyName"); + + if (familyName.Contains(",")) + throw new NotImplementedException("Only one family name is supported."); + + // Family name starts right of '#'. + int idxHash = familyName.IndexOf('#'); + if (idxHash < 0) + throw new ArgumentException("Family name must contain a '#'. Example './#MyFontFamilyName'", "familyName"); + + string key = familyName.Substring(idxHash + 1); + if (String.IsNullOrEmpty(key)) + throw new ArgumentException("familyName has invalid format."); + + if (Singleton._fontFamilies.ContainsKey(key)) + throw new ArgumentException("An entry with the specified family name already exists."); + +#if !SILVERLIGHT +#if DEBUG_ + foreach (WpfFontFamily fontFamily1 in WpfFonts.GetFontFamilies(baseUri, familyName)) + { + ICollection wpfTypefaces = fontFamily1.GetTypefaces(); + wpfTypefaces.GetType(); + } +#endif + // Create WPF font family. + WpfFontFamily fontFamily = new WpfFontFamily(baseUri, familyName); + //System.Windows.Media.FontFamily x; + // Required for new Uri("pack://application:,,,/") + // ReSharper disable once ObjectCreationAsStatement + // new System.Windows.Application(); + +#else + System.Windows.Media.FontFamily fontFamily = new System.Windows.Media.FontFamily(familyName); +#endif + + // Check whether font data really exists +#if DEBUG && !SILVERLIGHT + ICollection list = fontFamily.GetTypefaces(); + foreach (WpfTypeface typeFace in list) + { + Debug.WriteLine(String.Format("{0}, {1}, {2}, {3}, {4}", familyName, typeFace.FaceNames[FontHelper.XmlLanguageEnUs], typeFace.Style, typeFace.Weight, typeFace.Stretch)); + WpfGlyphTypeface glyphTypeface; + if (!typeFace.TryGetGlyphTypeface(out glyphTypeface)) + { + Debug.WriteLine(" Glyph typeface does not exists."); + //throw new ArgumentException("Font with the specified family name does not exist."); + } + } +#endif + + Singleton._fontFamilies.Add(key, fontFamily); + } +#endif + + //internal static XGlyphTypeface TryGetXGlyphTypeface(string familyName, XFontStyle style) + //{ + // string name = MakeName(familyName, style); + + // XGlyphTypeface typeface; + // _global._typefaces.TryGetValue(name, out typeface); + // return typeface; + //} + +#if GDI + internal static GdiFont TryCreateFont(string name, double size, GdiFontStyle style, out XFontSource fontSource) + { + fontSource = null; + try + { + GdiPrivateFontCollection pfc = Singleton._privateFontCollection; + if (pfc == null) + return null; +#if true + string key = MakeKey(name, (XFontStyle)style); + if (Singleton._fontSources.TryGetValue(key, out fontSource)) + { + GdiFont font = new GdiFont(name, (float)size, style, GraphicsUnit.World); +#if DEBUG_ + Debug.Assert(StringComparer.OrdinalIgnoreCase.Compare(name, font.Name) == 0); + Debug.Assert(font.Bold == ((style & GdiFontStyle.Bold) != 0)); + Debug.Assert(font.Italic == ((style & GdiFontStyle.Italic) != 0)); +#endif + return font; + } + return null; +#else + foreach (GdiFontFamily family in pfc.Families) + { + if (string.Compare(family.Name, name, StringComparison.OrdinalIgnoreCase) == 0) + { + GdiFont font = new GdiFont(family, (float)size, style, GraphicsUnit.World); + if (string.Compare(font.Name, name, StringComparison.OrdinalIgnoreCase) != 0) + { + // Style simulation is not implemented in GDI+. + // Use WPF build. + } + return font; + } + } +#endif + } + catch (Exception ex) + { + // Ignore exception and return null. + Debug.WriteLine(ex.ToString()); + } + return null; + } +#endif + +#if WPF && !SILVERLIGHT + internal static WpfTypeface TryCreateTypeface(string name, XFontStyle style, out WpfFontFamily fontFamily) + { + if (Singleton._fontFamilies.TryGetValue(name, out fontFamily)) + { + WpfTypeface typeface = FontHelper.CreateTypeface(fontFamily, style); + return typeface; + } + return null; + } +#endif + + static string MakeKey(string familyName, XFontStyle style) + { + return MakeKey(familyName, (style & XFontStyle.Bold) != 0, (style & XFontStyle.Italic) != 0); + } + + static string MakeKey(string familyName, bool bold, bool italic) + { + return familyName + "#" + (bold ? "b" : "") + (italic ? "i" : ""); + } + + readonly Dictionary _typefaces = new Dictionary(); +#if GDI + //List privateFonts = new List(); + readonly Dictionary _fontSources = new Dictionary(StringComparer.OrdinalIgnoreCase); +#endif +#if WPF + readonly Dictionary _fontFamilies = new Dictionary(StringComparer.OrdinalIgnoreCase); +#endif + } +#endif +} diff --git a/PdfSharp/Drawing/XRect.cs b/PdfSharp/Drawing/XRect.cs new file mode 100644 index 0000000..9c07135 --- /dev/null +++ b/PdfSharp/Drawing/XRect.cs @@ -0,0 +1,847 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using System.Runtime.InteropServices; +#if CORE +#endif +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +using SysPoint = System.Windows.Point; +using SysSize = System.Windows.Size; +using SysRect = System.Windows.Rect; +#endif +#if NETFX_CORE +using Windows.UI.Xaml.Media; +using SysPoint = Windows.Foundation.Point; +using SysSize = Windows.Foundation.Size; +using SysRect = Windows.Foundation.Rect; +#endif +#if !EDF_CORE +using PdfSharp.Internal; +#else +using PdfSharp.Internal; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Stores a set of four floating-point numbers that represent the location and size of a rectangle. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + [Serializable, StructLayout(LayoutKind.Sequential)] // , ValueSerializer(typeof(RectValueSerializer)), TypeConverter(typeof(RectConverter))] + public struct XRect : IFormattable + { + /// + /// Initializes a new instance of the XRect class. + /// + public XRect(double x, double y, double width, double height) + { + if (width < 0 || height < 0) + throw new ArgumentException("WidthAndHeightCannotBeNegative"); //SR.Get(SRID.Size_WidthAndHeightCannotBeNegative, new object[0])); + _x = x; + _y = y; + _width = width; + _height = height; + } + + /// + /// Initializes a new instance of the XRect class. + /// + public XRect(XPoint point1, XPoint point2) + { + _x = Math.Min(point1.X, point2.X); + _y = Math.Min(point1.Y, point2.Y); + _width = Math.Max(Math.Max(point1.X, point2.X) - _x, 0); + _height = Math.Max(Math.Max(point1.Y, point2.Y) - _y, 0); + } + + /// + /// Initializes a new instance of the XRect class. + /// + public XRect(XPoint point, XVector vector) + : this(point, point + vector) + { } + + /// + /// Initializes a new instance of the XRect class. + /// + public XRect(XPoint location, XSize size) + { + if (size.IsEmpty) + this = s_empty; + else + { + _x = location.X; + _y = location.Y; + _width = size.Width; + _height = size.Height; + } + } + + /// + /// Initializes a new instance of the XRect class. + /// + public XRect(XSize size) + { + if (size.IsEmpty) + this = s_empty; + else + { + _x = _y = 0; + _width = size.Width; + _height = size.Height; + } + } + +#if GDI + /// + /// Initializes a new instance of the XRect class. + /// + public XRect(PointF location, SizeF size) + { + _x = location.X; + _y = location.Y; + _width = size.Width; + _height = size.Height; + } +#endif + +#if GDI + /// + /// Initializes a new instance of the XRect class. + /// + public XRect(RectangleF rect) + { + _x = rect.X; + _y = rect.Y; + _width = rect.Width; + _height = rect.Height; + } +#endif + +#if WPF || NETFX_CORE + /// + /// Initializes a new instance of the XRect class. + /// + public XRect(SysRect rect) + { + _x = rect.X; + _y = rect.Y; + _width = rect.Width; + _height = rect.Height; + } +#endif + + /// + /// Creates a rectangle from for straight lines. + /// + // ReSharper disable InconsistentNaming + public static XRect FromLTRB(double left, double top, double right, double bottom) + // ReSharper restore InconsistentNaming + { + return new XRect(left, top, right - left, bottom - top); + } + + /// + /// Determines whether the two rectangles are equal. + /// + public static bool operator ==(XRect rect1, XRect rect2) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + return rect1.X == rect2.X && rect1.Y == rect2.Y && rect1.Width == rect2.Width && rect1.Height == rect2.Height; + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Determines whether the two rectangles are not equal. + /// + public static bool operator !=(XRect rect1, XRect rect2) + { + return !(rect1 == rect2); + } + + /// + /// Determines whether the two rectangles are equal. + /// + public static bool Equals(XRect rect1, XRect rect2) + { + if (rect1.IsEmpty) + return rect2.IsEmpty; + return rect1.X.Equals(rect2.X) && rect1.Y.Equals(rect2.Y) && rect1.Width.Equals(rect2.Width) && rect1.Height.Equals(rect2.Height); + } + + /// + /// Determines whether this instance and the specified object are equal. + /// + public override bool Equals(object o) + { + if (!(o is XRect)) + return false; + return Equals(this, (XRect)o); + } + + /// + /// Determines whether this instance and the specified rect are equal. + /// + public bool Equals(XRect value) + { + return Equals(this, value); + } + + /// + /// Returns the hash code for this instance. + /// + public override int GetHashCode() + { + if (IsEmpty) + return 0; + return X.GetHashCode() ^ Y.GetHashCode() ^ Width.GetHashCode() ^ Height.GetHashCode(); + } + + /// + /// Parses the rectangle from a string. + /// + public static XRect Parse(string source) + { + XRect empty; + CultureInfo cultureInfo = CultureInfo.InvariantCulture; + TokenizerHelper helper = new TokenizerHelper(source, cultureInfo); + string str = helper.NextTokenRequired(); + if (str == "Empty") + empty = Empty; + else + empty = new XRect(Convert.ToDouble(str, cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo)); + helper.LastTokenRequired(); + return empty; + } + + /// + /// Converts this XRect to a human readable string. + /// + public override string ToString() + { + return ConvertToString(null, null); + } + + /// + /// Converts this XRect to a human readable string. + /// + public string ToString(IFormatProvider provider) + { + return ConvertToString(null, provider); + } + + /// + /// Converts this XRect to a human readable string. + /// + string IFormattable.ToString(string format, IFormatProvider provider) + { + return ConvertToString(format, provider); + } + + internal string ConvertToString(string format, IFormatProvider provider) + { + if (IsEmpty) + return "Empty"; + char numericListSeparator = TokenizerHelper.GetNumericListSeparator(provider); + provider = provider ?? CultureInfo.InvariantCulture; + // ReSharper disable FormatStringProblem + return string.Format(provider, "{1:" + format + "}{0}{2:" + format + "}{0}{3:" + format + "}{0}{4:" + format + "}", new object[] { numericListSeparator, _x, _y, _width, _height }); + // ReSharper restore FormatStringProblem + } + + /// + /// Gets the empty rectangle. + /// + public static XRect Empty + { + get { return s_empty; } + } + + /// + /// Gets a value indicating whether this instance is empty. + /// + public bool IsEmpty + { + get { return _width < 0; } + } + + /// + /// Gets or sets the location of the rectangle. + /// + public XPoint Location + { + get { return new XPoint(_x, _y); } + set + { + if (IsEmpty) + throw new InvalidOperationException("CannotModifyEmptyRect"); //SR.Get(SRID.Rect_CannotModifyEmptyRect, new object[0])); + _x = value.X; + _y = value.Y; + } + } + + /// + /// Gets or sets the size of the rectangle. + /// + //[Browsable(false)] + public XSize Size + { + get + { + if (IsEmpty) + return XSize.Empty; + return new XSize(_width, _height); + } + set + { + if (value.IsEmpty) + this = s_empty; + else + { + if (IsEmpty) + throw new InvalidOperationException("CannotModifyEmptyRect"); //SR.Get(SRID.Rect_CannotModifyEmptyRect, new object[0])); + _width = value.Width; + _height = value.Height; + } + } + } + + /// + /// Gets or sets the X value of the rectangle. + /// + public double X + { + get { return _x; } + set + { + if (IsEmpty) + throw new InvalidOperationException("CannotModifyEmptyRect"); //SR.Get(SRID.Rect_CannotModifyEmptyRect, new object[0])); + _x = value; + } + } + double _x; + + /// + /// Gets or sets the Y value of the rectangle. + /// + public double Y + { + get { return _y; } + set + { + if (IsEmpty) + throw new InvalidOperationException("CannotModifyEmptyRect"); //SR.Get(SRID.Rect_CannotModifyEmptyRect, new object[0])); + _y = value; + } + } + double _y; + + /// + /// Gets or sets the width of the rectangle. + /// + public double Width + { + get { return _width; } + set + { + if (IsEmpty) + throw new InvalidOperationException("CannotModifyEmptyRect"); //SR.Get(SRID.Rect_CannotModifyEmptyRect, new object[0])); + if (value < 0) + throw new ArgumentException("WidthCannotBeNegative"); //SR.Get(SRID.Size_WidthCannotBeNegative, new object[0])); + + _width = value; + } + } + double _width; + + /// + /// Gets or sets the height of the rectangle. + /// + public double Height + { + get { return _height; } + set + { + if (IsEmpty) + throw new InvalidOperationException("CannotModifyEmptyRect"); //SR.Get(SRID.Rect_CannotModifyEmptyRect, new object[0])); + if (value < 0) + throw new ArgumentException("HeightCannotBeNegative"); //SR.Get(SRID.Size_HeightCannotBeNegative, new object[0])); + _height = value; + } + } + double _height; + + /// + /// Gets the x-axis value of the left side of the rectangle. + /// + public double Left + { + get { return _x; } + } + + /// + /// Gets the y-axis value of the top side of the rectangle. + /// + public double Top + { + get { return _y; } + } + + /// + /// Gets the x-axis value of the right side of the rectangle. + /// + public double Right + { + get + { + if (IsEmpty) + return double.NegativeInfinity; + return _x + _width; + } + } + + /// + /// Gets the y-axis value of the bottom side of the rectangle. + /// + public double Bottom + { + get + { + if (IsEmpty) + return double.NegativeInfinity; + return _y + _height; + } + } + + /// + /// Gets the position of the top-left corner of the rectangle. + /// + public XPoint TopLeft + { + get { return new XPoint(Left, Top); } + } + + /// + /// Gets the position of the top-right corner of the rectangle. + /// + public XPoint TopRight + { + get { return new XPoint(Right, Top); } + } + + /// + /// Gets the position of the bottom-left corner of the rectangle. + /// + public XPoint BottomLeft + { + get { return new XPoint(Left, Bottom); } + } + + /// + /// Gets the position of the bottom-right corner of the rectangle. + /// + public XPoint BottomRight + { + get { return new XPoint(Right, Bottom); } + } + + /// + /// Gets the center of the rectangle. + /// + //[Browsable(false)] + public XPoint Center + { + get { return new XPoint(_x + _width / 2, _y + _height / 2); } + } + + /// + /// Indicates whether the rectangle contains the specified point. + /// + public bool Contains(XPoint point) + { + return Contains(point.X, point.Y); + } + + /// + /// Indicates whether the rectangle contains the specified point. + /// + public bool Contains(double x, double y) + { + if (IsEmpty) + return false; + return ContainsInternal(x, y); + } + + /// + /// Indicates whether the rectangle contains the specified rectangle. + /// + public bool Contains(XRect rect) + { + return !IsEmpty && !rect.IsEmpty && + _x <= rect._x && _y <= rect._y && + _x + _width >= rect._x + rect._width && _y + _height >= rect._y + rect._height; + } + + /// + /// Indicates whether the specified rectangle intersects with the current rectangle. + /// + public bool IntersectsWith(XRect rect) + { + return !IsEmpty && !rect.IsEmpty && + rect.Left <= Right && rect.Right >= Left && + rect.Top <= Bottom && rect.Bottom >= Top; + } + + /// + /// Sets current rectangle to the intersection of the current rectangle and the specified rectangle. + /// + public void Intersect(XRect rect) + { + if (!IntersectsWith(rect)) + this = Empty; + else + { + double left = Math.Max(Left, rect.Left); + double top = Math.Max(Top, rect.Top); + _width = Math.Max(Math.Min(Right, rect.Right) - left, 0.0); + _height = Math.Max(Math.Min(Bottom, rect.Bottom) - top, 0.0); + _x = left; + _y = top; + } + } + + /// + /// Returns the intersection of two rectangles. + /// + public static XRect Intersect(XRect rect1, XRect rect2) + { + rect1.Intersect(rect2); + return rect1; + } + + /// + /// Sets current rectangle to the union of the current rectangle and the specified rectangle. + /// + public void Union(XRect rect) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + if (IsEmpty) + this = rect; + else if (!rect.IsEmpty) + { + double left = Math.Min(Left, rect.Left); + double top = Math.Min(Top, rect.Top); + if (rect.Width == Double.PositiveInfinity || Width == Double.PositiveInfinity) + _width = Double.PositiveInfinity; + else + { + double right = Math.Max(Right, rect.Right); + _width = Math.Max(right - left, 0.0); + } + + if (rect.Height == Double.PositiveInfinity || _height == Double.PositiveInfinity) + _height = Double.PositiveInfinity; + else + { + double bottom = Math.Max(Bottom, rect.Bottom); + _height = Math.Max(bottom - top, 0.0); + } + _x = left; + _y = top; + } + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Returns the union of two rectangles. + /// + public static XRect Union(XRect rect1, XRect rect2) + { + rect1.Union(rect2); + return rect1; + } + + /// + /// Sets current rectangle to the union of the current rectangle and the specified point. + /// + public void Union(XPoint point) + { + Union(new XRect(point, point)); + } + + /// + /// Returns the intersection of a rectangle and a point. + /// + public static XRect Union(XRect rect, XPoint point) + { + rect.Union(new XRect(point, point)); + return rect; + } + + /// + /// Moves a rectangle by the specified amount. + /// + public void Offset(XVector offsetVector) + { + if (IsEmpty) + throw new InvalidOperationException("CannotCallMethod"); //SR.Get(SRID.Rect_CannotCallMethod, new object[0])); + _x += offsetVector.X; + _y += offsetVector.Y; + } + + /// + /// Moves a rectangle by the specified amount. + /// + public void Offset(double offsetX, double offsetY) + { + if (IsEmpty) + throw new InvalidOperationException("CannotCallMethod"); //SR.Get(SRID.Rect_CannotCallMethod, new object[0])); + _x += offsetX; + _y += offsetY; + } + + /// + /// Returns a rectangle that is offset from the specified rectangle by using the specified vector. + /// + public static XRect Offset(XRect rect, XVector offsetVector) + { + rect.Offset(offsetVector.X, offsetVector.Y); + return rect; + } + + /// + /// Returns a rectangle that is offset from the specified rectangle by using specified horizontal and vertical amounts. + /// + public static XRect Offset(XRect rect, double offsetX, double offsetY) + { + rect.Offset(offsetX, offsetY); + return rect; + } + + /// + /// Translates the rectangle by adding the specified point. + /// + //[Obsolete("Use Offset.")] + public static XRect operator +(XRect rect, XPoint point) + { + return new XRect(rect._x + point.X, rect.Y + point.Y, rect._width, rect._height); + } + + /// + /// Translates the rectangle by subtracting the specified point. + /// + //[Obsolete("Use Offset.")] + public static XRect operator -(XRect rect, XPoint point) + { + return new XRect(rect._x - point.X, rect.Y - point.Y, rect._width, rect._height); + } + + /// + /// Expands the rectangle by using the specified Size, in all directions. + /// + public void Inflate(XSize size) + { + Inflate(size.Width, size.Height); + } + + /// + /// Expands or shrinks the rectangle by using the specified width and height amounts, in all directions. + /// + public void Inflate(double width, double height) + { + if (IsEmpty) + throw new InvalidOperationException("CannotCallMethod"); //SR.Get(SRID.Rect_CannotCallMethod, new object[0])); + _x -= width; + _y -= height; + _width += width; + _width += width; + _height += height; + _height += height; + if (_width < 0 || _height < 0) + this = s_empty; + } + + /// + /// Returns the rectangle that results from expanding the specified rectangle by the specified Size, in all directions. + /// + public static XRect Inflate(XRect rect, XSize size) + { + rect.Inflate(size.Width, size.Height); + return rect; + } + + /// + /// Creates a rectangle that results from expanding or shrinking the specified rectangle by the specified width and height amounts, in all directions. + /// + public static XRect Inflate(XRect rect, double width, double height) + { + rect.Inflate(width, height); + return rect; + } + + /// + /// Returns the rectangle that results from applying the specified matrix to the specified rectangle. + /// + public static XRect Transform(XRect rect, XMatrix matrix) + { + XMatrix.MatrixHelper.TransformRect(ref rect, ref matrix); + return rect; + } + + /// + /// Transforms the rectangle by applying the specified matrix. + /// + public void Transform(XMatrix matrix) + { + XMatrix.MatrixHelper.TransformRect(ref this, ref matrix); + } + + /// + /// Multiplies the size of the current rectangle by the specified x and y values. + /// + public void Scale(double scaleX, double scaleY) + { + if (!IsEmpty) + { + _x *= scaleX; + _y *= scaleY; + _width *= scaleX; + _height *= scaleY; + if (scaleX < 0) + { + _x += _width; + _width *= -1.0; + } + if (scaleY < 0) + { + _y += _height; + _height *= -1.0; + } + } + } + +#if CORE // Internal version in CORE build. +#if UseGdiObjects + /// + /// Converts this instance to a System.Drawing.RectangleF. + /// + internal RectangleF ToRectangleF() + { + return new RectangleF((float)_x, (float)_y, (float)_width, (float)_height); + } +#endif +#endif + +#if GDI + /// + /// Converts this instance to a System.Drawing.RectangleF. + /// + public RectangleF ToRectangleF() + { + return new RectangleF((float)_x, (float)_y, (float)_width, (float)_height); + } +#endif + +#if GDI + /// + /// Performs an implicit conversion from a System.Drawing.Rectangle to an XRect. + /// + public static implicit operator XRect(Rectangle rect) + { + return new XRect(rect.X, rect.Y, rect.Width, rect.Height); + } + + /// + /// Performs an implicit conversion from a System.Drawing.RectangleF to an XRect. + /// + public static implicit operator XRect(RectangleF rect) + { + return new XRect(rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + +#if WPF || NETFX_CORE + /// + /// Performs an implicit conversion from System.Windows.Rect to XRect. + /// + public static implicit operator XRect(SysRect rect) + { + return new XRect(rect.X, rect.Y, rect.Width, rect.Height); + } +#endif + + bool ContainsInternal(double x, double y) + { + return x >= _x && x - _width <= _x && y >= _y && y - _height <= _y; + } + + static XRect CreateEmptyRect() + { + XRect rect = new XRect(); + rect._x = double.PositiveInfinity; + rect._y = double.PositiveInfinity; + rect._width = double.NegativeInfinity; + rect._height = double.NegativeInfinity; + return rect; + } + + static XRect() + { + s_empty = CreateEmptyRect(); + } + + static readonly XRect s_empty; + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + /// The debugger display. + // ReSharper disable UnusedMember.Local + string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get + { + const string format = Config.SignificantFigures10; + return String.Format(CultureInfo.InvariantCulture, + "rect=({0:" + format + "}, {1:" + format + "}, {2:" + format + "}, {3:" + format + "})", + _x, _y, _width, _height); + } + } + } +} diff --git a/PdfSharp/Drawing/XSize.cs b/PdfSharp/Drawing/XSize.cs new file mode 100644 index 0000000..e49fb1e --- /dev/null +++ b/PdfSharp/Drawing/XSize.cs @@ -0,0 +1,376 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using System.Runtime.InteropServices; +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows; +using SysPoint = System.Windows.Point; +using SysSize = System.Windows.Size; +#endif +#if NETFX_CORE +using Windows.UI.Xaml.Media; +using SysPoint = Windows.Foundation.Point; +using SysSize = Windows.Foundation.Size; +#endif +#if !EDF_CORE +using PdfSharp.Internal; +#else +using PdfSharp.Internal; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Represents a pair of floating-point numbers, typically the width and height of a + /// graphical object. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + [Serializable, StructLayout(LayoutKind.Sequential)] //, ValueSerializer(typeof(SizeValueSerializer)), TypeConverter(typeof(SizeConverter))] + public struct XSize : IFormattable + { + /// + /// Initializes a new instance of the XPoint class with the specified values. + /// + public XSize(double width, double height) + { + if (width < 0 || height < 0) + throw new ArgumentException("WidthAndHeightCannotBeNegative"); //SR.Get(SRID.Size_WidthAndHeightCannotBeNegative, new object[0])); + + _width = width; + _height = height; + } + + /// + /// Determines whether two size objects are equal. + /// + public static bool operator ==(XSize size1, XSize size2) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + return size1.Width == size2.Width && size1.Height == size2.Height; + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Determines whether two size objects are not equal. + /// + public static bool operator !=(XSize size1, XSize size2) + { + return !(size1 == size2); + } + + /// + /// Indicates whether this two instance are equal. + /// + public static bool Equals(XSize size1, XSize size2) + { + if (size1.IsEmpty) + return size2.IsEmpty; + return size1.Width.Equals(size2.Width) && size1.Height.Equals(size2.Height); + } + + /// + /// Indicates whether this instance and a specified object are equal. + /// + public override bool Equals(object o) + { + if (!(o is XSize)) + return false; + return Equals(this, (XSize)o); + } + + /// + /// Indicates whether this instance and a specified size are equal. + /// + public bool Equals(XSize value) + { + return Equals(this, value); + } + + /// + /// Returns the hash code for this instance. + /// + public override int GetHashCode() + { + if (IsEmpty) + return 0; + return Width.GetHashCode() ^ Height.GetHashCode(); + } + + /// + /// Parses the size from a string. + /// + public static XSize Parse(string source) + { + XSize empty; + CultureInfo cultureInfo = CultureInfo.InvariantCulture; + TokenizerHelper helper = new TokenizerHelper(source, cultureInfo); + string str = helper.NextTokenRequired(); + if (str == "Empty") + empty = Empty; + else + empty = new XSize(Convert.ToDouble(str, cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo)); + helper.LastTokenRequired(); + return empty; + } + +#if GDI + /// + /// Converts this XSize to a PointF. + /// + public PointF ToPointF() + { + return new PointF((float)_width, (float)_height); + } +#endif + + /// + /// Converts this XSize to an XPoint. + /// + public XPoint ToXPoint() + { + return new XPoint(_width, _height); + } + + /// + /// Converts this XSize to an XVector. + /// + public XVector ToXVector() + { + return new XVector(_width, _height); + } + +#if GDI + /// + /// Converts this XSize to a SizeF. + /// + public SizeF ToSizeF() + { + return new SizeF((float)_width, (float)_height); + } +#endif + +#if WPF || NETFX_CORE + /// + /// Converts this XSize to a System.Windows.Size. + /// + public SysSize ToSize() + { + return new SysSize(_width, _height); + } +#endif + +#if GDI + /// + /// Creates an XSize from a System.Drawing.Size. + /// + public static XSize FromSize(System.Drawing.Size size) + { + return new XSize(size.Width, size.Height); + } + + /// + /// Implicit conversion from XSize to System.Drawing.Size. The conversion must be implicit because the + /// WinForms designer uses it. + /// + public static implicit operator XSize(System.Drawing.Size size) + { + return new XSize(size.Width, size.Height); + } +#endif + +#if WPF || NETFX_CORE + /// + /// Creates an XSize from a System.Drawing.Size. + /// + public static XSize FromSize(SysSize size) + { + return new XSize(size.Width, size.Height); + } +#endif + +#if GDI + /// + /// Creates an XSize from a System.Drawing.Size. + /// + public static XSize FromSizeF(SizeF size) + { + return new XSize(size.Width, size.Height); + } +#endif + + /// + /// Converts this XSize to a human readable string. + /// + public override string ToString() + { + return ConvertToString(null, null); + } + + /// + /// Converts this XSize to a human readable string. + /// + public string ToString(IFormatProvider provider) + { + return ConvertToString(null, provider); + } + + /// + /// Converts this XSize to a human readable string. + /// + string IFormattable.ToString(string format, IFormatProvider provider) + { + return ConvertToString(format, provider); + } + + internal string ConvertToString(string format, IFormatProvider provider) + { + if (IsEmpty) + return "Empty"; + + char numericListSeparator = TokenizerHelper.GetNumericListSeparator(provider); + provider = provider ?? CultureInfo.InvariantCulture; + // ReSharper disable FormatStringProblem + return string.Format(provider, "{1:" + format + "}{0}{2:" + format + "}", new object[] { numericListSeparator, _width, _height }); + // ReSharper restore FormatStringProblem + } + + /// + /// Returns an empty size, i.e. a size with a width or height less than 0. + /// + public static XSize Empty + { + get { return s_empty; } + } + static readonly XSize s_empty; + + /// + /// Gets a value indicating whether this instance is empty. + /// + public bool IsEmpty + { + get { return _width < 0; } + } + + /// + /// Gets or sets the width. + /// + public double Width + { + get { return _width; } + set + { + if (IsEmpty) + throw new InvalidOperationException("CannotModifyEmptySize"); //SR.Get(SRID.Size_CannotModifyEmptySize, new object[0])); + if (value < 0) + throw new ArgumentException("WidthCannotBeNegative"); //SR.Get(SRID.Size_WidthCannotBeNegative, new object[0])); + _width = value; + } + } + double _width; + + /// + /// Gets or sets the height. + /// + public double Height + { + get { return _height; } + set + { + if (IsEmpty) + throw new InvalidOperationException("CannotModifyEmptySize"); // SR.Get(SRID.Size_CannotModifyEmptySize, new object[0])); + if (value < 0) + throw new ArgumentException("HeightCannotBeNegative"); //SR.Get(SRID.Size_HeightCannotBeNegative, new object[0])); + _height = value; + } + } + double _height; + + /// + /// Performs an explicit conversion from XSize to XVector. + /// + public static explicit operator XVector(XSize size) + { + return new XVector(size._width, size._height); + } + + /// + /// Performs an explicit conversion from XSize to XPoint. + /// + public static explicit operator XPoint(XSize size) + { + return new XPoint(size._width, size._height); + } + +#if WPF || NETFX_CORE + /// + /// Performs an explicit conversion from Size to XSize. + /// + public static explicit operator XSize(SysSize size) + { + return new XSize(size.Width, size.Height); + } +#endif + + private static XSize CreateEmptySize() + { + XSize size = new XSize(); + size._width = double.NegativeInfinity; + size._height = double.NegativeInfinity; + return size; + } + + static XSize() + { + s_empty = CreateEmptySize(); + } + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + /// The debugger display. + // ReSharper disable UnusedMember.Local + string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get + { + const string format = Config.SignificantFigures10; + return String.Format(CultureInfo.InvariantCulture, + "size=({2}{0:" + format + "}, {1:" + format + "})", + _width, _height, IsEmpty ? "Empty " : ""); + } + } + } +} diff --git a/PdfSharp/Drawing/XSolidBrush.cs b/PdfSharp/Drawing/XSolidBrush.cs new file mode 100644 index 0000000..b7d0825 --- /dev/null +++ b/PdfSharp/Drawing/XSolidBrush.cs @@ -0,0 +1,178 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +#endif +#if UWP +using Microsoft.Graphics.Canvas; +using Microsoft.Graphics.Canvas.Brushes; +using UwpBrush = Windows.UI.Xaml.Media.Brush; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Defines a single color object used to fill shapes and draw text. + /// + public sealed class XSolidBrush : XBrush + { + /// + /// Initializes a new instance of the class. + /// + public XSolidBrush() + { } + + /// + /// Initializes a new instance of the class. + /// + public XSolidBrush(XColor color) + : this(color, false) + { } + + internal XSolidBrush(XColor color, bool immutable) + { + _color = color; + _immutable = immutable; + } + + /// + /// Initializes a new instance of the class. + /// + public XSolidBrush(XSolidBrush brush) + { + _color = brush.Color; + } + + /// + /// Gets or sets the color of this brush. + /// + public XColor Color + { + get { return _color; } + set + { + if (_immutable) + throw new ArgumentException(PSSR.CannotChangeImmutableObject("XSolidBrush")); +#if GDI + _gdiDirty = _gdiDirty || _color != value; +#endif +#if WPF + _wpfDirty = _wpfDirty || _color != value; +#endif +#if GDI && WPF + _gdiDirty = _wpfDirty = true; +#endif + _color = value; + } + } + internal XColor _color; + + /// + /// Gets or sets a value indicating whether the brush enables overprint when used in a PDF document. + /// Experimental, takes effect only on CMYK color mode. + /// + public bool Overprint + { + get { return _overprint; } + set + { + if (_immutable) + throw new ArgumentException(PSSR.CannotChangeImmutableObject("XSolidBrush")); + _overprint = value; + } + } + internal bool _overprint; + +#if GDI + internal override System.Drawing.Brush RealizeGdiBrush() + { + if (_gdiDirty) + { + if (_gdiBrush == null) + _gdiBrush = new SolidBrush(_color.ToGdiColor()); + else + _gdiBrush.Color = _color.ToGdiColor(); + _gdiDirty = false; + } + +#if DEBUG + System.Drawing.Color clr = _color.ToGdiColor(); + SolidBrush brush1 = new SolidBrush(clr); + Debug.Assert(_gdiBrush.Color == brush1.Color); +#endif + return _gdiBrush; + } +#endif + +#if WPF + internal override System.Windows.Media.Brush RealizeWpfBrush() + { + if (_wpfDirty) + { + if (_wpfBrush == null) + _wpfBrush = new SolidColorBrush(_color.ToWpfColor()); + else + _wpfBrush.Color = _color.ToWpfColor(); + _wpfDirty = false; + } + +#if DEBUG_ + System.Windows.Media.Color clr = _color.ToWpfColor(); + System.Windows.Media.SolidColorBrush brush1 = new System.Windows.Media.SolidColorBrush(clr); //System.Drawing.Color.FromArgb(128, 128, 0, 0)); + Debug.Assert(_wpfBrush.Color == brush1.Color); // Crashes during unit testing +#endif + return _wpfBrush; + } +#endif + +#if UWP + internal override ICanvasBrush RealizeCanvasBrush() + { + return new CanvasSolidColorBrush(CanvasDevice.GetSharedDevice(), _color.ToUwpColor()); + } +#endif + +#if GDI + bool _gdiDirty = true; + SolidBrush _gdiBrush; +#endif +#if WPF + bool _wpfDirty = true; + SolidColorBrush _wpfBrush; +#endif + readonly bool _immutable; + } +} diff --git a/PdfSharp/Drawing/XStringFormat.cs b/PdfSharp/Drawing/XStringFormat.cs new file mode 100644 index 0000000..7710a19 --- /dev/null +++ b/PdfSharp/Drawing/XStringFormat.cs @@ -0,0 +1,223 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if CORE +#endif +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing +{ +#if true_ + /// + /// Not used in this implementation. + /// + [Flags] + public enum XStringFormatFlags + { + //DirectionRightToLeft = 0x0001, + //DirectionVertical = 0x0002, + //FitBlackBox = 0x0004, + //DisplayFormatControl = 0x0020, + //NoFontFallback = 0x0400, + /// + /// The default value. + /// + MeasureTrailingSpaces = 0x0800, + //NoWrap = 0x1000, + //LineLimit = 0x2000, + //NoClip = 0x4000, + } +#endif + + /// + /// Represents the text layout information. + /// + public class XStringFormat + { + /// + /// Initializes a new instance of the class. + /// + public XStringFormat() + { +#if WPF + GetType(); // Make ReSharper happy. +#endif + } + + //TODO public StringFormat(StringFormat format); + //public StringFormat(StringFormatFlags options); + //public StringFormat(StringFormatFlags options, int language); + //public object Clone(); + //public void Dispose(); + //private void Dispose(bool disposing); + //protected override void Finalize(); + //public float[] GetTabStops(out float firstTabOffset); + //public void SetDigitSubstitution(int language, StringDigitSubstitute substitute); + //public void SetMeasurableCharacterRanges(CharacterRange[] ranges); + //public void SetTabStops(float firstTabOffset, float[] tabStops); + //public override string ToString(); + + /// + /// Gets or sets horizontal text alignment information. + /// + public XStringAlignment Alignment + { + get { return _alignment; } + set + { + _alignment = value; +#if CORE || GDI +#if UseGdiObjects + // Update StringFormat only if it exists. + if (_stringFormat != null) + { + _stringFormat.Alignment = (StringAlignment)value; + } +#endif +#endif + } + } + XStringAlignment _alignment; + + //public int DigitSubstitutionLanguage { get; } + //public StringDigitSubstitute DigitSubstitutionMethod { get; } + //public StringFormatFlags FormatFlags { get; set; } + //public static StringFormat GenericDefault { get; } + //public static StringFormat GenericTypographic { get; } + //public HotkeyPrefix HotkeyPrefix { get; set; } + + /// + /// Gets or sets the line alignment. + /// + public XLineAlignment LineAlignment + { + get { return _lineAlignment; } + set + { + _lineAlignment = value; +#if CORE || GDI +#if UseGdiObjects + // Update StringFormat only if it exists. + if (_stringFormat != null) + { + // BaseLine is specific to PDFsharp. + if (value == XLineAlignment.BaseLine) + _stringFormat.LineAlignment = StringAlignment.Near; + else + _stringFormat.LineAlignment = (StringAlignment)value; + } +#endif +#endif + } + } + XLineAlignment _lineAlignment; + + //public StringTrimming Trimming { get; set; } + + /// + /// Gets a new XStringFormat object that aligns the text left on the base line. + /// + [Obsolete("Use XStringFormats.Default. (Note plural in class name.)")] + public static XStringFormat Default + { + get { return XStringFormats.Default; } + } + + /// + /// Gets a new XStringFormat object that aligns the text top left of the layout rectangle. + /// + [Obsolete("Use XStringFormats.Default. (Note plural in class name.)")] + public static XStringFormat TopLeft + { + get { return XStringFormats.TopLeft; } + } + + /// + /// Gets a new XStringFormat object that centers the text in the middle of the layout rectangle. + /// + [Obsolete("Use XStringFormats.Center. (Note plural in class name.)")] + public static XStringFormat Center + { + get { return XStringFormats.Center; } + } + + /// + /// Gets a new XStringFormat object that centers the text at the top of the layout rectangle. + /// + [Obsolete("Use XStringFormats.TopCenter. (Note plural in class name.)")] + public static XStringFormat TopCenter + { + get { return XStringFormats.TopCenter; } + } + + /// + /// Gets a new XStringFormat object that centers the text at the bottom of the layout rectangle. + /// + [Obsolete("Use XStringFormats.BottomCenter. (Note plural in class name.)")] + public static XStringFormat BottomCenter + { + get { return XStringFormats.BottomCenter; } + } + +#if GDI + //#if UseGdiObjects + internal StringFormat RealizeGdiStringFormat() + { + if (_stringFormat == null) + { + // It seems that StringFormat.GenericTypographic is a global object and we need "Clone()" to avoid side effects. + _stringFormat = (StringFormat)StringFormat.GenericTypographic.Clone(); + _stringFormat.Alignment = (StringAlignment)_alignment; + + // BaseLine is specific to PDFsharp. + if (_lineAlignment == XLineAlignment.BaseLine) + _stringFormat.LineAlignment = StringAlignment.Near; + else + _stringFormat.LineAlignment = (StringAlignment)_lineAlignment; + + //_stringFormat.FormatFlags = (StringFormatFlags)_formatFlags; + + // Bugfix: Set MeasureTrailingSpaces to get the correct width with Graphics.MeasureString(). + // Before, MeasureString() didn't include blanks in width calculation, which could result in text overflowing table or page border before wrapping. $MaOs + _stringFormat.FormatFlags = _stringFormat.FormatFlags | StringFormatFlags.MeasureTrailingSpaces; + } + return _stringFormat; + } + StringFormat _stringFormat; + //#endif +#endif + } +} diff --git a/PdfSharp/Drawing/XStringFormats.cs b/PdfSharp/Drawing/XStringFormats.cs new file mode 100644 index 0000000..af0daf6 --- /dev/null +++ b/PdfSharp/Drawing/XStringFormats.cs @@ -0,0 +1,235 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing +{ + /// + /// Represents predefined text layouts. + /// + public static class XStringFormats + { + /// + /// Gets a new XStringFormat object that aligns the text left on the base line. + /// This is the same as BaseLineLeft. + /// + public static XStringFormat Default + { + get { return BaseLineLeft; } + } + + /// + /// Gets a new XStringFormat object that aligns the text left on the base line. + /// This is the same as Default. + /// + public static XStringFormat BaseLineLeft + { + get + { + // Create new format to allow changes. + XStringFormat format = new XStringFormat(); + format.Alignment = XStringAlignment.Near; + format.LineAlignment = XLineAlignment.BaseLine; + return format; + } + } + + /// + /// Gets a new XStringFormat object that aligns the text top left of the layout rectangle. + /// + public static XStringFormat TopLeft + { + get + { + // Create new format to allow changes. + XStringFormat format = new XStringFormat(); + format.Alignment = XStringAlignment.Near; + format.LineAlignment = XLineAlignment.Near; + return format; + } + } + + /// + /// Gets a new XStringFormat object that aligns the text center left of the layout rectangle. + /// + public static XStringFormat CenterLeft + { + get + { + // Create new format to allow changes. + XStringFormat format = new XStringFormat(); + format.Alignment = XStringAlignment.Near; + format.LineAlignment = XLineAlignment.Center; + return format; + } + } + + /// + /// Gets a new XStringFormat object that aligns the text bottom left of the layout rectangle. + /// + public static XStringFormat BottomLeft + { + get + { + // Create new format to allow changes. + XStringFormat format = new XStringFormat(); + format.Alignment = XStringAlignment.Near; + format.LineAlignment = XLineAlignment.Far; + return format; + } + } + + /// + /// Gets a new XStringFormat object that centers the text in the middle of the base line. + /// + public static XStringFormat BaseLineCenter + { + get + { + // Create new format to allow changes. + XStringFormat format = new XStringFormat(); + format.Alignment = XStringAlignment.Center; + format.LineAlignment = XLineAlignment.BaseLine; + return format; + } + } + + /// + /// Gets a new XStringFormat object that centers the text at the top of the layout rectangle. + /// + public static XStringFormat TopCenter + { + get + { + // Create new format to allow changes. + XStringFormat format = new XStringFormat(); + format.Alignment = XStringAlignment.Center; + format.LineAlignment = XLineAlignment.Near; + return format; + } + } + + /// + /// Gets a new XStringFormat object that centers the text in the middle of the layout rectangle. + /// + public static XStringFormat Center + { + get + { + // Create new format to allow changes. + XStringFormat format = new XStringFormat(); + format.Alignment = XStringAlignment.Center; + format.LineAlignment = XLineAlignment.Center; + return format; + } + } + + /// + /// Gets a new XStringFormat object that centers the text at the bottom of the layout rectangle. + /// + public static XStringFormat BottomCenter + { + get + { + // Create new format to allow changes. + XStringFormat format = new XStringFormat(); + format.Alignment = XStringAlignment.Center; + format.LineAlignment = XLineAlignment.Far; + return format; + } + } + + /// + /// Gets a new XStringFormat object that aligns the text in right on the base line. + /// + public static XStringFormat BaseLineRight + { + get + { + // Create new format to allow changes. + XStringFormat format = new XStringFormat(); + format.Alignment = XStringAlignment.Far; + format.LineAlignment = XLineAlignment.BaseLine; + return format; + } + } + + /// + /// Gets a new XStringFormat object that aligns the text top right of the layout rectangle. + /// + public static XStringFormat TopRight + { + get + { + // Create new format to allow changes. + XStringFormat format = new XStringFormat(); + format.Alignment = XStringAlignment.Far; + format.LineAlignment = XLineAlignment.Near; + return format; + } + } + + /// + /// Gets a new XStringFormat object that aligns the text center right of the layout rectangle. + /// + public static XStringFormat CenterRight + { + get + { + // Create new format to allow changes. + XStringFormat format = new XStringFormat(); + format.Alignment = XStringAlignment.Far; + format.LineAlignment = XLineAlignment.Center; + return format; + } + } + + /// + /// Gets a new XStringFormat object that aligns the text at the bottom right of the layout rectangle. + /// + public static XStringFormat BottomRight + { + get + { + // Create new format to allow changes. + XStringFormat format = new XStringFormat(); + format.Alignment = XStringAlignment.Far; + format.LineAlignment = XLineAlignment.Far; + return format; + } + } + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing/XTypeface.cs b/PdfSharp/Drawing/XTypeface.cs new file mode 100644 index 0000000..6875e64 --- /dev/null +++ b/PdfSharp/Drawing/XTypeface.cs @@ -0,0 +1,84 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows; +using System.Windows.Documents; +using System.Windows.Media; +#endif + +namespace PdfSharp.Drawing +{ +#if true_ // Not yet used + /// + /// no: Specifies a physical font face that corresponds to a font file on the disk or in memory. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + internal class XTypeface_not_yet_used + { + public XTypeface_not_yet_used(XFontFamily family, XFontStyle style) + { + _family = family; + _style = style; + } + + public XFontFamily Family + { + get { return _family; } + } + XFontFamily _family; + + public XFontStyle Style + { + get { return _style; } + } + XFontStyle _style; + + public bool TryGetGlyphTypeface(out XGlyphTypeface glyphTypeface) + { + glyphTypeface = null; + return false; + } + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + // ReSharper disable UnusedMember.Local + string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get { return string.Format(CultureInfo.InvariantCulture, "XTypeface"); } + } + } +#endif +} diff --git a/PdfSharp/Drawing/XUnit.cs b/PdfSharp/Drawing/XUnit.cs new file mode 100644 index 0000000..2d4bbf2 --- /dev/null +++ b/PdfSharp/Drawing/XUnit.cs @@ -0,0 +1,597 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; + +namespace PdfSharp.Drawing +{ + /// + /// Represents a value and its unit of measure. The structure converts implicitly from and to + /// double with a value measured in point. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + public struct XUnit : IFormattable + { + internal const double PointFactor = 1; + internal const double InchFactor = 72; + internal const double MillimeterFactor = 72 / 25.4; + internal const double CentimeterFactor = 72 / 2.54; + internal const double PresentationFactor = 72 / 96.0; + + internal const double PointFactorWpf = 96 / 72.0; + internal const double InchFactorWpf = 96; + internal const double MillimeterFactorWpf = 96 / 25.4; + internal const double CentimeterFactorWpf = 96 / 2.54; + internal const double PresentationFactorWpf = 1; + + /// + /// Initializes a new instance of the XUnit class with type set to point. + /// + public XUnit(double point) + { + _value = point; + _type = XGraphicsUnit.Point; + } + + /// + /// Initializes a new instance of the XUnit class. + /// + public XUnit(double value, XGraphicsUnit type) + { + if (!Enum.IsDefined(typeof(XGraphicsUnit), type)) +#if !SILVERLIGHT && !NETFX_CORE && !UWP + throw new System.ComponentModel.InvalidEnumArgumentException(nameof(type), (int)type, typeof(XGraphicsUnit)); +#else + throw new ArgumentException("type"); +#endif + _value = value; + _type = type; + } + + /// + /// Gets the raw value of the object without any conversion. + /// To determine the XGraphicsUnit use property Type. + /// To get the value in point use the implicit conversion to double. + /// + public double Value + { + get { return _value; } + } + + /// + /// Gets the unit of measure. + /// + public XGraphicsUnit Type + { + get { return _type; } + } + + /// + /// Gets or sets the value in point. + /// + public double Point + { + get + { + switch (_type) + { + case XGraphicsUnit.Point: + return _value; + + case XGraphicsUnit.Inch: + return _value * 72; + + case XGraphicsUnit.Millimeter: + return _value * 72 / 25.4; + + case XGraphicsUnit.Centimeter: + return _value * 72 / 2.54; + + case XGraphicsUnit.Presentation: + return _value * 72 / 96; + + default: + throw new InvalidCastException(); + } + } + set + { + _value = value; + _type = XGraphicsUnit.Point; + } + } + + /// + /// Gets or sets the value in inch. + /// + public double Inch + { + get + { + switch (_type) + { + case XGraphicsUnit.Point: + return _value / 72; + + case XGraphicsUnit.Inch: + return _value; + + case XGraphicsUnit.Millimeter: + return _value / 25.4; + + case XGraphicsUnit.Centimeter: + return _value / 2.54; + + case XGraphicsUnit.Presentation: + return _value / 96; + + default: + throw new InvalidCastException(); + } + } + set + { + _value = value; + _type = XGraphicsUnit.Inch; + } + } + + /// + /// Gets or sets the value in millimeter. + /// + public double Millimeter + { + get + { + switch (_type) + { + case XGraphicsUnit.Point: + return _value * 25.4 / 72; + + case XGraphicsUnit.Inch: + return _value * 25.4; + + case XGraphicsUnit.Millimeter: + return _value; + + case XGraphicsUnit.Centimeter: + return _value * 10; + + case XGraphicsUnit.Presentation: + return _value * 25.4 / 96; + + default: + throw new InvalidCastException(); + } + } + set + { + _value = value; + _type = XGraphicsUnit.Millimeter; + } + } + + /// + /// Gets or sets the value in centimeter. + /// + public double Centimeter + { + get + { + switch (_type) + { + case XGraphicsUnit.Point: + return _value * 2.54 / 72; + + case XGraphicsUnit.Inch: + return _value * 2.54; + + case XGraphicsUnit.Millimeter: + return _value / 10; + + case XGraphicsUnit.Centimeter: + return _value; + + case XGraphicsUnit.Presentation: + return _value * 2.54 / 96; + + default: + throw new InvalidCastException(); + } + } + set + { + _value = value; + _type = XGraphicsUnit.Centimeter; + } + } + + /// + /// Gets or sets the value in presentation units (1/96 inch). + /// + public double Presentation + { + get + { + switch (_type) + { + case XGraphicsUnit.Point: + return _value * 96 / 72; + + case XGraphicsUnit.Inch: + return _value * 96; + + case XGraphicsUnit.Millimeter: + return _value * 96 / 25.4; + + case XGraphicsUnit.Centimeter: + return _value * 96 / 2.54; + + case XGraphicsUnit.Presentation: + return _value; + + default: + throw new InvalidCastException(); + } + } + set + { + _value = value; + _type = XGraphicsUnit.Point; + } + } + + /// + /// Returns the object as string using the format information. + /// The unit of measure is appended to the end of the string. + /// + public string ToString(IFormatProvider formatProvider) + { + string valuestring = _value.ToString(formatProvider) + GetSuffix(); + return valuestring; + } + + /// + /// Returns the object as string using the specified format and format information. + /// The unit of measure is appended to the end of the string. + /// + string IFormattable.ToString(string format, IFormatProvider formatProvider) + { + string valuestring = _value.ToString(format, formatProvider) + GetSuffix(); + return valuestring; + } + + /// + /// Returns the object as string. The unit of measure is appended to the end of the string. + /// + public override string ToString() + { + string valuestring = _value.ToString(CultureInfo.InvariantCulture) + GetSuffix(); + return valuestring; + } + + /// + /// Returns the unit of measure of the object as a string like 'pt', 'cm', or 'in'. + /// + string GetSuffix() + { + switch (_type) + { + case XGraphicsUnit.Point: + return "pt"; + + case XGraphicsUnit.Inch: + return "in"; + + case XGraphicsUnit.Millimeter: + return "mm"; + + case XGraphicsUnit.Centimeter: + return "cm"; + + case XGraphicsUnit.Presentation: + return "pu"; + + //case XGraphicsUnit.Pica: + // return "pc"; + + //case XGraphicsUnit.Line: + // return "li"; + + default: + throw new InvalidCastException(); + } + } + + /// + /// Returns an XUnit object. Sets type to point. + /// + public static XUnit FromPoint(double value) + { + XUnit unit; + unit._value = value; + unit._type = XGraphicsUnit.Point; + return unit; + } + + /// + /// Returns an XUnit object. Sets type to inch. + /// + public static XUnit FromInch(double value) + { + XUnit unit; + unit._value = value; + unit._type = XGraphicsUnit.Inch; + return unit; + } + + /// + /// Returns an XUnit object. Sets type to millimeters. + /// + public static XUnit FromMillimeter(double value) + { + XUnit unit; + unit._value = value; + unit._type = XGraphicsUnit.Millimeter; + return unit; + } + + /// + /// Returns an XUnit object. Sets type to centimeters. + /// + public static XUnit FromCentimeter(double value) + { + XUnit unit; + unit._value = value; + unit._type = XGraphicsUnit.Centimeter; + return unit; + } + + /// + /// Returns an XUnit object. Sets type to Presentation. + /// + public static XUnit FromPresentation(double value) + { + XUnit unit; + unit._value = value; + unit._type = XGraphicsUnit.Presentation; + return unit; + } + + /// + /// Converts a string to an XUnit object. + /// If the string contains a suffix like 'cm' or 'in' the object will be converted + /// to the appropriate type, otherwise point is assumed. + /// + public static implicit operator XUnit(string value) + { + XUnit unit; + value = value.Trim(); + + // HACK for Germans... + value = value.Replace(',', '.'); + + int count = value.Length; + int valLen = 0; + for (; valLen < count;) + { + char ch = value[valLen]; + if (ch == '.' || ch == '-' || ch == '+' || char.IsNumber(ch)) + valLen++; + else + break; + } + + try + { + unit._value = Double.Parse(value.Substring(0, valLen).Trim(), CultureInfo.InvariantCulture); + } + catch (Exception ex) + { + unit._value = 1; + string message = String.Format("String '{0}' is not a valid value for structure 'XUnit'.", value); + throw new ArgumentException(message, ex); + } + + string typeStr = value.Substring(valLen).Trim().ToLower(); + unit._type = XGraphicsUnit.Point; + switch (typeStr) + { + case "cm": + unit._type = XGraphicsUnit.Centimeter; + break; + + case "in": + unit._type = XGraphicsUnit.Inch; + break; + + case "mm": + unit._type = XGraphicsUnit.Millimeter; + break; + + case "": + case "pt": + unit._type = XGraphicsUnit.Point; + break; + + case "pu": // presentation units + unit._type = XGraphicsUnit.Presentation; + break; + + default: + throw new ArgumentException("Unknown unit type: '" + typeStr + "'"); + } + return unit; + } + + /// + /// Converts an int to an XUnit object with type set to point. + /// + public static implicit operator XUnit(int value) + { + XUnit unit; + unit._value = value; + unit._type = XGraphicsUnit.Point; + return unit; + } + + /// + /// Converts a double to an XUnit object with type set to point. + /// + public static implicit operator XUnit(double value) + { + XUnit unit; + unit._value = value; + unit._type = XGraphicsUnit.Point; + return unit; + } + + /// + /// Returns a double value as point. + /// + public static implicit operator double(XUnit value) + { + return value.Point; + } + + /// + /// Memberwise comparison. To compare by value, + /// use code like Math.Abs(a.Pt - b.Pt) < 1e-5. + /// + public static bool operator ==(XUnit value1, XUnit value2) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + return value1._type == value2._type && value1._value == value2._value; + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Memberwise comparison. To compare by value, + /// use code like Math.Abs(a.Pt - b.Pt) < 1e-5. + /// + public static bool operator !=(XUnit value1, XUnit value2) + { + return !(value1 == value2); + } + + /// + /// Calls base class Equals. + /// + public override bool Equals(Object obj) + { + if (obj is XUnit) + return this == (XUnit)obj; + return false; + } + + /// + /// Returns the hash code for this instance. + /// + public override int GetHashCode() + { + // ReSharper disable NonReadonlyFieldInGetHashCode + return _value.GetHashCode() ^ _type.GetHashCode(); + // ReSharper restore NonReadonlyFieldInGetHashCode + } + + /// + /// This member is intended to be used by XmlDomainObjectReader only. + /// + public static XUnit Parse(string value) + { + XUnit unit = value; + return unit; + } + + /// + /// Converts an existing object from one unit into another unit type. + /// + public void ConvertType(XGraphicsUnit type) + { + if (_type == type) + return; + + switch (type) + { + case XGraphicsUnit.Point: + _value = Point; + _type = XGraphicsUnit.Point; + break; + + case XGraphicsUnit.Inch: + _value = Inch; + _type = XGraphicsUnit.Inch; + break; + + case XGraphicsUnit.Centimeter: + _value = Centimeter; + _type = XGraphicsUnit.Centimeter; + break; + + case XGraphicsUnit.Millimeter: + _value = Millimeter; + _type = XGraphicsUnit.Millimeter; + break; + + case XGraphicsUnit.Presentation: + _value = Presentation; + _type = XGraphicsUnit.Presentation; + break; + + default: + throw new ArgumentException("Unknown unit type: '" + type + "'"); + } + } + + /// + /// Represents a unit with all values zero. + /// + public static readonly XUnit Zero = new XUnit(); + + double _value; + XGraphicsUnit _type; + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + /// The debugger display. + // ReSharper disable UnusedMember.Local + string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get + { + const string format = Config.SignificantFigures10; + return String.Format(CultureInfo.InvariantCulture, "unit=({0:" + format + "} {1})", _value, GetSuffix()); + } + } + } +} \ No newline at end of file diff --git a/PdfSharp/Drawing/XVector.cs b/PdfSharp/Drawing/XVector.cs new file mode 100644 index 0000000..6ee9202 --- /dev/null +++ b/PdfSharp/Drawing/XVector.cs @@ -0,0 +1,299 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using System.Runtime.InteropServices; +using PdfSharp.Internal; +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows.Media; +#endif + +#pragma warning disable 1591 + +#if !EDF_CORE +namespace PdfSharp.Drawing +#else +namespace Edf.Drawing +#endif +{ + /// + /// Represents a two-dimensional vector specified by x- and y-coordinates. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct XVector : IFormattable + { + public XVector(double x, double y) + { + _x = x; + _y = y; + } + + public static bool operator ==(XVector vector1, XVector vector2) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + return vector1._x == vector2._x && vector1._y == vector2._y; + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + public static bool operator !=(XVector vector1, XVector vector2) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + return vector1._x != vector2._x || vector1._y != vector2._y; + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + public static bool Equals(XVector vector1, XVector vector2) + { + if (vector1.X.Equals(vector2.X)) + return vector1.Y.Equals(vector2.Y); + return false; + } + + public override bool Equals(object o) + { + if (!(o is XVector)) + return false; + return Equals(this, (XVector)o); + } + + public bool Equals(XVector value) + { + return Equals(this, value); + } + + public override int GetHashCode() + { + // ReSharper disable NonReadonlyFieldInGetHashCode + return _x.GetHashCode() ^ _y.GetHashCode(); + // ReSharper restore NonReadonlyFieldInGetHashCode + } + + public static XVector Parse(string source) + { + TokenizerHelper helper = new TokenizerHelper(source, CultureInfo.InvariantCulture); + string str = helper.NextTokenRequired(); + XVector vector = new XVector(Convert.ToDouble(str, CultureInfo.InvariantCulture), Convert.ToDouble(helper.NextTokenRequired(), CultureInfo.InvariantCulture)); + helper.LastTokenRequired(); + return vector; + } + + public double X + { + get { return _x; } + set { _x = value; } + } + double _x; + + public double Y + { + get { return _y; } + set { _y = value; } + } + double _y; + + public override string ToString() + { + return ConvertToString(null, null); + } + + public string ToString(IFormatProvider provider) + { + return ConvertToString(null, provider); + } + + string IFormattable.ToString(string format, IFormatProvider provider) + { + return ConvertToString(format, provider); + } + + internal string ConvertToString(string format, IFormatProvider provider) + { + const char numericListSeparator = ','; + provider = provider ?? CultureInfo.InvariantCulture; + // ReSharper disable once FormatStringProblem + return string.Format(provider, "{1:" + format + "}{0}{2:" + format + "}", numericListSeparator, _x, _y); + } + + public double Length + { + get { return Math.Sqrt(_x * _x + _y * _y); } + } + + public double LengthSquared + { + get { return _x * _x + _y * _y; } + } + + public void Normalize() + { + this = this / Math.Max(Math.Abs(_x), Math.Abs(_y)); + this = this / Length; + } + + public static double CrossProduct(XVector vector1, XVector vector2) + { + return vector1._x * vector2._y - vector1._y * vector2._x; + } + + public static double AngleBetween(XVector vector1, XVector vector2) + { + double y = vector1._x * vector2._y - vector2._x * vector1._y; + double x = vector1._x * vector2._x + vector1._y * vector2._y; + return (Math.Atan2(y, x) * 57.295779513082323); + } + + public static XVector operator -(XVector vector) + { + return new XVector(-vector._x, -vector._y); + } + + public void Negate() + { + _x = -_x; + _y = -_y; + } + + public static XVector operator +(XVector vector1, XVector vector2) + { + return new XVector(vector1._x + vector2._x, vector1._y + vector2._y); + } + + public static XVector Add(XVector vector1, XVector vector2) + { + return new XVector(vector1._x + vector2._x, vector1._y + vector2._y); + } + + public static XVector operator -(XVector vector1, XVector vector2) + { + return new XVector(vector1._x - vector2._x, vector1._y - vector2._y); + } + + public static XVector Subtract(XVector vector1, XVector vector2) + { + return new XVector(vector1._x - vector2._x, vector1._y - vector2._y); + } + + public static XPoint operator +(XVector vector, XPoint point) + { + return new XPoint(point.X + vector._x, point.Y + vector._y); + } + + public static XPoint Add(XVector vector, XPoint point) + { + return new XPoint(point.X + vector._x, point.Y + vector._y); + } + + public static XVector operator *(XVector vector, double scalar) + { + return new XVector(vector._x * scalar, vector._y * scalar); + } + + public static XVector Multiply(XVector vector, double scalar) + { + return new XVector(vector._x * scalar, vector._y * scalar); + } + + public static XVector operator *(double scalar, XVector vector) + { + return new XVector(vector._x * scalar, vector._y * scalar); + } + + public static XVector Multiply(double scalar, XVector vector) + { + return new XVector(vector._x * scalar, vector._y * scalar); + } + + public static XVector operator /(XVector vector, double scalar) + { + return vector * (1.0 / scalar); + } + + public static XVector Divide(XVector vector, double scalar) + { + return vector * (1.0 / scalar); + } + + public static XVector operator *(XVector vector, XMatrix matrix) + { + return matrix.Transform(vector); + } + + public static XVector Multiply(XVector vector, XMatrix matrix) + { + return matrix.Transform(vector); + } + + public static double operator *(XVector vector1, XVector vector2) + { + return vector1._x * vector2._x + vector1._y * vector2._y; + } + + public static double Multiply(XVector vector1, XVector vector2) + { + return vector1._x * vector2._x + vector1._y * vector2._y; + } + + public static double Determinant(XVector vector1, XVector vector2) + { + return vector1._x * vector2._y - vector1._y * vector2._x; + } + + public static explicit operator XSize(XVector vector) + { + return new XSize(Math.Abs(vector._x), Math.Abs(vector._y)); + } + + public static explicit operator XPoint(XVector vector) + { + return new XPoint(vector._x, vector._y); + } + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + /// The debugger display. + // ReSharper disable UnusedMember.Local + string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get + { + const string format = Config.SignificantFigures10; + return string.Format(CultureInfo.InvariantCulture, "vector=({0:" + format + "}, {1:" + format + "})", _x, _y); + } + } + } +} diff --git a/PdfSharp/Drawing/enums/PathStart.cs b/PdfSharp/Drawing/enums/PathStart.cs new file mode 100644 index 0000000..c1defc8 --- /dev/null +++ b/PdfSharp/Drawing/enums/PathStart.cs @@ -0,0 +1,54 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// ReSharper disable InconsistentNaming + +namespace PdfSharp.Drawing +{ + /// + /// Indicates how to handle the first point of a path. + /// + internal enum PathStart + { + /// + /// Set the current position to the first point. + /// + MoveTo1st, + + /// + /// Draws a line to the first point. + /// + LineTo1st, + + /// + /// Ignores the first point. + /// + Ignore1st, + } +} diff --git a/PdfSharp/Drawing/enums/XColorSpace.cs b/PdfSharp/Drawing/enums/XColorSpace.cs new file mode 100644 index 0000000..57598f7 --- /dev/null +++ b/PdfSharp/Drawing/enums/XColorSpace.cs @@ -0,0 +1,52 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Currently not used. Only DeviceRGB is rendered in PDF. + /// + public enum XColorSpace + { + /// + /// Identifies the RGB color space. + /// + Rgb, + + /// + /// Identifies the CMYK color space. + /// + Cmyk, + + /// + /// Identifies the gray scale color space. + /// + GrayScale, + } +} diff --git a/PdfSharp/Drawing/enums/XCombineMode.cs b/PdfSharp/Drawing/enums/XCombineMode.cs new file mode 100644 index 0000000..eaa1e7a --- /dev/null +++ b/PdfSharp/Drawing/enums/XCombineMode.cs @@ -0,0 +1,67 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Specifies how different clipping regions can be combined. + /// + public enum XCombineMode // Same values as System.Drawing.Drawing2D.CombineMode. + { + /// + /// One clipping region is replaced by another. + /// + Replace = 0, + + /// + /// Two clipping regions are combined by taking their intersection. + /// + Intersect = 1, + + /// + /// Not yet implemented in PDFsharp. + /// + Union = 2, + + /// + /// Not yet implemented in PDFsharp. + /// + Xor = 3, + + /// + /// Not yet implemented in PDFsharp. + /// + Exclude = 4, + + /// + /// Not yet implemented in PDFsharp. + /// + Complement = 5, + } +} diff --git a/PdfSharp/Drawing/enums/XDashStyle.cs b/PdfSharp/Drawing/enums/XDashStyle.cs new file mode 100644 index 0000000..5fdd539 --- /dev/null +++ b/PdfSharp/Drawing/enums/XDashStyle.cs @@ -0,0 +1,67 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Specifies the style of dashed lines drawn with an XPen object. + /// + public enum XDashStyle // Same values as System.Drawing.Drawing2D.DashStyle. + { + /// + /// Specifies a solid line. + /// + Solid = 0, + + /// + /// Specifies a line consisting of dashes. + /// + Dash = 1, + + /// + /// Specifies a line consisting of dots. + /// + Dot = 2, + + /// + /// Specifies a line consisting of a repeating pattern of dash-dot. + /// + DashDot = 3, + + /// + /// Specifies a line consisting of a repeating pattern of dash-dot-dot. + /// + DashDotDot = 4, + + /// + /// Specifies a user-defined custom dash style. + /// + Custom = 5, + } +} diff --git a/PdfSharp/Drawing/enums/XFillMode.cs b/PdfSharp/Drawing/enums/XFillMode.cs new file mode 100644 index 0000000..00cd507 --- /dev/null +++ b/PdfSharp/Drawing/enums/XFillMode.cs @@ -0,0 +1,47 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Specifies how the interior of a closed path is filled. + /// + public enum XFillMode // Same values as System.Drawing.FillMode. + { + /// + /// Specifies the alternate fill mode. Called the 'odd-even rule' in PDF terminology. + /// + Alternate = 0, + + /// + /// Specifies the winding fill mode. Called the 'nonzero winding number rule' in PDF terminology. + /// + Winding = 1, + } +} diff --git a/PdfSharp/Drawing/enums/XFontStyle.cs b/PdfSharp/Drawing/enums/XFontStyle.cs new file mode 100644 index 0000000..5a3afac --- /dev/null +++ b/PdfSharp/Drawing/enums/XFontStyle.cs @@ -0,0 +1,74 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Drawing +{ + /// + /// Specifies style information applied to text. + /// + [Flags] + public enum XFontStyle // Same values as System.Drawing.FontStyle. + { + /// + /// Normal text. + /// + Regular = XGdiFontStyle.Regular, + + /// + /// Bold text. + /// + Bold = XGdiFontStyle.Bold, + + /// + /// Italic text. + /// + Italic = XGdiFontStyle.Italic, + + /// + /// Bold and italic text. + /// + BoldItalic = XGdiFontStyle.BoldItalic, + + /// + /// Underlined text. + /// + Underline = XGdiFontStyle.Underline, + + /// + /// Text with a line through the middle. + /// + Strikeout = XGdiFontStyle.Strikeout, + + // Additional flags: + // BoldSimulation + // ItalicSimulation // It is not ObliqueSimulation, because oblique is what is what you get and this simulates italic. + } +} diff --git a/PdfSharp/Drawing/enums/XGdiFontStyle.cs b/PdfSharp/Drawing/enums/XGdiFontStyle.cs new file mode 100644 index 0000000..5fe612f --- /dev/null +++ b/PdfSharp/Drawing/enums/XGdiFontStyle.cs @@ -0,0 +1,76 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Text; + +namespace PdfSharp.Drawing +{ + /// + /// Backward compatibility. + /// + [Flags] + internal enum XGdiFontStyle // Same values as System.Drawing.FontStyle. + { + // Must be identical to both: + // System.Drawing.FontStyle and + // PdfSharp.Drawing.FontStyle + + /// + /// Normal text. + /// + Regular = 0, + + /// + /// Bold text. + /// + Bold = 1, + + /// + /// Italic text. + /// + Italic = 2, + + /// + /// Bold and italic text. + /// + BoldItalic = 3, + + /// + /// Underlined text. + /// + Underline = 4, + + /// + /// Text with a line through the middle. + /// + Strikeout = 8, + } +} diff --git a/PdfSharp/Drawing/enums/XGraphicRenderTarget.cs b/PdfSharp/Drawing/enums/XGraphicRenderTarget.cs new file mode 100644 index 0000000..831aec4 --- /dev/null +++ b/PdfSharp/Drawing/enums/XGraphicRenderTarget.cs @@ -0,0 +1,63 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// ReSharper disable InconsistentNaming + +namespace PdfSharp.Drawing +{ + /// + /// Determines whether rendering based on GDI+ or WPF. + /// For internal use in hybrid build only only. + /// + enum XGraphicTargetContext + { + // NETFX_CORE_TODO + NONE = 0, + + /// + /// Rendering does not depent on a particular technology. + /// + CORE = 1, + + /// + /// Renders using GDI+. + /// + GDI = 2, + + /// + /// Renders using WPF (including Silverlight). + /// + WPF = 3, + + /// + /// Universal Windows Platform. + /// + UWP = 10, + } +} diff --git a/PdfSharp/Drawing/enums/XGraphicsPathItemType.cs b/PdfSharp/Drawing/enums/XGraphicsPathItemType.cs new file mode 100644 index 0000000..c3e8cd3 --- /dev/null +++ b/PdfSharp/Drawing/enums/XGraphicsPathItemType.cs @@ -0,0 +1,48 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Type of the path data. + /// + internal enum XGraphicsPathItemType + { + Lines, + Beziers, + Curve, + Arc, + Rectangle, + RoundedRectangle, + Ellipse, + Polygon, + CloseFigure, + StartFigure, + } +} diff --git a/PdfSharp/Drawing/enums/XGraphicsPdfPageOptions.cs b/PdfSharp/Drawing/enums/XGraphicsPdfPageOptions.cs new file mode 100644 index 0000000..40ab94f --- /dev/null +++ b/PdfSharp/Drawing/enums/XGraphicsPdfPageOptions.cs @@ -0,0 +1,52 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Specifies how the content of an existing PDF page and new content is combined. + /// + public enum XGraphicsPdfPageOptions + { + /// + /// The new content is inserted behind the old content and any subsequent drawing in done above the existing graphic. + /// + Append, + + /// + /// The new content is inserted before the old content and any subsequent drawing in done beneath the existing graphic. + /// + Prepend, + + /// + /// The new content entirely replaces the old content and any subsequent drawing in done on a blank page. + /// + Replace, + } +} diff --git a/PdfSharp/Drawing/enums/XGraphicsUnit.cs b/PdfSharp/Drawing/enums/XGraphicsUnit.cs new file mode 100644 index 0000000..59ff13d --- /dev/null +++ b/PdfSharp/Drawing/enums/XGraphicsUnit.cs @@ -0,0 +1,62 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Specifies the unit of measure. + /// + public enum XGraphicsUnit // NOT the same values as System.Drawing.GraphicsUnit + { + /// + /// Specifies a printer's point (1/72 inch) as the unit of measure. + /// + Point = 0, // Must be 0 to let a new XUnit be 0 point. + + /// + /// Specifies the inch (2.54 cm) as the unit of measure. + /// + Inch = 1, + + /// + /// Specifies the millimeter as the unit of measure. + /// + Millimeter = 2, + + /// + /// Specifies the centimeter as the unit of measure. + /// + Centimeter = 3, + + /// + /// Specifies a presentation point (1/96 inch) as the unit of measure. + /// + Presentation = 4, + } +} diff --git a/PdfSharp/Drawing/enums/XKnownColor.cs b/PdfSharp/Drawing/enums/XKnownColor.cs new file mode 100644 index 0000000..9fdcc19 --- /dev/null +++ b/PdfSharp/Drawing/enums/XKnownColor.cs @@ -0,0 +1,461 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Specifies all pre-defined colors. Used to identify the pre-defined colors and to + /// localize their names. + /// + public enum XKnownColor + { + /// A pre-defined color. + AliceBlue = 0, + + /// A pre-defined color. + AntiqueWhite = 1, + + /// A pre-defined color. + Aqua = 2, + + /// A pre-defined color. + Aquamarine = 3, + + /// A pre-defined color. + Azure = 4, + + /// A pre-defined color. + Beige = 5, + + /// A pre-defined color. + Bisque = 6, + + /// A pre-defined color. + Black = 7, + + /// A pre-defined color. + BlanchedAlmond = 8, + + /// A pre-defined color. + Blue = 9, + + /// A pre-defined color. + BlueViolet = 10, + + /// A pre-defined color. + Brown = 11, + + /// A pre-defined color. + BurlyWood = 12, + + /// A pre-defined color. + CadetBlue = 13, + + /// A pre-defined color. + Chartreuse = 14, + + /// A pre-defined color. + Chocolate = 15, + + /// A pre-defined color. + Coral = 16, + + /// A pre-defined color. + CornflowerBlue = 17, + + /// A pre-defined color. + Cornsilk = 18, + + /// A pre-defined color. + Crimson = 19, + + /// A pre-defined color. + Cyan = 20, + + /// A pre-defined color. + DarkBlue = 21, + + /// A pre-defined color. + DarkCyan = 22, + + /// A pre-defined color. + DarkGoldenrod = 23, + + /// A pre-defined color. + DarkGray = 24, + + /// A pre-defined color. + DarkGreen = 25, + + /// A pre-defined color. + DarkKhaki = 26, + + /// A pre-defined color. + DarkMagenta = 27, + + /// A pre-defined color. + DarkOliveGreen = 28, + + /// A pre-defined color. + DarkOrange = 29, + + /// A pre-defined color. + DarkOrchid = 30, + + /// A pre-defined color. + DarkRed = 31, + + /// A pre-defined color. + DarkSalmon = 32, + + /// A pre-defined color. + DarkSeaGreen = 33, + + /// A pre-defined color. + DarkSlateBlue = 34, + + /// A pre-defined color. + DarkSlateGray = 35, + + /// A pre-defined color. + DarkTurquoise = 36, + + /// A pre-defined color. + DarkViolet = 37, + + /// A pre-defined color. + DeepPink = 38, + + /// A pre-defined color. + DeepSkyBlue = 39, + + /// A pre-defined color. + DimGray = 40, + + /// A pre-defined color. + DodgerBlue = 41, + + /// A pre-defined color. + Firebrick = 42, + + /// A pre-defined color. + FloralWhite = 43, + + /// A pre-defined color. + ForestGreen = 44, + + /// A pre-defined color. + Fuchsia = 45, + + /// A pre-defined color. + Gainsboro = 46, + + /// A pre-defined color. + GhostWhite = 47, + + /// A pre-defined color. + Gold = 48, + + /// A pre-defined color. + Goldenrod = 49, + + /// A pre-defined color. + Gray = 50, + + /// A pre-defined color. + Green = 51, + + /// A pre-defined color. + GreenYellow = 52, + + /// A pre-defined color. + Honeydew = 53, + + /// A pre-defined color. + HotPink = 54, + + /// A pre-defined color. + IndianRed = 55, + + /// A pre-defined color. + Indigo = 56, + + /// A pre-defined color. + Ivory = 57, + + /// A pre-defined color. + Khaki = 58, + + /// A pre-defined color. + Lavender = 59, + + /// A pre-defined color. + LavenderBlush = 60, + + /// A pre-defined color. + LawnGreen = 61, + + /// A pre-defined color. + LemonChiffon = 62, + + /// A pre-defined color. + LightBlue = 63, + + /// A pre-defined color. + LightCoral = 64, + + /// A pre-defined color. + LightCyan = 65, + + /// A pre-defined color. + LightGoldenrodYellow = 66, + + /// A pre-defined color. + LightGray = 67, + + /// A pre-defined color. + LightGreen = 68, + + /// A pre-defined color. + LightPink = 69, + + /// A pre-defined color. + LightSalmon = 70, + + /// A pre-defined color. + LightSeaGreen = 71, + + /// A pre-defined color. + LightSkyBlue = 72, + + /// A pre-defined color. + LightSlateGray = 73, + + /// A pre-defined color. + LightSteelBlue = 74, + + /// A pre-defined color. + LightYellow = 75, + + /// A pre-defined color. + Lime = 76, + + /// A pre-defined color. + LimeGreen = 77, + + /// A pre-defined color. + Linen = 78, + + /// A pre-defined color. + Magenta = 79, + + /// A pre-defined color. + Maroon = 80, + + /// A pre-defined color. + MediumAquamarine = 81, + + /// A pre-defined color. + MediumBlue = 82, + + /// A pre-defined color. + MediumOrchid = 83, + + /// A pre-defined color. + MediumPurple = 84, + + /// A pre-defined color. + MediumSeaGreen = 85, + + /// A pre-defined color. + MediumSlateBlue = 86, + + /// A pre-defined color. + MediumSpringGreen = 87, + + /// A pre-defined color. + MediumTurquoise = 88, + + /// A pre-defined color. + MediumVioletRed = 89, + + /// A pre-defined color. + MidnightBlue = 90, + + /// A pre-defined color. + MintCream = 91, + + /// A pre-defined color. + MistyRose = 92, + + /// A pre-defined color. + Moccasin = 93, + + /// A pre-defined color. + NavajoWhite = 94, + + /// A pre-defined color. + Navy = 95, + + /// A pre-defined color. + OldLace = 96, + + /// A pre-defined color. + Olive = 97, + + /// A pre-defined color. + OliveDrab = 98, + + /// A pre-defined color. + Orange = 99, + + /// A pre-defined color. + OrangeRed = 100, + + /// A pre-defined color. + Orchid = 101, + + /// A pre-defined color. + PaleGoldenrod = 102, + + /// A pre-defined color. + PaleGreen = 103, + + /// A pre-defined color. + PaleTurquoise = 104, + + /// A pre-defined color. + PaleVioletRed = 105, + + /// A pre-defined color. + PapayaWhip = 106, + + /// A pre-defined color. + PeachPuff = 107, + + /// A pre-defined color. + Peru = 108, + + /// A pre-defined color. + Pink = 109, + + /// A pre-defined color. + Plum = 110, + + /// A pre-defined color. + PowderBlue = 111, + + /// A pre-defined color. + Purple = 112, + + /// A pre-defined color. + Red = 113, + + /// A pre-defined color. + RosyBrown = 114, + + /// A pre-defined color. + RoyalBlue = 115, + + /// A pre-defined color. + SaddleBrown = 116, + + /// A pre-defined color. + Salmon = 117, + + /// A pre-defined color. + SandyBrown = 118, + + /// A pre-defined color. + SeaGreen = 119, + + /// A pre-defined color. + SeaShell = 120, + + /// A pre-defined color. + Sienna = 121, + + /// A pre-defined color. + Silver = 122, + + /// A pre-defined color. + SkyBlue = 123, + + /// A pre-defined color. + SlateBlue = 124, + + /// A pre-defined color. + SlateGray = 125, + + /// A pre-defined color. + Snow = 126, + + /// A pre-defined color. + SpringGreen = 127, + + /// A pre-defined color. + SteelBlue = 128, + + /// A pre-defined color. + Tan = 129, + + /// A pre-defined color. + Teal = 130, + + /// A pre-defined color. + Thistle = 131, + + /// A pre-defined color. + Tomato = 132, + + /// A pre-defined color. + Transparent = 133, + + /// A pre-defined color. + Turquoise = 134, + + /// A pre-defined color. + Violet = 135, + + /// A pre-defined color. + Wheat = 136, + + /// A pre-defined color. + White = 137, + + /// A pre-defined color. + WhiteSmoke = 138, + + /// A pre-defined color. + Yellow = 139, + + /// A pre-defined color. + YellowGreen = 140, + } +} diff --git a/PdfSharp/Drawing/enums/XLineAlignment.cs b/PdfSharp/Drawing/enums/XLineAlignment.cs new file mode 100644 index 0000000..3d5a8bf --- /dev/null +++ b/PdfSharp/Drawing/enums/XLineAlignment.cs @@ -0,0 +1,62 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Specifies the alignment of a text string relative to its layout rectangle + /// + public enum XLineAlignment // same values as System.Drawing.StringAlignment (except BaseLine) + { + /// + /// Specifies the text be aligned near the layout. + /// In a left-to-right layout, the near position is left. In a right-to-left layout, the near + /// position is right. + /// + Near = 0, + + /// + /// Specifies that text is aligned in the center of the layout rectangle. + /// + Center = 1, + + /// + /// Specifies that text is aligned far from the origin position of the layout rectangle. + /// In a left-to-right layout, the far position is right. In a right-to-left layout, the far + /// position is left. + /// + Far = 2, + + /// + /// Specifies that text is aligned relative to its base line. + /// With this option the layout rectangle must have a height of 0. + /// + BaseLine = 3, + } +} diff --git a/PdfSharp/Drawing/enums/XLineCap.cs b/PdfSharp/Drawing/enums/XLineCap.cs new file mode 100644 index 0000000..0c2caca --- /dev/null +++ b/PdfSharp/Drawing/enums/XLineCap.cs @@ -0,0 +1,52 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Specifies the available cap styles with which an XPen object can start and end a line. + /// + public enum XLineCap + { + /// + /// Specifies a flat line cap. + /// + Flat = 0, + + /// + /// Specifies a round line cap. + /// + Round = 1, + + /// + /// Specifies a square line cap. + /// + Square = 2 + } +} diff --git a/PdfSharp/Drawing/enums/XLineJoin.cs b/PdfSharp/Drawing/enums/XLineJoin.cs new file mode 100644 index 0000000..d4262ad --- /dev/null +++ b/PdfSharp/Drawing/enums/XLineJoin.cs @@ -0,0 +1,53 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Specifies how to join consecutive line or curve segments in a figure or subpath. + /// + public enum XLineJoin + { + /// + /// Specifies a mitered join. This produces a sharp corner or a clipped corner, + /// depending on whether the length of the miter exceeds the miter limit + /// + Miter = 0, + + /// + /// Specifies a circular join. This produces a smooth, circular arc between the lines. + /// + Round = 1, + + /// + /// Specifies a beveled join. This produces a diagonal corner. + /// + Bevel = 2, + } +} diff --git a/PdfSharp/Drawing/enums/XLinearGradientMode.cs b/PdfSharp/Drawing/enums/XLinearGradientMode.cs new file mode 100644 index 0000000..cd9e7c2 --- /dev/null +++ b/PdfSharp/Drawing/enums/XLinearGradientMode.cs @@ -0,0 +1,57 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Specifies the direction of a linear gradient. + /// + public enum XLinearGradientMode // same values as System.Drawing.LinearGradientMode + { + /// + /// Specifies a gradient from left to right. + /// + Horizontal = 0, + + /// + /// Specifies a gradient from top to bottom. + /// + Vertical = 1, + + /// + /// Specifies a gradient from upper left to lower right. + /// + ForwardDiagonal = 2, + + /// + /// Specifies a gradient from upper right to lower left. + /// + BackwardDiagonal = 3, + } +} diff --git a/PdfSharp/Drawing/enums/XMatrixOrder.cs b/PdfSharp/Drawing/enums/XMatrixOrder.cs new file mode 100644 index 0000000..80c1bd1 --- /dev/null +++ b/PdfSharp/Drawing/enums/XMatrixOrder.cs @@ -0,0 +1,47 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Specifies the order for matrix transform operations. + /// + public enum XMatrixOrder + { + /// + /// The new operation is applied before the old operation. + /// + Prepend = 0, + + /// + /// The new operation is applied after the old operation. + /// + Append = 1, + } +} diff --git a/PdfSharp/Drawing/enums/XPageDirection.cs b/PdfSharp/Drawing/enums/XPageDirection.cs new file mode 100644 index 0000000..73bf8bc --- /dev/null +++ b/PdfSharp/Drawing/enums/XPageDirection.cs @@ -0,0 +1,51 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Drawing +{ + /// + /// Specifies the direction of the y-axis. + /// + public enum XPageDirection + { + /// + /// Increasing Y values go downwards. This is the default. + /// + Downwards = 0, + + /// + /// Increasing Y values go upwards. This is only possible when drawing on a PDF page. + /// It is not implemented when drawing on a System.Drawing.Graphics object. + /// + [Obsolete("Not implemeted - yagni")] + Upwards = 1, // Possible, but needs a lot of case differentiation - postponed. + } +} diff --git a/PdfSharp/Drawing/enums/XSmoothingMode.cs b/PdfSharp/Drawing/enums/XSmoothingMode.cs new file mode 100644 index 0000000..55cee30 --- /dev/null +++ b/PdfSharp/Drawing/enums/XSmoothingMode.cs @@ -0,0 +1,73 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Drawing +{ + /// + /// Specifies whether smoothing (or antialiasing) is applied to lines and curves + /// and the edges of filled areas. + /// + [Flags] + public enum XSmoothingMode // same values as System.Drawing.Drawing2D.SmoothingMode + { + // Not used in PDF rendering process. + + /// + /// Specifies an invalid mode. + /// + Invalid = -1, + + /// + /// Specifies the default mode. + /// + Default = 0, + + /// + /// Specifies high speed, low quality rendering. + /// + HighSpeed = 1, + + /// + /// Specifies high quality, low speed rendering. + /// + HighQuality = 2, + + /// + /// Specifies no antialiasing. + /// + None = 3, + + /// + /// Specifies antialiased rendering. + /// + AntiAlias = 4, + } +} diff --git a/PdfSharp/Drawing/enums/XStringAlignment.cs b/PdfSharp/Drawing/enums/XStringAlignment.cs new file mode 100644 index 0000000..b3ef466 --- /dev/null +++ b/PdfSharp/Drawing/enums/XStringAlignment.cs @@ -0,0 +1,56 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Specifies the alignment of a text string relative to its layout rectangle. + /// + public enum XStringAlignment // Same values as System.Drawing.StringAlignment. + { + /// + /// Specifies the text be aligned near the layout. + /// In a left-to-right layout, the near position is left. In a right-to-left layout, the near + /// position is right. + /// + Near = 0, + + /// + /// Specifies that text is aligned in the center of the layout rectangle. + /// + Center = 1, + + /// + /// Specifies that text is aligned far from the origin position of the layout rectangle. + /// In a left-to-right layout, the far position is right. In a right-to-left layout, the far + /// position is left. + /// + Far = 2, + } +} diff --git a/PdfSharp/Drawing/enums/XStyleSimulations.cs b/PdfSharp/Drawing/enums/XStyleSimulations.cs new file mode 100644 index 0000000..d0dc353 --- /dev/null +++ b/PdfSharp/Drawing/enums/XStyleSimulations.cs @@ -0,0 +1,60 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Drawing +{ + /// + /// Describes the simulation style of a font. + /// + [Flags] + public enum XStyleSimulations // Identical to WpfStyleSimulations. + { + /// + /// No font style simulation. + /// + None = 0, + + /// + /// Bold style simulation. + /// + BoldSimulation = 1, + + /// + /// Italic style simulation. + /// + ItalicSimulation = 2, + + /// + /// Bold and Italic style simulation. + /// + BoldItalicSimulation = ItalicSimulation | BoldSimulation, + } +} diff --git a/PdfSharp/Drawing/enums/XSweepDirection.cs b/PdfSharp/Drawing/enums/XSweepDirection.cs new file mode 100644 index 0000000..49bd0e9 --- /dev/null +++ b/PdfSharp/Drawing/enums/XSweepDirection.cs @@ -0,0 +1,47 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Drawing +{ + /// + /// Defines the direction an elliptical arc is drawn. + /// + public enum XSweepDirection // Same values as System.Windows.Media.SweepDirection. + { + /// + /// Specifies that arcs are drawn in a counter clockwise (negative-angle) direction. + /// + Counterclockwise = 0, + + /// + /// Specifies that arcs are drawn in a clockwise (positive-angle) direction. + /// + Clockwise = 1, + } +} diff --git a/PdfSharp/Fonts.OpenType/FontDescriptor.cs b/PdfSharp/Fonts.OpenType/FontDescriptor.cs new file mode 100644 index 0000000..6beba84 --- /dev/null +++ b/PdfSharp/Fonts.OpenType/FontDescriptor.cs @@ -0,0 +1,398 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +#endif +using PdfSharp.Pdf.Internal; +using PdfSharp.Fonts; +#if !EDF_CORE +using PdfSharp.Drawing; +#endif + +#pragma warning disable 0649 + +namespace PdfSharp.Fonts.OpenType +{ + // TODO: Needs to be refactored #??? + /// + /// Base class for all font descriptors. + /// Currently only OpenTypeDescriptor is derived from this base class. + /// + internal class FontDescriptor + { + protected FontDescriptor(string key) + { + _key = key; + } + + public string Key + { + get { return _key; } + } + readonly string _key; + + + + + + + + ///// + ///// + ///// + //public string FontFile + //{ + // get { return _fontFile; } + // private set { _fontFile = value; } // BUG: never set + //} + //string _fontFile; + + ///// + ///// + ///// + //public string FontType + //{ + // get { return _fontType; } + // private set { _fontType = value; } // BUG: never set + //} + //string _fontType; + + /// + /// + /// + public string FontName + { + get { return _fontName; } + protected set { _fontName = value; } + } + string _fontName; + + ///// + ///// + ///// + //public string FullName + //{ + // get { return _fullName; } + // private set { _fullName = value; } // BUG: never set + //} + //string _fullName; + + ///// + ///// + ///// + //public string FamilyName + //{ + // get { return _familyName; } + // private set { _familyName = value; } // BUG: never set + //} + //string _familyName; + + /// + /// + /// + public string Weight + { + get { return _weight; } + private set { _weight = value; } // BUG: never set + } + string _weight; + + /// + /// Gets a value indicating whether this instance belongs to a bold font. + /// + public virtual bool IsBoldFace + { + get { return false; } + } + + /// + /// + /// + public float ItalicAngle + { + get { return _italicAngle; } + protected set { _italicAngle = value; } + } + float _italicAngle; + + /// + /// Gets a value indicating whether this instance belongs to an italic font. + /// + public virtual bool IsItalicFace + { + get { return false; } + } + + /// + /// + /// + public int XMin + { + get { return _xMin; } + protected set { _xMin = value; } + } + int _xMin; + + /// + /// + /// + public int YMin + { + get { return _yMin; } + protected set { _yMin = value; } + } + int _yMin; + + /// + /// + /// + public int XMax + { + get { return _xMax; } + protected set { _xMax = value; } + } + int _xMax; + + /// + /// + /// + public int YMax + { + get { return _yMax; } + protected set { _yMax = value; } + } + int _yMax; + + /// + /// + /// + public bool IsFixedPitch + { + get { return _isFixedPitch; } + private set { _isFixedPitch = value; } // BUG: never set + } + bool _isFixedPitch; + + /// + /// + /// + public int UnderlinePosition + { + get { return _underlinePosition; } + protected set { _underlinePosition = value; } + } + int _underlinePosition; + + /// + /// + /// + public int UnderlineThickness + { + get { return _underlineThickness; } + protected set { _underlineThickness = value; } + } + int _underlineThickness; + + /// + /// + /// + public int StrikeoutPosition + { + get { return _strikeoutPosition; } + protected set { _strikeoutPosition = value; } + } + int _strikeoutPosition; + + /// + /// + /// + public int StrikeoutSize + { + get { return _strikeoutSize; } + protected set { _strikeoutSize = value; } + } + int _strikeoutSize; + + /// + /// + /// + public string Version + { + get { return _version; } + private set { _version = value; } // BUG: never set + } + string _version; + + ///// + ///// + ///// + //public string Notice + //{ + // get { return Notice; } + //} + //protected string notice; + + /// + /// + /// + public string EncodingScheme + { + get { return _encodingScheme; } + private set { _encodingScheme = value; } // BUG: never set + } + string _encodingScheme; + + /// + /// + /// + public int UnitsPerEm + { + get { return _unitsPerEm; } + protected set { _unitsPerEm = value; } + } + int _unitsPerEm; + + /// + /// + /// + public int CapHeight + { + get { return _capHeight; } + protected set { _capHeight = value; } + } + int _capHeight; + + /// + /// + /// + public int XHeight + { + get { return _xHeight; } + protected set { _xHeight = value; } + } + int _xHeight; + + /// + /// + /// + public int Ascender + { + get { return _ascender; } + protected set { _ascender = value; } + } + int _ascender; + + /// + /// + /// + public int Descender + { + get { return _descender; } + protected set { _descender = value; } + } + int _descender; + + /// + /// + /// + public int Leading + { + get { return _leading; } + protected set { _leading = value; } + } + int _leading; + + /// + /// + /// + public int Flags + { + get { return _flags; } + private set { _flags = value; } // BUG: never set + } + int _flags; + + /// + /// + /// + public int StemV + { + get { return _stemV; } + protected set { _stemV = value; } + } + int _stemV; + + /// + /// + /// + public int LineSpacing + { + get { return _lineSpacing; } + protected set { _lineSpacing = value; } + } + int _lineSpacing; + + + internal static string ComputeKey(XFont font) + { + return font.GlyphTypeface.Key; + //return ComputeKey(font.GlyphTypeface.Fontface.FullFaceName, font.Style); + //XGlyphTypeface glyphTypeface = font.GlyphTypeface; + //string key = glyphTypeface.Fontface.FullFaceName.ToLowerInvariant() + + // (glyphTypeface.IsBold ? "/b" : "") + (glyphTypeface.IsItalic ? "/i" : ""); + //return key; + } + + internal static string ComputeKey(string name, XFontStyle style) + { + return ComputeKey(name, + (style & XFontStyle.Bold) == XFontStyle.Bold, + (style & XFontStyle.Italic) == XFontStyle.Italic); + } + + internal static string ComputeKey(string name, bool isBold, bool isItalic) + { + string key = name.ToLowerInvariant() + '/' + + (isBold ? "b" : "") + (isItalic ? "i" : ""); + return key; + } + + internal static string ComputeKey(string name) + { + string key = name.ToLowerInvariant(); + return key; + } + } +} \ No newline at end of file diff --git a/PdfSharp/Fonts.OpenType/GenericFontTable.cs b/PdfSharp/Fonts.OpenType/GenericFontTable.cs new file mode 100644 index 0000000..9f3e50f --- /dev/null +++ b/PdfSharp/Fonts.OpenType/GenericFontTable.cs @@ -0,0 +1,70 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +//using Fixed = System.Int32; +//using FWord = System.Int16; +//using UFWord = System.UInt16; + +namespace PdfSharp.Fonts.OpenType +{ +#if true_ + /// + /// Generic font table. Not yet used + /// + internal class GenericFontTable : OpenTypeFontTable + { + public GenericFontTable(OpenTypeFontTable fontTable) + : base(null, "xxxx") + { + DirectoryEntry.Tag = fontTable.DirectoryEntry.Tag; + int length = fontTable.DirectoryEntry.Length; + if (length > 0) + { + _table = new byte[length]; + Buffer.BlockCopy(fontTable.FontData.Data, fontTable.DirectoryEntry.Offset, _table, 0, length); + } + } + + public GenericFontTable(OpenTypeFontface fontData, string tag) + : base(fontData, tag) + { + _fontData = fontData; + } + + protected override OpenTypeFontTable DeepCopy() + { + GenericFontTable fontTable = (GenericFontTable)base.DeepCopy(); + fontTable._table = (byte[])_table.Clone(); + return fontTable; + } + + byte[] _table; + } +#endif +} diff --git a/PdfSharp/Fonts.OpenType/GlyphDataTable.cs b/PdfSharp/Fonts.OpenType/GlyphDataTable.cs new file mode 100644 index 0000000..3b3632a --- /dev/null +++ b/PdfSharp/Fonts.OpenType/GlyphDataTable.cs @@ -0,0 +1,190 @@ + +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#define VERBOSE_ + +using System; +using System.Collections.Generic; + +//using Fixed = System.Int32; +//using FWord = System.Int16; +//using UFWord = System.UInt16; + +namespace PdfSharp.Fonts.OpenType +{ + /// + /// This table contains information that describes the glyphs in the font in the TrueType outline format. + /// Information regarding the rasterizer (scaler) refers to the TrueType rasterizer. + /// http://www.microsoft.com/typography/otspec/glyf.htm + /// + internal class GlyphDataTable : OpenTypeFontTable + { + public const string Tag = TableTagNames.Glyf; + + internal byte[] GlyphTable; + + public GlyphDataTable() + : base(null, Tag) + { + DirectoryEntry.Tag = TableTagNames.Glyf; + } + + public GlyphDataTable(OpenTypeFontface fontData) + : base(fontData, Tag) + { + DirectoryEntry.Tag = TableTagNames.Glyf; + Read(); + } + + /// + /// Converts the bytes in a handy representation + /// + public void Read() + { + try + { + // not yet needed... + } + catch (Exception ex) + { + throw ex; + } + } + + /// + /// Gets the data of the specified glyph. + /// + public byte[] GetGlyphData(int glyph) + { + IndexToLocationTable loca = _fontData.loca; + int start = GetOffset(glyph); + int next = GetOffset(glyph + 1); + int count = next - start; + byte[] bytes = new byte[count]; + Buffer.BlockCopy(_fontData.FontSource.Bytes, start, bytes, 0, count); + return bytes; + } + + /// + /// Gets the size of the byte array that defines the glyph. + /// + public int GetGlyphSize(int glyph) + { + IndexToLocationTable loca = _fontData.loca; + return GetOffset(glyph + 1) - GetOffset(glyph); + } + + /// + /// Gets the offset of the specified glyph relative to the first byte of the font image. + /// + public int GetOffset(int glyph) + { + return DirectoryEntry.Offset + _fontData.loca.LocaTable[glyph]; + } + + /// + /// Adds for all composite glyphs the glyphs the composite one is made of. + /// + public void CompleteGlyphClosure(Dictionary glyphs) + { + int count = glyphs.Count; + int[] glyphArray = new int[glyphs.Count]; + glyphs.Keys.CopyTo(glyphArray, 0); + if (!glyphs.ContainsKey(0)) + glyphs.Add(0, null); + for (int idx = 0; idx < count; idx++) + AddCompositeGlyphs(glyphs, glyphArray[idx]); + } + + /// + /// If the specified glyph is a composite glyph add the glyphs it is made of to the glyph table. + /// + void AddCompositeGlyphs(Dictionary glyphs, int glyph) + { + //int start = fontData.loca.GetOffset(glyph); + int start = GetOffset(glyph); + // Has no contour? + if (start == GetOffset(glyph + 1)) + return; + _fontData.Position = start; + int numContours = _fontData.ReadShort(); + // Is not a composite glyph? + if (numContours >= 0) + return; + _fontData.SeekOffset(8); + for (; ; ) + { + int flags = _fontData.ReadUFWord(); + int cGlyph = _fontData.ReadUFWord(); + if (!glyphs.ContainsKey(cGlyph)) + glyphs.Add(cGlyph, null); + if ((flags & MORE_COMPONENTS) == 0) + return; + int offset = (flags & ARG_1_AND_2_ARE_WORDS) == 0 ? 2 : 4; + if ((flags & WE_HAVE_A_SCALE) != 0) + offset += 2; + else if ((flags & WE_HAVE_AN_X_AND_Y_SCALE) != 0) + offset += 4; + if ((flags & WE_HAVE_A_TWO_BY_TWO) != 0) + offset += 8; + _fontData.SeekOffset(offset); + } + } + + /// + /// Prepares the font table to be compiled into its binary representation. + /// + public override void PrepareForCompilation() + { + base.PrepareForCompilation(); + + if (DirectoryEntry.Length == 0) + DirectoryEntry.Length = GlyphTable.Length; + DirectoryEntry.CheckSum = CalcChecksum(GlyphTable); + } + + /// + /// Converts the font into its binary representation. + /// + public override void Write(OpenTypeFontWriter writer) + { + writer.Write(GlyphTable, 0, DirectoryEntry.PaddedLength); + } + + // ReSharper disable InconsistentNaming + // Constants from OpenType spec. + const int ARG_1_AND_2_ARE_WORDS = 1; + const int WE_HAVE_A_SCALE = 8; + const int MORE_COMPONENTS = 32; + const int WE_HAVE_AN_X_AND_Y_SCALE = 64; + const int WE_HAVE_A_TWO_BY_TWO = 128; + // ReSharper restore InconsistentNaming + } +} diff --git a/PdfSharp/Fonts.OpenType/GlyphTypefaceCache.cs b/PdfSharp/Fonts.OpenType/GlyphTypefaceCache.cs new file mode 100644 index 0000000..a4ae118 --- /dev/null +++ b/PdfSharp/Fonts.OpenType/GlyphTypefaceCache.cs @@ -0,0 +1,116 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Collections.Generic; +using System.Text; +using PdfSharp.Drawing; +using PdfSharp.Internal; + +namespace PdfSharp.Fonts.OpenType +{ + /// + /// Global table of all glyph typefaces. + /// + internal class GlyphTypefaceCache + { + GlyphTypefaceCache() + { + _glyphTypefacesByKey = new Dictionary(); + } + + public static bool TryGetGlyphTypeface(string key, out XGlyphTypeface glyphTypeface) + { + try + { + Lock.EnterFontFactory(); + bool result = Singleton._glyphTypefacesByKey.TryGetValue(key, out glyphTypeface); + return result; + } + finally { Lock.ExitFontFactory(); } + } + + public static void AddGlyphTypeface(XGlyphTypeface glyphTypeface) + { + try + { + Lock.EnterFontFactory(); + GlyphTypefaceCache cache = Singleton; + Debug.Assert(!cache._glyphTypefacesByKey.ContainsKey(glyphTypeface.Key)); + cache._glyphTypefacesByKey.Add(glyphTypeface.Key, glyphTypeface); + } + finally { Lock.ExitFontFactory(); } + } + + /// + /// Gets the singleton. + /// + static GlyphTypefaceCache Singleton + { + get + { + // ReSharper disable once InvertIf + if (_singleton == null) + { + try + { + Lock.EnterFontFactory(); + if (_singleton == null) + _singleton = new GlyphTypefaceCache(); + } + finally { Lock.ExitFontFactory(); } + } + return _singleton; + } + } + static volatile GlyphTypefaceCache _singleton; + + internal static string GetCacheState() + { + StringBuilder state = new StringBuilder(); + state.Append("====================\n"); + state.Append("Glyph typefaces by name\n"); + Dictionary.KeyCollection familyKeys = Singleton._glyphTypefacesByKey.Keys; + int count = familyKeys.Count; + string[] keys = new string[count]; + familyKeys.CopyTo(keys, 0); + Array.Sort(keys, StringComparer.OrdinalIgnoreCase); + foreach (string key in keys) + state.AppendFormat(" {0}: {1}\n", key, Singleton._glyphTypefacesByKey[key].DebuggerDisplay); + state.Append("\n"); + return state.ToString(); + } + + /// + /// Maps typeface key to glyph typeface. + /// + readonly Dictionary _glyphTypefacesByKey; + } +} diff --git a/PdfSharp/Fonts.OpenType/IRefFontTable.cs b/PdfSharp/Fonts.OpenType/IRefFontTable.cs new file mode 100644 index 0000000..1bc0b01 --- /dev/null +++ b/PdfSharp/Fonts.OpenType/IRefFontTable.cs @@ -0,0 +1,83 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using Fixed = System.Int32; +using FWord = System.Int16; +using UFWord = System.UInt16; + +namespace PdfSharp.Fonts.OpenType +{ + /// + /// Represents an indirect reference to an existing font table in a font image. + /// Used to create binary copies of an existing font table that is not modified. + /// + // ReSharper disable once InconsistentNaming - "I" stands for "indirect", not "interface". + internal class IRefFontTable : OpenTypeFontTable + { + public IRefFontTable(OpenTypeFontface fontData, OpenTypeFontTable fontTable) + : base(null, fontTable.DirectoryEntry.Tag) + { + _fontData = fontData; + _irefDirectoryEntry = fontTable.DirectoryEntry; + } + + readonly TableDirectoryEntry _irefDirectoryEntry; + + /// + /// Prepares the font table to be compiled into its binary representation. + /// + public override void PrepareForCompilation() + { + base.PrepareForCompilation(); + DirectoryEntry.Length = _irefDirectoryEntry.Length; + DirectoryEntry.CheckSum = _irefDirectoryEntry.CheckSum; +#if DEBUG + // Check the checksum algorithm + if (DirectoryEntry.Tag != TableTagNames.Head) + { + byte[] bytes = new byte[DirectoryEntry.PaddedLength]; + Buffer.BlockCopy(_irefDirectoryEntry.FontTable._fontData.FontSource.Bytes, _irefDirectoryEntry.Offset, bytes, 0, DirectoryEntry.PaddedLength); + uint checkSum1 = DirectoryEntry.CheckSum; + uint checkSum2 = CalcChecksum(bytes); + // TODO: Sometimes this Assert fails, + //Debug.Assert(checkSum1 == checkSum2, "Bug in checksum algorithm."); + } +#endif + } + + /// + /// Converts the font into its binary representation. + /// + public override void Write(OpenTypeFontWriter writer) + { + writer.Write(_irefDirectoryEntry.FontTable._fontData.FontSource.Bytes, _irefDirectoryEntry.Offset, _irefDirectoryEntry.PaddedLength); + } + } +} diff --git a/PdfSharp/Fonts.OpenType/IndexToLocationTable.cs b/PdfSharp/Fonts.OpenType/IndexToLocationTable.cs new file mode 100644 index 0000000..9b84c84 --- /dev/null +++ b/PdfSharp/Fonts.OpenType/IndexToLocationTable.cs @@ -0,0 +1,149 @@ + +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#define VERBOSE_ + +using System; +using System.Diagnostics; + +//using Fixed = System.Int32; +//using FWord = System.Int16; +//using UFWord = System.UInt16; + +namespace PdfSharp.Fonts.OpenType +{ + /// + /// The indexToLoc table stores the offsets to the locations of the glyphs in the font, + /// relative to the beginning of the glyphData table. In order to compute the length of + /// the last glyph element, there is an extra entry after the last valid index. + /// + internal class IndexToLocationTable : OpenTypeFontTable + { + public const string Tag = TableTagNames.Loca; + + internal int[] LocaTable; + + public IndexToLocationTable() + : base(null, Tag) + { + DirectoryEntry.Tag = TableTagNames.Loca; + } + + public IndexToLocationTable(OpenTypeFontface fontData) + : base(fontData, Tag) + { + DirectoryEntry = _fontData.TableDictionary[TableTagNames.Loca]; + Read(); + } + + public bool ShortIndex; + + /// + /// Converts the bytes in a handy representation + /// + public void Read() + { + try + { + ShortIndex = _fontData.head.indexToLocFormat == 0; + _fontData.Position = DirectoryEntry.Offset; + if (ShortIndex) + { + int entries = DirectoryEntry.Length / 2; + Debug.Assert(_fontData.maxp.numGlyphs + 1 == entries, + "For your information only: Number of glyphs mismatch in font. You can ignore this assertion."); + LocaTable = new int[entries]; + for (int idx = 0; idx < entries; idx++) + LocaTable[idx] = 2 * _fontData.ReadUFWord(); + } + else + { + int entries = DirectoryEntry.Length / 4; + Debug.Assert(_fontData.maxp.numGlyphs + 1 == entries, + "For your information only: Number of glyphs mismatch in font. You can ignore this assertion."); + LocaTable = new int[entries]; + for (int idx = 0; idx < entries; idx++) + LocaTable[idx] = _fontData.ReadLong(); + } + } + catch (Exception) + { + GetType(); + throw; + } + } + + /// + /// Prepares the font table to be compiled into its binary representation. + /// + public override void PrepareForCompilation() + { + DirectoryEntry.Offset = 0; + if (ShortIndex) + DirectoryEntry.Length = LocaTable.Length * 2; + else + DirectoryEntry.Length = LocaTable.Length * 4; + + _bytes = new byte[DirectoryEntry.PaddedLength]; + int length = LocaTable.Length; + int byteIdx = 0; + if (ShortIndex) + { + for (int idx = 0; idx < length; idx++) + { + int value = LocaTable[idx] / 2; + _bytes[byteIdx++] = (byte)(value >> 8); + _bytes[byteIdx++] = (byte)(value); + } + } + else + { + for (int idx = 0; idx < length; idx++) + { + int value = LocaTable[idx]; + _bytes[byteIdx++] = (byte)(value >> 24); + _bytes[byteIdx++] = (byte)(value >> 16); + _bytes[byteIdx++] = (byte)(value >> 8); + _bytes[byteIdx++] = (byte)value; + } + } + DirectoryEntry.CheckSum = CalcChecksum(_bytes); + } + byte[] _bytes; + + /// + /// Converts the font into its binary representation. + /// + public override void Write(OpenTypeFontWriter writer) + { + writer.Write(_bytes, 0, DirectoryEntry.PaddedLength); + } + } +} \ No newline at end of file diff --git a/PdfSharp/Fonts.OpenType/OpenTypeDescriptor.cs b/PdfSharp/Fonts.OpenType/OpenTypeDescriptor.cs new file mode 100644 index 0000000..8ec96a7 --- /dev/null +++ b/PdfSharp/Fonts.OpenType/OpenTypeDescriptor.cs @@ -0,0 +1,425 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Text; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +#endif +using PdfSharp.Pdf.Internal; +#if !EDF_CORE +using PdfSharp.Drawing; +#endif + +namespace PdfSharp.Fonts.OpenType +{ + /// + /// The OpenType font descriptor. + /// Currently the only font type PDFsharp supports. + /// + internal sealed class OpenTypeDescriptor : FontDescriptor + { + /// + /// New... + /// + public OpenTypeDescriptor(string fontDescriptorKey, string name, XFontStyle stlye, OpenTypeFontface fontface, XPdfFontOptions options) + : base(fontDescriptorKey) + { + FontFace = fontface; + FontName = name; + Initialize(); + } + + public OpenTypeDescriptor(string fontDescriptorKey, XFont font) + : base(fontDescriptorKey) + { + try + { + FontFace = font.GlyphTypeface.Fontface; + FontName = font.Name; + Initialize(); + } + catch + { + GetType(); + throw; + } + } + + internal OpenTypeDescriptor(string fontDescriptorKey, string idName, byte[] fontData) + : base(fontDescriptorKey) + { + try + { + FontFace = new OpenTypeFontface(fontData, idName); + // Try to get real name form name table + if (idName.Contains("XPS-Font-") && FontFace.name != null && FontFace.name.Name.Length != 0) + { + string tag = String.Empty; + if (idName.IndexOf('+') == 6) + tag = idName.Substring(0, 6); + idName = tag + "+" + FontFace.name.Name; + if (FontFace.name.Style.Length != 0) + idName += "," + FontFace.name.Style; + //idName = idName.Replace(" ", ""); + } + FontName = idName; + Initialize(); + } + catch (Exception) + { + GetType(); + throw; + } + } + + internal OpenTypeFontface FontFace; + + void Initialize() + { + // TODO: Respect embedding restrictions. + //bool embeddingRestricted = fontData.os2.fsType == 0x0002; + + //fontName = image.n + ItalicAngle = FontFace.post.italicAngle; + + XMin = FontFace.head.xMin; + YMin = FontFace.head.yMin; + XMax = FontFace.head.xMax; + YMax = FontFace.head.yMax; + + UnderlinePosition = FontFace.post.underlinePosition; + UnderlineThickness = FontFace.post.underlineThickness; + + // PDFlib states that some Apple fonts miss the OS/2 table. + Debug.Assert(FontFace.os2 != null, "TrueType font has no OS/2 table."); + + StrikeoutPosition = FontFace.os2.yStrikeoutPosition; + StrikeoutSize = FontFace.os2.yStrikeoutSize; + + // No documentation found how to get the set vertical stems width from the + // TrueType tables. + // The following formula comes from PDFlib Lite source code. Acrobat 5.0 sets + // /StemV to 0 always. I think the value doesn't matter. + //float weight = (float)(image.os2.usWeightClass / 65.0f); + //stemV = (int)(50 + weight * weight); // MAGIC + StemV = 0; + + UnitsPerEm = FontFace.head.unitsPerEm; + + // Calculate Ascent, Descent, Leading and LineSpacing like in WPF Source Code (see FontDriver.ReadBasicMetrics) + + // OS/2 is an optional table, but we can't determine if it is existing in this font. + bool os2SeemsToBeEmpty = FontFace.os2.sTypoAscender == 0 && FontFace.os2.sTypoDescender == 0 && FontFace.os2.sTypoLineGap == 0; + //Debug.Assert(!os2SeemsToBeEmpty); // Are there fonts without OS/2 table? + + bool dontUseWinLineMetrics = (FontFace.os2.fsSelection & 128) != 0; + if (!os2SeemsToBeEmpty && dontUseWinLineMetrics) + { + // Comment from WPF: The font specifies that the sTypoAscender, sTypoDescender, and sTypoLineGap fields are valid and + // should be used instead of winAscent and winDescent. + int typoAscender = FontFace.os2.sTypoAscender; + int typoDescender = FontFace.os2.sTypoDescender; + int typoLineGap = FontFace.os2.sTypoLineGap; + + // Comment from WPF: We include the line gap in the ascent so that white space is distributed above the line. (Note that + // the typo line gap is a different concept than "external leading".) + Ascender = typoAscender + typoLineGap; + // Comment from WPF: Typo descent is a signed value where the positive direction is up. It is therefore typically negative. + // A signed typo descent would be quite unusual as it would indicate the descender was above the baseline + Descender = -typoDescender; + LineSpacing = typoAscender + typoLineGap - typoDescender; + } + else + { + // Comment from WPF: get the ascender field + int ascender = FontFace.hhea.ascender; + // Comment from WPF: get the descender field; this is measured in the same direction as ascender and is therefore + // normally negative whereas we want a positive value; however some fonts get the sign wrong + // so instead of just negating we take the absolute value. + int descender = Math.Abs(FontFace.hhea.descender); + // Comment from WPF: get the lineGap field and make sure it's >= 0 + int lineGap = Math.Max((short)0, FontFace.hhea.lineGap); + + if (!os2SeemsToBeEmpty) + { + // Comment from WPF: we could use sTypoAscender, sTypoDescender, and sTypoLineGap which are supposed to represent + // optimal typographic values not constrained by backwards compatibility; however, many fonts get + // these fields wrong or get them right only for Latin text; therefore we use the more reliable + // platform-specific Windows values. We take the absolute value of the win32descent in case some + // fonts get the sign wrong. + int winAscent = FontFace.os2.usWinAscent; + int winDescent = Math.Abs(FontFace.os2.usWinDescent); + + Ascender = winAscent; + Descender = winDescent; + // Comment from WPF: The following calculation for designLineSpacing is per [....]. The default line spacing + // should be the sum of the Mac ascender, descender, and lineGap unless the resulting value would + // be less than the cell height (winAscent + winDescent) in which case we use the cell height. + // See also http://www.microsoft.com/typography/otspec/recom.htm. + // Note that in theory it's valid for the baseline-to-baseline distance to be less than the cell + // height. However, Windows has never allowed this for Truetype fonts, and fonts built for Windows + // sometimes rely on this behavior and get the hha values wrong or set them all to zero. + LineSpacing = Math.Max(lineGap + ascender + descender, winAscent + winDescent); + } + else + { + Ascender = ascender; + Descender = descender; + LineSpacing = ascender + descender + lineGap; + } + } + + Debug.Assert(Descender >= 0); + + int cellHeight = Ascender + Descender; + int internalLeading = cellHeight - UnitsPerEm; // Not used, only for debugging. + int externalLeading = LineSpacing - cellHeight; + Leading = externalLeading; + + // sCapHeight and sxHeight are only valid if Version >= 2 + if (FontFace.os2.version >= 2 && FontFace.os2.sCapHeight != 0) + CapHeight = FontFace.os2.sCapHeight; + else + CapHeight = Ascender; + + if (FontFace.os2.version >= 2 && FontFace.os2.sxHeight != 0) + XHeight = FontFace.os2.sxHeight; + else + XHeight = (int)(0.66 * Ascender); + + //flags = image. + +#if !EDF_CORE + Encoding ansi = PdfEncoders.WinAnsiEncoding; // System.Text.Encoding.Default; +#else + Encoding ansi = null; //$$$ PdfEncoders.WinAnsiEncoding; // System.Text.Encoding.Default; +#endif + + Encoding unicode = Encoding.Unicode; + byte[] bytes = new byte[256]; + + bool symbol = FontFace.cmap.symbol; + Widths = new int[256]; + for (int idx = 0; idx < 256; idx++) + { + bytes[idx] = (byte)idx; + // PDFlib handles some font flaws here... + // We wait for bug reports. + + char ch = (char)idx; + string s = ansi.GetString(bytes, idx, 1); + if (s.Length != 0) + { + if (s[0] != ch) + ch = s[0]; + } + + //Debug.Assert(ch == idx); + + //int glyphIndex; + //if (symbol) + //{ + // glyphIndex = idx + (FontFace.os2. usFirstCharIndex & 0xFF00); + // glyphIndex = CharCodeToGlyphIndex((char)glyphIndex); + //} + //else + //{ + // //Debug.Assert(idx + (fontData.os2.usFirstCharIndex & 0xFF00) == idx); + // //glyphIndex = CharCodeToGlyphIndex((char)idx); + // glyphIndex = CharCodeToGlyphIndex(ch); + //} + + if (symbol) + { + // Remap ch for symbol fonts. + ch = (char)(ch | (FontFace.os2.usFirstCharIndex & 0xFF00)); // @@@ refactor + } + int glyphIndex = CharCodeToGlyphIndex(ch); + Widths[idx] = GlyphIndexToPdfWidth(glyphIndex); + } + } + public int[] Widths; + + /// + /// Gets a value indicating whether this instance belongs to a bold font. + /// + public override bool IsBoldFace + { + get + { + // usWeightClass 700 is Bold + //Debug.Assert((fontData.os2.usWeightClass >= 700) == ((fontData.os2.fsSelection & (ushort)OS2Table.FontSelectionFlags.Bold) != 0)); + return FontFace.os2.IsBold; + } + } + + /// + /// Gets a value indicating whether this instance belongs to an italic font. + /// + public override bool IsItalicFace + { + get { return FontFace.os2.IsItalic; } + } + + internal int DesignUnitsToPdf(double value) + { + return (int)Math.Round(value * 1000.0 / FontFace.head.unitsPerEm); + } + + /// + /// Maps a unicode to the index of the corresponding glyph. + /// See OpenType spec "cmap - Character To Glyph Index Mapping Table / Format 4: Segment mapping to delta values" + /// for details about this a little bit strange looking algorithm. + /// + public int CharCodeToGlyphIndex(char value) + { + try + { + CMap4 cmap = FontFace.cmap.cmap4; + int segCount = cmap.segCountX2 / 2; + int seg; + for (seg = 0; seg < segCount; seg++) + { + if (value <= cmap.endCount[seg]) + break; + } + Debug.Assert(seg < segCount); + + if (value < cmap.startCount[seg]) + return 0; + + if (cmap.idRangeOffs[seg] == 0) + return (value + cmap.idDelta[seg]) & 0xFFFF; + + int idx = cmap.idRangeOffs[seg] / 2 + (value - cmap.startCount[seg]) - (segCount - seg); + Debug.Assert(idx >= 0 && idx < cmap.glyphCount); + + if (cmap.glyphIdArray[idx] == 0) + return 0; + + return (cmap.glyphIdArray[idx] + cmap.idDelta[seg]) & 0xFFFF; + } + catch + { + GetType(); + throw; + } + } + + /// + /// Converts the width of a glyph identified by its index to PDF design units. + /// + public int GlyphIndexToPdfWidth(int glyphIndex) + { + try + { + int numberOfHMetrics = FontFace.hhea.numberOfHMetrics; + int unitsPerEm = FontFace.head.unitsPerEm; + + // glyphIndex >= numberOfHMetrics means the font is mono-spaced and all glyphs have the same width + if (glyphIndex >= numberOfHMetrics) + glyphIndex = numberOfHMetrics - 1; + + int width = FontFace.hmtx.Metrics[glyphIndex].advanceWidth; + + // Sometimes the unitsPerEm is 1000, sometimes a power of 2. + if (unitsPerEm == 1000) + return width; + return width * 1000 / unitsPerEm; // normalize + } + catch (Exception) + { + GetType(); + throw; + } + } + + public int PdfWidthFromCharCode(char ch) + { + int idx = CharCodeToGlyphIndex(ch); + int width = GlyphIndexToPdfWidth(idx); + return width; + } + + /// + /// //Converts the width of a glyph identified by its index to PDF design units. + /// + public double GlyphIndexToEmfWidth(int glyphIndex, double emSize) + { + try + { + int numberOfHMetrics = FontFace.hhea.numberOfHMetrics; + int unitsPerEm = FontFace.head.unitsPerEm; + + // glyphIndex >= numberOfHMetrics means the font is mono-spaced and all glyphs have the same width + if (glyphIndex >= numberOfHMetrics) + glyphIndex = numberOfHMetrics - 1; + + int width = FontFace.hmtx.Metrics[glyphIndex].advanceWidth; + + return width * emSize / unitsPerEm; // normalize + } + catch (Exception) + { + GetType(); + throw; + } + } + + /// + /// //Converts the width of a glyph identified by its index to PDF design units. + /// + public int GlyphIndexToWidth(int glyphIndex) + { + try + { + int numberOfHMetrics = FontFace.hhea.numberOfHMetrics; + + // glyphIndex >= numberOfHMetrics means the font is mono-spaced and all glyphs have the same width + if (glyphIndex >= numberOfHMetrics) + glyphIndex = numberOfHMetrics - 1; + + int width = FontFace.hmtx.Metrics[glyphIndex].advanceWidth; + return width; + } + catch (Exception) + { + GetType(); + throw; + } + } + } +} diff --git a/PdfSharp/Fonts.OpenType/OpenTypeFontTable.cs b/PdfSharp/Fonts.OpenType/OpenTypeFontTable.cs new file mode 100644 index 0000000..c8a6103 --- /dev/null +++ b/PdfSharp/Fonts.OpenType/OpenTypeFontTable.cs @@ -0,0 +1,118 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; + +//using Fixed = System.Int32; +//using FWord = System.Int16; +//using UFWord = System.UInt16; +#if SILVERLIGHT +using PdfSharp; +#endif + +namespace PdfSharp.Fonts.OpenType +{ + // TODO: Create a font driver for reading and writing OpenType font files. + + /// + /// Base class for all OpenType tables used in PDFsharp. + /// + internal class OpenTypeFontTable : ICloneable + { + public OpenTypeFontTable(OpenTypeFontface fontData, string tag) + { + _fontData = fontData; + if (fontData != null && fontData.TableDictionary.ContainsKey(tag)) + DirectoryEntry = fontData.TableDictionary[tag]; + else + DirectoryEntry = new TableDirectoryEntry(tag); + DirectoryEntry.FontTable = this; + } + + /// + /// Creates a deep copy of the current instance. + /// + public object Clone() + { + return DeepCopy(); + } + + protected virtual OpenTypeFontTable DeepCopy() + { + OpenTypeFontTable fontTable = (OpenTypeFontTable)MemberwiseClone(); + fontTable.DirectoryEntry.Offset = 0; + fontTable.DirectoryEntry.FontTable = fontTable; + return fontTable; + } + + /// + /// Gets the font image the table belongs to. + /// + public OpenTypeFontface FontData + { + get { return _fontData; } + } + internal OpenTypeFontface _fontData; + + public TableDirectoryEntry DirectoryEntry; + + /// + /// When overridden in a derived class, prepares the font table to be compiled into its binary representation. + /// + public virtual void PrepareForCompilation() + { } + + /// + /// When overridden in a derived class, converts the font into its binary representation. + /// + public virtual void Write(OpenTypeFontWriter writer) + { } + + /// + /// Calculates the checksum of a table represented by its bytes. + /// + public static uint CalcChecksum(byte[] bytes) + { + Debug.Assert((bytes.Length & 3) == 0); + // Cannot use Buffer.BlockCopy because 32-bit values are Big-endian in fonts. + uint byte3, byte2, byte1, byte0; + byte3 = byte2 = byte1 = byte0 = 0; + int length = bytes.Length; + for (int idx = 0; idx < length;) + { + byte3 += bytes[idx++]; + byte2 += bytes[idx++]; + byte1 += bytes[idx++]; + byte0 += bytes[idx++]; + } + return (byte3 << 24) + (byte2 << 16) + (byte1 << 8) + byte0; + } + } +} diff --git a/PdfSharp/Fonts.OpenType/OpenTypeFontTables.cs b/PdfSharp/Fonts.OpenType/OpenTypeFontTables.cs new file mode 100644 index 0000000..6d5ee25 --- /dev/null +++ b/PdfSharp/Fonts.OpenType/OpenTypeFontTables.cs @@ -0,0 +1,1051 @@ + +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#define VERBOSE_ + +using System; +using System.Diagnostics; +using System.Text; + +using Fixed = System.Int32; +using FWord = System.Int16; +using UFWord = System.UInt16; + +// ReSharper disable InconsistentNaming + +namespace PdfSharp.Fonts.OpenType +{ + internal enum PlatformId + { + Apple, Mac, Iso, Win + } + + /// + /// Only Symbol and Unicode is used by PDFsharp. + /// + internal enum WinEncodingId + { + Symbol, Unicode + } + + /// + /// CMap format 4: Segment mapping to delta values. + /// The Windows standard format. + /// + internal class CMap4 : OpenTypeFontTable + { + public WinEncodingId encodingId; // Windows encoding ID. + public ushort format; // Format number is set to 4. + public ushort length; // This is the length in bytes of the subtable. + public ushort language; // This field must be set to zero for all cmap subtables whose platform IDs are other than Macintosh (platform ID 1). + public ushort segCountX2; // 2 x segCount. + public ushort searchRange; // 2 x (2**floor(log2(segCount))) + public ushort entrySelector; // log2(searchRange/2) + public ushort rangeShift; + public ushort[] endCount; // [segCount] / End characterCode for each segment, last=0xFFFF. + public ushort[] startCount; // [segCount] / Start character code for each segment. + public short[] idDelta; // [segCount] / Delta for all character codes in segment. + public ushort[] idRangeOffs; // [segCount] / Offsets into glyphIdArray or 0 + public int glyphCount; // = (length - (16 + 4 * 2 * segCount)) / 2; + public ushort[] glyphIdArray; // Glyph index array (arbitrary length) + + public CMap4(OpenTypeFontface fontData, WinEncodingId encodingId) + : base(fontData, "----") + { + this.encodingId = encodingId; + Read(); + } + + internal void Read() + { + try + { + // m_EncodingID = encID; + format = _fontData.ReadUShort(); + Debug.Assert(format == 4, "Only format 4 expected."); + length = _fontData.ReadUShort(); + language = _fontData.ReadUShort(); // Always null in Windows + segCountX2 = _fontData.ReadUShort(); + searchRange = _fontData.ReadUShort(); + entrySelector = _fontData.ReadUShort(); + rangeShift = _fontData.ReadUShort(); + + int segCount = segCountX2 / 2; + glyphCount = (length - (16 + 8 * segCount)) / 2; + + //ASSERT_CONDITION(0 <= m_NumGlyphIds && m_NumGlyphIds < m_Length, "Invalid Index"); + + endCount = new ushort[segCount]; + startCount = new ushort[segCount]; + idDelta = new short[segCount]; + idRangeOffs = new ushort[segCount]; + + glyphIdArray = new ushort[glyphCount]; + + for (int idx = 0; idx < segCount; idx++) + endCount[idx] = _fontData.ReadUShort(); + + //ASSERT_CONDITION(m_EndCount[segs - 1] == 0xFFFF, "Out of Index"); + + // Read reserved pad. + _fontData.ReadUShort(); + + for (int idx = 0; idx < segCount; idx++) + startCount[idx] = _fontData.ReadUShort(); + + for (int idx = 0; idx < segCount; idx++) + idDelta[idx] = _fontData.ReadShort(); + + for (int idx = 0; idx < segCount; idx++) + idRangeOffs[idx] = _fontData.ReadUShort(); + + for (int idx = 0; idx < glyphCount; idx++) + glyphIdArray[idx] = _fontData.ReadUShort(); + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + /// + /// This table defines the mapping of character codes to the glyph index values used in the font. + /// It may contain more than one subtable, in order to support more than one character encoding scheme. + /// + internal class CMapTable : OpenTypeFontTable + { + public const string Tag = TableTagNames.CMap; + + public ushort version; + public ushort numTables; + + /// + /// Is true for symbol font encoding. + /// + public bool symbol; + + public CMap4 cmap4; + + /// + /// Initializes a new instance of the class. + /// + public CMapTable(OpenTypeFontface fontData) + : base(fontData, Tag) + { + Read(); + } + + internal void Read() + { + try + { + int tableOffset = _fontData.Position; + + version = _fontData.ReadUShort(); + numTables = _fontData.ReadUShort(); +#if DEBUG_ + if (_fontData.Name == "Cambria") + Debug-Break.Break(); +#endif + + bool success = false; + for (int idx = 0; idx < numTables; idx++) + { + PlatformId platformId = (PlatformId)_fontData.ReadUShort(); + WinEncodingId encodingId = (WinEncodingId)_fontData.ReadUShort(); + int offset = _fontData.ReadLong(); + + int currentPosition = _fontData.Position; + + // Just read Windows stuff. + if (platformId == PlatformId.Win && (encodingId == WinEncodingId.Symbol || encodingId == WinEncodingId.Unicode)) + { + symbol = encodingId == WinEncodingId.Symbol; + + _fontData.Position = tableOffset + offset; + cmap4 = new CMap4(_fontData, encodingId); + _fontData.Position = currentPosition; + // We have found what we are looking for, so break. + success = true; + break; + } + } + if (!success) + throw new InvalidOperationException("Font has no usable platform or encoding ID. It cannot be used with PDFsharp."); + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + /// + /// This table gives global information about the font. The bounding box values should be computed using + /// only glyphs that have contours. Glyphs with no contours should be ignored for the purposes of these calculations. + /// + internal class FontHeaderTable : OpenTypeFontTable + { + public const string Tag = TableTagNames.Head; + + public Fixed version; // 0x00010000 for Version 1.0. + public Fixed fontRevision; + public uint checkSumAdjustment; + public uint magicNumber; // Set to 0x5F0F3CF5 + public ushort flags; + public ushort unitsPerEm; // Valid range is from 16 to 16384. This value should be a power of 2 for fonts that have TrueType outlines. + public long created; + public long modified; + public short xMin, yMin; // For all glyph bounding boxes. + public short xMax, yMax; // For all glyph bounding boxes. + public ushort macStyle; + public ushort lowestRecPPEM; + public short fontDirectionHint; + public short indexToLocFormat; // 0 for short offsets, 1 for long + public short glyphDataFormat; // 0 for current format + + public FontHeaderTable(OpenTypeFontface fontData) + : base(fontData, Tag) + { + Read(); + } + + public void Read() + { + try + { + version = _fontData.ReadFixed(); + fontRevision = _fontData.ReadFixed(); + checkSumAdjustment = _fontData.ReadULong(); + magicNumber = _fontData.ReadULong(); + flags = _fontData.ReadUShort(); + unitsPerEm = _fontData.ReadUShort(); + created = _fontData.ReadLongDate(); + modified = _fontData.ReadLongDate(); + xMin = _fontData.ReadShort(); + yMin = _fontData.ReadShort(); + xMax = _fontData.ReadShort(); + yMax = _fontData.ReadShort(); + macStyle = _fontData.ReadUShort(); + lowestRecPPEM = _fontData.ReadUShort(); + fontDirectionHint = _fontData.ReadShort(); + indexToLocFormat = _fontData.ReadShort(); + glyphDataFormat = _fontData.ReadShort(); + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + /// + /// This table contains information for horizontal layout. The values in the minRightSidebearing, + /// MinLeftSideBearing and xMaxExtent should be computed using only glyphs that have contours. + /// Glyphs with no contours should be ignored for the purposes of these calculations. + /// All reserved areas must be set to 0. + /// + internal class HorizontalHeaderTable : OpenTypeFontTable + { + public const string Tag = TableTagNames.HHea; + + public Fixed version; // 0x00010000 for Version 1.0. + public FWord ascender; // Typographic ascent. (Distance from baseline of highest Ascender) + public FWord descender; // Typographic descent. (Distance from baseline of lowest Descender) + public FWord lineGap; // Typographic line gap. Negative LineGap values are treated as zero in Windows 3.1, System 6, and System 7. + public UFWord advanceWidthMax; + public FWord minLeftSideBearing; + public FWord minRightSideBearing; + public FWord xMaxExtent; + public short caretSlopeRise; + public short caretSlopeRun; + public short reserved1; + public short reserved2; + public short reserved3; + public short reserved4; + public short reserved5; + public short metricDataFormat; + public ushort numberOfHMetrics; + + public HorizontalHeaderTable(OpenTypeFontface fontData) + : base(fontData, Tag) + { + Read(); + } + + public void Read() + { + try + { + version = _fontData.ReadFixed(); + ascender = _fontData.ReadFWord(); + descender = _fontData.ReadFWord(); + lineGap = _fontData.ReadFWord(); + advanceWidthMax = _fontData.ReadUFWord(); + minLeftSideBearing = _fontData.ReadFWord(); + minRightSideBearing = _fontData.ReadFWord(); + xMaxExtent = _fontData.ReadFWord(); + caretSlopeRise = _fontData.ReadShort(); + caretSlopeRun = _fontData.ReadShort(); + reserved1 = _fontData.ReadShort(); + reserved2 = _fontData.ReadShort(); + reserved3 = _fontData.ReadShort(); + reserved4 = _fontData.ReadShort(); + reserved5 = _fontData.ReadShort(); + metricDataFormat = _fontData.ReadShort(); + numberOfHMetrics = _fontData.ReadUShort(); + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + internal class HorizontalMetrics : OpenTypeFontTable + { + public const string Tag = "----"; + + public ushort advanceWidth; + public short lsb; + + public HorizontalMetrics(OpenTypeFontface fontData) + : base(fontData, Tag) + { + Read(); + } + + public void Read() + { + try + { + advanceWidth = _fontData.ReadUFWord(); + lsb = _fontData.ReadFWord(); + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + /// + /// The type longHorMetric is defined as an array where each element has two parts: + /// the advance width, which is of type USHORT, and the left side bearing, which is of type SHORT. + /// These fields are in font design units. + /// + internal class HorizontalMetricsTable : OpenTypeFontTable + { + public const string Tag = TableTagNames.HMtx; + + public HorizontalMetrics[] Metrics; + public FWord[] LeftSideBearing; + + public HorizontalMetricsTable(OpenTypeFontface fontData) + : base(fontData, Tag) + { + Read(); + } + + public void Read() + { + try + { + HorizontalHeaderTable hhea = _fontData.hhea; + MaximumProfileTable maxp = _fontData.maxp; + if (hhea != null && maxp != null) + { + int numMetrics = hhea.numberOfHMetrics; //->NumberOfHMetrics(); + int numLsbs = maxp.numGlyphs - numMetrics; + + Debug.Assert(numMetrics != 0); + Debug.Assert(numLsbs >= 0); + + Metrics = new HorizontalMetrics[numMetrics]; + for (int idx = 0; idx < numMetrics; idx++) + Metrics[idx] = new HorizontalMetrics(_fontData); + + if (numLsbs > 0) + { + LeftSideBearing = new FWord[numLsbs]; + for (int idx = 0; idx < numLsbs; idx++) + LeftSideBearing[idx] = _fontData.ReadFWord(); + } + } + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + // UNDONE + internal class VerticalHeaderTable : OpenTypeFontTable + { + public const string Tag = TableTagNames.VHea; + + // code comes from HorizontalHeaderTable + public Fixed Version; // 0x00010000 for Version 1.0. + public FWord Ascender; // Typographic ascent. (Distance from baseline of highest Ascender) + public FWord Descender; // Typographic descent. (Distance from baseline of lowest Descender) + public FWord LineGap; // Typographic line gap. Negative LineGap values are treated as zero in Windows 3.1, System 6, and System 7. + public UFWord AdvanceWidthMax; + public FWord MinLeftSideBearing; + public FWord MinRightSideBearing; + public FWord xMaxExtent; + public short caretSlopeRise; + public short caretSlopeRun; + public short reserved1; + public short reserved2; + public short reserved3; + public short reserved4; + public short reserved5; + public short metricDataFormat; + public ushort numberOfHMetrics; + + public VerticalHeaderTable(OpenTypeFontface fontData) + : base(fontData, Tag) + { + Read(); + } + + public void Read() + { + try + { + Version = _fontData.ReadFixed(); + Ascender = _fontData.ReadFWord(); + Descender = _fontData.ReadFWord(); + LineGap = _fontData.ReadFWord(); + AdvanceWidthMax = _fontData.ReadUFWord(); + MinLeftSideBearing = _fontData.ReadFWord(); + MinRightSideBearing = _fontData.ReadFWord(); + xMaxExtent = _fontData.ReadFWord(); + caretSlopeRise = _fontData.ReadShort(); + caretSlopeRun = _fontData.ReadShort(); + reserved1 = _fontData.ReadShort(); + reserved2 = _fontData.ReadShort(); + reserved3 = _fontData.ReadShort(); + reserved4 = _fontData.ReadShort(); + reserved5 = _fontData.ReadShort(); + metricDataFormat = _fontData.ReadShort(); + numberOfHMetrics = _fontData.ReadUShort(); + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + internal class VerticalMetrics : OpenTypeFontTable + { + public const string Tag = "----"; + + // code comes from HorizontalMetrics + public ushort advanceWidth; + public short lsb; + + public VerticalMetrics(OpenTypeFontface fontData) + : base(fontData, Tag) + { + Read(); + } + + public void Read() + { + try + { + advanceWidth = _fontData.ReadUFWord(); + lsb = _fontData.ReadFWord(); + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + /// + /// The vertical Metrics table allows you to specify the vertical spacing for each glyph in a + /// vertical font. This table consists of either one or two arrays that contain metric + /// information (the advance heights and top sidebearings) for the vertical layout of each + /// of the glyphs in the font. + /// + internal class VerticalMetricsTable : OpenTypeFontTable + { + // UNDONE + public const string Tag = TableTagNames.VMtx; + + // code comes from HorizontalMetricsTable + public HorizontalMetrics[] metrics; + public FWord[] leftSideBearing; + + public VerticalMetricsTable(OpenTypeFontface fontData) + : base(fontData, Tag) + { + Read(); + throw new NotImplementedException("VerticalMetricsTable"); + } + + public void Read() + { + try + { + HorizontalHeaderTable hhea = _fontData.hhea; + MaximumProfileTable maxp = _fontData.maxp; + if (hhea != null && maxp != null) + { + int numMetrics = hhea.numberOfHMetrics; //->NumberOfHMetrics(); + int numLsbs = maxp.numGlyphs - numMetrics; + + Debug.Assert(numMetrics != 0); + Debug.Assert(numLsbs >= 0); + + metrics = new HorizontalMetrics[numMetrics]; + for (int idx = 0; idx < numMetrics; idx++) + metrics[idx] = new HorizontalMetrics(_fontData); + + if (numLsbs > 0) + { + leftSideBearing = new FWord[numLsbs]; + for (int idx = 0; idx < numLsbs; idx++) + leftSideBearing[idx] = _fontData.ReadFWord(); + } + } + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + /// + /// This table establishes the memory requirements for this font. + /// Fonts with CFF data must use Version 0.5 of this table, specifying only the numGlyphs field. + /// Fonts with TrueType outlines must use Version 1.0 of this table, where all data is required. + /// Both formats of OpenType require a 'maxp' table because a number of applications call the + /// Windows GetFontData() API on the 'maxp' table to determine the number of glyphs in the font. + /// + internal class MaximumProfileTable : OpenTypeFontTable + { + public const string Tag = TableTagNames.MaxP; + + public Fixed version; + public ushort numGlyphs; + public ushort maxPoints; + public ushort maxContours; + public ushort maxCompositePoints; + public ushort maxCompositeContours; + public ushort maxZones; + public ushort maxTwilightPoints; + public ushort maxStorage; + public ushort maxFunctionDefs; + public ushort maxInstructionDefs; + public ushort maxStackElements; + public ushort maxSizeOfInstructions; + public ushort maxComponentElements; + public ushort maxComponentDepth; + + public MaximumProfileTable(OpenTypeFontface fontData) + : base(fontData, Tag) + { + Read(); + } + + public void Read() + { + try + { + version = _fontData.ReadFixed(); + numGlyphs = _fontData.ReadUShort(); + maxPoints = _fontData.ReadUShort(); + maxContours = _fontData.ReadUShort(); + maxCompositePoints = _fontData.ReadUShort(); + maxCompositeContours = _fontData.ReadUShort(); + maxZones = _fontData.ReadUShort(); + maxTwilightPoints = _fontData.ReadUShort(); + maxStorage = _fontData.ReadUShort(); + maxFunctionDefs = _fontData.ReadUShort(); + maxInstructionDefs = _fontData.ReadUShort(); + maxStackElements = _fontData.ReadUShort(); + maxSizeOfInstructions = _fontData.ReadUShort(); + maxComponentElements = _fontData.ReadUShort(); + maxComponentDepth = _fontData.ReadUShort(); + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + /// + /// The naming table allows multilingual strings to be associated with the OpenTypeTM font file. + /// These strings can represent copyright notices, font names, family names, style names, and so on. + /// To keep this table short, the font manufacturer may wish to make a limited set of entries in some + /// small set of languages; later, the font can be "localized" and the strings translated or added. + /// Other parts of the OpenType font file that require these strings can then refer to them simply by + /// their index number. Clients that need a particular string can look it up by its platform ID, character + /// encoding ID, language ID and name ID. Note that some platforms may require single byte character + /// strings, while others may require double byte strings. + /// + /// For historical reasons, some applications which install fonts perform Version control using Macintosh + /// platform (platform ID 1) strings from the 'name' table. Because of this, we strongly recommend that + /// the 'name' table of all fonts include Macintosh platform strings and that the syntax of the Version + /// number (name id 5) follows the guidelines given in this document. + /// + internal class NameTable : OpenTypeFontTable + { + public const string Tag = TableTagNames.Name; + + /// + /// Get the font family name. + /// + public string Name = String.Empty; + + /// + /// Get the font subfamily name. + /// + public string Style = String.Empty; + + /// + /// Get the full font name. + /// + public string FullFontName = String.Empty; + + public ushort format; + public ushort count; + public ushort stringOffset; + + byte[] bytes; + + public NameTable(OpenTypeFontface fontData) + : base(fontData, Tag) + { + Read(); + } + + public void Read() + { + try + { +#if DEBUG + _fontData.Position = DirectoryEntry.Offset; +#endif + bytes = new byte[DirectoryEntry.PaddedLength]; + Buffer.BlockCopy(_fontData.FontSource.Bytes, DirectoryEntry.Offset, bytes, 0, DirectoryEntry.Length); + + format = _fontData.ReadUShort(); + count = _fontData.ReadUShort(); + stringOffset = _fontData.ReadUShort(); + + for (int idx = 0; idx < count; idx++) + { + NameRecord nrec = ReadNameRecord(); + byte[] value = new byte[nrec.length]; + Buffer.BlockCopy(_fontData.FontSource.Bytes, DirectoryEntry.Offset + stringOffset + nrec.offset, value, 0, nrec.length); + + //Debug.WriteLine(nrec.platformID.ToString()); + + // Read font name and style in US English. + if (nrec.platformID == 0 || nrec.platformID == 3) + { + // Font Family name. Up to four fonts can share the Font Family name, + // forming a font style linking group (regular, italic, bold, bold italic - + // as defined by OS/2.fsSelection bit settings). + if (nrec.nameID == 1 && nrec.languageID == 0x0409) + { + if (String.IsNullOrEmpty(Name)) + Name = Encoding.BigEndianUnicode.GetString(value, 0, value.Length); + } + + // Font Subfamily name. The Font Subfamily name distinguishes the font in a + // group with the same Font Family name (name ID 1). This is assumed to + // address style (italic, oblique) and weight (light, bold, black, etc.). + // A font with no particular differences in weight or style (e.g. medium weight, + // not italic and fsSelection bit 6 set) should have the string “Regular” stored in + // this position. + if (nrec.nameID == 2 && nrec.languageID == 0x0409) + { + if (String.IsNullOrEmpty(Style)) + Style = Encoding.BigEndianUnicode.GetString(value, 0, value.Length); + } + + // Full font name; a combination of strings 1 and 2, or a similar human-readable + // variant. If string 2 is "Regular", it is sometimes omitted from name ID 4. + if (nrec.nameID == 4 && nrec.languageID == 0x0409) + { + if (String.IsNullOrEmpty(FullFontName)) + FullFontName = Encoding.BigEndianUnicode.GetString(value, 0, value.Length); + } + } + } + Debug.Assert(!String.IsNullOrEmpty(Name)); + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + + NameRecord ReadNameRecord() + { + NameRecord nrec = new NameRecord(); + nrec.platformID = _fontData.ReadUShort(); + nrec.encodingID = _fontData.ReadUShort(); + nrec.languageID = _fontData.ReadUShort(); + nrec.nameID = _fontData.ReadUShort(); + nrec.length = _fontData.ReadUShort(); + nrec.offset = _fontData.ReadUShort(); + return nrec; + } + + class NameRecord + { + public ushort platformID; + public ushort encodingID; + public ushort languageID; + public ushort nameID; + public ushort length; + public ushort offset; + } + } + + /// + /// The OS/2 table consists of a set of Metrics that are required in OpenType fonts. + /// + internal class OS2Table : OpenTypeFontTable + { + public const string Tag = TableTagNames.OS2; + + [Flags] + public enum FontSelectionFlags : ushort + { + Italic = 1 << 0, + Bold = 1 << 5, + Regular = 1 << 6, + } + + public ushort version; + public short xAvgCharWidth; + public ushort usWeightClass; + public ushort usWidthClass; + public ushort fsType; + public short ySubscriptXSize; + public short ySubscriptYSize; + public short ySubscriptXOffset; + public short ySubscriptYOffset; + public short ySuperscriptXSize; + public short ySuperscriptYSize; + public short ySuperscriptXOffset; + public short ySuperscriptYOffset; + public short yStrikeoutSize; + public short yStrikeoutPosition; + public short sFamilyClass; + public byte[] panose; // = new byte[10]; + public uint ulUnicodeRange1; // Bits 0-31 + public uint ulUnicodeRange2; // Bits 32-63 + public uint ulUnicodeRange3; // Bits 64-95 + public uint ulUnicodeRange4; // Bits 96-127 + public string achVendID; // = ""; + public ushort fsSelection; + public ushort usFirstCharIndex; + public ushort usLastCharIndex; + public short sTypoAscender; + public short sTypoDescender; + public short sTypoLineGap; + public ushort usWinAscent; + public ushort usWinDescent; + // Version >= 1 + public uint ulCodePageRange1; // Bits 0-31 + public uint ulCodePageRange2; // Bits 32-63 + // Version >= 2 + public short sxHeight; + public short sCapHeight; + public ushort usDefaultChar; + public ushort usBreakChar; + public ushort usMaxContext; + + public OS2Table(OpenTypeFontface fontData) + : base(fontData, Tag) + { + Read(); + } + + public void Read() + { + try + { + version = _fontData.ReadUShort(); + xAvgCharWidth = _fontData.ReadShort(); + usWeightClass = _fontData.ReadUShort(); + usWidthClass = _fontData.ReadUShort(); + fsType = _fontData.ReadUShort(); + ySubscriptXSize = _fontData.ReadShort(); + ySubscriptYSize = _fontData.ReadShort(); + ySubscriptXOffset = _fontData.ReadShort(); + ySubscriptYOffset = _fontData.ReadShort(); + ySuperscriptXSize = _fontData.ReadShort(); + ySuperscriptYSize = _fontData.ReadShort(); + ySuperscriptXOffset = _fontData.ReadShort(); + ySuperscriptYOffset = _fontData.ReadShort(); + yStrikeoutSize = _fontData.ReadShort(); + yStrikeoutPosition = _fontData.ReadShort(); + sFamilyClass = _fontData.ReadShort(); + panose = _fontData.ReadBytes(10); + ulUnicodeRange1 = _fontData.ReadULong(); + ulUnicodeRange2 = _fontData.ReadULong(); + ulUnicodeRange3 = _fontData.ReadULong(); + ulUnicodeRange4 = _fontData.ReadULong(); + achVendID = _fontData.ReadString(4); + fsSelection = _fontData.ReadUShort(); + usFirstCharIndex = _fontData.ReadUShort(); + usLastCharIndex = _fontData.ReadUShort(); + sTypoAscender = _fontData.ReadShort(); + sTypoDescender = _fontData.ReadShort(); + sTypoLineGap = _fontData.ReadShort(); + usWinAscent = _fontData.ReadUShort(); + usWinDescent = _fontData.ReadUShort(); + + if (version >= 1) + { + ulCodePageRange1 = _fontData.ReadULong(); + ulCodePageRange2 = _fontData.ReadULong(); + + if (version >= 2) + { + sxHeight = _fontData.ReadShort(); + sCapHeight = _fontData.ReadShort(); + usDefaultChar = _fontData.ReadUShort(); + usBreakChar = _fontData.ReadUShort(); + usMaxContext = _fontData.ReadUShort(); + } + } + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + + public bool IsBold + { + get { return (fsSelection & (ushort)FontSelectionFlags.Bold) != 0; } + } + + public bool IsItalic + { + get { return (fsSelection & (ushort)FontSelectionFlags.Italic) != 0; } + } + } + + /// + /// This table contains additional information needed to use TrueType or OpenTypeTM fonts + /// on PostScript printers. + /// + internal class PostScriptTable : OpenTypeFontTable + { + public const string Tag = TableTagNames.Post; + + public Fixed formatType; + public float italicAngle; + public FWord underlinePosition; + public FWord underlineThickness; + public ulong isFixedPitch; + public ulong minMemType42; + public ulong maxMemType42; + public ulong minMemType1; + public ulong maxMemType1; + + public PostScriptTable(OpenTypeFontface fontData) + : base(fontData, Tag) + { + Read(); + } + + public void Read() + { + try + { + formatType = _fontData.ReadFixed(); + italicAngle = _fontData.ReadFixed() / 65536f; + underlinePosition = _fontData.ReadFWord(); + underlineThickness = _fontData.ReadFWord(); + isFixedPitch = _fontData.ReadULong(); + minMemType42 = _fontData.ReadULong(); + maxMemType42 = _fontData.ReadULong(); + minMemType1 = _fontData.ReadULong(); + maxMemType1 = _fontData.ReadULong(); + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + /// + /// This table contains a list of values that can be referenced by instructions. + /// They can be used, among other things, to control characteristics for different glyphs. + /// The length of the table must be an integral number of FWORD units. + /// + internal class ControlValueTable : OpenTypeFontTable + { + public const string Tag = TableTagNames.Cvt; + + FWord[] array; // List of n values referenceable by instructions. n is the number of FWORD items that fit in the size of the table. + + public ControlValueTable(OpenTypeFontface fontData) + : base(fontData, Tag) + { + DirectoryEntry.Tag = TableTagNames.Cvt; + DirectoryEntry = fontData.TableDictionary[TableTagNames.Cvt]; + Read(); + } + + public void Read() + { + try + { + int length = DirectoryEntry.Length / 2; + array = new FWord[length]; + for (int idx = 0; idx < length; idx++) + array[idx] = _fontData.ReadFWord(); + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + /// + /// This table is similar to the CVT Program, except that it is only run once, when the font is first used. + /// It is used only for FDEFs and IDEFs. Thus the CVT Program need not contain function definitions. + /// However, the CVT Program may redefine existing FDEFs or IDEFs. + /// + internal class FontProgram : OpenTypeFontTable + { + public const string Tag = TableTagNames.Fpgm; + + byte[] bytes; // Instructions. n is the number of BYTE items that fit in the size of the table. + + public FontProgram(OpenTypeFontface fontData) + : base(fontData, Tag) + { + DirectoryEntry.Tag = TableTagNames.Fpgm; + DirectoryEntry = fontData.TableDictionary[TableTagNames.Fpgm]; + Read(); + } + + public void Read() + { + try + { + int length = DirectoryEntry.Length; + bytes = new byte[length]; + for (int idx = 0; idx < length; idx++) + bytes[idx] = _fontData.ReadByte(); + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + /// + /// The Control Value Program consists of a set of TrueType instructions that will be executed whenever the font or + /// point size or transformation matrix change and before each glyph is interpreted. Any instruction is legal in the + /// CVT Program but since no glyph is associated with it, instructions intended to move points within a particular + /// glyph outline cannot be used in the CVT Program. The name 'prep' is anachronistic. + /// + internal class ControlValueProgram : OpenTypeFontTable + { + public const string Tag = TableTagNames.Prep; + + byte[] bytes; // Set of instructions executed whenever point size or font or transformation change. n is the number of BYTE items that fit in the size of the table. + + public ControlValueProgram(OpenTypeFontface fontData) + : base(fontData, Tag) + { + DirectoryEntry.Tag = TableTagNames.Prep; + DirectoryEntry = fontData.TableDictionary[TableTagNames.Prep]; + Read(); + } + + public void Read() + { + try + { + int length = DirectoryEntry.Length; + bytes = new byte[length]; + for (int idx = 0; idx < length; idx++) + bytes[idx] = _fontData.ReadByte(); + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } + + /// + /// This table contains information that describes the glyphs in the font in the TrueType outline format. + /// Information regarding the rasterizer (scaler) refers to the TrueType rasterizer. + /// + internal class GlyphSubstitutionTable : OpenTypeFontTable + { + public const string Tag = TableTagNames.GSUB; + + public GlyphSubstitutionTable(OpenTypeFontface fontData) + : base(fontData, Tag) + { + DirectoryEntry.Tag = TableTagNames.GSUB; + DirectoryEntry = fontData.TableDictionary[TableTagNames.GSUB]; + Read(); + } + + public void Read() + { + try + { + } + catch (Exception ex) + { + throw new InvalidOperationException(PSSR.ErrorReadingFontData, ex); + } + } + } +} diff --git a/PdfSharp/Fonts.OpenType/OpenTypeFontWriter.cs b/PdfSharp/Fonts.OpenType/OpenTypeFontWriter.cs new file mode 100644 index 0000000..a0e9d9c --- /dev/null +++ b/PdfSharp/Fonts.OpenType/OpenTypeFontWriter.cs @@ -0,0 +1,59 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using System.IO; + +namespace PdfSharp.Fonts.OpenType +{ + /// + /// Represents a writer for True Type font files. + /// + internal class OpenTypeFontWriter : FontWriter + { + /// + /// Initializes a new instance of the class. + /// + public OpenTypeFontWriter(Stream stream) + : base(stream) + { } + + /// + /// Writes a table name. + /// + public void WriteTag(string tag) + { + Debug.Assert(tag.Length == 4); + WriteByte((byte)(tag[0])); + WriteByte((byte)(tag[1])); + WriteByte((byte)(tag[2])); + WriteByte((byte)(tag[3])); + } + } +} diff --git a/PdfSharp/Fonts.OpenType/OpenTypeFontface.cs b/PdfSharp/Fonts.OpenType/OpenTypeFontface.cs new file mode 100644 index 0000000..6e9fc8f --- /dev/null +++ b/PdfSharp/Fonts.OpenType/OpenTypeFontface.cs @@ -0,0 +1,746 @@ + +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#define VERBOSE_ + +using System; +using System.Diagnostics; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Runtime.InteropServices; +using System.IO; +#if GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using GdiFontFamily = System.Drawing.FontFamily; +using GdiFont = System.Drawing.Font; +using GdiFontStyle = System.Drawing.FontStyle; +#endif +#if WPF +using System.Windows; +using System.Windows.Documents; +using System.Windows.Media; +using WpfFontFamily = System.Windows.Media.FontFamily; +using WpfTypeface = System.Windows.Media.Typeface; +using WpfGlyphTypeface = System.Windows.Media.GlyphTypeface; +#endif +using PdfSharp.Fonts; +#if !EDF_CORE +using PdfSharp.Drawing; +using PdfSharp.Internal; +#endif + +using Fixed = System.Int32; +using FWord = System.Int16; +using UFWord = System.UInt16; + +#pragma warning disable 0649 + +namespace PdfSharp.Fonts.OpenType +{ + /// + /// Represents an OpenType fontface in memory. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + internal sealed class OpenTypeFontface + { + // Implementation Notes + // OpenTypeFontface represents a 'decompiled' font file in memory. + // + // * An OpenTypeFontface can belong to more than one + // XGlyphTypeface because of StyleSimulations. + // + // * Currently there is a one to one relationship to XFontSource. + // + // * Consider OpenTypeFontface as an decompiled XFontSource. + // + // http://www.microsoft.com/typography/otspec/ + + /// + /// Shallow copy for font subset. + /// + OpenTypeFontface(OpenTypeFontface fontface) + { + _offsetTable = fontface._offsetTable; + _fullFaceName = fontface._fullFaceName; + } + + /// + /// Initializes a new instance of the class. + /// + public OpenTypeFontface(byte[] data, string faceName) + { + _fullFaceName = faceName; + // Always save a copy of the font bytes. + int length = data.Length; + //FontSource = new XFontSource(faceName, new byte[length]); + Array.Copy(data, FontSource.Bytes, length); + Read(); + } + + public OpenTypeFontface(XFontSource fontSource) + { + FontSource = fontSource; + Read(); + _fullFaceName = name.FullFontName; + } + + public static OpenTypeFontface CetOrCreateFrom(XFontSource fontSource) + { + OpenTypeFontface fontface; + if (OpenTypeFontfaceCache.TryGetFontface(fontSource.Key, out fontface)) + { + return fontface; + } + // Each font source already contains its OpenTypeFontface. + Debug.Assert(fontSource.Fontface != null); + fontface = OpenTypeFontfaceCache.AddFontface(fontSource.Fontface); + Debug.Assert(ReferenceEquals(fontSource.Fontface, fontface)); + return fontface; + } + + /// + /// Gets the full face name from the name table. + /// Name is also used as the key. + /// + public string FullFaceName + { + get { return _fullFaceName; } + } + readonly string _fullFaceName; + + public ulong CheckSum + { + get + { + if (_checkSum == 0) + _checkSum = FontHelper.CalcChecksum(FontSource.Bytes); + return _checkSum; + } + } + ulong _checkSum; + + /// + /// Gets the bytes that represents the font data. + /// + public XFontSource FontSource + { + get { return _fontSource; } + private set + { + // Stop working if font was not found. + if (value == null) + throw new InvalidOperationException("Font cannot be resolved."); + _fontSource = value; + } + } + XFontSource _fontSource; + + internal FontTechnology _fontTechnology; + + internal OffsetTable _offsetTable; + + /// + /// The dictionary of all font tables. + /// + internal Dictionary TableDictionary = new Dictionary(); + + // Keep names identical to OpenType spec. + // ReSharper disable InconsistentNaming + internal CMapTable cmap; + internal ControlValueTable cvt; + internal FontProgram fpgm; + internal MaximumProfileTable maxp; + internal NameTable name; + internal ControlValueProgram prep; + internal FontHeaderTable head; + internal HorizontalHeaderTable hhea; + internal HorizontalMetricsTable hmtx; + internal OS2Table os2; + internal PostScriptTable post; + internal GlyphDataTable glyf; + internal IndexToLocationTable loca; + internal GlyphSubstitutionTable gsub; + internal VerticalHeaderTable vhea; // TODO + internal VerticalMetricsTable vmtx; // TODO + // ReSharper restore InconsistentNaming + + public bool CanRead + { + get { return FontSource != null; } + } + + public bool CanWrite + { + get { return FontSource == null; } + } + + /// + /// Adds the specified table to this font image. + /// + public void AddTable(OpenTypeFontTable fontTable) + { + if (!CanWrite) + throw new InvalidOperationException("Font image cannot be modified."); + + if (fontTable == null) + throw new ArgumentNullException("fontTable"); + + if (fontTable._fontData == null) + { + fontTable._fontData = this; + } + else + { + Debug.Assert(fontTable._fontData.CanRead); + // Create a reference to this font table + fontTable = new IRefFontTable(this, fontTable); + } + + //Debug.Assert(fontTable.FontData == null); + //fontTable.fontData = this; + + TableDictionary[fontTable.DirectoryEntry.Tag] = fontTable.DirectoryEntry; + switch (fontTable.DirectoryEntry.Tag) + { + case TableTagNames.CMap: + cmap = fontTable as CMapTable; + break; + + case TableTagNames.Cvt: + cvt = fontTable as ControlValueTable; + break; + + case TableTagNames.Fpgm: + fpgm = fontTable as FontProgram; + break; + + case TableTagNames.MaxP: + maxp = fontTable as MaximumProfileTable; + break; + + case TableTagNames.Name: + name = fontTable as NameTable; + break; + + case TableTagNames.Head: + head = fontTable as FontHeaderTable; + break; + + case TableTagNames.HHea: + hhea = fontTable as HorizontalHeaderTable; + break; + + case TableTagNames.HMtx: + hmtx = fontTable as HorizontalMetricsTable; + break; + + case TableTagNames.OS2: + os2 = fontTable as OS2Table; + break; + + case TableTagNames.Post: + post = fontTable as PostScriptTable; + break; + + case TableTagNames.Glyf: + glyf = fontTable as GlyphDataTable; + break; + + case TableTagNames.Loca: + loca = fontTable as IndexToLocationTable; + break; + + case TableTagNames.GSUB: + gsub = fontTable as GlyphSubstitutionTable; + break; + + case TableTagNames.Prep: + prep = fontTable as ControlValueProgram; + break; + } + } + + /// + /// Reads all required tables from the font data. + /// + internal void Read() + { + // Determine font technology + // ReSharper disable InconsistentNaming + const uint OTTO = 0x4f54544f; // Adobe OpenType CFF data, tag: 'OTTO' + const uint TTCF = 0x74746366; // TrueType Collection tag: 'ttcf' + // ReSharper restore InconsistentNaming + try + { +#if DEBUG_ + if (Name == "Cambria") + Debug-Break.Break(); +#endif + + // Check if data is a TrueType collection font. + uint startTag = ReadULong(); + if (startTag == TTCF) + { + _fontTechnology = FontTechnology.TrueTypeCollection; + throw new InvalidOperationException("TrueType collection fonts are not yet supported by PDFsharp."); + } + + // Read offset table + _offsetTable.Version = startTag; + _offsetTable.TableCount = ReadUShort(); + _offsetTable.SearchRange = ReadUShort(); + _offsetTable.EntrySelector = ReadUShort(); + _offsetTable.RangeShift = ReadUShort(); + + // Move to table dictionary at position 12 + Debug.Assert(_pos == 12); + //tableDictionary = (offsetTable.TableCount); + + if (_offsetTable.Version == OTTO) + _fontTechnology = FontTechnology.PostscriptOutlines; + else + _fontTechnology = FontTechnology.TrueTypeOutlines; + + for (int idx = 0; idx < _offsetTable.TableCount; idx++) + { + TableDirectoryEntry entry = TableDirectoryEntry.ReadFrom(this); + TableDictionary.Add(entry.Tag, entry); +#if VERBOSE + Debug.WriteLine(String.Format("Font table: {0}", entry.Tag)); +#endif + } + + // PDFlib checks this, but it is not part of the OpenType spec anymore + if (TableDictionary.ContainsKey("bhed")) + throw new NotSupportedException("Bitmap fonts are not supported by PDFsharp."); + + // Read required tables + if (Seek(CMapTable.Tag) != -1) + cmap = new CMapTable(this); + + if (Seek(ControlValueTable.Tag) != -1) + cvt = new ControlValueTable(this); + + if (Seek(FontProgram.Tag) != -1) + fpgm = new FontProgram(this); + + if (Seek(MaximumProfileTable.Tag) != -1) + maxp = new MaximumProfileTable(this); + + if (Seek(NameTable.Tag) != -1) + name = new NameTable(this); + + if (Seek(FontHeaderTable.Tag) != -1) + head = new FontHeaderTable(this); + + if (Seek(HorizontalHeaderTable.Tag) != -1) + hhea = new HorizontalHeaderTable(this); + + if (Seek(HorizontalMetricsTable.Tag) != -1) + hmtx = new HorizontalMetricsTable(this); + + if (Seek(OS2Table.Tag) != -1) + os2 = new OS2Table(this); + + if (Seek(PostScriptTable.Tag) != -1) + post = new PostScriptTable(this); + + if (Seek(GlyphDataTable.Tag) != -1) + glyf = new GlyphDataTable(this); + + if (Seek(IndexToLocationTable.Tag) != -1) + loca = new IndexToLocationTable(this); + + if (Seek(GlyphSubstitutionTable.Tag) != -1) + gsub = new GlyphSubstitutionTable(this); + + if (Seek(ControlValueProgram.Tag) != -1) + prep = new ControlValueProgram(this); + } + catch (Exception) + { + GetType(); + throw; + } + } + + /// + /// Creates a new font image that is a subset of this font image containing only the specified glyphs. + /// + public OpenTypeFontface CreateFontSubSet(Dictionary glyphs, bool cidFont) + { + // Create new font image + OpenTypeFontface fontData = new OpenTypeFontface(this); + + // Create new loca and glyf table + IndexToLocationTable locaNew = new IndexToLocationTable(); + locaNew.ShortIndex = loca.ShortIndex; + GlyphDataTable glyfNew = new GlyphDataTable(); + + // Add all required tables + //fontData.AddTable(os2); + if (!cidFont) + fontData.AddTable(cmap); + if (cvt != null) + fontData.AddTable(cvt); + if (fpgm != null) + fontData.AddTable(fpgm); + fontData.AddTable(glyfNew); + fontData.AddTable(head); + fontData.AddTable(hhea); + fontData.AddTable(hmtx); + fontData.AddTable(locaNew); + if (maxp != null) + fontData.AddTable(maxp); + //fontData.AddTable(name); + if (prep != null) + fontData.AddTable(prep); + + // Get closure of used glyphs. + glyf.CompleteGlyphClosure(glyphs); + + // Create a sorted array of all used glyphs. + int glyphCount = glyphs.Count; + int[] glyphArray = new int[glyphCount]; + glyphs.Keys.CopyTo(glyphArray, 0); + Array.Sort(glyphArray); + + // Calculate new size of glyph table. + int size = 0; + for (int idx = 0; idx < glyphCount; idx++) + size += glyf.GetGlyphSize(glyphArray[idx]); + glyfNew.DirectoryEntry.Length = size; + + // Create new loca table + int numGlyphs = maxp.numGlyphs; + locaNew.LocaTable = new int[numGlyphs + 1]; + + // Create new glyf table + glyfNew.GlyphTable = new byte[glyfNew.DirectoryEntry.PaddedLength]; + + // Fill new glyf and loca table + int glyphOffset = 0; + int glyphIndex = 0; + for (int idx = 0; idx < numGlyphs; idx++) + { + locaNew.LocaTable[idx] = glyphOffset; + if (glyphIndex < glyphCount && glyphArray[glyphIndex] == idx) + { + glyphIndex++; + byte[] bytes = glyf.GetGlyphData(idx); + int length = bytes.Length; + if (length > 0) + { + Buffer.BlockCopy(bytes, 0, glyfNew.GlyphTable, glyphOffset, length); + glyphOffset += length; + } + } + } + locaNew.LocaTable[numGlyphs] = glyphOffset; + + // Compile font tables into byte array + fontData.Compile(); + + return fontData; + } + + /// + /// Compiles the font to its binary representation. + /// + void Compile() + { + MemoryStream stream = new MemoryStream(); + OpenTypeFontWriter writer = new OpenTypeFontWriter(stream); + + int tableCount = TableDictionary.Count; + int selector = _entrySelectors[tableCount]; + + _offsetTable.Version = 0x00010000; + _offsetTable.TableCount = tableCount; + _offsetTable.SearchRange = (ushort)((1 << selector) * 16); + _offsetTable.EntrySelector = (ushort)selector; + _offsetTable.RangeShift = (ushort)((tableCount - (1 << selector)) * 16); + _offsetTable.Write(writer); + + // Sort tables by tag name + string[] tags = new string[tableCount]; + TableDictionary.Keys.CopyTo(tags, 0); + Array.Sort(tags, StringComparer.Ordinal); + +#if VERBOSE + Debug.WriteLine("Start Compile"); +#endif + // Write tables in alphabetical order + int tablePosition = 12 + 16 * tableCount; + for (int idx = 0; idx < tableCount; idx++) + { + TableDirectoryEntry entry = TableDictionary[tags[idx]]; +#if DEBUG + if (entry.Tag == "glyf" || entry.Tag == "loca") + GetType(); +#endif + entry.FontTable.PrepareForCompilation(); + entry.Offset = tablePosition; + writer.Position = tablePosition; + entry.FontTable.Write(writer); + int endPosition = writer.Position; + tablePosition = endPosition; + writer.Position = 12 + 16 * idx; + entry.Write(writer); +#if VERBOSE + Debug.WriteLine(String.Format(" Write Table '{0}', offset={1}, length={2}, checksum={3}, ", entry.Tag, entry.Offset, entry.Length, entry.CheckSum)); +#endif + } +#if VERBOSE + Debug.WriteLine("End Compile"); +#endif + writer.Stream.Flush(); + int l = (int)writer.Stream.Length; + FontSource = XFontSource.CreateCompiledFont(stream.ToArray()); + } + // 2^entrySelector[n] <= n + static readonly int[] _entrySelectors = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; + + public int Position + { + get { return _pos; } + set { _pos = value; } + } + int _pos; + + public int Seek(string tag) + { + if (TableDictionary.ContainsKey(tag)) + { + _pos = TableDictionary[tag].Offset; + return _pos; + } + return -1; + } + + public int SeekOffset(int offset) + { + _pos += offset; + return _pos; + } + + /// + /// Reads a System.Byte. + /// + public byte ReadByte() + { + return _fontSource.Bytes[_pos++]; + } + + /// + /// Reads a System.Int16. + /// + public short ReadShort() + { + int pos = _pos; + _pos += 2; + return (short)((_fontSource.Bytes[pos] << 8) | (_fontSource.Bytes[pos + 1])); + } + + /// + /// Reads a System.UInt16. + /// + public ushort ReadUShort() + { + int pos = _pos; + _pos += 2; + return (ushort)((_fontSource.Bytes[pos] << 8) | (_fontSource.Bytes[pos + 1])); + } + + /// + /// Reads a System.Int32. + /// + public int ReadLong() + { + int pos = _pos; + _pos += 4; + return (_fontSource.Bytes[pos] << 24) | (_fontSource.Bytes[pos + 1] << 16) | (_fontSource.Bytes[pos + 2] << 8) | (_fontSource.Bytes[pos + 3]); + } + + /// + /// Reads a System.UInt32. + /// + public uint ReadULong() + { + int pos = _pos; + _pos += 4; + return (uint)((_fontSource.Bytes[pos] << 24) | (_fontSource.Bytes[pos + 1] << 16) | (_fontSource.Bytes[pos + 2] << 8) | (_fontSource.Bytes[pos + 3])); + } + + /// + /// Reads a System.Int32. + /// + public Fixed ReadFixed() + { + int pos = _pos; + _pos += 4; + return (_fontSource.Bytes[pos] << 24) | (_fontSource.Bytes[pos + 1] << 16) | (_fontSource.Bytes[pos + 2] << 8) | (_fontSource.Bytes[pos + 3]); + } + + /// + /// Reads a System.Int16. + /// + public short ReadFWord() + { + int pos = _pos; + _pos += 2; + return (short)((_fontSource.Bytes[pos] << 8) | (_fontSource.Bytes[pos + 1])); + } + + /// + /// Reads a System.UInt16. + /// + public ushort ReadUFWord() + { + int pos = _pos; + _pos += 2; + return (ushort)((_fontSource.Bytes[pos] << 8) | (_fontSource.Bytes[pos + 1])); + } + + /// + /// Reads a System.Int64. + /// + public long ReadLongDate() + { + int pos = _pos; + _pos += 8; + byte[] bytes = _fontSource.Bytes; + return (((long)bytes[pos]) << 56) | (((long)bytes[pos + 1]) << 48) | (((long)bytes[pos + 2]) << 40) | (((long)bytes[pos + 3]) << 32) | + (((long)bytes[pos + 4]) << 24) | (((long)bytes[pos + 5]) << 16) | (((long)bytes[pos + 6]) << 8) | bytes[pos + 7]; + } + + /// + /// Reads a System.String with the specified size. + /// + public string ReadString(int size) + { + char[] chars = new char[size]; + for (int idx = 0; idx < size; idx++) + chars[idx] = (char)_fontSource.Bytes[_pos++]; + return new string(chars); + } + + /// + /// Reads a System.Byte[] with the specified size. + /// + public byte[] ReadBytes(int size) + { + byte[] bytes = new byte[size]; + for (int idx = 0; idx < size; idx++) + bytes[idx] = _fontSource.Bytes[_pos++]; + return bytes; + } + + /// + /// Reads the specified buffer. + /// + public void Read(byte[] buffer) + { + Read(buffer, 0, buffer.Length); + } + + /// + /// Reads the specified buffer. + /// + public void Read(byte[] buffer, int offset, int length) + { + Buffer.BlockCopy(_fontSource.Bytes, _pos, buffer, offset, length); + _pos += length; + } + + /// + /// Reads a System.Char[4] as System.String. + /// + public string ReadTag() + { + return ReadString(4); + } + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + // ReSharper disable UnusedMember.Local + internal string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get { return string.Format(CultureInfo.InvariantCulture, "OpenType fontfaces: {0}", _fullFaceName); } + } + + /// + /// Represents the font offset table. + /// + internal struct OffsetTable + { + /// + /// 0x00010000 for Version 1.0. + /// + public uint Version; + + /// + /// Number of tables. + /// + public int TableCount; + + /// + /// (Maximum power of 2 ≤ numTables) x 16. + /// + public ushort SearchRange; + + /// + /// Log2(maximum power of 2 ≤ numTables). + /// + public ushort EntrySelector; + + /// + /// NumTables x 16-searchRange. + /// + public ushort RangeShift; + + /// + /// Writes the offset table. + /// + public void Write(OpenTypeFontWriter writer) + { + writer.WriteUInt(Version); + writer.WriteShort(TableCount); + writer.WriteUShort(SearchRange); + writer.WriteUShort(EntrySelector); + writer.WriteUShort(RangeShift); + } + } + } +} diff --git a/PdfSharp/Fonts.OpenType/OpenTypeFontfaceCache.cs b/PdfSharp/Fonts.OpenType/OpenTypeFontfaceCache.cs new file mode 100644 index 0000000..faa19ad --- /dev/null +++ b/PdfSharp/Fonts.OpenType/OpenTypeFontfaceCache.cs @@ -0,0 +1,157 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using PdfSharp.Internal; + +namespace PdfSharp.Fonts.OpenType +{ + /// + /// Global table of all OpenType fontfaces cached by their face name and check sum. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + internal class OpenTypeFontfaceCache + { + OpenTypeFontfaceCache() + { + _fontfaceCache = new Dictionary(StringComparer.OrdinalIgnoreCase); + _fontfacesByCheckSum = new Dictionary(); + } + + /// + /// Tries to get fontface by its key. + /// + public static bool TryGetFontface(string key, out OpenTypeFontface fontface) + { + try + { + Lock.EnterFontFactory(); + bool result = Singleton._fontfaceCache.TryGetValue(key, out fontface); + return result; + } + finally { Lock.ExitFontFactory(); } + } + + /// + /// Tries to get fontface by its check sum. + /// + public static bool TryGetFontface(ulong checkSum, out OpenTypeFontface fontface) + { + try + { + Lock.EnterFontFactory(); + bool result = Singleton._fontfacesByCheckSum.TryGetValue(checkSum, out fontface); + return result; + } + finally { Lock.ExitFontFactory(); } + } + + public static OpenTypeFontface AddFontface(OpenTypeFontface fontface) + { + try + { + Lock.EnterFontFactory(); + OpenTypeFontface fontfaceCheck; + if (TryGetFontface(fontface.FullFaceName, out fontfaceCheck)) + { + if (fontfaceCheck.CheckSum != fontface.CheckSum) + throw new InvalidOperationException("OpenTypeFontface with same signature but different bytes."); + return fontfaceCheck; + } + Singleton._fontfaceCache.Add(fontface.FullFaceName, fontface); + Singleton._fontfacesByCheckSum.Add(fontface.CheckSum, fontface); + return fontface; + } + finally { Lock.ExitFontFactory(); } + } + + /// + /// Gets the singleton. + /// + static OpenTypeFontfaceCache Singleton + { + get + { + // ReSharper disable once InvertIf + if (_singleton == null) + { + try + { + Lock.EnterFontFactory(); + if (_singleton == null) + _singleton = new OpenTypeFontfaceCache(); + } + finally { Lock.ExitFontFactory(); } + } + return _singleton; + } + } + static volatile OpenTypeFontfaceCache _singleton; + + internal static string GetCacheState() + { + StringBuilder state = new StringBuilder(); + state.Append("====================\n"); + state.Append("OpenType fontfaces by name\n"); + Dictionary.KeyCollection familyKeys = Singleton._fontfaceCache.Keys; + int count = familyKeys.Count; + string[] keys = new string[count]; + familyKeys.CopyTo(keys, 0); + Array.Sort(keys, StringComparer.OrdinalIgnoreCase); + foreach (string key in keys) + state.AppendFormat(" {0}: {1}\n", key, Singleton._fontfaceCache[key].DebuggerDisplay); + state.Append("\n"); + return state.ToString(); + } + + /// + /// Maps face name to OpenType fontface. + /// + readonly Dictionary _fontfaceCache; + + /// + /// Maps font source key to OpenType fontface. + /// + readonly Dictionary _fontfacesByCheckSum; + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + // ReSharper disable UnusedMember.Local + string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get { return string.Format(CultureInfo.InvariantCulture, "Fontfaces: {0}", _fontfaceCache.Count); } + } + } +} diff --git a/PdfSharp/Fonts.OpenType/TableDirectoryEntry.cs b/PdfSharp/Fonts.OpenType/TableDirectoryEntry.cs new file mode 100644 index 0000000..4869f46 --- /dev/null +++ b/PdfSharp/Fonts.OpenType/TableDirectoryEntry.cs @@ -0,0 +1,130 @@ + +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#define VERBOSE_ + +using System.Diagnostics; + +//using Fixed = System.Int32; +//using FWord = System.Int16; +//using UFWord = System.UInt16; + +namespace PdfSharp.Fonts.OpenType +{ + /// + /// Represents an entry in the fonts table dictionary. + /// + internal class TableDirectoryEntry + { + /// + /// Initializes a new instance of the class. + /// + public TableDirectoryEntry() + { } + + /// + /// Initializes a new instance of the class. + /// + public TableDirectoryEntry(string tag) + { + Debug.Assert(tag.Length == 4); + Tag = tag; + //CheckSum = 0; + //Offset = 0; + //Length = 0; + //FontTable = null; + } + + /// + /// 4 -byte identifier. + /// + public string Tag; + + /// + /// CheckSum for this table. + /// + public uint CheckSum; + + /// + /// Offset from beginning of TrueType font file. + /// + public int Offset; + + /// + /// Actual length of this table in bytes. + /// + public int Length; + + /// + /// Gets the length rounded up to a multiple of four bytes. + /// + public int PaddedLength + { + get { return (Length + 3) & ~3; } + } + + /// + /// Associated font table. + /// + public OpenTypeFontTable FontTable; + + /// + /// Creates and reads a TableDirectoryEntry from the font image. + /// + public static TableDirectoryEntry ReadFrom(OpenTypeFontface fontData) + { + TableDirectoryEntry entry = new TableDirectoryEntry(); + entry.Tag = fontData.ReadTag(); + entry.CheckSum = fontData.ReadULong(); + entry.Offset = fontData.ReadLong(); + entry.Length = (int)fontData.ReadULong(); + return entry; + } + + public void Read(OpenTypeFontface fontData) + { + Tag = fontData.ReadTag(); + CheckSum = fontData.ReadULong(); + Offset = fontData.ReadLong(); + Length = (int)fontData.ReadULong(); + } + + public void Write(OpenTypeFontWriter writer) + { + Debug.Assert(Tag.Length == 4); + Debug.Assert(Offset != 0); + Debug.Assert(Length != 0); + writer.WriteTag(Tag); + writer.WriteUInt(CheckSum); + writer.WriteInt(Offset); + writer.WriteUInt((uint)Length); + } + } +} diff --git a/PdfSharp/Fonts.OpenType/enums/FontTechnology.cs b/PdfSharp/Fonts.OpenType/enums/FontTechnology.cs new file mode 100644 index 0000000..de3d9ec --- /dev/null +++ b/PdfSharp/Fonts.OpenType/enums/FontTechnology.cs @@ -0,0 +1,52 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Fonts.OpenType +{ + /// + /// Identifies the technology of an OpenType font file. + /// + enum FontTechnology + { + /// + /// Font is Adobe Postscript font in CFF. + /// + PostscriptOutlines, + + /// + /// Font is a TrueType font. + /// + TrueTypeOutlines, + + /// + /// Font is a TrueType font collection. + /// + TrueTypeCollection + } +} diff --git a/PdfSharp/Fonts.OpenType/enums/TableTagNames.cs b/PdfSharp/Fonts.OpenType/enums/TableTagNames.cs new file mode 100644 index 0000000..d5aeb1c --- /dev/null +++ b/PdfSharp/Fonts.OpenType/enums/TableTagNames.cs @@ -0,0 +1,211 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// ReSharper disable InconsistentNaming + +namespace PdfSharp.Fonts.OpenType +{ + /// + /// TrueType font table names. + /// + static class TableTagNames + { + // --- Required Tables --- + + /// + /// Character to glyph mapping. + /// + public const string CMap = "cmap"; + + /// + /// Font header . + /// + public const string Head = "head"; + + /// + /// Horizontal header. + /// + public const string HHea = "hhea"; + + /// + /// Horizontal Metrics. + /// + public const string HMtx = "hmtx"; + + /// + /// Maximum profile. + /// + public const string MaxP = "maxp"; + + /// + /// Naming table. + /// + public const string Name = "name"; + + /// + /// OS/2 and Windows specific Metrics. + /// + public const string OS2 = "OS/2"; + + /// + /// PostScript information. + /// + public const string Post = "post"; + + // --- Tables Related to TrueType Outlines --- + + /// + /// Control Value Table. + /// + public const string Cvt = "cvt "; + + /// + /// Font program. + /// + public const string Fpgm = "fpgm"; + + /// + /// Glyph data. + /// + public const string Glyf = "glyf"; + + /// + /// Index to location. + /// + public const string Loca = "loca"; + + /// + /// CVT Program. + /// + public const string Prep = "prep"; + + // --- Tables Related to PostScript Outlines --- + + /// + /// PostScript font program (compact font format). + /// + public const string Cff = "CFF"; + + /// + /// Vertical Origin. + /// + public const string VOrg = "VORG"; + + // --- Tables Related to Bitmap Glyphs --- + + /// + /// Embedded bitmap data. + /// + public const string EBDT = "EBDT"; + + /// + /// Embedded bitmap location data. + /// + public const string EBLC = "EBLC"; + + /// + /// Embedded bitmap scaling data. + /// + public const string EBSC = "EBSC"; + + // --- Advanced Typographic Tables --- + + /// + /// Baseline data. + /// + public const string BASE = "BASE"; + + /// + /// Glyph definition data. + /// + public const string GDEF = "GDEF"; + + /// + /// Glyph positioning data. + /// + public const string GPOS = "GPOS"; + + /// + /// Glyph substitution data. + /// + public const string GSUB = "GSUB"; + + /// + /// Justification data. + /// + public const string JSTF = "JSTF"; + + // --- Other OpenType Tables --- + + /// + /// Digital signature. + /// + public const string DSIG = "DSIG"; + + /// + /// Grid-fitting/Scan-conversion. + /// + public const string Gasp = "gasp"; + + /// + /// Horizontal device Metrics. + /// + public const string Hdmx = "hdmx"; + + /// + /// Kerning. + /// + public const string Kern = "kern"; + + /// + /// Linear threshold data. + /// + public const string LTSH = "LTSH"; + + /// + /// PCL 5 data. + /// + public const string PCLT = "PCLT"; + + /// + /// Vertical device Metrics. + /// + public const string VDMX = "VDMX"; + + /// + /// Vertical Header. + /// + public const string VHea = "vhea"; + + /// + /// Vertical Metrics. + /// + public const string VMtx = "vmtx"; + } +} \ No newline at end of file diff --git a/PdfSharp/Fonts/AdobeGlyphList20.cs b/PdfSharp/Fonts/AdobeGlyphList20.cs new file mode 100644 index 0000000..63792d6 --- /dev/null +++ b/PdfSharp/Fonts/AdobeGlyphList20.cs @@ -0,0 +1,4325 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if DEBUG_ +namespace PdfSharp.Fonts +{ + /// + /// Pre-defined names for Unicode characters. + /// + /*public*/ class AdobeGlyphList20 + { + AdobeGlyphList20() { } + + public char A = '\u0041'; + public char AE = '\u00C6'; + public char AEacute = '\u01FC'; + public char AEmacron = '\u01E2'; + public char AEsmall = '\uF7E6'; + public char Aacute = '\u00C1'; + public char Aacutesmall = '\uF7E1'; + public char Abreve = '\u0102'; + public char Abreveacute = '\u1EAE'; + public char Abrevecyrillic = '\u04D0'; + public char Abrevedotbelow = '\u1EB6'; + public char Abrevegrave = '\u1EB0'; + public char Abrevehookabove = '\u1EB2'; + public char Abrevetilde = '\u1EB4'; + public char Acaron = '\u01CD'; + public char Acircle = '\u24B6'; + public char Acircumflex = '\u00C2'; + public char Acircumflexacute = '\u1EA4'; + public char Acircumflexdotbelow = '\u1EAC'; + public char Acircumflexgrave = '\u1EA6'; + public char Acircumflexhookabove = '\u1EA8'; + public char Acircumflexsmall = '\uF7E2'; + public char Acircumflextilde = '\u1EAA'; + public char Acute = '\uF6C9'; + public char Acutesmall = '\uF7B4'; + public char Acyrillic = '\u0410'; + public char Adblgrave = '\u0200'; + public char Adieresis = '\u00C4'; + public char Adieresiscyrillic = '\u04D2'; + public char Adieresismacron = '\u01DE'; + public char Adieresissmall = '\uF7E4'; + public char Adotbelow = '\u1EA0'; + public char Adotmacron = '\u01E0'; + public char Agrave = '\u00C0'; + public char Agravesmall = '\uF7E0'; + public char Ahookabove = '\u1EA2'; + public char Aiecyrillic = '\u04D4'; + public char Ainvertedbreve = '\u0202'; + public char Alpha = '\u0391'; + public char Alphatonos = '\u0386'; + public char Amacron = '\u0100'; + public char Amonospace = '\uFF21'; + public char Aogonek = '\u0104'; + public char Aring = '\u00C5'; + public char Aringacute = '\u01FA'; + public char Aringbelow = '\u1E00'; + public char Aringsmall = '\uF7E5'; + public char Asmall = '\uF761'; + public char Atilde = '\u00C3'; + public char Atildesmall = '\uF7E3'; + public char Aybarmenian = '\u0531'; + public char B = '\u0042'; + public char Bcircle = '\u24B7'; + public char Bdotaccent = '\u1E02'; + public char Bdotbelow = '\u1E04'; + public char Becyrillic = '\u0411'; + public char Benarmenian = '\u0532'; + public char Beta = '\u0392'; + public char Bhook = '\u0181'; + public char Blinebelow = '\u1E06'; + public char Bmonospace = '\uFF22'; + public char Brevesmall = '\uF6F4'; + public char Bsmall = '\uF762'; + public char Btopbar = '\u0182'; + public char C = '\u0043'; + public char Caarmenian = '\u053E'; + public char Cacute = '\u0106'; + public char Caron = '\uF6CA'; + public char Caronsmall = '\uF6F5'; + public char Ccaron = '\u010C'; + public char Ccedilla = '\u00C7'; + public char Ccedillaacute = '\u1E08'; + public char Ccedillasmall = '\uF7E7'; + public char Ccircle = '\u24B8'; + public char Ccircumflex = '\u0108'; + public char Cdot = '\u010A'; + public char Cdotaccent = '\u010A'; + public char Cedillasmall = '\uF7B8'; + public char Chaarmenian = '\u0549'; + public char Cheabkhasiancyrillic = '\u04BC'; + public char Checyrillic = '\u0427'; + public char Chedescenderabkhasiancyrillic = '\u04BE'; + public char Chedescendercyrillic = '\u04B6'; + public char Chedieresiscyrillic = '\u04F4'; + public char Cheharmenian = '\u0543'; + public char Chekhakassiancyrillic = '\u04CB'; + public char Cheverticalstrokecyrillic = '\u04B8'; + public char Chi = '\u03A7'; + public char Chook = '\u0187'; + public char Circumflexsmall = '\uF6F6'; + public char Cmonospace = '\uFF23'; + public char Coarmenian = '\u0551'; + public char Csmall = '\uF763'; + public char D = '\u0044'; + public char DZ = '\u01F1'; + public char DZcaron = '\u01C4'; + public char Daarmenian = '\u0534'; + public char Dafrican = '\u0189'; + public char Dcaron = '\u010E'; + public char Dcedilla = '\u1E10'; + public char Dcircle = '\u24B9'; + public char Dcircumflexbelow = '\u1E12'; + public char Dcroat = '\u0110'; + public char Ddotaccent = '\u1E0A'; + public char Ddotbelow = '\u1E0C'; + public char Decyrillic = '\u0414'; + public char Deicoptic = '\u03EE'; + public char Delta = '\u2206'; + public char Deltagreek = '\u0394'; + public char Dhook = '\u018A'; + public char Dieresis = '\uF6CB'; + public char DieresisAcute = '\uF6CC'; + public char DieresisGrave = '\uF6CD'; + public char Dieresissmall = '\uF7A8'; + public char Digammagreek = '\u03DC'; + public char Djecyrillic = '\u0402'; + public char Dlinebelow = '\u1E0E'; + public char Dmonospace = '\uFF24'; + public char Dotaccentsmall = '\uF6F7'; + public char Dslash = '\u0110'; + public char Dsmall = '\uF764'; + public char Dtopbar = '\u018B'; + public char Dz = '\u01F2'; + public char Dzcaron = '\u01C5'; + public char Dzeabkhasiancyrillic = '\u04E0'; + public char Dzecyrillic = '\u0405'; + public char Dzhecyrillic = '\u040F'; + public char E = '\u0045'; + public char Eacute = '\u00C9'; + public char Eacutesmall = '\uF7E9'; + public char Ebreve = '\u0114'; + public char Ecaron = '\u011A'; + public char Ecedillabreve = '\u1E1C'; + public char Echarmenian = '\u0535'; + public char Ecircle = '\u24BA'; + public char Ecircumflex = '\u00CA'; + public char Ecircumflexacute = '\u1EBE'; + public char Ecircumflexbelow = '\u1E18'; + public char Ecircumflexdotbelow = '\u1EC6'; + public char Ecircumflexgrave = '\u1EC0'; + public char Ecircumflexhookabove = '\u1EC2'; + public char Ecircumflexsmall = '\uF7EA'; + public char Ecircumflextilde = '\u1EC4'; + public char Ecyrillic = '\u0404'; + public char Edblgrave = '\u0204'; + public char Edieresis = '\u00CB'; + public char Edieresissmall = '\uF7EB'; + public char Edot = '\u0116'; + public char Edotaccent = '\u0116'; + public char Edotbelow = '\u1EB8'; + public char Efcyrillic = '\u0424'; + public char Egrave = '\u00C8'; + public char Egravesmall = '\uF7E8'; + public char Eharmenian = '\u0537'; + public char Ehookabove = '\u1EBA'; + public char Eightroman = '\u2167'; + public char Einvertedbreve = '\u0206'; + public char Eiotifiedcyrillic = '\u0464'; + public char Elcyrillic = '\u041B'; + public char Elevenroman = '\u216A'; + public char Emacron = '\u0112'; + public char Emacronacute = '\u1E16'; + public char Emacrongrave = '\u1E14'; + public char Emcyrillic = '\u041C'; + public char Emonospace = '\uFF25'; + public char Encyrillic = '\u041D'; + public char Endescendercyrillic = '\u04A2'; + public char Eng = '\u014A'; + public char Enghecyrillic = '\u04A4'; + public char Enhookcyrillic = '\u04C7'; + public char Eogonek = '\u0118'; + public char Eopen = '\u0190'; + public char Epsilon = '\u0395'; + public char Epsilontonos = '\u0388'; + public char Ercyrillic = '\u0420'; + public char Ereversed = '\u018E'; + public char Ereversedcyrillic = '\u042D'; + public char Escyrillic = '\u0421'; + public char Esdescendercyrillic = '\u04AA'; + public char Esh = '\u01A9'; + public char Esmall = '\uF765'; + public char Eta = '\u0397'; + public char Etarmenian = '\u0538'; + public char Etatonos = '\u0389'; + public char Eth = '\u00D0'; + public char Ethsmall = '\uF7F0'; + public char Etilde = '\u1EBC'; + public char Etildebelow = '\u1E1A'; + public char Euro = '\u20AC'; + public char Ezh = '\u01B7'; + public char Ezhcaron = '\u01EE'; + public char Ezhreversed = '\u01B8'; + public char F = '\u0046'; + public char Fcircle = '\u24BB'; + public char Fdotaccent = '\u1E1E'; + public char Feharmenian = '\u0556'; + public char Feicoptic = '\u03E4'; + public char Fhook = '\u0191'; + public char Fitacyrillic = '\u0472'; + public char Fiveroman = '\u2164'; + public char Fmonospace = '\uFF26'; + public char Fourroman = '\u2163'; + public char Fsmall = '\uF766'; + public char G = '\u0047'; + public char GBsquare = '\u3387'; + public char Gacute = '\u01F4'; + public char Gamma = '\u0393'; + public char Gammaafrican = '\u0194'; + public char Gangiacoptic = '\u03EA'; + public char Gbreve = '\u011E'; + public char Gcaron = '\u01E6'; + public char Gcedilla = '\u0122'; + public char Gcircle = '\u24BC'; + public char Gcircumflex = '\u011C'; + public char Gcommaaccent = '\u0122'; + public char Gdot = '\u0120'; + public char Gdotaccent = '\u0120'; + public char Gecyrillic = '\u0413'; + public char Ghadarmenian = '\u0542'; + public char Ghemiddlehookcyrillic = '\u0494'; + public char Ghestrokecyrillic = '\u0492'; + public char Gheupturncyrillic = '\u0490'; + public char Ghook = '\u0193'; + public char Gimarmenian = '\u0533'; + public char Gjecyrillic = '\u0403'; + public char Gmacron = '\u1E20'; + public char Gmonospace = '\uFF27'; + public char Grave = '\uF6CE'; + public char Gravesmall = '\uF760'; + public char Gsmall = '\uF767'; + public char Gsmallhook = '\u029B'; + public char Gstroke = '\u01E4'; + public char H = '\u0048'; + public char H18533 = '\u25CF'; + public char H18543 = '\u25AA'; + public char H18551 = '\u25AB'; + public char H22073 = '\u25A1'; + public char HPsquare = '\u33CB'; + public char Haabkhasiancyrillic = '\u04A8'; + public char Hadescendercyrillic = '\u04B2'; + public char Hardsigncyrillic = '\u042A'; + public char Hbar = '\u0126'; + public char Hbrevebelow = '\u1E2A'; + public char Hcedilla = '\u1E28'; + public char Hcircle = '\u24BD'; + public char Hcircumflex = '\u0124'; + public char Hdieresis = '\u1E26'; + public char Hdotaccent = '\u1E22'; + public char Hdotbelow = '\u1E24'; + public char Hmonospace = '\uFF28'; + public char Hoarmenian = '\u0540'; + public char Horicoptic = '\u03E8'; + public char Hsmall = '\uF768'; + public char Hungarumlaut = '\uF6CF'; + public char Hungarumlautsmall = '\uF6F8'; + public char Hzsquare = '\u3390'; + public char I = '\u0049'; + public char IAcyrillic = '\u042F'; + public char IJ = '\u0132'; + public char IUcyrillic = '\u042E'; + public char Iacute = '\u00CD'; + public char Iacutesmall = '\uF7ED'; + public char Ibreve = '\u012C'; + public char Icaron = '\u01CF'; + public char Icircle = '\u24BE'; + public char Icircumflex = '\u00CE'; + public char Icircumflexsmall = '\uF7EE'; + public char Icyrillic = '\u0406'; + public char Idblgrave = '\u0208'; + public char Idieresis = '\u00CF'; + public char Idieresisacute = '\u1E2E'; + public char Idieresiscyrillic = '\u04E4'; + public char Idieresissmall = '\uF7EF'; + public char Idot = '\u0130'; + public char Idotaccent = '\u0130'; + public char Idotbelow = '\u1ECA'; + public char Iebrevecyrillic = '\u04D6'; + public char Iecyrillic = '\u0415'; + public char Ifraktur = '\u2111'; + public char Igrave = '\u00CC'; + public char Igravesmall = '\uF7EC'; + public char Ihookabove = '\u1EC8'; + public char Iicyrillic = '\u0418'; + public char Iinvertedbreve = '\u020A'; + public char Iishortcyrillic = '\u0419'; + public char Imacron = '\u012A'; + public char Imacroncyrillic = '\u04E2'; + public char Imonospace = '\uFF29'; + public char Iniarmenian = '\u053B'; + public char Iocyrillic = '\u0401'; + public char Iogonek = '\u012E'; + public char Iota = '\u0399'; + public char Iotaafrican = '\u0196'; + public char Iotadieresis = '\u03AA'; + public char Iotatonos = '\u038A'; + public char Ismall = '\uF769'; + public char Istroke = '\u0197'; + public char Itilde = '\u0128'; + public char Itildebelow = '\u1E2C'; + public char Izhitsacyrillic = '\u0474'; + public char Izhitsadblgravecyrillic = '\u0476'; + public char J = '\u004A'; + public char Jaarmenian = '\u0541'; + public char Jcircle = '\u24BF'; + public char Jcircumflex = '\u0134'; + public char Jecyrillic = '\u0408'; + public char Jheharmenian = '\u054B'; + public char Jmonospace = '\uFF2A'; + public char Jsmall = '\uF76A'; + public char K = '\u004B'; + public char KBsquare = '\u3385'; + public char KKsquare = '\u33CD'; + public char Kabashkircyrillic = '\u04A0'; + public char Kacute = '\u1E30'; + public char Kacyrillic = '\u041A'; + public char Kadescendercyrillic = '\u049A'; + public char Kahookcyrillic = '\u04C3'; + public char Kappa = '\u039A'; + public char Kastrokecyrillic = '\u049E'; + public char Kaverticalstrokecyrillic = '\u049C'; + public char Kcaron = '\u01E8'; + public char Kcedilla = '\u0136'; + public char Kcircle = '\u24C0'; + public char Kcommaaccent = '\u0136'; + public char Kdotbelow = '\u1E32'; + public char Keharmenian = '\u0554'; + public char Kenarmenian = '\u053F'; + public char Khacyrillic = '\u0425'; + public char Kheicoptic = '\u03E6'; + public char Khook = '\u0198'; + public char Kjecyrillic = '\u040C'; + public char Klinebelow = '\u1E34'; + public char Kmonospace = '\uFF2B'; + public char Koppacyrillic = '\u0480'; + public char Koppagreek = '\u03DE'; + public char Ksicyrillic = '\u046E'; + public char Ksmall = '\uF76B'; + public char L = '\u004C'; + public char LJ = '\u01C7'; + public char LL = '\uF6BF'; + public char Lacute = '\u0139'; + public char Lambda = '\u039B'; + public char Lcaron = '\u013D'; + public char Lcedilla = '\u013B'; + public char Lcircle = '\u24C1'; + public char Lcircumflexbelow = '\u1E3C'; + public char Lcommaaccent = '\u013B'; + public char Ldot = '\u013F'; + public char Ldotaccent = '\u013F'; + public char Ldotbelow = '\u1E36'; + public char Ldotbelowmacron = '\u1E38'; + public char Liwnarmenian = '\u053C'; + public char Lj = '\u01C8'; + public char Ljecyrillic = '\u0409'; + public char Llinebelow = '\u1E3A'; + public char Lmonospace = '\uFF2C'; + public char Lslash = '\u0141'; + public char Lslashsmall = '\uF6F9'; + public char Lsmall = '\uF76C'; + public char M = '\u004D'; + public char MBsquare = '\u3386'; + public char Macron = '\uF6D0'; + public char Macronsmall = '\uF7AF'; + public char Macute = '\u1E3E'; + public char Mcircle = '\u24C2'; + public char Mdotaccent = '\u1E40'; + public char Mdotbelow = '\u1E42'; + public char Menarmenian = '\u0544'; + public char Mmonospace = '\uFF2D'; + public char Msmall = '\uF76D'; + public char Mturned = '\u019C'; + public char Mu = '\u039C'; + public char N = '\u004E'; + public char NJ = '\u01CA'; + public char Nacute = '\u0143'; + public char Ncaron = '\u0147'; + public char Ncedilla = '\u0145'; + public char Ncircle = '\u24C3'; + public char Ncircumflexbelow = '\u1E4A'; + public char Ncommaaccent = '\u0145'; + public char Ndotaccent = '\u1E44'; + public char Ndotbelow = '\u1E46'; + public char Nhookleft = '\u019D'; + public char Nineroman = '\u2168'; + public char Nj = '\u01CB'; + public char Njecyrillic = '\u040A'; + public char Nlinebelow = '\u1E48'; + public char Nmonospace = '\uFF2E'; + public char Nowarmenian = '\u0546'; + public char Nsmall = '\uF76E'; + public char Ntilde = '\u00D1'; + public char Ntildesmall = '\uF7F1'; + public char Nu = '\u039D'; + public char O = '\u004F'; + public char OE = '\u0152'; + public char OEsmall = '\uF6FA'; + public char Oacute = '\u00D3'; + public char Oacutesmall = '\uF7F3'; +//Obarredcyrillic;04E8 +//Obarreddieresiscyrillic;04EA +//Obreve;014E +//Ocaron;01D1 +//Ocenteredtilde;019F +//Ocircle;24C4 +//Ocircumflex;00D4 +//Ocircumflexacute;1ED0 +//Ocircumflexdotbelow;1ED8 +//Ocircumflexgrave;1ED2 +//Ocircumflexhookabove;1ED4 +//Ocircumflexsmall;F7F4 +//Ocircumflextilde;1ED6 +//Ocyrillic;041E +//Odblacute;0150 +//Odblgrave;020C +//Odieresis;00D6 +//Odieresiscyrillic;04E6 +//Odieresissmall;F7F6 +//Odotbelow;1ECC +//Ogoneksmall;F6FB +//Ograve;00D2 +//Ogravesmall;F7F2 +//Oharmenian;0555 +//Ohm;2126 +//Ohookabove;1ECE +//Ohorn;01A0 +//Ohornacute;1EDA +//Ohorndotbelow;1EE2 +//Ohorngrave;1EDC +//Ohornhookabove;1EDE +//Ohorntilde;1EE0 +//Ohungarumlaut;0150 +//Oi;01A2 +//Oinvertedbreve;020E +//Omacron;014C +//Omacronacute;1E52 +//Omacrongrave;1E50 +//Omega;2126 +//Omegacyrillic;0460 +//Omegagreek;03A9 +//Omegaroundcyrillic;047A +//Omegatitlocyrillic;047C +//Omegatonos;038F +//Omicron;039F +//Omicrontonos;038C +//Omonospace;FF2F +//Oneroman;2160 +//Oogonek;01EA +//Oogonekmacron;01EC +//Oopen;0186 +//Oslash;00D8 +//Oslashacute;01FE +//Oslashsmall;F7F8 +//Osmall;F76F +//Ostrokeacute;01FE +//Otcyrillic;047E +//Otilde;00D5 +//Otildeacute;1E4C +//Otildedieresis;1E4E +//Otildesmall;F7F5 +//P;0050 +//Pacute;1E54 +//Pcircle;24C5 +//Pdotaccent;1E56 +//Pecyrillic;041F +//Peharmenian;054A +//Pemiddlehookcyrillic;04A6 +//Phi;03A6 +//Phook;01A4 +//Pi;03A0 +//Piwrarmenian;0553 +//Pmonospace;FF30 +//Psi;03A8 +//Psicyrillic;0470 +//Psmall;F770 +//Q;0051 +//Qcircle;24C6 +//Qmonospace;FF31 +//Qsmall;F771 +//R;0052 +//Raarmenian;054C +//Racute;0154 +//Rcaron;0158 +//Rcedilla;0156 +//Rcircle;24C7 +//Rcommaaccent;0156 +//Rdblgrave;0210 +//Rdotaccent;1E58 +//Rdotbelow;1E5A +//Rdotbelowmacron;1E5C +//Reharmenian;0550 +//Rfraktur;211C +//Rho;03A1 +//Ringsmall;F6FC +//Rinvertedbreve;0212 +//Rlinebelow;1E5E +//Rmonospace;FF32 +//Rsmall;F772 +//Rsmallinverted;0281 +//Rsmallinvertedsuperior;02B6 +//S;0053 +//SF010000;250C +//SF020000;2514 +//SF030000;2510 +//SF040000;2518 +//SF050000;253C +//SF060000;252C +//SF070000;2534 +//SF080000;251C +//SF090000;2524 +//SF100000;2500 +//SF110000;2502 +//SF190000;2561 +//SF200000;2562 +//SF210000;2556 +//SF220000;2555 +//SF230000;2563 +//SF240000;2551 +//SF250000;2557 +//SF260000;255D +//SF270000;255C +//SF280000;255B +//SF360000;255E +//SF370000;255F +//SF380000;255A +//SF390000;2554 +//SF400000;2569 +//SF410000;2566 +//SF420000;2560 +//SF430000;2550 +//SF440000;256C +//SF450000;2567 +//SF460000;2568 +//SF470000;2564 +//SF480000;2565 +//SF490000;2559 +//SF500000;2558 +//SF510000;2552 +//SF520000;2553 +//SF530000;256B +//SF540000;256A +//Sacute;015A +//Sacutedotaccent;1E64 +//Sampigreek;03E0 +//Scaron;0160 +//Scarondotaccent;1E66 +//Scaronsmall;F6FD +//Scedilla;015E +//Schwa;018F +//Schwacyrillic;04D8 +//Schwadieresiscyrillic;04DA +//Scircle;24C8 +//Scircumflex;015C +//Scommaaccent;0218 +//Sdotaccent;1E60 +//Sdotbelow;1E62 +//Sdotbelowdotaccent;1E68 +//Seharmenian;054D +//Sevenroman;2166 +//Shaarmenian;0547 +//Shacyrillic;0428 +//Shchacyrillic;0429 +//Sheicoptic;03E2 +//Shhacyrillic;04BA +//Shimacoptic;03EC +//Sigma;03A3 +//Sixroman;2165 +//Smonospace;FF33 +//Softsigncyrillic;042C +//Ssmall;F773 +//Stigmagreek;03DA +//T;0054 +//Tau;03A4 +//Tbar;0166 +//Tcaron;0164 +//Tcedilla;0162 +//Tcircle;24C9 +//Tcircumflexbelow;1E70 +//Tcommaaccent;0162 +//Tdotaccent;1E6A +//Tdotbelow;1E6C +//Tecyrillic;0422 +//Tedescendercyrillic;04AC +//Tenroman;2169 +//Tetsecyrillic;04B4 +//Theta;0398 +//Thook;01AC +//Thorn;00DE +//Thornsmall;F7FE +//Threeroman;2162 +//Tildesmall;F6FE +//Tiwnarmenian;054F +//Tlinebelow;1E6E +//Tmonospace;FF34 +//Toarmenian;0539 +//Tonefive;01BC +//Tonesix;0184 +//Tonetwo;01A7 +//Tretroflexhook;01AE +//Tsecyrillic;0426 +//Tshecyrillic;040B +//Tsmall;F774 +//Twelveroman;216B +//Tworoman;2161 +//U;0055 +//Uacute;00DA +//Uacutesmall;F7FA +//Ubreve;016C +//Ucaron;01D3 +//Ucircle;24CA +//Ucircumflex;00DB +//Ucircumflexbelow;1E76 +//Ucircumflexsmall;F7FB +//Ucyrillic;0423 +//Udblacute;0170 +//Udblgrave;0214 +//Udieresis;00DC +//Udieresisacute;01D7 +//Udieresisbelow;1E72 +//Udieresiscaron;01D9 +//Udieresiscyrillic;04F0 +//Udieresisgrave;01DB +//Udieresismacron;01D5 +//Udieresissmall;F7FC +//Udotbelow;1EE4 +//Ugrave;00D9 +//Ugravesmall;F7F9 +//Uhookabove;1EE6 +//Uhorn;01AF +//Uhornacute;1EE8 +//Uhorndotbelow;1EF0 +//Uhorngrave;1EEA +//Uhornhookabove;1EEC +//Uhorntilde;1EEE +//Uhungarumlaut;0170 +//Uhungarumlautcyrillic;04F2 +//Uinvertedbreve;0216 +//Ukcyrillic;0478 +//Umacron;016A +//Umacroncyrillic;04EE +//Umacrondieresis;1E7A +//Umonospace;FF35 +//Uogonek;0172 +//Upsilon;03A5 +//Upsilon1;03D2 +//Upsilonacutehooksymbolgreek;03D3 +//Upsilonafrican;01B1 +//Upsilondieresis;03AB +//Upsilondieresishooksymbolgreek;03D4 +//Upsilonhooksymbol;03D2 +//Upsilontonos;038E +//Uring;016E +//Ushortcyrillic;040E +//Usmall;F775 +//Ustraightcyrillic;04AE +//Ustraightstrokecyrillic;04B0 +//Utilde;0168 +//Utildeacute;1E78 +//Utildebelow;1E74 +//V;0056 +//Vcircle;24CB +//Vdotbelow;1E7E +//Vecyrillic;0412 +//Vewarmenian;054E +//Vhook;01B2 +//Vmonospace;FF36 +//Voarmenian;0548 +//Vsmall;F776 +//Vtilde;1E7C +//W;0057 +//Wacute;1E82 +//Wcircle;24CC +//Wcircumflex;0174 +//Wdieresis;1E84 +//Wdotaccent;1E86 +//Wdotbelow;1E88 +//Wgrave;1E80 +//Wmonospace;FF37 +//Wsmall;F777 +//X;0058 +//Xcircle;24CD +//Xdieresis;1E8C +//Xdotaccent;1E8A +//Xeharmenian;053D +//Xi;039E +//Xmonospace;FF38 +//Xsmall;F778 +//Y;0059 +//Yacute;00DD +//Yacutesmall;F7FD +//Yatcyrillic;0462 +//Ycircle;24CE +//Ycircumflex;0176 +//Ydieresis;0178 +//Ydieresissmall;F7FF +//Ydotaccent;1E8E +//Ydotbelow;1EF4 +//Yericyrillic;042B +//Yerudieresiscyrillic;04F8 +//Ygrave;1EF2 +//Yhook;01B3 +//Yhookabove;1EF6 +//Yiarmenian;0545 +//Yicyrillic;0407 +//Yiwnarmenian;0552 +//Ymonospace;FF39 +//Ysmall;F779 +//Ytilde;1EF8 +//Yusbigcyrillic;046A +//Yusbigiotifiedcyrillic;046C +//Yuslittlecyrillic;0466 +//Yuslittleiotifiedcyrillic;0468 +//Z;005A +//Zaarmenian;0536 +//Zacute;0179 +//Zcaron;017D +//Zcaronsmall;F6FF +//Zcircle;24CF +//Zcircumflex;1E90 +//Zdot;017B +//Zdotaccent;017B +//Zdotbelow;1E92 +//Zecyrillic;0417 +//Zedescendercyrillic;0498 +//Zedieresiscyrillic;04DE +//Zeta;0396 +//Zhearmenian;053A +//Zhebrevecyrillic;04C1 +//Zhecyrillic;0416 +//Zhedescendercyrillic;0496 +//Zhedieresiscyrillic;04DC +//Zlinebelow;1E94 +//Zmonospace;FF3A +//Zsmall;F77A +//Zstroke;01B5 +//a;0061 +//aabengali;0986 +//aacute;00E1 +//aadeva;0906 +//aagujarati;0A86 +//aagurmukhi;0A06 +//aamatragurmukhi;0A3E +//aarusquare;3303 +//aavowelsignbengali;09BE +//aavowelsigndeva;093E +//aavowelsigngujarati;0ABE +//abbreviationmarkarmenian;055F +//abbreviationsigndeva;0970 +//abengali;0985 +//abopomofo;311A +//abreve;0103 +//abreveacute;1EAF +//abrevecyrillic;04D1 +//abrevedotbelow;1EB7 +//abrevegrave;1EB1 +//abrevehookabove;1EB3 +//abrevetilde;1EB5 +//acaron;01CE +//acircle;24D0 +//acircumflex;00E2 +//acircumflexacute;1EA5 +//acircumflexdotbelow;1EAD +//acircumflexgrave;1EA7 +//acircumflexhookabove;1EA9 +//acircumflextilde;1EAB +//acute;00B4 +//acutebelowcmb;0317 +//acutecmb;0301 +//acutecomb;0301 +//acutedeva;0954 +//acutelowmod;02CF +//acutetonecmb;0341 +//acyrillic;0430 +//adblgrave;0201 +//addakgurmukhi;0A71 +//adeva;0905 +//adieresis;00E4 +//adieresiscyrillic;04D3 +//adieresismacron;01DF +//adotbelow;1EA1 +//adotmacron;01E1 +//ae;00E6 +//aeacute;01FD +//aekorean;3150 +//aemacron;01E3 +//afii00208;2015 +//afii08941;20A4 +//afii10017;0410 +//afii10018;0411 +//afii10019;0412 +//afii10020;0413 +//afii10021;0414 +//afii10022;0415 +//afii10023;0401 +//afii10024;0416 +//afii10025;0417 +//afii10026;0418 +//afii10027;0419 +//afii10028;041A +//afii10029;041B +//afii10030;041C +//afii10031;041D +//afii10032;041E +//afii10033;041F +//afii10034;0420 +//afii10035;0421 +//afii10036;0422 +//afii10037;0423 +//afii10038;0424 +//afii10039;0425 +//afii10040;0426 +//afii10041;0427 +//afii10042;0428 +//afii10043;0429 +//afii10044;042A +//afii10045;042B +//afii10046;042C +//afii10047;042D +//afii10048;042E +//afii10049;042F +//afii10050;0490 +//afii10051;0402 +//afii10052;0403 +//afii10053;0404 +//afii10054;0405 +//afii10055;0406 +//afii10056;0407 +//afii10057;0408 +//afii10058;0409 +//afii10059;040A +//afii10060;040B +//afii10061;040C +//afii10062;040E +//afii10063;F6C4 +//afii10064;F6C5 +//afii10065;0430 +//afii10066;0431 +//afii10067;0432 +//afii10068;0433 +//afii10069;0434 +//afii10070;0435 +//afii10071;0451 +//afii10072;0436 +//afii10073;0437 +//afii10074;0438 +//afii10075;0439 +//afii10076;043A +//afii10077;043B +//afii10078;043C +//afii10079;043D +//afii10080;043E +//afii10081;043F +//afii10082;0440 +//afii10083;0441 +//afii10084;0442 +//afii10085;0443 +//afii10086;0444 +//afii10087;0445 +//afii10088;0446 +//afii10089;0447 +//afii10090;0448 +//afii10091;0449 +//afii10092;044A +//afii10093;044B +//afii10094;044C +//afii10095;044D +//afii10096;044E +//afii10097;044F +//afii10098;0491 +//afii10099;0452 +//afii10100;0453 +//afii10101;0454 +//afii10102;0455 +//afii10103;0456 +//afii10104;0457 +//afii10105;0458 +//afii10106;0459 +//afii10107;045A +//afii10108;045B +//afii10109;045C +//afii10110;045E +//afii10145;040F +//afii10146;0462 +//afii10147;0472 +//afii10148;0474 +//afii10192;F6C6 +//afii10193;045F +//afii10194;0463 +//afii10195;0473 +//afii10196;0475 +//afii10831;F6C7 +//afii10832;F6C8 +//afii10846;04D9 +//afii299;200E +//afii300;200F +//afii301;200D +//afii57381;066A +//afii57388;060C +//afii57392;0660 +//afii57393;0661 +//afii57394;0662 +//afii57395;0663 +//afii57396;0664 +//afii57397;0665 +//afii57398;0666 +//afii57399;0667 +//afii57400;0668 +//afii57401;0669 +//afii57403;061B +//afii57407;061F +//afii57409;0621 +//afii57410;0622 +//afii57411;0623 +//afii57412;0624 +//afii57413;0625 +//afii57414;0626 +//afii57415;0627 +//afii57416;0628 +//afii57417;0629 +//afii57418;062A +//afii57419;062B +//afii57420;062C +//afii57421;062D +//afii57422;062E +//afii57423;062F +//afii57424;0630 +//afii57425;0631 +//afii57426;0632 +//afii57427;0633 +//afii57428;0634 +//afii57429;0635 +//afii57430;0636 +//afii57431;0637 +//afii57432;0638 +//afii57433;0639 +//afii57434;063A +//afii57440;0640 +//afii57441;0641 +//afii57442;0642 +//afii57443;0643 +//afii57444;0644 +//afii57445;0645 +//afii57446;0646 +//afii57448;0648 +//afii57449;0649 +//afii57450;064A +//afii57451;064B +//afii57452;064C +//afii57453;064D +//afii57454;064E +//afii57455;064F +//afii57456;0650 +//afii57457;0651 +//afii57458;0652 +//afii57470;0647 +//afii57505;06A4 +//afii57506;067E +//afii57507;0686 +//afii57508;0698 +//afii57509;06AF +//afii57511;0679 +//afii57512;0688 +//afii57513;0691 +//afii57514;06BA +//afii57519;06D2 +//afii57534;06D5 +//afii57636;20AA +//afii57645;05BE +//afii57658;05C3 +//afii57664;05D0 +//afii57665;05D1 +//afii57666;05D2 +//afii57667;05D3 +//afii57668;05D4 +//afii57669;05D5 +//afii57670;05D6 +//afii57671;05D7 +//afii57672;05D8 +//afii57673;05D9 +//afii57674;05DA +//afii57675;05DB +//afii57676;05DC +//afii57677;05DD +//afii57678;05DE +//afii57679;05DF +//afii57680;05E0 +//afii57681;05E1 +//afii57682;05E2 +//afii57683;05E3 +//afii57684;05E4 +//afii57685;05E5 +//afii57686;05E6 +//afii57687;05E7 +//afii57688;05E8 +//afii57689;05E9 +//afii57690;05EA +//afii57694;FB2A +//afii57695;FB2B +//afii57700;FB4B +//afii57705;FB1F +//afii57716;05F0 +//afii57717;05F1 +//afii57718;05F2 +//afii57723;FB35 +//afii57793;05B4 +//afii57794;05B5 +//afii57795;05B6 +//afii57796;05BB +//afii57797;05B8 +//afii57798;05B7 +//afii57799;05B0 +//afii57800;05B2 +//afii57801;05B1 +//afii57802;05B3 +//afii57803;05C2 +//afii57804;05C1 +//afii57806;05B9 +//afii57807;05BC +//afii57839;05BD +//afii57841;05BF +//afii57842;05C0 +//afii57929;02BC +//afii61248;2105 +//afii61289;2113 +//afii61352;2116 +//afii61573;202C +//afii61574;202D +//afii61575;202E +//afii61664;200C +//afii63167;066D +//afii64937;02BD +//agrave;00E0 +//agujarati;0A85 +//agurmukhi;0A05 +//ahiragana;3042 +//ahookabove;1EA3 +//aibengali;0990 +//aibopomofo;311E +//aideva;0910 +//aiecyrillic;04D5 +//aigujarati;0A90 +//aigurmukhi;0A10 +//aimatragurmukhi;0A48 +//ainarabic;0639 +//ainfinalarabic;FECA +//aininitialarabic;FECB +//ainmedialarabic;FECC +//ainvertedbreve;0203 +//aivowelsignbengali;09C8 +//aivowelsigndeva;0948 +//aivowelsigngujarati;0AC8 +//akatakana;30A2 +//akatakanahalfwidth;FF71 +//akorean;314F +//alef;05D0 +//alefarabic;0627 +//alefdageshhebrew;FB30 +//aleffinalarabic;FE8E +//alefhamzaabovearabic;0623 +//alefhamzaabovefinalarabic;FE84 +//alefhamzabelowarabic;0625 +//alefhamzabelowfinalarabic;FE88 +//alefhebrew;05D0 +//aleflamedhebrew;FB4F +//alefmaddaabovearabic;0622 +//alefmaddaabovefinalarabic;FE82 +//alefmaksuraarabic;0649 +//alefmaksurafinalarabic;FEF0 +//alefmaksurainitialarabic;FEF3 +//alefmaksuramedialarabic;FEF4 +//alefpatahhebrew;FB2E +//alefqamatshebrew;FB2F +//aleph;2135 +//allequal;224C +//alpha;03B1 +//alphatonos;03AC +//amacron;0101 +//amonospace;FF41 +//ampersand;0026 +//ampersandmonospace;FF06 +//ampersandsmall;F726 +//amsquare;33C2 +//anbopomofo;3122 +//angbopomofo;3124 +//angkhankhuthai;0E5A +//angle;2220 +//anglebracketleft;3008 +//anglebracketleftvertical;FE3F +//anglebracketright;3009 +//anglebracketrightvertical;FE40 +//angleleft;2329 +//angleright;232A +//angstrom;212B +//anoteleia;0387 +//anudattadeva;0952 +//anusvarabengali;0982 +//anusvaradeva;0902 +//anusvaragujarati;0A82 +//aogonek;0105 +//apaatosquare;3300 +//aparen;249C +//apostrophearmenian;055A +//apostrophemod;02BC +//apple;F8FF +//approaches;2250 +//approxequal;2248 +//approxequalorimage;2252 +//approximatelyequal;2245 +//araeaekorean;318E +//araeakorean;318D +//arc;2312 +//arighthalfring;1E9A +//aring;00E5 +//aringacute;01FB +//aringbelow;1E01 +//arrowboth;2194 +//arrowdashdown;21E3 +//arrowdashleft;21E0 +//arrowdashright;21E2 +//arrowdashup;21E1 +//arrowdblboth;21D4 +//arrowdbldown;21D3 +//arrowdblleft;21D0 +//arrowdblright;21D2 +//arrowdblup;21D1 +//arrowdown;2193 +//arrowdownleft;2199 +//arrowdownright;2198 +//arrowdownwhite;21E9 +//arrowheaddownmod;02C5 +//arrowheadleftmod;02C2 +//arrowheadrightmod;02C3 +//arrowheadupmod;02C4 +//arrowhorizex;F8E7 +//arrowleft;2190 +//arrowleftdbl;21D0 +//arrowleftdblstroke;21CD +//arrowleftoverright;21C6 +//arrowleftwhite;21E6 +//arrowright;2192 +//arrowrightdblstroke;21CF +//arrowrightheavy;279E +//arrowrightoverleft;21C4 +//arrowrightwhite;21E8 +//arrowtableft;21E4 +//arrowtabright;21E5 +//arrowup;2191 +//arrowupdn;2195 +//arrowupdnbse;21A8 +//arrowupdownbase;21A8 +//arrowupleft;2196 +//arrowupleftofdown;21C5 +//arrowupright;2197 +//arrowupwhite;21E7 +//arrowvertex;F8E6 +//asciicircum;005E +//asciicircummonospace;FF3E +//asciitilde;007E +//asciitildemonospace;FF5E +//ascript;0251 +//ascriptturned;0252 +//asmallhiragana;3041 +//asmallkatakana;30A1 +//asmallkatakanahalfwidth;FF67 +//asterisk;002A +//asteriskaltonearabic;066D +//asteriskarabic;066D +//asteriskmath;2217 +//asteriskmonospace;FF0A +//asterisksmall;FE61 +//asterism;2042 +//asuperior;F6E9 +//asymptoticallyequal;2243 +//at;0040 +//atilde;00E3 +//atmonospace;FF20 +//atsmall;FE6B +//aturned;0250 +//aubengali;0994 +//aubopomofo;3120 +//audeva;0914 +//augujarati;0A94 +//augurmukhi;0A14 +//aulengthmarkbengali;09D7 +//aumatragurmukhi;0A4C +//auvowelsignbengali;09CC +//auvowelsigndeva;094C +//auvowelsigngujarati;0ACC +//avagrahadeva;093D +//aybarmenian;0561 +//ayin;05E2 +//ayinaltonehebrew;FB20 +//ayinhebrew;05E2 +//b;0062 +//babengali;09AC +//backslash;005C +//backslashmonospace;FF3C +//badeva;092C +//bagujarati;0AAC +//bagurmukhi;0A2C +//bahiragana;3070 +//bahtthai;0E3F +//bakatakana;30D0 +//bar;007C +//barmonospace;FF5C +//bbopomofo;3105 +//bcircle;24D1 +//bdotaccent;1E03 +//bdotbelow;1E05 +//beamedsixteenthnotes;266C +//because;2235 +//becyrillic;0431 +//beharabic;0628 +//behfinalarabic;FE90 +//behinitialarabic;FE91 +//behiragana;3079 +//behmedialarabic;FE92 +//behmeeminitialarabic;FC9F +//behmeemisolatedarabic;FC08 +//behnoonfinalarabic;FC6D +//bekatakana;30D9 +//benarmenian;0562 +//bet;05D1 +//beta;03B2 +//betasymbolgreek;03D0 +//betdagesh;FB31 +//betdageshhebrew;FB31 +//bethebrew;05D1 +//betrafehebrew;FB4C +//bhabengali;09AD +//bhadeva;092D +//bhagujarati;0AAD +//bhagurmukhi;0A2D +//bhook;0253 +//bihiragana;3073 +//bikatakana;30D3 +//bilabialclick;0298 +//bindigurmukhi;0A02 +//birusquare;3331 +//blackcircle;25CF +//blackdiamond;25C6 +//blackdownpointingtriangle;25BC +//blackleftpointingpointer;25C4 +//blackleftpointingtriangle;25C0 +//blacklenticularbracketleft;3010 +//blacklenticularbracketleftvertical;FE3B +//blacklenticularbracketright;3011 +//blacklenticularbracketrightvertical;FE3C +//blacklowerlefttriangle;25E3 +//blacklowerrighttriangle;25E2 +//blackrectangle;25AC +//blackrightpointingpointer;25BA +//blackrightpointingtriangle;25B6 +//blacksmallsquare;25AA +//blacksmilingface;263B +//blacksquare;25A0 +//blackstar;2605 +//blackupperlefttriangle;25E4 +//blackupperrighttriangle;25E5 +//blackuppointingsmalltriangle;25B4 +//blackuppointingtriangle;25B2 +//blank;2423 +//blinebelow;1E07 +//block;2588 +//bmonospace;FF42 +//bobaimaithai;0E1A +//bohiragana;307C +//bokatakana;30DC +//bparen;249D +//bqsquare;33C3 +//braceex;F8F4 +//braceleft;007B +//braceleftbt;F8F3 +//braceleftmid;F8F2 +//braceleftmonospace;FF5B +//braceleftsmall;FE5B +//bracelefttp;F8F1 +//braceleftvertical;FE37 +//braceright;007D +//bracerightbt;F8FE +//bracerightmid;F8FD +//bracerightmonospace;FF5D +//bracerightsmall;FE5C +//bracerighttp;F8FC +//bracerightvertical;FE38 +//bracketleft;005B +//bracketleftbt;F8F0 +//bracketleftex;F8EF +//bracketleftmonospace;FF3B +//bracketlefttp;F8EE +//bracketright;005D +//bracketrightbt;F8FB +//bracketrightex;F8FA +//bracketrightmonospace;FF3D +//bracketrighttp;F8F9 +//breve;02D8 +//brevebelowcmb;032E +//brevecmb;0306 +//breveinvertedbelowcmb;032F +//breveinvertedcmb;0311 +//breveinverteddoublecmb;0361 +//bridgebelowcmb;032A +//bridgeinvertedbelowcmb;033A +//brokenbar;00A6 +//bstroke;0180 +//bsuperior;F6EA +//btopbar;0183 +//buhiragana;3076 +//bukatakana;30D6 +//bullet;2022 +//bulletinverse;25D8 +//bulletoperator;2219 +//bullseye;25CE +//c;0063 +//caarmenian;056E +//cabengali;099A +//cacute;0107 +//cadeva;091A +//cagujarati;0A9A +//cagurmukhi;0A1A +//calsquare;3388 +//candrabindubengali;0981 +//candrabinducmb;0310 +//candrabindudeva;0901 +//candrabindugujarati;0A81 +//capslock;21EA +//careof;2105 +//caron;02C7 +//caronbelowcmb;032C +//caroncmb;030C +//carriagereturn;21B5 +//cbopomofo;3118 +//ccaron;010D +//ccedilla;00E7 +//ccedillaacute;1E09 +//ccircle;24D2 +//ccircumflex;0109 +//ccurl;0255 +//cdot;010B +//cdotaccent;010B +//cdsquare;33C5 +//cedilla;00B8 +//cedillacmb;0327 +//cent;00A2 +//centigrade;2103 +//centinferior;F6DF +//centmonospace;FFE0 +//centoldstyle;F7A2 +//centsuperior;F6E0 +//chaarmenian;0579 +//chabengali;099B +//chadeva;091B +//chagujarati;0A9B +//chagurmukhi;0A1B +//chbopomofo;3114 +//cheabkhasiancyrillic;04BD +//checkmark;2713 +//checyrillic;0447 +//chedescenderabkhasiancyrillic;04BF +//chedescendercyrillic;04B7 +//chedieresiscyrillic;04F5 +//cheharmenian;0573 +//chekhakassiancyrillic;04CC +//cheverticalstrokecyrillic;04B9 +//chi;03C7 +//chieuchacirclekorean;3277 +//chieuchaparenkorean;3217 +//chieuchcirclekorean;3269 +//chieuchkorean;314A +//chieuchparenkorean;3209 +//chochangthai;0E0A +//chochanthai;0E08 +//chochingthai;0E09 +//chochoethai;0E0C +//chook;0188 +//cieucacirclekorean;3276 +//cieucaparenkorean;3216 +//cieuccirclekorean;3268 +//cieuckorean;3148 +//cieucparenkorean;3208 +//cieucuparenkorean;321C +//circle;25CB +//circlemultiply;2297 +//circleot;2299 +//circleplus;2295 +//circlepostalmark;3036 +//circlewithlefthalfblack;25D0 +//circlewithrighthalfblack;25D1 +//circumflex;02C6 +//circumflexbelowcmb;032D +//circumflexcmb;0302 +//clear;2327 +//clickalveolar;01C2 +//clickdental;01C0 +//clicklateral;01C1 +//clickretroflex;01C3 +//club;2663 +//clubsuitblack;2663 +//clubsuitwhite;2667 +//cmcubedsquare;33A4 +//cmonospace;FF43 +//cmsquaredsquare;33A0 +//coarmenian;0581 +//colon;003A +//colonmonetary;20A1 +//colonmonospace;FF1A +//colonsign;20A1 +//colonsmall;FE55 +//colontriangularhalfmod;02D1 +//colontriangularmod;02D0 +//comma;002C +//commaabovecmb;0313 +//commaaboverightcmb;0315 +//commaaccent;F6C3 +//commaarabic;060C +//commaarmenian;055D +//commainferior;F6E1 +//commamonospace;FF0C +//commareversedabovecmb;0314 +//commareversedmod;02BD +//commasmall;FE50 +//commasuperior;F6E2 +//commaturnedabovecmb;0312 +//commaturnedmod;02BB +//compass;263C +//congruent;2245 +//contourintegral;222E +//control;2303 +//controlACK;0006 +//controlBEL;0007 +//controlBS;0008 +//controlCAN;0018 +//controlCR;000D +//controlDC1;0011 +//controlDC2;0012 +//controlDC3;0013 +//controlDC4;0014 +//controlDEL;007F +//controlDLE;0010 +//controlEM;0019 +//controlENQ;0005 +//controlEOT;0004 +//controlESC;001B +//controlETB;0017 +//controlETX;0003 +//controlFF;000C +//controlFS;001C +//controlGS;001D +//controlHT;0009 +//controlLF;000A +//controlNAK;0015 +//controlRS;001E +//controlSI;000F +//controlSO;000E +//controlSOT;0002 +//controlSTX;0001 +//controlSUB;001A +//controlSYN;0016 +//controlUS;001F +//controlVT;000B +//copyright;00A9 +//copyrightsans;F8E9 +//copyrightserif;F6D9 +//cornerbracketleft;300C +//cornerbracketlefthalfwidth;FF62 +//cornerbracketleftvertical;FE41 +//cornerbracketright;300D +//cornerbracketrighthalfwidth;FF63 +//cornerbracketrightvertical;FE42 +//corporationsquare;337F +//cosquare;33C7 +//coverkgsquare;33C6 +//cparen;249E +//cruzeiro;20A2 +//cstretched;0297 +//curlyand;22CF +//curlyor;22CE +//currency;00A4 +//cyrBreve;F6D1 +//cyrFlex;F6D2 +//cyrbreve;F6D4 +//cyrflex;F6D5 +//d;0064 +//daarmenian;0564 +//dabengali;09A6 +//dadarabic;0636 +//dadeva;0926 +//dadfinalarabic;FEBE +//dadinitialarabic;FEBF +//dadmedialarabic;FEC0 +//dagesh;05BC +//dageshhebrew;05BC +//dagger;2020 +//daggerdbl;2021 +//dagujarati;0AA6 +//dagurmukhi;0A26 +//dahiragana;3060 +//dakatakana;30C0 +//dalarabic;062F +//dalet;05D3 +//daletdagesh;FB33 +//daletdageshhebrew;FB33 +//dalethatafpatah;05D3 05B2 +//dalethatafpatahhebrew;05D3 05B2 +//dalethatafsegol;05D3 05B1 +//dalethatafsegolhebrew;05D3 05B1 +//dalethebrew;05D3 +//dalethiriq;05D3 05B4 +//dalethiriqhebrew;05D3 05B4 +//daletholam;05D3 05B9 +//daletholamhebrew;05D3 05B9 +//daletpatah;05D3 05B7 +//daletpatahhebrew;05D3 05B7 +//daletqamats;05D3 05B8 +//daletqamatshebrew;05D3 05B8 +//daletqubuts;05D3 05BB +//daletqubutshebrew;05D3 05BB +//daletsegol;05D3 05B6 +//daletsegolhebrew;05D3 05B6 +//daletsheva;05D3 05B0 +//daletshevahebrew;05D3 05B0 +//dalettsere;05D3 05B5 +//dalettserehebrew;05D3 05B5 +//dalfinalarabic;FEAA +//dammaarabic;064F +//dammalowarabic;064F +//dammatanaltonearabic;064C +//dammatanarabic;064C +//danda;0964 +//dargahebrew;05A7 +//dargalefthebrew;05A7 +//dasiapneumatacyrilliccmb;0485 +//dblGrave;F6D3 +//dblanglebracketleft;300A +//dblanglebracketleftvertical;FE3D +//dblanglebracketright;300B +//dblanglebracketrightvertical;FE3E +//dblarchinvertedbelowcmb;032B +//dblarrowleft;21D4 +//dblarrowright;21D2 +//dbldanda;0965 +//dblgrave;F6D6 +//dblgravecmb;030F +//dblintegral;222C +//dbllowline;2017 +//dbllowlinecmb;0333 +//dbloverlinecmb;033F +//dblprimemod;02BA +//dblverticalbar;2016 +//dblverticallineabovecmb;030E +//dbopomofo;3109 +//dbsquare;33C8 +//dcaron;010F +//dcedilla;1E11 +//dcircle;24D3 +//dcircumflexbelow;1E13 +//dcroat;0111 +//ddabengali;09A1 +//ddadeva;0921 +//ddagujarati;0AA1 +//ddagurmukhi;0A21 +//ddalarabic;0688 +//ddalfinalarabic;FB89 +//dddhadeva;095C +//ddhabengali;09A2 +//ddhadeva;0922 +//ddhagujarati;0AA2 +//ddhagurmukhi;0A22 +//ddotaccent;1E0B +//ddotbelow;1E0D +//decimalseparatorarabic;066B +//decimalseparatorpersian;066B +//decyrillic;0434 +//degree;00B0 +//dehihebrew;05AD +//dehiragana;3067 +//deicoptic;03EF +//dekatakana;30C7 +//deleteleft;232B +//deleteright;2326 +//delta;03B4 +//deltaturned;018D +//denominatorminusonenumeratorbengali;09F8 +//dezh;02A4 +//dhabengali;09A7 +//dhadeva;0927 +//dhagujarati;0AA7 +//dhagurmukhi;0A27 +//dhook;0257 +//dialytikatonos;0385 +//dialytikatonoscmb;0344 +//diamond;2666 +//diamondsuitwhite;2662 +//dieresis;00A8 +//dieresisacute;F6D7 +//dieresisbelowcmb;0324 +//dieresiscmb;0308 +//dieresisgrave;F6D8 +//dieresistonos;0385 +//dihiragana;3062 +//dikatakana;30C2 +//dittomark;3003 +//divide;00F7 +//divides;2223 +//divisionslash;2215 +//djecyrillic;0452 +//dkshade;2593 +//dlinebelow;1E0F +//dlsquare;3397 +//dmacron;0111 +//dmonospace;FF44 +//dnblock;2584 +//dochadathai;0E0E +//dodekthai;0E14 +//dohiragana;3069 +//dokatakana;30C9 +//dollar;0024 +//dollarinferior;F6E3 +//dollarmonospace;FF04 +//dollaroldstyle;F724 +//dollarsmall;FE69 +//dollarsuperior;F6E4 +//dong;20AB +//dorusquare;3326 +//dotaccent;02D9 +//dotaccentcmb;0307 +//dotbelowcmb;0323 +//dotbelowcomb;0323 +//dotkatakana;30FB +//dotlessi;0131 +//dotlessj;F6BE +//dotlessjstrokehook;0284 +//dotmath;22C5 +//dottedcircle;25CC +//doubleyodpatah;FB1F +//doubleyodpatahhebrew;FB1F +//downtackbelowcmb;031E +//downtackmod;02D5 +//dparen;249F +//dsuperior;F6EB +//dtail;0256 +//dtopbar;018C +//duhiragana;3065 +//dukatakana;30C5 +//dz;01F3 +//dzaltone;02A3 +//dzcaron;01C6 +//dzcurl;02A5 +//dzeabkhasiancyrillic;04E1 +//dzecyrillic;0455 +//dzhecyrillic;045F +//e;0065 +//eacute;00E9 +//earth;2641 +//ebengali;098F +//ebopomofo;311C +//ebreve;0115 +//ecandradeva;090D +//ecandragujarati;0A8D +//ecandravowelsigndeva;0945 +//ecandravowelsigngujarati;0AC5 +//ecaron;011B +//ecedillabreve;1E1D +//echarmenian;0565 +//echyiwnarmenian;0587 +//ecircle;24D4 +//ecircumflex;00EA +//ecircumflexacute;1EBF +//ecircumflexbelow;1E19 +//ecircumflexdotbelow;1EC7 +//ecircumflexgrave;1EC1 +//ecircumflexhookabove;1EC3 +//ecircumflextilde;1EC5 +//ecyrillic;0454 +//edblgrave;0205 +//edeva;090F +//edieresis;00EB +//edot;0117 +//edotaccent;0117 +//edotbelow;1EB9 +//eegurmukhi;0A0F +//eematragurmukhi;0A47 +//efcyrillic;0444 +//egrave;00E8 +//egujarati;0A8F +//eharmenian;0567 +//ehbopomofo;311D +//ehiragana;3048 +//ehookabove;1EBB +//eibopomofo;311F +//eight;0038 +//eightarabic;0668 +//eightbengali;09EE +//eightcircle;2467 +//eightcircleinversesansserif;2791 +//eightdeva;096E +//eighteencircle;2471 +//eighteenparen;2485 +//eighteenperiod;2499 +//eightgujarati;0AEE +//eightgurmukhi;0A6E +//eighthackarabic;0668 +//eighthangzhou;3028 +//eighthnotebeamed;266B +//eightideographicparen;3227 +//eightinferior;2088 +//eightmonospace;FF18 +//eightoldstyle;F738 +//eightparen;247B +//eightperiod;248F +//eightpersian;06F8 +//eightroman;2177 +//eightsuperior;2078 +//eightthai;0E58 +//einvertedbreve;0207 +//eiotifiedcyrillic;0465 +//ekatakana;30A8 +//ekatakanahalfwidth;FF74 +//ekonkargurmukhi;0A74 +//ekorean;3154 +//elcyrillic;043B +//element;2208 +//elevencircle;246A +//elevenparen;247E +//elevenperiod;2492 +//elevenroman;217A +//ellipsis;2026 +//ellipsisvertical;22EE +//emacron;0113 +//emacronacute;1E17 +//emacrongrave;1E15 +//emcyrillic;043C +//emdash;2014 +//emdashvertical;FE31 +//emonospace;FF45 +//emphasismarkarmenian;055B +//emptyset;2205 +//enbopomofo;3123 +//encyrillic;043D +//endash;2013 +//endashvertical;FE32 +//endescendercyrillic;04A3 +//eng;014B +//engbopomofo;3125 +//enghecyrillic;04A5 +//enhookcyrillic;04C8 +//enspace;2002 +//eogonek;0119 +//eokorean;3153 +//eopen;025B +//eopenclosed;029A +//eopenreversed;025C +//eopenreversedclosed;025E +//eopenreversedhook;025D +//eparen;24A0 +//epsilon;03B5 +//epsilontonos;03AD +//equal;003D +//equalmonospace;FF1D +//equalsmall;FE66 +//equalsuperior;207C +//equivalence;2261 +//erbopomofo;3126 +//ercyrillic;0440 +//ereversed;0258 +//ereversedcyrillic;044D +//escyrillic;0441 +//esdescendercyrillic;04AB +//esh;0283 +//eshcurl;0286 +//eshortdeva;090E +//eshortvowelsigndeva;0946 +//eshreversedloop;01AA +//eshsquatreversed;0285 +//esmallhiragana;3047 +//esmallkatakana;30A7 +//esmallkatakanahalfwidth;FF6A +//estimated;212E +//esuperior;F6EC +//eta;03B7 +//etarmenian;0568 +//etatonos;03AE +//eth;00F0 +//etilde;1EBD +//etildebelow;1E1B +//etnahtafoukhhebrew;0591 +//etnahtafoukhlefthebrew;0591 +//etnahtahebrew;0591 +//etnahtalefthebrew;0591 +//eturned;01DD +//eukorean;3161 +//euro;20AC +//evowelsignbengali;09C7 +//evowelsigndeva;0947 +//evowelsigngujarati;0AC7 +//exclam;0021 +//exclamarmenian;055C +//exclamdbl;203C +//exclamdown;00A1 +//exclamdownsmall;F7A1 +//exclammonospace;FF01 +//exclamsmall;F721 +//existential;2203 +//ezh;0292 +//ezhcaron;01EF +//ezhcurl;0293 +//ezhreversed;01B9 +//ezhtail;01BA +//f;0066 +//fadeva;095E +//fagurmukhi;0A5E +//fahrenheit;2109 +//fathaarabic;064E +//fathalowarabic;064E +//fathatanarabic;064B +//fbopomofo;3108 +//fcircle;24D5 +//fdotaccent;1E1F +//feharabic;0641 +//feharmenian;0586 +//fehfinalarabic;FED2 +//fehinitialarabic;FED3 +//fehmedialarabic;FED4 +//feicoptic;03E5 +//female;2640 +//ff;FB00 +//ffi;FB03 +//ffl;FB04 +//fi;FB01 +//fifteencircle;246E +//fifteenparen;2482 +//fifteenperiod;2496 +//figuredash;2012 +//filledbox;25A0 +//filledrect;25AC +//finalkaf;05DA +//finalkafdagesh;FB3A +//finalkafdageshhebrew;FB3A +//finalkafhebrew;05DA +//finalkafqamats;05DA 05B8 +//finalkafqamatshebrew;05DA 05B8 +//finalkafsheva;05DA 05B0 +//finalkafshevahebrew;05DA 05B0 +//finalmem;05DD +//finalmemhebrew;05DD +//finalnun;05DF +//finalnunhebrew;05DF +//finalpe;05E3 +//finalpehebrew;05E3 +//finaltsadi;05E5 +//finaltsadihebrew;05E5 +//firsttonechinese;02C9 +//fisheye;25C9 +//fitacyrillic;0473 +//five;0035 +//fivearabic;0665 +//fivebengali;09EB +//fivecircle;2464 +//fivecircleinversesansserif;278E +//fivedeva;096B +//fiveeighths;215D +//fivegujarati;0AEB +//fivegurmukhi;0A6B +//fivehackarabic;0665 +//fivehangzhou;3025 +//fiveideographicparen;3224 +//fiveinferior;2085 +//fivemonospace;FF15 +//fiveoldstyle;F735 +//fiveparen;2478 +//fiveperiod;248C +//fivepersian;06F5 +//fiveroman;2174 +//fivesuperior;2075 +//fivethai;0E55 +//fl;FB02 +//florin;0192 +//fmonospace;FF46 +//fmsquare;3399 +//fofanthai;0E1F +//fofathai;0E1D +//fongmanthai;0E4F +//forall;2200 +//four;0034 +//fourarabic;0664 +//fourbengali;09EA +//fourcircle;2463 +//fourcircleinversesansserif;278D +//fourdeva;096A +//fourgujarati;0AEA +//fourgurmukhi;0A6A +//fourhackarabic;0664 +//fourhangzhou;3024 +//fourideographicparen;3223 +//fourinferior;2084 +//fourmonospace;FF14 +//fournumeratorbengali;09F7 +//fouroldstyle;F734 +//fourparen;2477 +//fourperiod;248B +//fourpersian;06F4 +//fourroman;2173 +//foursuperior;2074 +//fourteencircle;246D +//fourteenparen;2481 +//fourteenperiod;2495 +//fourthai;0E54 +//fourthtonechinese;02CB +//fparen;24A1 +//fraction;2044 +//franc;20A3 +//g;0067 +//gabengali;0997 +//gacute;01F5 +//gadeva;0917 +//gafarabic;06AF +//gaffinalarabic;FB93 +//gafinitialarabic;FB94 +//gafmedialarabic;FB95 +//gagujarati;0A97 +//gagurmukhi;0A17 +//gahiragana;304C +//gakatakana;30AC +//gamma;03B3 +//gammalatinsmall;0263 +//gammasuperior;02E0 +//gangiacoptic;03EB +//gbopomofo;310D +//gbreve;011F +//gcaron;01E7 +//gcedilla;0123 +//gcircle;24D6 +//gcircumflex;011D +//gcommaaccent;0123 +//gdot;0121 +//gdotaccent;0121 +//gecyrillic;0433 +//gehiragana;3052 +//gekatakana;30B2 +//geometricallyequal;2251 +//gereshaccenthebrew;059C +//gereshhebrew;05F3 +//gereshmuqdamhebrew;059D +//germandbls;00DF +//gershayimaccenthebrew;059E +//gershayimhebrew;05F4 +//getamark;3013 +//ghabengali;0998 +//ghadarmenian;0572 +//ghadeva;0918 +//ghagujarati;0A98 +//ghagurmukhi;0A18 +//ghainarabic;063A +//ghainfinalarabic;FECE +//ghaininitialarabic;FECF +//ghainmedialarabic;FED0 +//ghemiddlehookcyrillic;0495 +//ghestrokecyrillic;0493 +//gheupturncyrillic;0491 +//ghhadeva;095A +//ghhagurmukhi;0A5A +//ghook;0260 +//ghzsquare;3393 +//gihiragana;304E +//gikatakana;30AE +//gimarmenian;0563 +//gimel;05D2 +//gimeldagesh;FB32 +//gimeldageshhebrew;FB32 +//gimelhebrew;05D2 +//gjecyrillic;0453 +//glottalinvertedstroke;01BE +//glottalstop;0294 +//glottalstopinverted;0296 +//glottalstopmod;02C0 +//glottalstopreversed;0295 +//glottalstopreversedmod;02C1 +//glottalstopreversedsuperior;02E4 +//glottalstopstroke;02A1 +//glottalstopstrokereversed;02A2 +//gmacron;1E21 +//gmonospace;FF47 +//gohiragana;3054 +//gokatakana;30B4 +//gparen;24A2 +//gpasquare;33AC +//gradient;2207 +//grave;0060 +//gravebelowcmb;0316 +//gravecmb;0300 +//gravecomb;0300 +//gravedeva;0953 +//gravelowmod;02CE +//gravemonospace;FF40 +//gravetonecmb;0340 +//greater;003E +//greaterequal;2265 +//greaterequalorless;22DB +//greatermonospace;FF1E +//greaterorequivalent;2273 +//greaterorless;2277 +//greateroverequal;2267 +//greatersmall;FE65 +//gscript;0261 +//gstroke;01E5 +//guhiragana;3050 +//guillemotleft;00AB +//guillemotright;00BB +//guilsinglleft;2039 +//guilsinglright;203A +//gukatakana;30B0 +//guramusquare;3318 +//gysquare;33C9 +//h;0068 +//haabkhasiancyrillic;04A9 +//haaltonearabic;06C1 +//habengali;09B9 +//hadescendercyrillic;04B3 +//hadeva;0939 +//hagujarati;0AB9 +//hagurmukhi;0A39 +//haharabic;062D +//hahfinalarabic;FEA2 +//hahinitialarabic;FEA3 +//hahiragana;306F +//hahmedialarabic;FEA4 +//haitusquare;332A +//hakatakana;30CF +//hakatakanahalfwidth;FF8A +//halantgurmukhi;0A4D +//hamzaarabic;0621 +//hamzadammaarabic;0621 064F +//hamzadammatanarabic;0621 064C +//hamzafathaarabic;0621 064E +//hamzafathatanarabic;0621 064B +//hamzalowarabic;0621 +//hamzalowkasraarabic;0621 0650 +//hamzalowkasratanarabic;0621 064D +//hamzasukunarabic;0621 0652 +//hangulfiller;3164 +//hardsigncyrillic;044A +//harpoonleftbarbup;21BC +//harpoonrightbarbup;21C0 +//hasquare;33CA +//hatafpatah;05B2 +//hatafpatah16;05B2 +//hatafpatah23;05B2 +//hatafpatah2f;05B2 +//hatafpatahhebrew;05B2 +//hatafpatahnarrowhebrew;05B2 +//hatafpatahquarterhebrew;05B2 +//hatafpatahwidehebrew;05B2 +//hatafqamats;05B3 +//hatafqamats1b;05B3 +//hatafqamats28;05B3 +//hatafqamats34;05B3 +//hatafqamatshebrew;05B3 +//hatafqamatsnarrowhebrew;05B3 +//hatafqamatsquarterhebrew;05B3 +//hatafqamatswidehebrew;05B3 +//hatafsegol;05B1 +//hatafsegol17;05B1 +//hatafsegol24;05B1 +//hatafsegol30;05B1 +//hatafsegolhebrew;05B1 +//hatafsegolnarrowhebrew;05B1 +//hatafsegolquarterhebrew;05B1 +//hatafsegolwidehebrew;05B1 +//hbar;0127 +//hbopomofo;310F +//hbrevebelow;1E2B +//hcedilla;1E29 +//hcircle;24D7 +//hcircumflex;0125 +//hdieresis;1E27 +//hdotaccent;1E23 +//hdotbelow;1E25 +//he;05D4 +//heart;2665 +//heartsuitblack;2665 +//heartsuitwhite;2661 +//hedagesh;FB34 +//hedageshhebrew;FB34 +//hehaltonearabic;06C1 +//heharabic;0647 +//hehebrew;05D4 +//hehfinalaltonearabic;FBA7 +//hehfinalalttwoarabic;FEEA +//hehfinalarabic;FEEA +//hehhamzaabovefinalarabic;FBA5 +//hehhamzaaboveisolatedarabic;FBA4 +//hehinitialaltonearabic;FBA8 +//hehinitialarabic;FEEB +//hehiragana;3078 +//hehmedialaltonearabic;FBA9 +//hehmedialarabic;FEEC +//heiseierasquare;337B +//hekatakana;30D8 +//hekatakanahalfwidth;FF8D +//hekutaarusquare;3336 +//henghook;0267 +//herutusquare;3339 +//het;05D7 +//hethebrew;05D7 +//hhook;0266 +//hhooksuperior;02B1 +//hieuhacirclekorean;327B +//hieuhaparenkorean;321B +//hieuhcirclekorean;326D +//hieuhkorean;314E +//hieuhparenkorean;320D +//hihiragana;3072 +//hikatakana;30D2 +//hikatakanahalfwidth;FF8B +//hiriq;05B4 +//hiriq14;05B4 +//hiriq21;05B4 +//hiriq2d;05B4 +//hiriqhebrew;05B4 +//hiriqnarrowhebrew;05B4 +//hiriqquarterhebrew;05B4 +//hiriqwidehebrew;05B4 +//hlinebelow;1E96 +//hmonospace;FF48 +//hoarmenian;0570 +//hohipthai;0E2B +//hohiragana;307B +//hokatakana;30DB +//hokatakanahalfwidth;FF8E +//holam;05B9 +//holam19;05B9 +//holam26;05B9 +//holam32;05B9 +//holamhebrew;05B9 +//holamnarrowhebrew;05B9 +//holamquarterhebrew;05B9 +//holamwidehebrew;05B9 +//honokhukthai;0E2E +//hookabovecomb;0309 +//hookcmb;0309 +//hookpalatalizedbelowcmb;0321 +//hookretroflexbelowcmb;0322 +//hoonsquare;3342 +//horicoptic;03E9 +//horizontalbar;2015 +//horncmb;031B +//hotsprings;2668 +//house;2302 +//hparen;24A3 +//hsuperior;02B0 +//hturned;0265 +//huhiragana;3075 +//huiitosquare;3333 +//hukatakana;30D5 +//hukatakanahalfwidth;FF8C +//hungarumlaut;02DD +//hungarumlautcmb;030B +//hv;0195 +//hyphen;002D +//hypheninferior;F6E5 +//hyphenmonospace;FF0D +//hyphensmall;FE63 +//hyphensuperior;F6E6 +//hyphentwo;2010 +//i;0069 +//iacute;00ED +//iacyrillic;044F +//ibengali;0987 +//ibopomofo;3127 +//ibreve;012D +//icaron;01D0 +//icircle;24D8 +//icircumflex;00EE +//icyrillic;0456 +//idblgrave;0209 +//ideographearthcircle;328F +//ideographfirecircle;328B +//ideographicallianceparen;323F +//ideographiccallparen;323A +//ideographiccentrecircle;32A5 +//ideographicclose;3006 +//ideographiccomma;3001 +//ideographiccommaleft;FF64 +//ideographiccongratulationparen;3237 +//ideographiccorrectcircle;32A3 +//ideographicearthparen;322F +//ideographicenterpriseparen;323D +//ideographicexcellentcircle;329D +//ideographicfestivalparen;3240 +//ideographicfinancialcircle;3296 +//ideographicfinancialparen;3236 +//ideographicfireparen;322B +//ideographichaveparen;3232 +//ideographichighcircle;32A4 +//ideographiciterationmark;3005 +//ideographiclaborcircle;3298 +//ideographiclaborparen;3238 +//ideographicleftcircle;32A7 +//ideographiclowcircle;32A6 +//ideographicmedicinecircle;32A9 +//ideographicmetalparen;322E +//ideographicmoonparen;322A +//ideographicnameparen;3234 +//ideographicperiod;3002 +//ideographicprintcircle;329E +//ideographicreachparen;3243 +//ideographicrepresentparen;3239 +//ideographicresourceparen;323E +//ideographicrightcircle;32A8 +//ideographicsecretcircle;3299 +//ideographicselfparen;3242 +//ideographicsocietyparen;3233 +//ideographicspace;3000 +//ideographicspecialparen;3235 +//ideographicstockparen;3231 +//ideographicstudyparen;323B +//ideographicsunparen;3230 +//ideographicsuperviseparen;323C +//ideographicwaterparen;322C +//ideographicwoodparen;322D +//ideographiczero;3007 +//ideographmetalcircle;328E +//ideographmooncircle;328A +//ideographnamecircle;3294 +//ideographsuncircle;3290 +//ideographwatercircle;328C +//ideographwoodcircle;328D +//ideva;0907 +//idieresis;00EF +//idieresisacute;1E2F +//idieresiscyrillic;04E5 +//idotbelow;1ECB +//iebrevecyrillic;04D7 +//iecyrillic;0435 +//ieungacirclekorean;3275 +//ieungaparenkorean;3215 +//ieungcirclekorean;3267 +//ieungkorean;3147 +//ieungparenkorean;3207 +//igrave;00EC +//igujarati;0A87 +//igurmukhi;0A07 +//ihiragana;3044 +//ihookabove;1EC9 +//iibengali;0988 +//iicyrillic;0438 +//iideva;0908 +//iigujarati;0A88 +//iigurmukhi;0A08 +//iimatragurmukhi;0A40 +//iinvertedbreve;020B +//iishortcyrillic;0439 +//iivowelsignbengali;09C0 +//iivowelsigndeva;0940 +//iivowelsigngujarati;0AC0 +//ij;0133 +//ikatakana;30A4 +//ikatakanahalfwidth;FF72 +//ikorean;3163 +//ilde;02DC +//iluyhebrew;05AC +//imacron;012B +//imacroncyrillic;04E3 +//imageorapproximatelyequal;2253 +//imatragurmukhi;0A3F +//imonospace;FF49 +//increment;2206 +//infinity;221E +//iniarmenian;056B +//integral;222B +//integralbottom;2321 +//integralbt;2321 +//integralex;F8F5 +//integraltop;2320 +//integraltp;2320 +//intersection;2229 +//intisquare;3305 +//invbullet;25D8 +//invcircle;25D9 +//invsmileface;263B +//iocyrillic;0451 +//iogonek;012F +//iota;03B9 +//iotadieresis;03CA +//iotadieresistonos;0390 +//iotalatin;0269 +//iotatonos;03AF +//iparen;24A4 +//irigurmukhi;0A72 +//ismallhiragana;3043 +//ismallkatakana;30A3 +//ismallkatakanahalfwidth;FF68 +//issharbengali;09FA +//istroke;0268 +//isuperior;F6ED +//iterationhiragana;309D +//iterationkatakana;30FD +//itilde;0129 +//itildebelow;1E2D +//iubopomofo;3129 +//iucyrillic;044E +//ivowelsignbengali;09BF +//ivowelsigndeva;093F +//ivowelsigngujarati;0ABF +//izhitsacyrillic;0475 +//izhitsadblgravecyrillic;0477 +//j;006A +//jaarmenian;0571 +//jabengali;099C +//jadeva;091C +//jagujarati;0A9C +//jagurmukhi;0A1C +//jbopomofo;3110 +//jcaron;01F0 +//jcircle;24D9 +//jcircumflex;0135 +//jcrossedtail;029D +//jdotlessstroke;025F +//jecyrillic;0458 +//jeemarabic;062C +//jeemfinalarabic;FE9E +//jeeminitialarabic;FE9F +//jeemmedialarabic;FEA0 +//jeharabic;0698 +//jehfinalarabic;FB8B +//jhabengali;099D +//jhadeva;091D +//jhagujarati;0A9D +//jhagurmukhi;0A1D +//jheharmenian;057B +//jis;3004 +//jmonospace;FF4A +//jparen;24A5 +//jsuperior;02B2 +//k;006B +//kabashkircyrillic;04A1 +//kabengali;0995 +//kacute;1E31 +//kacyrillic;043A +//kadescendercyrillic;049B +//kadeva;0915 +//kaf;05DB +//kafarabic;0643 +//kafdagesh;FB3B +//kafdageshhebrew;FB3B +//kaffinalarabic;FEDA +//kafhebrew;05DB +//kafinitialarabic;FEDB +//kafmedialarabic;FEDC +//kafrafehebrew;FB4D +//kagujarati;0A95 +//kagurmukhi;0A15 +//kahiragana;304B +//kahookcyrillic;04C4 +//kakatakana;30AB +//kakatakanahalfwidth;FF76 +//kappa;03BA +//kappasymbolgreek;03F0 +//kapyeounmieumkorean;3171 +//kapyeounphieuphkorean;3184 +//kapyeounpieupkorean;3178 +//kapyeounssangpieupkorean;3179 +//karoriisquare;330D +//kashidaautoarabic;0640 +//kashidaautonosidebearingarabic;0640 +//kasmallkatakana;30F5 +//kasquare;3384 +//kasraarabic;0650 +//kasratanarabic;064D +//kastrokecyrillic;049F +//katahiraprolongmarkhalfwidth;FF70 +//kaverticalstrokecyrillic;049D +//kbopomofo;310E +//kcalsquare;3389 +//kcaron;01E9 +//kcedilla;0137 +//kcircle;24DA +//kcommaaccent;0137 +//kdotbelow;1E33 +//keharmenian;0584 +//kehiragana;3051 +//kekatakana;30B1 +//kekatakanahalfwidth;FF79 +//kenarmenian;056F +//kesmallkatakana;30F6 +//kgreenlandic;0138 +//khabengali;0996 +//khacyrillic;0445 +//khadeva;0916 +//khagujarati;0A96 +//khagurmukhi;0A16 +//khaharabic;062E +//khahfinalarabic;FEA6 +//khahinitialarabic;FEA7 +//khahmedialarabic;FEA8 +//kheicoptic;03E7 +//khhadeva;0959 +//khhagurmukhi;0A59 +//khieukhacirclekorean;3278 +//khieukhaparenkorean;3218 +//khieukhcirclekorean;326A +//khieukhkorean;314B +//khieukhparenkorean;320A +//khokhaithai;0E02 +//khokhonthai;0E05 +//khokhuatthai;0E03 +//khokhwaithai;0E04 +//khomutthai;0E5B +//khook;0199 +//khorakhangthai;0E06 +//khzsquare;3391 +//kihiragana;304D +//kikatakana;30AD +//kikatakanahalfwidth;FF77 +//kiroguramusquare;3315 +//kiromeetorusquare;3316 +//kirosquare;3314 +//kiyeokacirclekorean;326E +//kiyeokaparenkorean;320E +//kiyeokcirclekorean;3260 +//kiyeokkorean;3131 +//kiyeokparenkorean;3200 +//kiyeoksioskorean;3133 +//kjecyrillic;045C +//klinebelow;1E35 +//klsquare;3398 +//kmcubedsquare;33A6 +//kmonospace;FF4B +//kmsquaredsquare;33A2 +//kohiragana;3053 +//kohmsquare;33C0 +//kokaithai;0E01 +//kokatakana;30B3 +//kokatakanahalfwidth;FF7A +//kooposquare;331E +//koppacyrillic;0481 +//koreanstandardsymbol;327F +//koroniscmb;0343 +//kparen;24A6 +//kpasquare;33AA +//ksicyrillic;046F +//ktsquare;33CF +//kturned;029E +//kuhiragana;304F +//kukatakana;30AF +//kukatakanahalfwidth;FF78 +//kvsquare;33B8 +//kwsquare;33BE +//l;006C +//labengali;09B2 +//lacute;013A +//ladeva;0932 +//lagujarati;0AB2 +//lagurmukhi;0A32 +//lakkhangyaothai;0E45 +//lamaleffinalarabic;FEFC +//lamalefhamzaabovefinalarabic;FEF8 +//lamalefhamzaaboveisolatedarabic;FEF7 +//lamalefhamzabelowfinalarabic;FEFA +//lamalefhamzabelowisolatedarabic;FEF9 +//lamalefisolatedarabic;FEFB +//lamalefmaddaabovefinalarabic;FEF6 +//lamalefmaddaaboveisolatedarabic;FEF5 +//lamarabic;0644 +//lambda;03BB +//lambdastroke;019B +//lamed;05DC +//lameddagesh;FB3C +//lameddageshhebrew;FB3C +//lamedhebrew;05DC +//lamedholam;05DC 05B9 +//lamedholamdagesh;05DC 05B9 05BC +//lamedholamdageshhebrew;05DC 05B9 05BC +//lamedholamhebrew;05DC 05B9 +//lamfinalarabic;FEDE +//lamhahinitialarabic;FCCA +//laminitialarabic;FEDF +//lamjeeminitialarabic;FCC9 +//lamkhahinitialarabic;FCCB +//lamlamhehisolatedarabic;FDF2 +//lammedialarabic;FEE0 +//lammeemhahinitialarabic;FD88 +//lammeeminitialarabic;FCCC +//lammeemjeeminitialarabic;FEDF FEE4 FEA0 +//lammeemkhahinitialarabic;FEDF FEE4 FEA8 +//largecircle;25EF +//lbar;019A +//lbelt;026C +//lbopomofo;310C +//lcaron;013E +//lcedilla;013C +//lcircle;24DB +//lcircumflexbelow;1E3D +//lcommaaccent;013C +//ldot;0140 +//ldotaccent;0140 +//ldotbelow;1E37 +//ldotbelowmacron;1E39 +//leftangleabovecmb;031A +//lefttackbelowcmb;0318 +//less;003C +//lessequal;2264 +//lessequalorgreater;22DA +//lessmonospace;FF1C +//lessorequivalent;2272 +//lessorgreater;2276 +//lessoverequal;2266 +//lesssmall;FE64 +//lezh;026E +//lfblock;258C +//lhookretroflex;026D +//lira;20A4 +//liwnarmenian;056C +//lj;01C9 +//ljecyrillic;0459 +//ll;F6C0 +//lladeva;0933 +//llagujarati;0AB3 +//llinebelow;1E3B +//llladeva;0934 +//llvocalicbengali;09E1 +//llvocalicdeva;0961 +//llvocalicvowelsignbengali;09E3 +//llvocalicvowelsigndeva;0963 +//lmiddletilde;026B +//lmonospace;FF4C +//lmsquare;33D0 +//lochulathai;0E2C +//logicaland;2227 +//logicalnot;00AC +//logicalnotreversed;2310 +//logicalor;2228 +//lolingthai;0E25 +//longs;017F +//lowlinecenterline;FE4E +//lowlinecmb;0332 +//lowlinedashed;FE4D +//lozenge;25CA +//lparen;24A7 +//lslash;0142 +//lsquare;2113 +//lsuperior;F6EE +//ltshade;2591 +//luthai;0E26 +//lvocalicbengali;098C +//lvocalicdeva;090C +//lvocalicvowelsignbengali;09E2 +//lvocalicvowelsigndeva;0962 +//lxsquare;33D3 +//m;006D +//mabengali;09AE +//macron;00AF +//macronbelowcmb;0331 +//macroncmb;0304 +//macronlowmod;02CD +//macronmonospace;FFE3 +//macute;1E3F +//madeva;092E +//magujarati;0AAE +//magurmukhi;0A2E +//mahapakhhebrew;05A4 +//mahapakhlefthebrew;05A4 +//mahiragana;307E +//maichattawalowleftthai;F895 +//maichattawalowrightthai;F894 +//maichattawathai;0E4B +//maichattawaupperleftthai;F893 +//maieklowleftthai;F88C +//maieklowrightthai;F88B +//maiekthai;0E48 +//maiekupperleftthai;F88A +//maihanakatleftthai;F884 +//maihanakatthai;0E31 +//maitaikhuleftthai;F889 +//maitaikhuthai;0E47 +//maitholowleftthai;F88F +//maitholowrightthai;F88E +//maithothai;0E49 +//maithoupperleftthai;F88D +//maitrilowleftthai;F892 +//maitrilowrightthai;F891 +//maitrithai;0E4A +//maitriupperleftthai;F890 +//maiyamokthai;0E46 +//makatakana;30DE +//makatakanahalfwidth;FF8F +//male;2642 +//mansyonsquare;3347 +//maqafhebrew;05BE +//mars;2642 +//masoracirclehebrew;05AF +//masquare;3383 +//mbopomofo;3107 +//mbsquare;33D4 +//mcircle;24DC +//mcubedsquare;33A5 +//mdotaccent;1E41 +//mdotbelow;1E43 +//meemarabic;0645 +//meemfinalarabic;FEE2 +//meeminitialarabic;FEE3 +//meemmedialarabic;FEE4 +//meemmeeminitialarabic;FCD1 +//meemmeemisolatedarabic;FC48 +//meetorusquare;334D +//mehiragana;3081 +//meizierasquare;337E +//mekatakana;30E1 +//mekatakanahalfwidth;FF92 +//mem;05DE +//memdagesh;FB3E +//memdageshhebrew;FB3E +//memhebrew;05DE +//menarmenian;0574 +//merkhahebrew;05A5 +//merkhakefulahebrew;05A6 +//merkhakefulalefthebrew;05A6 +//merkhalefthebrew;05A5 +//mhook;0271 +//mhzsquare;3392 +//middledotkatakanahalfwidth;FF65 +//middot;00B7 +//mieumacirclekorean;3272 +//mieumaparenkorean;3212 +//mieumcirclekorean;3264 +//mieumkorean;3141 +//mieumpansioskorean;3170 +//mieumparenkorean;3204 +//mieumpieupkorean;316E +//mieumsioskorean;316F +//mihiragana;307F +//mikatakana;30DF +//mikatakanahalfwidth;FF90 +//minus;2212 +//minusbelowcmb;0320 +//minuscircle;2296 +//minusmod;02D7 +//minusplus;2213 +//minute;2032 +//miribaarusquare;334A +//mirisquare;3349 +//mlonglegturned;0270 +//mlsquare;3396 +//mmcubedsquare;33A3 +//mmonospace;FF4D +//mmsquaredsquare;339F +//mohiragana;3082 +//mohmsquare;33C1 +//mokatakana;30E2 +//mokatakanahalfwidth;FF93 +//molsquare;33D6 +//momathai;0E21 +//moverssquare;33A7 +//moverssquaredsquare;33A8 +//mparen;24A8 +//mpasquare;33AB +//mssquare;33B3 +//msuperior;F6EF +//mturned;026F +//mu;00B5 +//mu1;00B5 +//muasquare;3382 +//muchgreater;226B +//muchless;226A +//mufsquare;338C +//mugreek;03BC +//mugsquare;338D +//muhiragana;3080 +//mukatakana;30E0 +//mukatakanahalfwidth;FF91 +//mulsquare;3395 +//multiply;00D7 +//mumsquare;339B +//munahhebrew;05A3 +//munahlefthebrew;05A3 +//musicalnote;266A +//musicalnotedbl;266B +//musicflatsign;266D +//musicsharpsign;266F +//mussquare;33B2 +//muvsquare;33B6 +//muwsquare;33BC +//mvmegasquare;33B9 +//mvsquare;33B7 +//mwmegasquare;33BF +//mwsquare;33BD +//n;006E +//nabengali;09A8 +//nabla;2207 +//nacute;0144 +//nadeva;0928 +//nagujarati;0AA8 +//nagurmukhi;0A28 +//nahiragana;306A +//nakatakana;30CA +//nakatakanahalfwidth;FF85 +//napostrophe;0149 +//nasquare;3381 +//nbopomofo;310B +//nbspace;00A0 +//ncaron;0148 +//ncedilla;0146 +//ncircle;24DD +//ncircumflexbelow;1E4B +//ncommaaccent;0146 +//ndotaccent;1E45 +//ndotbelow;1E47 +//nehiragana;306D +//nekatakana;30CD +//nekatakanahalfwidth;FF88 +//newsheqelsign;20AA +//nfsquare;338B +//ngabengali;0999 +//ngadeva;0919 +//ngagujarati;0A99 +//ngagurmukhi;0A19 +//ngonguthai;0E07 +//nhiragana;3093 +//nhookleft;0272 +//nhookretroflex;0273 +//nieunacirclekorean;326F +//nieunaparenkorean;320F +//nieuncieuckorean;3135 +//nieuncirclekorean;3261 +//nieunhieuhkorean;3136 +//nieunkorean;3134 +//nieunpansioskorean;3168 +//nieunparenkorean;3201 +//nieunsioskorean;3167 +//nieuntikeutkorean;3166 +//nihiragana;306B +//nikatakana;30CB +//nikatakanahalfwidth;FF86 +//nikhahitleftthai;F899 +//nikhahitthai;0E4D +//nine;0039 +//ninearabic;0669 +//ninebengali;09EF +//ninecircle;2468 +//ninecircleinversesansserif;2792 +//ninedeva;096F +//ninegujarati;0AEF +//ninegurmukhi;0A6F +//ninehackarabic;0669 +//ninehangzhou;3029 +//nineideographicparen;3228 +//nineinferior;2089 +//ninemonospace;FF19 +//nineoldstyle;F739 +//nineparen;247C +//nineperiod;2490 +//ninepersian;06F9 +//nineroman;2178 +//ninesuperior;2079 +//nineteencircle;2472 +//nineteenparen;2486 +//nineteenperiod;249A +//ninethai;0E59 +//nj;01CC +//njecyrillic;045A +//nkatakana;30F3 +//nkatakanahalfwidth;FF9D +//nlegrightlong;019E +//nlinebelow;1E49 +//nmonospace;FF4E +//nmsquare;339A +//nnabengali;09A3 +//nnadeva;0923 +//nnagujarati;0AA3 +//nnagurmukhi;0A23 +//nnnadeva;0929 +//nohiragana;306E +//nokatakana;30CE +//nokatakanahalfwidth;FF89 +//nonbreakingspace;00A0 +//nonenthai;0E13 +//nonuthai;0E19 +//noonarabic;0646 +//noonfinalarabic;FEE6 +//noonghunnaarabic;06BA +//noonghunnafinalarabic;FB9F +//noonhehinitialarabic;FEE7 FEEC +//nooninitialarabic;FEE7 +//noonjeeminitialarabic;FCD2 +//noonjeemisolatedarabic;FC4B +//noonmedialarabic;FEE8 +//noonmeeminitialarabic;FCD5 +//noonmeemisolatedarabic;FC4E +//noonnoonfinalarabic;FC8D +//notcontains;220C +//notelement;2209 +//notelementof;2209 +//notequal;2260 +//notgreater;226F +//notgreaternorequal;2271 +//notgreaternorless;2279 +//notidentical;2262 +//notless;226E +//notlessnorequal;2270 +//notparallel;2226 +//notprecedes;2280 +//notsubset;2284 +//notsucceeds;2281 +//notsuperset;2285 +//nowarmenian;0576 +//nparen;24A9 +//nssquare;33B1 +//nsuperior;207F +//ntilde;00F1 +//nu;03BD +//nuhiragana;306C +//nukatakana;30CC +//nukatakanahalfwidth;FF87 +//nuktabengali;09BC +//nuktadeva;093C +//nuktagujarati;0ABC +//nuktagurmukhi;0A3C +//numbersign;0023 +//numbersignmonospace;FF03 +//numbersignsmall;FE5F +//numeralsigngreek;0374 +//numeralsignlowergreek;0375 +//numero;2116 +//nun;05E0 +//nundagesh;FB40 +//nundageshhebrew;FB40 +//nunhebrew;05E0 +//nvsquare;33B5 +//nwsquare;33BB +//nyabengali;099E +//nyadeva;091E +//nyagujarati;0A9E +//nyagurmukhi;0A1E +//o;006F +//oacute;00F3 +//oangthai;0E2D +//obarred;0275 +//obarredcyrillic;04E9 +//obarreddieresiscyrillic;04EB +//obengali;0993 +//obopomofo;311B +//obreve;014F +//ocandradeva;0911 +//ocandragujarati;0A91 +//ocandravowelsigndeva;0949 +//ocandravowelsigngujarati;0AC9 +//ocaron;01D2 +//ocircle;24DE +//ocircumflex;00F4 +//ocircumflexacute;1ED1 +//ocircumflexdotbelow;1ED9 +//ocircumflexgrave;1ED3 +//ocircumflexhookabove;1ED5 +//ocircumflextilde;1ED7 +//ocyrillic;043E +//odblacute;0151 +//odblgrave;020D +//odeva;0913 +//odieresis;00F6 +//odieresiscyrillic;04E7 +//odotbelow;1ECD +//oe;0153 +//oekorean;315A +//ogonek;02DB +//ogonekcmb;0328 +//ograve;00F2 +//ogujarati;0A93 +//oharmenian;0585 +//ohiragana;304A +//ohookabove;1ECF +//ohorn;01A1 +//ohornacute;1EDB +//ohorndotbelow;1EE3 +//ohorngrave;1EDD +//ohornhookabove;1EDF +//ohorntilde;1EE1 +//ohungarumlaut;0151 +//oi;01A3 +//oinvertedbreve;020F +//okatakana;30AA +//okatakanahalfwidth;FF75 +//okorean;3157 +//olehebrew;05AB +//omacron;014D +//omacronacute;1E53 +//omacrongrave;1E51 +//omdeva;0950 +//omega;03C9 +//omega1;03D6 +//omegacyrillic;0461 +//omegalatinclosed;0277 +//omegaroundcyrillic;047B +//omegatitlocyrillic;047D +//omegatonos;03CE +//omgujarati;0AD0 +//omicron;03BF +//omicrontonos;03CC +//omonospace;FF4F +//one;0031 +//onearabic;0661 +//onebengali;09E7 +//onecircle;2460 +//onecircleinversesansserif;278A +//onedeva;0967 +//onedotenleader;2024 +//oneeighth;215B +//onefitted;F6DC +//onegujarati;0AE7 +//onegurmukhi;0A67 +//onehackarabic;0661 +//onehalf;00BD +//onehangzhou;3021 +//oneideographicparen;3220 +//oneinferior;2081 +//onemonospace;FF11 +//onenumeratorbengali;09F4 +//oneoldstyle;F731 +//oneparen;2474 +//oneperiod;2488 +//onepersian;06F1 +//onequarter;00BC +//oneroman;2170 +//onesuperior;00B9 +//onethai;0E51 +//onethird;2153 +//oogonek;01EB +//oogonekmacron;01ED +//oogurmukhi;0A13 +//oomatragurmukhi;0A4B +//oopen;0254 +//oparen;24AA +//openbullet;25E6 +//option;2325 +//ordfeminine;00AA +//ordmasculine;00BA +//orthogonal;221F +//oshortdeva;0912 +//oshortvowelsigndeva;094A +//oslash;00F8 +//oslashacute;01FF +//osmallhiragana;3049 +//osmallkatakana;30A9 +//osmallkatakanahalfwidth;FF6B +//ostrokeacute;01FF +//osuperior;F6F0 +//otcyrillic;047F +//otilde;00F5 +//otildeacute;1E4D +//otildedieresis;1E4F +//oubopomofo;3121 +//overline;203E +//overlinecenterline;FE4A +//overlinecmb;0305 +//overlinedashed;FE49 +//overlinedblwavy;FE4C +//overlinewavy;FE4B +//overscore;00AF +//ovowelsignbengali;09CB +//ovowelsigndeva;094B +//ovowelsigngujarati;0ACB +//p;0070 +//paampssquare;3380 +//paasentosquare;332B +//pabengali;09AA +//pacute;1E55 +//padeva;092A +//pagedown;21DF +//pageup;21DE +//pagujarati;0AAA +//pagurmukhi;0A2A +//pahiragana;3071 +//paiyannoithai;0E2F +//pakatakana;30D1 +//palatalizationcyrilliccmb;0484 +//palochkacyrillic;04C0 +//pansioskorean;317F +//paragraph;00B6 +//parallel;2225 +//parenleft;0028 +//parenleftaltonearabic;FD3E +//parenleftbt;F8ED +//parenleftex;F8EC +//parenleftinferior;208D +//parenleftmonospace;FF08 +//parenleftsmall;FE59 +//parenleftsuperior;207D +//parenlefttp;F8EB +//parenleftvertical;FE35 +//parenright;0029 +//parenrightaltonearabic;FD3F +//parenrightbt;F8F8 +//parenrightex;F8F7 +//parenrightinferior;208E +//parenrightmonospace;FF09 +//parenrightsmall;FE5A +//parenrightsuperior;207E +//parenrighttp;F8F6 +//parenrightvertical;FE36 +//partialdiff;2202 +//paseqhebrew;05C0 +//pashtahebrew;0599 +//pasquare;33A9 +//patah;05B7 +//patah11;05B7 +//patah1d;05B7 +//patah2a;05B7 +//patahhebrew;05B7 +//patahnarrowhebrew;05B7 +//patahquarterhebrew;05B7 +//patahwidehebrew;05B7 +//pazerhebrew;05A1 +//pbopomofo;3106 +//pcircle;24DF +//pdotaccent;1E57 +//pe;05E4 +//pecyrillic;043F +//pedagesh;FB44 +//pedageshhebrew;FB44 +//peezisquare;333B +//pefinaldageshhebrew;FB43 +//peharabic;067E +//peharmenian;057A +//pehebrew;05E4 +//pehfinalarabic;FB57 +//pehinitialarabic;FB58 +//pehiragana;307A +//pehmedialarabic;FB59 +//pekatakana;30DA +//pemiddlehookcyrillic;04A7 +//perafehebrew;FB4E +//percent;0025 +//percentarabic;066A +//percentmonospace;FF05 +//percentsmall;FE6A +//period;002E +//periodarmenian;0589 +//periodcentered;00B7 +//periodhalfwidth;FF61 +//periodinferior;F6E7 +//periodmonospace;FF0E +//periodsmall;FE52 +//periodsuperior;F6E8 +//perispomenigreekcmb;0342 +//perpendicular;22A5 +//perthousand;2030 +//peseta;20A7 +//pfsquare;338A +//phabengali;09AB +//phadeva;092B +//phagujarati;0AAB +//phagurmukhi;0A2B +//phi;03C6 +//phi1;03D5 +//phieuphacirclekorean;327A +//phieuphaparenkorean;321A +//phieuphcirclekorean;326C +//phieuphkorean;314D +//phieuphparenkorean;320C +//philatin;0278 +//phinthuthai;0E3A +//phisymbolgreek;03D5 +//phook;01A5 +//phophanthai;0E1E +//phophungthai;0E1C +//phosamphaothai;0E20 +//pi;03C0 +//pieupacirclekorean;3273 +//pieupaparenkorean;3213 +//pieupcieuckorean;3176 +//pieupcirclekorean;3265 +//pieupkiyeokkorean;3172 +//pieupkorean;3142 +//pieupparenkorean;3205 +//pieupsioskiyeokkorean;3174 +//pieupsioskorean;3144 +//pieupsiostikeutkorean;3175 +//pieupthieuthkorean;3177 +//pieuptikeutkorean;3173 +//pihiragana;3074 +//pikatakana;30D4 +//pisymbolgreek;03D6 +//piwrarmenian;0583 +//plus;002B +//plusbelowcmb;031F +//pluscircle;2295 +//plusminus;00B1 +//plusmod;02D6 +//plusmonospace;FF0B +//plussmall;FE62 +//plussuperior;207A +//pmonospace;FF50 +//pmsquare;33D8 +//pohiragana;307D +//pointingindexdownwhite;261F +//pointingindexleftwhite;261C +//pointingindexrightwhite;261E +//pointingindexupwhite;261D +//pokatakana;30DD +//poplathai;0E1B +//postalmark;3012 +//postalmarkface;3020 +//pparen;24AB +//precedes;227A +//prescription;211E +//primemod;02B9 +//primereversed;2035 +//product;220F +//projective;2305 +//prolongedkana;30FC +//propellor;2318 +//propersubset;2282 +//propersuperset;2283 +//proportion;2237 +//proportional;221D +//psi;03C8 +//psicyrillic;0471 +//psilipneumatacyrilliccmb;0486 +//pssquare;33B0 +//puhiragana;3077 +//pukatakana;30D7 +//pvsquare;33B4 +//pwsquare;33BA +//q;0071 +//qadeva;0958 +//qadmahebrew;05A8 +//qafarabic;0642 +//qaffinalarabic;FED6 +//qafinitialarabic;FED7 +//qafmedialarabic;FED8 +//qamats;05B8 +//qamats10;05B8 +//qamats1a;05B8 +//qamats1c;05B8 +//qamats27;05B8 +//qamats29;05B8 +//qamats33;05B8 +//qamatsde;05B8 +//qamatshebrew;05B8 +//qamatsnarrowhebrew;05B8 +//qamatsqatanhebrew;05B8 +//qamatsqatannarrowhebrew;05B8 +//qamatsqatanquarterhebrew;05B8 +//qamatsqatanwidehebrew;05B8 +//qamatsquarterhebrew;05B8 +//qamatswidehebrew;05B8 +//qarneyparahebrew;059F +//qbopomofo;3111 +//qcircle;24E0 +//qhook;02A0 +//qmonospace;FF51 +//qof;05E7 +//qofdagesh;FB47 +//qofdageshhebrew;FB47 +//qofhatafpatah;05E7 05B2 +//qofhatafpatahhebrew;05E7 05B2 +//qofhatafsegol;05E7 05B1 +//qofhatafsegolhebrew;05E7 05B1 +//qofhebrew;05E7 +//qofhiriq;05E7 05B4 +//qofhiriqhebrew;05E7 05B4 +//qofholam;05E7 05B9 +//qofholamhebrew;05E7 05B9 +//qofpatah;05E7 05B7 +//qofpatahhebrew;05E7 05B7 +//qofqamats;05E7 05B8 +//qofqamatshebrew;05E7 05B8 +//qofqubuts;05E7 05BB +//qofqubutshebrew;05E7 05BB +//qofsegol;05E7 05B6 +//qofsegolhebrew;05E7 05B6 +//qofsheva;05E7 05B0 +//qofshevahebrew;05E7 05B0 +//qoftsere;05E7 05B5 +//qoftserehebrew;05E7 05B5 +//qparen;24AC +//quarternote;2669 +//qubuts;05BB +//qubuts18;05BB +//qubuts25;05BB +//qubuts31;05BB +//qubutshebrew;05BB +//qubutsnarrowhebrew;05BB +//qubutsquarterhebrew;05BB +//qubutswidehebrew;05BB +//question;003F +//questionarabic;061F +//questionarmenian;055E +//questiondown;00BF +//questiondownsmall;F7BF +//questiongreek;037E +//questionmonospace;FF1F +//questionsmall;F73F +//quotedbl;0022 +//quotedblbase;201E +//quotedblleft;201C +//quotedblmonospace;FF02 +//quotedblprime;301E +//quotedblprimereversed;301D +//quotedblright;201D +//quoteleft;2018 +//quoteleftreversed;201B +//quotereversed;201B +//quoteright;2019 +//quoterightn;0149 +//quotesinglbase;201A +//quotesingle;0027 +//quotesinglemonospace;FF07 +//r;0072 +//raarmenian;057C +//rabengali;09B0 +//racute;0155 +//radeva;0930 +//radical;221A +//radicalex;F8E5 +//radoverssquare;33AE +//radoverssquaredsquare;33AF +//radsquare;33AD +//rafe;05BF +//rafehebrew;05BF +//ragujarati;0AB0 +//ragurmukhi;0A30 +//rahiragana;3089 +//rakatakana;30E9 +//rakatakanahalfwidth;FF97 +//ralowerdiagonalbengali;09F1 +//ramiddlediagonalbengali;09F0 +//ramshorn;0264 +//ratio;2236 +//rbopomofo;3116 +//rcaron;0159 +//rcedilla;0157 +//rcircle;24E1 +//rcommaaccent;0157 +//rdblgrave;0211 +//rdotaccent;1E59 +//rdotbelow;1E5B +//rdotbelowmacron;1E5D +//referencemark;203B +//reflexsubset;2286 +//reflexsuperset;2287 +//registered;00AE +//registersans;F8E8 +//registerserif;F6DA +//reharabic;0631 +//reharmenian;0580 +//rehfinalarabic;FEAE +//rehiragana;308C +//rehyehaleflamarabic;0631 FEF3 FE8E 0644 +//rekatakana;30EC +//rekatakanahalfwidth;FF9A +//resh;05E8 +//reshdageshhebrew;FB48 +//reshhatafpatah;05E8 05B2 +//reshhatafpatahhebrew;05E8 05B2 +//reshhatafsegol;05E8 05B1 +//reshhatafsegolhebrew;05E8 05B1 +//reshhebrew;05E8 +//reshhiriq;05E8 05B4 +//reshhiriqhebrew;05E8 05B4 +//reshholam;05E8 05B9 +//reshholamhebrew;05E8 05B9 +//reshpatah;05E8 05B7 +//reshpatahhebrew;05E8 05B7 +//reshqamats;05E8 05B8 +//reshqamatshebrew;05E8 05B8 +//reshqubuts;05E8 05BB +//reshqubutshebrew;05E8 05BB +//reshsegol;05E8 05B6 +//reshsegolhebrew;05E8 05B6 +//reshsheva;05E8 05B0 +//reshshevahebrew;05E8 05B0 +//reshtsere;05E8 05B5 +//reshtserehebrew;05E8 05B5 +//reversedtilde;223D +//reviahebrew;0597 +//reviamugrashhebrew;0597 +//revlogicalnot;2310 +//rfishhook;027E +//rfishhookreversed;027F +//rhabengali;09DD +//rhadeva;095D +//rho;03C1 +//rhook;027D +//rhookturned;027B +//rhookturnedsuperior;02B5 +//rhosymbolgreek;03F1 +//rhotichookmod;02DE +//rieulacirclekorean;3271 +//rieulaparenkorean;3211 +//rieulcirclekorean;3263 +//rieulhieuhkorean;3140 +//rieulkiyeokkorean;313A +//rieulkiyeoksioskorean;3169 +//rieulkorean;3139 +//rieulmieumkorean;313B +//rieulpansioskorean;316C +//rieulparenkorean;3203 +//rieulphieuphkorean;313F +//rieulpieupkorean;313C +//rieulpieupsioskorean;316B +//rieulsioskorean;313D +//rieulthieuthkorean;313E +//rieultikeutkorean;316A +//rieulyeorinhieuhkorean;316D +//rightangle;221F +//righttackbelowcmb;0319 +//righttriangle;22BF +//rihiragana;308A +//rikatakana;30EA +//rikatakanahalfwidth;FF98 +//ring;02DA +//ringbelowcmb;0325 +//ringcmb;030A +//ringhalfleft;02BF +//ringhalfleftarmenian;0559 +//ringhalfleftbelowcmb;031C +//ringhalfleftcentered;02D3 +//ringhalfright;02BE +//ringhalfrightbelowcmb;0339 +//ringhalfrightcentered;02D2 +//rinvertedbreve;0213 +//rittorusquare;3351 +//rlinebelow;1E5F +//rlongleg;027C +//rlonglegturned;027A +//rmonospace;FF52 +//rohiragana;308D +//rokatakana;30ED +//rokatakanahalfwidth;FF9B +//roruathai;0E23 +//rparen;24AD +//rrabengali;09DC +//rradeva;0931 +//rragurmukhi;0A5C +//rreharabic;0691 +//rrehfinalarabic;FB8D +//rrvocalicbengali;09E0 +//rrvocalicdeva;0960 +//rrvocalicgujarati;0AE0 +//rrvocalicvowelsignbengali;09C4 +//rrvocalicvowelsigndeva;0944 +//rrvocalicvowelsigngujarati;0AC4 +//rsuperior;F6F1 +//rtblock;2590 +//rturned;0279 +//rturnedsuperior;02B4 +//ruhiragana;308B +//rukatakana;30EB +//rukatakanahalfwidth;FF99 +//rupeemarkbengali;09F2 +//rupeesignbengali;09F3 +//rupiah;F6DD +//ruthai;0E24 +//rvocalicbengali;098B +//rvocalicdeva;090B +//rvocalicgujarati;0A8B +//rvocalicvowelsignbengali;09C3 +//rvocalicvowelsigndeva;0943 +//rvocalicvowelsigngujarati;0AC3 +//s;0073 +//sabengali;09B8 +//sacute;015B +//sacutedotaccent;1E65 +//sadarabic;0635 +//sadeva;0938 +//sadfinalarabic;FEBA +//sadinitialarabic;FEBB +//sadmedialarabic;FEBC +//sagujarati;0AB8 +//sagurmukhi;0A38 +//sahiragana;3055 +//sakatakana;30B5 +//sakatakanahalfwidth;FF7B +//sallallahoualayhewasallamarabic;FDFA +//samekh;05E1 +//samekhdagesh;FB41 +//samekhdageshhebrew;FB41 +//samekhhebrew;05E1 +//saraaathai;0E32 +//saraaethai;0E41 +//saraaimaimalaithai;0E44 +//saraaimaimuanthai;0E43 +//saraamthai;0E33 +//saraathai;0E30 +//saraethai;0E40 +//saraiileftthai;F886 +//saraiithai;0E35 +//saraileftthai;F885 +//saraithai;0E34 +//saraothai;0E42 +//saraueeleftthai;F888 +//saraueethai;0E37 +//saraueleftthai;F887 +//sarauethai;0E36 +//sarauthai;0E38 +//sarauuthai;0E39 +//sbopomofo;3119 +//scaron;0161 +//scarondotaccent;1E67 +//scedilla;015F +//schwa;0259 +//schwacyrillic;04D9 +//schwadieresiscyrillic;04DB +//schwahook;025A +//scircle;24E2 +//scircumflex;015D +//scommaaccent;0219 +//sdotaccent;1E61 +//sdotbelow;1E63 +//sdotbelowdotaccent;1E69 +//seagullbelowcmb;033C +//second;2033 +//secondtonechinese;02CA +//section;00A7 +//seenarabic;0633 +//seenfinalarabic;FEB2 +//seeninitialarabic;FEB3 +//seenmedialarabic;FEB4 +//segol;05B6 +//segol13;05B6 +//segol1f;05B6 +//segol2c;05B6 +//segolhebrew;05B6 +//segolnarrowhebrew;05B6 +//segolquarterhebrew;05B6 +//segoltahebrew;0592 +//segolwidehebrew;05B6 +//seharmenian;057D +//sehiragana;305B +//sekatakana;30BB +//sekatakanahalfwidth;FF7E +//semicolon;003B +//semicolonarabic;061B +//semicolonmonospace;FF1B +//semicolonsmall;FE54 +//semivoicedmarkkana;309C +//semivoicedmarkkanahalfwidth;FF9F +//sentisquare;3322 +//sentosquare;3323 +//seven;0037 +//sevenarabic;0667 +//sevenbengali;09ED +//sevencircle;2466 +//sevencircleinversesansserif;2790 +//sevendeva;096D +//seveneighths;215E +//sevengujarati;0AED +//sevengurmukhi;0A6D +//sevenhackarabic;0667 +//sevenhangzhou;3027 +//sevenideographicparen;3226 +//seveninferior;2087 +//sevenmonospace;FF17 +//sevenoldstyle;F737 +//sevenparen;247A +//sevenperiod;248E +//sevenpersian;06F7 +//sevenroman;2176 +//sevensuperior;2077 +//seventeencircle;2470 +//seventeenparen;2484 +//seventeenperiod;2498 +//seventhai;0E57 +//sfthyphen;00AD +//shaarmenian;0577 +//shabengali;09B6 +//shacyrillic;0448 +//shaddaarabic;0651 +//shaddadammaarabic;FC61 +//shaddadammatanarabic;FC5E +//shaddafathaarabic;FC60 +//shaddafathatanarabic;0651 064B +//shaddakasraarabic;FC62 +//shaddakasratanarabic;FC5F +//shade;2592 +//shadedark;2593 +//shadelight;2591 +//shademedium;2592 +//shadeva;0936 +//shagujarati;0AB6 +//shagurmukhi;0A36 +//shalshelethebrew;0593 +//shbopomofo;3115 +//shchacyrillic;0449 +//sheenarabic;0634 +//sheenfinalarabic;FEB6 +//sheeninitialarabic;FEB7 +//sheenmedialarabic;FEB8 +//sheicoptic;03E3 +//sheqel;20AA +//sheqelhebrew;20AA +//sheva;05B0 +//sheva115;05B0 +//sheva15;05B0 +//sheva22;05B0 +//sheva2e;05B0 +//shevahebrew;05B0 +//shevanarrowhebrew;05B0 +//shevaquarterhebrew;05B0 +//shevawidehebrew;05B0 +//shhacyrillic;04BB +//shimacoptic;03ED +//shin;05E9 +//shindagesh;FB49 +//shindageshhebrew;FB49 +//shindageshshindot;FB2C +//shindageshshindothebrew;FB2C +//shindageshsindot;FB2D +//shindageshsindothebrew;FB2D +//shindothebrew;05C1 +//shinhebrew;05E9 +//shinshindot;FB2A +//shinshindothebrew;FB2A +//shinsindot;FB2B +//shinsindothebrew;FB2B +//shook;0282 +//sigma;03C3 +//sigma1;03C2 +//sigmafinal;03C2 +//sigmalunatesymbolgreek;03F2 +//sihiragana;3057 +//sikatakana;30B7 +//sikatakanahalfwidth;FF7C +//siluqhebrew;05BD +//siluqlefthebrew;05BD +//similar;223C +//sindothebrew;05C2 +//siosacirclekorean;3274 +//siosaparenkorean;3214 +//sioscieuckorean;317E +//sioscirclekorean;3266 +//sioskiyeokkorean;317A +//sioskorean;3145 +//siosnieunkorean;317B +//siosparenkorean;3206 +//siospieupkorean;317D +//siostikeutkorean;317C +//six;0036 +//sixarabic;0666 +//sixbengali;09EC +//sixcircle;2465 +//sixcircleinversesansserif;278F +//sixdeva;096C +//sixgujarati;0AEC +//sixgurmukhi;0A6C +//sixhackarabic;0666 +//sixhangzhou;3026 +//sixideographicparen;3225 +//sixinferior;2086 +//sixmonospace;FF16 +//sixoldstyle;F736 +//sixparen;2479 +//sixperiod;248D +//sixpersian;06F6 +//sixroman;2175 +//sixsuperior;2076 +//sixteencircle;246F +//sixteencurrencydenominatorbengali;09F9 +//sixteenparen;2483 +//sixteenperiod;2497 +//sixthai;0E56 +//slash;002F +//slashmonospace;FF0F +//slong;017F +//slongdotaccent;1E9B +//smileface;263A +//smonospace;FF53 +//sofpasuqhebrew;05C3 +//softhyphen;00AD +//softsigncyrillic;044C +//sohiragana;305D +//sokatakana;30BD +//sokatakanahalfwidth;FF7F +//soliduslongoverlaycmb;0338 +//solidusshortoverlaycmb;0337 +//sorusithai;0E29 +//sosalathai;0E28 +//sosothai;0E0B +//sosuathai;0E2A +//space;0020 +//spacehackarabic;0020 +//spade;2660 +//spadesuitblack;2660 +//spadesuitwhite;2664 +//sparen;24AE +//squarebelowcmb;033B +//squarecc;33C4 +//squarecm;339D +//squarediagonalcrosshatchfill;25A9 +//squarehorizontalfill;25A4 +//squarekg;338F +//squarekm;339E +//squarekmcapital;33CE +//squareln;33D1 +//squarelog;33D2 +//squaremg;338E +//squaremil;33D5 +//squaremm;339C +//squaremsquared;33A1 +//squareorthogonalcrosshatchfill;25A6 +//squareupperlefttolowerrightfill;25A7 +//squareupperrighttolowerleftfill;25A8 +//squareverticalfill;25A5 +//squarewhitewithsmallblack;25A3 +//srsquare;33DB +//ssabengali;09B7 +//ssadeva;0937 +//ssagujarati;0AB7 +//ssangcieuckorean;3149 +//ssanghieuhkorean;3185 +//ssangieungkorean;3180 +//ssangkiyeokkorean;3132 +//ssangnieunkorean;3165 +//ssangpieupkorean;3143 +//ssangsioskorean;3146 +//ssangtikeutkorean;3138 +//ssuperior;F6F2 +//sterling;00A3 +//sterlingmonospace;FFE1 +//strokelongoverlaycmb;0336 +//strokeshortoverlaycmb;0335 +//subset;2282 +//subsetnotequal;228A +//subsetorequal;2286 +//succeeds;227B +//suchthat;220B +//suhiragana;3059 +//sukatakana;30B9 +//sukatakanahalfwidth;FF7D +//sukunarabic;0652 +//summation;2211 +//sun;263C +//superset;2283 +//supersetnotequal;228B +//supersetorequal;2287 +//svsquare;33DC +//syouwaerasquare;337C +//t;0074 +//tabengali;09A4 +//tackdown;22A4 +//tackleft;22A3 +//tadeva;0924 +//tagujarati;0AA4 +//tagurmukhi;0A24 +//taharabic;0637 +//tahfinalarabic;FEC2 +//tahinitialarabic;FEC3 +//tahiragana;305F +//tahmedialarabic;FEC4 +//taisyouerasquare;337D +//takatakana;30BF +//takatakanahalfwidth;FF80 +//tatweelarabic;0640 +//tau;03C4 +//tav;05EA +//tavdages;FB4A +//tavdagesh;FB4A +//tavdageshhebrew;FB4A +//tavhebrew;05EA +//tbar;0167 +//tbopomofo;310A +//tcaron;0165 +//tccurl;02A8 +//tcedilla;0163 +//tcheharabic;0686 +//tchehfinalarabic;FB7B +//tchehinitialarabic;FB7C +//tchehmedialarabic;FB7D +//tchehmeeminitialarabic;FB7C FEE4 +//tcircle;24E3 +//tcircumflexbelow;1E71 +//tcommaaccent;0163 +//tdieresis;1E97 +//tdotaccent;1E6B +//tdotbelow;1E6D +//tecyrillic;0442 +//tedescendercyrillic;04AD +//teharabic;062A +//tehfinalarabic;FE96 +//tehhahinitialarabic;FCA2 +//tehhahisolatedarabic;FC0C +//tehinitialarabic;FE97 +//tehiragana;3066 +//tehjeeminitialarabic;FCA1 +//tehjeemisolatedarabic;FC0B +//tehmarbutaarabic;0629 +//tehmarbutafinalarabic;FE94 +//tehmedialarabic;FE98 +//tehmeeminitialarabic;FCA4 +//tehmeemisolatedarabic;FC0E +//tehnoonfinalarabic;FC73 +//tekatakana;30C6 +//tekatakanahalfwidth;FF83 +//telephone;2121 +//telephoneblack;260E +//telishagedolahebrew;05A0 +//telishaqetanahebrew;05A9 +//tencircle;2469 +//tenideographicparen;3229 +//tenparen;247D +//tenperiod;2491 +//tenroman;2179 +//tesh;02A7 +//tet;05D8 +//tetdagesh;FB38 +//tetdageshhebrew;FB38 +//tethebrew;05D8 +//tetsecyrillic;04B5 +//tevirhebrew;059B +//tevirlefthebrew;059B +//thabengali;09A5 +//thadeva;0925 +//thagujarati;0AA5 +//thagurmukhi;0A25 +//thalarabic;0630 +//thalfinalarabic;FEAC +//thanthakhatlowleftthai;F898 +//thanthakhatlowrightthai;F897 +//thanthakhatthai;0E4C +//thanthakhatupperleftthai;F896 +//theharabic;062B +//thehfinalarabic;FE9A +//thehinitialarabic;FE9B +//thehmedialarabic;FE9C +//thereexists;2203 +//therefore;2234 +//theta;03B8 +//theta1;03D1 +//thetasymbolgreek;03D1 +//thieuthacirclekorean;3279 +//thieuthaparenkorean;3219 +//thieuthcirclekorean;326B +//thieuthkorean;314C +//thieuthparenkorean;320B +//thirteencircle;246C +//thirteenparen;2480 +//thirteenperiod;2494 +//thonangmonthothai;0E11 +//thook;01AD +//thophuthaothai;0E12 +//thorn;00FE +//thothahanthai;0E17 +//thothanthai;0E10 +//thothongthai;0E18 +//thothungthai;0E16 +//thousandcyrillic;0482 +//thousandsseparatorarabic;066C +//thousandsseparatorpersian;066C +//three;0033 +//threearabic;0663 +//threebengali;09E9 +//threecircle;2462 +//threecircleinversesansserif;278C +//threedeva;0969 +//threeeighths;215C +//threegujarati;0AE9 +//threegurmukhi;0A69 +//threehackarabic;0663 +//threehangzhou;3023 +//threeideographicparen;3222 +//threeinferior;2083 +//threemonospace;FF13 +//threenumeratorbengali;09F6 +//threeoldstyle;F733 +//threeparen;2476 +//threeperiod;248A +//threepersian;06F3 +//threequarters;00BE +//threequartersemdash;F6DE +//threeroman;2172 +//threesuperior;00B3 +//threethai;0E53 +//thzsquare;3394 +//tihiragana;3061 +//tikatakana;30C1 +//tikatakanahalfwidth;FF81 +//tikeutacirclekorean;3270 +//tikeutaparenkorean;3210 +//tikeutcirclekorean;3262 +//tikeutkorean;3137 +//tikeutparenkorean;3202 +//tilde;02DC +//tildebelowcmb;0330 +//tildecmb;0303 +//tildecomb;0303 +//tildedoublecmb;0360 +//tildeoperator;223C +//tildeoverlaycmb;0334 +//tildeverticalcmb;033E +//timescircle;2297 +//tipehahebrew;0596 +//tipehalefthebrew;0596 +//tippigurmukhi;0A70 +//titlocyrilliccmb;0483 +//tiwnarmenian;057F +//tlinebelow;1E6F +//tmonospace;FF54 +//toarmenian;0569 +//tohiragana;3068 +//tokatakana;30C8 +//tokatakanahalfwidth;FF84 +//tonebarextrahighmod;02E5 +//tonebarextralowmod;02E9 +//tonebarhighmod;02E6 +//tonebarlowmod;02E8 +//tonebarmidmod;02E7 +//tonefive;01BD +//tonesix;0185 +//tonetwo;01A8 +//tonos;0384 +//tonsquare;3327 +//topatakthai;0E0F +//tortoiseshellbracketleft;3014 +//tortoiseshellbracketleftsmall;FE5D +//tortoiseshellbracketleftvertical;FE39 +//tortoiseshellbracketright;3015 +//tortoiseshellbracketrightsmall;FE5E +//tortoiseshellbracketrightvertical;FE3A +//totaothai;0E15 +//tpalatalhook;01AB +//tparen;24AF +//trademark;2122 +//trademarksans;F8EA +//trademarkserif;F6DB +//tretroflexhook;0288 +//triagdn;25BC +//triaglf;25C4 +//triagrt;25BA +//triagup;25B2 +//ts;02A6 +//tsadi;05E6 +//tsadidagesh;FB46 +//tsadidageshhebrew;FB46 +//tsadihebrew;05E6 +//tsecyrillic;0446 +//tsere;05B5 +//tsere12;05B5 +//tsere1e;05B5 +//tsere2b;05B5 +//tserehebrew;05B5 +//tserenarrowhebrew;05B5 +//tserequarterhebrew;05B5 +//tserewidehebrew;05B5 +//tshecyrillic;045B +//tsuperior;F6F3 +//ttabengali;099F +//ttadeva;091F +//ttagujarati;0A9F +//ttagurmukhi;0A1F +//tteharabic;0679 +//ttehfinalarabic;FB67 +//ttehinitialarabic;FB68 +//ttehmedialarabic;FB69 +//tthabengali;09A0 +//tthadeva;0920 +//tthagujarati;0AA0 +//tthagurmukhi;0A20 +//tturned;0287 +//tuhiragana;3064 +//tukatakana;30C4 +//tukatakanahalfwidth;FF82 +//tusmallhiragana;3063 +//tusmallkatakana;30C3 +//tusmallkatakanahalfwidth;FF6F +//twelvecircle;246B +//twelveparen;247F +//twelveperiod;2493 +//twelveroman;217B +//twentycircle;2473 +//twentyhangzhou;5344 +//twentyparen;2487 +//twentyperiod;249B +//two;0032 +//twoarabic;0662 +//twobengali;09E8 +//twocircle;2461 +//twocircleinversesansserif;278B +//twodeva;0968 +//twodotenleader;2025 +//twodotleader;2025 +//twodotleadervertical;FE30 +//twogujarati;0AE8 +//twogurmukhi;0A68 +//twohackarabic;0662 +//twohangzhou;3022 +//twoideographicparen;3221 +//twoinferior;2082 +//twomonospace;FF12 +//twonumeratorbengali;09F5 +//twooldstyle;F732 +//twoparen;2475 +//twoperiod;2489 +//twopersian;06F2 +//tworoman;2171 +//twostroke;01BB +//twosuperior;00B2 +//twothai;0E52 +//twothirds;2154 +//u;0075 +//uacute;00FA +//ubar;0289 +//ubengali;0989 +//ubopomofo;3128 +//ubreve;016D +//ucaron;01D4 +//ucircle;24E4 +//ucircumflex;00FB +//ucircumflexbelow;1E77 +//ucyrillic;0443 +//udattadeva;0951 +//udblacute;0171 +//udblgrave;0215 +//udeva;0909 +//udieresis;00FC +//udieresisacute;01D8 +//udieresisbelow;1E73 +//udieresiscaron;01DA +//udieresiscyrillic;04F1 +//udieresisgrave;01DC +//udieresismacron;01D6 +//udotbelow;1EE5 +//ugrave;00F9 +//ugujarati;0A89 +//ugurmukhi;0A09 +//uhiragana;3046 +//uhookabove;1EE7 +//uhorn;01B0 +//uhornacute;1EE9 +//uhorndotbelow;1EF1 +//uhorngrave;1EEB +//uhornhookabove;1EED +//uhorntilde;1EEF +//uhungarumlaut;0171 +//uhungarumlautcyrillic;04F3 +//uinvertedbreve;0217 +//ukatakana;30A6 +//ukatakanahalfwidth;FF73 +//ukcyrillic;0479 +//ukorean;315C +//umacron;016B +//umacroncyrillic;04EF +//umacrondieresis;1E7B +//umatragurmukhi;0A41 +//umonospace;FF55 +//underscore;005F +//underscoredbl;2017 +//underscoremonospace;FF3F +//underscorevertical;FE33 +//underscorewavy;FE4F +//union;222A +//universal;2200 +//uogonek;0173 +//uparen;24B0 +//upblock;2580 +//upperdothebrew;05C4 +//upsilon;03C5 +//upsilondieresis;03CB +//upsilondieresistonos;03B0 +//upsilonlatin;028A +//upsilontonos;03CD +//uptackbelowcmb;031D +//uptackmod;02D4 +//uragurmukhi;0A73 +//uring;016F +//ushortcyrillic;045E +//usmallhiragana;3045 +//usmallkatakana;30A5 +//usmallkatakanahalfwidth;FF69 +//ustraightcyrillic;04AF +//ustraightstrokecyrillic;04B1 +//utilde;0169 +//utildeacute;1E79 +//utildebelow;1E75 +//uubengali;098A +//uudeva;090A +//uugujarati;0A8A +//uugurmukhi;0A0A +//uumatragurmukhi;0A42 +//uuvowelsignbengali;09C2 +//uuvowelsigndeva;0942 +//uuvowelsigngujarati;0AC2 +//uvowelsignbengali;09C1 +//uvowelsigndeva;0941 +//uvowelsigngujarati;0AC1 +//v;0076 +//vadeva;0935 +//vagujarati;0AB5 +//vagurmukhi;0A35 +//vakatakana;30F7 +//vav;05D5 +//vavdagesh;FB35 +//vavdagesh65;FB35 +//vavdageshhebrew;FB35 +//vavhebrew;05D5 +//vavholam;FB4B +//vavholamhebrew;FB4B +//vavvavhebrew;05F0 +//vavyodhebrew;05F1 +//vcircle;24E5 +//vdotbelow;1E7F +//vecyrillic;0432 +//veharabic;06A4 +//vehfinalarabic;FB6B +//vehinitialarabic;FB6C +//vehmedialarabic;FB6D +//vekatakana;30F9 +//venus;2640 +//verticalbar;007C +//verticallineabovecmb;030D +//verticallinebelowcmb;0329 +//verticallinelowmod;02CC +//verticallinemod;02C8 +//vewarmenian;057E +//vhook;028B +//vikatakana;30F8 +//viramabengali;09CD +//viramadeva;094D +//viramagujarati;0ACD +//visargabengali;0983 +//visargadeva;0903 +//visargagujarati;0A83 +//vmonospace;FF56 +//voarmenian;0578 +//voicediterationhiragana;309E +//voicediterationkatakana;30FE +//voicedmarkkana;309B +//voicedmarkkanahalfwidth;FF9E +//vokatakana;30FA +//vparen;24B1 +//vtilde;1E7D +//vturned;028C +//vuhiragana;3094 +//vukatakana;30F4 +//w;0077 +//wacute;1E83 +//waekorean;3159 +//wahiragana;308F +//wakatakana;30EF +//wakatakanahalfwidth;FF9C +//wakorean;3158 +//wasmallhiragana;308E +//wasmallkatakana;30EE +//wattosquare;3357 +//wavedash;301C +//wavyunderscorevertical;FE34 +//wawarabic;0648 +//wawfinalarabic;FEEE +//wawhamzaabovearabic;0624 +//wawhamzaabovefinalarabic;FE86 +//wbsquare;33DD +//wcircle;24E6 +//wcircumflex;0175 +//wdieresis;1E85 +//wdotaccent;1E87 +//wdotbelow;1E89 +//wehiragana;3091 +//weierstrass;2118 +//wekatakana;30F1 +//wekorean;315E +//weokorean;315D +//wgrave;1E81 +//whitebullet;25E6 +//whitecircle;25CB +//whitecircleinverse;25D9 +//whitecornerbracketleft;300E +//whitecornerbracketleftvertical;FE43 +//whitecornerbracketright;300F +//whitecornerbracketrightvertical;FE44 +//whitediamond;25C7 +//whitediamondcontainingblacksmalldiamond;25C8 +//whitedownpointingsmalltriangle;25BF +//whitedownpointingtriangle;25BD +//whiteleftpointingsmalltriangle;25C3 +//whiteleftpointingtriangle;25C1 +//whitelenticularbracketleft;3016 +//whitelenticularbracketright;3017 +//whiterightpointingsmalltriangle;25B9 +//whiterightpointingtriangle;25B7 +//whitesmallsquare;25AB +//whitesmilingface;263A +//whitesquare;25A1 +//whitestar;2606 +//whitetelephone;260F +//whitetortoiseshellbracketleft;3018 +//whitetortoiseshellbracketright;3019 +//whiteuppointingsmalltriangle;25B5 +//whiteuppointingtriangle;25B3 +//wihiragana;3090 +//wikatakana;30F0 +//wikorean;315F +//wmonospace;FF57 +//wohiragana;3092 +//wokatakana;30F2 +//wokatakanahalfwidth;FF66 +//won;20A9 +//wonmonospace;FFE6 +//wowaenthai;0E27 +//wparen;24B2 +//wring;1E98 +//wsuperior;02B7 +//wturned;028D +//wynn;01BF +//x;0078 +//xabovecmb;033D +//xbopomofo;3112 +//xcircle;24E7 +//xdieresis;1E8D +//xdotaccent;1E8B +//xeharmenian;056D +//xi;03BE +//xmonospace;FF58 +//xparen;24B3 +//xsuperior;02E3 +//y;0079 +//yaadosquare;334E +//yabengali;09AF +//yacute;00FD +//yadeva;092F +//yaekorean;3152 +//yagujarati;0AAF +//yagurmukhi;0A2F +//yahiragana;3084 +//yakatakana;30E4 +//yakatakanahalfwidth;FF94 +//yakorean;3151 +//yamakkanthai;0E4E +//yasmallhiragana;3083 +//yasmallkatakana;30E3 +//yasmallkatakanahalfwidth;FF6C +//yatcyrillic;0463 +//ycircle;24E8 +//ycircumflex;0177 +//ydieresis;00FF +//ydotaccent;1E8F +//ydotbelow;1EF5 +//yeharabic;064A +//yehbarreearabic;06D2 +//yehbarreefinalarabic;FBAF +//yehfinalarabic;FEF2 +//yehhamzaabovearabic;0626 +//yehhamzaabovefinalarabic;FE8A +//yehhamzaaboveinitialarabic;FE8B +//yehhamzaabovemedialarabic;FE8C +//yehinitialarabic;FEF3 +//yehmedialarabic;FEF4 +//yehmeeminitialarabic;FCDD +//yehmeemisolatedarabic;FC58 +//yehnoonfinalarabic;FC94 +//yehthreedotsbelowarabic;06D1 +//yekorean;3156 +//yen;00A5 +//yenmonospace;FFE5 +//yeokorean;3155 +//yeorinhieuhkorean;3186 +//yerahbenyomohebrew;05AA +//yerahbenyomolefthebrew;05AA +//yericyrillic;044B +//yerudieresiscyrillic;04F9 +//yesieungkorean;3181 +//yesieungpansioskorean;3183 +//yesieungsioskorean;3182 +//yetivhebrew;059A +//ygrave;1EF3 +//yhook;01B4 +//yhookabove;1EF7 +//yiarmenian;0575 +//yicyrillic;0457 +//yikorean;3162 +//yinyang;262F +//yiwnarmenian;0582 +//ymonospace;FF59 +//yod;05D9 +//yoddagesh;FB39 +//yoddageshhebrew;FB39 +//yodhebrew;05D9 +//yodyodhebrew;05F2 +//yodyodpatahhebrew;FB1F +//yohiragana;3088 +//yoikorean;3189 +//yokatakana;30E8 +//yokatakanahalfwidth;FF96 +//yokorean;315B +//yosmallhiragana;3087 +//yosmallkatakana;30E7 +//yosmallkatakanahalfwidth;FF6E +//yotgreek;03F3 +//yoyaekorean;3188 +//yoyakorean;3187 +//yoyakthai;0E22 +//yoyingthai;0E0D +//yparen;24B4 +//ypogegrammeni;037A +//ypogegrammenigreekcmb;0345 +//yr;01A6 +//yring;1E99 +//ysuperior;02B8 +//ytilde;1EF9 +//yturned;028E +//yuhiragana;3086 +//yuikorean;318C +//yukatakana;30E6 +//yukatakanahalfwidth;FF95 +//yukorean;3160 +//yusbigcyrillic;046B +//yusbigiotifiedcyrillic;046D +//yuslittlecyrillic;0467 +//yuslittleiotifiedcyrillic;0469 +//yusmallhiragana;3085 +//yusmallkatakana;30E5 +//yusmallkatakanahalfwidth;FF6D +//yuyekorean;318B +//yuyeokorean;318A +//yyabengali;09DF +//yyadeva;095F +//z;007A +//zaarmenian;0566 +//zacute;017A +//zadeva;095B +//zagurmukhi;0A5B +//zaharabic;0638 +//zahfinalarabic;FEC6 +//zahinitialarabic;FEC7 +//zahiragana;3056 +//zahmedialarabic;FEC8 +//zainarabic;0632 +//zainfinalarabic;FEB0 +//zakatakana;30B6 +//zaqefgadolhebrew;0595 +//zaqefqatanhebrew;0594 +//zarqahebrew;0598 +//zayin;05D6 +//zayindagesh;FB36 +//zayindageshhebrew;FB36 +//zayinhebrew;05D6 +//zbopomofo;3117 +//zcaron;017E +//zcircle;24E9 +//zcircumflex;1E91 +//zcurl;0291 +//zdot;017C +//zdotaccent;017C +//zdotbelow;1E93 +//zecyrillic;0437 +//zedescendercyrillic;0499 +//zedieresiscyrillic;04DF +//zehiragana;305C +//zekatakana;30BC +//zero;0030 +//zeroarabic;0660 +//zerobengali;09E6 +//zerodeva;0966 +//zerogujarati;0AE6 +//zerogurmukhi;0A66 +//zerohackarabic;0660 +//zeroinferior;2080 +//zeromonospace;FF10 +//zerooldstyle;F730 +//zeropersian;06F0 +//zerosuperior;2070 +//zerothai;0E50 +//zerowidthjoiner;FEFF +//zerowidthnonjoiner;200C +//zerowidthspace;200B +//zeta;03B6 +//zhbopomofo;3113 +//zhearmenian;056A +//zhebrevecyrillic;04C2 +//zhecyrillic;0436 +//zhedescendercyrillic;0497 +//zhedieresiscyrillic;04DD +//zihiragana;3058 +//zikatakana;30B8 +//zinorhebrew;05AE +//zlinebelow;1E95 +//zmonospace;FF5A +//zohiragana;305E +//zokatakana;30BE +//zparen;24B5 +//zretroflexhook;0290 +//zstroke;01B6 +//zuhiragana;305A +//zukatakana;30BA + + } +} +#endif \ No newline at end of file diff --git a/PdfSharp/Fonts/AdobeGlyphListForNewFonts.cs b/PdfSharp/Fonts/AdobeGlyphListForNewFonts.cs new file mode 100644 index 0000000..7ff6283 --- /dev/null +++ b/PdfSharp/Fonts/AdobeGlyphListForNewFonts.cs @@ -0,0 +1,4223 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Fonts +{ +#if true_ +#if !SILVERLIGHT + /// + /// Testing only + /// + public sealed class AdobeGlyphListForNewFonts + { + AdobeGlyphListForNewFonts() { } + + // ReSharper disable InconsistentNaming + + /// + /// LATIN CAPITAL LETTER A + /// + public const char A = '\u0041'; + + /// + /// LATIN CAPITAL LETTER AE + /// + public const char AE = '\u00C6'; + + /// + /// LATIN CAPITAL LETTER AE WITH ACUTE + /// + public const char AEacute = '\u01FC'; + + /// + /// LATIN CAPITAL LETTER A WITH ACUTE + /// + public const char Aacute = '\u00C1'; + + /// + /// LATIN CAPITAL LETTER A WITH BREVE + /// + public const char Abreve = '\u0102'; + + /// + /// LATIN CAPITAL LETTER A WITH CIRCUMFLEX + /// + public const char Acircumflex = '\u00C2'; + + /// + /// LATIN CAPITAL LETTER A WITH DIAERESIS + /// + public const char Adieresis = '\u00C4'; + + /// + /// LATIN CAPITAL LETTER A WITH GRAVE + /// + public const char Agrave = '\u00C0'; + + /// + /// GREEK CAPITAL LETTER ALPHA + /// + public const char Alpha = '\u0391'; + + /// + /// GREEK CAPITAL LETTER ALPHA WITH TONOS + /// + public const char Alphatonos = '\u0386'; + + /// + /// LATIN CAPITAL LETTER A WITH MACRON + /// + public const char Amacron = '\u0100'; + + /// + /// LATIN CAPITAL LETTER A WITH OGONEK + /// + public const char Aogonek = '\u0104'; + + /// + /// LATIN CAPITAL LETTER A WITH RING ABOVE + /// + public const char Aring = '\u00C5'; + + /// + /// LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE + /// + public const char Aringacute = '\u01FA'; + + /// + /// LATIN CAPITAL LETTER A WITH TILDE + /// + public const char Atilde = '\u00C3'; + + /// + /// LATIN CAPITAL LETTER B + /// + public const char B = '\u0042'; + + /// + /// GREEK CAPITAL LETTER BETA + /// + public const char Beta = '\u0392'; + + /// + /// LATIN CAPITAL LETTER C + /// + public const char C = '\u0043'; + + /// + /// LATIN CAPITAL LETTER C WITH ACUTE + /// + public const char Cacute = '\u0106'; + + /// + /// LATIN CAPITAL LETTER C WITH CARON + /// + public const char Ccaron = '\u010C'; + + /// + /// LATIN CAPITAL LETTER C WITH CEDILLA + /// + public const char Ccedilla = '\u00C7'; + + /// + /// LATIN CAPITAL LETTER C WITH CIRCUMFLEX + /// + public const char Ccircumflex = '\u0108'; + + /// + /// LATIN CAPITAL LETTER C WITH DOT ABOVE + /// + public const char Cdotaccent = '\u010A'; + + /// + /// GREEK CAPITAL LETTER CHI + /// + public const char Chi = '\u03A7'; + + /// + /// LATIN CAPITAL LETTER D + /// + public const char D = '\u0044'; + + /// + /// LATIN CAPITAL LETTER D WITH CARON + /// + public const char Dcaron = '\u010E'; + + /// + /// LATIN CAPITAL LETTER D WITH STROKE + /// + public const char Dcroat = '\u0110'; + + /// + /// INCREMENT + /// + public const char Delta = '\u2206'; + + /// + /// LATIN CAPITAL LETTER E + /// + public const char E = '\u0045'; + + /// + /// LATIN CAPITAL LETTER E WITH ACUTE + /// + public const char Eacute = '\u00C9'; + + /// + /// LATIN CAPITAL LETTER E WITH BREVE + /// + public const char Ebreve = '\u0114'; + + /// + /// LATIN CAPITAL LETTER E WITH CARON + /// + public const char Ecaron = '\u011A'; + + /// + /// LATIN CAPITAL LETTER E WITH CIRCUMFLEX + /// + public const char Ecircumflex = '\u00CA'; + + /// + /// LATIN CAPITAL LETTER E WITH DIAERESIS + /// + public const char Edieresis = '\u00CB'; + + /// + /// LATIN CAPITAL LETTER E WITH DOT ABOVE + /// + public const char Edotaccent = '\u0116'; + + /// + /// LATIN CAPITAL LETTER E WITH GRAVE + /// + public const char Egrave = '\u00C8'; + + /// + /// LATIN CAPITAL LETTER E WITH MACRON + /// + public const char Emacron = '\u0112'; + + /// + /// LATIN CAPITAL LETTER ENG + /// + public const char Eng = '\u014A'; + + /// + /// LATIN CAPITAL LETTER E WITH OGONEK + /// + public const char Eogonek = '\u0118'; + + /// + /// GREEK CAPITAL LETTER EPSILON + /// + public const char Epsilon = '\u0395'; + + /// + /// GREEK CAPITAL LETTER EPSILON WITH TONOS + /// + public const char Epsilontonos = '\u0388'; + + /// + /// GREEK CAPITAL LETTER ETA + /// + public const char Eta = '\u0397'; + + /// + /// GREEK CAPITAL LETTER ETA WITH TONOS + /// + public const char Etatonos = '\u0389'; + + /// + /// LATIN CAPITAL LETTER ETH + /// + public const char Eth = '\u00D0'; + + /// + /// EURO SIGN + /// + public const char Euro = '\u20AC'; + + /// + /// LATIN CAPITAL LETTER F + /// + public const char F = '\u0046'; + + /// + /// LATIN CAPITAL LETTER G + /// + public const char G = '\u0047'; + + /// + /// GREEK CAPITAL LETTER GAMMA + /// + public const char Gamma = '\u0393'; + + /// + /// LATIN CAPITAL LETTER G WITH BREVE + /// + public const char Gbreve = '\u011E'; + + /// + /// LATIN CAPITAL LETTER G WITH CARON + /// + public const char Gcaron = '\u01E6'; + + /// + /// LATIN CAPITAL LETTER G WITH CIRCUMFLEX + /// + public const char Gcircumflex = '\u011C'; + + /// + /// LATIN CAPITAL LETTER G WITH CEDILLA + /// + public const char Gcommaaccent = '\u0122'; + + /// + /// LATIN CAPITAL LETTER G WITH DOT ABOVE + /// + public const char Gdotaccent = '\u0120'; + + /// + /// LATIN CAPITAL LETTER H + /// + public const char H = '\u0048'; + + /// + /// BLACK CIRCLE + /// + public const char H18533 = '\u25CF'; + + /// + /// BLACK SMALL SQUARE + /// + public const char H18543 = '\u25AA'; + + /// + /// WHITE SMALL SQUARE + /// + public const char H18551 = '\u25AB'; + + /// + /// WHITE SQUARE + /// + public const char H22073 = '\u25A1'; + + /// + /// LATIN CAPITAL LETTER H WITH STROKE + /// + public const char Hbar = '\u0126'; + + /// + /// LATIN CAPITAL LETTER H WITH CIRCUMFLEX + /// + public const char Hcircumflex = '\u0124'; + + /// + /// LATIN CAPITAL LETTER I + /// + public const char I = '\u0049'; + + /// + /// LATIN CAPITAL LIGATURE IJ + /// + public const char IJ = '\u0132'; + + /// + /// LATIN CAPITAL LETTER I WITH ACUTE + /// + public const char Iacute = '\u00CD'; + + /// + /// LATIN CAPITAL LETTER I WITH BREVE + /// + public const char Ibreve = '\u012C'; + + /// + /// LATIN CAPITAL LETTER I WITH CIRCUMFLEX + /// + public const char Icircumflex = '\u00CE'; + + /// + /// LATIN CAPITAL LETTER I WITH DIAERESIS + /// + public const char Idieresis = '\u00CF'; + + /// + /// LATIN CAPITAL LETTER I WITH DOT ABOVE + /// + public const char Idotaccent = '\u0130'; + + /// + /// BLACK-LETTER CAPITAL I + /// + public const char Ifraktur = '\u2111'; + + /// + /// LATIN CAPITAL LETTER I WITH GRAVE + /// + public const char Igrave = '\u00CC'; + + /// + /// LATIN CAPITAL LETTER I WITH MACRON + /// + public const char Imacron = '\u012A'; + + /// + /// LATIN CAPITAL LETTER I WITH OGONEK + /// + public const char Iogonek = '\u012E'; + + /// + /// GREEK CAPITAL LETTER IOTA + /// + public const char Iota = '\u0399'; + + /// + /// GREEK CAPITAL LETTER IOTA WITH DIALYTIKA + /// + public const char Iotadieresis = '\u03AA'; + + /// + /// GREEK CAPITAL LETTER IOTA WITH TONOS + /// + public const char Iotatonos = '\u038A'; + + /// + /// LATIN CAPITAL LETTER I WITH TILDE + /// + public const char Itilde = '\u0128'; + + /// + /// LATIN CAPITAL LETTER J + /// + public const char J = '\u004A'; + + /// + /// LATIN CAPITAL LETTER J WITH CIRCUMFLEX + /// + public const char Jcircumflex = '\u0134'; + + /// + /// LATIN CAPITAL LETTER K + /// + public const char K = '\u004B'; + + /// + /// GREEK CAPITAL LETTER KAPPA + /// + public const char Kappa = '\u039A'; + + /// + /// LATIN CAPITAL LETTER K WITH CEDILLA + /// + public const char Kcommaaccent = '\u0136'; + + /// + /// LATIN CAPITAL LETTER L + /// + public const char L = '\u004C'; + + /// + /// LATIN CAPITAL LETTER L WITH ACUTE + /// + public const char Lacute = '\u0139'; + + /// + /// GREEK CAPITAL LETTER LAMDA + /// + public const char Lambda = '\u039B'; + + /// + /// LATIN CAPITAL LETTER L WITH CARON + /// + public const char Lcaron = '\u013D'; + + /// + /// LATIN CAPITAL LETTER L WITH CEDILLA + /// + public const char Lcommaaccent = '\u013B'; + + /// + /// LATIN CAPITAL LETTER L WITH MIDDLE DOT + /// + public const char Ldot = '\u013F'; + + /// + /// LATIN CAPITAL LETTER L WITH STROKE + /// + public const char Lslash = '\u0141'; + + /// + /// LATIN CAPITAL LETTER M + /// + public const char M = '\u004D'; + + /// + /// GREEK CAPITAL LETTER MU + /// + public const char Mu = '\u039C'; + + /// + /// LATIN CAPITAL LETTER N + /// + public const char N = '\u004E'; + + /// + /// LATIN CAPITAL LETTER N WITH ACUTE + /// + public const char Nacute = '\u0143'; + + /// + /// LATIN CAPITAL LETTER N WITH CARON + /// + public const char Ncaron = '\u0147'; + + /// + /// LATIN CAPITAL LETTER N WITH CEDILLA + /// + public const char Ncommaaccent = '\u0145'; + + /// + /// LATIN CAPITAL LETTER N WITH TILDE + /// + public const char Ntilde = '\u00D1'; + + /// + /// GREEK CAPITAL LETTER NU + /// + public const char Nu = '\u039D'; + + /// + /// LATIN CAPITAL LETTER O + /// + public const char O = '\u004F'; + + /// + /// LATIN CAPITAL LIGATURE OE + /// + public const char OE = '\u0152'; + + /// + /// LATIN CAPITAL LETTER O WITH ACUTE + /// + public const char Oacute = '\u00D3'; + + /// + /// LATIN CAPITAL LETTER O WITH BREVE + /// + public const char Obreve = '\u014E'; + + /// + /// LATIN CAPITAL LETTER O WITH CIRCUMFLEX + /// + public const char Ocircumflex = '\u00D4'; + + /// + /// LATIN CAPITAL LETTER O WITH DIAERESIS + /// + public const char Odieresis = '\u00D6'; + + /// + /// LATIN CAPITAL LETTER O WITH GRAVE + /// + public const char Ograve = '\u00D2'; + + /// + /// LATIN CAPITAL LETTER O WITH HORN + /// + public const char Ohorn = '\u01A0'; + + /// + /// LATIN CAPITAL LETTER O WITH DOUBLE ACUTE + /// + public const char Ohungarumlaut = '\u0150'; + + /// + /// LATIN CAPITAL LETTER O WITH MACRON + /// + public const char Omacron = '\u014C'; + + /// + /// OHM SIGN + /// + public const char Omega = '\u2126'; + + /// + /// GREEK CAPITAL LETTER OMEGA WITH TONOS + /// + public const char Omegatonos = '\u038F'; + + /// + /// GREEK CAPITAL LETTER OMICRON + /// + public const char Omicron = '\u039F'; + + /// + /// GREEK CAPITAL LETTER OMICRON WITH TONOS + /// + public const char Omicrontonos = '\u038C'; + + /// + /// LATIN CAPITAL LETTER O WITH STROKE + /// + public const char Oslash = '\u00D8'; + + /// + /// LATIN CAPITAL LETTER O WITH STROKE AND ACUTE + /// + public const char Oslashacute = '\u01FE'; + + /// + /// LATIN CAPITAL LETTER O WITH TILDE + /// + public const char Otilde = '\u00D5'; + + /// + /// LATIN CAPITAL LETTER P + /// + public const char P = '\u0050'; + + /// + /// GREEK CAPITAL LETTER PHI + /// + public const char Phi = '\u03A6'; + + /// + /// GREEK CAPITAL LETTER PI + /// + public const char Pi = '\u03A0'; + + /// + /// GREEK CAPITAL LETTER PSI + /// + public const char Psi = '\u03A8'; + + /// + /// LATIN CAPITAL LETTER Q + /// + public const char Q = '\u0051'; + + /// + /// LATIN CAPITAL LETTER R + /// + public const char R = '\u0052'; + + /// + /// LATIN CAPITAL LETTER R WITH ACUTE + /// + public const char Racute = '\u0154'; + + /// + /// LATIN CAPITAL LETTER R WITH CARON + /// + public const char Rcaron = '\u0158'; + + /// + /// LATIN CAPITAL LETTER R WITH CEDILLA + /// + public const char Rcommaaccent = '\u0156'; + + /// + /// BLACK-LETTER CAPITAL R + /// + public const char Rfraktur = '\u211C'; + + /// + /// GREEK CAPITAL LETTER RHO + /// + public const char Rho = '\u03A1'; + + /// + /// LATIN CAPITAL LETTER S + /// + public const char S = '\u0053'; + + /// + /// BOX DRAWINGS LIGHT DOWN AND RIGHT + /// + public const char SF010000 = '\u250C'; + + /// + /// BOX DRAWINGS LIGHT UP AND RIGHT + /// + public const char SF020000 = '\u2514'; + + /// + /// BOX DRAWINGS LIGHT DOWN AND LEFT + /// + public const char SF030000 = '\u2510'; + + /// + /// BOX DRAWINGS LIGHT UP AND LEFT + /// + public const char SF040000 = '\u2518'; + + /// + /// BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL + /// + public const char SF050000 = '\u253C'; + + /// + /// BOX DRAWINGS LIGHT DOWN AND HORIZONTAL + /// + public const char SF060000 = '\u252C'; + + /// + /// BOX DRAWINGS LIGHT UP AND HORIZONTAL + /// + public const char SF070000 = '\u2534'; + + /// + /// BOX DRAWINGS LIGHT VERTICAL AND RIGHT + /// + public const char SF080000 = '\u251C'; + + /// + /// BOX DRAWINGS LIGHT VERTICAL AND LEFT + /// + public const char SF090000 = '\u2524'; + + /// + /// BOX DRAWINGS LIGHT HORIZONTAL + /// + public const char SF100000 = '\u2500'; + + /// + /// BOX DRAWINGS LIGHT VERTICAL + /// + public const char SF110000 = '\u2502'; + + /// + /// BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE + /// + public const char SF190000 = '\u2561'; + + /// + /// BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE + /// + public const char SF200000 = '\u2562'; + + /// + /// BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE + /// + public const char SF210000 = '\u2556'; + + /// + /// BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE + /// + public const char SF220000 = '\u2555'; + + /// + /// BOX DRAWINGS DOUBLE VERTICAL AND LEFT + /// + public const char SF230000 = '\u2563'; + + /// + /// BOX DRAWINGS DOUBLE VERTICAL + /// + public const char SF240000 = '\u2551'; + + /// + /// BOX DRAWINGS DOUBLE DOWN AND LEFT + /// + public const char SF250000 = '\u2557'; + + /// + /// BOX DRAWINGS DOUBLE UP AND LEFT + /// + public const char SF260000 = '\u255D'; + + /// + /// BOX DRAWINGS UP DOUBLE AND LEFT SINGLE + /// + public const char SF270000 = '\u255C'; + + /// + /// BOX DRAWINGS UP SINGLE AND LEFT DOUBLE + /// + public const char SF280000 = '\u255B'; + + /// + /// BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE + /// + public const char SF360000 = '\u255E'; + + /// + /// BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE + /// + public const char SF370000 = '\u255F'; + + /// + /// BOX DRAWINGS DOUBLE UP AND RIGHT + /// + public const char SF380000 = '\u255A'; + + /// + /// BOX DRAWINGS DOUBLE DOWN AND RIGHT + /// + public const char SF390000 = '\u2554'; + + /// + /// BOX DRAWINGS DOUBLE UP AND HORIZONTAL + /// + public const char SF400000 = '\u2569'; + + /// + /// BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL + /// + public const char SF410000 = '\u2566'; + + /// + /// BOX DRAWINGS DOUBLE VERTICAL AND RIGHT + /// + public const char SF420000 = '\u2560'; + + /// + /// BOX DRAWINGS DOUBLE HORIZONTAL + /// + public const char SF430000 = '\u2550'; + + /// + /// BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL + /// + public const char SF440000 = '\u256C'; + + /// + /// BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE + /// + public const char SF450000 = '\u2567'; + + /// + /// BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE + /// + public const char SF460000 = '\u2568'; + + /// + /// BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE + /// + public const char SF470000 = '\u2564'; + + /// + /// BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE + /// + public const char SF480000 = '\u2565'; + + /// + /// BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE + /// + public const char SF490000 = '\u2559'; + + /// + /// BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE + /// + public const char SF500000 = '\u2558'; + + /// + /// BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE + /// + public const char SF510000 = '\u2552'; + + /// + /// BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE + /// + public const char SF520000 = '\u2553'; + + /// + /// BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE + /// + public const char SF530000 = '\u256B'; + + /// + /// BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE + /// + public const char SF540000 = '\u256A'; + + /// + /// LATIN CAPITAL LETTER S WITH ACUTE + /// + public const char Sacute = '\u015A'; + + /// + /// LATIN CAPITAL LETTER S WITH CARON + /// + public const char Scaron = '\u0160'; + + /// + /// LATIN CAPITAL LETTER S WITH CEDILLA + /// + public const char Scedilla = '\u015E'; + + /// + /// LATIN CAPITAL LETTER S WITH CIRCUMFLEX + /// + public const char Scircumflex = '\u015C'; + + /// + /// LATIN CAPITAL LETTER S WITH COMMA BELOW + /// + public const char Scommaaccent = '\u0218'; + + /// + /// GREEK CAPITAL LETTER SIGMA + /// + public const char Sigma = '\u03A3'; + + /// + /// LATIN CAPITAL LETTER T + /// + public const char T = '\u0054'; + + /// + /// GREEK CAPITAL LETTER TAU + /// + public const char Tau = '\u03A4'; + + /// + /// LATIN CAPITAL LETTER T WITH STROKE + /// + public const char Tbar = '\u0166'; + + /// + /// LATIN CAPITAL LETTER T WITH CARON + /// + public const char Tcaron = '\u0164'; + + /// + /// LATIN CAPITAL LETTER T WITH CEDILLA + /// + public const char Tcommaaccent = '\u0162'; + + /// + /// GREEK CAPITAL LETTER THETA + /// + public const char Theta = '\u0398'; + + /// + /// LATIN CAPITAL LETTER THORN + /// + public const char Thorn = '\u00DE'; + + /// + /// LATIN CAPITAL LETTER U + /// + public const char U = '\u0055'; + + /// + /// LATIN CAPITAL LETTER U WITH ACUTE + /// + public const char Uacute = '\u00DA'; + + /// + /// LATIN CAPITAL LETTER U WITH BREVE + /// + public const char Ubreve = '\u016C'; + + /// + /// LATIN CAPITAL LETTER U WITH CIRCUMFLEX + /// + public const char Ucircumflex = '\u00DB'; + + /// + /// LATIN CAPITAL LETTER U WITH DIAERESIS + /// + public const char Udieresis = '\u00DC'; + + /// + /// LATIN CAPITAL LETTER U WITH GRAVE + /// + public const char Ugrave = '\u00D9'; + + /// + /// LATIN CAPITAL LETTER U WITH HORN + /// + public const char Uhorn = '\u01AF'; + + /// + /// LATIN CAPITAL LETTER U WITH DOUBLE ACUTE + /// + public const char Uhungarumlaut = '\u0170'; + + /// + /// LATIN CAPITAL LETTER U WITH MACRON + /// + public const char Umacron = '\u016A'; + + /// + /// LATIN CAPITAL LETTER U WITH OGONEK + /// + public const char Uogonek = '\u0172'; + + /// + /// GREEK CAPITAL LETTER UPSILON + /// + public const char Upsilon = '\u03A5'; + + /// + /// GREEK UPSILON WITH HOOK SYMBOL + /// + public const char Upsilon1 = '\u03D2'; + + /// + /// GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA + /// + public const char Upsilondieresis = '\u03AB'; + + /// + /// GREEK CAPITAL LETTER UPSILON WITH TONOS + /// + public const char Upsilontonos = '\u038E'; + + /// + /// LATIN CAPITAL LETTER U WITH RING ABOVE + /// + public const char Uring = '\u016E'; + + /// + /// LATIN CAPITAL LETTER U WITH TILDE + /// + public const char Utilde = '\u0168'; + + /// + /// LATIN CAPITAL LETTER V + /// + public const char V = '\u0056'; + + /// + /// LATIN CAPITAL LETTER W + /// + public const char W = '\u0057'; + + /// + /// LATIN CAPITAL LETTER W WITH ACUTE + /// + public const char Wacute = '\u1E82'; + + /// + /// LATIN CAPITAL LETTER W WITH CIRCUMFLEX + /// + public const char Wcircumflex = '\u0174'; + + /// + /// LATIN CAPITAL LETTER W WITH DIAERESIS + /// + public const char Wdieresis = '\u1E84'; + + /// + /// LATIN CAPITAL LETTER W WITH GRAVE + /// + public const char Wgrave = '\u1E80'; + + /// + /// LATIN CAPITAL LETTER X + /// + public const char X = '\u0058'; + + /// + /// GREEK CAPITAL LETTER XI + /// + public const char Xi = '\u039E'; + + /// + /// LATIN CAPITAL LETTER Y + /// + public const char Y = '\u0059'; + + /// + /// LATIN CAPITAL LETTER Y WITH ACUTE + /// + public const char Yacute = '\u00DD'; + + /// + /// LATIN CAPITAL LETTER Y WITH CIRCUMFLEX + /// + public const char Ycircumflex = '\u0176'; + + /// + /// LATIN CAPITAL LETTER Y WITH DIAERESIS + /// + public const char Ydieresis = '\u0178'; + + /// + /// LATIN CAPITAL LETTER Y WITH GRAVE + /// + public const char Ygrave = '\u1EF2'; + + /// + /// LATIN CAPITAL LETTER Z + /// + public const char Z = '\u005A'; + + /// + /// LATIN CAPITAL LETTER Z WITH ACUTE + /// + public const char Zacute = '\u0179'; + + /// + /// LATIN CAPITAL LETTER Z WITH CARON + /// + public const char Zcaron = '\u017D'; + + /// + /// LATIN CAPITAL LETTER Z WITH DOT ABOVE + /// + public const char Zdotaccent = '\u017B'; + + /// + /// GREEK CAPITAL LETTER ZETA + /// + public const char Zeta = '\u0396'; + + /// + /// LATIN SMALL LETTER A + /// + public const char a = '\u0061'; + + /// + /// LATIN SMALL LETTER A WITH ACUTE + /// + public const char aacute = '\u00E1'; + + /// + /// LATIN SMALL LETTER A WITH BREVE + /// + public const char abreve = '\u0103'; + + /// + /// LATIN SMALL LETTER A WITH CIRCUMFLEX + /// + public const char acircumflex = '\u00E2'; + + /// + /// ACUTE ACCENT + /// + public const char acute = '\u00B4'; + + /// + /// COMBINING ACUTE ACCENT + /// + public const char acutecomb = '\u0301'; + + /// + /// LATIN SMALL LETTER A WITH DIAERESIS + /// + public const char adieresis = '\u00E4'; + + /// + /// LATIN SMALL LETTER AE + /// + public const char ae = '\u00E6'; + + /// + /// LATIN SMALL LETTER AE WITH ACUTE + /// + public const char aeacute = '\u01FD'; + + /// + /// HORIZONTAL BAR + /// + public const char afii00208 = '\u2015'; + + /// + /// CYRILLIC CAPITAL LETTER A + /// + public const char afii10017 = '\u0410'; + + /// + /// CYRILLIC CAPITAL LETTER BE + /// + public const char afii10018 = '\u0411'; + + /// + /// CYRILLIC CAPITAL LETTER VE + /// + public const char afii10019 = '\u0412'; + + /// + /// CYRILLIC CAPITAL LETTER GHE + /// + public const char afii10020 = '\u0413'; + + /// + /// CYRILLIC CAPITAL LETTER DE + /// + public const char afii10021 = '\u0414'; + + /// + /// CYRILLIC CAPITAL LETTER IE + /// + public const char afii10022 = '\u0415'; + + /// + /// CYRILLIC CAPITAL LETTER IO + /// + public const char afii10023 = '\u0401'; + + /// + /// CYRILLIC CAPITAL LETTER ZHE + /// + public const char afii10024 = '\u0416'; + + /// + /// CYRILLIC CAPITAL LETTER ZE + /// + public const char afii10025 = '\u0417'; + + /// + /// CYRILLIC CAPITAL LETTER I + /// + public const char afii10026 = '\u0418'; + + /// + /// CYRILLIC CAPITAL LETTER SHORT I + /// + public const char afii10027 = '\u0419'; + + /// + /// CYRILLIC CAPITAL LETTER KA + /// + public const char afii10028 = '\u041A'; + + /// + /// CYRILLIC CAPITAL LETTER EL + /// + public const char afii10029 = '\u041B'; + + /// + /// CYRILLIC CAPITAL LETTER EM + /// + public const char afii10030 = '\u041C'; + + /// + /// CYRILLIC CAPITAL LETTER EN + /// + public const char afii10031 = '\u041D'; + + /// + /// CYRILLIC CAPITAL LETTER O + /// + public const char afii10032 = '\u041E'; + + /// + /// CYRILLIC CAPITAL LETTER PE + /// + public const char afii10033 = '\u041F'; + + /// + /// CYRILLIC CAPITAL LETTER ER + /// + public const char afii10034 = '\u0420'; + + /// + /// CYRILLIC CAPITAL LETTER ES + /// + public const char afii10035 = '\u0421'; + + /// + /// CYRILLIC CAPITAL LETTER TE + /// + public const char afii10036 = '\u0422'; + + /// + /// CYRILLIC CAPITAL LETTER U + /// + public const char afii10037 = '\u0423'; + + /// + /// CYRILLIC CAPITAL LETTER EF + /// + public const char afii10038 = '\u0424'; + + /// + /// CYRILLIC CAPITAL LETTER HA + /// + public const char afii10039 = '\u0425'; + + /// + /// CYRILLIC CAPITAL LETTER TSE + /// + public const char afii10040 = '\u0426'; + + /// + /// CYRILLIC CAPITAL LETTER CHE + /// + public const char afii10041 = '\u0427'; + + /// + /// CYRILLIC CAPITAL LETTER SHA + /// + public const char afii10042 = '\u0428'; + + /// + /// CYRILLIC CAPITAL LETTER SHCHA + /// + public const char afii10043 = '\u0429'; + + /// + /// CYRILLIC CAPITAL LETTER HARD SIGN + /// + public const char afii10044 = '\u042A'; + + /// + /// CYRILLIC CAPITAL LETTER YERU + /// + public const char afii10045 = '\u042B'; + + /// + /// CYRILLIC CAPITAL LETTER SOFT SIGN + /// + public const char afii10046 = '\u042C'; + + /// + /// CYRILLIC CAPITAL LETTER E + /// + public const char afii10047 = '\u042D'; + + /// + /// CYRILLIC CAPITAL LETTER YU + /// + public const char afii10048 = '\u042E'; + + /// + /// CYRILLIC CAPITAL LETTER YA + /// + public const char afii10049 = '\u042F'; + + /// + /// CYRILLIC CAPITAL LETTER GHE WITH UPTURN + /// + public const char afii10050 = '\u0490'; + + /// + /// CYRILLIC CAPITAL LETTER DJE + /// + public const char afii10051 = '\u0402'; + + /// + /// CYRILLIC CAPITAL LETTER GJE + /// + public const char afii10052 = '\u0403'; + + /// + /// CYRILLIC CAPITAL LETTER UKRAINIAN IE + /// + public const char afii10053 = '\u0404'; + + /// + /// CYRILLIC CAPITAL LETTER DZE + /// + public const char afii10054 = '\u0405'; + + /// + /// CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I + /// + public const char afii10055 = '\u0406'; + + /// + /// CYRILLIC CAPITAL LETTER YI + /// + public const char afii10056 = '\u0407'; + + /// + /// CYRILLIC CAPITAL LETTER JE + /// + public const char afii10057 = '\u0408'; + + /// + /// CYRILLIC CAPITAL LETTER LJE + /// + public const char afii10058 = '\u0409'; + + /// + /// CYRILLIC CAPITAL LETTER NJE + /// + public const char afii10059 = '\u040A'; + + /// + /// CYRILLIC CAPITAL LETTER TSHE + /// + public const char afii10060 = '\u040B'; + + /// + /// CYRILLIC CAPITAL LETTER KJE + /// + public const char afii10061 = '\u040C'; + + /// + /// CYRILLIC CAPITAL LETTER SHORT U + /// + public const char afii10062 = '\u040E'; + + /// + /// CYRILLIC SMALL LETTER A + /// + public const char afii10065 = '\u0430'; + + /// + /// CYRILLIC SMALL LETTER BE + /// + public const char afii10066 = '\u0431'; + + /// + /// CYRILLIC SMALL LETTER VE + /// + public const char afii10067 = '\u0432'; + + /// + /// CYRILLIC SMALL LETTER GHE + /// + public const char afii10068 = '\u0433'; + + /// + /// CYRILLIC SMALL LETTER DE + /// + public const char afii10069 = '\u0434'; + + /// + /// CYRILLIC SMALL LETTER IE + /// + public const char afii10070 = '\u0435'; + + /// + /// CYRILLIC SMALL LETTER IO + /// + public const char afii10071 = '\u0451'; + + /// + /// CYRILLIC SMALL LETTER ZHE + /// + public const char afii10072 = '\u0436'; + + /// + /// CYRILLIC SMALL LETTER ZE + /// + public const char afii10073 = '\u0437'; + + /// + /// CYRILLIC SMALL LETTER I + /// + public const char afii10074 = '\u0438'; + + /// + /// CYRILLIC SMALL LETTER SHORT I + /// + public const char afii10075 = '\u0439'; + + /// + /// CYRILLIC SMALL LETTER KA + /// + public const char afii10076 = '\u043A'; + + /// + /// CYRILLIC SMALL LETTER EL + /// + public const char afii10077 = '\u043B'; + + /// + /// CYRILLIC SMALL LETTER EM + /// + public const char afii10078 = '\u043C'; + + /// + /// CYRILLIC SMALL LETTER EN + /// + public const char afii10079 = '\u043D'; + + /// + /// CYRILLIC SMALL LETTER O + /// + public const char afii10080 = '\u043E'; + + /// + /// CYRILLIC SMALL LETTER PE + /// + public const char afii10081 = '\u043F'; + + /// + /// CYRILLIC SMALL LETTER ER + /// + public const char afii10082 = '\u0440'; + + /// + /// CYRILLIC SMALL LETTER ES + /// + public const char afii10083 = '\u0441'; + + /// + /// CYRILLIC SMALL LETTER TE + /// + public const char afii10084 = '\u0442'; + + /// + /// CYRILLIC SMALL LETTER U + /// + public const char afii10085 = '\u0443'; + + /// + /// CYRILLIC SMALL LETTER EF + /// + public const char afii10086 = '\u0444'; + + /// + /// CYRILLIC SMALL LETTER HA + /// + public const char afii10087 = '\u0445'; + + /// + /// CYRILLIC SMALL LETTER TSE + /// + public const char afii10088 = '\u0446'; + + /// + /// CYRILLIC SMALL LETTER CHE + /// + public const char afii10089 = '\u0447'; + + /// + /// CYRILLIC SMALL LETTER SHA + /// + public const char afii10090 = '\u0448'; + + /// + /// CYRILLIC SMALL LETTER SHCHA + /// + public const char afii10091 = '\u0449'; + + /// + /// CYRILLIC SMALL LETTER HARD SIGN + /// + public const char afii10092 = '\u044A'; + + /// + /// CYRILLIC SMALL LETTER YERU + /// + public const char afii10093 = '\u044B'; + + /// + /// CYRILLIC SMALL LETTER SOFT SIGN + /// + public const char afii10094 = '\u044C'; + + /// + /// CYRILLIC SMALL LETTER E + /// + public const char afii10095 = '\u044D'; + + /// + /// CYRILLIC SMALL LETTER YU + /// + public const char afii10096 = '\u044E'; + + /// + /// CYRILLIC SMALL LETTER YA + /// + public const char afii10097 = '\u044F'; + + /// + /// CYRILLIC SMALL LETTER GHE WITH UPTURN + /// + public const char afii10098 = '\u0491'; + + /// + /// CYRILLIC SMALL LETTER DJE + /// + public const char afii10099 = '\u0452'; + + /// + /// CYRILLIC SMALL LETTER GJE + /// + public const char afii10100 = '\u0453'; + + /// + /// CYRILLIC SMALL LETTER UKRAINIAN IE + /// + public const char afii10101 = '\u0454'; + + /// + /// CYRILLIC SMALL LETTER DZE + /// + public const char afii10102 = '\u0455'; + + /// + /// CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I + /// + public const char afii10103 = '\u0456'; + + /// + /// CYRILLIC SMALL LETTER YI + /// + public const char afii10104 = '\u0457'; + + /// + /// CYRILLIC SMALL LETTER JE + /// + public const char afii10105 = '\u0458'; + + /// + /// CYRILLIC SMALL LETTER LJE + /// + public const char afii10106 = '\u0459'; + + /// + /// CYRILLIC SMALL LETTER NJE + /// + public const char afii10107 = '\u045A'; + + /// + /// CYRILLIC SMALL LETTER TSHE + /// + public const char afii10108 = '\u045B'; + + /// + /// CYRILLIC SMALL LETTER KJE + /// + public const char afii10109 = '\u045C'; + + /// + /// CYRILLIC SMALL LETTER SHORT U + /// + public const char afii10110 = '\u045E'; + + /// + /// CYRILLIC CAPITAL LETTER DZHE + /// + public const char afii10145 = '\u040F'; + + /// + /// CYRILLIC CAPITAL LETTER YAT + /// + public const char afii10146 = '\u0462'; + + /// + /// CYRILLIC CAPITAL LETTER FITA + /// + public const char afii10147 = '\u0472'; + + /// + /// CYRILLIC CAPITAL LETTER IZHITSA + /// + public const char afii10148 = '\u0474'; + + /// + /// CYRILLIC SMALL LETTER DZHE + /// + public const char afii10193 = '\u045F'; + + /// + /// CYRILLIC SMALL LETTER YAT + /// + public const char afii10194 = '\u0463'; + + /// + /// CYRILLIC SMALL LETTER FITA + /// + public const char afii10195 = '\u0473'; + + /// + /// CYRILLIC SMALL LETTER IZHITSA + /// + public const char afii10196 = '\u0475'; + + /// + /// CYRILLIC SMALL LETTER SCHWA + /// + public const char afii10846 = '\u04D9'; + + /// + /// LEFT-TO-RIGHT MARK + /// + public const char afii299 = '\u200E'; + + /// + /// RIGHT-TO-LEFT MARK + /// + public const char afii300 = '\u200F'; + + /// + /// ZERO WIDTH JOINER + /// + public const char afii301 = '\u200D'; + + /// + /// ARABIC PERCENT SIGN + /// + public const char afii57381 = '\u066A'; + + /// + /// ARABIC COMMA + /// + public const char afii57388 = '\u060C'; + + /// + /// ARABIC-INDIC DIGIT ZERO + /// + public const char afii57392 = '\u0660'; + + /// + /// ARABIC-INDIC DIGIT ONE + /// + public const char afii57393 = '\u0661'; + + /// + /// ARABIC-INDIC DIGIT TWO + /// + public const char afii57394 = '\u0662'; + + /// + /// ARABIC-INDIC DIGIT THREE + /// + public const char afii57395 = '\u0663'; + + /// + /// ARABIC-INDIC DIGIT FOUR + /// + public const char afii57396 = '\u0664'; + + /// + /// ARABIC-INDIC DIGIT FIVE + /// + public const char afii57397 = '\u0665'; + + /// + /// ARABIC-INDIC DIGIT SIX + /// + public const char afii57398 = '\u0666'; + + /// + /// ARABIC-INDIC DIGIT SEVEN + /// + public const char afii57399 = '\u0667'; + + /// + /// ARABIC-INDIC DIGIT EIGHT + /// + public const char afii57400 = '\u0668'; + + /// + /// ARABIC-INDIC DIGIT NINE + /// + public const char afii57401 = '\u0669'; + + /// + /// ARABIC SEMICOLON + /// + public const char afii57403 = '\u061B'; + + /// + /// ARABIC QUESTION MARK + /// + public const char afii57407 = '\u061F'; + + /// + /// ARABIC LETTER HAMZA + /// + public const char afii57409 = '\u0621'; + + /// + /// ARABIC LETTER ALEF WITH MADDA ABOVE + /// + public const char afii57410 = '\u0622'; + + /// + /// ARABIC LETTER ALEF WITH HAMZA ABOVE + /// + public const char afii57411 = '\u0623'; + + /// + /// ARABIC LETTER WAW WITH HAMZA ABOVE + /// + public const char afii57412 = '\u0624'; + + /// + /// ARABIC LETTER ALEF WITH HAMZA BELOW + /// + public const char afii57413 = '\u0625'; + + /// + /// ARABIC LETTER YEH WITH HAMZA ABOVE + /// + public const char afii57414 = '\u0626'; + + /// + /// ARABIC LETTER ALEF + /// + public const char afii57415 = '\u0627'; + + /// + /// ARABIC LETTER BEH + /// + public const char afii57416 = '\u0628'; + + /// + /// ARABIC LETTER TEH MARBUTA + /// + public const char afii57417 = '\u0629'; + + /// + /// ARABIC LETTER TEH + /// + public const char afii57418 = '\u062A'; + + /// + /// ARABIC LETTER THEH + /// + public const char afii57419 = '\u062B'; + + /// + /// ARABIC LETTER JEEM + /// + public const char afii57420 = '\u062C'; + + /// + /// ARABIC LETTER HAH + /// + public const char afii57421 = '\u062D'; + + /// + /// ARABIC LETTER KHAH + /// + public const char afii57422 = '\u062E'; + + /// + /// ARABIC LETTER DAL + /// + public const char afii57423 = '\u062F'; + + /// + /// ARABIC LETTER THAL + /// + public const char afii57424 = '\u0630'; + + /// + /// ARABIC LETTER REH + /// + public const char afii57425 = '\u0631'; + + /// + /// ARABIC LETTER ZAIN + /// + public const char afii57426 = '\u0632'; + + /// + /// ARABIC LETTER SEEN + /// + public const char afii57427 = '\u0633'; + + /// + /// ARABIC LETTER SHEEN + /// + public const char afii57428 = '\u0634'; + + /// + /// ARABIC LETTER SAD + /// + public const char afii57429 = '\u0635'; + + /// + /// ARABIC LETTER DAD + /// + public const char afii57430 = '\u0636'; + + /// + /// ARABIC LETTER TAH + /// + public const char afii57431 = '\u0637'; + + /// + /// ARABIC LETTER ZAH + /// + public const char afii57432 = '\u0638'; + + /// + /// ARABIC LETTER AIN + /// + public const char afii57433 = '\u0639'; + + /// + /// ARABIC LETTER GHAIN + /// + public const char afii57434 = '\u063A'; + + /// + /// ARABIC TATWEEL + /// + public const char afii57440 = '\u0640'; + + /// + /// ARABIC LETTER FEH + /// + public const char afii57441 = '\u0641'; + + /// + /// ARABIC LETTER QAF + /// + public const char afii57442 = '\u0642'; + + /// + /// ARABIC LETTER KAF + /// + public const char afii57443 = '\u0643'; + + /// + /// ARABIC LETTER LAM + /// + public const char afii57444 = '\u0644'; + + /// + /// ARABIC LETTER MEEM + /// + public const char afii57445 = '\u0645'; + + /// + /// ARABIC LETTER NOON + /// + public const char afii57446 = '\u0646'; + + /// + /// ARABIC LETTER WAW + /// + public const char afii57448 = '\u0648'; + + /// + /// ARABIC LETTER ALEF MAKSURA + /// + public const char afii57449 = '\u0649'; + + /// + /// ARABIC LETTER YEH + /// + public const char afii57450 = '\u064A'; + + /// + /// ARABIC FATHATAN + /// + public const char afii57451 = '\u064B'; + + /// + /// ARABIC DAMMATAN + /// + public const char afii57452 = '\u064C'; + + /// + /// ARABIC KASRATAN + /// + public const char afii57453 = '\u064D'; + + /// + /// ARABIC FATHA + /// + public const char afii57454 = '\u064E'; + + /// + /// ARABIC DAMMA + /// + public const char afii57455 = '\u064F'; + + /// + /// ARABIC KASRA + /// + public const char afii57456 = '\u0650'; + + /// + /// ARABIC SHADDA + /// + public const char afii57457 = '\u0651'; + + /// + /// ARABIC SUKUN + /// + public const char afii57458 = '\u0652'; + + /// + /// ARABIC LETTER HEH + /// + public const char afii57470 = '\u0647'; + + /// + /// ARABIC LETTER VEH + /// + public const char afii57505 = '\u06A4'; + + /// + /// ARABIC LETTER PEH + /// + public const char afii57506 = '\u067E'; + + /// + /// ARABIC LETTER TCHEH + /// + public const char afii57507 = '\u0686'; + + /// + /// ARABIC LETTER JEH + /// + public const char afii57508 = '\u0698'; + + /// + /// ARABIC LETTER GAF + /// + public const char afii57509 = '\u06AF'; + + /// + /// ARABIC LETTER TTEH + /// + public const char afii57511 = '\u0679'; + + /// + /// ARABIC LETTER DDAL + /// + public const char afii57512 = '\u0688'; + + /// + /// ARABIC LETTER RREH + /// + public const char afii57513 = '\u0691'; + + /// + /// ARABIC LETTER NOON GHUNNA + /// + public const char afii57514 = '\u06BA'; + + /// + /// ARABIC LETTER YEH BARREE + /// + public const char afii57519 = '\u06D2'; + + /// + /// ARABIC LETTER AE + /// + public const char afii57534 = '\u06D5'; + + /// + /// NEW SHEQEL SIGN + /// + public const char afii57636 = '\u20AA'; + + /// + /// HEBREW PUNCTUATION MAQAF + /// + public const char afii57645 = '\u05BE'; + + /// + /// HEBREW PUNCTUATION SOF PASUQ + /// + public const char afii57658 = '\u05C3'; + + /// + /// HEBREW LETTER ALEF + /// + public const char afii57664 = '\u05D0'; + + /// + /// HEBREW LETTER BET + /// + public const char afii57665 = '\u05D1'; + + /// + /// HEBREW LETTER GIMEL + /// + public const char afii57666 = '\u05D2'; + + /// + /// HEBREW LETTER DALET + /// + public const char afii57667 = '\u05D3'; + + /// + /// HEBREW LETTER HE + /// + public const char afii57668 = '\u05D4'; + + /// + /// HEBREW LETTER VAV + /// + public const char afii57669 = '\u05D5'; + + /// + /// HEBREW LETTER ZAYIN + /// + public const char afii57670 = '\u05D6'; + + /// + /// HEBREW LETTER HET + /// + public const char afii57671 = '\u05D7'; + + /// + /// HEBREW LETTER TET + /// + public const char afii57672 = '\u05D8'; + + /// + /// HEBREW LETTER YOD + /// + public const char afii57673 = '\u05D9'; + + /// + /// HEBREW LETTER FINAL KAF + /// + public const char afii57674 = '\u05DA'; + + /// + /// HEBREW LETTER KAF + /// + public const char afii57675 = '\u05DB'; + + /// + /// HEBREW LETTER LAMED + /// + public const char afii57676 = '\u05DC'; + + /// + /// HEBREW LETTER FINAL MEM + /// + public const char afii57677 = '\u05DD'; + + /// + /// HEBREW LETTER MEM + /// + public const char afii57678 = '\u05DE'; + + /// + /// HEBREW LETTER FINAL NUN + /// + public const char afii57679 = '\u05DF'; + + /// + /// HEBREW LETTER NUN + /// + public const char afii57680 = '\u05E0'; + + /// + /// HEBREW LETTER SAMEKH + /// + public const char afii57681 = '\u05E1'; + + /// + /// HEBREW LETTER AYIN + /// + public const char afii57682 = '\u05E2'; + + /// + /// HEBREW LETTER FINAL PE + /// + public const char afii57683 = '\u05E3'; + + /// + /// HEBREW LETTER PE + /// + public const char afii57684 = '\u05E4'; + + /// + /// HEBREW LETTER FINAL TSADI + /// + public const char afii57685 = '\u05E5'; + + /// + /// HEBREW LETTER TSADI + /// + public const char afii57686 = '\u05E6'; + + /// + /// HEBREW LETTER QOF + /// + public const char afii57687 = '\u05E7'; + + /// + /// HEBREW LETTER RESH + /// + public const char afii57688 = '\u05E8'; + + /// + /// HEBREW LETTER SHIN + /// + public const char afii57689 = '\u05E9'; + + /// + /// HEBREW LETTER TAV + /// + public const char afii57690 = '\u05EA'; + + /// + /// HEBREW LIGATURE YIDDISH DOUBLE VAV + /// + public const char afii57716 = '\u05F0'; + + /// + /// HEBREW LIGATURE YIDDISH VAV YOD + /// + public const char afii57717 = '\u05F1'; + + /// + /// HEBREW LIGATURE YIDDISH DOUBLE YOD + /// + public const char afii57718 = '\u05F2'; + + /// + /// HEBREW POINT HIRIQ + /// + public const char afii57793 = '\u05B4'; + + /// + /// HEBREW POINT TSERE + /// + public const char afii57794 = '\u05B5'; + + /// + /// HEBREW POINT SEGOL + /// + public const char afii57795 = '\u05B6'; + + /// + /// HEBREW POINT QUBUTS + /// + public const char afii57796 = '\u05BB'; + + /// + /// HEBREW POINT QAMATS + /// + public const char afii57797 = '\u05B8'; + + /// + /// HEBREW POINT PATAH + /// + public const char afii57798 = '\u05B7'; + + /// + /// HEBREW POINT SHEVA + /// + public const char afii57799 = '\u05B0'; + + /// + /// HEBREW POINT HATAF PATAH + /// + public const char afii57800 = '\u05B2'; + + /// + /// HEBREW POINT HATAF SEGOL + /// + public const char afii57801 = '\u05B1'; + + /// + /// HEBREW POINT HATAF QAMATS + /// + public const char afii57802 = '\u05B3'; + + /// + /// HEBREW POINT SIN DOT + /// + public const char afii57803 = '\u05C2'; + + /// + /// HEBREW POINT SHIN DOT + /// + public const char afii57804 = '\u05C1'; + + /// + /// HEBREW POINT HOLAM + /// + public const char afii57806 = '\u05B9'; + + /// + /// HEBREW POINT DAGESH OR MAPIQ + /// + public const char afii57807 = '\u05BC'; + + /// + /// HEBREW POINT METEG + /// + public const char afii57839 = '\u05BD'; + + /// + /// HEBREW POINT RAFE + /// + public const char afii57841 = '\u05BF'; + + /// + /// HEBREW PUNCTUATION PASEQ + /// + public const char afii57842 = '\u05C0'; + + /// + /// MODIFIER LETTER APOSTROPHE + /// + public const char afii57929 = '\u02BC'; + + /// + /// CARE OF + /// + public const char afii61248 = '\u2105'; + + /// + /// SCRIPT SMALL L + /// + public const char afii61289 = '\u2113'; + + /// + /// NUMERO SIGN + /// + public const char afii61352 = '\u2116'; + + /// + /// POP DIRECTIONAL FORMATTING + /// + public const char afii61573 = '\u202C'; + + /// + /// LEFT-TO-RIGHT OVERRIDE + /// + public const char afii61574 = '\u202D'; + + /// + /// RIGHT-TO-LEFT OVERRIDE + /// + public const char afii61575 = '\u202E'; + + /// + /// ZERO WIDTH NON-JOINER + /// + public const char afii61664 = '\u200C'; + + /// + /// ARABIC FIVE POINTED STAR + /// + public const char afii63167 = '\u066D'; + + /// + /// MODIFIER LETTER REVERSED COMMA + /// + public const char afii64937 = '\u02BD'; + + /// + /// LATIN SMALL LETTER A WITH GRAVE + /// + public const char agrave = '\u00E0'; + + /// + /// ALEF SYMBOL + /// + public const char aleph = '\u2135'; + + /// + /// GREEK SMALL LETTER ALPHA + /// + public const char alpha = '\u03B1'; + + /// + /// GREEK SMALL LETTER ALPHA WITH TONOS + /// + public const char alphatonos = '\u03AC'; + + /// + /// LATIN SMALL LETTER A WITH MACRON + /// + public const char amacron = '\u0101'; + + /// + /// AMPERSAND + /// + public const char ampersand = '\u0026'; + + /// + /// ANGLE + /// + public const char angle = '\u2220'; + + /// + /// LEFT-POINTING ANGLE BRACKET + /// + public const char angleleft = '\u2329'; + + /// + /// RIGHT-POINTING ANGLE BRACKET + /// + public const char angleright = '\u232A'; + + /// + /// GREEK ANO TELEIA + /// + public const char anoteleia = '\u0387'; + + /// + /// LATIN SMALL LETTER A WITH OGONEK + /// + public const char aogonek = '\u0105'; + + /// + /// ALMOST EQUAL TO + /// + public const char approxequal = '\u2248'; + + /// + /// LATIN SMALL LETTER A WITH RING ABOVE + /// + public const char aring = '\u00E5'; + + /// + /// LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE + /// + public const char aringacute = '\u01FB'; + + /// + /// LEFT RIGHT ARROW + /// + public const char arrowboth = '\u2194'; + + /// + /// LEFT RIGHT DOUBLE ARROW + /// + public const char arrowdblboth = '\u21D4'; + + /// + /// DOWNWARDS DOUBLE ARROW + /// + public const char arrowdbldown = '\u21D3'; + + /// + /// LEFTWARDS DOUBLE ARROW + /// + public const char arrowdblleft = '\u21D0'; + + /// + /// RIGHTWARDS DOUBLE ARROW + /// + public const char arrowdblright = '\u21D2'; + + /// + /// UPWARDS DOUBLE ARROW + /// + public const char arrowdblup = '\u21D1'; + + /// + /// DOWNWARDS ARROW + /// + public const char arrowdown = '\u2193'; + + /// + /// LEFTWARDS ARROW + /// + public const char arrowleft = '\u2190'; + + /// + /// RIGHTWARDS ARROW + /// + public const char arrowright = '\u2192'; + + /// + /// UPWARDS ARROW + /// + public const char arrowup = '\u2191'; + + /// + /// UP DOWN ARROW + /// + public const char arrowupdn = '\u2195'; + + /// + /// UP DOWN ARROW WITH BASE + /// + public const char arrowupdnbse = '\u21A8'; + + // EXTENDER + //public const char ARROW = '\u;arrowvertex;VERTICAL' + + /// + /// CIRCUMFLEX ACCENT + /// + public const char asciicircum = '\u005E'; + + /// + /// TILDE + /// + public const char asciitilde = '\u007E'; + + /// + /// ASTERISK + /// + public const char asterisk = '\u002A'; + + /// + /// ASTERISK OPERATOR + /// + public const char asteriskmath = '\u2217'; + + /// + /// COMMERCIAL AT + /// + public const char at = '\u0040'; + + /// + /// LATIN SMALL LETTER A WITH TILDE + /// + public const char atilde = '\u00E3'; + + /// + /// LATIN SMALL LETTER B + /// + public const char b = '\u0062'; + + /// + /// REVERSE SOLIDUS + /// + public const char backslash = '\u005C'; + + /// + /// VERTICAL LINE + /// + public const char bar = '\u007C'; + + /// + /// GREEK SMALL LETTER BETA + /// + public const char beta = '\u03B2'; + + /// + /// FULL BLOCK + /// + public const char block = '\u2588'; + + /// + /// LEFT CURLY BRACKET + /// + public const char braceleft = '\u007B'; + + /// + /// RIGHT CURLY BRACKET + /// + public const char braceright = '\u007D'; + + /// + /// LEFT SQUARE BRACKET + /// + public const char bracketleft = '\u005B'; + + /// + /// RIGHT SQUARE BRACKET + /// + public const char bracketright = '\u005D'; + + /// + /// BREVE + /// + public const char breve = '\u02D8'; + + /// + /// BROKEN BAR + /// + public const char brokenbar = '\u00A6'; + + /// + /// BULLET + /// + public const char bullet = '\u2022'; + + /// + /// LATIN SMALL LETTER C + /// + public const char c = '\u0063'; + + /// + /// LATIN SMALL LETTER C WITH ACUTE + /// + public const char cacute = '\u0107'; + + /// + /// CARON + /// + public const char caron = '\u02C7'; + + /// + /// DOWNWARDS ARROW WITH CORNER LEFTWARDS + /// + public const char carriagereturn = '\u21B5'; + + /// + /// LATIN SMALL LETTER C WITH CARON + /// + public const char ccaron = '\u010D'; + + /// + /// LATIN SMALL LETTER C WITH CEDILLA + /// + public const char ccedilla = '\u00E7'; + + /// + /// LATIN SMALL LETTER C WITH CIRCUMFLEX + /// + public const char ccircumflex = '\u0109'; + + /// + /// LATIN SMALL LETTER C WITH DOT ABOVE + /// + public const char cdotaccent = '\u010B'; + + /// + /// CEDILLA + /// + public const char cedilla = '\u00B8'; + + /// + /// CENT SIGN + /// + public const char cent = '\u00A2'; + + /// + /// GREEK SMALL LETTER CHI + /// + public const char chi = '\u03C7'; + + /// + /// WHITE CIRCLE + /// + public const char circle = '\u25CB'; + + /// + /// CIRCLED TIMES + /// + public const char circlemultiply = '\u2297'; + + /// + /// CIRCLED PLUS + /// + public const char circleplus = '\u2295'; + + /// + /// MODIFIER LETTER CIRCUMFLEX ACCENT + /// + public const char circumflex = '\u02C6'; + + /// + /// BLACK CLUB SUIT + /// + public const char club = '\u2663'; + + /// + /// COLON + /// + public const char colon = '\u003A'; + + /// + /// COLON SIGN + /// + public const char colonmonetary = '\u20A1'; + + /// + /// COMMA + /// + public const char comma = '\u002C'; + + /// + /// APPROXIMATELY EQUAL TO + /// + public const char congruent = '\u2245'; + + /// + /// COPYRIGHT SIGN + /// + public const char copyright = '\u00A9'; + + /// + /// CURRENCY SIGN + /// + public const char currency = '\u00A4'; + + /// + /// LATIN SMALL LETTER D + /// + public const char d = '\u0064'; + + /// + /// DAGGER + /// + public const char dagger = '\u2020'; + + /// + /// DOUBLE DAGGER + /// + public const char daggerdbl = '\u2021'; + + /// + /// LATIN SMALL LETTER D WITH CARON + /// + public const char dcaron = '\u010F'; + + /// + /// LATIN SMALL LETTER D WITH STROKE + /// + public const char dcroat = '\u0111'; + + /// + /// DEGREE SIGN + /// + public const char degree = '\u00B0'; + + /// + /// GREEK SMALL LETTER DELTA + /// + public const char delta = '\u03B4'; + + /// + /// BLACK DIAMOND SUIT + /// + public const char diamond = '\u2666'; + + /// + /// DIAERESIS + /// + public const char dieresis = '\u00A8'; + + /// + /// GREEK DIALYTIKA TONOS + /// + public const char dieresistonos = '\u0385'; + + /// + /// DIVISION SIGN + /// + public const char divide = '\u00F7'; + + /// + /// DARK SHADE + /// + public const char dkshade = '\u2593'; + + /// + /// LOWER HALF BLOCK + /// + public const char dnblock = '\u2584'; + + /// + /// DOLLAR SIGN + /// + public const char dollar = '\u0024'; + + /// + /// DONG SIGN + /// + public const char dong = '\u20AB'; + + /// + /// DOT ABOVE + /// + public const char dotaccent = '\u02D9'; + + /// + /// COMBINING DOT BELOW + /// + public const char dotbelowcomb = '\u0323'; + + /// + /// LATIN SMALL LETTER DOTLESS I + /// + public const char dotlessi = '\u0131'; + + /// + /// DOT OPERATOR + /// + public const char dotmath = '\u22C5'; + + /// + /// LATIN SMALL LETTER E + /// + public const char e = '\u0065'; + + /// + /// LATIN SMALL LETTER E WITH ACUTE + /// + public const char eacute = '\u00E9'; + + /// + /// LATIN SMALL LETTER E WITH BREVE + /// + public const char ebreve = '\u0115'; + + /// + /// LATIN SMALL LETTER E WITH CARON + /// + public const char ecaron = '\u011B'; + + /// + /// LATIN SMALL LETTER E WITH CIRCUMFLEX + /// + public const char ecircumflex = '\u00EA'; + + /// + /// LATIN SMALL LETTER E WITH DIAERESIS + /// + public const char edieresis = '\u00EB'; + + /// + /// LATIN SMALL LETTER E WITH DOT ABOVE + /// + public const char edotaccent = '\u0117'; + + /// + /// LATIN SMALL LETTER E WITH GRAVE + /// + public const char egrave = '\u00E8'; + + /// + /// DIGIT EIGHT + /// + public const char eight = '\u0038'; + + /// + /// ELEMENT OF + /// + public const char element = '\u2208'; + + /// + /// HORIZONTAL ELLIPSIS + /// + public const char ellipsis = '\u2026'; + + /// + /// LATIN SMALL LETTER E WITH MACRON + /// + public const char emacron = '\u0113'; + + /// + /// EM DASH + /// + public const char emdash = '\u2014'; + + /// + /// EMPTY SET + /// + public const char emptyset = '\u2205'; + + /// + /// EN DASH + /// + public const char endash = '\u2013'; + + /// + /// LATIN SMALL LETTER ENG + /// + public const char eng = '\u014B'; + + /// + /// LATIN SMALL LETTER E WITH OGONEK + /// + public const char eogonek = '\u0119'; + + /// + /// GREEK SMALL LETTER EPSILON + /// + public const char epsilon = '\u03B5'; + + /// + /// GREEK SMALL LETTER EPSILON WITH TONOS + /// + public const char epsilontonos = '\u03AD'; + + /// + /// EQUALS SIGN + /// + public const char equal = '\u003D'; + + /// + /// IDENTICAL TO + /// + public const char equivalence = '\u2261'; + + /// + /// ESTIMATED SYMBOL + /// + public const char estimated = '\u212E'; + + /// + /// GREEK SMALL LETTER ETA + /// + public const char eta = '\u03B7'; + + /// + /// GREEK SMALL LETTER ETA WITH TONOS + /// + public const char etatonos = '\u03AE'; + + /// + /// LATIN SMALL LETTER ETH + /// + public const char eth = '\u00F0'; + + /// + /// EXCLAMATION MARK + /// + public const char exclam = '\u0021'; + + /// + /// DOUBLE EXCLAMATION MARK + /// + public const char exclamdbl = '\u203C'; + + /// + /// INVERTED EXCLAMATION MARK + /// + public const char exclamdown = '\u00A1'; + + /// + /// THERE EXISTS + /// + public const char existential = '\u2203'; + + /// + /// LATIN SMALL LETTER F + /// + public const char f = '\u0066'; + + /// + /// FEMALE SIGN + /// + public const char female = '\u2640'; + + /// + /// FIGURE DASH + /// + public const char figuredash = '\u2012'; + + /// + /// BLACK SQUARE + /// + public const char filledbox = '\u25A0'; + + /// + /// BLACK RECTANGLE + /// + public const char filledrect = '\u25AC'; + + /// + /// DIGIT FIVE + /// + public const char five = '\u0035'; + + /// + /// VULGAR FRACTION FIVE EIGHTHS + /// + public const char fiveeighths = '\u215D'; + + /// + /// LATIN SMALL LETTER F WITH HOOK + /// + public const char florin = '\u0192'; + + /// + /// DIGIT FOUR + /// + public const char four = '\u0034'; + + /// + /// FRACTION SLASH + /// + public const char fraction = '\u2044'; + + /// + /// FRENCH FRANC SIGN + /// + public const char franc = '\u20A3'; + + /// + /// LATIN SMALL LETTER G + /// + public const char g = '\u0067'; + + /// + /// GREEK SMALL LETTER GAMMA + /// + public const char gamma = '\u03B3'; + + /// + /// LATIN SMALL LETTER G WITH BREVE + /// + public const char gbreve = '\u011F'; + + /// + /// LATIN SMALL LETTER G WITH CARON + /// + public const char gcaron = '\u01E7'; + + /// + /// LATIN SMALL LETTER G WITH CIRCUMFLEX + /// + public const char gcircumflex = '\u011D'; + + /// + /// LATIN SMALL LETTER G WITH CEDILLA + /// + public const char gcommaaccent = '\u0123'; + + /// + /// LATIN SMALL LETTER G WITH DOT ABOVE + /// + public const char gdotaccent = '\u0121'; + + /// + /// LATIN SMALL LETTER SHARP S + /// + public const char germandbls = '\u00DF'; + + /// + /// NABLA + /// + public const char gradient = '\u2207'; + + /// + /// GRAVE ACCENT + /// + public const char grave = '\u0060'; + + /// + /// COMBINING GRAVE ACCENT + /// + public const char gravecomb = '\u0300'; + + /// + /// GREATER-THAN SIGN + /// + public const char greater = '\u003E'; + + /// + /// GREATER-THAN OR EQUAL TO + /// + public const char greaterequal = '\u2265'; + + /// + /// LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + /// + public const char guillemotleft = '\u00AB'; + + /// + /// RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + /// + public const char guillemotright = '\u00BB'; + + /// + /// SINGLE LEFT-POINTING ANGLE QUOTATION MARK + /// + public const char guilsinglleft = '\u2039'; + + /// + /// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK + /// + public const char guilsinglright = '\u203A'; + + /// + /// LATIN SMALL LETTER H + /// + public const char h = '\u0068'; + + /// + /// LATIN SMALL LETTER H WITH STROKE + /// + public const char hbar = '\u0127'; + + /// + /// LATIN SMALL LETTER H WITH CIRCUMFLEX + /// + public const char hcircumflex = '\u0125'; + + /// + /// BLACK HEART SUIT + /// + public const char heart = '\u2665'; + + /// + /// COMBINING HOOK ABOVE + /// + public const char hookabovecomb = '\u0309'; + + /// + /// HOUSE + /// + public const char house = '\u2302'; + + /// + /// DOUBLE ACUTE ACCENT + /// + public const char hungarumlaut = '\u02DD'; + + /// + /// HYPHEN-MINUS + /// + public const char hyphen = '\u002D'; + + /// + /// LATIN SMALL LETTER I + /// + public const char i = '\u0069'; + + /// + /// LATIN SMALL LETTER I WITH ACUTE + /// + public const char iacute = '\u00ED'; + + /// + /// LATIN SMALL LETTER I WITH BREVE + /// + public const char ibreve = '\u012D'; + + /// + /// LATIN SMALL LETTER I WITH CIRCUMFLEX + /// + public const char icircumflex = '\u00EE'; + + /// + /// LATIN SMALL LETTER I WITH DIAERESIS + /// + public const char idieresis = '\u00EF'; + + /// + /// LATIN SMALL LETTER I WITH GRAVE + /// + public const char igrave = '\u00EC'; + + /// + /// LATIN SMALL LIGATURE IJ + /// + public const char ij = '\u0133'; + + /// + /// LATIN SMALL LETTER I WITH MACRON + /// + public const char imacron = '\u012B'; + + /// + /// INFINITY + /// + public const char infinity = '\u221E'; + + /// + /// INTEGRAL + /// + public const char integral = '\u222B'; + + /// + /// BOTTOM HALF INTEGRAL + /// + public const char integralbt = '\u2321'; + + /// + /// TOP HALF INTEGRAL + /// + public const char integraltp = '\u2320'; + + /// + /// INTERSECTION + /// + public const char intersection = '\u2229'; + + /// + /// INVERSE BULLET + /// + public const char invbullet = '\u25D8'; + + /// + /// INVERSE WHITE CIRCLE + /// + public const char invcircle = '\u25D9'; + + /// + /// BLACK SMILING FACE + /// + public const char invsmileface = '\u263B'; + + /// + /// LATIN SMALL LETTER I WITH OGONEK + /// + public const char iogonek = '\u012F'; + + /// + /// GREEK SMALL LETTER IOTA + /// + public const char iota = '\u03B9'; + + /// + /// GREEK SMALL LETTER IOTA WITH DIALYTIKA + /// + public const char iotadieresis = '\u03CA'; + + /// + /// GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS + /// + public const char iotadieresistonos = '\u0390'; + + /// + /// GREEK SMALL LETTER IOTA WITH TONOS + /// + public const char iotatonos = '\u03AF'; + + /// + /// LATIN SMALL LETTER I WITH TILDE + /// + public const char itilde = '\u0129'; + + /// + /// LATIN SMALL LETTER J + /// + public const char j = '\u006A'; + + /// + /// LATIN SMALL LETTER J WITH CIRCUMFLEX + /// + public const char jcircumflex = '\u0135'; + + /// + /// LATIN SMALL LETTER K + /// + public const char k = '\u006B'; + + /// + /// GREEK SMALL LETTER KAPPA + /// + public const char kappa = '\u03BA'; + + /// + /// LATIN SMALL LETTER K WITH CEDILLA + /// + public const char kcommaaccent = '\u0137'; + + /// + /// LATIN SMALL LETTER KRA + /// + public const char kgreenlandic = '\u0138'; + + /// + /// LATIN SMALL LETTER L + /// + public const char l = '\u006C'; + + /// + /// LATIN SMALL LETTER L WITH ACUTE + /// + public const char lacute = '\u013A'; + + /// + /// GREEK SMALL LETTER LAMDA + /// + public const char lambda = '\u03BB'; + + /// + /// LATIN SMALL LETTER L WITH CARON + /// + public const char lcaron = '\u013E'; + + /// + /// LATIN SMALL LETTER L WITH CEDILLA + /// + public const char lcommaaccent = '\u013C'; + + /// + /// LATIN SMALL LETTER L WITH MIDDLE DOT + /// + public const char ldot = '\u0140'; + + /// + /// LESS-THAN SIGN + /// + public const char less = '\u003C'; + + /// + /// LESS-THAN OR EQUAL TO + /// + public const char lessequal = '\u2264'; + + /// + /// LEFT HALF BLOCK + /// + public const char lfblock = '\u258C'; + + /// + /// LIRA SIGN + /// + public const char lira = '\u20A4'; + + /// + /// LOGICAL AND + /// + public const char logicaland = '\u2227'; + + /// + /// NOT SIGN + /// + public const char logicalnot = '\u00AC'; + + /// + /// LOGICAL OR + /// + public const char logicalor = '\u2228'; + + /// + /// LATIN SMALL LETTER LONG S + /// + public const char longs = '\u017F'; + + /// + /// LOZENGE + /// + public const char lozenge = '\u25CA'; + + /// + /// LATIN SMALL LETTER L WITH STROKE + /// + public const char lslash = '\u0142'; + + /// + /// LIGHT SHADE + /// + public const char ltshade = '\u2591'; + + /// + /// LATIN SMALL LETTER M + /// + public const char m = '\u006D'; + + /// + /// MACRON + /// + public const char macron = '\u00AF'; + + /// + /// MALE SIGN + /// + public const char male = '\u2642'; + + /// + /// MINUS SIGN + /// + public const char minus = '\u2212'; + + /// + /// PRIME + /// + public const char minute = '\u2032'; + + /// + /// MICRO SIGN + /// + public const char mu = '\u00B5'; + + /// + /// MULTIPLICATION SIGN + /// + public const char multiply = '\u00D7'; + + /// + /// EIGHTH NOTE + /// + public const char musicalnote = '\u266A'; + + /// + /// BEAMED EIGHTH NOTES + /// + public const char musicalnotedbl = '\u266B'; + + /// + /// LATIN SMALL LETTER N + /// + public const char n = '\u006E'; + + /// + /// LATIN SMALL LETTER N WITH ACUTE + /// + public const char nacute = '\u0144'; + + /// + /// LATIN SMALL LETTER N PRECEDED BY APOSTROPHE + /// + public const char napostrophe = '\u0149'; + + /// + /// LATIN SMALL LETTER N WITH CARON + /// + public const char ncaron = '\u0148'; + + /// + /// LATIN SMALL LETTER N WITH CEDILLA + /// + public const char ncommaaccent = '\u0146'; + + /// + /// DIGIT NINE + /// + public const char nine = '\u0039'; + + /// + /// NOT AN ELEMENT OF + /// + public const char notelement = '\u2209'; + + /// + /// NOT EQUAL TO + /// + public const char notequal = '\u2260'; + + /// + /// NOT A SUBSET OF + /// + public const char notsubset = '\u2284'; + + /// + /// LATIN SMALL LETTER N WITH TILDE + /// + public const char ntilde = '\u00F1'; + + /// + /// GREEK SMALL LETTER NU + /// + public const char nu = '\u03BD'; + + /// + /// NUMBER SIGN + /// + public const char numbersign = '\u0023'; + + /// + /// LATIN SMALL LETTER O + /// + public const char o = '\u006F'; + + /// + /// LATIN SMALL LETTER O WITH ACUTE + /// + public const char oacute = '\u00F3'; + + /// + /// LATIN SMALL LETTER O WITH BREVE + /// + public const char obreve = '\u014F'; + + /// + /// LATIN SMALL LETTER O WITH CIRCUMFLEX + /// + public const char ocircumflex = '\u00F4'; + + /// + /// LATIN SMALL LETTER O WITH DIAERESIS + /// + public const char odieresis = '\u00F6'; + + /// + /// LATIN SMALL LIGATURE OE + /// + public const char oe = '\u0153'; + + /// + /// OGONEK + /// + public const char ogonek = '\u02DB'; + + /// + /// LATIN SMALL LETTER O WITH GRAVE + /// + public const char ograve = '\u00F2'; + + /// + /// LATIN SMALL LETTER O WITH HORN + /// + public const char ohorn = '\u01A1'; + + /// + /// LATIN SMALL LETTER O WITH DOUBLE ACUTE + /// + public const char ohungarumlaut = '\u0151'; + + /// + /// LATIN SMALL LETTER O WITH MACRON + /// + public const char omacron = '\u014D'; + + /// + /// GREEK SMALL LETTER OMEGA + /// + public const char omega = '\u03C9'; + + /// + /// GREEK PI SYMBOL + /// + public const char omega1 = '\u03D6'; + + /// + /// GREEK SMALL LETTER OMEGA WITH TONOS + /// + public const char omegatonos = '\u03CE'; + + /// + /// GREEK SMALL LETTER OMICRON + /// + public const char omicron = '\u03BF'; + + /// + /// GREEK SMALL LETTER OMICRON WITH TONOS + /// + public const char omicrontonos = '\u03CC'; + + /// + /// DIGIT ONE + /// + public const char one = '\u0031'; + + /// + /// ONE DOT LEADER + /// + public const char onedotenleader = '\u2024'; + + /// + /// VULGAR FRACTION ONE EIGHTH + /// + public const char oneeighth = '\u215B'; + + /// + /// VULGAR FRACTION ONE HALF + /// + public const char onehalf = '\u00BD'; + + /// + /// VULGAR FRACTION ONE QUARTER + /// + public const char onequarter = '\u00BC'; + + /// + /// VULGAR FRACTION ONE THIRD + /// + public const char onethird = '\u2153'; + + /// + /// WHITE BULLET + /// + public const char openbullet = '\u25E6'; + + /// + /// FEMININE ORDINAL INDICATOR + /// + public const char ordfeminine = '\u00AA'; + + /// + /// MASCULINE ORDINAL INDICATOR + /// + public const char ordmasculine = '\u00BA'; + + /// + /// RIGHT ANGLE + /// + public const char orthogonal = '\u221F'; + + /// + /// LATIN SMALL LETTER O WITH STROKE + /// + public const char oslash = '\u00F8'; + + /// + /// LATIN SMALL LETTER O WITH STROKE AND ACUTE + /// + public const char oslashacute = '\u01FF'; + + /// + /// LATIN SMALL LETTER O WITH TILDE + /// + public const char otilde = '\u00F5'; + + /// + /// LATIN SMALL LETTER P + /// + public const char p = '\u0070'; + + /// + /// PILCROW SIGN + /// + public const char paragraph = '\u00B6'; + + /// + /// LEFT PARENTHESIS + /// + public const char parenleft = '\u0028'; + + /// + /// RIGHT PARENTHESIS + /// + public const char parenright = '\u0029'; + + /// + /// PARTIAL DIFFERENTIAL + /// + public const char partialdiff = '\u2202'; + + /// + /// PERCENT SIGN + /// + public const char percent = '\u0025'; + + /// + /// FULL STOP + /// + public const char period = '\u002E'; + + /// + /// MIDDLE DOT + /// + public const char periodcentered = '\u00B7'; + + /// + /// UP TACK + /// + public const char perpendicular = '\u22A5'; + + /// + /// PER MILLE SIGN + /// + public const char perthousand = '\u2030'; + + /// + /// PESETA SIGN + /// + public const char peseta = '\u20A7'; + + /// + /// GREEK SMALL LETTER PHI + /// + public const char phi = '\u03C6'; + + /// + /// GREEK PHI SYMBOL + /// + public const char phi1 = '\u03D5'; + + /// + /// GREEK SMALL LETTER PI + /// + public const char pi = '\u03C0'; + + /// + /// PLUS SIGN + /// + public const char plus = '\u002B'; + + /// + /// PLUS-MINUS SIGN + /// + public const char plusminus = '\u00B1'; + + /// + /// PRESCRIPTION TAKE + /// + public const char prescription = '\u211E'; + + /// + /// N-ARY PRODUCT + /// + public const char product = '\u220F'; + + /// + /// SUBSET OF + /// + public const char propersubset = '\u2282'; + + /// + /// SUPERSET OF + /// + public const char propersuperset = '\u2283'; + + /// + /// PROPORTIONAL TO + /// + public const char proportional = '\u221D'; + + /// + /// GREEK SMALL LETTER PSI + /// + public const char psi = '\u03C8'; + + /// + /// LATIN SMALL LETTER Q + /// + public const char q = '\u0071'; + + /// + /// QUESTION MARK + /// + public const char question = '\u003F'; + + /// + /// INVERTED QUESTION MARK + /// + public const char questiondown = '\u00BF'; + + /// + /// QUOTATION MARK + /// + public const char quotedbl = '\u0022'; + + /// + /// DOUBLE LOW-9 QUOTATION MARK + /// + public const char quotedblbase = '\u201E'; + + /// + /// LEFT DOUBLE QUOTATION MARK + /// + public const char quotedblleft = '\u201C'; + + /// + /// RIGHT DOUBLE QUOTATION MARK + /// + public const char quotedblright = '\u201D'; + + /// + /// LEFT SINGLE QUOTATION MARK + /// + public const char quoteleft = '\u2018'; + + /// + /// SINGLE HIGH-REVERSED-9 QUOTATION MARK + /// + public const char quotereversed = '\u201B'; + + /// + /// RIGHT SINGLE QUOTATION MARK + /// + public const char quoteright = '\u2019'; + + /// + /// SINGLE LOW-9 QUOTATION MARK + /// + public const char quotesinglbase = '\u201A'; + + /// + /// APOSTROPHE + /// + public const char quotesingle = '\u0027'; + + /// + /// LATIN SMALL LETTER R + /// + public const char r = '\u0072'; + + /// + /// LATIN SMALL LETTER R WITH ACUTE + /// + public const char racute = '\u0155'; + + /// + /// SQUARE ROOT + /// + public const char radical = '\u221A'; + + /// + /// LATIN SMALL LETTER R WITH CARON + /// + public const char rcaron = '\u0159'; + + /// + /// LATIN SMALL LETTER R WITH CEDILLA + /// + public const char rcommaaccent = '\u0157'; + + /// + /// SUBSET OF OR EQUAL TO + /// + public const char reflexsubset = '\u2286'; + + /// + /// SUPERSET OF OR EQUAL TO + /// + public const char reflexsuperset = '\u2287'; + + /// + /// REGISTERED SIGN + /// + public const char registered = '\u00AE'; + + /// + /// REVERSED NOT SIGN + /// + public const char revlogicalnot = '\u2310'; + + /// + /// GREEK SMALL LETTER RHO + /// + public const char rho = '\u03C1'; + + /// + /// RING ABOVE + /// + public const char ring = '\u02DA'; + + /// + /// RIGHT HALF BLOCK + /// + public const char rtblock = '\u2590'; + + /// + /// LATIN SMALL LETTER S + /// + public const char s = '\u0073'; + + /// + /// LATIN SMALL LETTER S WITH ACUTE + /// + public const char sacute = '\u015B'; + + /// + /// LATIN SMALL LETTER S WITH CARON + /// + public const char scaron = '\u0161'; + + /// + /// LATIN SMALL LETTER S WITH CEDILLA + /// + public const char scedilla = '\u015F'; + + /// + /// LATIN SMALL LETTER S WITH CIRCUMFLEX + /// + public const char scircumflex = '\u015D'; + + /// + /// LATIN SMALL LETTER S WITH COMMA BELOW + /// + public const char scommaaccent = '\u0219'; + + /// + /// DOUBLE PRIME + /// + public const char second = '\u2033'; + + /// + /// SECTION SIGN + /// + public const char section = '\u00A7'; + + /// + /// SEMICOLON + /// + public const char semicolon = '\u003B'; + + /// + /// DIGIT SEVEN + /// + public const char seven = '\u0037'; + + /// + /// VULGAR FRACTION SEVEN EIGHTHS + /// + public const char seveneighths = '\u215E'; + + /// + /// MEDIUM SHADE + /// + public const char shade = '\u2592'; + + /// + /// GREEK SMALL LETTER SIGMA + /// + public const char sigma = '\u03C3'; + + /// + /// GREEK SMALL LETTER FINAL SIGMA + /// + public const char sigma1 = '\u03C2'; + + /// + /// TILDE OPERATOR + /// + public const char similar = '\u223C'; + + /// + /// DIGIT SIX + /// + public const char six = '\u0036'; + + /// + /// SOLIDUS + /// + public const char slash = '\u002F'; + + /// + /// WHITE SMILING FACE + /// + public const char smileface = '\u263A'; + + /// + /// SPACE + /// + public const char space = '\u0020'; + + /// + /// BLACK SPADE SUIT + /// + public const char spade = '\u2660'; + + /// + /// POUND SIGN + /// + public const char sterling = '\u00A3'; + + /// + /// CONTAINS AS MEMBER + /// + public const char suchthat = '\u220B'; + + /// + /// N-ARY SUMMATION + /// + public const char summation = '\u2211'; + + /// + /// WHITE SUN WITH RAYS + /// + public const char sun = '\u263C'; + + /// + /// LATIN SMALL LETTER T + /// + public const char t = '\u0074'; + + /// + /// GREEK SMALL LETTER TAU + /// + public const char tau = '\u03C4'; + + /// + /// LATIN SMALL LETTER T WITH STROKE + /// + public const char tbar = '\u0167'; + + /// + /// LATIN SMALL LETTER T WITH CARON + /// + public const char tcaron = '\u0165'; + + /// + /// LATIN SMALL LETTER T WITH CEDILLA + /// + public const char tcommaaccent = '\u0163'; + + /// + /// THEREFORE + /// + public const char therefore = '\u2234'; + + /// + /// GREEK SMALL LETTER THETA + /// + public const char theta = '\u03B8'; + + /// + /// GREEK THETA SYMBOL + /// + public const char theta1 = '\u03D1'; + + /// + /// LATIN SMALL LETTER THORN + /// + public const char thorn = '\u00FE'; + + /// + /// DIGIT THREE + /// + public const char three = '\u0033'; + + /// + /// VULGAR FRACTION THREE EIGHTHS + /// + public const char threeeighths = '\u215C'; + + /// + /// VULGAR FRACTION THREE QUARTERS + /// + public const char threequarters = '\u00BE'; + + /// + /// SMALL TILDE + /// + public const char tilde = '\u02DC'; + + /// + /// COMBINING TILDE + /// + public const char tildecomb = '\u0303'; + + /// + /// GREEK TONOS + /// + public const char tonos = '\u0384'; + + /// + /// TRADE MARK SIGN + /// + public const char trademark = '\u2122'; + + /// + /// BLACK DOWN-POINTING TRIANGLE + /// + public const char triagdn = '\u25BC'; + + /// + /// BLACK LEFT-POINTING POINTER + /// + public const char triaglf = '\u25C4'; + + /// + /// BLACK RIGHT-POINTING POINTER + /// + public const char triagrt = '\u25BA'; + + /// + /// BLACK UP-POINTING TRIANGLE + /// + public const char triagup = '\u25B2'; + + /// + /// DIGIT TWO + /// + public const char two = '\u0032'; + + /// + /// TWO DOT LEADER + /// + public const char twodotenleader = '\u2025'; + + /// + /// VULGAR FRACTION TWO THIRDS + /// + public const char twothirds = '\u2154'; + + /// + /// LATIN SMALL LETTER U + /// + public const char u = '\u0075'; + + /// + /// LATIN SMALL LETTER U WITH ACUTE + /// + public const char uacute = '\u00FA'; + + /// + /// LATIN SMALL LETTER U WITH BREVE + /// + public const char ubreve = '\u016D'; + + /// + /// LATIN SMALL LETTER U WITH CIRCUMFLEX + /// + public const char ucircumflex = '\u00FB'; + + /// + /// LATIN SMALL LETTER U WITH DIAERESIS + /// + public const char udieresis = '\u00FC'; + + /// + /// LATIN SMALL LETTER U WITH GRAVE + /// + public const char ugrave = '\u00F9'; + + /// + /// LATIN SMALL LETTER U WITH HORN + /// + public const char uhorn = '\u01B0'; + + /// + /// LATIN SMALL LETTER U WITH DOUBLE ACUTE + /// + public const char uhungarumlaut = '\u0171'; + + /// + /// LATIN SMALL LETTER U WITH MACRON + /// + public const char umacron = '\u016B'; + + /// + /// LOW LINE + /// + public const char underscore = '\u005F'; + + /// + /// DOUBLE LOW LINE + /// + public const char underscoredbl = '\u2017'; + + /// + /// UNION + /// + public const char union = '\u222A'; + + /// + /// FOR ALL + /// + public const char universal = '\u2200'; + + /// + /// LATIN SMALL LETTER U WITH OGONEK + /// + public const char uogonek = '\u0173'; + + /// + /// UPPER HALF BLOCK + /// + public const char upblock = '\u2580'; + + /// + /// GREEK SMALL LETTER UPSILON + /// + public const char upsilon = '\u03C5'; + + /// + /// GREEK SMALL LETTER UPSILON WITH DIALYTIKA + /// + public const char upsilondieresis = '\u03CB'; + + /// + /// GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS + /// + public const char upsilondieresistonos = '\u03B0'; + + /// + /// GREEK SMALL LETTER UPSILON WITH TONOS + /// + public const char upsilontonos = '\u03CD'; + + /// + /// LATIN SMALL LETTER U WITH RING ABOVE + /// + public const char uring = '\u016F'; + + /// + /// LATIN SMALL LETTER U WITH TILDE + /// + public const char utilde = '\u0169'; + + /// + /// LATIN SMALL LETTER V + /// + public const char v = '\u0076'; + + /// + /// LATIN SMALL LETTER W + /// + public const char w = '\u0077'; + + /// + /// LATIN SMALL LETTER W WITH ACUTE + /// + public const char wacute = '\u1E83'; + + /// + /// LATIN SMALL LETTER W WITH CIRCUMFLEX + /// + public const char wcircumflex = '\u0175'; + + /// + /// LATIN SMALL LETTER W WITH DIAERESIS + /// + public const char wdieresis = '\u1E85'; + + /// + /// SCRIPT CAPITAL P + /// + public const char weierstrass = '\u2118'; + + /// + /// LATIN SMALL LETTER W WITH GRAVE + /// + public const char wgrave = '\u1E81'; + + /// + /// LATIN SMALL LETTER X + /// + public const char x = '\u0078'; + + /// + /// GREEK SMALL LETTER XI + /// + public const char xi = '\u03BE'; + + /// + /// LATIN SMALL LETTER Y + /// + public const char y = '\u0079'; + + /// + /// LATIN SMALL LETTER Y WITH ACUTE + /// + public const char yacute = '\u00FD'; + + /// + /// LATIN SMALL LETTER Y WITH CIRCUMFLEX + /// + public const char ycircumflex = '\u0177'; + + /// + /// LATIN SMALL LETTER Y WITH DIAERESIS + /// + public const char ydieresis = '\u00FF'; + + /// + /// YEN SIGN + /// + public const char yen = '\u00A5'; + + /// + /// LATIN SMALL LETTER Y WITH GRAVE + /// + public const char ygrave = '\u1EF3'; + + /// + /// LATIN SMALL LETTER Z + /// + public const char z = '\u007A'; + + /// + /// LATIN SMALL LETTER Z WITH ACUTE + /// + public const char zacute = '\u017A'; + + /// + /// LATIN SMALL LETTER Z WITH CARON + /// + public const char zcaron = '\u017E'; + + /// + /// LATIN SMALL LETTER Z WITH DOT ABOVE + /// + public const char zdotaccent = '\u017C'; + + /// + /// DIGIT ZERO + /// + public const char zero = '\u0030'; + + /// + /// GREEK SMALL LETTER ZETA + /// + public const char zeta = '\u03B6'; + } +#endif +#endif +} diff --git a/PdfSharp/Fonts/CMapInfo.cs b/PdfSharp/Fonts/CMapInfo.cs new file mode 100644 index 0000000..36e8585 --- /dev/null +++ b/PdfSharp/Fonts/CMapInfo.cs @@ -0,0 +1,141 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Collections.Generic; +using PdfSharp.Fonts.OpenType; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Fonts +{ + /// + /// Helper class that determines the characters used in a particular font. + /// + internal class CMapInfo + { + public CMapInfo(OpenTypeDescriptor descriptor) + { + Debug.Assert(descriptor != null); + _descriptor = descriptor; + } + internal OpenTypeDescriptor _descriptor; + + /// + /// Adds the characters of the specified string to the hashtable. + /// + public void AddChars(string text) + { + if (text != null) + { + bool symbol = _descriptor.FontFace.cmap.symbol; + int length = text.Length; + for (int idx = 0; idx < length; idx++) + { + char ch = text[idx]; + if (!CharacterToGlyphIndex.ContainsKey(ch)) + { + char ch2 = ch; + if (symbol) + { + // Remap ch for symbol fonts. + ch2 = (char)(ch | (_descriptor.FontFace.os2.usFirstCharIndex & 0xFF00)); // @@@ refactor + } + int glyphIndex = _descriptor.CharCodeToGlyphIndex(ch2); + CharacterToGlyphIndex.Add(ch, glyphIndex); + GlyphIndices[glyphIndex] = null; + MinChar = (char)Math.Min(MinChar, ch); + MaxChar = (char)Math.Max(MaxChar, ch); + } + } + } + } + + /// + /// Adds the glyphIndices to the hashtable. + /// + public void AddGlyphIndices(string glyphIndices) + { + if (glyphIndices != null) + { + int length = glyphIndices.Length; + for (int idx = 0; idx < length; idx++) + { + int glyphIndex = glyphIndices[idx]; + GlyphIndices[glyphIndex] = null; + } + } + } + + /// + /// Adds a ANSI characters. + /// + internal void AddAnsiChars() + { + byte[] ansi = new byte[256 - 32]; + for (int idx = 0; idx < 256 - 32; idx++) + ansi[idx] = (byte)(idx + 32); +#if EDF_CORE + string text = null; // PdfEncoders.WinAnsiEncoding.GetString(ansi, 0, ansi.Length); +#else + string text = PdfEncoders.WinAnsiEncoding.GetString(ansi, 0, ansi.Length); +#endif + AddChars(text); + } + + internal bool Contains(char ch) + { + return CharacterToGlyphIndex.ContainsKey(ch); + } + + public char[] Chars + { + get + { + char[] chars = new char[CharacterToGlyphIndex.Count]; + CharacterToGlyphIndex.Keys.CopyTo(chars, 0); + Array.Sort(chars); + return chars; + } + } + + public int[] GetGlyphIndices() + { + int[] indices = new int[GlyphIndices.Count]; + GlyphIndices.Keys.CopyTo(indices, 0); + Array.Sort(indices); + return indices; + } + + public char MinChar = char.MaxValue; + public char MaxChar = char.MinValue; + public Dictionary CharacterToGlyphIndex = new Dictionary(); + public Dictionary GlyphIndices = new Dictionary(); + } +} diff --git a/PdfSharp/Fonts/FontDescriptorCache.cs b/PdfSharp/Fonts/FontDescriptorCache.cs new file mode 100644 index 0000000..365b291 --- /dev/null +++ b/PdfSharp/Fonts/FontDescriptorCache.cs @@ -0,0 +1,174 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using PdfSharp.Drawing; +using PdfSharp.Fonts.OpenType; +using PdfSharp.Internal; + +namespace PdfSharp.Fonts +{ + /// + /// Global table of OpenType font descriptor objects. + /// + internal sealed class FontDescriptorCache + { + FontDescriptorCache() + { + _cache = new Dictionary(); + } + + ///// + ///// Gets the FontDescriptor identified by the specified FontSelector. If no such object + ///// exists, a new FontDescriptor is created and added to the stock. + ///// + //public static FontDescriptor GetOrCreateDescriptor_DEL-ETE(string familyName, XFontStyle stlye, OpenTypeFontface fontface) + //{ + // //FontSelector1 selector = new FontSelector1(familyName, stlye); + // string fontDescriptorKey = null; // FontDescriptor.ComputeKey(familyName, stlye); + // try + // { + // Lock.EnterFontFactory(); + // FontDescriptor descriptor; + // if (!Singleton._cache.TryGetValue(fontDescriptorKey, out descriptor)) + // { + // descriptor = new OpenTypeDescriptor(fontDescriptorKey, familyName, stlye, fontface, null); + // Singleton._cache.Add(fontDescriptorKey, descriptor); + // } + // return descriptor; + // } + // finally { Lock.ExitFontFactory(); } + //} + + /// + /// Gets the FontDescriptor identified by the specified XFont. If no such object + /// exists, a new FontDescriptor is created and added to the cache. + /// + public static FontDescriptor GetOrCreateDescriptorFor(XFont font) + { + if (font == null) + throw new ArgumentNullException("font"); + + //FontSelector1 selector = new FontSelector1(font); + string fontDescriptorKey = FontDescriptor.ComputeKey(font); + try + { + Lock.EnterFontFactory(); + FontDescriptor descriptor; + if (!Singleton._cache.TryGetValue(fontDescriptorKey, out descriptor)) + { + descriptor = new OpenTypeDescriptor(fontDescriptorKey, font); + Singleton._cache.Add(fontDescriptorKey, descriptor); + } + return descriptor; + } + finally { Lock.ExitFontFactory(); } + } + + /// + /// Gets the FontDescriptor identified by the specified FontSelector. If no such object + /// exists, a new FontDescriptor is created and added to the stock. + /// + public static FontDescriptor GetOrCreateDescriptor(string fontFamilyName, XFontStyle style) + { + if (string.IsNullOrEmpty(fontFamilyName)) + throw new ArgumentNullException("fontFamilyName"); + + //FontSelector1 selector = new FontSelector1(fontFamilyName, style); + string fontDescriptorKey = FontDescriptor.ComputeKey(fontFamilyName, style); + try + { + Lock.EnterFontFactory(); + FontDescriptor descriptor; + if (!Singleton._cache.TryGetValue(fontDescriptorKey, out descriptor)) + { + XFont font = new XFont(fontFamilyName, 10, style); + descriptor = GetOrCreateDescriptorFor(font); + if (Singleton._cache.ContainsKey(fontDescriptorKey)) + Singleton.GetType(); + else + Singleton._cache.Add(fontDescriptorKey, descriptor); + } + return descriptor; + } + finally { Lock.ExitFontFactory(); } + } + + public static FontDescriptor GetOrCreateDescriptor(string idName, byte[] fontData) + { + //FontSelector1 selector = new FontSelector1(idName); + string fontDescriptorKey = FontDescriptor.ComputeKey(idName); + try + { + Lock.EnterFontFactory(); + FontDescriptor descriptor; + if (!Singleton._cache.TryGetValue(fontDescriptorKey, out descriptor)) + { + descriptor = GetOrCreateOpenTypeDescriptor(fontDescriptorKey, idName, fontData); + Singleton._cache.Add(fontDescriptorKey, descriptor); + } + return descriptor; + } + finally { Lock.ExitFontFactory(); } + } + + static OpenTypeDescriptor GetOrCreateOpenTypeDescriptor(string fontDescriptorKey, string idName, byte[] fontData) + { + return new OpenTypeDescriptor(fontDescriptorKey, idName, fontData); + } + + /// + /// Gets the singleton. + /// + static FontDescriptorCache Singleton + { + get + { + if (_singleton == null) + { + try + { + Lock.EnterFontFactory(); + if (_singleton == null) + _singleton = new FontDescriptorCache(); + } + finally { Lock.ExitFontFactory(); } + } + return _singleton; + } + } + static volatile FontDescriptorCache _singleton; + + /// + /// Maps font font descriptor key to font descriptor. + /// + readonly Dictionary _cache; + } +} diff --git a/PdfSharp/Fonts/FontFactory.cs b/PdfSharp/Fonts/FontFactory.cs new file mode 100644 index 0000000..dff1b2a --- /dev/null +++ b/PdfSharp/Fonts/FontFactory.cs @@ -0,0 +1,450 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Collections.Generic; +using System.Text; +#if CORE || GDI +using System.Drawing; +using GdiFontFamily = System.Drawing.FontFamily; +using GdiFont = System.Drawing.Font; +#endif +#if WPF +using System.Windows; +using System.Windows.Media; +using System.Windows.Resources; +using WpfFontFamily = System.Windows.Media.FontFamily; +using WpfGlyphTypeface = System.Windows.Media.GlyphTypeface; +using WpfTypeface = System.Windows.Media.Typeface; +#endif +using PdfSharp.Drawing; +using PdfSharp.Fonts.OpenType; +using PdfSharp.Internal; + +#pragma warning disable 1591 +// ReSharper disable RedundantNameQualifier + +namespace PdfSharp.Fonts +{ + /// + /// Provides functionality to map a fontface request to a physical font. + /// + internal static class FontFactory + { + //// Suffix for internal face names to indicate that the font data comes from the platform + //// and not from the users font resolver. + //public const string PlatformTag = "platform:"; + + /// + /// Converts specified information about a required typeface into a specific font. + /// + /// Name of the font family. + /// The font resolving options. + /// Typeface key if already known by caller, null otherwise. + /// + /// Information about the typeface, or null if no typeface can be found. + /// + public static FontResolverInfo ResolveTypeface(string familyName, FontResolvingOptions fontResolvingOptions, string typefaceKey) + { + if (string.IsNullOrEmpty(typefaceKey)) + typefaceKey = XGlyphTypeface.ComputeKey(familyName, fontResolvingOptions); + + try + { + Lock.EnterFontFactory(); + // Was this typeface requested before? + FontResolverInfo fontResolverInfo; + if (FontResolverInfosByName.TryGetValue(typefaceKey, out fontResolverInfo)) + return fontResolverInfo; + + // Case: This typeface was not yet resolved before. + + // Is there a custom font resolver available? + IFontResolver customFontResolver = GlobalFontSettings.FontResolver; + if (customFontResolver != null) + { + // Case: Use custom font resolver. + fontResolverInfo = customFontResolver.ResolveTypeface(familyName, fontResolvingOptions.IsBold, fontResolvingOptions.IsItalic); + + // If resolved by custom font resolver register info and font source. + if (fontResolverInfo != null && !(fontResolverInfo is PlatformFontResolverInfo)) + { + // OverrideStyleSimulations is true only for internal quality tests. + if (fontResolvingOptions.OverrideStyleSimulations) + { + // Override style simulation returned by custom font resolver. + fontResolverInfo = new FontResolverInfo(fontResolverInfo.FaceName, fontResolvingOptions.MustSimulateBold, fontResolvingOptions.MustSimulateItalic, fontResolverInfo.CollectionNumber); + } + + string resolverInfoKey = fontResolverInfo.Key; + FontResolverInfo existingFontResolverInfo; + if (FontResolverInfosByName.TryGetValue(resolverInfoKey, out existingFontResolverInfo)) + { + // Case: A new typeface was resolved with the same info as a previous one. + // Discard new object an reuse previous one. + fontResolverInfo = existingFontResolverInfo; + // Associate with typeface key. + FontResolverInfosByName.Add(typefaceKey, fontResolverInfo); +#if DEBUG + // The font source should exist. + Debug.Assert(FontSourcesByName.ContainsKey(fontResolverInfo.FaceName)); +#endif + } + else + { + // Case: No such font resolver info exists. + // Add to both dictionaries. + FontResolverInfosByName.Add(typefaceKey, fontResolverInfo); + Debug.Assert(resolverInfoKey == fontResolverInfo.Key); + FontResolverInfosByName.Add(resolverInfoKey, fontResolverInfo); + + // Create font source if not yet exists. + XFontSource previousFontSource; + if (FontSourcesByName.TryGetValue(fontResolverInfo.FaceName, out previousFontSource)) + { + // Case: The font source exists, because a previous font resolver info comes + // with the same face name, but was different in style simulation flags. + // Nothing to do. + } + else + { + // Case: Get font from custom font resolver and create font source. + byte[] bytes = customFontResolver.GetFont(fontResolverInfo.FaceName); + XFontSource fontSource = XFontSource.GetOrCreateFrom(bytes); + + // Add font source's font resolver name if it is different to the face name. + if (string.Compare(fontResolverInfo.FaceName, fontSource.FontName, StringComparison.OrdinalIgnoreCase) != 0) + FontSourcesByName.Add(fontResolverInfo.FaceName, fontSource); + } + } + } + } + else + { + // Case: There was no custom font resolver set. + // Use platform font resolver. + // If it was successful resolver info and font source are cached + // automatically by PlatformFontResolver.ResolveTypeface. + fontResolverInfo = PlatformFontResolver.ResolveTypeface(familyName, fontResolvingOptions, typefaceKey); + } + + // Return value is null if the typeface could not be resolved. + // In this case PDFsharp stops. + return fontResolverInfo; + } + finally { Lock.ExitFontFactory(); } + } + +#if GDI + /// + /// Registers the font face. + /// + public static XFontSource RegisterFontFace(byte[] fontBytes) + { + try + { + Lock.EnterFontFactory(); + ulong key = FontHelper.CalcChecksum(fontBytes); + XFontSource fontSource; + if (FontSourcesByKey.TryGetValue(key, out fontSource)) + { + throw new InvalidOperationException("Font face already registered."); + } + fontSource = XFontSource.GetOrCreateFrom(fontBytes); + Debug.Assert(FontSourcesByKey.ContainsKey(key)); + Debug.Assert(fontSource.Fontface != null); + + //fontSource.Fontface = new OpenTypeFontface(fontSource); + //FontSourcesByKey.Add(checksum, fontSource); + //FontSourcesByFontName.Add(fontSource.FontName, fontSource); + + XGlyphTypeface glyphTypeface = new XGlyphTypeface(fontSource); + FontSourcesByName.Add(glyphTypeface.Key, fontSource); + GlyphTypefaceCache.AddGlyphTypeface(glyphTypeface); + return fontSource; + } + finally { Lock.ExitFontFactory(); } + } +#endif + + /// + /// Gets the bytes of a physical font with specified face name. + /// + public static XFontSource GetFontSourceByFontName(string fontName) + { + XFontSource fontSource; + if (FontSourcesByName.TryGetValue(fontName, out fontSource)) + return fontSource; + + Debug.Assert(false, string.Format("An XFontSource with the name '{0}' does not exists.", fontName)); + return null; + } + + /// + /// Gets the bytes of a physical font with specified face name. + /// + public static XFontSource GetFontSourceByTypefaceKey(string typefaceKey) + { + XFontSource fontSource; + if (FontSourcesByName.TryGetValue(typefaceKey, out fontSource)) + return fontSource; + + Debug.Assert(false, string.Format("An XFontSource with the typeface key '{0}' does not exists.", typefaceKey)); + return null; + } + + public static bool TryGetFontSourceByKey(ulong key, out XFontSource fontSource) + { + return FontSourcesByKey.TryGetValue(key, out fontSource); + } + + /// + /// Gets a value indicating whether at least one font source was created. + /// + public static bool HasFontSources + { + get { return FontSourcesByName.Count > 0; } + } + + public static bool TryGetFontResolverInfoByTypefaceKey(string typeFaceKey, out FontResolverInfo info) + { + return FontResolverInfosByName.TryGetValue(typeFaceKey, out info); + } + + public static bool TryGetFontSourceByTypefaceKey(string typefaceKey, out XFontSource source) + { + return FontSourcesByName.TryGetValue(typefaceKey, out source); + } + + //public static bool TryGetFontSourceByFaceName(string faceName, out XFontSource source) + //{ + // return FontSourcesByName.TryGetValue(faceName, out source); + //} + + internal static void CacheFontResolverInfo(string typefaceKey, FontResolverInfo fontResolverInfo) + { + FontResolverInfo existingfFontResolverInfo; + // Check whether identical font is already registered. + if (FontResolverInfosByName.TryGetValue(typefaceKey, out existingfFontResolverInfo)) + { + // Should never come here. + throw new InvalidOperationException(string.Format("A font file with different content already exists with the specified face name '{0}'.", typefaceKey)); + } + if (FontResolverInfosByName.TryGetValue(fontResolverInfo.Key, out existingfFontResolverInfo)) + { + // Should never come here. + throw new InvalidOperationException(string.Format("A font resolver already exists with the specified key '{0}'.", fontResolverInfo.Key)); + } + // Add to both dictionaries. + FontResolverInfosByName.Add(typefaceKey, fontResolverInfo); + FontResolverInfosByName.Add(fontResolverInfo.Key, fontResolverInfo); + } + + /// + /// Caches a font source under its face name and its key. + /// + public static XFontSource CacheFontSource(XFontSource fontSource) + { + try + { + Lock.EnterFontFactory(); + // Check whether an identical font source with a different face name already exists. + XFontSource existingFontSource; + if (FontSourcesByKey.TryGetValue(fontSource.Key, out existingFontSource)) + { +#if DEBUG + // Fonts have same length and check sum. Now check byte by byte identity. + int length = fontSource.Bytes.Length; + for (int idx = 0; idx < length; idx++) + { + if (existingFontSource.Bytes[idx] != fontSource.Bytes[idx]) + { + //Debug.Assert(false,"Two fonts with identical checksum found."); + break; + //goto FontsAreNotIdentical; + } + } + Debug.Assert(existingFontSource.Fontface != null); +#endif + return existingFontSource; + + //FontsAreNotIdentical: + //// Incredible rare case: Two different fonts have the same size and check sum. + //// Give the new one a new key until it do not clash with an existing one. + //while (FontSourcesByKey.ContainsKey(fontSource.Key)) + // fontSource.IncrementKey(); + } + + OpenTypeFontface fontface = fontSource.Fontface; + if (fontface == null) + { + // Create OpenType fontface for this font source. + fontSource.Fontface = new OpenTypeFontface(fontSource); + } + FontSourcesByKey.Add(fontSource.Key, fontSource); + FontSourcesByName.Add(fontSource.FontName, fontSource); + return fontSource; + } + finally { Lock.ExitFontFactory(); } + } + + /// + /// Caches a font source under its face name and its key. + /// + public static XFontSource CacheNewFontSource(string typefaceKey, XFontSource fontSource) + { + // Debug.Assert(!FontSourcesByFaceName.ContainsKey(fontSource.FaceName)); + + // Check whether an identical font source with a different face name already exists. + XFontSource existingFontSource; + if (FontSourcesByKey.TryGetValue(fontSource.Key, out existingFontSource)) + { + //// Fonts have same length and check sum. Now check byte by byte identity. + //int length = fontSource.Bytes.Length; + //for (int idx = 0; idx < length; idx++) + //{ + // if (existingFontSource.Bytes[idx] != fontSource.Bytes[idx]) + // { + // goto FontsAreNotIdentical; + // } + //} + return existingFontSource; + + ////// The bytes are really identical. Register font source again with the new face name + ////// but return the existing one to save memory. + ////FontSourcesByFaceName.Add(fontSource.FaceName, existingFontSource); + ////return existingFontSource; + + //FontsAreNotIdentical: + //// Incredible rare case: Two different fonts have the same size and check sum. + //// Give the new one a new key until it do not clash with an existing one. + //while (FontSourcesByKey.ContainsKey(fontSource.Key)) + // fontSource.IncrementKey(); + } + + OpenTypeFontface fontface = fontSource.Fontface; + if (fontface == null) + { + fontface = new OpenTypeFontface(fontSource); + fontSource.Fontface = fontface; // Also sets the font name in fontSource + } + + FontSourcesByName.Add(typefaceKey, fontSource); + FontSourcesByName.Add(fontSource.FontName, fontSource); + FontSourcesByKey.Add(fontSource.Key, fontSource); + + return fontSource; + } + + public static void CacheExistingFontSourceWithNewTypefaceKey(string typefaceKey, XFontSource fontSource) + { + try + { + Lock.EnterFontFactory(); + FontSourcesByName.Add(typefaceKey, fontSource); + } + finally { Lock.ExitFontFactory(); } + } + + internal static string GetFontCachesState() + { + StringBuilder state = new StringBuilder(); + string[] keys; + int count; + + // FontResolverInfo by name. + state.Append("====================\n"); + state.Append("Font resolver info by name\n"); + Dictionary.KeyCollection keyCollection = FontResolverInfosByName.Keys; + count = keyCollection.Count; + keys = new string[count]; + keyCollection.CopyTo(keys, 0); + Array.Sort(keys, StringComparer.OrdinalIgnoreCase); + foreach (string key in keys) + state.AppendFormat(" {0}: {1}\n", key, FontResolverInfosByName[key].DebuggerDisplay); + state.Append("\n"); + + // FontSource by key. + state.Append("Font source by key and name\n"); + Dictionary.KeyCollection fontSourceKeys = FontSourcesByKey.Keys; + count = fontSourceKeys.Count; + ulong[] ulKeys = new ulong[count]; + fontSourceKeys.CopyTo(ulKeys, 0); + Array.Sort(ulKeys, delegate (ulong x, ulong y) { return x == y ? 0 : (x > y ? 1 : -1); }); + foreach (ulong ul in ulKeys) + state.AppendFormat(" {0}: {1}\n", ul, FontSourcesByKey[ul].DebuggerDisplay); + Dictionary.KeyCollection fontSourceNames = FontSourcesByName.Keys; + count = fontSourceNames.Count; + keys = new string[count]; + fontSourceNames.CopyTo(keys, 0); + Array.Sort(keys, StringComparer.OrdinalIgnoreCase); + foreach (string key in keys) + state.AppendFormat(" {0}: {1}\n", key, FontSourcesByName[key].DebuggerDisplay); + state.Append("--------------------\n\n"); + + // FontFamilyInternal by name. + state.Append(FontFamilyCache.GetCacheState()); + // XGlyphTypeface by name. + state.Append(GlyphTypefaceCache.GetCacheState()); + // OpenTypeFontface by name. + state.Append(OpenTypeFontfaceCache.GetCacheState()); + return state.ToString(); + } + + // TODO: Move to ctor + + /// + /// Maps font typeface key to font resolver info. + /// + //static readonly Dictionary FontResolverInfosByTypefaceKey = new Dictionary(StringComparer.OrdinalIgnoreCase); + static readonly Dictionary FontResolverInfosByName = new Dictionary(StringComparer.OrdinalIgnoreCase); + + ///// + ///// Maps font resolver info key to font resolver info. + ///// + //static readonly Dictionary FontResolverInfosByKey = new Dictionary(); + + /// + /// Maps typeface key or font name to font source. + /// + //static readonly Dictionary FontSourcesByTypefaceKey = new Dictionary(StringComparer.OrdinalIgnoreCase); + static readonly Dictionary FontSourcesByName = new Dictionary(StringComparer.OrdinalIgnoreCase); + + ///// + ///// Maps font name to font source. + ///// + //static readonly Dictionary FontSourcesByFontName = new Dictionary(); + + /// + /// Maps font source key to font source. + /// + static readonly Dictionary FontSourcesByKey = new Dictionary(); + } +} diff --git a/PdfSharp/Fonts/FontResolverInfo.cs b/PdfSharp/Fonts/FontResolverInfo.cs new file mode 100644 index 0000000..ad61739 --- /dev/null +++ b/PdfSharp/Fonts/FontResolverInfo.cs @@ -0,0 +1,211 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using PdfSharp.Drawing; +#if CORE +using System.Drawing; +#endif +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Fonts +{ + // The English terms font, font family, typeface, glyph etc. are sometimes confusingly used. + // Here a short clarification by Wikipedia. + // + // Wikipedia EN -> DE + // Font -> Schriftschnitt + // Computer font -> Font (Informationstechnik) + // Typeface (Font family) -> Schriftart / Schriftfamilie + // Glyph -> Glyphe + // + // It seems that typeface and font family are synonyms in English. + // In WPF a family name is used as a term for a bunch of fonts that share the same + // characteristics, like Univers or Times New Roman. + // In WPF a fontface describes a request of a font of a particular font family, e.g. + // Univers medium bold italic. + // In WPF a glyph typeface is the result of requesting a typeface, i.e. a physical font + // plus the information whether bold and/or italic should be simulated. + // + // Wikipedia DE -> EN + // Schriftart -> Typeface + // Schriftschnitt -> Font + // Schriftfamilie -> ~ (means Font family) + // Schriftsippe -> Font superfamily + // Font -> Computer font + // + // http://en.wikipedia.org/wiki/Font + // http://en.wikipedia.org/wiki/Computer_font + // http://en.wikipedia.org/wiki/Typeface + // http://en.wikipedia.org/wiki/Glyph + // http://en.wikipedia.org/wiki/Typographic_unit + // + // FaceName: A unique and only internally used name of a glyph typeface. In other words the name of the font data that represents a specific font. + // + // + + /// + /// Describes the physical font that must be used to render a particular XFont. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + public class FontResolverInfo + { + private const string KeyPrefix = "frik:"; // Font Resolver Info Key + + /// + /// Initializes a new instance of the struct. + /// + /// The name that uniquely identifies the fontface. + public FontResolverInfo(string faceName) : + this(faceName, false, false, 0) + { } + + /// + /// Initializes a new instance of the struct. + /// + /// The name that uniquely identifies the fontface. + /// Set to true to simulate bold when rendered. Not implemented and must be false. + /// Set to true to simulate italic when rendered. + /// Index of the font in a true type font collection. + /// Not yet implemented and must be zero. + /// + internal FontResolverInfo(string faceName, bool mustSimulateBold, bool mustSimulateItalic, int collectionNumber) + { + if (String.IsNullOrEmpty(faceName)) + throw new ArgumentNullException("faceName"); + if (collectionNumber != 0) + throw new NotImplementedException("collectionNumber is not yet implemented and must be 0."); + + _faceName = faceName; + _mustSimulateBold = mustSimulateBold; + _mustSimulateItalic = mustSimulateItalic; + _collectionNumber = collectionNumber; + } + + /// + /// Initializes a new instance of the struct. + /// + /// The name that uniquely identifies the fontface. + /// Set to true to simulate bold when rendered. Not implemented and must be false. + /// Set to true to simulate italic when rendered. + public FontResolverInfo(string faceName, bool mustSimulateBold, bool mustSimulateItalic) + : this(faceName, mustSimulateBold, mustSimulateItalic, 0) + { } + + /// + /// Initializes a new instance of the struct. + /// + /// The name that uniquely identifies the fontface. + /// The style simulation flags. + public FontResolverInfo(string faceName, XStyleSimulations styleSimulations) + : this(faceName, + (styleSimulations & XStyleSimulations.BoldSimulation) == XStyleSimulations.BoldSimulation, + (styleSimulations & XStyleSimulations.ItalicSimulation) == XStyleSimulations.ItalicSimulation, 0) + { } + + /// + /// Gets the key for this object. + /// + internal string Key + { + get + { + return _key ?? (_key = KeyPrefix + _faceName.ToLowerInvariant() + + '/' + (_mustSimulateBold ? "b+" : "b-") + (_mustSimulateItalic ? "i+" : "i-")); + } + } + string _key; + + /// + /// A name that uniquely identifies the font (not the family), e.g. the file name of the font. PDFsharp does not use this + /// name internally, but passes it to the GetFont function of the IFontResolver interface to retrieve the font data. + /// + public string FaceName + { + get { return _faceName; } + } + readonly string _faceName; + + /// + /// Indicates whether bold must be simulated. Bold simulation is not implemented in PDFsharp. + /// + public bool MustSimulateBold + { + get { return _mustSimulateBold; } + } + readonly bool _mustSimulateBold; + + /// + /// Indicates whether italic must be simulated. + /// + public bool MustSimulateItalic + { + get { return _mustSimulateItalic; } + } + readonly bool _mustSimulateItalic; + + /// + /// Gets the style simulation flags. + /// + public XStyleSimulations StyleSimulations + { + get { return (_mustSimulateBold ? XStyleSimulations.BoldSimulation : 0) | (_mustSimulateItalic ? XStyleSimulations.ItalicSimulation : 0); } + } + + /// + /// The number of the font in a Truetype font collection file. The number of the first font is 0. + /// NOT YET IMPLEMENTED. Must be zero. + /// + internal int CollectionNumber // TODO : Find a better name. + { + get { return _collectionNumber; } + } + readonly int _collectionNumber; + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + internal string DebuggerDisplay + { + get + { + return string.Format(CultureInfo.InvariantCulture, "FontResolverInfo: '{0}',{1}{2}", FaceName, + MustSimulateBold ? " simulate Bold" : "", + MustSimulateItalic ? " simulate Italic" : ""); + } + } + } +} diff --git a/PdfSharp/Fonts/FontResolvingOptions.cs b/PdfSharp/Fonts/FontResolvingOptions.cs new file mode 100644 index 0000000..427b151 --- /dev/null +++ b/PdfSharp/Fonts/FontResolvingOptions.cs @@ -0,0 +1,89 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Text; +#endif +#if WPF +using System.Windows.Media; +#endif +using PdfSharp.Drawing; + +namespace PdfSharp.Fonts +{ + /// + /// Parameters that affect font selection. + /// + class FontResolvingOptions + { + public FontResolvingOptions(XFontStyle fontStyle) + { + FontStyle = fontStyle; + } + + public FontResolvingOptions(XFontStyle fontStyle, XStyleSimulations styleSimulations) + { + FontStyle = fontStyle; + OverrideStyleSimulations = true; + StyleSimulations = styleSimulations; + } + + public bool IsBold + { + get { return (FontStyle & XFontStyle.Bold) == XFontStyle.Bold; } + } + + public bool IsItalic + { + get { return (FontStyle & XFontStyle.Italic) == XFontStyle.Italic; } + } + + public bool IsBoldItalic + { + get { return (FontStyle & XFontStyle.BoldItalic) == XFontStyle.BoldItalic; } + } + + public bool MustSimulateBold + { + get { return (StyleSimulations & XStyleSimulations.BoldSimulation) == XStyleSimulations.BoldSimulation; } + } + + public bool MustSimulateItalic + { + get { return (StyleSimulations & XStyleSimulations.ItalicSimulation) == XStyleSimulations.ItalicSimulation; } + } + + public XFontStyle FontStyle; + + public bool OverrideStyleSimulations; + + public XStyleSimulations StyleSimulations; + } +} diff --git a/PdfSharp/Fonts/FontWriter.cs b/PdfSharp/Fonts/FontWriter.cs new file mode 100644 index 0000000..b8b556a --- /dev/null +++ b/PdfSharp/Fonts/FontWriter.cs @@ -0,0 +1,176 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.IO; + +namespace PdfSharp.Fonts +{ + /// + /// Represents a writer for generation of font file streams. + /// + internal class FontWriter + { + /// + /// Initializes a new instance of the class. + /// Data is written in Motorola format (big-endian). + /// + public FontWriter(Stream stream) + { + _stream = stream; + } + + /// + /// Closes the writer and, if specified, the underlying stream. + /// + public void Close(bool closeUnderlyingStream) + { + if (_stream != null && closeUnderlyingStream) + { +#if !UWP + _stream.Close(); +#endif + _stream.Dispose(); + } + _stream = null; + } + + /// + /// Closes the writer and the underlying stream. + /// + public void Close() + { + Close(true); + } + + /// + /// Gets or sets the position within the stream. + /// + public int Position + { + get { return (int)_stream.Position; } + set { _stream.Position = value; } + } + + /// + /// Writes the specified value to the font stream. + /// + public void WriteByte(byte value) + { + _stream.WriteByte(value); + } + + /// + /// Writes the specified value to the font stream. + /// + public void WriteByte(int value) + { + _stream.WriteByte((byte)value); + } + + /// + /// Writes the specified value to the font stream using big-endian. + /// + public void WriteShort(short value) + { + _stream.WriteByte((byte)(value >> 8)); + _stream.WriteByte((byte)value); + } + + /// + /// Writes the specified value to the font stream using big-endian. + /// + public void WriteShort(int value) + { + WriteShort((short)value); + } + + /// + /// Writes the specified value to the font stream using big-endian. + /// + public void WriteUShort(ushort value) + { + _stream.WriteByte((byte)(value >> 8)); + _stream.WriteByte((byte)value); + } + + /// + /// Writes the specified value to the font stream using big-endian. + /// + public void WriteUShort(int value) + { + WriteUShort((ushort)value); + } + + /// + /// Writes the specified value to the font stream using big-endian. + /// + public void WriteInt(int value) + { + _stream.WriteByte((byte)(value >> 24)); + _stream.WriteByte((byte)(value >> 16)); + _stream.WriteByte((byte)(value >> 8)); + _stream.WriteByte((byte)value); + } + + /// + /// Writes the specified value to the font stream using big-endian. + /// + public void WriteUInt(uint value) + { + _stream.WriteByte((byte)(value >> 24)); + _stream.WriteByte((byte)(value >> 16)); + _stream.WriteByte((byte)(value >> 8)); + _stream.WriteByte((byte)value); + } + + //public short ReadFWord() + //public ushort ReadUFWord() + //public long ReadLongDate() + //public string ReadString(int size) + + public void Write(byte[] buffer) + { + _stream.Write(buffer, 0, buffer.Length); + } + + public void Write(byte[] buffer, int offset, int count) + { + _stream.Write(buffer, offset, count); + } + + /// + /// Gets the underlying stream. + /// + internal Stream Stream + { + get { return _stream; } + } + Stream _stream; + } +} diff --git a/PdfSharp/Fonts/GlobalFontSettings.cs b/PdfSharp/Fonts/GlobalFontSettings.cs new file mode 100644 index 0000000..d4c1d9d --- /dev/null +++ b/PdfSharp/Fonts/GlobalFontSettings.cs @@ -0,0 +1,116 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Internal; +using PdfSharp.Pdf; + +namespace PdfSharp.Fonts +{ + /// + /// Provides functionality to specify information about the handling of fonts in the current application domain. + /// + public static class GlobalFontSettings + { + /// + /// The name of the default font. + /// + public const string DefaultFontName = "PlatformDefault"; + + /// + /// Gets or sets the global font resolver for the current application domain. + /// This static function must be called only once and before any font operation was executed by PDFsharp. + /// If this is not easily to obtain, e.g. because your code is running on a web server, you must provide the + /// same instance of your font resolver in every subsequent setting of this property. + /// In a web application set the font resolver in Global.asax. + /// + public static IFontResolver FontResolver + { + get { return _fontResolver; } + set + { + // Cannot remove font resolver. + if (value == null) + throw new ArgumentNullException(); + + try + { + Lock.EnterFontFactory(); + // Ignore multiple setting e.g. in a web application. + if (ReferenceEquals(_fontResolver, value)) + return; + + if (FontFactory.HasFontSources) + throw new InvalidOperationException("Must not change font resolver after is was once used."); + + _fontResolver = value; + } + finally { Lock.ExitFontFactory(); } + } + } + static IFontResolver _fontResolver; + + /// + /// Gets or sets the default font encoding used for XFont objects where encoding is not explicitly specified. + /// If it is not set, the default value is PdfFontEncoding.Unicode. + /// If you are sure your document contains only Windows-1252 characters (see https://en.wikipedia.org/wiki/Windows-1252) + /// set default encoding to PdfFontEncodingj.Windows1252. + /// Must be set only once per app domain. + /// + public static PdfFontEncoding DefaultFontEncoding + { + get + { + if (!_fontEncodingInitialized) + DefaultFontEncoding = PdfFontEncoding.Unicode; + return _fontEncoding; + } + set + { + try + { + Lock.EnterFontFactory(); + if (_fontEncodingInitialized) + { + // Ignore multiple setting e.g. in a web application. + if (_fontEncoding == value) + return; + throw new InvalidOperationException("Must not change DefaultFontEncoding after is was set once."); + } + + _fontEncoding = value; + _fontEncodingInitialized = true; + } + finally { Lock.ExitFontFactory(); } + } + } + static PdfFontEncoding _fontEncoding; + static bool _fontEncodingInitialized; + } +} \ No newline at end of file diff --git a/PdfSharp/Fonts/IFontResolver.cs b/PdfSharp/Fonts/IFontResolver.cs new file mode 100644 index 0000000..23889bd --- /dev/null +++ b/PdfSharp/Fonts/IFontResolver.cs @@ -0,0 +1,54 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Fonts +{ + /// + /// Provides functionality that converts a requested typeface into a physical font. + /// + public interface IFontResolver + { + /// + /// Converts specified information about a required typeface into a specific font. + /// + /// Name of the font family. + /// Set to true when a bold fontface is required. + /// Set to true when an italic fontface is required. + /// Information about the physical font, or null if the request cannot be satisfied. + FontResolverInfo ResolveTypeface(string familyName, bool isBold, bool isItalic); + + //FontResolverInfo ResolveTypeface(Typeface); TODO in PDFsharp 2.0 + + /// + /// Gets the bytes of a physical font with specified face name. + /// + /// A face name previously retrieved by ResolveTypeface. + byte[] GetFont(string faceName); + } +} \ No newline at end of file diff --git a/PdfSharp/Fonts/PlatformFontResolver.cs b/PdfSharp/Fonts/PlatformFontResolver.cs new file mode 100644 index 0000000..c7cb4b0 --- /dev/null +++ b/PdfSharp/Fonts/PlatformFontResolver.cs @@ -0,0 +1,337 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +#if CORE || GDI +using System.Drawing; +using System.Drawing.Drawing2D; +using GdiFontFamily = System.Drawing.FontFamily; +using GdiFont = System.Drawing.Font; +using GdiFontStyle = System.Drawing.FontStyle; +#endif +#if WPF +using System.Windows; +using System.Windows.Documents; +using System.Windows.Media; +using WpfFontFamily = System.Windows.Media.FontFamily; +using WpfTypeface = System.Windows.Media.Typeface; +using WpfGlyphTypeface = System.Windows.Media.GlyphTypeface; +using WpfStyleSimulations = System.Windows.Media.StyleSimulations; +#endif +using PdfSharp.Drawing; + +#pragma warning disable 1591 +// ReSharper disable RedundantNameQualifier + +namespace PdfSharp.Fonts +{ + /// + /// Default platform specific font resolving. + /// + public static class PlatformFontResolver + { + /// + /// Resolves the typeface by generating a font resolver info. + /// + /// Name of the font family. + /// Indicates whether a bold font is requested. + /// Indicates whether an italic font is requested. + public static FontResolverInfo ResolveTypeface(string familyName, bool isBold, bool isItalic) + { + FontResolvingOptions fontResolvingOptions = new FontResolvingOptions(FontHelper.CreateStyle(isBold, isItalic)); + return ResolveTypeface(familyName, fontResolvingOptions, XGlyphTypeface.ComputeKey(familyName, fontResolvingOptions)); + } + + /// + /// Internal implementation. + /// + internal static FontResolverInfo ResolveTypeface(string familyName, FontResolvingOptions fontResolvingOptions, string typefaceKey) + { + // Internally we often have the typeface key already. + if (string.IsNullOrEmpty(typefaceKey)) + typefaceKey = XGlyphTypeface.ComputeKey(familyName, fontResolvingOptions); + + // The user may call ResolveTypeface anytime from anywhere, so check cache in FontFactory in the first place. + FontResolverInfo fontResolverInfo; + if (FontFactory.TryGetFontResolverInfoByTypefaceKey(typefaceKey, out fontResolverInfo)) + return fontResolverInfo; + + // Let the platform create the requested font source and save both PlattformResolverInfo + // and XFontSource in FontFactory cache. + // It is possible that we already have the correct font source. E.g. we already have the regular typeface in cache + // and looking now for the italic typeface, but no such font exists. In this case we get the regular font source + // and cache again it with the italic typeface key. Furthermore in glyph typeface style simulation for italic is set. +#if (CORE || GDI) && !WPF + GdiFont gdiFont; + XFontSource fontSource = CreateFontSource(familyName, fontResolvingOptions, out gdiFont, typefaceKey); +#endif +#if WPF && !SILVERLIGHT + WpfFontFamily wpfFontFamily; + WpfTypeface wpfTypeface; + WpfGlyphTypeface wpfGlyphTypeface; + XFontSource fontSource = CreateFontSource(familyName, fontResolvingOptions, out wpfFontFamily, out wpfTypeface, out wpfGlyphTypeface, typefaceKey); +#endif +#if SILVERLIGHT + //GlyphTypeface wpfGlyphTypeface; + XFontSource fontSource = null;//CreateFontSource(familyName, isBold, isItalic, out wpfGlyphTypeface, typefaceKey); +#endif +#if NETFX_CORE || UWP + //GlyphTypeface wpfGlyphTypeface; + XFontSource fontSource = null;//CreateFontSource(familyName, isBold, isItalic, out wpfGlyphTypeface, typefaceKey); +#endif + // If no such font exists return null. PDFsharp will fail. + if (fontSource == null) + return null; + + //#if (CORE || GDI) && !WPF + // // TODO: Support style simulation for GDI+ platform fonts. + // fontResolverInfo = new PlatformFontResolverInfo(typefaceKey, false, false, gdiFont); + //#endif + if (fontResolvingOptions.OverrideStyleSimulations) + { +#if (CORE || GDI) && !WPF + // TODO: Support style simulation for GDI+ platform fonts. + fontResolverInfo = new PlatformFontResolverInfo(typefaceKey, fontResolvingOptions.MustSimulateBold, fontResolvingOptions.MustSimulateItalic, gdiFont); +#endif +#if WPF && !SILVERLIGHT + fontResolverInfo = new PlatformFontResolverInfo(typefaceKey, fontResolvingOptions.MustSimulateBold, fontResolvingOptions.MustSimulateItalic, + wpfFontFamily, wpfTypeface, wpfGlyphTypeface); +#endif + } + else + { +#if (CORE || GDI) && !WPF + bool mustSimulateBold = gdiFont.Bold && !fontSource.Fontface.os2.IsBold; + bool mustSimulateItalic = gdiFont.Italic && !fontSource.Fontface.os2.IsItalic; + fontResolverInfo = new PlatformFontResolverInfo(typefaceKey, mustSimulateBold, mustSimulateItalic, gdiFont); +#endif +#if WPF && !SILVERLIGHT + // WPF knows what styles have to be simulated. + bool mustSimulateBold = (wpfGlyphTypeface.StyleSimulations & WpfStyleSimulations.BoldSimulation) == WpfStyleSimulations.BoldSimulation; + bool mustSimulateItalic = (wpfGlyphTypeface.StyleSimulations & WpfStyleSimulations.ItalicSimulation) == WpfStyleSimulations.ItalicSimulation; + + // Weird behavior of WPF is fixed here in case we request a bold italic typeface. + // If only italic is available, bold is simulated based on italic. + // If only bold is available, italic is simulated based on bold. + // But if both bold and italic is available, italic face is used and bold is simulated. + // The latter case is reversed here, i.e. bold face is used and italic is simulated. + if (fontResolvingOptions.IsBoldItalic && mustSimulateBold && !mustSimulateItalic) + { + // Try to get the bold typeface. + string typefaceKeyBold = XGlyphTypeface.ComputeKey(familyName, true, false); + FontResolverInfo infoBold = ResolveTypeface(familyName, + new FontResolvingOptions(FontHelper.CreateStyle(true, false)), typefaceKeyBold); + // Use it if it does not base on simulation. + if (infoBold != null && infoBold.StyleSimulations == XStyleSimulations.None) + { + // Use existing bold typeface and simulate italic. + fontResolverInfo = new PlatformFontResolverInfo(typefaceKeyBold, false, true, + wpfFontFamily, wpfTypeface, wpfGlyphTypeface); + } + else + { + // Simulate both. + fontResolverInfo = new PlatformFontResolverInfo(typefaceKey, true, true, + wpfFontFamily, wpfTypeface, wpfGlyphTypeface); + } + } + else + { + fontResolverInfo = new PlatformFontResolverInfo(typefaceKey, mustSimulateBold, mustSimulateItalic, + wpfFontFamily, wpfTypeface, wpfGlyphTypeface); + } +#endif + } + +#if SILVERLIGHT + fontResolverInfo = null; //new PlattformResolverInfo(typefaceKey, false, false, wpfGlyphTypeface); +#endif + FontFactory.CacheFontResolverInfo(typefaceKey, fontResolverInfo); + + // Register font data under the platform specific face name. + // Already done in CreateFontSource. + // FontFactory.CacheNewFontSource(typefaceKey, fontSource); + + return fontResolverInfo; + } + +#if (CORE_WITH_GDI || GDI) && !WPF + /// + /// Create a GDI+ font and use its handle to retrieve font data using native calls. + /// + internal static XFontSource CreateFontSource(string familyName, FontResolvingOptions fontResolvingOptions, out GdiFont font, string typefaceKey) + { + if (string.IsNullOrEmpty(typefaceKey)) + typefaceKey = XGlyphTypeface.ComputeKey(familyName, fontResolvingOptions); +#if true_ + if (familyName == "Cambria") + Debug-Break.Break(); +#endif + GdiFontStyle gdiStyle = (GdiFontStyle)(fontResolvingOptions.FontStyle & XFontStyle.BoldItalic); + + // Create a 10 point GDI+ font as an exemplar. + XFontSource fontSource; + font = FontHelper.CreateFont(familyName, 10, gdiStyle, out fontSource); + + if (fontSource != null) + { + Debug.Assert(font != null); + // Case: Font was created by a GDI+ private font collection. +#if true +#if DEBUG + XFontSource existingFontSource; + Debug.Assert(FontFactory.TryGetFontSourceByTypefaceKey(typefaceKey, out existingFontSource) && + ReferenceEquals(fontSource, existingFontSource)); +#endif +#else + // Win32 API cannot get font data from fonts created by private font collection, + // because this is handled internally in GDI+. + // Therefore the font source was created when the private font is added to the private font collection. + if (!FontFactory.TryGetFontSourceByTypefaceKey(typefaceKey, out fontSource)) + { + // Simplify styles. + // (The code is written for clarity - do not rearrange for optimization) + if (font.Bold && font.Italic) + { + if (FontFactory.TryGetFontSourceByTypefaceKey(XGlyphTypeface.ComputeKey(font.Name, true, false), out fontSource)) + { + // Use bold font. + FontFactory.CacheExistingFontSourceWithNewTypefaceKey(typefaceKey, fontSource); + } + else if (FontFactory.TryGetFontSourceByTypefaceKey(XGlyphTypeface.ComputeKey(font.Name, false, true), out fontSource)) + { + // Use italic font. + FontFactory.CacheExistingFontSourceWithNewTypefaceKey(typefaceKey, fontSource); + } + else if (FontFactory.TryGetFontSourceByTypefaceKey(XGlyphTypeface.ComputeKey(font.Name, false, false), out fontSource)) + { + // Use regular font. + FontFactory.CacheExistingFontSourceWithNewTypefaceKey(typefaceKey, fontSource); + } + } + else if (font.Bold || font.Italic) + { + // Use regular font. + if (FontFactory.TryGetFontSourceByTypefaceKey(XGlyphTypeface.ComputeKey(font.Name, false, false), out fontSource)) + { + FontFactory.CacheExistingFontSourceWithNewTypefaceKey(typefaceKey, fontSource); + } + } + else + { + if (FontFactory.TryGetFontSourceByTypefaceKey(XGlyphTypeface.ComputeKey(font.Name, false, false), out fontSource)) + { + // Should never come here... + FontFactory.CacheExistingFontSourceWithNewTypefaceKey(typefaceKey, fontSource); + } + } + } +#endif + } + else + { + // Get or create the font source and cache it under the specified typeface key. + fontSource = XFontSource.GetOrCreateFromGdi(typefaceKey, font); + } + return fontSource; + } +#endif + +#if WPF && !SILVERLIGHT + /// + /// Create a WPF GlyphTypeface and retrieve font data from it. + /// + internal static XFontSource CreateFontSource(string familyName, FontResolvingOptions fontResolvingOptions, + out WpfFontFamily wpfFontFamily, out WpfTypeface wpfTypeface, out WpfGlyphTypeface wpfGlyphTypeface, string typefaceKey) + { + if (string.IsNullOrEmpty(typefaceKey)) + typefaceKey = XGlyphTypeface.ComputeKey(familyName, fontResolvingOptions); + XFontStyle style = fontResolvingOptions.FontStyle; + +#if DEBUG + if (StringComparer.OrdinalIgnoreCase.Compare(familyName, "Segoe UI Semilight") == 0 + && (style & XFontStyle.BoldItalic) == XFontStyle.Italic) + familyName.GetType(); +#endif + + // Use WPF technique to create font data. + wpfTypeface = XPrivateFontCollection.TryCreateTypeface(familyName, style, out wpfFontFamily); +#if DEBUG__ + if (wpfTypeface != null) + { + WpfGlyphTypeface glyphTypeface; + ICollection list = wpfFontFamily.GetTypefaces(); + foreach (WpfTypeface tf in list) + { + if (!tf.TryGetGlyphTypeface(out glyphTypeface)) + Debug-Break.Break(); + } + + //if (!WpfTypeface.TryGetGlyphTypeface(out glyphTypeface)) + // throw new InvalidOperationException(PSSR.CannotGetGlyphTypeface(familyName)); + } +#endif + if (wpfFontFamily == null) + wpfFontFamily = new WpfFontFamily(familyName); + + if (wpfTypeface == null) + wpfTypeface = FontHelper.CreateTypeface(wpfFontFamily, style); + + // Let WPF choose the right glyph typeface. + if (!wpfTypeface.TryGetGlyphTypeface(out wpfGlyphTypeface)) + throw new InvalidOperationException(PSSR.CannotGetGlyphTypeface(familyName)); + + // Get or create the font source and cache it under the specified typeface key. + XFontSource fontSource = XFontSource.GetOrCreateFromWpf(typefaceKey, wpfGlyphTypeface); + return fontSource; + } +#endif + +#if SILVERLIGHT + /// + /// Silverlight has no access to the bytes of its fonts and therefore return null. + /// + internal static XFontSource CreateFontSource(string familyName, bool isBold, bool isItalic) + { + // PDFsharp does not provide a default font because this would blow up the assembly + // unnecessarily if the font is not needed. Provide your own font resolver to generate + // PDF files containing text. + return null; + } +#endif + +#if NETFX_CORE + internal static XFontSource CreateFontSource(string familyName, bool isBold, bool isItalic, string typefaceKey) + { + throw new NotImplementedException(); + } +#endif + } +} diff --git a/PdfSharp/Fonts/PlatformFontResolverInfo.cs b/PdfSharp/Fonts/PlatformFontResolverInfo.cs new file mode 100644 index 0000000..d816456 --- /dev/null +++ b/PdfSharp/Fonts/PlatformFontResolverInfo.cs @@ -0,0 +1,101 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if CORE || GDI +using System.Drawing; +using GdiFont = System.Drawing.Font; + +#endif +#if WPF +using System.Windows.Media; +using WpfFontFamily = System.Windows.Media.FontFamily; +using WpfTypeface = System.Windows.Media.Typeface; +using WpfGlyphTypeface = System.Windows.Media.GlyphTypeface; +#endif + +namespace PdfSharp.Fonts +{ + /// + /// Represents a font resolver info created by the platform font resolver. + /// + internal class PlatformFontResolverInfo : FontResolverInfo + { +#if CORE || GDI + public PlatformFontResolverInfo(string faceName, bool mustSimulateBold, bool mustSimulateItalic, GdiFont gdiFont) + : base(faceName, mustSimulateBold, mustSimulateItalic) + { + _gdiFont = gdiFont; + } +#endif +#if WPF + public PlatformFontResolverInfo(string faceName, bool mustSimulateBold, bool mustSimulateItalic, WpfFontFamily wpfFontFamily, + WpfTypeface wpfTypeface, WpfGlyphTypeface wpfGlyphTypeface) + : base(faceName, mustSimulateBold, mustSimulateItalic) + { + _wpfFontFamily = wpfFontFamily; + _wpfTypeface = wpfTypeface; + _wpfGlyphTypeface = wpfGlyphTypeface; + } +#endif + +#if CORE || GDI + public Font GdiFont + { + get { return _gdiFont; } + } + readonly Font _gdiFont; +#endif +#if WPF + public WpfFontFamily WpfFontFamily + { + get { return _wpfFontFamily; } + } + readonly WpfFontFamily _wpfFontFamily; + + public WpfTypeface WpfTypeface + { + get { return _wpfTypeface; } + } + readonly WpfTypeface _wpfTypeface; + + public WpfGlyphTypeface WpfGlyphTypeface + { + get { return _wpfGlyphTypeface; } + } + readonly WpfGlyphTypeface _wpfGlyphTypeface; +#endif +#if NETFX_CORE || UWP + public PlatformFontResolverInfo(string faceName, bool mustSimulateBold, bool mustSimulateItalic) + : base(faceName, mustSimulateBold, mustSimulateItalic) + { + //_gdiFont = gdiFont; + } +#endif + } +} diff --git a/PdfSharp/Forms/ColorComboBox.cs b/PdfSharp/Forms/ColorComboBox.cs new file mode 100644 index 0000000..205bcb1 --- /dev/null +++ b/PdfSharp/Forms/ColorComboBox.cs @@ -0,0 +1,202 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections; +using System.Text; +#if GDI +using System.Drawing; +using System.Windows.Forms; +#endif +using PdfSharp.Drawing; + +#if GDI +namespace PdfSharp.Forms +{ + /// + /// A combo box control for selection XColor values. + /// + public class ColorComboBox : ComboBox + { + /// + /// Initializes a new instance of the class. + /// + public ColorComboBox() + { + DropDownStyle = ComboBoxStyle.DropDownList; + DrawMode = DrawMode.OwnerDrawFixed; + Fill(); + } + + readonly XColorResourceManager _crm = new XColorResourceManager(); + + /// + /// Gets or sets the custom color. + /// + public XColor Color + { + get { return _color; } + set + { + _color = value; + if (value.IsKnownColor) + { + XKnownColor color = XColorResourceManager.GetKnownColor(value.Argb); + for (int idx = 1; idx < Items.Count; idx++) + { + if (((ColorItem)Items[idx]).Color.Argb == value.Argb) + { + SelectedIndex = idx; + break; + } + } + } + else + SelectedIndex = 0; + Invalidate(); + } + } + XColor _color = XColor.Empty; + + void Fill() + { + Items.Add(new ColorItem(XColor.Empty, "custom")); + XKnownColor[] knownColors = XColorResourceManager.GetKnownColors(false); + int count = knownColors.Length; + for (int idx = 0; idx < knownColors.Length; idx++) + { + XKnownColor color = knownColors[idx]; + Items.Add(new ColorItem(XColor.FromKnownColor(color), _crm.ToColorName(color))); + } + } + + /// + /// Keep control a drop down combo box. + /// + protected override void OnDropDownStyleChanged(EventArgs e) + { + DropDownStyle = ComboBoxStyle.DropDownList; + base.OnDropDownStyleChanged(e); + } + + /// + /// Sets the color with the selected item. + /// + protected override void OnSelectedIndexChanged(EventArgs e) + { + int index = SelectedIndex; + if (index > 0) + { + ColorItem item = (ColorItem)Items[index]; + _color = item.Color; + } + base.OnSelectedIndexChanged(e); + } + + /// + /// Draw a color entry. + /// + protected override void OnDrawItem(DrawItemEventArgs e) + { + int idx = e.Index; + + // Nothing selected? + if (idx < 0) + return; + + object obj = Items[idx]; + if (obj is ColorItem) + { + ColorItem item = (ColorItem)obj; + + // Is custom color? + if (idx == 0) + { + string name; + if (_color.IsEmpty) + name = "custom"; + else + name = _crm.ToColorName(_color); + + item = new ColorItem(_color, name); + } + + XColor clr = item.Color; + Graphics gfx = e.Graphics; + Rectangle rect = e.Bounds; + Brush textbrush = SystemBrushes.ControlText; + if ((e.State & DrawItemState.Selected) == 0) + { + gfx.FillRectangle(SystemBrushes.Window, rect); + textbrush = SystemBrushes.ControlText; + } + else + { + gfx.FillRectangle(SystemBrushes.Highlight, rect); + textbrush = SystemBrushes.HighlightText; + } + + // Draw color box + if (!clr.IsEmpty) + { + Rectangle box = new Rectangle(rect.X + 3, rect.Y + 1, rect.Height * 2, rect.Height - 3); + gfx.FillRectangle(new SolidBrush(clr.ToGdiColor()), box); + gfx.DrawRectangle(Pens.Black, box); + } + + StringFormat format = new StringFormat(StringFormat.GenericDefault); + format.Alignment = StringAlignment.Near; + format.LineAlignment = StringAlignment.Center; + rect.X += rect.Height * 2 + 3 + 3; + gfx.DrawString(item.Name, Font, textbrush, rect, format); + } + } + + /// + /// Represents a combo box item. + /// + struct ColorItem + { + public ColorItem(XColor color, string name) + { + Color = color; + Name = name; + } + + public override string ToString() + { + return Name; + } + + public XColor Color; + public string Name; + } + } +} +#endif diff --git a/PdfSharp/Forms/DeviceInfos.cs b/PdfSharp/Forms/DeviceInfos.cs new file mode 100644 index 0000000..2ba2ddb --- /dev/null +++ b/PdfSharp/Forms/DeviceInfos.cs @@ -0,0 +1,128 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Security; +//using System.Security.Permissions; + +#if GDI +namespace PdfSharp.Forms +{ + /// + /// Contains information about a physical device like a display or a printer. + /// + public struct DeviceInfos + { + /// + /// Width, in millimeters, of the physical screen or device. + /// + public int HorizontalSize; + + /// + /// Height, in millimeters, of the physical screen or device. + /// + public int VerticalSize; + + /// + /// Width, in pixels, of the screen or device. + /// + public int HorizontalResolution; + + /// + /// Height, in pixels, of the screen or device. + /// + public int VerticalResolution; + + /// + /// Number of pixels per logical inch along the screen or device width. + /// + public int LogicalDpiX; + + /// + /// Number of pixels per logical inch along the screen or device height. + /// + public int LogicalDpiY; + + /// + /// Number of pixels per physical inch along the screen or device width. + /// + public float PhysicalDpiX; + + /// + /// Number of pixels per physical inch along the screen or device height. + /// + public float PhysicalDpiY; + + /// + /// The ratio of LogicalDpiX and PhysicalDpiX. + /// + public float ScaleX; + + /// + /// The ratio of LogicalDpiY and PhysicalDpiY. + /// + public float ScaleY; + + /// + /// Gets a DeviceInfo for the specifed device context. + /// + [SuppressUnmanagedCodeSecurity] + public static DeviceInfos GetInfos(IntPtr hdc) + { + DeviceInfos devInfo; + + devInfo.HorizontalSize = GetDeviceCaps(hdc, HORZSIZE); + devInfo.VerticalSize = GetDeviceCaps(hdc, VERTSIZE); + devInfo.HorizontalResolution = GetDeviceCaps(hdc, HORZRES); + devInfo.VerticalResolution = GetDeviceCaps(hdc, VERTRES); + devInfo.LogicalDpiX = GetDeviceCaps(hdc, LOGPIXELSX); + devInfo.LogicalDpiY = GetDeviceCaps(hdc, LOGPIXELSY); + devInfo.PhysicalDpiX = devInfo.HorizontalResolution * 25.4f / devInfo.HorizontalSize; + devInfo.PhysicalDpiY = devInfo.VerticalResolution * 25.4f / devInfo.VerticalSize; + devInfo.ScaleX = devInfo.LogicalDpiX / devInfo.PhysicalDpiX; + devInfo.ScaleY = devInfo.LogicalDpiY / devInfo.PhysicalDpiY; + + return devInfo; + } + + [DllImport("gdi32.dll")] + static extern int GetDeviceCaps(IntPtr hdc, int capability); + // ReSharper disable InconsistentNaming + const int HORZSIZE = 4; + const int VERTSIZE = 6; + const int HORZRES = 8; + const int VERTRES = 10; + const int LOGPIXELSX = 88; + const int LOGPIXELSY = 90; + // ReSharper restore InconsistentNaming + } +} +#endif diff --git a/PdfSharp/Forms/PagePreview.cs b/PdfSharp/Forms/PagePreview.cs new file mode 100644 index 0000000..d51b7ba --- /dev/null +++ b/PdfSharp/Forms/PagePreview.cs @@ -0,0 +1,1077 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// Draw crosses to check layout calculation +#define DRAW_X_ + +#if DEBUG +// Test drawing in a bitmap. This is just a hack - don't use it! +#define DRAW_BMP_ +#endif + +using System; +using System.Diagnostics; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; +using PdfSharp.Drawing; + +#if !GDI +#error This file must only be included in GDI build. +#endif + +namespace PdfSharp.Forms +{ + /* TODOs + * + * o Call render event only once. -> introduce an UpdatePage() function + * + * Further stuff: set printable area; set text box (smallest rect that contains all content) + */ + /// + /// Represents a preview control for an XGraphics page. Can be used as an alternative to + /// System.Windows.Forms.PrintPreviewControl. + /// + public class PagePreview : UserControl + { + /// + /// A delegate for invoking the render function. + /// + public delegate void RenderEvent(XGraphics gfx); + + private Container components = null; + + /// + /// Initializes a new instance of the class. + /// + public PagePreview() + { + _canvas = new PagePreviewCanvas(this); + Controls.Add(_canvas); + + _hScrollBar = new HScrollBar(); + _hScrollBar.Visible = _showScrollbars; + _hScrollBar.Scroll += OnScroll; + _hScrollBar.ValueChanged += OnValueChanged; + Controls.Add(_hScrollBar); + + _vScrollBar = new VScrollBar(); + _vScrollBar.Visible = _showScrollbars; + _vScrollBar.Scroll += OnScroll; + _vScrollBar.ValueChanged += OnValueChanged; + Controls.Add(_vScrollBar); + + InitializeComponent(); + //OnLayout(); + + _zoom = Zoom.FullPage; + _printableArea = new RectangleF(); + //virtPageSize = new Size(); + //showNonPrintableArea = false; + //virtualPrintableArea = new Rectangle(); + + _printableArea.GetType(); + //showNonPrintableArea.GetType(); + //virtualPrintableArea.GetType(); + + // Prevent bogus compiler warnings + _posOffset = new Point(); + _virtualPage = new Rectangle(); + } + + readonly PagePreviewCanvas _canvas; + readonly HScrollBar _hScrollBar; + readonly VScrollBar _vScrollBar; + + /// + /// Clean up any resources being used. + /// + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (components != null) + components.Dispose(); + } + base.Dispose(disposing); + } + + /// + /// Gets or sets the border style of the control. + /// + /// + [DefaultValue((int)BorderStyle.Fixed3D), Description("Determines the style of the border."), Category("Preview Properties")] + public new BorderStyle BorderStyle + { + get { return _borderStyle; } + set + { + if (!Enum.IsDefined(typeof(BorderStyle), value)) + throw new InvalidEnumArgumentException("value", (int)value, typeof(BorderStyle)); + + if (value != _borderStyle) + { + _borderStyle = value; + LayoutChildren(); + } + } + } + BorderStyle _borderStyle = BorderStyle.Fixed3D; + + // [DefaultValue(2), Description("TODO..."), Category("Preview Properties")] + // public PageSize PageSize + // { + // get { return pageSize2; } + // set + // { + // if (!Enum.IsDefined(typeof(PageSize), value)) + // throw new InvalidEnumArgumentException("value", (int)value, typeof(PageSize)); + // + // if (value != pageSize2) + // { + // pageSize2 = value; + // // base.RecreateHandle(); + // // integralHeightAdjust = true; + // // try + // // { + // // base.Height = requestedHeight; + // // } + // // finally + // // { + // // integralHeightAdjust = false; + // // } + // } + // } + // } + // PageSize pageSize2; + + /// + /// Gets or sets the XGraphicsUnit of the page. + /// The default value is XGraphicsUnit.Point. + /// + public XGraphicsUnit PageGraphicsUnit + { + get { return _pageGraphicsUnit; } + set { _pageGraphicsUnit = value; } + } + XGraphicsUnit _pageGraphicsUnit = XGraphicsUnit.Point; + + /// + /// This property was renamed. Use new property PageGraphicsUnit. + /// + [Obsolete("Property renamed, use PageGraphicsUnit")] + public XGraphicsUnit PageUnit + { + get { return _pageGraphicsUnit; } + set { _pageGraphicsUnit = value; } + } + + /// + /// Gets or sets a predefined zoom factor. + /// + [DefaultValue((int)Zoom.FullPage), Description("Determines the zoom of the page."), Category("Preview Properties")] + public Zoom Zoom + { + get { return _zoom; } + set + { + if ((int)value < (int)Zoom.Mininum || (int)value > (int)Zoom.Maximum) + { + if (!Enum.IsDefined(typeof(Zoom), value)) + throw new InvalidEnumArgumentException("value", (int)value, typeof(Zoom)); + } + if (value != _zoom) + { + _zoom = value; + CalculatePreviewDimension(); + SetScrollBarRange(); + _canvas.Invalidate(); + } + } + } + Zoom _zoom; + + /// + /// Gets or sets an arbitrary zoom factor. The range is from 10 to 800. + /// + //[DefaultValue((int)Zoom.FullPage), Description("Determines the zoom of the page."), Category("Preview Properties")] + public int ZoomPercent + { + get { return _zoomPercent; } + set + { + if (value < (int)Zoom.Mininum || value > (int)Zoom.Maximum) + throw new ArgumentOutOfRangeException("value", value, + String.Format("Value must between {0} and {1}.", (int)Zoom.Mininum, (int)Zoom.Maximum)); + + if (value != _zoomPercent) + { + _zoom = (Zoom)value; + _zoomPercent = value; + CalculatePreviewDimension(); + SetScrollBarRange(); + _canvas.Invalidate(); + } + } + } + int _zoomPercent; + + /// + /// Gets or sets the color of the page. + /// + [Description("The background color of the page."), Category("Preview Properties")] + public Color PageColor + { + get { return _pageColor; } + set + { + if (value != _pageColor) + { + _pageColor = value; + Invalidate(); + } + } + } + Color _pageColor = Color.GhostWhite; + + /// + /// Gets or sets the color of the desktop. + /// + [Description("The color of the desktop."), Category("Preview Properties")] + public Color DesktopColor + { + get { return _desktopColor; } + set + { + if (value != _desktopColor) + { + _desktopColor = value; + Invalidate(); + } + } + } + internal Color _desktopColor = SystemColors.ControlDark; + + /// + /// Gets or sets a value indicating whether the scrollbars are visible. + /// + [DefaultValue(true), Description("Determines whether the scrollbars are visible."), Category("Preview Properties")] + public bool ShowScrollbars + { + get { return _showScrollbars; } + set + { + if (value != _showScrollbars) + { + _showScrollbars = value; + _hScrollBar.Visible = value; + _vScrollBar.Visible = value; + LayoutChildren(); + } + } + } + bool _showScrollbars = true; + + /// + /// Gets or sets a value indicating whether the page is visible. + /// + [DefaultValue(true), Description("Determines whether the page visible."), Category("Preview Properties")] + public bool ShowPage + { + get { return _showPage; } + set + { + if (value != _showPage) + { + _showPage = value; + _canvas.Invalidate(); + } + } + } + internal bool _showPage = true; + + /// + /// Gets or sets the page size in point. + /// + [Description("Determines the size (in points) of the page."), Category("Preview Properties")] + public XSize PageSize + { + get { return new XSize((int)_pageSize.Width, (int)_pageSize.Height); } + set + { + _pageSize = new SizeF((float)value.Width, (float)value.Height); + CalculatePreviewDimension(); + Invalidate(); + } + } + + /// + /// This is a hack for Visual Studio 2008. The designer uses reflection for setting the PageSize property. + /// This fails, even an implicit operator that converts Size to XSize exits. + /// + public Size PageSizeF + { + get { return new Size(Convert.ToInt32(_pageSize.Width), Convert.ToInt32(_pageSize.Height)); } + set + { + _pageSize = value; + CalculatePreviewDimension(); + Invalidate(); + } + } + + /// + /// Sets a delegate that is invoked when the preview wants to be painted. + /// + public void SetRenderFunction(Action renderEvent) + { + _renderAction = renderEvent; + Invalidate(); + } + Action _renderAction; + + /// + /// Sets a delegate that is invoked when the preview wants to be painted. + /// + [Obsolete("Use SetRenderFunction")] + public void SetRenderEvent(RenderEvent renderEvent) + { + _renderAction = new Action(renderEvent); + Invalidate(); + } + + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + Name = "PagePreview"; + Size = new System.Drawing.Size(228, 252); + } + #endregion + + /// + /// Raises the ZoomChanged event when the zoom factor changed. + /// + protected virtual void OnZoomChanged(EventArgs e) + { + if (ZoomChanged != null) + ZoomChanged(this, e); + } + + /// + /// Occurs when the zoom factor changed. + /// + public event EventHandler ZoomChanged; + + /// + /// Paints the background with the sheet of paper. + /// + protected override void OnPaintBackground(PaintEventArgs e) + { + // Accurate drawing prevents flickering + Graphics gfx = e.Graphics; + Rectangle clientRect = ClientRectangle; + int d = 0; + switch (_borderStyle) + { + case BorderStyle.FixedSingle: + gfx.DrawRectangle(SystemPens.WindowFrame, clientRect.X, clientRect.Y, clientRect.Width - 1, clientRect.Height - 1); + d = 1; + break; + + case BorderStyle.Fixed3D: + ControlPaint.DrawBorder3D(gfx, clientRect, Border3DStyle.Sunken); + d = 2; + break; + } + if (_showScrollbars) + { + int cxScrollbar = SystemInformation.VerticalScrollBarWidth; + int cyScrollbar = SystemInformation.HorizontalScrollBarHeight; + + gfx.FillRectangle(new SolidBrush(BackColor), + clientRect.Width - cxScrollbar - d, clientRect.Height - cyScrollbar - d, cxScrollbar, cyScrollbar); + } + } + + /// + /// Recalculates the preview dimension. + /// + protected override void OnSizeChanged(EventArgs e) + { + base.OnSizeChanged(e); + CalculatePreviewDimension(); + SetScrollBarRange(); + } + + /// + /// Invalidates the canvas. + /// + protected override void OnInvalidated(InvalidateEventArgs e) + { + base.OnInvalidated(e); + _canvas.Invalidate(); + } + + /// + /// Layouts the child controls. + /// + protected override void OnLayout(LayoutEventArgs levent) + { + LayoutChildren(); + } + + void OnScroll(object obj, ScrollEventArgs e) + { + ScrollBar sc = obj as ScrollBar; + if (sc != null) + { + //Debug.WriteLine(String.Format("OnScroll: {0}, {1}", sc.Value, e.NewValue)); + } + } + + void OnValueChanged(object obj, EventArgs e) + { + ScrollBar sc = obj as ScrollBar; + if (sc != null) + { + //Debug.WriteLine(String.Format("OnValueChanged: {0}", sc.Value)); + if (sc == _hScrollBar) + _posOffset.X = sc.Value; + + else if (sc == _vScrollBar) + _posOffset.Y = sc.Value; + } + _canvas.Invalidate(); + } + + void LayoutChildren() + { + Invalidate(); + Rectangle clientRect = ClientRectangle; + switch (_borderStyle) + { + case BorderStyle.FixedSingle: + clientRect.Inflate(-1, -1); + break; + + case BorderStyle.Fixed3D: + clientRect.Inflate(-2, -2); + break; + } + int x = clientRect.X; + int y = clientRect.Y; + int cx = clientRect.Width; + int cy = clientRect.Height; + int cxScrollbar = 0; + int cyScrollbar = 0; + if (_showScrollbars && _vScrollBar != null && _hScrollBar != null) + { + cxScrollbar = _vScrollBar.Width; + cyScrollbar = _hScrollBar.Height; + _vScrollBar.Location = new Point(x + cx - cxScrollbar, y); + _vScrollBar.Size = new Size(cxScrollbar, cy - cyScrollbar); + _hScrollBar.Location = new Point(x, y + cy - cyScrollbar); + _hScrollBar.Size = new Size(cx - cxScrollbar, cyScrollbar); + } + if (_canvas != null) + { + _canvas.Location = new Point(x, y); + _canvas.Size = new Size(cx - cxScrollbar, cy - cyScrollbar); + } + } + + /// + /// Calculates all values for drawing the page preview. + /// + internal void CalculatePreviewDimension(out bool zoomChanged) + { + // User may change display resolution while preview is running + Graphics gfx = Graphics.FromHwnd(IntPtr.Zero); + IntPtr hdc = gfx.GetHdc(); + DeviceInfos devInfo = DeviceInfos.GetInfos(hdc); + gfx.ReleaseHdc(hdc); + gfx.Dispose(); + int xdpiScreen = devInfo.LogicalDpiX; + int ydpiScreen = devInfo.LogicalDpiY; + //int cxScrollbar = SystemInformation.VerticalScrollBarWidth; + //int cyScrollbar = SystemInformation.HorizontalScrollBarHeight; + Rectangle rcCanvas = _canvas.ClientRectangle; + + Zoom zoomOld = _zoom; + int zoomPercentOld = _zoomPercent; + + // Border around virtual page in pixel. + const int leftBorder = 2; + const int rightBorder = 4; // because of shadow + const int topBorder = 2; + const int bottomBorder = 4; // because of shadow + const int horzBorders = leftBorder + rightBorder; + const int vertBorders = topBorder + bottomBorder; + + // Calculate new zoom factor. + switch (_zoom) + { + case Zoom.BestFit: + BestFit: + //zoomPercent = Convert.ToInt32(25400.0 * (rcCanvas.Width - (leftBorder + rightBorder)) / (this.pageSize.Width * xdpiScreen)); + _zoomPercent = (int)(7200f * (rcCanvas.Width - horzBorders) / (_pageSize.Width * xdpiScreen)); + //--zoomPercent; // prevent round up errors + break; + + case Zoom.TextFit: + // TODO: 'public Rectangle TextBox' property + goto BestFit; + //zoomPercent = LongFromReal (25400.0 / (_cxUsedPage + 0) * + // (rcWnd.CX () - 2 * cxScrollbar) / xdpiScreen) - 3; + //break; + + case Zoom.FullPage: + { + //int zoomX = Convert.ToInt32(25400.0 / (pageSize.Width) * + // (rcCanvas.Width - (leftBorder + rightBorder)) / xdpiScreen); + //int zoomY = Convert.ToInt32(25400.0 / (pageSize.Height) * + // (rcCanvas.Height - (topBorder + bottomBorder)) / ydpiScreen); + int zoomX = (int)(7200f * (rcCanvas.Width - horzBorders) / (_pageSize.Width * xdpiScreen)); + int zoomY = (int)(7200f * (rcCanvas.Height - vertBorders) / (_pageSize.Height * ydpiScreen)); + _zoomPercent = Math.Min(zoomX, zoomY); + //--zoomPercent; // prevent round up errors + } + break; + + case Zoom.OriginalSize: + _zoomPercent = (int)(0.5 + 200f / (devInfo.ScaleX + devInfo.ScaleY)); + _zoomPercent = (int)(0.5 + 100f / devInfo.ScaleX); + break; + + default: + _zoomPercent = (int)_zoom; + break; + } + + // Bound to zoom limits + _zoomPercent = Math.Max(Math.Min(_zoomPercent, (int)Zoom.Maximum), (int)Zoom.Mininum); + if ((int)_zoom > 0) + _zoom = (Zoom)_zoomPercent; + + // Size of page in preview window in pixel + _virtualPage.X = leftBorder; + _virtualPage.Y = topBorder; + _virtualPage.Width = (int)(_pageSize.Width * xdpiScreen * _zoomPercent / 7200); + _virtualPage.Height = (int)(_pageSize.Height * ydpiScreen * _zoomPercent / 7200); + + //// 2540 := (25.4mm * 100%) / 1mm + //m_VirtualPrintableArea.X = (int)printableArea.X * this.zoomPercent * xdpiScreen / 2540; + //m_VirtualPrintableArea.Y = (int)printableArea.Y * this.zoomPercent * xdpiScreen / 2540; + //m_VirtualPrintableArea.Width = (int)printableArea.Width * this.zoomPercent * xdpiScreen / 2540; + //m_VirtualPrintableArea.Height = (int)printableArea.Height * this.zoomPercent * xdpiScreen / 2540; + + // Border do not depend on zoom anymore + _virtualCanvas = new Size(_virtualPage.Width + horzBorders, _virtualPage.Height + vertBorders); + + // Adjust virtual canvas to at least actual window size + if (_virtualCanvas.Width < rcCanvas.Width) + { + _virtualCanvas.Width = rcCanvas.Width; + _virtualPage.X = leftBorder + (rcCanvas.Width - horzBorders - _virtualPage.Width) / 2; + } + if (_virtualCanvas.Height < rcCanvas.Height) + { + _virtualCanvas.Height = rcCanvas.Height; + _virtualPage.Y = topBorder + (rcCanvas.Height - vertBorders - _virtualPage.Height) / 2; + } + + zoomChanged = zoomOld != _zoom || zoomPercentOld != _zoomPercent; + if (zoomChanged) + OnZoomChanged(new EventArgs()); + } + + internal void CalculatePreviewDimension() + { + bool zoomChanged; + CalculatePreviewDimension(out zoomChanged); + } + + internal bool RenderPage(Graphics gfx) + { + //delete m_RenderContext; + //m_RenderContext = new HdcRenderContext(wdc.m_hdc); + + gfx.TranslateTransform(-_posOffset.X, -_posOffset.Y); + gfx.SetClip(new Rectangle(_virtualPage.X + 1, _virtualPage.Y + 1, _virtualPage.Width - 1, _virtualPage.Height - 1)); + + float scaleX = _virtualPage.Width / _pageSize.Width; + float scaleY = _virtualPage.Height / _pageSize.Height; + + //gfx.SetSmoothingMode(SmoothingModeAntiAlias); + //PaintBackground(gfx); + +#if DRAW_BMP + Matrix matrix = new Matrix(); + matrix.Translate(virtualPage.X, virtualPage.Y); + matrix.Translate(-posOffset.X, -this.posOffset.Y); + //matrix.Scale(scaleX, scaleY); + gfx.Transform = matrix; + +#if DRAW_X + gfx.DrawLine(Pens.Red, 0, 0, pageSize.Width, pageSize.Height); + gfx.DrawLine(Pens.Red, 0, pageSize.Height, pageSize.Width, 0); +#endif + if (renderEvent != null) + { + Bitmap bmp = new Bitmap(virtualPage.Width, this.virtualPage.Height, gfx); + Graphics gfx2 = Graphics.FromImage(bmp); + gfx2.Clear(pageColor); + gfx2.ScaleTransform(scaleX, scaleY); + gfx2.SmoothingMode = SmoothingMode.HighQuality; + XGraphics xgfx = XGraphics.FromGraphics(gfx2, new XSize(pageSize.Width, this.pageSize.Height)); + try + { + renderEvent(xgfx); + gfx.DrawImage(bmp, 0, 0); + } + finally + { + bmp.Dispose(); + } + } +#else + Matrix matrix = new Matrix(); + matrix.Translate(_virtualPage.X, _virtualPage.Y); + matrix.Translate(-_posOffset.X, -_posOffset.Y); + matrix.Scale(scaleX, scaleY); + gfx.Transform = matrix; + +#if DRAW_X + gfx.DrawLine(Pens.Red, 0, 0, pageSize.Width, pageSize.Height); + gfx.DrawLine(Pens.Red, 0, pageSize.Height, pageSize.Width, 0); +#endif + + if (_renderAction != null) + { + gfx.SmoothingMode = SmoothingMode.HighQuality; + XGraphics xgfx = XGraphics.FromGraphics(gfx, new XSize(_pageSize.Width, _pageSize.Height), PageGraphicsUnit); + try + { + _renderAction(xgfx); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Exception"); + } + } +#endif + + // Old C++ stuff, may be useful later... +#if false + switch (m_mode) + { + case RenderModeDirect: + { + delete m_PreviewMetafile; + m_PreviewMetafile = NULL; + + float cxPage = Metric::MillimetersToPoints(m_dimPage.cx / 10.0f); + float cyPage = Metric::MillimetersToPoints(m_dimPage.cy / 10.0f); + + float scaleX = virtualPage.Width / cxPage; + float scaleY = virtualPage.Height / cyPage; + + Graphics gfx(m_RenderContext); + gfx.SetSmoothingMode(SmoothingModeAntiAlias); + PaintBackground(gfx, &virtualPage); + + Matrix matrix; + matrix.Translate((float)virtualPage.X, (float)virtualPage.Y); + matrix.Translate((float) - m_posOffset.x, (float) -m_posOffset.y); + matrix.Scale(scaleX, scaleY); + + m_RenderContext->SetDefaultViewMatrix(&matrix); + gfx.ResetTransform(); + if (m_PreviewRenderer && m_PreviewRenderer->CanRender()) + m_PreviewRenderer->Render(&gfx, m_Page); + } + break; + + case RenderModeMetafile: + { + Graphics gfx(m_RenderContext); + if (m_PreviewMetafile == NULL) + { + float cxPage = Metric::MillimetersToPoints(m_dimPage.cx / 10.0f); + float cyPage = Metric::MillimetersToPoints(m_dimPage.cy / 10.0f); + + //float factor = 72.0f / 96.0f; + Rect rcLogicalPage(0, 0, (int)cxPage, (int)cyPage); + RectF rcFLogicalPage(0, 0, cxPage, cyPage); + + //DeviceName devname; + //DESKTOP::QueryDefaultPrinter(devname); //HACK DRUCKER MUSS DA SEIN! + //DeviceMode devmode(devname); + + //HDC hdc = ::CreateIC(devname.m_szDriver, devname.m_szDevice, devname.m_szOutput, devmode.m_pdm); + + //HDC hdc = m_Graphics->GetHDC(); + //HDC hdc = ::GetDC(NULL); + HDC hdc = ::CreateIC("DISPLAY", NULL, NULL, NULL); + + + float dpiX = gfx.GetDpiX(); + float dpiY = gfx.GetDpiY(); + + // Even Petzold would be surprised about that... + // Display | LaserJet + // DPI 96 : 120 | 300 + // physical device size in MM --------------------------------------------- + int horzSizeMM = ::GetDeviceCaps(hdc, HORZSIZE); // = 330 : 254 | 198 (not 210) + int vertSizeMM = ::GetDeviceCaps(hdc, VERTSIZE); // = 254 : 203 | 288 (hot 297) + + // device size in pixel + int horzSizePixel = ::GetDeviceCaps(hdc, HORZRES); // = 1280 : 1280 | 4676 + int vertSizePixel = ::GetDeviceCaps(hdc, VERTRES); // = 1024 : 1024 | 6814 + + // 'logical' device resolution in DPI + int logResX = ::GetDeviceCaps(hdc, LOGPIXELSX); // = 96 : 120 | 600 + int logResY = ::GetDeviceCaps(hdc, LOGPIXELSY); // = 96 : 120 | 600 + + // physical pixel size in .01 MM units + // accidentally(?) the result of GetPhysicalDimension! + //float X1 = 100.0f * horzSizeMM / horzSizePixel; // = 25.781250 : 19.843750 | 4.2343884 + //float Y1 = 100.0f * vertSizeMM / vertSizePixel; // = 24.804688 : 19.824219 | 4.2265925 + + // now we can get the 'physical' device resolution... + float phyResX = horzSizePixel / (horzSizeMM / 25.4f); // = 98.521210 : 128.00000 | 599.85052 + float phyResY = vertSizePixel / (vertSizeMM / 25.4f); // = 102.40000 : 128.12611 | 600.95691 + + // ...and rescale the size of the meta rectangle. + float magicX = logResX / phyResX; // = 0.97440946 : 0.93750000 | 1.0002491 + float magicY = logResY / phyResY; // = 0.93750000 : 0.93657720 | 0.99840766 + + // use A4 page in point + // adjust size of A4 page so that meta file fits with DrawImage... + RectF rcMagic(0, 0, magicX * cxPage, magicY * cyPage); + m_PreviewMetafile = new Metafile(hdc, rcMagic, MetafileFrameUnitPoint, + EmfTypeEmfPlusOnly, L"some description"); + + SizeF size; + float horzRes, vertRes; + float height, width; + MetafileHeader metafileHeader; + + // GetPhysicalDimension returns physical size of a pixel in .01 MM units!! + m_PreviewMetafile->GetPhysicalDimension(&size); + + horzRes = (float)m_PreviewMetafile->GetHorizontalResolution(); + vertRes = (float)m_PreviewMetafile->GetVerticalResolution(); + height = (float)m_PreviewMetafile->GetHeight(); + width = (float)m_PreviewMetafile->GetWidth(); + m_PreviewMetafile->GetMetafileHeader(&metafileHeader); + + Graphics gfxMf(m_PreviewMetafile); + dpiX = gfxMf.GetDpiX(); + dpiY = gfxMf.GetDpiY(); + + m_PreviewMetafile->GetPhysicalDimension(&size); + horzRes = (float)m_PreviewMetafile->GetHorizontalResolution(); + vertRes = (float)m_PreviewMetafile->GetVerticalResolution(); + height = (float)m_PreviewMetafile->GetHeight(); + width = (float)m_PreviewMetafile->GetWidth(); + m_PreviewMetafile->GetMetafileHeader(&metafileHeader); + + gfxMf.SetPageUnit(UnitPoint); + if (m_PreviewRenderer && m_PreviewRenderer->CanRender()) + m_PreviewRenderer->Render(&gfxMf, m_Page); + + ::DeleteDC(hdc); + } + if (m_PreviewMetafile) + { + gfx.SetSmoothingMode(SmoothingModeAntiAlias); + PaintBackground(gfx, &virtualPage); + //Matrix matrix(1, 0, 0, 1, (float) - m_posOffset.x, (float) - m_posOffset.y); + m_RenderContext->SetDefaultViewMatrix(&matrix); + gfx.ResetTransform(); + gfx.DrawImage(m_PreviewMetafile, virtualPage); + } + } + break; + + case RenderModeBitmap: + break; + } +#endif + return true; + } + + /// + /// Paints the background and the empty page. + /// + internal void PaintBackground(Graphics gfx) + { + // Draw sharp paper borders and shadow. + gfx.SmoothingMode = SmoothingMode.None; + //gfx.SetCompositingMode(CompositingModeSourceOver); // CompositingModeSourceCopy + //gfx.SetCompositingQuality(CompositingQualityHighQuality); + + gfx.TranslateTransform(-_posOffset.X, -_posOffset.Y); + + // Draw outer area. Use clipping to prevent flickering of page interior. + gfx.SetClip(new Rectangle(_virtualPage.X, _virtualPage.Y, _virtualPage.Width + 3, _virtualPage.Height + 3), CombineMode.Exclude); + gfx.SetClip(new Rectangle(_virtualPage.X + _virtualPage.Width + 1, _virtualPage.Y, 2, 2), CombineMode.Union); + gfx.SetClip(new Rectangle(_virtualPage.X, _virtualPage.Y + _virtualPage.Height + 1, 2, 2), CombineMode.Union); + gfx.Clear(_desktopColor); + +#if DRAW_X + gfx.DrawLine(Pens.Blue, 0, 0, virtualCanvas.Width, virtualCanvas.Height); + gfx.DrawLine(Pens.Blue, virtualCanvas.Width, 0, 0, virtualCanvas.Height); +#endif + gfx.ResetClip(); + +#if !DRAW_BMP + // Fill page interior. + SolidBrush brushPaper = new SolidBrush(_pageColor); + gfx.FillRectangle(brushPaper, _virtualPage.X + 1, _virtualPage.Y + 1, _virtualPage.Width - 1, _virtualPage.Height - 1); +#endif + + //// draw non printable area + //if (m_ShowNonPrintableArea) + //{ + //SolidBrush brushNPA(+DESKTOP::QuerySysColor((SYSCLR_3DLIGHT)) | 0xFF000000); + // + //gfx.FillRectangle(&brushNPA, virtualPage.X, virtualPage.Y, virtualPage.Width, rcPrintableArea.Y - virtualPage.Y); + //gfx.FillRectangle(&brushNPA, virtualPage.X, virtualPage.Y, rcPrintableArea.X - virtualPage.X, virtualPage.Height); + //gfx.FillRectangle(&brushNPA, rcPrintableArea.X + rcPrintableArea.Width, + //virtualPage.Y, virtualPage.X + virtualPage.Width - (rcPrintableArea.X + rcPrintableArea.Width), virtualPage.Height); + //gfx.FillRectangle(&brushNPA, virtualPage.X, rcPrintableArea.Y + rcPrintableArea.Height, + //virtualPage.Width, virtualPage.Y + virtualPage.Height - (rcPrintableArea.Y + rcPrintableArea.Height)); + //} + //DrawDash(gfx, virtualPage); + + // Draw page border and shadow. + Pen penPaperBorder = SystemPens.WindowText; + Brush brushShadow = SystemBrushes.ControlDarkDark; + gfx.DrawRectangle(penPaperBorder, _virtualPage); + gfx.FillRectangle(brushShadow, _virtualPage.X + _virtualPage.Width + 1, _virtualPage.Y + 2, 2, _virtualPage.Height + 1); + gfx.FillRectangle(brushShadow, _virtualPage.X + 2, _virtualPage.Y + _virtualPage.Height + 1, _virtualPage.Width + 1, 2); + } + + /// + /// Check clipping rectangle calculations. + /// + [Conditional("DEBUG")] + void DrawDash(Graphics gfx, Rectangle rect) + { + Pen pen = new Pen(Color.GreenYellow, 1); + pen.DashStyle = DashStyle.Dash; + gfx.DrawRectangle(pen, rect); + } + + /// + /// Adjusts scroll bars. + /// + void SetScrollBarRange() + { + // Windows 7 issue: Must invalidate scroll bars to ensure that + // the arrows are painted correctly. + + Rectangle clientRect = _canvas.ClientRectangle; + Size clientAreaSize = clientRect.Size; + + // Scroll range + int dx = _virtualCanvas.Width - clientAreaSize.Width; + int dy = _virtualCanvas.Height - clientAreaSize.Height; + + //bool extendX = clientAreaSize.Width < virtualCanvas.Width; + //bool extendY = clientAreaSize.Height < virtualCanvas.Height; + + if (ShowScrollbars && _hScrollBar != null) + { + if (_posOffset.X > dx) + _hScrollBar.Value = _posOffset.X = dx; + + if (dx > 0) + { + _hScrollBar.Minimum = 0; + _hScrollBar.Maximum = _virtualCanvas.Width; + _hScrollBar.SmallChange = clientAreaSize.Width / 10; + _hScrollBar.LargeChange = clientAreaSize.Width; + _hScrollBar.Enabled = true; + } + else + { + _hScrollBar.Minimum = 0; + _hScrollBar.Maximum = 0; + _hScrollBar.Enabled = false; + } + _hScrollBar.Invalidate(); + } + + if (ShowScrollbars && _vScrollBar != null) + { + if (_posOffset.Y > dy) + _vScrollBar.Value = _posOffset.Y = dy; + + if (dy > 0) + { + _vScrollBar.Minimum = 0; + _vScrollBar.Maximum = _virtualCanvas.Height; + _vScrollBar.SmallChange = clientAreaSize.Height / 10; + _vScrollBar.LargeChange = clientAreaSize.Height; + _vScrollBar.Enabled = true; + } + else + { + _vScrollBar.Minimum = 0; + _vScrollBar.Maximum = 0; + _vScrollBar.Enabled = false; + } + _vScrollBar.Invalidate(); + } + } + + ///// + ///// Calculates two interesting values... + ///// + //public static void GetMagicValues(IntPtr hdc, out float magicX, out float magicY) + //{ + // // Even Petzold would be surprised about that... + + // // Physical device size in MM + // int horzSizeMM = GetDeviceCaps(hdc, HORZSIZE); + // int vertSizeMM = GetDeviceCaps(hdc, VERTSIZE); + // // + // // Display size in pixels 1600 x 1200 1280 x 1024 + // // + // // My old Sony display with 96 DPI: --- 330 x 254 + // // My old Sony display with 120 DPI: --- 254 x 203 + // // My current Sony display with 96 DPI: 410 x 310 410 x 310 + // // My current Sony display with 120 DPI: 410 x 310 410 x 310 + // // My old Sony display with 96 DPI: --- 360 x 290 + // // My old Sony display with 120 DPI: --- 360 x 290 + // // My LaserJet 6L (300 DPI): 198 (not 210) x 288 (nscot 297) + + + // // Device size in pixel + // int horzSizePixel = GetDeviceCaps(hdc, HORZRES); + // int vertSizePixel = GetDeviceCaps(hdc, VERTRES); + // // + // // Display size in pixels 1600 x 1200 1280 x 1024 + // // + // // My old Sony display with 96 DPI: --- 1280 x 1024 + // // My old Sony display with 120 DPI: --- 1280 x 1024 + // // My current Sony display with 96 DPI: 1600 x 1200 1280 x 1024 + // // My current Sony display with 120 DPI: 1600 x 1200 1280 x 1024 + // // + // // My LaserJet 6L (600 DPI): 4676 x 6814 + + // // 'logical' device resolution in DPI + // int logResX = GetDeviceCaps(hdc, LOGPIXELSX); + // int logResY = GetDeviceCaps(hdc, LOGPIXELSY); + // // + // // Display size in pixels 1600 x 1200 1280 x 1024 + // // + // // My old Sony display with 96 DPI: --- 96 x 96 + // // My old Sony display with 120 DPI: --- 120 x 120 + // // My current Sony display with 96 DPI: 96 x 96 96 x 96 + // // My current Sony display with 120 DPI: 120 x 120 120 x 120 + // // + // // My LaserJet 6L (600 DPI): 600 x 600 + + // // physical pixel size in .01 MM units + // // accidentally(?) the result of GetPhysicalDimension! + // //float X1 = 100.0f * horzSizeMM / horzSizePixel; // = 25.781250 : 19.843750 | 4.2343884 + // //float Y1 = 100.0f * vertSizeMM / vertSizePixel; // = 24.804688 : 19.824219 | 4.2265925 + + // // Now we can get the 'physical' device resolution... + // float phyResX = horzSizePixel / (horzSizeMM / 25.4f); + // float phyResY = vertSizePixel / (vertSizeMM / 25.4f); + // // + // // Display size in pixels 1600 x 1200 1280 x 1024 + // // + // // My old Sony display with 96 DPI: --- 98.521210 x 102.40000 + // // My old Sony display with 120 DPI: --- 128.00000 x 128.12611 + // // My current Sony display with 96 DPI: 99.12195 x 98.32258 79.29756 x 83.90193 + // // My current Sony display with 120 DPI: 99.12195 x 98.32258 79.29756 x 83.90193 + // // + // // My LaserJet 6L (600 DPI): 599.85052 x 600.95691 + + // // ...and rescale the size of the meta rectangle. + // magicX = logResX / phyResX; + // magicY = logResY / phyResY; + // // + // // Display size in pixels 1600 x 1200 1280 x 1024 + // // + // // My old Sony display with 96 DPI: --- 0.97440946 x 0.93750000 + // // My old Sony display with 120 DPI: --- 0.93750000 x 0.93657720 + // // My current Sony display with 96 DPI: 0.968503952 x 0.976377964 1.21062994 x 1.14419293 + // // My current Sony display with 120 DPI: 1.21062994 x 1.22047246 1.51328743 x 1.43024123 + // // + // // My LaserJet 6L (600 DPI): 1.0002491 x 0.99840766 + //} + + //[DllImport("gdi32.dll")] + //static extern int GetDeviceCaps(IntPtr hdc, int capability); + //const int HORZSIZE = 4; + //const int VERTSIZE = 6; + //const int HORZRES = 8; + //const int VERTRES = 10; + //const int LOGPIXELSX = 88; + //const int LOGPIXELSY = 90; + + /// + /// Upper left corner of scroll area. + /// + Point _posOffset; + + /// + /// Real page size in point. + /// + SizeF _pageSize = PageSizeConverter.ToSize(PdfSharp.PageSize.A4).ToSizeF(); + + /// + /// Page in pixel relative to virtual canvas. + /// + Rectangle _virtualPage; + + /// + /// The size in pixels of an area that completely contains the virtual page and at least a small + /// border around it. If this area is larger than the canvas window, it is scrolled. + /// + Size _virtualCanvas; + + /// + /// Printable area in point. + /// + readonly RectangleF _printableArea; + } +} diff --git a/PdfSharp/Forms/PagePreview.resx b/PdfSharp/Forms/PagePreview.resx new file mode 100644 index 0000000..5d320b1 --- /dev/null +++ b/PdfSharp/Forms/PagePreview.resx @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + False + + + False + + + PagePreview + + + False + + + 80 + + + (Default) + + + False + + + Private + + + 4, 4 + + \ No newline at end of file diff --git a/PdfSharp/Forms/PagePreviewCanvas.cs b/PdfSharp/Forms/PagePreviewCanvas.cs new file mode 100644 index 0000000..1c2a1e8 --- /dev/null +++ b/PdfSharp/Forms/PagePreviewCanvas.cs @@ -0,0 +1,87 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections; +using System.ComponentModel; +#if GDI +using System.Drawing; +using System.Windows.Forms; +#endif +#if Wpf +using System.Windows.Media; +#endif + +#if !GDI +#error This file must only be included in GDI build. +#endif + +namespace PdfSharp.Forms +{ + /// + /// Implements the control that previews the page. + /// + class PagePreviewCanvas : System.Windows.Forms.Control + { + public PagePreviewCanvas(PagePreview preview) + { + _preview = preview; + SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true); + } + PagePreview _preview; + + protected override void OnPaint(PaintEventArgs e) + { + if (!_preview._showPage) + return; + + Graphics gfx = e.Graphics; + bool zoomChanged; + _preview.CalculatePreviewDimension(out zoomChanged); + _preview.RenderPage(gfx); + } + + protected override void OnPaintBackground(PaintEventArgs e) + { + if (!_preview._showPage) + { + e.Graphics.Clear(_preview._desktopColor); + return; + } + bool zoomChanged; + _preview.CalculatePreviewDimension(out zoomChanged); + _preview.PaintBackground(e.Graphics); + } + + protected override void OnSizeChanged(EventArgs e) + { + Invalidate(); + } + } +} diff --git a/PdfSharp/Forms/PagePreviewCanvas.resx b/PdfSharp/Forms/PagePreviewCanvas.resx new file mode 100644 index 0000000..3f337e0 --- /dev/null +++ b/PdfSharp/Forms/PagePreviewCanvas.resx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.0.0.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/PdfSharp/Forms/enums/RenderMode.cs b/PdfSharp/Forms/enums/RenderMode.cs new file mode 100644 index 0000000..779978e --- /dev/null +++ b/PdfSharp/Forms/enums/RenderMode.cs @@ -0,0 +1,54 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +namespace PdfSharp.Forms +{ + /// + /// Specifies how to reander the preview. + /// + public enum RenderMode + { + /// + /// Draw immediately. + /// + Direct = 0, + + /// + /// Draw using a metafile. + /// + Metafile = 1, + + /// + /// Draw using a bitmap image. + /// + Bitmap = 2 + } +} +#endif diff --git a/PdfSharp/Forms/enums/Zoom.cs b/PdfSharp/Forms/enums/Zoom.cs new file mode 100644 index 0000000..788121a --- /dev/null +++ b/PdfSharp/Forms/enums/Zoom.cs @@ -0,0 +1,120 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +namespace PdfSharp.Forms +{ + /// + /// Defines a zoom factor used in the preview control. + /// + public enum Zoom + { + /// + /// The smallest possible zoom factor. + /// + Mininum = 10, + + /// + /// The largest possible zoom factor. + /// + Maximum = 800, + + /// + /// A pre-defined zoom factor. + /// + Percent800 = 800, + + /// + /// A pre-defined zoom factor. + /// + Percent600 = 600, + + /// + /// A pre-defined zoom factor. + /// + Percent400 = 400, + + /// + /// A pre-defined zoom factor. + /// + Percent200 = 200, + + /// + /// A pre-defined zoom factor. + /// + Percent150 = 150, + + /// + /// A pre-defined zoom factor. + /// + Percent100 = 100, + + /// + /// A pre-defined zoom factor. + /// + Percent75 = 75, + + /// + /// A pre-defined zoom factor. + /// + Percent50 = 50, + + /// + /// A pre-defined zoom factor. + /// + Percent25 = 25, + + /// + /// A pre-defined zoom factor. + /// + Percent10 = 10, + + /// + /// Sets the zoom factor so that the document fits horizontally into the window. + /// + BestFit = -1, + + /// + /// Sets the zoom factor so that the printable area of the document fits horizontally into the window. + /// Currently not yet implemented and the same as ZoomBestFit. + /// + TextFit = -2, + + /// + /// Sets the zoom factor so that the whole document fits completely into the window. + /// + FullPage = -3, + + /// + /// Sets the zoom factor so that the document is displayed in its real physical size (based on the DPI information returned from the OS for the current monitor). + /// + OriginalSize = -4, + } +} +#endif diff --git a/PdfSharp/Internal/Calc.cs b/PdfSharp/Internal/Calc.cs new file mode 100644 index 0000000..81e061f --- /dev/null +++ b/PdfSharp/Internal/Calc.cs @@ -0,0 +1,120 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows; +#endif +using PdfSharp.Drawing; + +namespace PdfSharp.Internal +{ + /// + /// Some static helper functions for calculations. + /// + internal static class Calc + { + /// + /// Degree to radiant factor. + /// + public const double Deg2Rad = Math.PI / 180; + + ///// + ///// Half of pi. + ///// + //public const double πHalf = Math.PI / 2; + //// α - β κ + + /// + /// Get page size in point from specified PageSize. + /// + public static XSize PageSizeToSize(PageSize value) + { + switch (value) + { + case PageSize.A0: + return new XSize(2380, 3368); + + case PageSize.A1: + return new XSize(1684, 2380); + + case PageSize.A2: + return new XSize(1190, 1684); + + case PageSize.A3: + return new XSize(842, 1190); + + case PageSize.A4: + return new XSize(595, 842); + + case PageSize.A5: + return new XSize(420, 595); + + case PageSize.B4: + return new XSize(729, 1032); + + case PageSize.B5: + return new XSize(516, 729); + + // The strange sizes from overseas... + + case PageSize.Letter: + return new XSize(612, 792); + + case PageSize.Legal: + return new XSize(612, 1008); + + case PageSize.Tabloid: + return new XSize(792, 1224); + + case PageSize.Ledger: + return new XSize(1224, 792); + + case PageSize.Statement: + return new XSize(396, 612); + + case PageSize.Executive: + return new XSize(540, 720); + + case PageSize.Folio: + return new XSize(612, 936); + + case PageSize.Quarto: + return new XSize(610, 780); + + case PageSize.Size10x14: + return new XSize(720, 1008); + } + throw new ArgumentException("Invalid PageSize."); + } + } +} diff --git a/PdfSharp/Internal/ColorHelper.cs b/PdfSharp/Internal/ColorHelper.cs new file mode 100644 index 0000000..222b317 --- /dev/null +++ b/PdfSharp/Internal/ColorHelper.cs @@ -0,0 +1,83 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows; +#endif + +#pragma warning disable 649 + +namespace PdfSharp.Internal +{ + struct SColor + { + public byte a; + public byte r; + public byte g; + public byte b; + } + + struct SCColor + { + public float a; + public float r; + public float g; + public float b; + } + + static class ColorHelper + { + public static float sRgbToScRgb(byte bval) + { + float num = ((float)bval) / 255f; + if (num <= 0.0) + return 0f; + if (num <= 0.04045) + return (num / 12.92f); + if (num < 1f) + return (float)Math.Pow((num + 0.055) / 1.055, 2.4); + return 1f; + } + + public static byte ScRgbTosRgb(float val) + { + if (val <= 0.0) + return 0; + if (val <= 0.0031308) + return (byte)(((255f * val) * 12.92f) + 0.5f); + if (val < 1.0) + return (byte)((255f * ((1.055f * ((float)Math.Pow((double)val, 0.41666666666666669))) - 0.055f)) + 0.5f); + return 0xff; + } + } +} diff --git a/PdfSharp/Internal/Diagnostics.cs b/PdfSharp/Internal/Diagnostics.cs new file mode 100644 index 0000000..f246805 --- /dev/null +++ b/PdfSharp/Internal/Diagnostics.cs @@ -0,0 +1,117 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Globalization; +using PdfSharp.Pdf.Content; +using PdfSharp.Pdf.IO; + +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows; +#endif + +namespace PdfSharp.Internal +{ + enum NotImplementedBehaviour + { + DoNothing, Log, Throw + } + + /// + /// A bunch of internal helper functions. + /// + internal static class Diagnostics + { + public static NotImplementedBehaviour NotImplementedBehaviour + { + get { return _notImplementedBehaviour; } + set { _notImplementedBehaviour = value; } + } + static NotImplementedBehaviour _notImplementedBehaviour; + } + + internal static class ParserDiagnostics + { + public static void ThrowParserException(string message) + { + throw new PdfReaderException(message); + } + + public static void ThrowParserException(string message, Exception innerException) + { + throw new PdfReaderException(message, innerException); + } + + public static void HandleUnexpectedCharacter(char ch) + { + // Hex formatting does not work with type char. It must be casted to integer. + string message = string.Format(CultureInfo.InvariantCulture, + "Unexpected character '0x{0:x4}' in PDF stream. The file may be corrupted. " + + "If you think this is a bug in PDFsharp, please send us your PDF file.", (int)ch); + ThrowParserException(message); + } + public static void HandleUnexpectedToken(string token) + { + string message = string.Format(CultureInfo.InvariantCulture, + "Unexpected token '{0}' in PDF stream. The file may be corrupted. " + + "If you think this is a bug in PDFsharp, please send us your PDF file.", token); + ThrowParserException(message); + } + } + + internal static class ContentReaderDiagnostics + { + public static void ThrowContentReaderException(string message) + { + throw new ContentReaderException(message); + } + + public static void ThrowContentReaderException(string message, Exception innerException) + { + throw new ContentReaderException(message, innerException); + } + + public static void ThrowNumberOutOfIntegerRange(long value) + { + string message = string.Format(CultureInfo.InvariantCulture, "Number '{0}' out of integer range.", value); + ThrowContentReaderException(message); + } + + public static void HandleUnexpectedCharacter(char ch) + { + string message = string.Format(CultureInfo.InvariantCulture, + "Unexpected character '0x{0:x4}' in content stream. The stream may be corrupted or the feature is not implemented. " + + "If you think this is a bug in PDFsharp, please send us your PDF file.", (int)ch); + ThrowContentReaderException(message); + } + } +} diff --git a/PdfSharp/Internal/DiagnosticsHelper.cs b/PdfSharp/Internal/DiagnosticsHelper.cs new file mode 100644 index 0000000..f6eaec3 --- /dev/null +++ b/PdfSharp/Internal/DiagnosticsHelper.cs @@ -0,0 +1,148 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows; +#endif +using System.Diagnostics; +using PdfSharp.Drawing; +using PdfSharp.Fonts; + +namespace PdfSharp.Internal +{ + /// + /// A bunch of internal helper functions. + /// + internal static class DiagnosticsHelper + { + public static void HandleNotImplemented(string message) + { + string text = "Not implemented: " + message; + switch (Diagnostics.NotImplementedBehaviour) + { + case NotImplementedBehaviour.DoNothing: + break; + + case NotImplementedBehaviour.Log: + Logger.Log(text); + break; + + case NotImplementedBehaviour.Throw: + ThrowNotImplementedException(text); + break; + + default: + throw new ArgumentOutOfRangeException(); + } + } + + /// + /// Indirectly throws NotImplementedException. + /// Required because PDFsharp Release builds tread warnings as errors and + /// throwing NotImplementedException may lead to unreachable code which + /// crashes the build. + /// + public static void ThrowNotImplementedException(string message) + { + throw new NotImplementedException(message); + } + } + + internal static class Logger + { + public static void Log(string format, params object[] args) + { + Debug.WriteLine("Log..."); + } + } + + class Logging + { + + } + + class Tracing + { + [Conditional("DEBUG")] + public void Foo() + { } + } + + /// + /// Helper class around the Debugger class. + /// + public static class DebugBreak + { + /// + /// Call Debugger.Break() if a debugger is attached. + /// + public static void Break() + { + Break(false); + } + + /// + /// Call Debugger.Break() if a debugger is attached or when always is set to true. + /// + public static void Break(bool always) + { +#if DEBUG + if (always || Debugger.IsAttached) + Debugger.Break(); +#endif + } + } + + /// + /// Internal stuff for development of PDFsharp. + /// + public static class FontsDevHelper + { + /// + /// Creates font and enforces bold/italic simulation. + /// + public static XFont CreateSpecialFont(string familyName, double emSize, XFontStyle style, + XPdfFontOptions pdfOptions, XStyleSimulations styleSimulations) + { + return new XFont(familyName, emSize, style, pdfOptions, styleSimulations); + } + + /// + /// Dumps the font caches to a string. + /// + public static string GetFontCachesState() + { + return FontFactory.GetFontCachesState(); + } + } +} diff --git a/PdfSharp/Internal/DoubleUtil.cs b/PdfSharp/Internal/DoubleUtil.cs new file mode 100644 index 0000000..bbf1bd4 --- /dev/null +++ b/PdfSharp/Internal/DoubleUtil.cs @@ -0,0 +1,208 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Microsoft +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Runtime.InteropServices; +#if !EDF_CORE +using PdfSharp.Drawing; +#else +using PdfSharp.Drawing; +#endif + +#if !EDF_CORE +namespace PdfSharp.Internal +#else +namespace Edf.Internal +#endif +{ + /// + /// Some floating point utilities. Partially reflected from WPF, later equalized with original source code. + /// + internal static class DoubleUtil + { + const double Epsilon = 2.2204460492503131E-16; // smallest such that 1.0 + Epsilon != 1.0 + private const double TenTimesEpsilon = 10.0 * Epsilon; + const float FloatMinimum = 1.175494E-38f; + + /// + /// Indicates whether the values are so close that they can be considered as equal. + /// + public static bool AreClose(double value1, double value2) + { + //if (value1 == value2) + if (value1.Equals(value2)) + return true; + // This computes (|value1-value2| / (|value1| + |value2| + 10.0)) < Epsilon + double eps = (Math.Abs(value1) + Math.Abs(value2) + 10.0) * Epsilon; + double delta = value1 - value2; + return (-eps < delta) && (eps > delta); + } + + /// + /// Indicates whether the values are so close that they can be considered as equal. + /// + public static bool AreRoughlyEqual(double value1, double value2, int decimalPlace) + { + if (value1 == value2) + return true; + return Math.Abs(value1 - value2) < decs[decimalPlace]; + } + static readonly double[] decs = { 1, 1E-1, 1E-2, 1E-3, 1E-4, 1E-5, 1E-6, 1E-7, 1E-8, 1E-9, 1E-10, 1E-11, 1E-12, 1E-13, 1E-14, 1E-15, 1E-16 }; + + /// + /// Indicates whether the values are so close that they can be considered as equal. + /// + public static bool AreClose(XPoint point1, XPoint point2) + { + return AreClose(point1.X, point2.X) && AreClose(point1.Y, point2.Y); + } + + /// + /// Indicates whether the values are so close that they can be considered as equal. + /// + public static bool AreClose(XRect rect1, XRect rect2) + { + if (rect1.IsEmpty) + return rect2.IsEmpty; + return !rect2.IsEmpty && AreClose(rect1.X, rect2.X) && AreClose(rect1.Y, rect2.Y) && + AreClose(rect1.Height, rect2.Height) && AreClose(rect1.Width, rect2.Width); + } + + /// + /// Indicates whether the values are so close that they can be considered as equal. + /// + public static bool AreClose(XSize size1, XSize size2) + { + return AreClose(size1.Width, size2.Width) && AreClose(size1.Height, size2.Height); + } + + /// + /// Indicates whether the values are so close that they can be considered as equal. + /// + public static bool AreClose(XVector vector1, XVector vector2) + { + return AreClose(vector1.X, vector2.X) && AreClose(vector1.Y, vector2.Y); + } + + /// + /// Indicates whether value1 is greater than value2 and the values are not close to each other. + /// + public static bool GreaterThan(double value1, double value2) + { + return value1 > value2 && !AreClose(value1, value2); + } + + /// + /// Indicates whether value1 is greater than value2 or the values are close to each other. + /// + public static bool GreaterThanOrClose(double value1, double value2) + { + return value1 > value2 || AreClose(value1, value2); + } + + /// + /// Indicates whether value1 is less than value2 and the values are not close to each other. + /// + public static bool LessThan(double value1, double value2) + { + return value1 < value2 && !AreClose(value1, value2); + } + + /// + /// Indicates whether value1 is less than value2 or the values are close to each other. + /// + public static bool LessThanOrClose(double value1, double value2) + { + return value1 < value2 || AreClose(value1, value2); + } + + /// + /// Indicates whether the value is between 0 and 1 or close to 0 or 1. + /// + public static bool IsBetweenZeroAndOne(double value) + { + return GreaterThanOrClose(value, 0) && LessThanOrClose(value, 1); + } + + /// + /// Indicates whether the value is not a number. + /// + public static bool IsNaN(double value) + { + NanUnion t = new NanUnion(); + t.DoubleValue = value; + + ulong exp = t.UintValue & 0xfff0000000000000; + ulong man = t.UintValue & 0x000fffffffffffff; + + return (exp == 0x7ff0000000000000 || exp == 0xfff0000000000000) && (man != 0); + } + + /// + /// Indicates whether at least one of the four rectangle values is not a number. + /// + public static bool RectHasNaN(XRect r) + { + return IsNaN(r.X) || IsNaN(r.Y) || IsNaN(r.Height) || IsNaN(r.Width); + } + + /// + /// Indicates whether the value is 1 or close to 1. + /// + public static bool IsOne(double value) + { + return Math.Abs(value - 1.0) < TenTimesEpsilon; + } + + /// + /// Indicates whether the value is 0 or close to 0. + /// + public static bool IsZero(double value) + { + return Math.Abs(value) < TenTimesEpsilon; + } + + /// + /// Converts a double to integer. + /// + public static int DoubleToInt(double value) + { + return 0 < value ? (int)(value + 0.5) : (int)(value - 0.5); + } + + [StructLayout(LayoutKind.Explicit)] + struct NanUnion + { + [FieldOffset(0)] + internal double DoubleValue; + [FieldOffset(0)] + internal readonly ulong UintValue; + } + } +} diff --git a/PdfSharp/Internal/Lock.cs b/PdfSharp/Internal/Lock.cs new file mode 100644 index 0000000..ef69f5a --- /dev/null +++ b/PdfSharp/Internal/Lock.cs @@ -0,0 +1,75 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.ComponentModel; +using System.Threading; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Internal +{ + /// + /// Static locking functions to make PDFsharp thread save. + /// + internal static class Lock + { + public static void EnterGdiPlus() + { + //if (_fontFactoryLockCount > 0) + // throw new InvalidOperationException(""); + + Monitor.Enter(GdiPlus); + _gdiPlusLockCount++; + } + + public static void ExitGdiPlus() + { + _gdiPlusLockCount--; + Monitor.Exit(GdiPlus); + } + + static readonly object GdiPlus = new object(); + static int _gdiPlusLockCount; + + public static void EnterFontFactory() + { + Monitor.Enter(FontFactory); + _fontFactoryLockCount++; + } + + public static void ExitFontFactory() + { + _fontFactoryLockCount--; + Monitor.Exit(FontFactory); + } + static readonly object FontFactory = new object(); + [ThreadStatic] + static int _fontFactoryLockCount; + } +} diff --git a/PdfSharp/Internal/NativeMethods.cs b/PdfSharp/Internal/NativeMethods.cs new file mode 100644 index 0000000..a40862a --- /dev/null +++ b/PdfSharp/Internal/NativeMethods.cs @@ -0,0 +1,155 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Runtime.InteropServices; + +// ReSharper disable InconsistentNaming + +namespace PdfSharp.Internal +{ +#if CORE || GDI || WPF + /// + /// Required native Win32 calls. + /// + static class NativeMethods + { + public const int GDI_ERROR = -1; + + /// + /// Reflected from System.Drawing.SafeNativeMethods+LOGFONT + /// + //[SuppressUnmanagedCodeSecurity] + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + public class LOGFONT + { + // Preserve us for warning CS0649... + LOGFONT(int dummy) + { + lfHeight = 0; + lfWidth = 0; + lfEscapement = 0; + lfOrientation = 0; + lfWeight = 0; + lfItalic = 0; + lfUnderline = 0; + lfStrikeOut = 0; + lfCharSet = 0; + lfOutPrecision = 0; + lfClipPrecision = 0; + lfQuality = 0; + lfPitchAndFamily = 0; + lfFaceName = ""; + } + public int lfHeight; + public int lfWidth; + public int lfEscapement; + public int lfOrientation; + public int lfWeight; + public byte lfItalic; + public byte lfUnderline; + public byte lfStrikeOut; + public byte lfCharSet; + public byte lfOutPrecision; + public byte lfClipPrecision; + public byte lfQuality; + public byte lfPitchAndFamily; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string lfFaceName; + public override string ToString() + { + object[] objArray1 = new object[0x1c] + { + "lfHeight=", lfHeight, + ", lfWidth=", lfWidth, + ", lfEscapement=", lfEscapement, + ", lfOrientation=", lfOrientation, + ", lfWeight=", lfWeight, + ", lfItalic=", lfItalic, + ", lfUnderline=", lfUnderline, + ", lfStrikeOut=", lfStrikeOut, + ", lfCharSet=", lfCharSet, + ", lfOutPrecision=", lfOutPrecision, + ", lfClipPrecision=", lfClipPrecision, + ", lfQuality=", lfQuality, + ", lfPitchAndFamily=", lfPitchAndFamily, + ", lfFaceName=", lfFaceName + }; + return string.Concat(objArray1); + } + public LOGFONT() { } + } + + [DllImport("user32.dll")] + public static extern IntPtr GetDC(IntPtr hwnd); + + [DllImport("user32.dll")] + public static extern IntPtr ReleaseDC(IntPtr hwnd, IntPtr hdc); + + [DllImport("gdi32.dll", SetLastError = true)] + public static extern int GetFontData( + IntPtr hdc, // handle to DC + uint dwTable, // metric table name + uint dwOffset, // offset into table + byte[] lpvBuffer, // buffer for returned data + int cbData // length of data + ); + + // CreateDCA(__in_opt LPCSTR pwszDriver, __in_opt LPCSTR pwszDevice, __in_opt LPCSTR pszPort, __in_opt CONST DEVMODEA* pdm); + [DllImport("gdi32.dll", SetLastError = true)] + public static extern IntPtr CreateDC( + string driver, + string device, + string port, + IntPtr data + ); + + [DllImport("gdi32.dll", SetLastError = true)] + public static extern IntPtr CreateCompatibleDC(IntPtr hdc); + + [DllImport("gdi32.dll", EntryPoint = "CreateFontIndirectW")] + public static extern IntPtr CreateFontIndirect(LOGFONT lpLogFont); + + [DllImport("gdi32.dll")] + public static extern IntPtr SelectObject(IntPtr hdc, IntPtr hgdiobj); + + [DllImport("gdi32.dll")] + public static extern bool DeleteObject(IntPtr hgdiobj); + + public const int HORZSIZE = 4; // Horizontal size in millimeters + public const int VERTSIZE = 6; // Vertical size in millimeters + public const int HORZRES = 8; // Horizontal width in pixels + public const int VERTRES = 10; // Vertical height in pixels + public const int LOGPIXELSX = 88; // Logical pixels/inch in X + public const int LOGPIXELSY = 90; // Logical pixels/inch in Y + [DllImport("gdi32.dll")] + public static extern int GetDeviceCaps(IntPtr hdc, int nIndex); + } +#endif +} \ No newline at end of file diff --git a/PdfSharp/Internal/TokenizerHelper.cs b/PdfSharp/Internal/TokenizerHelper.cs new file mode 100644 index 0000000..dbdeba3 --- /dev/null +++ b/PdfSharp/Internal/TokenizerHelper.cs @@ -0,0 +1,259 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Microsoft +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Globalization; + +#if !EDF_CORE +namespace PdfSharp.Internal +#else +namespace Edf.Internal +#endif +{ + // Reflected from WPF to ensure compatibility + // Use netmassdownloader -d "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0" -output g:\cachetest -v + class TokenizerHelper + { + /// + /// Initializes a new instance of the class. + /// + public TokenizerHelper(string str, IFormatProvider formatProvider) + { + char numericListSeparator = GetNumericListSeparator(formatProvider); + Initialize(str, '\'', numericListSeparator); + } + + /// + /// Initializes a new instance of the class. + /// + public TokenizerHelper(string str, char quoteChar, char separator) + { + Initialize(str, quoteChar, separator); + } + + void Initialize(string str, char quoteChar, char separator) + { + _str = str; + _strLen = str == null ? 0 : str.Length; + _currentTokenIndex = -1; + _quoteChar = quoteChar; + _argSeparator = separator; + + // Skip any whitespace. + while (_charIndex < _strLen) + { + if (!char.IsWhiteSpace(_str, _charIndex)) + return; + _charIndex++; + } + } + + public string NextTokenRequired() + { + if (!NextToken(false)) + throw new InvalidOperationException("PrematureStringTermination"); //SR.Get(SRID.TokenizerHelperPrematureStringTermination, new object[0])); + return GetCurrentToken(); + } + + public string NextTokenRequired(bool allowQuotedToken) + { + if (!NextToken(allowQuotedToken)) + throw new InvalidOperationException("PrematureStringTermination"); //SR.Get(SRID.TokenizerHelperPrematureStringTermination, new object[0])); + return GetCurrentToken(); + } + + public string GetCurrentToken() + { + if (_currentTokenIndex < 0) + return null; + return _str.Substring(_currentTokenIndex, _currentTokenLength); + } + + public void LastTokenRequired() + { + if (_charIndex != _strLen) + throw new InvalidOperationException("Extra data encountered"); //SR.Get(SRID.TokenizerHelperExtraDataEncountered, new object[0])); + } + + /// + /// Move to next token. + /// + public bool NextToken() + { + return NextToken(false); + } + + /// + /// Move to next token. + /// + public bool NextToken(bool allowQuotedToken) + { + return NextToken(allowQuotedToken, _argSeparator); + } + + public bool NextToken(bool allowQuotedToken, char separator) + { + // Reset index. + _currentTokenIndex = -1; + _foundSeparator = false; + + // Already at the end of the string? + if (_charIndex >= _strLen) + return false; + + char currentChar = _str[_charIndex]; + + // Setup the quoteCount . + int quoteCount = 0; + + // If we are allowing a quoted token and this token begins with a quote, + // set up the quote count and skip the initial quote + if (allowQuotedToken && + currentChar == _quoteChar) + { + quoteCount++; + _charIndex++; + } + + int newTokenIndex = _charIndex; + int newTokenLength = 0; + + // Loop until hit end of string or hit a separator or whitespace. + while (_charIndex < _strLen) + { + currentChar = _str[_charIndex]; + + // If have a quoteCount and this is a quote decrement the quoteCount. + if (quoteCount > 0) + { + // If anything but a quoteChar we move on. + if (currentChar == _quoteChar) + { + quoteCount--; + + // If at zero which it always should for now break out of the loop. + if (quoteCount == 0) + { + ++_charIndex; + break; + } + } + } + else if ((char.IsWhiteSpace(currentChar)) || (currentChar == separator)) + { + if (currentChar == separator) + _foundSeparator = true; + break; + } + + _charIndex++; + newTokenLength++; + } + + // If quoteCount isn't zero we hit the end of the string before the ending quote. + if (quoteCount > 0) + throw new InvalidOperationException("Missing end quote"); //SR.Get(SRID.TokenizerHelperMissingEndQuote, new object[0])); + + // Move at the start of the nextToken. + ScanToNextToken(separator); + + // Update the _currentToken values. + _currentTokenIndex = newTokenIndex; + _currentTokenLength = newTokenLength; + + if (_currentTokenLength < 1) + throw new InvalidOperationException("Empty token"); // SR.Get(SRID.TokenizerHelperEmptyToken, new object[0])); + + return true; + } + + private void ScanToNextToken(char separator) + { + // Do nothing if already at end of the string. + if (_charIndex < _strLen) + { + char currentChar = _str[_charIndex]; + + // Ensure that currentChar is a white space or separator. + if (currentChar != separator && !char.IsWhiteSpace(currentChar)) + throw new InvalidOperationException("ExtraDataEncountered"); //SR.Get(SRID.TokenizerHelperExtraDataEncountered, new object[0])); + + // Loop until a character that isn't the separator or white space. + int argSepCount = 0; + while (_charIndex < _strLen) + { + currentChar = _str[_charIndex]; + if (currentChar == separator) + { + _foundSeparator = true; + argSepCount++; + _charIndex++; + + if (argSepCount > 1) + throw new InvalidOperationException("EmptyToken"); //SR.Get(SRID.TokenizerHelperEmptyToken, new object[0])); + } + else if (char.IsWhiteSpace(currentChar)) + { + // Skip white space. + ++_charIndex; + } + else + break; + } + + // If there was a separatorChar then we shouldn't be at the end of string or means there was a separator but there isn't an arg. + if (argSepCount > 0 && _charIndex >= _strLen) + throw new InvalidOperationException("EmptyToken"); // SR.Get(SRID.TokenizerHelperEmptyToken, new object[0])); + } + } + + public static char GetNumericListSeparator(IFormatProvider provider) + { + char numericSeparator = ','; + NumberFormatInfo numberFormat = NumberFormatInfo.GetInstance(provider); + if (numberFormat.NumberDecimalSeparator.Length > 0 && numericSeparator == numberFormat.NumberDecimalSeparator[0]) + numericSeparator = ';'; + return numericSeparator; + } + + public bool FoundSeparator + { + get { return _foundSeparator; } + } + bool _foundSeparator; + + char _argSeparator; + int _charIndex; + int _currentTokenIndex; + int _currentTokenLength; + char _quoteChar; + string _str; + int _strLen; + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf.AcroForms/PdfAcroField.cs b/PdfSharp/Pdf.AcroForms/PdfAcroField.cs new file mode 100644 index 0000000..1cae3dc --- /dev/null +++ b/PdfSharp/Pdf.AcroForms/PdfAcroField.cs @@ -0,0 +1,579 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using PdfSharp.Pdf.Advanced; + +namespace PdfSharp.Pdf.AcroForms +{ + /// + /// Represents the base class for all interactive field dictionaries. + /// + public abstract class PdfAcroField : PdfDictionary + { + /// + /// Initializes a new instance of PdfAcroField. + /// + internal PdfAcroField(PdfDocument document) + : base(document) + { } + + /// + /// Initializes a new instance of the class. Used for type transformation. + /// + protected PdfAcroField(PdfDictionary dict) + : base(dict) + { } + + /// + /// Gets the name of this field. + /// + public string Name + { + get + { + string name = Elements.GetString(Keys.T); + return name; + } + } + + /// + /// Gets the field flags of this instance. + /// + public PdfAcroFieldFlags Flags + { + // TODO: This entry is inheritable, thus the implementation is incorrect... + get { return (PdfAcroFieldFlags)Elements.GetInteger(Keys.Ff); } + } + + internal PdfAcroFieldFlags SetFlags + { + get { return (PdfAcroFieldFlags)Elements.GetInteger(Keys.Ff); } + set { Elements.SetInteger(Keys.Ff, (int)value); } + } + + /// + /// Gets or sets the value of the field. + /// + public virtual PdfItem Value + { + get { return Elements[Keys.V]; } + set + { + if (ReadOnly) + throw new InvalidOperationException("The field is read only."); + if (value is PdfString || value is PdfName) + Elements[Keys.V] = value; + else + throw new NotImplementedException("Values other than string cannot be set."); + } + } + + /// + /// Gets or sets a value indicating whether the field is read only. + /// + public bool ReadOnly + { + get { return (Flags & PdfAcroFieldFlags.ReadOnly) != 0; } + set + { + if (value) + SetFlags |= PdfAcroFieldFlags.ReadOnly; + else + SetFlags &= ~PdfAcroFieldFlags.ReadOnly; + } + } + + /// + /// Gets the field with the specified name. + /// + public PdfAcroField this[string name] + { + get { return GetValue(name); } + } + + /// + /// Gets a child field by name. + /// + protected virtual PdfAcroField GetValue(string name) + { + if (String.IsNullOrEmpty(name)) + return this; + if (HasKids) + return Fields.GetValue(name); + return null; + } + + /// + /// Indicates whether the field has child fields. + /// + public bool HasKids + { + get + { + PdfItem item = Elements[Keys.Kids]; + if (item == null) + return false; + if (item is PdfArray) + return ((PdfArray)item).Elements.Count > 0; + return false; + } + } + + /// + /// Gets the names of all descendants of this field. + /// + [Obsolete("Use GetDescendantNames")] + public string[] DescendantNames // Properties should not return arrays. + { + get { return GetDescendantNames(); } + } + + /// + /// Gets the names of all descendants of this field. + /// + public string[] GetDescendantNames() + { + List names = new List(); + if (HasKids) + { + PdfAcroFieldCollection fields = Fields; + fields.GetDescendantNames(ref names, null); + } + List temp = new List(); + foreach (string name in names) + temp.Add(name); + return temp.ToArray(); + } + + /// + /// Gets the names of all appearance dictionaries of this AcroField. + /// + public string[] GetAppearanceNames() + { + Dictionary names = new Dictionary(); + PdfDictionary dict = Elements["/AP"] as PdfDictionary; + if (dict != null) + { + AppDict(dict, names); + + if (HasKids) + { + PdfItem[] kids = Fields.Elements.Items; + foreach (PdfItem pdfItem in kids) + { + if (pdfItem is PdfReference) + { + PdfDictionary xxx = ((PdfReference)pdfItem).Value as PdfDictionary; + if (xxx != null) + AppDict(xxx, names); + } + } + //((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements.SetName(Keys.V, name1); + + } + } + string[] array = new string[names.Count]; + names.Keys.CopyTo(array, 0); + return array; + } + + //static string[] AppearanceNames(PdfDictionary dictIn) + //{ + // Dictionary names = new Dictionary(); + // PdfDictionary dict = dictIn["/AP"] as PdfDictionary; + // if (dict != null) + // { + // AppDict(dict, names); + + // if (HasKids) + // { + // PdfItem[] kids = Fields.Elements.Items; + // foreach (PdfItem pdfItem in kids) + // { + // if (pdfItem is PdfReference) + // { + // PdfDictionary xxx = ((PdfReference)pdfItem).Value as PdfDictionary; + // if (xxx != null) + // AppDict(xxx, names); + // } + // } + // //((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements.SetName(Keys.V, name1); + + // } + // } + // string[] array = new string[names.Count]; + // names.Keys.CopyTo(array, 0); + // return array; + //} + + static void AppDict(PdfDictionary dict, Dictionary names) + { + PdfDictionary sub; + if ((sub = dict.Elements["/D"] as PdfDictionary) != null) + AppDict2(sub, names); + if ((sub = dict.Elements["/N"] as PdfDictionary) != null) + AppDict2(sub, names); + } + + static void AppDict2(PdfDictionary dict, Dictionary names) + { + foreach (string key in dict.Elements.Keys) + { + if (!names.ContainsKey(key)) + names.Add(key, null); + } + } + + internal virtual void GetDescendantNames(ref List names, string partialName) + { + if (HasKids) + { + PdfAcroFieldCollection fields = Fields; + string t = Elements.GetString(Keys.T); + Debug.Assert(t != ""); + if (t.Length > 0) + { + if (!String.IsNullOrEmpty(partialName)) + partialName += "." + t; + else + partialName = t; + fields.GetDescendantNames(ref names, partialName); + } + } + else + { + string t = Elements.GetString(Keys.T); + Debug.Assert(t != ""); + if (t.Length > 0) + { + if (!String.IsNullOrEmpty(partialName)) + names.Add(partialName + "." + t); + else + names.Add(t); + } + } + } + + /// + /// Gets the collection of fields within this field. + /// + public PdfAcroFieldCollection Fields + { + get + { + if (_fields == null) + { + object o = Elements.GetValue(Keys.Kids, VCF.CreateIndirect); + _fields = (PdfAcroFieldCollection)o; + } + return _fields; + } + } + PdfAcroFieldCollection _fields; + + /// + /// Holds a collection of interactive fields. + /// + public sealed class PdfAcroFieldCollection : PdfArray + { + PdfAcroFieldCollection(PdfArray array) + : base(array) + { } + + /// + /// Gets the number of elements in the array. + /// + public int Count + { + get + { + return Elements.Count; + } + } + + /// + /// Gets the names of all fields in the collection. + /// + public string[] Names + { + get + { + int count = Elements.Count; + string[] names = new string[count]; + for (int idx = 0; idx < count; idx++) + names[idx] = ((PdfDictionary)((PdfReference)Elements[idx]).Value).Elements.GetString(Keys.T); + return names; + } + } + + /// + /// Gets an array of all descendant names. + /// + public string[] DescendantNames + { + get + { + List names = new List(); + GetDescendantNames(ref names, null); + //List temp = new List(); + //foreach (PdfName name in names) + // temp.Add(name.ToString()); + return names.ToArray(); + } + } + + internal void GetDescendantNames(ref List names, string partialName) + { + int count = Elements.Count; + for (int idx = 0; idx < count; idx++) + { + PdfAcroField field = this[idx]; + if (field != null) + field.GetDescendantNames(ref names, partialName); + } + } + + /// + /// Gets a field from the collection. For your convenience an instance of a derived class like + /// PdfTextField or PdfCheckBox is returned if PDFsharp can guess the actual type of the dictionary. + /// If the actual type cannot be guessed by PDFsharp the function returns an instance + /// of PdfGenericField. + /// + public PdfAcroField this[int index] + { + get + { + PdfItem item = Elements[index]; + Debug.Assert(item is PdfReference); + PdfDictionary dict = ((PdfReference)item).Value as PdfDictionary; + Debug.Assert(dict != null); + PdfAcroField field = dict as PdfAcroField; + if (field == null && dict != null) + { + // Do type transformation + field = CreateAcroField(dict); + //Elements[index] = field.XRef; + } + return field; + } + } + + /// + /// Gets the field with the specified name. + /// + public PdfAcroField this[string name] + { + get { return GetValue(name); } + } + + internal PdfAcroField GetValue(string name) + { + if (String.IsNullOrEmpty(name)) + return null; + + int dot = name.IndexOf('.'); + string prefix = dot == -1 ? name : name.Substring(0, dot); + string suffix = dot == -1 ? "" : name.Substring(dot + 1); + + int count = Elements.Count; + for (int idx = 0; idx < count; idx++) + { + PdfAcroField field = this[idx]; + if (field.Name == prefix) + return field.GetValue(suffix); + } + return null; + } + + /// + /// Create a derived type like PdfTextField or PdfCheckBox if possible. + /// If the actual cannot be guessed by PDFsharp the function returns an instance + /// of PdfGenericField. + /// + PdfAcroField CreateAcroField(PdfDictionary dict) + { + string ft = dict.Elements.GetName(Keys.FT); + PdfAcroFieldFlags flags = (PdfAcroFieldFlags)dict.Elements.GetInteger(Keys.Ff); + switch (ft) + { + case "/Btn": + if ((flags & PdfAcroFieldFlags.Pushbutton) != 0) + return new PdfPushButtonField(dict); + + if ((flags & PdfAcroFieldFlags.Radio) != 0) + return new PdfRadioButtonField(dict); + + return new PdfCheckBoxField(dict); + + case "/Tx": + return new PdfTextField(dict); + + case "/Ch": + if ((flags & PdfAcroFieldFlags.Combo) != 0) + return new PdfComboBoxField(dict); + else + return new PdfListBoxField(dict); + + case "/Sig": + return new PdfSignatureField(dict); + + default: + return new PdfGenericField(dict); + } + } + } + + /// + /// Predefined keys of this dictionary. + /// The description comes from PDF 1.4 Reference. + /// + public class Keys : KeysBase + { + // ReSharper disable InconsistentNaming + + /// + /// (Required for terminal fields; inheritable) The type of field that this dictionary + /// describes: + /// Btn Button + /// Tx Text + /// Ch Choice + /// Sig (PDF 1.3) Signature + /// Note: This entry may be present in a nonterminal field (one whose descendants + /// are themselves fields) in order to provide an inheritable FT value. However, a + /// nonterminal field does not logically have a type of its own; it is merely a container + /// for inheritable attributes that are intended for descendant terminal fields of + /// any type. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string FT = "/FT"; + + /// + /// (Required if this field is the child of another in the field hierarchy; absent otherwise) + /// The field that is the immediate parent of this one (the field, if any, whose Kids array + /// includes this field). A field can have at most one parent; that is, it can be included + /// in the Kids array of at most one other field. + /// + [KeyInfo(KeyType.Dictionary)] + public const string Parent = "/Parent"; + + /// + /// (Optional) An array of indirect references to the immediate children of this field. + /// + [KeyInfo(KeyType.Array | KeyType.Optional, typeof(PdfAcroFieldCollection))] + public const string Kids = "/Kids"; + + /// + /// (Optional) The partial field name. + /// + [KeyInfo(KeyType.TextString | KeyType.Optional)] + public const string T = "/T"; + + /// + /// (Optional; PDF 1.3) An alternate field name, to be used in place of the actual + /// field name wherever the field must be identified in the user interface (such as + /// in error or status messages referring to the field). This text is also useful + /// when extracting the documents contents in support of accessibility to disabled + /// users or for other purposes. + /// + [KeyInfo(KeyType.TextString | KeyType.Optional)] + public const string TU = "/TU"; + + /// + /// (Optional; PDF 1.3) The mapping name to be used when exporting interactive form field + /// data from the document. + /// + [KeyInfo(KeyType.TextString | KeyType.Optional)] + public const string TM = "/TM"; + + /// + /// (Optional; inheritable) A set of flags specifying various characteristics of the field. + /// Default value: 0. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string Ff = "/Ff"; + + /// + /// (Optional; inheritable) The fields value, whose format varies depending on + /// the field type; see the descriptions of individual field types for further information. + /// + [KeyInfo(KeyType.Various | KeyType.Optional)] + public const string V = "/V"; + + /// + /// (Optional; inheritable) The default value to which the field reverts when a + /// reset-form action is executed. The format of this value is the same as that of V. + /// + [KeyInfo(KeyType.Various | KeyType.Optional)] + public const string DV = "/DV"; + + /// + /// (Optional; PDF 1.2) An additional-actions dictionary defining the fields behavior + /// in response to various trigger events. This entry has exactly the same meaning as + /// the AA entry in an annotation dictionary. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional)] + public const string AA = "/AA"; + + // ----- Additional entries to all fields containing variable text -------------------------- + + /// + /// (Required; inheritable) A resource dictionary containing default resources + /// (such as fonts, patterns, or color spaces) to be used by the appearance stream. + /// At a minimum, this dictionary must contain a Font entry specifying the resource + /// name and font dictionary of the default font for displaying the fields text. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required)] + public const string DR = "/DR"; + + /// + /// (Required; inheritable) The default appearance string, containing a sequence of + /// valid page-content graphics or text state operators defining such properties as + /// the fields text size and color. + /// + [KeyInfo(KeyType.String | KeyType.Required)] + public const string DA = "/DA"; + + /// + /// (Optional; inheritable) A code specifying the form of quadding (justification) + /// to be used in displaying the text: + /// 0 Left-justified + /// 1 Centered + /// 2 Right-justified + /// Default value: 0 (left-justified). + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string Q = "/Q"; + + // ReSharper restore InconsistentNaming + } + } +} diff --git a/PdfSharp/Pdf.AcroForms/PdfAcroForm.cs b/PdfSharp/Pdf.AcroForms/PdfAcroForm.cs new file mode 100644 index 0000000..402eda4 --- /dev/null +++ b/PdfSharp/Pdf.AcroForms/PdfAcroForm.cs @@ -0,0 +1,151 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.AcroForms +{ + /// + /// Represents an interactive form (or AcroForm), a collection of fields for + /// gathering information interactively from the user. + /// + public sealed class PdfAcroForm : PdfDictionary + { + /// + /// Initializes a new instance of AcroForm. + /// + internal PdfAcroForm(PdfDocument document) + : base(document) + { + _document = document; + } + + internal PdfAcroForm(PdfDictionary dictionary) + : base(dictionary) + { } + + /// + /// Gets the fields collection of this form. + /// + public PdfAcroField.PdfAcroFieldCollection Fields + { + get + { + if (_fields == null) + { + object o = Elements.GetValue(Keys.Fields, VCF.CreateIndirect); + _fields = (PdfAcroField.PdfAcroFieldCollection)o; + } + return _fields; + } + } + PdfAcroField.PdfAcroFieldCollection _fields; + + /// + /// Predefined keys of this dictionary. + /// The description comes from PDF 1.4 Reference. + /// + public sealed class Keys : KeysBase + { + // ReSharper disable InconsistentNaming + + /// + /// (Required) An array of references to the documents root fields (those with + /// no ancestors in the field hierarchy). + /// + [KeyInfo(KeyType.Array | KeyType.Required, typeof(PdfAcroField.PdfAcroFieldCollection))] + public const string Fields = "/Fields"; + + /// + /// (Optional) A flag specifying whether to construct appearance streams and + /// appearance dictionaries for all widget annotations in the document. + /// Default value: false. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string NeedAppearances = "/NeedAppearances"; + + /// + /// (Optional; PDF 1.3) A set of flags specifying various document-level characteristics + /// related to signature fields. + /// Default value: 0. + /// + [KeyInfo("1.3", KeyType.Integer | KeyType.Optional)] + public const string SigFlags = "/SigFlags"; + + /// + /// (Required if any fields in the document have additional-actions dictionaries + /// containing a C entry; PDF 1.3) An array of indirect references to field dictionaries + /// with calculation actions, defining the calculation order in which their values will + /// be recalculated when the value of any field changes. + /// + [KeyInfo(KeyType.Array)] + public const string CO = "/CO"; + + /// + /// (Optional) A document-wide default value for the DR attribute of variable text fields. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional)] + public const string DR = "/DR"; + + /// + /// (Optional) A document-wide default value for the DA attribute of variable text fields. + /// + [KeyInfo(KeyType.String | KeyType.Optional)] + public const string DA = "/DA"; + + /// + /// (Optional) A document-wide default value for the Q attribute of variable text fields. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string Q = "/Q"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get + { + if (s_meta == null) + s_meta = CreateMeta(typeof(Keys)); + return s_meta; + } + } + static DictionaryMeta s_meta; + + // ReSharper restore InconsistentNaming + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.AcroForms/PdfButtonField.cs b/PdfSharp/Pdf.AcroForms/PdfButtonField.cs new file mode 100644 index 0000000..b7846fa --- /dev/null +++ b/PdfSharp/Pdf.AcroForms/PdfButtonField.cs @@ -0,0 +1,103 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using PdfSharp.Pdf.Annotations; + +namespace PdfSharp.Pdf.AcroForms +{ + /// + /// Represents the base class for all button fields. + /// + public abstract class PdfButtonField : PdfAcroField + { + /// + /// Initializes a new instance of the class. + /// + protected PdfButtonField(PdfDocument document) + : base(document) + { } + + /// + /// Initializes a new instance of the class. + /// + protected PdfButtonField(PdfDictionary dict) + : base(dict) + { } + + /// + /// Gets the name which represents the opposite of /Off. + /// + protected string GetNonOffValue() + { + // Try to get the information from the appearance dictionaray. + // Just return the first key that is not /Off. + // I'm not sure what is the right solution to get this value. + PdfDictionary ap = Elements[PdfAnnotation.Keys.AP] as PdfDictionary; + if (ap != null) + { + PdfDictionary n = ap.Elements["/N"] as PdfDictionary; + if (n != null) + { + foreach (string name in n.Elements.Keys) + if (name != "/Off") + return name; + } + } + return null; + } + + internal override void GetDescendantNames(ref List names, string partialName) + { + string t = Elements.GetString(PdfAcroField.Keys.T); + // HACK: ??? + if (t == "") + t = "???"; + Debug.Assert(t != ""); + if (t.Length > 0) + { + if (!String.IsNullOrEmpty(partialName)) + names.Add(partialName + "." + t); + else + names.Add(t); + } + } + + /// + /// Predefined keys of this dictionary. + /// The description comes from PDF 1.4 Reference. + /// + public new class Keys : PdfAcroField.Keys + { + // Pushbuttons have no additional entries. + } + } +} diff --git a/PdfSharp/Pdf.AcroForms/PdfCheckBoxField.cs b/PdfSharp/Pdf.AcroForms/PdfCheckBoxField.cs new file mode 100644 index 0000000..cdc10f9 --- /dev/null +++ b/PdfSharp/Pdf.AcroForms/PdfCheckBoxField.cs @@ -0,0 +1,401 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Pdf.Annotations; +using PdfSharp.Pdf.Advanced; + +namespace PdfSharp.Pdf.AcroForms +{ + /// + /// Represents the check box field. + /// + public sealed class PdfCheckBoxField : PdfButtonField + { + /// + /// Initializes a new instance of PdfCheckBoxField. + /// + internal PdfCheckBoxField(PdfDocument document) + : base(document) + { + _document = document; + } + + internal PdfCheckBoxField(PdfDictionary dict) + : base(dict) + { } + +#if true_ + /// + /// Indicates whether the field is checked. + /// + public bool Checked //R080317 // TODO + { + get + { + if (!HasKids) + { + string value = Elements.GetString(Keys.V); + //return !String.IsNullOrEmpty(value) && value != UncheckedValue; + return !String.IsNullOrEmpty(value) && value == CheckedName; + } + + if (Fields.Elements.Items.Length == 2) + { + string value = ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements.GetString(Keys.V); + //bool bReturn = value.Length != 0 && value != UncheckedValue; //R081114 (3Std.!!) auch auf Nein prfen; //TODO woher kommt der Wert? + bool bReturn = value.Length != 0 && value == CheckedName; + return bReturn; + } + + // NYI: Return false in any other case. + return false; + } + + set + { + if (!HasKids) + { + //string name = value ? GetNonOffValue() : "/Off"; + string name = value ? CheckedName : UncheckedName; + Elements.SetName(Keys.V, name); + Elements.SetName(PdfAnnotation.Keys.AS, name); + } + else + { + // Here we have to handle fields that exist twice with the same name. + // Checked must be set for both fields, using /Off for one field and skipping /Off for the other, + // to have only one field with a check mark. + // Finding this took me two working days. + if (Fields.Elements.Items.Length == 2) + { + if (value) + { + //Element 0 behandeln -> auf checked setzen + string name1 = ""; + PdfDictionary o = ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements["/AP"] as PdfDictionary; + if (o != null) + { + PdfDictionary n = o.Elements["/N"] as PdfDictionary; + if (n != null) + { + foreach (string name in n.Elements.Keys) + { + //if (name != UncheckedValue) + if (name == CheckedName) + { + name1 = name; + break; + } + } + } + } + if (name1.Length != 0) + { + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements.SetName(Keys.V, name1); + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements.SetName(PdfAnnotation.Keys.AS, name1); + } + + //Element 1 behandeln -> auf unchecked setzen + o = ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements["/AP"] as PdfDictionary; + if (o != null) + { + PdfDictionary n = o.Elements["/N"] as PdfDictionary; + if (n != null) + { + foreach (string name in n.Elements.Keys) + { + if (name == UncheckedName) + { + name1 = name; + break; + } + } + } + } + if (!String.IsNullOrEmpty(name1)) + { + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements.SetName(Keys.V, name1); + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements.SetName(PdfAnnotation.Keys.AS, name1); + } + } + else + { + //Element 0 behandeln -> auf unchecked setzen + string name1 = ""; + PdfDictionary o = ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements["/AP"] as PdfDictionary; + if (o != null) + { + PdfDictionary n = o.Elements["/N"] as PdfDictionary; + if (n != null) + { + foreach (string name in n.Elements.Keys) + { + //if (name != UncheckedValue) + if (name == CheckedName) + { + name1 = name; + break; + } + } + } + } + if (name1.Length != 0) + { + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements.SetName(Keys.V, name1); + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements.SetName(PdfAnnotation.Keys.AS, name1); + } + + //Element 1 behandeln -> auf checked setzen + o = ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements["/AP"] as PdfDictionary; + if (o != null) + { + PdfDictionary n = o.Elements["/N"] as PdfDictionary; + if (n != null) + { + foreach (string name in n.Elements.Keys) + { + if (name == UncheckedName) + { + name1 = name; + break; + } + } + } + } + if (name1.Length != 0) + { + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements.SetName(Keys.V, name1); + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements.SetName(PdfAnnotation.Keys.AS, name1); + } + } + } + } + } + } + +#else + /// + /// Indicates whether the field is checked. + /// + public bool Checked + { + get + { + if (!HasKids) //R080317 + { + string value = Elements.GetString(Keys.V); + return value.Length != 0 && value != "/Off"; + } + else //R080317 + { + if (Fields.Elements.Items.Length == 2) + { + string value = ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements.GetString(Keys.V); + bool bReturn = value.Length != 0 && value != "/Off" && value != "/Nein"; //R081114 (3Std.!!) auch auf Nein prfen; //TODO woher kommt der Wert? + return bReturn; + } + else + return false; + } + } + set + { + if (!HasKids) + { + string name = value ? GetNonOffValue() : "/Off"; + Elements.SetName(Keys.V, name); + Elements.SetName(PdfAnnotation.Keys.AS, name); + } + else + { + // Here we have to handle fields that exist twice with the same name. + // Checked must be set for both fields, using /Off for one field and skipping /Off for the other, + // to have only one field with a check mark. + // Finding this took me two working days. + if (Fields.Elements.Items.Length == 2) + { + if (value) + { + //Element 0 behandeln -> auf checked setzen + string name1 = ""; + PdfDictionary o = ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements["/AP"] as PdfDictionary; + if (o != null) + { + PdfDictionary n = o.Elements["/N"] as PdfDictionary; + if (n != null) + { + foreach (string name in n.Elements.Keys) + { + if (name != "/Off") + { + name1 = name; + break; + } + } + } + } + if (name1.Length != 0) + { + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements.SetName(Keys.V, name1); + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements.SetName(PdfAnnotation.Keys.AS, name1); + } + + //Element 1 behandeln -> auf unchecked setzen + o = ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements["/AP"] as PdfDictionary; + if (o != null) + { + PdfDictionary n = o.Elements["/N"] as PdfDictionary; + if (n != null) + { + foreach (string name in n.Elements.Keys) + { + if (name == "/Off") + { + name1 = name; + break; + } + } + } + } + if (name1.Length != 0) + { + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements.SetName(Keys.V, name1); + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements.SetName(PdfAnnotation.Keys.AS, name1); + } + + } + else + { + //Element 0 behandeln -> auf unchecked setzen + string name1 = ""; + PdfDictionary o = ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements["/AP"] as PdfDictionary; + if (o != null) + { + PdfDictionary n = o.Elements["/N"] as PdfDictionary; + if (n != null) + { + foreach (string name in n.Elements.Keys) + { + if (name != "/Off") + { + name1 = name; + break; + } + } + } + } + if (name1.Length != 0) + { + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements.SetName(Keys.V, name1); + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[1])).Value)).Elements.SetName(PdfAnnotation.Keys.AS, name1); + } + + //Element 1 behandeln -> auf checked setzen + o = ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements["/AP"] as PdfDictionary; + if (o != null) + { + PdfDictionary n = o.Elements["/N"] as PdfDictionary; + if (n != null) + { + foreach (string name in n.Elements.Keys) + { + if (name == "/Off") + { + name1 = name; + break; + } + } + } + } + if (name1.Length != 0) + { + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements.SetName(Keys.V, name1); + ((PdfDictionary)(((PdfReference)(Fields.Elements.Items[0])).Value)).Elements.SetName(PdfAnnotation.Keys.AS, name1); + } + } + } + } + } + } +#endif + + /// + /// Gets or sets the name of the dictionary that represents the Checked state. + /// + /// The default value is "/Yes". + public string CheckedName + { + get { return _checkedName; } + set { _checkedName = value; } + } + string _checkedName = "/Yes"; + + /// + /// Gets or sets the name of the dictionary that represents the Unchecked state. + /// The default value is "/Off". + /// + public string UncheckedName + { + get { return _uncheckedName; } + set { _uncheckedName = value; } + } + string _uncheckedName = "/Off"; + + /// + /// Predefined keys of this dictionary. + /// The description comes from PDF 1.4 Reference. + /// + public new class Keys : PdfButtonField.Keys + { + /// + /// (Optional; inheritable; PDF 1.4) A text string to be used in place of the V entry for the + /// value of the field. + /// + [KeyInfo(KeyType.TextString | KeyType.Optional)] + public const string Opt = "/Opt"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.AcroForms/PdfChoiceField.cs b/PdfSharp/Pdf.AcroForms/PdfChoiceField.cs new file mode 100644 index 0000000..80d89dd --- /dev/null +++ b/PdfSharp/Pdf.AcroForms/PdfChoiceField.cs @@ -0,0 +1,181 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; + +namespace PdfSharp.Pdf.AcroForms +{ + /// + /// Represents the base class for all choice field dictionaries. + /// + public abstract class PdfChoiceField : PdfAcroField + { + /// + /// Initializes a new instance of the class. + /// + protected PdfChoiceField(PdfDocument document) + : base(document) + { } + + /// + /// Initializes a new instance of the class. + /// + protected PdfChoiceField(PdfDictionary dict) + : base(dict) + { } + + /// + /// Gets the index of the specified string in the /Opt array or -1, if no such string exists. + /// + protected int IndexInOptArray(string value) + { + PdfArray opt = Elements.GetArray(Keys.Opt); + +#if DEBUG // Check with //R080317 implemention + PdfArray opt2 = null; + if (Elements[Keys.Opt] is PdfArray) + opt2 = Elements[Keys.Opt] as PdfArray; + else if (Elements[Keys.Opt] is Advanced.PdfReference) + { + //falls das Array nicht direkt am Element hngt, + //das Array aus dem referenzierten Element holen + opt2 = ((Advanced.PdfReference)Elements[Keys.Opt]).Value as PdfArray; + } + Debug.Assert(ReferenceEquals(opt, opt2)); +#endif + + if (opt != null) + { + int count = opt.Elements.Count; + for (int idx = 0; idx < count; idx++) + { + PdfItem item = opt.Elements[idx]; + if (item is PdfString) + { + if (item.ToString() == value) + return idx; + } + else if (item is PdfArray) + { + PdfArray array = (PdfArray)item; + if (array.Elements.Count != 0) + { + if (array.Elements[0].ToString() == value) + return idx; + } + } + } + } + return -1; + } + + /// + /// Gets the value from the index in the /Opt array. + /// + protected string ValueInOptArray(int index) + { + PdfArray opt = Elements.GetArray(Keys.Opt); + if (opt != null) + { + int count = opt.Elements.Count; + if (index < 0 || index >= count) + throw new ArgumentOutOfRangeException("index"); + + PdfItem item = opt.Elements[index]; + if (item is PdfString) + return item.ToString(); + + if (item is PdfArray) + { + PdfArray array = (PdfArray)item; + if (array.Elements.Count != 0) + return array.Elements[0].ToString(); + } + } + return ""; + } + + /// + /// Predefined keys of this dictionary. + /// The description comes from PDF 1.4 Reference. + /// + public new class Keys : PdfAcroField.Keys + { + // ReSharper disable InconsistentNaming + + /// + /// (Required; inheritable) An array of options to be presented to the user. Each element of + /// the array is either a text string representing one of the available options or a two-element + /// array consisting of a text string together with a default appearance string for constructing + /// the items appearance dynamically at viewing time. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string Opt = "/Opt"; + + /// + /// (Optional; inheritable) For scrollable list boxes, the top index (the index in the Opt array + /// of the first option visible in the list). + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string TI = "/TI"; + + /// + /// (Sometimes required, otherwise optional; inheritable; PDF 1.4) For choice fields that allow + /// multiple selection (MultiSelect flag set), an array of integers, sorted in ascending order, + /// representing the zero-based indices in the Opt array of the currently selected option + /// items. This entry is required when two or more elements in the Opt array have different + /// names but the same export value, or when the value of the choice field is an array; in + /// other cases, it is permitted but not required. If the items identified by this entry differ + /// from those in the V entry of the field dictionary (see below), the V entry takes precedence. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string I = "/I"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + + // ReSharper restore InconsistentNaming + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.AcroForms/PdfComboBoxField.cs b/PdfSharp/Pdf.AcroForms/PdfComboBoxField.cs new file mode 100644 index 0000000..99ac476 --- /dev/null +++ b/PdfSharp/Pdf.AcroForms/PdfComboBoxField.cs @@ -0,0 +1,132 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.AcroForms +{ + /// + /// Represents the combo box field. + /// + public sealed class PdfComboBoxField : PdfChoiceField + { + /// + /// Initializes a new instance of PdfComboBoxField. + /// + internal PdfComboBoxField(PdfDocument document) + : base(document) + { } + + internal PdfComboBoxField(PdfDictionary dict) + : base(dict) + { } + + /// + /// Gets or sets the index of the selected item. + /// + public int SelectedIndex + { + get + { + string value = Elements.GetString(Keys.V); + return IndexInOptArray(value); + } + set + { + // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + if (value != -1) //R080325 + { + string key = ValueInOptArray(value); + Elements.SetString(Keys.V, key); + Elements.SetInteger("/I", value); //R080304 !!!!!!! sonst reagiert die Combobox berhaupt nicht !!!!! + } + } + } + + /// + /// Gets or sets the value of the field. + /// + // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + public override PdfItem Value //R080304 + { + get { return Elements[Keys.V]; } + set + { + if (ReadOnly) + throw new InvalidOperationException("The field is read only."); + if (value is PdfString || value is PdfName) + { + Elements[Keys.V] = value; + SelectedIndex = SelectedIndex; //R080304 !!! + if (SelectedIndex == -1) + { + //R080317 noch nicht rund + try + { + //anhngen + ((PdfArray)(((PdfItem[])(Elements.Values))[2])).Elements.Add(Value); + SelectedIndex = SelectedIndex; + } + catch { } + } + } + else + throw new NotImplementedException("Values other than string cannot be set."); + } + } + + /// + /// Predefined keys of this dictionary. + /// The description comes from PDF 1.4 Reference. + /// + public new class Keys : PdfAcroField.Keys + { + // Combo boxes have no additional entries. + + internal static DictionaryMeta Meta + { + get + { + if (Keys._meta == null) + Keys._meta = CreateMeta(typeof(Keys)); + return Keys._meta; + } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.AcroForms/PdfGenericField.cs b/PdfSharp/Pdf.AcroForms/PdfGenericField.cs new file mode 100644 index 0000000..bf8b2f0 --- /dev/null +++ b/PdfSharp/Pdf.AcroForms/PdfGenericField.cs @@ -0,0 +1,69 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.AcroForms +{ + /// + /// Represents a generic field. Used for AcroForm dictionaries unknown to PDFsharp. + /// + public sealed class PdfGenericField : PdfAcroField + { + /// + /// Initializes a new instance of PdfGenericField. + /// + internal PdfGenericField(PdfDocument document) + : base(document) + { } + + internal PdfGenericField(PdfDictionary dict) + : base(dict) + { } + + /// + /// Predefined keys of this dictionary. + /// The description comes from PDF 1.4 Reference. + /// + public new class Keys : PdfAcroField.Keys + { + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.AcroForms/PdfListBoxField.cs b/PdfSharp/Pdf.AcroForms/PdfListBoxField.cs new file mode 100644 index 0000000..3523d63 --- /dev/null +++ b/PdfSharp/Pdf.AcroForms/PdfListBoxField.cs @@ -0,0 +1,88 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.AcroForms +{ + /// + /// Represents the list box field. + /// + public sealed class PdfListBoxField : PdfChoiceField + { + /// + /// Initializes a new instance of PdfListBoxField. + /// + internal PdfListBoxField(PdfDocument document) + : base(document) + { } + + internal PdfListBoxField(PdfDictionary dict) + : base(dict) + { } + + /// + /// Gets or sets the index of the selected item + /// + public int SelectedIndex + { + get + { + string value = Elements.GetString(Keys.V); + return IndexInOptArray(value); + } + set + { + string key = ValueInOptArray(value); + Elements.SetString(Keys.V, key); + } + } + + /// + /// Predefined keys of this dictionary. + /// The description comes from PDF 1.4 Reference. + /// + public new class Keys : PdfAcroField.Keys + { + // List boxes have no additional entries. + + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.AcroForms/PdfPushButtonField.cs b/PdfSharp/Pdf.AcroForms/PdfPushButtonField.cs new file mode 100644 index 0000000..fdb1a64 --- /dev/null +++ b/PdfSharp/Pdf.AcroForms/PdfPushButtonField.cs @@ -0,0 +1,71 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.AcroForms +{ + /// + /// Represents the push button field. + /// + public sealed class PdfPushButtonField : PdfButtonField + { + /// + /// Initializes a new instance of PdfPushButtonField. + /// + internal PdfPushButtonField(PdfDocument document) + : base(document) + { + _document = document; + } + + internal PdfPushButtonField(PdfDictionary dict) + : base(dict) + { } + + /// + /// Predefined keys of this dictionary. + /// The description comes from PDF 1.4 Reference. + /// + public new class Keys : PdfAcroField.Keys + { + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.AcroForms/PdfRadioButtonField.cs b/PdfSharp/Pdf.AcroForms/PdfRadioButtonField.cs new file mode 100644 index 0000000..f970329 --- /dev/null +++ b/PdfSharp/Pdf.AcroForms/PdfRadioButtonField.cs @@ -0,0 +1,132 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.AcroForms +{ + /// + /// Represents the radio button field. + /// + public sealed class PdfRadioButtonField : PdfButtonField + { + /// + /// Initializes a new instance of PdfRadioButtonField. + /// + internal PdfRadioButtonField(PdfDocument document) + : base(document) + { + _document = document; + } + + internal PdfRadioButtonField(PdfDictionary dict) + : base(dict) + { } + + /// + /// Gets or sets the index of the selected radio button in a radio button group. + /// + public int SelectedIndex + { + get + { + string value = Elements.GetString(Keys.V); + return IndexInOptStrings(value); + } + set + { + PdfArray opt = Elements[Keys.Opt] as PdfArray; + + if (opt == null) + opt = Elements[Keys.Kids] as PdfArray; + + if (opt != null) + { + int count = opt.Elements.Count; + if (value < 0 || value >= count) + throw new ArgumentOutOfRangeException("value"); + Elements.SetName(Keys.V, opt.Elements[value].ToString()); + } + } + } + + int IndexInOptStrings(string value) + { + PdfArray opt = Elements[Keys.Opt] as PdfArray; + if (opt != null) + { + int count = opt.Elements.Count; + for (int idx = 0; idx < count; idx++) + { + PdfItem item = opt.Elements[idx]; + if (item is PdfString) + { + if (item.ToString() == value) + return idx; + } + } + } + return -1; + } + + /// + /// Predefined keys of this dictionary. + /// The description comes from PDF 1.4 Reference. + /// + public new class Keys : PdfButtonField.Keys + { + /// + /// (Optional; inheritable; PDF 1.4) An array of text strings to be used in + /// place of the V entries for the values of the widget annotations representing + /// the individual radio buttons. Each element in the array represents + /// the export value of the corresponding widget annotation in the + /// Kids array of the radio button field. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string Opt = "/Opt"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.AcroForms/PdfSignatureField.cs b/PdfSharp/Pdf.AcroForms/PdfSignatureField.cs new file mode 100644 index 0000000..e9fd1d6 --- /dev/null +++ b/PdfSharp/Pdf.AcroForms/PdfSignatureField.cs @@ -0,0 +1,134 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.AcroForms +{ + /// + /// Represents the signature field. + /// + public sealed class PdfSignatureField : PdfAcroField + { + /// + /// Initializes a new instance of PdfSignatureField. + /// + internal PdfSignatureField(PdfDocument document) + : base(document) + { } + + internal PdfSignatureField(PdfDictionary dict) + : base(dict) + { } + + /// + /// Predefined keys of this dictionary. + /// The description comes from PDF 1.4 Reference. + /// + public new class Keys : PdfAcroField.Keys + { + /// + /// (Optional) The type of PDF object that this dictionary describes; if present, + /// must be Sig for a signature dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string Type = "/Type"; + + /// + /// (Required; inheritable) The name of the signature handler to be used for + /// authenticating the fields contents, such as Adobe.PPKLite, Entrust.PPKEF, + /// CICI.SignIt, or VeriSign.PPKVS. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string Filter = "/Filter"; + + /// + /// (Optional) The name of a specific submethod of the specified handler. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string SubFilter = "/SubFilter"; + + /// + /// (Required) An array of pairs of integers (starting byte offset, length in bytes) + /// describing the exact byte range for the digest calculation. Multiple discontinuous + /// byte ranges may be used to describe a digest that does not include the + /// signature token itself. + /// + [KeyInfo(KeyType.Array | KeyType.Required)] + public const string ByteRange = "/ByteRange"; + + /// + /// (Required) The encrypted signature token. + /// + [KeyInfo(KeyType.String | KeyType.Required)] + public const string Contents = "/Contents"; + + /// + /// (Optional) The name of the person or authority signing the document. + /// + [KeyInfo(KeyType.TextString | KeyType.Optional)] + public const string Name = "/Name"; + + /// + /// (Optional) The time of signing. Depending on the signature handler, this + /// may be a normal unverified computer time or a time generated in a verifiable + /// way from a secure time server. + /// + [KeyInfo(KeyType.Date | KeyType.Optional)] + public const string M = "/M"; + + /// + /// (Optional) The CPU host name or physical location of the signing. + /// + [KeyInfo(KeyType.TextString | KeyType.Optional)] + public const string Location = "/Location"; + + /// + /// (Optional) The reason for the signing, such as (I agree). + /// + [KeyInfo(KeyType.TextString | KeyType.Optional)] + public const string Reason = "/Reason"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.AcroForms/PdfTextField.cs b/PdfSharp/Pdf.AcroForms/PdfTextField.cs new file mode 100644 index 0000000..8bf6644 --- /dev/null +++ b/PdfSharp/Pdf.AcroForms/PdfTextField.cs @@ -0,0 +1,309 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.Annotations; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf.AcroForms +{ + /// + /// Represents the text field. + /// + public sealed class PdfTextField : PdfAcroField + { + /// + /// Initializes a new instance of PdfTextField. + /// + internal PdfTextField(PdfDocument document) + : base(document) + { } + + internal PdfTextField(PdfDictionary dict) + : base(dict) + { } + + /// + /// Gets or sets the text value of the text field. + /// + public string Text + { + get { return Elements.GetString(Keys.V); } + set { Elements.SetString(Keys.V, value); RenderAppearance(); } //HACK in PdfTextField + } + + /// + /// Gets or sets the font used to draw the text of the field. + /// + public XFont Font + { + get { return _font; } + set { _font = value; } + } + XFont _font = new XFont("Courier New", 10); + + /// + /// Gets or sets the foreground color of the field. + /// + public XColor ForeColor + { + get { return _foreColor; } + set { _foreColor = value; } + } + XColor _foreColor = XColors.Black; + + /// + /// Gets or sets the background color of the field. + /// + public XColor BackColor + { + get { return _backColor; } + set { _backColor = value; } + } + XColor _backColor = XColor.Empty; + + /// + /// Gets or sets the maximum length of the field. + /// + /// The length of the max. + public int MaxLength + { + get { return Elements.GetInteger(Keys.MaxLen); } + set { Elements.SetInteger(Keys.MaxLen, value); } + } + + /// + /// Gets or sets a value indicating whether the field has multiple lines. + /// + public bool MultiLine + { + get { return (Flags & PdfAcroFieldFlags.Multiline) != 0; } + set + { + if (value) + SetFlags |= PdfAcroFieldFlags.Multiline; + else + SetFlags &= ~PdfAcroFieldFlags.Multiline; + } + } + + /// + /// Gets or sets a value indicating whether this field is used for passwords. + /// + public bool Password + { + get { return (Flags & PdfAcroFieldFlags.Password) != 0; } + set + { + if (value) + SetFlags |= PdfAcroFieldFlags.Password; + else + SetFlags &= ~PdfAcroFieldFlags.Password; + } + } + + /// + /// Creates the normal appearance form X object for the annotation that represents + /// this acro form text field. + /// + void RenderAppearance() + { +#if true_ + PdfFormXObject xobj = new PdfFormXObject(Owner); + Owner.Internals.AddObject(xobj); + xobj.Elements["/BBox"] = new PdfLiteral("[0 0 122.653 12.707]"); + xobj.Elements["/FormType"] = new PdfLiteral("1"); + xobj.Elements["/Matrix"] = new PdfLiteral("[1 0 0 1 0 0]"); + PdfDictionary res = new PdfDictionary(Owner); + xobj.Elements["/Resources"] = res; + res.Elements["/Font"] = new PdfLiteral("<< /Helv 28 0 R >> /ProcSet [/PDF /Text]"); + xobj.Elements["/Subtype"] = new PdfLiteral("/Form"); + xobj.Elements["/Type"] = new PdfLiteral("/XObject"); + + string s = + "/Tx BMC " + '\n' + + "q" + '\n' + + "1 1 120.653 10.707 re" + '\n' + + "W" + '\n' + + "n" + '\n' + + "BT" + '\n' + + "/Helv 7.93 Tf" + '\n' + + "0 g" + '\n' + + "2 3.412 Td" + '\n' + + "(Hello ) Tj" + '\n' + + "20.256 0 Td" + '\n' + + "(XXX) Tj" + '\n' + + "ET" + '\n' + + "Q" + '\n' + + "";//"EMC"; + int length = s.Length; + byte[] stream = new byte[length]; + for (int idx = 0; idx < length; idx++) + stream[idx] = (byte)s[idx]; + xobj.CreateStream(stream); + + // Get existing or create new appearance dictionary + PdfDictionary ap = Elements[PdfAnnotation.Keys.AP] as PdfDictionary; + if (ap == null) + { + ap = new PdfDictionary(_document); + Elements[PdfAnnotation.Keys.AP] = ap; + } + + // Set XRef to normal state + ap.Elements["/N"] = xobj.Reference; + + + + + //// HACK + //string m = + //"" + '\n' + + //" " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" PDFsharp 1.40.2150-g (www.pdfsharp.com) (Original: Powered By Crystal) " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" 2011-07-11T23:15:09+02:00 " + '\n' + + //" 2011-05-19T16:26:51+03:00 " + '\n' + + //" 2011-07-11T23:15:09+02:00 " + '\n' + + //" Crystal Reports " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" application/pdf " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" uuid:68249d89-baed-4384-9a2d-fbf8ace75c45 " + '\n' + + //" uuid:3d5f2f46-c140-416f-baf2-7f9c970cef1d " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" " + '\n' + + //" " + '\n' + + //""; + + //PdfDictionary mdict = (PdfDictionary)_document.Internals.GetObject(new PdfObjectID(32)); + + //length = m.Length; + //stream = new byte[length]; + //for (int idx = 0; idx < length; idx++) + // stream[idx] = (byte)m[idx]; + + //mdict.Stream.Value = stream; + + + + +#else + PdfRectangle rect = Elements.GetRectangle(PdfAnnotation.Keys.Rect); + XForm form = new XForm(_document, rect.Size); + XGraphics gfx = XGraphics.FromForm(form); + + if (_backColor != XColor.Empty) + gfx.DrawRectangle(new XSolidBrush(BackColor), rect.ToXRect() - rect.Location); + + string text = Text; + if (text.Length > 0) + gfx.DrawString(Text, Font, new XSolidBrush(ForeColor), + rect.ToXRect() - rect.Location + new XPoint(2, 0), XStringFormats.TopLeft); + + form.DrawingFinished(); + form.PdfForm.Elements.Add("/FormType", new PdfLiteral("1")); + + // Get existing or create new appearance dictionary. + PdfDictionary ap = Elements[PdfAnnotation.Keys.AP] as PdfDictionary; + if (ap == null) + { + ap = new PdfDictionary(_document); + Elements[PdfAnnotation.Keys.AP] = ap; + } + + // Set XRef to normal state + ap.Elements["/N"] = form.PdfForm.Reference; + + PdfFormXObject xobj = form.PdfForm; + string s = xobj.Stream.ToString(); + // Thank you Adobe: Without putting the content in 'EMC brackets' + // the text is not rendered by PDF Reader 9 or higher. + s = "/Tx BMC\n" + s + "\nEMC"; + xobj.Stream.Value = new RawEncoding().GetBytes(s); +#endif + } + + internal override void PrepareForSave() + { + base.PrepareForSave(); + RenderAppearance(); + } + + /// + /// Predefined keys of this dictionary. + /// The description comes from PDF 1.4 Reference. + /// + public new class Keys : PdfAcroField.Keys + { + /// + /// (Optional; inheritable) The maximum length of the fields text, in characters. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string MaxLen = "/MaxLen"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.AcroForms/enums/PdfAcroFieldFlags.cs b/PdfSharp/Pdf.AcroForms/enums/PdfAcroFieldFlags.cs new file mode 100644 index 0000000..a4869a3 --- /dev/null +++ b/PdfSharp/Pdf.AcroForms/enums/PdfAcroFieldFlags.cs @@ -0,0 +1,151 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.AcroForms +{ + /// + /// Specifies the flags of AcroForm fields. + /// + [Flags] + public enum PdfAcroFieldFlags + { + // ----- Common to all fields ----------------------------------------------------------------- + + /// + /// If set, the user may not change the value of the field. Any associated widget + /// annotations will not interact with the user; that is, they will not respond to + /// mouse clicks or change their appearance in response to mouse motions. This + /// flag is useful for fields whose values are computed or imported from a database. + /// + ReadOnly = 1 << (1 - 1), + + /// + /// If set, the field must have a value at the time it is exported by a submit-form action. + /// + Required = 1 << (2 - 1), + + /// + /// If set, the field must not be exported by a submit-form action. + /// + NoExport = 1 << (3 - 1), + + // ----- Specific to button fields ------------------------------------------------------------ + + /// + /// If set, the field is a pushbutton that does not retain a permanent value. + /// + Pushbutton = 1 << (17 - 1), + + /// + /// If set, the field is a set of radio buttons; if clear, the field is a checkbox. + /// This flag is meaningful only if the Pushbutton flag is clear. + /// + Radio = 1 << (16 - 1), + + /// + /// (Radio buttons only) If set, exactly one radio button must be selected at all times; + /// clicking the currently selected button has no effect. If clear, clicking + /// the selected button deselects it, leaving no button selected. + /// + NoToggleToOff = 1 << (15 - 1), + + // ----- Specific to text fields -------------------------------------------------------------- + + /// + /// If set, the field may contain multiple lines of text; if clear, the fields text + /// is restricted to a single line. + /// + Multiline = 1 << (13 - 1), + + /// + /// If set, the field is intended for entering a secure password that should + /// not be echoed visibly to the screen. Characters typed from the keyboard + /// should instead be echoed in some unreadable form, such as + /// asterisks or bullet characters. + /// To protect password confidentiality, viewer applications should never + /// store the value of the text field in the PDF file if this flag is set. + /// + Password = 1 << (14 - 1), + + /// + /// (PDF 1.4) If set, the text entered in the field represents the pathname of + /// a file whose contents are to be submitted as the value of the field. + /// + FileSelect = 1 << (21 - 1), + + /// + /// (PDF 1.4) If set, the text entered in the field will not be spell-checked. + /// + DoNotSpellCheckTextField = 1 << (23 - 1), + + /// + /// (PDF 1.4) If set, the field will not scroll (horizontally for single-line + /// fields, vertically for multiple-line fields) to accommodate more text + /// than will fit within its annotation rectangle. Once the field is full, no + /// further text will be accepted. + /// + DoNotScroll = 1 << (24 - 1), + + // ----- Specific to choice fields ------------------------------------------------------------ + + /// + /// If set, the field is a combo box; if clear, the field is a list box. + /// + Combo = 1 << (18 - 1), + + /// + /// If set, the combo box includes an editable text box as well as a drop list; + /// if clear, it includes only a drop list. This flag is meaningful only if the + /// Combo flag is set. + /// + Edit = 1 << (19 - 1), + + /// + /// If set, the fields option items should be sorted alphabetically. This flag is + /// intended for use by form authoring tools, not by PDF viewer applications; + /// viewers should simply display the options in the order in which they occur + /// in the Opt array. + /// + Sort = 1 << (20 - 1), + + /// + /// (PDF 1.4) If set, more than one of the fields option items may be selected + /// simultaneously; if clear, no more than one item at a time may be selected. + /// + MultiSelect = 1 << (22 - 1), + + /// + /// (PDF 1.4) If set, the text entered in the field will not be spell-checked. + /// This flag is meaningful only if the Combo and Edit flags are both set. + /// + DoNotSpellCheckChoiseField = 1 << (23 - 1), + } +} diff --git a/PdfSharp/Pdf.Actions/PdfAction.cs b/PdfSharp/Pdf.Actions/PdfAction.cs new file mode 100644 index 0000000..ee29771 --- /dev/null +++ b/PdfSharp/Pdf.Actions/PdfAction.cs @@ -0,0 +1,83 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Actions +{ + /// + /// Represents the base class for all PDF actions. + /// + public abstract class PdfAction : PdfDictionary + { + /// + /// Initializes a new instance of the class. + /// + protected PdfAction() + { + Elements.SetName(Keys.Type, "/Action"); + } + + /// + /// Initializes a new instance of the class. + /// + /// The document that owns this object. + protected PdfAction(PdfDocument document) + : base(document) + { + Elements.SetName(Keys.Type, "/Action"); + } + + /// + /// Predefined keys of this dictionary. + /// + internal class Keys : KeysBase + { + /// + /// (Optional) The type of PDF object that this dictionary describes; + /// if present, must be Action for an action dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Optional, FixedValue = "Action")] + public const string Type = "/Type"; + + /// + /// (Required) The type of action that this dictionary describes. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string S = "/S"; + + /// + /// (Optional; PDF 1.2) The next action or sequence of actions to be performed + /// after the action represented by this dictionary. The value is either a + /// single action dictionary or an array of action dictionaries to be performed + /// in order; see below for further discussion. + /// + [KeyInfo(KeyType.ArrayOrDictionary | KeyType.Optional)] + public const string Next = "/Next"; + } + } +} diff --git a/PdfSharp/Pdf.Actions/PdfGoToAction.cs b/PdfSharp/Pdf.Actions/PdfGoToAction.cs new file mode 100644 index 0000000..5cfdf26 --- /dev/null +++ b/PdfSharp/Pdf.Actions/PdfGoToAction.cs @@ -0,0 +1,80 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Actions +{ + /// + /// Represents a PDF Goto actions. + /// + public sealed class PdfGoToAction : PdfAction + { + /// + /// Initializes a new instance of the class. + /// + public PdfGoToAction() + { + Inititalize(); + } + + /// + /// Initializes a new instance of the class. + /// + /// The document that owns this object. + public PdfGoToAction(PdfDocument document) + : base(document) + { + Inititalize(); + } + + void Inititalize() + { + Elements.SetName(PdfAction.Keys.Type, "/Action"); + Elements.SetName(PdfAction.Keys.S, "/Goto"); + } + + /// + /// Predefined keys of this dictionary. + /// + internal new class Keys : PdfAction.Keys + { + ///// + ///// (Required) The type of action that this dictionary describes; + ///// must be GoTo for a go-to action. + ///// + //[KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Goto")] + //public const string S = "/S"; + + /// + /// (Required) The destination to jump to (see Section 8.2.1, Destinations). + /// + [KeyInfo(KeyType.Name | KeyType.ByteString | KeyType.Array | KeyType.Required)] + public const string D = "/D"; + } + } +} diff --git a/PdfSharp/Pdf.Actions/enums/PdfNamedActionNames.cs b/PdfSharp/Pdf.Actions/enums/PdfNamedActionNames.cs new file mode 100644 index 0000000..2f8db00 --- /dev/null +++ b/PdfSharp/Pdf.Actions/enums/PdfNamedActionNames.cs @@ -0,0 +1,57 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Actions +{ + /// + /// Specifies the predefined PDF actions. + /// + public enum PdfNamedActionNames + { + /// + /// Go to next page. + /// + NextPage, + + /// + /// Go to previous page. + /// + PrevPage, + + /// + /// Go to first page. + /// + FirstPage, + + /// + /// Go to last page. + /// + LastPage + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf.Advanced/IContentStream.cs b/PdfSharp/Pdf.Advanced/IContentStream.cs new file mode 100644 index 0000000..4d232f1 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/IContentStream.cs @@ -0,0 +1,48 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + + + +using PdfSharp.Drawing; + +namespace PdfSharp.Pdf.Advanced +{ + internal interface IContentStream + { + PdfResources Resources { get; } + + string GetFontName(XFont font, out PdfFont pdfFont); + + string GetFontName(string idName, byte[] fontData, out PdfFont pdfFont); + + string GetImageName(XImage image); + + string GetFormName(XForm form); + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf.Advanced/PdfCIDFont.cs b/PdfSharp/Pdf.Advanced/PdfCIDFont.cs new file mode 100644 index 0000000..67e86ef --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfCIDFont.cs @@ -0,0 +1,230 @@ + +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Drawing; +using PdfSharp.Pdf.Filters; +using PdfSharp.Fonts.OpenType; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a CIDFont dictionary. + /// + internal class PdfCIDFont : PdfFont + { + public PdfCIDFont(PdfDocument document) + : base(document) + { } + + public PdfCIDFont(PdfDocument document, PdfFontDescriptor fontDescriptor, XFont font) + : base(document) + { + Elements.SetName(Keys.Type, "/Font"); + Elements.SetName(Keys.Subtype, "/CIDFontType2"); + PdfDictionary cid = new PdfDictionary(); + cid.Elements.SetString("/Ordering", "Identity"); + cid.Elements.SetString("/Registry", "Adobe"); + cid.Elements.SetInteger("/Supplement", 0); + Elements.SetValue(Keys.CIDSystemInfo, cid); + + FontDescriptor = fontDescriptor; + // ReSharper disable once DoNotCallOverridableMethodsInConstructor + Owner._irefTable.Add(fontDescriptor); + Elements[Keys.FontDescriptor] = fontDescriptor.Reference; + + FontEncoding = font.PdfOptions.FontEncoding; + } + + public PdfCIDFont(PdfDocument document, PdfFontDescriptor fontDescriptor, byte[] fontData) + : base(document) + { + Elements.SetName(Keys.Type, "/Font"); + Elements.SetName(Keys.Subtype, "/CIDFontType2"); + PdfDictionary cid = new PdfDictionary(); + cid.Elements.SetString("/Ordering", "Identity"); + cid.Elements.SetString("/Registry", "Adobe"); + cid.Elements.SetInteger("/Supplement", 0); + Elements.SetValue(Keys.CIDSystemInfo, cid); + + FontDescriptor = fontDescriptor; + // ReSharper disable once DoNotCallOverridableMethodsInConstructor + Owner._irefTable.Add(fontDescriptor); + Elements[Keys.FontDescriptor] = fontDescriptor.Reference; + + FontEncoding = PdfFontEncoding.Unicode; + } + + public string BaseFont + { + get { return Elements.GetName(Keys.BaseFont); } + set { Elements.SetName(Keys.BaseFont, value); } + } + + /// + /// Prepares the object to get saved. + /// + internal override void PrepareForSave() + { + base.PrepareForSave(); + +#if DEBUG_ + if (FontDescriptor._descriptor.FontFace.loca == null) + { + GetType(); + } +#endif + // CID fonts must be always embedded. PDFsharp embeds automatically a subset. + OpenTypeFontface subSet = null; + if (FontDescriptor._descriptor.FontFace.loca == null) + subSet = FontDescriptor._descriptor.FontFace; + else + subSet = FontDescriptor._descriptor.FontFace.CreateFontSubSet(_cmapInfo.GlyphIndices, true); + byte[] fontData = subSet.FontSource.Bytes; + PdfDictionary fontStream = new PdfDictionary(Owner); + Owner.Internals.AddObject(fontStream); + FontDescriptor.Elements[PdfFontDescriptor.Keys.FontFile2] = fontStream.Reference; + + fontStream.Elements["/Length1"] = new PdfInteger(fontData.Length); + if (!Owner.Options.NoCompression) + { + fontData = Filtering.FlateDecode.Encode(fontData, _document.Options.FlateEncodeMode); + fontStream.Elements["/Filter"] = new PdfName("/FlateDecode"); + } + fontStream.Elements["/Length"] = new PdfInteger(fontData.Length); + fontStream.CreateStream(fontData); + } + + /// + /// Predefined keys of this dictionary. + /// + public new sealed class Keys : PdfFont.Keys + { + /// + /// (Required) The type of PDF object that this dictionary describes; + /// must be Font for a CIDFont dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Font")] + public new const string Type = "/Type"; + + /// + /// (Required) The type of CIDFont; CIDFontType0 or CIDFontType2. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public new const string Subtype = "/Subtype"; + + /// + /// (Required) The PostScript name of the CIDFont. For Type 0 CIDFonts, this + /// is usually the value of the CIDFontName entry in the CIDFont program. For + /// Type 2 CIDFonts, it is derived the same way as for a simple TrueType font; + /// In either case, the name can have a subset prefix if appropriate. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public new const string BaseFont = "/BaseFont"; + + /// + /// (Required) A dictionary containing entries that define the character collection + /// of the CIDFont. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required)] + public const string CIDSystemInfo = "/CIDSystemInfo"; + + /// + /// (Required; must be an indirect reference) A font descriptor describing the + /// CIDFont’s default metrics other than its glyph widths. + /// + [KeyInfo(KeyType.Dictionary | KeyType.MustBeIndirect, typeof(PdfFontDescriptor))] + public new const string FontDescriptor = "/FontDescriptor"; + + /// + /// (Optional) The default width for glyphs in the CIDFont. + /// Default value: 1000. + /// + [KeyInfo(KeyType.Integer)] + public const string DW = "/DW"; + + /// + /// (Optional) A description of the widths for the glyphs in the CIDFont. The + /// array’s elements have a variable format that can specify individual widths + /// for consecutive CIDs or one width for a range of CIDs. + /// Default value: none (the DW value is used for all glyphs). + /// + [KeyInfo(KeyType.Array, typeof(PdfArray))] + public const string W = "/W"; + + /// + /// (Optional; applies only to CIDFonts used for vertical writing) An array of two + /// numbers specifying the default metrics for vertical writing. + /// Default value: [880 −1000]. + /// + [KeyInfo(KeyType.Array)] + public const string DW2 = "/DW2"; + + /// + /// (Optional; applies only to CIDFonts used for vertical writing) A description + /// of the metrics for vertical writing for the glyphs in the CIDFont. + /// Default value: none (the DW2 value is used for all glyphs). + /// + [KeyInfo(KeyType.Array, typeof(PdfArray))] + public const string W2 = "/W2"; + + /// + /// (Optional; Type 2 CIDFonts only) A specification of the mapping from CIDs + /// to glyph indices. If the value is a stream, the bytes in the stream contain the + /// mapping from CIDs to glyph indices: the glyph index for a particular CID + /// value c is a 2-byte value stored in bytes 2 × c and 2 × c + 1, where the first + /// byte is the high-order byte. If the value of CIDToGIDMap is a name, it must + /// be Identity, indicating that the mapping between CIDs and glyph indices is + /// the identity mapping. + /// Default value: Identity. + /// This entry may appear only in a Type 2 CIDFont whose associated True-Type font + /// program is embedded in the PDF file. + /// + [KeyInfo(KeyType.Dictionary | KeyType.StreamOrName)] + public const string CIDToGIDMap = "/CIDToGIDMap"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfCatalog.cs b/PdfSharp/Pdf.Advanced/PdfCatalog.cs new file mode 100644 index 0000000..f3d76b8 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfCatalog.cs @@ -0,0 +1,463 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.AcroForms; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents the catalog dictionary. + /// + public sealed class PdfCatalog : PdfDictionary + { + /// + /// Initializes a new instance of the class. + /// + public PdfCatalog(PdfDocument document) + : base(document) + { + Elements.SetName(Keys.Type, "/Catalog"); + + _version = "1.4"; // HACK in PdfCatalog + } + + internal PdfCatalog(PdfDictionary dictionary) + : base(dictionary) + { } + + /// + /// Get or sets the version of the PDF specification to which the document conforms. + /// + public string Version + { + get { return _version; } + set + { + switch (value) + { + case "1.0": + case "1.1": + case "1.2": + throw new InvalidOperationException("Unsupported PDF version."); + + case "1.3": + case "1.4": + _version = value; + break; + + case "1.5": + case "1.6": + throw new InvalidOperationException("Unsupported PDF version."); + + default: + throw new ArgumentException("Invalid version."); + } + } + } + string _version = "1.3"; + + /// + /// Gets the pages collection of this document. + /// + public PdfPages Pages + { + get + { + if (_pages == null) + { + _pages = (PdfPages)Elements.GetValue(Keys.Pages, VCF.CreateIndirect); + if (Owner.IsImported) + _pages.FlattenPageTree(); + } + return _pages; + } + } + PdfPages _pages; + + /// + /// Implementation of PdfDocument.PageLayout. + /// + internal PdfPageLayout PageLayout + { + get { return (PdfPageLayout)Elements.GetEnumFromName(Keys.PageLayout, PdfPageLayout.SinglePage); } + set { Elements.SetEnumAsName(Keys.PageLayout, value); } + } + + /// + /// Implementation of PdfDocument.PageMode. + /// + internal PdfPageMode PageMode + { + get { return (PdfPageMode)Elements.GetEnumFromName(Keys.PageMode, PdfPageMode.UseNone); } + set { Elements.SetEnumAsName(Keys.PageMode, value); } + } + + /// + /// Implementation of PdfDocument.ViewerPreferences. + /// + internal PdfViewerPreferences ViewerPreferences + { + get + { + if (_viewerPreferences == null) + _viewerPreferences = (PdfViewerPreferences)Elements.GetValue(Keys.ViewerPreferences, VCF.CreateIndirect); + return _viewerPreferences; + } + } + PdfViewerPreferences _viewerPreferences; + + /// + /// Implementation of PdfDocument.Outlines. + /// + internal PdfOutlineCollection Outlines + { + get + { + if (_outline == null) + { + ////// Ensure that the page tree exists. + ////// ReSharper disable once UnusedVariable because we need dummy to call the getter. + ////PdfPages dummy = Pages; + + // Now create the outline item tree. + _outline = (PdfOutline)Elements.GetValue(Keys.Outlines, VCF.CreateIndirect); + } + return _outline.Outlines; + } + } + PdfOutline _outline; + + /// + /// Gets the AcroForm dictionary of this document. + /// + public PdfAcroForm AcroForm + { + get + { + if (_acroForm == null) + _acroForm = (PdfAcroForm)Elements.GetValue(Keys.AcroForm); + return _acroForm; + } + } + PdfAcroForm _acroForm; + + /// + /// Gets or sets the language identifier specifying the natural language for all text in the document. + /// Sample values are 'en-US' for 'English United States' or 'de-DE' for 'deutsch Deutschland' (i.e. 'German Germany'). + /// + public string Language + { + get { return Elements.GetString(Keys.Lang); } + set + { + if (value == null) + Elements.Remove(Keys.Lang); + else + Elements.SetString(Keys.Lang, value); + } + } + + /// + /// Dispatches PrepareForSave to the objects that need it. + /// + internal override void PrepareForSave() + { + // Prepare pages. + if (_pages != null) + _pages.PrepareForSave(); + + // Create outline objects. + if (_outline != null && _outline.Outlines.Count > 0) + { + if (Elements[Keys.PageMode] == null) + PageMode = PdfPageMode.UseOutlines; + _outline.PrepareForSave(); + } + } + + internal override void WriteObject(PdfWriter writer) + { + if (_outline != null && _outline.Outlines.Count > 0) + { + if (Elements[Keys.PageMode] == null) + PageMode = PdfPageMode.UseOutlines; + } + base.WriteObject(writer); + } + + /// + /// Predefined keys of this dictionary. + /// + internal sealed class Keys : KeysBase + { + // ReSharper disable InconsistentNaming + + /// + /// (Required) The type of PDF object that this dictionary describes; + /// must be Catalog for the catalog dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Catalog")] + public const string Type = "/Type"; + + /// + /// (Optional; PDF 1.4) The version of the PDF specification to which the document + /// conforms (for example, 1.4) if later than the version specified in the files header. + /// If the header specifies a later version, or if this entry is absent, the document + /// conforms to the version specified in the header. This entry enables a PDF producer + /// application to update the version using an incremental update. + /// + [KeyInfo("1.4", KeyType.Name | KeyType.Optional)] + public const string Version = "/Version"; + + /// + /// (Required; must be an indirect reference) The page tree node that is the root of + /// the documents page tree. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required | KeyType.MustBeIndirect, typeof(PdfPages))] + public const string Pages = "/Pages"; + + /// + /// (Optional; PDF 1.3) A number tree defining the page labeling for the document. + /// The keys in this tree are page indices; the corresponding values are page label dictionaries. + /// Each page index denotes the first page in a labeling range to which the specified page + /// label dictionary applies. The tree must include a value for pageindex 0. + /// + [KeyInfo("1.3", KeyType.NumberTree | KeyType.Optional)] + public const string PageLabels = "/PageLabels"; + + /// + /// (Optional; PDF 1.2) The documents name dictionary. + /// + [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional)] + public const string Names = "/Names"; + + /// + /// (Optional; PDF 1.1; must be an indirect reference) A dictionary of names and + /// corresponding destinations. + /// + [KeyInfo("1.1", KeyType.Dictionary | KeyType.Optional)] + public const string Dests = "/Dests"; + + /// + /// (Optional; PDF 1.2) A viewer preferences dictionary specifying the way the document + /// is to be displayed on the screen. If this entry is absent, applications should use + /// their own current user preference settings. + /// + [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional, typeof(PdfViewerPreferences))] + public const string ViewerPreferences = "/ViewerPreferences"; + + /// + /// (Optional) A name object specifying the page layout to be used when the document is + /// opened: + /// SinglePage - Display one page at a time. + /// OneColumn - Display the pages in one column. + /// TwoColumnLeft - Display the pages in two columns, with oddnumbered pages on the left. + /// TwoColumnRight - Display the pages in two columns, with oddnumbered pages on the right. + /// TwoPageLeft - (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left + /// TwoPageRight - (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string PageLayout = "/PageLayout"; + + /// + /// (Optional) A name object specifying how the document should be displayed when opened: + /// UseNone - Neither document outline nor thumbnail images visible. + /// UseOutlines - Document outline visible. + /// UseThumbs - Thumbnail images visible. + /// FullScreen - Full-screen mode, with no menu bar, windowcontrols, or any other window visible. + /// UseOC - (PDF 1.5) Optional content group panel visible. + /// UseAttachments (PDF 1.6) Attachments panel visible. + /// Default value: UseNone. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string PageMode = "/PageMode"; + + /// + /// (Optional; must be an indirect reference) The outline dictionary that is the root + /// of the documents outline hierarchy. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfOutline))] + public const string Outlines = "/Outlines"; + + /// + /// (Optional; PDF 1.1; must be an indirect reference) An array of thread dictionaries + /// representing the documents article threads. + /// + [KeyInfo("1.1", KeyType.Array | KeyType.Optional)] + public const string Threads = "/Threads"; + + /// + /// (Optional; PDF 1.1) A value specifying a destination to be displayed or an action to be + /// performed when the document is opened. The value is either an array defining a destination + /// or an action dictionary representing an action. If this entry is absent, the document + /// should be opened to the top of the first page at the default magnification factor. + /// + [KeyInfo("1.1", KeyType.ArrayOrDictionary | KeyType.Optional)] + public const string OpenAction = "/OpenAction"; + + /// + /// (Optional; PDF 1.4) An additional-actions dictionary defining the actions to be taken + /// in response to various trigger events affecting the document as a whole. + /// + [KeyInfo("1.4", KeyType.Dictionary | KeyType.Optional)] + public const string AA = "/AA"; + + /// + /// (Optional; PDF 1.1) A URI dictionary containing document-level information for URI + /// (uniform resource identifier) actions. + /// + [KeyInfo("1.1", KeyType.Dictionary | KeyType.Optional)] + public const string URI = "/URI"; + + /// + /// (Optional; PDF 1.2) The documents interactive form (AcroForm) dictionary. + /// + [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional, typeof(PdfAcroForm))] + public const string AcroForm = "/AcroForm"; + + /// + /// (Optional; PDF 1.4; must be an indirect reference) A metadata stream + /// containing metadata for the document. + /// + [KeyInfo("1.4", KeyType.Dictionary | KeyType.Optional | KeyType.MustBeIndirect)] + public const string Metadata = "/Metadata"; + + /// + /// (Optional; PDF 1.3) The documents structure tree root dictionary. + /// + [KeyInfo("1.3", KeyType.Dictionary | KeyType.Optional)] + public const string StructTreeRoot = "/StructTreeRoot"; + + /// + /// (Optional; PDF 1.4) A mark information dictionary containing information + /// about the documents usage of Tagged PDF conventions. + /// + [KeyInfo("1.4", KeyType.Dictionary | KeyType.Optional)] + public const string MarkInfo = "/MarkInfo"; + + /// + /// (Optional; PDF 1.4) A language identifier specifying the natural language for all + /// text in the document except where overridden by language specifications for structure + /// elements or marked content. If this entry is absent, the language is considered unknown. + /// + [KeyInfo("1.4", KeyType.String | KeyType.Optional)] + public const string Lang = "/Lang"; + + /// + /// (Optional; PDF 1.3) A Web Capture information dictionary containing state information + /// used by the Acrobat Web Capture (AcroSpider) plugin extension. + /// + [KeyInfo("1.3", KeyType.Dictionary | KeyType.Optional)] + public const string SpiderInfo = "/SpiderInfo"; + + /// + /// (Optional; PDF 1.4) An array of output intent dictionaries describing the color + /// characteristics of output devices on which the document might be rendered. + /// + [KeyInfo("1.4", KeyType.Array | KeyType.Optional)] + public const string OutputIntents = "/OutputIntents"; + + /// + /// (Optional; PDF 1.4) A page-piece dictionary associated with the document. + /// + [KeyInfo("1.4", KeyType.Dictionary | KeyType.Optional)] + public const string PieceInfo = "/PieceInfo"; + + /// + /// (Optional; PDF 1.5; required if a document contains optional content) The documents + /// optional content properties dictionary. + /// + [KeyInfo("1.5", KeyType.Dictionary | KeyType.Optional)] + public const string OCProperties = "/OCProperties"; + + /// + /// (Optional; PDF 1.5) A permissions dictionary that specifies user access permissions + /// for the document. + /// + [KeyInfo("1.5", KeyType.Dictionary | KeyType.Optional)] + public const string Perms = "/Perms"; + + /// + /// (Optional; PDF 1.5) A dictionary containing attestations regarding the content of a + /// PDF document, as it relates to the legality of digital signatures. + /// + [KeyInfo("1.5", KeyType.Dictionary | KeyType.Optional)] + public const string Legal = "/Legal"; + + /// + /// (Optional; PDF 1.7) An array of requirement dictionaries representing + /// requirements for the document. + /// + [KeyInfo("1.7", KeyType.Array | KeyType.Optional)] + public const string Requirements = "/Requirements"; + + /// + /// (Optional; PDF 1.7) A collection dictionary that a PDF consumer uses to enhance + /// the presentation of file attachments stored in the PDF document. + /// + [KeyInfo("1.7", KeyType.Dictionary | KeyType.Optional)] + public const string Collection = "/Collection"; + + /// + /// (Optional; PDF 1.7) A flag used to expedite the display of PDF documents containing XFA forms. + /// It specifies whether the document must be regenerated when the document is first opened. + /// If true, the viewer application treats the document as a shell and regenerates the content + /// when the document is opened, regardless of any dynamic forms settings that appear in the XFA + /// stream itself. This setting is used to expedite the display of documents whose layout varies + /// depending on the content of the XFA streams. + /// If false, the viewer application does not regenerate the content when the document is opened. + /// See the XML Forms Architecture (XFA) Specification (Bibliography). + /// Default value: false. + /// + [KeyInfo("1.7", KeyType.Boolean | KeyType.Optional)] + public const string NeedsRendering = "/NeedsRendering"; + + // ReSharper restore InconsistentNaming + + /// + /// Gets the KeysMeta for these keys. + /// + public static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfContent.cs b/PdfSharp/Pdf.Advanced/PdfContent.cs new file mode 100644 index 0000000..9b2ea3f --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfContent.cs @@ -0,0 +1,192 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using PdfSharp.Drawing.Pdf; +using PdfSharp.Pdf.Filters; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents the content of a page. PDFsharp supports only one content stream per page. + /// If an imported page has an array of content streams, the streams are concatenated to + /// one single stream. + /// + public sealed class PdfContent : PdfDictionary + { + /// + /// Initializes a new instance of the class. + /// + public PdfContent(PdfDocument document) + : base(document) + { } + + /// + /// Initializes a new instance of the class. + /// + internal PdfContent(PdfPage page) + : base(page != null ? page.Owner : null) + { + //_pageContent = new PageContent(page); + } + + /// + /// Initializes a new instance of the class. + /// + /// The dict. + public PdfContent(PdfDictionary dict) // HACK PdfContent + : base(dict) + { + // A PdfContent dictionary is always unfiltered. + Decode(); + } + + /// + /// Sets a value indicating whether the content is compressed with the ZIP algorithm. + /// + public bool Compressed + { + set + { + if (value) + { + PdfItem filter = Elements["/Filter"]; + if (filter == null) + { + byte[] bytes = Filtering.FlateDecode.Encode(Stream.Value, _document.Options.FlateEncodeMode); + Stream.Value = bytes; + Elements.SetInteger("/Length", Stream.Length); + Elements.SetName("/Filter", "/FlateDecode"); + } + } + } + } + + /// + /// Unfilters the stream. + /// + void Decode() + { + if (Stream != null && Stream.Value != null) + { + PdfItem item = Elements["/Filter"]; + if (item != null) + { + byte[] bytes = Filtering.Decode(Stream.Value, item); + if (bytes != null) + { + Stream.Value = bytes; + Elements.Remove("/Filter"); + Elements.SetInteger("/Length", Stream.Length); + } + } + } + } + + /// + /// Surround content with q/Q operations if necessary. + /// + internal void PreserveGraphicsState() + { + // If a content stream is touched by PDFsharp it is typically because graphical operations are + // prepended or appended. Some nasty PDF tools does not preserve the graphical state correctly. + // Therefore we try to relieve the problem by surrounding the content stream with push/restore + // graphic state operation. + if (Stream != null) + { + byte[] value = Stream.Value; + int length = value.Length; + if (length != 0 && ((value[0] != (byte)'q' || value[1] != (byte)'\n'))) + { + byte[] newValue = new byte[length + 2 + 3]; + newValue[0] = (byte)'q'; + newValue[1] = (byte)'\n'; + Array.Copy(value, 0, newValue, 2, length); + newValue[length + 2] = (byte)' '; + newValue[length + 3] = (byte)'Q'; + newValue[length + 4] = (byte)'\n'; + Stream.Value = newValue; + Elements.SetInteger("/Length", Stream.Length); + } + } + } + + internal override void WriteObject(PdfWriter writer) + { + if (_pdfRenderer != null) + { + // GetContent also disposes the underlying XGraphics object, if one exists + //Stream = new PdfStream(PdfEncoders.RawEncoding.GetBytes(pdfRenderer.GetContent()), this); + _pdfRenderer.Close(); + Debug.Assert(_pdfRenderer == null); + } + + if (Stream != null) + { + //if (Owner.Options.CompressContentStreams) + if (Owner.Options.CompressContentStreams && Elements.GetName("/Filter").Length == 0) + { + Stream.Value = Filtering.FlateDecode.Encode(Stream.Value, _document.Options.FlateEncodeMode); + //Elements["/Filter"] = new PdfName("/FlateDecode"); + Elements.SetName("/Filter", "/FlateDecode"); + } + Elements.SetInteger("/Length", Stream.Length); + } + + base.WriteObject(writer); + } + + internal XGraphicsPdfRenderer _pdfRenderer; + + /// + /// Predefined keys of this dictionary. + /// + internal sealed class Keys : PdfStream.Keys + { + /// + /// Gets the KeysMeta for these keys. + /// + public static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfContents.cs b/PdfSharp/Pdf.Advanced/PdfContents.cs new file mode 100644 index 0000000..dfd941e --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfContents.cs @@ -0,0 +1,267 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Collections; +using PdfSharp.Pdf.Content.Objects; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents an array of PDF content streams of a page. + /// + public sealed class PdfContents : PdfArray + { + /// + /// Initializes a new instance of the class. + /// + /// The document. + public PdfContents(PdfDocument document) + : base(document) + { } + + internal PdfContents(PdfArray array) + : base(array) + { + int count = Elements.Count; + for (int idx = 0; idx < count; idx++) + { + // Convert the references from PdfDictionary to PdfContent + PdfItem item = Elements[idx]; + PdfReference iref = item as PdfReference; + if (iref != null && iref.Value is PdfDictionary) + { + // The following line is correct! + new PdfContent((PdfDictionary)iref.Value); + } + else + throw new InvalidOperationException("Unexpected item in a content stream array."); + } + } + + /// + /// Appends a new content stream and returns it. + /// + public PdfContent AppendContent() + { + Debug.Assert(Owner != null); + + SetModified(); + PdfContent content = new PdfContent(Owner); + Owner._irefTable.Add(content); + Debug.Assert(content.Reference != null); + Elements.Add(content.Reference); + return content; + } + + /// + /// Prepends a new content stream and returns it. + /// + public PdfContent PrependContent() + { + Debug.Assert(Owner != null); + + SetModified(); + PdfContent content = new PdfContent(Owner); + Owner._irefTable.Add(content); + Debug.Assert(content.Reference != null); + Elements.Insert(0, content.Reference); + return content; + } + + /// + /// Creates a single content stream with the bytes from the array of the content streams. + /// This operation does not modify any of the content streams in this array. + /// + public PdfContent CreateSingleContent() + { + byte[] bytes = new byte[0]; + byte[] bytes1; + byte[] bytes2; + foreach (PdfItem iref in Elements) + { + PdfDictionary cont = (PdfDictionary)((PdfReference)iref).Value; + bytes1 = bytes; + bytes2 = cont.Stream.UnfilteredValue; + bytes = new byte[bytes1.Length + bytes2.Length + 1]; + bytes1.CopyTo(bytes, 0); + bytes[bytes1.Length] = (byte)'\n'; + bytes2.CopyTo(bytes, bytes1.Length + 1); + } + PdfContent content = new PdfContent(Owner); + content.Stream = new PdfDictionary.PdfStream(bytes, content); + return content; + } + + /// + /// Replaces the current content of the page with the specified content sequence. + /// + public PdfContent ReplaceContent(CSequence cseq) + { + if (cseq == null) + throw new ArgumentNullException(nameof(cseq)); + + return ReplaceContent(cseq.ToContent()); + } + + /// + /// Replaces the current content of the page with the specified bytes. + /// + PdfContent ReplaceContent(byte[] contentBytes) + { + Debug.Assert(Owner != null); + + PdfContent content = new PdfContent(Owner); + + content.CreateStream(contentBytes); + + Owner._irefTable.Add(content); + Elements.Clear(); + Elements.Add(content.Reference); + + return content; + } + + void SetModified() + { + if (!_modified) + { + _modified = true; + int count = Elements.Count; + + if (count == 1) + { + PdfContent content = (PdfContent)((PdfReference)Elements[0]).Value; + content.PreserveGraphicsState(); + } + else if (count > 1) + { + // Surround content streams with q/Q operations + byte[] value; + int length; + PdfContent content = (PdfContent)((PdfReference)Elements[0]).Value; + if (content != null && content.Stream != null) + { + length = content.Stream.Length; + value = new byte[length + 2]; + value[0] = (byte)'q'; + value[1] = (byte)'\n'; + Array.Copy(content.Stream.Value, 0, value, 2, length); + content.Stream.Value = value; + content.Elements.SetInteger("/Length", length + 2); + } + content = (PdfContent)((PdfReference)Elements[count - 1]).Value; + if (content != null && content.Stream != null) + { + length = content.Stream.Length; + value = new byte[length + 3]; + Array.Copy(content.Stream.Value, 0, value, 0, length); + value[length] = (byte)' '; + value[length + 1] = (byte)'Q'; + value[length + 2] = (byte)'\n'; + content.Stream.Value = value; + content.Elements.SetInteger("/Length", length + 3); + } + } + } + } + bool _modified; + + internal override void WriteObject(PdfWriter writer) + { + // Save two bytes in PDF stream... + if (Elements.Count == 1) + Elements[0].WriteObject(writer); + else + base.WriteObject(writer); + } + + /// + /// Gets the enumerator. + /// + public new IEnumerator GetEnumerator() + { + return new PdfPageContentEnumerator(this); + } + + class PdfPageContentEnumerator : IEnumerator + { + internal PdfPageContentEnumerator(PdfContents list) + { + _contents = list; + _index = -1; + } + + public bool MoveNext() + { + if (_index < _contents.Elements.Count - 1) + { + _index++; + _currentElement = (PdfContent)((PdfReference)_contents.Elements[_index]).Value; + return true; + } + _index = _contents.Elements.Count; + return false; + } + + public void Reset() + { + _currentElement = null; + _index = -1; + } + + object IEnumerator.Current + { + get { return Current; } + } + + public PdfContent Current + { + get + { + if (_index == -1 || _index >= _contents.Elements.Count) + throw new InvalidOperationException(PSSR.ListEnumCurrentOutOfRange); + return _currentElement; + } + } + + public void Dispose() + { + // Nothing to do. + } + + PdfContent _currentElement; + int _index; + readonly PdfContents _contents; + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfCrossReferenceStream.cs b/PdfSharp/Pdf.Advanced/PdfCrossReferenceStream.cs new file mode 100644 index 0000000..0ab381b --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfCrossReferenceStream.cs @@ -0,0 +1,157 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; +using System.Diagnostics; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a PDF cross-reference stream. + /// + internal sealed class PdfCrossReferenceStream : PdfTrailer // Reference: 3.4.7 Cross-Reference Streams / Page 106 + { + /// + /// Initializes a new instance of the class. + /// + public PdfCrossReferenceStream(PdfDocument document) + : base(document) + { +#if DEBUG && CORE + if (Internal.PdfDiagnostics.TraceXrefStreams) + { + Debug.WriteLine("PdfCrossReferenceStream created."); + } +#endif + } + + public readonly List Entries = new List(); + + public struct CrossReferenceStreamEntry + { + // Reference: TABLE 3.16 Entries in a cross-reference stream / Page 109 + + public uint Type; // 0, 1, or 2. + + public uint Field2; + + public uint Field3; + } + + /// + /// Predefined keys for cross-reference dictionaries. + /// + public new class Keys : PdfTrailer.Keys // Reference: TABLE 3.15 Additional entries specific to a cross-reference stream dictionary / Page 107 + { + /// + /// (Required) The type of PDF object that this dictionary describes; + /// must be XRef for a cross-reference stream. + /// + [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "XRef")] + public const string Type = "/Type"; + + /// + /// (Required) The number one greater than the highest object number + /// used in this section or in any section for which this is an update. + /// It is equivalent to the Size entry in a trailer dictionary. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public new const string Size = "/Size"; + + /// + /// (Optional) An array containing a pair of integers for each subsection in this section. + /// The first integer is the first object number in the subsection; the second integer + /// is the number of entries in the subsection. + /// The array is sorted in ascending order by object number. Subsections cannot overlap; + /// an object number may have at most one entry in a section. + /// Default value: [0 Size]. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string Index = "/Index"; + + /// + /// (Present only if the file has more than one cross-reference stream; not meaningful in + /// hybrid-reference files) The byte offset from the beginning of the file to the beginning + /// of the previous cross-reference stream. This entry has the same function as the Prev + /// entry in the trailer dictionary. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public new const string Prev = "/Prev"; + + /// + /// (Required) An array of integers representing the size of the fields in a single + /// cross-reference entry. The table describes the types of entries and their fields. + /// For PDF 1.5, W always contains three integers; the value of each integer is the + /// number of bytes (in the decoded stream) of the corresponding field. For example, + /// [1 2 1] means that the fields are one byte, two bytes, and one byte, respectively. + /// + /// A value of zero for an element in the W array indicates that the corresponding field + /// is not present in the stream, and the default value is used, if there is one. If the + /// first element is zero, the type field is not present, and it defaults to type 1. + /// + /// The sum of the items is the total length of each entry; it can be used with the + /// Indexarray to determine the starting position of each subsection. + /// + /// Note: Different cross-reference streams in a PDF file may use different values for W. + /// + /// Entries in a cross-reference stream. + /// + /// TYPE FIELD DESCRIPTION + /// 0 1 The type of this entry, which must be 0. Type 0 entries define the linked list of free objects (corresponding to f entries in a cross-reference table). + /// 2 The object number of the next free object. + /// 3 The generation number to use if this object number is used again. + /// 1 1 The type of this entry, which must be 1. Type 1 entries define objects that are in use but are not compressed (corresponding to n entries in a cross-reference table). + /// 2 The byte offset of the object, starting from the beginning of the file. + /// 3 The generation number of the object. Default value: 0. + /// 2 1 The type of this entry, which must be 2. Type 2 entries define compressed objects. + /// 2 The object number of the object stream in which this object is stored. (The generation number of the object stream is implicitly 0.) + /// 3 The index of this object within the object stream. + /// + [KeyInfo(KeyType.Array | KeyType.Required)] + public const string W = "/W"; + + /// + /// Gets the KeysMeta for these keys. + /// + public static new DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfCrossReferenceTable.cs b/PdfSharp/Pdf.Advanced/PdfCrossReferenceTable.cs new file mode 100644 index 0000000..ea43bb9 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfCrossReferenceTable.cs @@ -0,0 +1,590 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Collections; +using System.Collections.Generic; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents the cross-reference table of a PDF document. + /// It contains all indirect objects of a document. + /// + internal sealed class PdfCrossReferenceTable // Must not be derive from PdfObject. + { + public PdfCrossReferenceTable(PdfDocument document) + { + _document = document; + } + readonly PdfDocument _document; + + /// + /// Represents the relation between PdfObjectID and PdfReference for a PdfDocument. + /// + public Dictionary ObjectTable = new Dictionary(); + + internal bool IsUnderConstruction + { + get { return _isUnderConstruction; } + set { _isUnderConstruction = value; } + } + bool _isUnderConstruction; + + /// + /// Adds a cross reference entry to the table. Used when parsing the trailer. + /// + public void Add(PdfReference iref) + { +#if DEBUG + if (iref.ObjectID.ObjectNumber == 948) + GetType(); +#endif + if (iref.ObjectID.IsEmpty) + iref.ObjectID = new PdfObjectID(GetNewObjectNumber()); + + if (ObjectTable.ContainsKey(iref.ObjectID)) + throw new InvalidOperationException("Object already in table."); + + ObjectTable.Add(iref.ObjectID, iref); + } + + /// + /// Adds a PdfObject to the table. + /// + public void Add(PdfObject value) + { + if (value.Owner == null) + value.Document = _document; + else + Debug.Assert(value.Owner == _document); + + if (value.ObjectID.IsEmpty) + value.SetObjectID(GetNewObjectNumber(), 0); + + if (ObjectTable.ContainsKey(value.ObjectID)) + throw new InvalidOperationException("Object already in table."); + + ObjectTable.Add(value.ObjectID, value.Reference); + } + + public void Remove(PdfReference iref) + { + ObjectTable.Remove(iref.ObjectID); + } + + /// + /// Gets a cross reference entry from an object identifier. + /// Returns null if no object with the specified ID exists in the object table. + /// + public PdfReference this[PdfObjectID objectID] + { + get + { + PdfReference iref; + ObjectTable.TryGetValue(objectID, out iref); + return iref; + } + } + + /// + /// Indicates whether the specified object identifier is in the table. + /// + public bool Contains(PdfObjectID objectID) + { + return ObjectTable.ContainsKey(objectID); + } + + //public PdfObject GetObject(PdfObjectID objectID) + //{ + // return this[objectID].Value; + //} + + // /// + // /// Gets the entry for the specified object, or null, if the object is not in + // /// this XRef table. + // /// + // internal PdfReference GetEntry(PdfObjectID objectID) + // { + // return this[objectID]; + // } + + /// + /// Returns the next free object number. + /// + public int GetNewObjectNumber() + { + // New objects are numbered consecutively. If a document is imported, maxObjectNumber is + // set to the highest object number used in the document. + return ++_maxObjectNumber; + } + internal int _maxObjectNumber; + + /// + /// Writes the xref section in pdf stream. + /// + internal void WriteObject(PdfWriter writer) + { + writer.WriteRaw("xref\n"); + + PdfReference[] irefs = AllReferences; + + int count = irefs.Length; + writer.WriteRaw(String.Format("0 {0}\n", count + 1)); + writer.WriteRaw(String.Format("{0:0000000000} {1:00000} {2} \n", 0, 65535, "f")); + //PdfEncoders.WriteAnsi(stream, text); + + for (int idx = 0; idx < count; idx++) + { + PdfReference iref = irefs[idx]; + + // Acrobat is very pedantic; it must be exactly 20 bytes per line. + writer.WriteRaw(String.Format("{0:0000000000} {1:00000} {2} \n", iref.Position, iref.GenerationNumber, "n")); + } + } + + /// + /// Gets an array of all object identifiers. For debugging purposes only. + /// + internal PdfObjectID[] AllObjectIDs + { + get + { + ICollection collection = ObjectTable.Keys; + PdfObjectID[] objectIDs = new PdfObjectID[collection.Count]; + collection.CopyTo(objectIDs, 0); + return objectIDs; + } + } + + /// + /// Gets an array of all cross references in ascending order by their object identifier. + /// + internal PdfReference[] AllReferences + { + get + { + Dictionary.ValueCollection collection = ObjectTable.Values; + List list = new List(collection); + list.Sort(PdfReference.Comparer); + PdfReference[] irefs = new PdfReference[collection.Count]; + list.CopyTo(irefs, 0); + return irefs; + } + } + + internal void HandleOrphanedReferences() + { } + + /// + /// Removes all objects that cannot be reached from the trailer. + /// Returns the number of removed objects. + /// + internal int Compact() + { + // TODO: remove PdfBooleanObject, PdfIntegerObject etc. + int removed = ObjectTable.Count; + //CheckConsistence(); + // TODO: Is this really so easy? + PdfReference[] irefs = TransitiveClosure(_document._trailer); + +#if DEBUG + // Have any two objects the same ID? + Dictionary ids = new Dictionary(); + foreach (PdfObjectID objID in ObjectTable.Keys) + { + ids.Add(objID.ObjectNumber, 0); + } + + // Have any two irefs the same value? + //Dictionary ids = new Dictionary(); + ids.Clear(); + foreach (PdfReference iref in ObjectTable.Values) + { + ids.Add(iref.ObjectNumber, 0); + } + + // + Dictionary refs = new Dictionary(); + foreach (PdfReference iref in irefs) + { + refs.Add(iref, 0); + } + foreach (PdfReference value in ObjectTable.Values) + { + if (!refs.ContainsKey(value)) + value.GetType(); + } + + foreach (PdfReference iref in ObjectTable.Values) + { + if (iref.Value == null) + GetType(); + Debug.Assert(iref.Value != null); + } + + foreach (PdfReference iref in irefs) + { + if (!ObjectTable.ContainsKey(iref.ObjectID)) + GetType(); + Debug.Assert(ObjectTable.ContainsKey(iref.ObjectID)); + + if (iref.Value == null) + GetType(); + Debug.Assert(iref.Value != null); + } +#endif + + _maxObjectNumber = 0; + ObjectTable.Clear(); + foreach (PdfReference iref in irefs) + { + // This if is needed for corrupt PDF files from the wild. + // Without the if, an exception will be thrown if the file contains duplicate IDs ("An item with the same key has already been added to the dictionary."). + // With the if, the first object with the ID will be used and later objects with the same ID will be ignored. + if (!ObjectTable.ContainsKey(iref.ObjectID)) + { + ObjectTable.Add(iref.ObjectID, iref); + _maxObjectNumber = Math.Max(_maxObjectNumber, iref.ObjectNumber); + } + } + //CheckConsistence(); + removed -= ObjectTable.Count; + return removed; + } + + /// + /// Renumbers the objects starting at 1. + /// + internal void Renumber() + { + //CheckConsistence(); + PdfReference[] irefs = AllReferences; + ObjectTable.Clear(); + // Give all objects a new number. + int count = irefs.Length; + for (int idx = 0; idx < count; idx++) + { + PdfReference iref = irefs[idx]; +#if DEBUG_ + if (iref.ObjectNumber == 1108) + GetType(); +#endif + iref.ObjectID = new PdfObjectID(idx + 1); + // Rehash with new number. + ObjectTable.Add(iref.ObjectID, iref); + } + _maxObjectNumber = count; + //CheckConsistence(); + } + + /// + /// Checks the logical consistence for debugging purposes (useful after reconstruction work). + /// + [Conditional("DEBUG_")] + public void CheckConsistence() + { + Dictionary ht1 = new Dictionary(); + foreach (PdfReference iref in ObjectTable.Values) + { + Debug.Assert(!ht1.ContainsKey(iref), "Duplicate iref."); + Debug.Assert(iref.Value != null); + ht1.Add(iref, null); + } + + Dictionary ht2 = new Dictionary(); + foreach (PdfReference iref in ObjectTable.Values) + { + Debug.Assert(!ht2.ContainsKey(iref.ObjectID), "Duplicate iref."); + ht2.Add(iref.ObjectID, null); + } + + ICollection collection = ObjectTable.Values; + int count = collection.Count; + PdfReference[] irefs = new PdfReference[count]; + collection.CopyTo(irefs, 0); +#if true + for (int i = 0; i < count; i++) + for (int j = 0; j < count; j++) + if (i != j) + { + Debug.Assert(ReferenceEquals(irefs[i].Document, _document)); + Debug.Assert(irefs[i] != irefs[j]); + Debug.Assert(!ReferenceEquals(irefs[i], irefs[j])); + Debug.Assert(!ReferenceEquals(irefs[i].Value, irefs[j].Value)); + Debug.Assert(!Equals(irefs[i].ObjectID, irefs[j].Value.ObjectID)); + Debug.Assert(irefs[i].ObjectNumber != irefs[j].Value.ObjectNumber); + Debug.Assert(ReferenceEquals(irefs[i].Document, irefs[j].Document)); + GetType(); + } +#endif + } + + ///// + ///// The garbage collector for PDF objects. + ///// + //public sealed class GC + //{ + // PdfXRefTable xrefTable; + // + // internal GC(PdfXRefTable xrefTable) + // { + // _xrefTable = xrefTable; + // } + // + // public void Collect() + // { } + // + // public PdfReference[] ReachableObjects() + // { + // Hash_table objects = new Hash_table(); + // TransitiveClosure(objects, _xrefTable.document.trailer); + // } + + /// + /// Calculates the transitive closure of the specified PdfObject, i.e. all indirect objects + /// recursively reachable from the specified object. + /// + public PdfReference[] TransitiveClosure(PdfObject pdfObject) + { + return TransitiveClosure(pdfObject, short.MaxValue); + } + + /// + /// Calculates the transitive closure of the specified PdfObject with the specified depth, i.e. all indirect objects + /// recursively reachable from the specified object in up to maximally depth steps. + /// + public PdfReference[] TransitiveClosure(PdfObject pdfObject, int depth) + { + CheckConsistence(); + Dictionary objects = new Dictionary(); + _overflow = new Dictionary(); + TransitiveClosureImplementation(objects, pdfObject); + TryAgain: + if (_overflow.Count > 0) + { + PdfObject[] array = new PdfObject[_overflow.Count]; + _overflow.Keys.CopyTo(array, 0); + _overflow = new Dictionary(); + for (int idx = 0; idx < array.Length; idx++) + { + PdfObject obj = array[idx]; + TransitiveClosureImplementation(objects, obj); + } + goto TryAgain; + } + + CheckConsistence(); + + ICollection collection = objects.Keys; + int count = collection.Count; + PdfReference[] irefs = new PdfReference[count]; + collection.CopyTo(irefs, 0); + +#if true_ + for (int i = 0; i < count; i++) + for (int j = 0; j < count; j++) + if (i != j) + { + Debug.Assert(ReferenceEquals(irefs[i].Document, _document)); + Debug.Assert(irefs[i] != irefs[j]); + Debug.Assert(!ReferenceEquals(irefs[i], irefs[j])); + Debug.Assert(!ReferenceEquals(irefs[i].Value, irefs[j].Value)); + Debug.Assert(!Equals(irefs[i].ObjectID, irefs[j].Value.ObjectID)); + Debug.Assert(irefs[i].ObjectNumber != irefs[j].Value.ObjectNumber); + Debug.Assert(ReferenceEquals(irefs[i].Document, irefs[j].Document)); + GetType(); + } +#endif + return irefs; + } + + static int _nestingLevel; + Dictionary _overflow = new Dictionary(); + + void TransitiveClosureImplementation(Dictionary objects, PdfObject pdfObject/*, ref int depth*/) + { + try + { + _nestingLevel++; + if (_nestingLevel >= 1000) + { + if (!_overflow.ContainsKey(pdfObject)) + _overflow.Add(pdfObject, null); + return; + } +#if DEBUG_ + //enterCount++; + if (enterCount == 5400) + GetType(); + //if (!Object.ReferenceEquals(pdfObject.Owner, _document)) + // GetType(); + //////Debug.Assert(Object.ReferenceEquals(pdfObject27.Document, _document)); + // if (item is PdfObject && ((PdfObject)item).ObjectID.ObjectNumber == 5) + // Debug.WriteLine("items: " + ((PdfObject)item).ObjectID.ToString()); + //if (pdfObject.ObjectNumber == 5) + // GetType(); +#endif + + IEnumerable enumerable = null; //(IEnumerator)pdfObject; + PdfDictionary dict; + PdfArray array; + if ((dict = pdfObject as PdfDictionary) != null) + enumerable = dict.Elements.Values; + else if ((array = pdfObject as PdfArray) != null) + enumerable = array.Elements; + else + Debug.Assert(false, "Should not come here."); + + if (enumerable != null) + { + foreach (PdfItem item in enumerable) + { + PdfReference iref = item as PdfReference; + if (iref != null) + { + // Is this an indirect reference to an object that does not exist? + //if (iref.Document == null) + //{ + // Debug.WriteLine("Dead object detected: " + iref.ObjectID.ToString()); + // PdfReference dead = DeadObject; + // iref.ObjectID = dead.ObjectID; + // iref.Document = _document; + // iref.SetObject(dead.Value); + // PdfDictionary dict = (PdfDictionary)dead.Value; + + // dict.Elements["/DeadObjectCount"] = + // new PdfInteger(dict.Elements.GetInteger("/DeadObjectCount") + 1); + + // iref = dead; + //} + + if (!ReferenceEquals(iref.Document, _document)) + { + GetType(); + Debug.WriteLine(String.Format("Bad iref: {0}", iref.ObjectID.ToString())); + } + Debug.Assert(ReferenceEquals(iref.Document, _document) || iref.Document == null, "External object detected!"); +#if DEBUG_ + if (iref.ObjectID.ObjectNumber == 23) + GetType(); +#endif + if (!objects.ContainsKey(iref)) + { + PdfObject value = iref.Value; + + // Ignore unreachable objects. + if (iref.Document != null) + { + // ... from trailer hack + if (value == null) + { + iref = ObjectTable[iref.ObjectID]; + Debug.Assert(iref.Value != null); + value = iref.Value; + } + Debug.Assert(ReferenceEquals(iref.Document, _document)); + objects.Add(iref, null); + //Debug.WriteLine(String.Format("objects.Add('{0}', null);", iref.ObjectID.ToString())); + if (value is PdfArray || value is PdfDictionary) + TransitiveClosureImplementation(objects, value /*, ref depth*/); + } + //else + //{ + // objects2.Add(this[iref.ObjectID], null); + //} + } + } + else + { + PdfObject pdfObject28 = item as PdfObject; + //if (pdfObject28 != null) + // Debug.Assert(Object.ReferenceEquals(pdfObject28.Document, _document)); + if (pdfObject28 != null && (pdfObject28 is PdfDictionary || pdfObject28 is PdfArray)) + TransitiveClosureImplementation(objects, pdfObject28 /*, ref depth*/); + } + } + } + } + finally + { + _nestingLevel--; + } + } + + /// + /// Gets the cross reference to an objects used for undefined indirect references. + /// + public PdfReference DeadObject + { + get + { + if (_deadObject == null) + { + _deadObject = new PdfDictionary(_document); + Add(_deadObject); + _deadObject.Elements.Add("/DeadObjectCount", new PdfInteger()); + } + return _deadObject.Reference; + } + } + PdfDictionary _deadObject; + } + + ///// + ///// Represents the cross-reference table of a PDF document. + ///// It contains all indirect objects of a document. + ///// + //internal sealed class PdfCrossReferenceStreamTable // Must not be derive from PdfObject. + //{ + // public PdfCrossReferenceStreamTable(PdfDocument document) + // { + // _document = document; + // } + // readonly PdfDocument _document; + + // public class Item + // { + // public PdfReference Reference; + + // public readonly List Entries = new List(); + // } + //} + + //struct CrossReferenceStreamEntry + //{ + // public int Type; + + // public int Field2; + + // public int Field3; + //} +} diff --git a/PdfSharp/Pdf.Advanced/PdfDictionaryWithContentStream.cs b/PdfSharp/Pdf.Advanced/PdfDictionaryWithContentStream.cs new file mode 100644 index 0000000..076691c --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfDictionaryWithContentStream.cs @@ -0,0 +1,169 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +#if GDI +using System.Drawing; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows.Media; +#endif +using PdfSharp.Drawing; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a base class for dictionaries with a content stream. + /// Implement IContentStream for use with a content writer. + /// + public abstract class PdfDictionaryWithContentStream : PdfDictionary, IContentStream + { + /// + /// Initializes a new instance of the class. + /// + public PdfDictionaryWithContentStream() + { } + + /// + /// Initializes a new instance of the class. + /// + /// The document. + public PdfDictionaryWithContentStream(PdfDocument document) + : base(document) + { } + + /// + /// Initializes a new instance from an existing dictionary. Used for object type transformation. + /// + protected PdfDictionaryWithContentStream(PdfDictionary dict) + : base(dict) + { } + + /// + /// Gets the resources dictionary of this dictionary. If no such dictionary exists, it is created. + /// + internal PdfResources Resources + { + get + { + if (_resources == null) + _resources = (PdfResources)Elements.GetValue(Keys.Resources, VCF.Create); + return _resources; + } + } + PdfResources _resources; + + /// + /// Implements the interface because the primary function is internal. + /// + PdfResources IContentStream.Resources + { + get { return Resources; } + } + + internal string GetFontName(XFont font, out PdfFont pdfFont) + { + pdfFont = _document.FontTable.GetFont(font); + Debug.Assert(pdfFont != null); + string name = Resources.AddFont(pdfFont); + return name; + } + + string IContentStream.GetFontName(XFont font, out PdfFont pdfFont) + { + return GetFontName(font, out pdfFont); + } + + internal string GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) + { + pdfFont = _document.FontTable.GetFont(idName, fontData); + Debug.Assert(pdfFont != null); + string name = Resources.AddFont(pdfFont); + return name; + } + + string IContentStream.GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) + { + return GetFontName(idName, fontData, out pdfFont); + } + + /// + /// Gets the resource name of the specified image within this dictionary. + /// + internal string GetImageName(XImage image) + { + PdfImage pdfImage = _document.ImageTable.GetImage(image); + Debug.Assert(pdfImage != null); + string name = Resources.AddImage(pdfImage); + return name; + } + + /// + /// Implements the interface because the primary function is internal. + /// + string IContentStream.GetImageName(XImage image) + { + throw new NotImplementedException(); + } + + /// + /// Gets the resource name of the specified form within this dictionary. + /// + internal string GetFormName(XForm form) + { + PdfFormXObject pdfForm = _document.FormTable.GetForm(form); + Debug.Assert(pdfForm != null); + string name = Resources.AddForm(pdfForm); + return name; + } + + /// + /// Implements the interface because the primary function is internal. + /// + string IContentStream.GetFormName(XForm form) + { + throw new NotImplementedException(); + } + + /// + /// Predefined keys of this dictionary. + /// + public class Keys : PdfDictionary.PdfStream.Keys + { + /// + /// (Optional but strongly recommended; PDF 1.2) A dictionary specifying any + /// resources (such as fonts and images) required by the form XObject. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResources))] + public const string Resources = "/Resources"; + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfExtGState.cs b/PdfSharp/Pdf.Advanced/PdfExtGState.cs new file mode 100644 index 0000000..11d423c --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfExtGState.cs @@ -0,0 +1,411 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Globalization; + +#if GDI +using System.Drawing; +using System.Drawing.Imaging; +#endif +#if WPF +#endif + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents an extended graphics state object. + /// + public sealed class PdfExtGState : PdfDictionary + { + /// + /// Initializes a new instance of the class. + /// + /// The document. + public PdfExtGState(PdfDocument document) + : base(document) + { + Elements.SetName(Keys.Type, "/ExtGState"); + +#if true_ + //AIS false + //BM /Normal + //ca 1 + //CA 1 + //op false + //OP false + //OPM 1 + //SA true + //SMask /None + //Type /ExtGState + + Elements.SetValue(Keys.AIS, new PdfBoolean(false)); // The alpha source + Elements.SetName("/BM", "Normal"); + Elements.SetValue(Keys.op, new PdfBoolean(false)); + Elements.SetValue(Keys.OP, new PdfBoolean(false)); + Elements.SetValue(Keys.OPM, new PdfInteger(1)); + Elements.SetValue("/SA", new PdfBoolean(true)); + Elements.SetName("/SMask", "None"); +#endif + //#if OP_HACK + // Elements.SetValue(Keys.op, new PdfBoolean(false)); + // Elements.SetValue(Keys.OP, new PdfBoolean(false)); + // Elements.SetValue(Keys.OPM, new PdfInteger(1)); + //#endif + } + + /// + /// Used in Edf.Xps. + /// + internal void SetDefault1() + { + //<< + // /AIS false + // /BM /Normal + // /ca 1 + // /CA 1 + // /op false + // /OP false + // /OPM 1 + // /SA true + // /SMask /None + // /Type /ExtGState + //>> + Elements.SetBoolean(Keys.AIS, false); + if (Elements.ContainsKey(Keys.BM)) Elements.SetName(Keys.BM, "/Normal"); + StrokeAlpha = 1; + NonStrokeAlpha = 1; + Elements.SetBoolean(Keys.op, false); + Elements.SetBoolean(Keys.OP, false); + Elements.SetBoolean(Keys.SA, true); + Elements.SetName(Keys.SMask, "/None"); + } + + /// + /// Used in Edf.Xps. + /// ...for shading patterns + /// + internal void SetDefault2() + { + //<< + // /AIS false + // /BM /Normal + // /ca 1 + // /CA 1 + // /op true + // /OP true + // /OPM 1 + // /SA true + // /SMask /None + // /Type /ExtGState + //>> + Elements.SetBoolean(Keys.AIS, false); + Elements.SetName(Keys.BM, "/Normal"); + StrokeAlpha = 1; + NonStrokeAlpha = 1; + Elements.SetBoolean(Keys.op, true); + Elements.SetBoolean(Keys.OP, true); + Elements.SetInteger(Keys.OPM, 1); + Elements.SetBoolean(Keys.SA, true); + Elements.SetName(Keys.SMask, "/None"); + } + + /// + /// Sets the alpha value for stroking operations. + /// + public double StrokeAlpha + { + set + { + _strokeAlpha = value; + Elements.SetReal(Keys.CA, value); + UpdateKey(); + } + } + double _strokeAlpha; + + /// + /// Sets the alpha value for nonstroking operations. + /// + public double NonStrokeAlpha + { + set + { + _nonStrokeAlpha = value; + Elements.SetReal(Keys.ca, value); + UpdateKey(); + } + } + double _nonStrokeAlpha; + + /// + /// Sets the overprint value for stroking operations. + /// + public bool StrokeOverprint + { + set + { + _strokeOverprint = value; + Elements.SetBoolean(Keys.OP, value); + UpdateKey(); + } + } + bool _strokeOverprint; + + /// + /// Sets the overprint value for nonstroking operations. + /// + public bool NonStrokeOverprint + { + set + { + _nonStrokeOverprint = value; + Elements.SetBoolean(Keys.op, value); + UpdateKey(); + } + } + bool _nonStrokeOverprint; + + /// + /// Sets a soft mask object. + /// + public PdfSoftMask SoftMask + { + set { Elements.SetReference(Keys.SMask, value); } + } + + internal string Key + { + get { return _key; } + } + + void UpdateKey() + { + _key = ((int)(1000 * _strokeAlpha)).ToString(CultureInfo.InvariantCulture) + + ((int)(1000 * _nonStrokeAlpha)).ToString(CultureInfo.InvariantCulture) + + (_strokeOverprint ? "S" : "s") + (_nonStrokeOverprint ? "N" : "n"); + } + string _key; + + internal static string MakeKey(double alpha, bool overPaint) + { + string key = ((int)(1000 * alpha)).ToString(CultureInfo.InvariantCulture) + (overPaint ? "O" : "0"); + return key; + } + + /// + /// Common keys for all streams. + /// + internal sealed class Keys : KeysBase + { + // ReSharper disable InconsistentNaming + + /// + /// (Optional) The type of PDF object that this dictionary describes; + /// must be ExtGState for a graphics state parameter dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string Type = "/Type"; + + /// + /// (Optional; PDF 1.3) The line width (see Line Width on page 185). + /// + [KeyInfo(KeyType.Real | KeyType.Optional)] + public const string LW = "/LW"; + + /// + /// (Optional; PDF 1.3) The line cap style. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string LC = "/LC"; + + /// + /// (Optional; PDF 1.3) The line join style. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string LJ = "/LJ"; + + /// + /// (Optional; PDF 1.3) The miter limit. + /// + [KeyInfo(KeyType.Real | KeyType.Optional)] + public const string ML = "/ML"; + + /// + /// (Optional; PDF 1.3) The line dash pattern, expressed as an array of the form + /// [dashArray dashPhase], where dashArray is itself an array and dashPhase is an integer. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string D = "/D"; + + /// + /// (Optional; PDF 1.3) The name of the rendering intent. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string RI = "/RI"; + + /// + /// (Optional) A flag specifying whether to apply overprint. In PDF 1.2 and earlier, + /// there is a single overprint parameter that applies to all painting operations. + /// Beginning with PDF 1.3, there are two separate overprint parameters: one for stroking + /// and one for all other painting operations. Specifying an OP entry sets both parameters + /// unless there is also an op entry in the same graphics state parameter dictionary, in + /// which case the OP entry sets only the overprint parameter for stroking. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string OP = "/OP"; + + /// + /// (Optional; PDF 1.3) A flag specifying whether to apply overprint for painting operations + /// other than stroking. If this entry is absent, the OP entry, if any, sets this parameter. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string op = "/op"; + + /// + /// (Optional; PDF 1.3) The overprint mode. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string OPM = "/OPM"; + + /// + /// (Optional; PDF 1.3) An array of the form [font size], where font is an indirect + /// reference to a font dictionary and size is a number expressed in text space units. + /// These two objects correspond to the operands of the Tf operator; however, + /// the first operand is an indirect object reference instead of a resource name. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string Font = "/Font"; + + /// + /// (Optional) The black-generation function, which maps the interval [0.0 1.0] + /// to the interval [0.0 1.0]. + /// + [KeyInfo(KeyType.Function | KeyType.Optional)] + public const string BG = "/BG"; + + /// + /// (Optional; PDF 1.3) Same as BG except that the value may also be the name Default, + /// denoting the black-generation function that was in effect at the start of the page. + /// If both BG and BG2 are present in the same graphics state parameter dictionary, + /// BG2 takes precedence. + /// + [KeyInfo(KeyType.FunctionOrName | KeyType.Optional)] + public const string BG2 = "/BG2"; + + /// + /// (Optional) The undercolor-removal function, which maps the interval + /// [0.0 1.0] to the interval [-1.0 1.0]. + /// + [KeyInfo(KeyType.Function | KeyType.Optional)] + public const string UCR = "/UCR"; + + /// + /// (Optional; PDF 1.3) Same as UCR except that the value may also be the name Default, + /// denoting the undercolor-removal function that was in effect at the start of the page. + /// If both UCR and UCR2 are present in the same graphics state parameter dictionary, + /// UCR2 takes precedence. + /// + [KeyInfo(KeyType.FunctionOrName | KeyType.Optional)] + public const string UCR2 = "/UCR2"; + + //TR function, array, or name + //TR2 function, array, or name + //HT dictionary, stream, or name + //FL number + //SM number + + /// + /// (Optional) A flag specifying whether to apply automatic stroke adjustment. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string SA = "/SA"; + + /// + /// (Optional; PDF 1.4) The current blend mode to be used in the transparent imaging model. + /// + [KeyInfo(KeyType.NameOrArray | KeyType.Optional)] + public const string BM = "/BM"; + + /// + /// (Optional; PDF 1.4) The current soft mask, specifying the mask shape or + /// mask opacity values to be used in the transparent imaging model. + /// + [KeyInfo(KeyType.NameOrDictionary | KeyType.Optional)] + public const string SMask = "/SMask"; + + /// + /// (Optional; PDF 1.4) The current stroking alpha constant, specifying the constant + /// shape or constant opacity value to be used for stroking operations in the transparent + /// imaging model. + /// + [KeyInfo(KeyType.Real | KeyType.Optional)] + public const string CA = "/CA"; + + /// + /// (Optional; PDF 1.4) Same as CA, but for nonstroking operations. + /// + [KeyInfo(KeyType.Real | KeyType.Optional)] + public const string ca = "/ca"; + + /// + /// (Optional; PDF 1.4) The alpha source flag (alpha is shape), specifying whether + /// the current soft mask and alpha constant are to be interpreted as shape values (true) + /// or opacity values (false). + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string AIS = "/AIS"; + + /// + /// (Optional; PDF 1.4) The text knockout flag, which determines the behavior of + /// overlapping glyphs within a text object in the transparent imaging model. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string TK = "/TK"; + + // ReSharper restore InconsistentNaming + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfExtGStateTable.cs b/PdfSharp/Pdf.Advanced/PdfExtGStateTable.cs new file mode 100644 index 0000000..8e92c21 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfExtGStateTable.cs @@ -0,0 +1,95 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Contains all used ExtGState objects of a document. + /// + public sealed class PdfExtGStateTable : PdfResourceTable + { + /// + /// Initializes a new instance of this class, which is a singleton for each document. + /// + public PdfExtGStateTable(PdfDocument document) + : base(document) + { } + + + /// + /// Gets a PdfExtGState with the key 'CA' set to the specified alpha value. + /// + public PdfExtGState GetExtGStateStroke(double alpha, bool overprint) + { + string key = PdfExtGState.MakeKey(alpha, overprint); + PdfExtGState extGState; + if (!_strokeAlphaValues.TryGetValue(key, out extGState)) + { + extGState = new PdfExtGState(Owner); + //extGState.Elements[PdfExtGState.Keys.CA] = new PdfReal(alpha); + extGState.StrokeAlpha = alpha; + if (overprint) + { + extGState.StrokeOverprint = true; + extGState.Elements.SetInteger(PdfExtGState.Keys.OPM, 1); + } + _strokeAlphaValues[key] = extGState; + } + return extGState; + } + + /// + /// Gets a PdfExtGState with the key 'ca' set to the specified alpha value. + /// + public PdfExtGState GetExtGStateNonStroke(double alpha, bool overprint) + { + string key = PdfExtGState.MakeKey(alpha, overprint); + PdfExtGState extGState; + if (!_nonStrokeStates.TryGetValue(key, out extGState)) + { + extGState = new PdfExtGState(Owner); + //extGState.Elements[PdfExtGState.Keys.ca] = new PdfReal(alpha); + extGState.NonStrokeAlpha = alpha; + if (overprint) + { + extGState.NonStrokeOverprint = true; + extGState.Elements.SetInteger(PdfExtGState.Keys.OPM, 1); + } + + _nonStrokeStates[key] = extGState; + } + return extGState; + } + + readonly Dictionary _strokeAlphaValues = new Dictionary(); + readonly Dictionary _nonStrokeStates = new Dictionary(); + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf.Advanced/PdfFont.cs b/PdfSharp/Pdf.Advanced/PdfFont.cs new file mode 100644 index 0000000..f8958de --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfFont.cs @@ -0,0 +1,156 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Text; +using PdfSharp.Fonts; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a PDF font. + /// + public class PdfFont : PdfDictionary + { + /// + /// Initializes a new instance of the class. + /// + public PdfFont(PdfDocument document) + : base(document) + { } + + internal PdfFontDescriptor FontDescriptor + { + get + { + Debug.Assert(_fontDescriptor != null); + return _fontDescriptor; + } + set { _fontDescriptor = value; } + } + PdfFontDescriptor _fontDescriptor; + + internal PdfFontEncoding FontEncoding; + + /// + /// Gets a value indicating whether this instance is symbol font. + /// + public bool IsSymbolFont + { + get { return _fontDescriptor.IsSymbolFont; } + } + + internal void AddChars(string text) + { + if (_cmapInfo != null) + _cmapInfo.AddChars(text); + } + + internal void AddGlyphIndices(string glyphIndices) + { + if (_cmapInfo != null) + _cmapInfo.AddGlyphIndices(glyphIndices); + } + + /// + /// Gets or sets the CMapInfo. + /// + internal CMapInfo CMapInfo + { + get { return _cmapInfo; } + set { _cmapInfo = value; } + } + internal CMapInfo _cmapInfo; + + /// + /// Gets or sets ToUnicodeMap. + /// + internal PdfToUnicodeMap ToUnicodeMap + { + get { return _toUnicode; } + set { _toUnicode = value; } + } + internal PdfToUnicodeMap _toUnicode; + + + /// + /// Adds a tag of exactly six uppercase letters to the font name + /// according to PDF Reference Section 5.5.3 'Font Subsets' + /// + internal static string CreateEmbeddedFontSubsetName(string name) + { + StringBuilder s = new StringBuilder(64); + byte[] bytes = Guid.NewGuid().ToByteArray(); + for (int idx = 0; idx < 6; idx++) + s.Append((char)('A' + bytes[idx] % 26)); + s.Append('+'); + if (name.StartsWith("/")) + s.Append(name.Substring(1)); + else + s.Append(name); + return s.ToString(); + } + + /// + /// Predefined keys common to all font dictionaries. + /// + public class Keys : KeysBase + { + /// + /// (Required) The type of PDF object that this dictionary describes; + /// must be Font for a font dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Font")] + public const string Type = "/Type"; + + /// + /// (Required) The type of font. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string Subtype = "/Subtype"; + + /// + /// (Required) The PostScript name of the font. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string BaseFont = "/BaseFont"; + + /// + /// (Required except for the standard 14 fonts; must be an indirect reference) + /// A font descriptor describing the fonts metrics other than its glyph widths. + /// Note: For the standard 14 fonts, the entries FirstChar, LastChar, Widths, and + /// FontDescriptor must either all be present or all be absent. Ordinarily, they are + /// absent; specifying them enables a standard font to be overridden. + /// + [KeyInfo(KeyType.Dictionary | KeyType.MustBeIndirect, typeof(PdfFontDescriptor))] + public const string FontDescriptor = "/FontDescriptor"; + } + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf.Advanced/PdfFontDescriptor.cs b/PdfSharp/Pdf.Advanced/PdfFontDescriptor.cs new file mode 100644 index 0000000..e566e48 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfFontDescriptor.cs @@ -0,0 +1,351 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Fonts.OpenType; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// The PDF font descriptor flags. + /// + [Flags] + enum PdfFontDescriptorFlags + { + /// + /// All glyphs have the same width (as opposed to proportional or variable-pitch + /// fonts, which have different widths). + /// + FixedPitch = 1 << 0, + + /// + /// Glyphs have serifs, which are short strokes drawn at an angle on the top and + /// bottom of glyph stems. (Sans serif fonts do not have serifs.) + /// + Serif = 1 << 1, + + /// + /// Font contains glyphs outside the Adobe standard Latin character set. This + /// flag and the Nonsymbolic flag cannot both be set or both be clear. + /// + Symbolic = 1 << 2, + + /// + /// Glyphs resemble cursive handwriting. + /// + Script = 1 << 3, + + /// + /// Font uses the Adobe standard Latin character set or a subset of it. + /// + Nonsymbolic = 1 << 5, + + /// + /// Glyphs have dominant vertical strokes that are slanted. + /// + Italic = 1 << 6, + + /// + /// Font contains no lowercase letters; typically used for display purposes, + /// such as for titles or headlines. + /// + AllCap = 1 << 16, + + /// + /// Font contains both uppercase and lowercase letters. The uppercase letters are + /// similar to those in the regular version of the same typeface family. The glyphs + /// for the lowercase letters have the same shapes as the corresponding uppercase + /// letters, but they are sized and their proportions adjusted so that they have the + /// same size and stroke weight as lowercase glyphs in the same typeface family. + /// + SmallCap = 1 << 17, + + /// + /// Determines whether bold glyphs are painted with extra pixels even at very small + /// text sizes. + /// + ForceBold = 1 << 18, + } + + /// + /// A PDF font descriptor specifies metrics and other attributes of a simple font, + /// as distinct from the metrics of individual glyphs. + /// + public sealed class PdfFontDescriptor : PdfDictionary + { + internal PdfFontDescriptor(PdfDocument document, OpenTypeDescriptor descriptor) + : base(document) + { + _descriptor = descriptor; + Elements.SetName(Keys.Type, "/FontDescriptor"); + + Elements.SetInteger(Keys.Ascent, _descriptor.DesignUnitsToPdf(_descriptor.Ascender)); + Elements.SetInteger(Keys.CapHeight, _descriptor.DesignUnitsToPdf(_descriptor.CapHeight)); + Elements.SetInteger(Keys.Descent, _descriptor.DesignUnitsToPdf(_descriptor.Descender)); + Elements.SetInteger(Keys.Flags, (int)FlagsFromDescriptor(_descriptor)); + Elements.SetRectangle(Keys.FontBBox, new PdfRectangle( + _descriptor.DesignUnitsToPdf(_descriptor.XMin), + _descriptor.DesignUnitsToPdf(_descriptor.YMin), + _descriptor.DesignUnitsToPdf(_descriptor.XMax), + _descriptor.DesignUnitsToPdf(_descriptor.YMax))); + // not here, done in PdfFont later... + //Elements.SetName(Keys.FontName, "abc"); //descriptor.FontName); + Elements.SetReal(Keys.ItalicAngle, _descriptor.ItalicAngle); + Elements.SetInteger(Keys.StemV, _descriptor.StemV); + Elements.SetInteger(Keys.XHeight, _descriptor.DesignUnitsToPdf(_descriptor.XHeight)); + } + + //HACK OpenTypeDescriptor descriptor + internal OpenTypeDescriptor _descriptor; + + /// + /// Gets or sets the name of the font. + /// + public string FontName + { + get { return Elements.GetName(Keys.FontName); } + set { Elements.SetName(Keys.FontName, value); } + } + + /// + /// Gets a value indicating whether this instance is symbol font. + /// + public bool IsSymbolFont + { + get { return _isSymbolFont; } + } + bool _isSymbolFont; + + // HACK FlagsFromDescriptor(OpenTypeDescriptor descriptor) + PdfFontDescriptorFlags FlagsFromDescriptor(OpenTypeDescriptor descriptor) + { + PdfFontDescriptorFlags flags = 0; + _isSymbolFont = descriptor.FontFace.cmap.symbol; + flags |= descriptor.FontFace.cmap.symbol ? PdfFontDescriptorFlags.Symbolic : PdfFontDescriptorFlags.Nonsymbolic; + return flags; + } + + /// + /// Predefined keys of this dictionary. + /// + public sealed class Keys : KeysBase + { + /// + /// (Required) The type of PDF object that this dictionary describes; must be + /// FontDescriptor for a font descriptor. + /// + [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "FontDescriptor")] + public const string Type = "/Type"; + + /// + /// (Required) The PostScript name of the font. This name should be the same as the + /// value of BaseFont in the font or CIDFont dictionary that refers to this font descriptor. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string FontName = "/FontName"; + + /// + /// (Optional; PDF 1.5; strongly recommended for Type 3 fonts in Tagged PDF documents) + /// A string specifying the preferred font family name. For example, for the font + /// Times Bold Italic, the FontFamily is Times. + /// + [KeyInfo(KeyType.String | KeyType.Optional)] + public const string FontFamily = "/FontFamily"; + + /// + /// (Optional; PDF 1.5; strongly recommended for Type 3 fonts in Tagged PDF documents) + /// The font stretch value. It must be one of the following names (ordered from + /// narrowest to widest): UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, + /// Normal, SemiExpanded, Expanded, ExtraExpanded or UltraExpanded. + /// Note: The specific interpretation of these values varies from font to font. + /// For example, Condensed in one font may appear most similar to Normal in another. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string FontStretch = "/FontStretch"; + + /// + /// (Optional; PDF 1.5; strongly recommended for Type 3 fonts in Tagged PDF documents) + /// The weight (thickness) component of the fully-qualified font name or font specifier. + /// The possible values are 100, 200, 300, 400, 500, 600, 700, 800, or 900, where each + /// number indicates a weight that is at least as dark as its predecessor. A value of + /// 400 indicates a normal weight; 700 indicates bold. + /// Note: The specific interpretation of these values varies from font to font. + /// For example, 300 in one font may appear most similar to 500 in another. + /// + [KeyInfo(KeyType.Real | KeyType.Optional)] + public const string FontWeight = "/FontWeight"; + + /// + /// (Required) A collection of flags defining various characteristics of the font. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string Flags = "/Flags"; + + /// + /// (Required, except for Type 3 fonts) A rectangle (see Section 3.8.4, Rectangles), + /// expressed in the glyph coordinate system, specifying the font bounding box. This + /// is the smallest rectangle enclosing the shape that would result if all of the + /// glyphs of the font were placed with their origins coincident and then filled. + /// + [KeyInfo(KeyType.Rectangle | KeyType.Required)] + public const string FontBBox = "/FontBBox"; + + /// + /// (Required) The angle, expressed in degrees counterclockwise from the vertical, of + /// the dominant vertical strokes of the font. (For example, the 9-oclock position is 90 + /// degrees, and the 3-oclock position is 90 degrees.) The value is negative for fonts + /// that slope to the right, as almost all italic fonts do. + /// + [KeyInfo(KeyType.Real | KeyType.Required)] + public const string ItalicAngle = "/ItalicAngle"; + + /// + /// (Required, except for Type 3 fonts) The maximum height above the baseline reached + /// by glyphs in this font, excluding the height of glyphs for accented characters. + /// + [KeyInfo(KeyType.Real | KeyType.Required)] + public const string Ascent = "/Ascent"; + + /// + /// (Required, except for Type 3 fonts) The maximum depth below the baseline reached + /// by glyphs in this font. The value is a negative number. + /// + [KeyInfo(KeyType.Real | KeyType.Required)] + public const string Descent = "/Descent"; + + /// + /// (Optional) The spacing between baselines of consecutive lines of text. + /// Default value: 0. + /// + [KeyInfo(KeyType.Real | KeyType.Optional)] + public const string Leading = "/Leading"; + + /// + /// (Required for fonts that have Latin characters, except for Type 3 fonts) The vertical + /// coordinate of the top of flat capital letters, measured from the baseline. + /// + [KeyInfo(KeyType.Real | KeyType.Required)] + public const string CapHeight = "/CapHeight"; + + /// + /// (Optional) The fonts x height: the vertical coordinate of the top of flat nonascending + /// lowercase letters (like the letter x), measured from the baseline, in fonts that have + /// Latin characters. Default value: 0. + /// + [KeyInfo(KeyType.Real | KeyType.Optional)] + public const string XHeight = "/XHeight"; + + /// + /// (Required, except for Type 3 fonts) The thickness, measured horizontally, of the dominant + /// vertical stems of glyphs in the font. + /// + [KeyInfo(KeyType.Real | KeyType.Required)] + public const string StemV = "/StemV"; + + /// + /// (Optional) The thickness, measured vertically, of the dominant horizontal stems + /// of glyphs in the font. Default value: 0. + /// + [KeyInfo(KeyType.Real | KeyType.Optional)] + public const string StemH = "/StemH"; + + /// + /// (Optional) The average width of glyphs in the font. Default value: 0. + /// + [KeyInfo(KeyType.Real | KeyType.Optional)] + public const string AvgWidth = "/AvgWidth"; + + /// + /// (Optional) The maximum width of glyphs in the font. Default value: 0. + /// + [KeyInfo(KeyType.Real | KeyType.Optional)] + public const string MaxWidth = "/MaxWidth"; + + /// + /// (Optional) The width to use for character codes whose widths are not specified in a + /// font dictionarys Widths array. This has a predictable effect only if all such codes + /// map to glyphs whose actual widths are the same as the value of the MissingWidth entry. + /// Default value: 0. + /// + [KeyInfo(KeyType.Real | KeyType.Optional)] + public const string MissingWidth = "/MissingWidth"; + + /// + /// (Optional) A stream containing a Type 1 font program. + /// + [KeyInfo(KeyType.Stream | KeyType.Optional)] + public const string FontFile = "/FontFile"; + + /// + /// (Optional; PDF 1.1) A stream containing a TrueType font program. + /// + [KeyInfo(KeyType.Stream | KeyType.Optional)] + public const string FontFile2 = "/FontFile2"; + + /// + /// (Optional; PDF 1.2) A stream containing a font program whose format is specified + /// by the Subtype entry in the stream dictionary. + /// + [KeyInfo(KeyType.Stream | KeyType.Optional)] + public const string FontFile3 = "/FontFile3"; + + /// + /// (Optional; meaningful only in Type 1 fonts; PDF 1.1) A string listing the character + /// names defined in a font subset. The names in this string must be in PDF syntaxthat is, + /// each name preceded by a slash (/). The names can appear in any order. The name .notdef + /// should be omitted; it is assumed to exist in the font subset. If this entry is absent, + /// the only indication of a font subset is the subset tag in the FontName entry. + /// + [KeyInfo(KeyType.String | KeyType.Optional)] + public const string CharSet = "/CharSet"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get + { + if (_meta == null) + _meta = CreateMeta(typeof(Keys)); + return _meta; + } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfFontTable.cs b/PdfSharp/Pdf.Advanced/PdfFontTable.cs new file mode 100644 index 0000000..7f31966 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfFontTable.cs @@ -0,0 +1,143 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using System.Collections.Generic; +using PdfSharp.Drawing; + +namespace PdfSharp.Pdf.Advanced +{ + internal enum FontType + { + /// + /// TrueType with WinAnsi encoding. + /// + TrueType = 1, + + /// + /// TrueType with Identity-H or Identity-V encoding (unicode). + /// + Type0 = 2, + } + + /// + /// Contains all used fonts of a document. + /// + internal sealed class PdfFontTable : PdfResourceTable + { + /// + /// Initializes a new instance of this class, which is a singleton for each document. + /// + public PdfFontTable(PdfDocument document) + : base(document) + { } + + /// + /// Gets a PdfFont from an XFont. If no PdfFont already exists, a new one is created. + /// + public PdfFont GetFont(XFont font) + { + string selector = font.Selector; + if (selector == null) + { + selector = ComputeKey(font); //new FontSelector(font); + font.Selector = selector; + } + PdfFont pdfFont; + if (!_fonts.TryGetValue(selector, out pdfFont)) + { + if (font.Unicode) + pdfFont = new PdfType0Font(Owner, font, font.IsVertical); + else + pdfFont = new PdfTrueTypeFont(Owner, font); + //pdfFont.Document = _document; + Debug.Assert(pdfFont.Owner == Owner); + _fonts[selector] = pdfFont; + } + return pdfFont; + } + +#if true + /// + /// Gets a PdfFont from a font program. If no PdfFont already exists, a new one is created. + /// + public PdfFont GetFont(string idName, byte[] fontData) + { + Debug.Assert(false); + //FontSelector selector = new FontSelector(idName); + string selector = null; // ComputeKey(font); //new FontSelector(font); + PdfFont pdfFont; + if (!_fonts.TryGetValue(selector, out pdfFont)) + { + //if (font.Unicode) + pdfFont = new PdfType0Font(Owner, idName, fontData, false); + //else + // pdfFont = new PdfTrueTypeFont(_owner, font); + //pdfFont.Document = _document; + Debug.Assert(pdfFont.Owner == Owner); + _fonts[selector] = pdfFont; + } + return pdfFont; + } +#endif + + /// + /// Tries to gets a PdfFont from the font dictionary. + /// Returns null if no such PdfFont exists. + /// + public PdfFont TryGetFont(string idName) + { + Debug.Assert(false); + //FontSelector selector = new FontSelector(idName); + string selector = null; + PdfFont pdfFont; + _fonts.TryGetValue(selector, out pdfFont); + return pdfFont; + } + + internal static string ComputeKey(XFont font) + { + XGlyphTypeface glyphTypeface = font.GlyphTypeface; + string key = glyphTypeface.Fontface.FullFaceName.ToLowerInvariant() + + (glyphTypeface.IsBold ? "/b" : "") + (glyphTypeface.IsItalic ? "/i" : "") + font.Unicode; + return key; + } + + /// + /// Map from PdfFontSelector to PdfFont. + /// + readonly Dictionary _fonts = new Dictionary(); + + public void PrepareForSave() + { + foreach (PdfFont font in _fonts.Values) + font.PrepareForSave(); + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfFormXObject.cs b/PdfSharp/Pdf.Advanced/PdfFormXObject.cs new file mode 100644 index 0000000..88af440 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfFormXObject.cs @@ -0,0 +1,509 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +#if GDI +using System.Drawing; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows.Media; +#endif +using PdfSharp.Drawing; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents an external form object (e.g. an imported page). + /// + public sealed class PdfFormXObject : PdfXObject, IContentStream + { + internal PdfFormXObject(PdfDocument thisDocument) + : base(thisDocument) + { + Elements.SetName(Keys.Type, "/XObject"); + Elements.SetName(Keys.Subtype, "/Form"); + } + + internal PdfFormXObject(PdfDocument thisDocument, XForm form) + : base(thisDocument) + { + // BUG: form is not used + Elements.SetName(Keys.Type, "/XObject"); + Elements.SetName(Keys.Subtype, "/Form"); + + //if (form.IsTemplate) + //{ } + } + + internal double DpiX + { + get { return _dpiX; } + set { _dpiX = value; } + } + double _dpiX = 72; + + internal double DpiY + { + get { return _dpiY; } + set { _dpiY = value; } + } + double _dpiY = 72; + + internal PdfFormXObject(PdfDocument thisDocument, PdfImportedObjectTable importedObjectTable, XPdfForm form) + : base(thisDocument) + { + Debug.Assert(importedObjectTable != null); + Debug.Assert(ReferenceEquals(thisDocument, importedObjectTable.Owner)); + Elements.SetName(Keys.Type, "/XObject"); + Elements.SetName(Keys.Subtype, "/Form"); + + if (form.IsTemplate) + { + Debug.Assert(importedObjectTable == null); + // TODO more initialization here??? + return; + } + + XPdfForm pdfForm = form; + // Get import page + PdfPages importPages = importedObjectTable.ExternalDocument.Pages; + if (pdfForm.PageNumber < 1 || pdfForm.PageNumber > importPages.Count) + PSSR.ImportPageNumberOutOfRange(pdfForm.PageNumber, importPages.Count, form._path); + PdfPage importPage = importPages[pdfForm.PageNumber - 1]; + + // Import resources + PdfItem res = importPage.Elements["/Resources"]; + if (res != null) // unlikely but possible + { +#if true + // Get root object + PdfObject root; + if (res is PdfReference) + root = ((PdfReference)res).Value; + else + root = (PdfDictionary)res; + + root = ImportClosure(importedObjectTable, thisDocument, root); + // If the root was a direct object, make it indirect. + if (root.Reference == null) + thisDocument._irefTable.Add(root); + + Debug.Assert(root.Reference != null); + Elements["/Resources"] = root.Reference; +#else + // Get transitive closure + PdfObject[] resources = importPage.Owner.Internals.GetClosure(resourcesRoot); + int count = resources.Length; +#if DEBUG_ + for (int idx = 0; idx < count; idx++) + { + Debug.Assert(resources[idx].XRef != null); + Debug.Assert(resources[idx].XRef.Document != null); + Debug.Assert(resources[idx].Document != null); + if (resources[idx].ObjectID.ObjectNumber == 12) + GetType(); + } +#endif + // 1st step. Already imported objects are reused and new ones are cloned. + for (int idx = 0; idx < count; idx++) + { + PdfObject obj = resources[idx]; + if (importedObjectTable.Contains(obj.ObjectID)) + { + // external object was already imported + PdfReference iref = importedObjectTable[obj.ObjectID]; + Debug.Assert(iref != null); + Debug.Assert(iref.Value != null); + Debug.Assert(iref.Document == Owner); + // replace external object by the already clone counterpart + resources[idx] = iref.Value; + } + else + { + // External object was not imported earlier and must be cloned + PdfObject clone = obj.Clone(); + Debug.Assert(clone.Reference == null); + clone.Document = Owner; + if (obj.Reference != null) + { + // add it to this (the importer) document + Owner.irefTable.Add(clone); + Debug.Assert(clone.Reference != null); + // save old object identifier + importedObjectTable.Add(obj.ObjectID, clone.Reference); + //Debug.WriteLine("Cloned: " + obj.ObjectID.ToString()); + } + else + { + // The root object (the /Resources value) is not an indirect object + Debug.Assert(idx == 0); + // add it to this (the importer) document + Owner.irefTable.Add(clone); + Debug.Assert(clone.Reference != null); + } + // replace external object by its clone + resources[idx] = clone; + } + } +#if DEBUG_ + for (int idx = 0; idx < count; idx++) + { + Debug.Assert(resources[idx].XRef != null); + Debug.Assert(resources[idx].XRef.Document != null); + Debug.Assert(resources[idx].Document != null); + if (resources[idx].ObjectID.ObjectNumber == 12) + GetType(); + } +#endif + + // 2nd step. Fix up indirect references that still refers to the import document. + for (int idx = 0; idx < count; idx++) + { + PdfObject obj = resources[idx]; + Debug.Assert(obj.Owner != null); + FixUpObject(importedObjectTable, importedObjectTable.Owner, obj); + } + + // Set resources key to the root of the clones + Elements["/Resources"] = resources[0].Reference; +#endif + } + + // Take /Rotate into account. + PdfRectangle rect = importPage.Elements.GetRectangle(PdfPage.Keys.MediaBox); + // Reduce rotation to 0, 90, 180, or 270. + int rotate = (importPage.Elements.GetInteger(PdfPage.Keys.Rotate) % 360 + 360) % 360; + //rotate = 0; + if (rotate == 0) + { + // Set bounding box to media box. + Elements["/BBox"] = rect; + } + else + { + // TODO: Have to adjust bounding box? (I think not, but I'm not sure -> wait for problem) + Elements["/BBox"] = rect; + + // Rotate the image such that it is upright. + XMatrix matrix = new XMatrix(); + double width = rect.Width; + double height = rect.Height; + matrix.RotateAtPrepend(-rotate, new XPoint(width / 2, height / 2)); + + // Translate the image such that its center lies on the center of the rotated bounding box. + double offset = (height - width) / 2; + if (rotate == 90) + { + // TODO It seems we can simplify this as the sign of offset changes too. + if (height > width) + matrix.TranslatePrepend(offset, offset); // Tested. + else + matrix.TranslatePrepend(offset, offset); // TODO Test case. + } + else if (rotate == 270) + { + // TODO It seems we can simplify this as the sign of offset changes too. + if (height > width) + matrix.TranslatePrepend(-offset, -offset); // Tested. + else + matrix.TranslatePrepend(-offset, -offset); // Tested. + } + + //string item = "[" + PdfEncoders.ToString(matrix) + "]"; + //Elements[Keys.Matrix] = new PdfLiteral(item); + Elements.SetMatrix(Keys.Matrix, matrix); + } + + // Preserve filter because the content keeps unmodified. + PdfContent content = importPage.Contents.CreateSingleContent(); +#if !DEBUG + content.Compressed = true; +#endif + PdfItem filter = content.Elements["/Filter"]; + if (filter != null) + Elements["/Filter"] = filter.Clone(); + + // (no cloning needed because the bytes keep untouched) + Stream = content.Stream; // new PdfStream(bytes, this); + Elements.SetInteger("/Length", content.Stream.Value.Length); + } + + /// + /// Gets the PdfResources object of this form. + /// + public PdfResources Resources + { + get + { + if (_resources == null) + _resources = (PdfResources)Elements.GetValue(Keys.Resources, VCF.Create); + return _resources; + } + } + PdfResources _resources; + + PdfResources IContentStream.Resources + { + get { return Resources; } + } + + internal string GetFontName(XFont font, out PdfFont pdfFont) + { + pdfFont = _document.FontTable.GetFont(font); + Debug.Assert(pdfFont != null); + string name = Resources.AddFont(pdfFont); + return name; + } + + string IContentStream.GetFontName(XFont font, out PdfFont pdfFont) + { + return GetFontName(font, out pdfFont); + } + + /// + /// Gets the resource name of the specified font data within this form XObject. + /// + internal string GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) + { + pdfFont = _document.FontTable.GetFont(idName, fontData); + Debug.Assert(pdfFont != null); + string name = Resources.AddFont(pdfFont); + return name; + } + + string IContentStream.GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) + { + return GetFontName(idName, fontData, out pdfFont); + } + + string IContentStream.GetImageName(XImage image) + { + throw new NotImplementedException(); + } + + string IContentStream.GetFormName(XForm form) + { + throw new NotImplementedException(); + } + +#if keep_code_some_time_as_reference + /// + /// Replace all indirect references to external objects by their cloned counterparts + /// owned by the importer document. + /// + void FixUpObject_old(PdfImportedObjectTable iot, PdfObject value) + { + // TODO: merge with PdfXObject.FixUpObject + PdfDictionary dict; + PdfArray array; + if ((dict = value as PdfDictionary) != null) + { + // Set document for cloned direct objects + if (dict.Owner == null) + dict.Document = Owner; + else + Debug.Assert(dict.Owner == Owner); + + // Search for indirect references in all keys + PdfName[] names = dict.Elements.KeyNames; + foreach (PdfName name in names) + { + PdfItem item = dict.Elements[name]; + // Is item an iref? + PdfReference iref = item as PdfReference; + if (iref != null) + { + // Does the iref already belong to this document? + if (iref.Document == Owner) + { + // Yes: fine + continue; + } + else + { + Debug.Assert(iref.Document == iot.ExternalDocument); + // No: replace with iref of cloned object + PdfReference newXRef = iot[iref.ObjectID]; + Debug.Assert(newXRef != null); + Debug.Assert(newXRef.Document == Owner); + dict.Elements[name] = newXRef; + } + } + else if (item is PdfObject) + { + // Fix up inner objects + FixUpObject_old(iot, (PdfObject)item); + } + } + } + else if ((array = value as PdfArray) != null) + { + // Set document for cloned direct objects + if (array.Owner == null) + array.Document = Owner; + else + Debug.Assert(array.Owner == Owner); + + // Search for indirect references in all array elements + int count = array.Elements.Count; + for (int idx = 0; idx < count; idx++) + { + PdfItem item = array.Elements[idx]; + // Is item an iref? + PdfReference iref = item as PdfReference; + if (iref != null) + { + // Does the iref belongs to this document? + if (iref.Document == Owner) + { + // Yes: fine + continue; + } + else + { + Debug.Assert(iref.Document == iot.ExternalDocument); + // No: replace with iref of cloned object + PdfReference newXRef = iot[iref.ObjectID]; + Debug.Assert(newXRef != null); + Debug.Assert(newXRef.Document == Owner); + array.Elements[idx] = newXRef; + } + } + else if (item is PdfObject) + { + // Fix up inner objects + FixUpObject_old(iot, (PdfObject)item); + } + } + } + } +#endif + + // /// + // /// Returns ??? + // /// + // public override string ToString() + // { + // return "Form"; + // } + + /// + /// Predefined keys of this dictionary. + /// + public sealed new class Keys : PdfXObject.Keys + { + /// + /// (Optional) The type of PDF object that this dictionary describes; if present, + /// must be XObject for a form XObject. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string Type = "/Type"; + + /// + /// (Required) The type of XObject that this dictionary describes; must be Form + /// for a form XObject. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string Subtype = "/Subtype"; + + /// + /// (Optional) A code identifying the type of form XObject that this dictionary + /// describes. The only valid value defined at the time of publication is 1. + /// Default value: 1. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string FormType = "/FormType"; + + /// + /// (Required) An array of four numbers in the form coordinate system, giving the + /// coordinates of the left, bottom, right, and top edges, respectively, of the + /// form XObjects bounding box. These boundaries are used to clip the form XObject + /// and to determine its size for caching. + /// + [KeyInfo(KeyType.Rectangle | KeyType.Required)] + public const string BBox = "/BBox"; + + /// + /// (Optional) An array of six numbers specifying the form matrix, which maps + /// form space into user space. + /// Default value: the identity matrix [1 0 0 1 0 0]. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string Matrix = "/Matrix"; + + /// + /// (Optional but strongly recommended; PDF 1.2) A dictionary specifying any + /// resources (such as fonts and images) required by the form XObject. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResources))] + public const string Resources = "/Resources"; + + /// + /// (Optional; PDF 1.4) A group attributes dictionary indicating that the contents + /// of the form XObject are to be treated as a group and specifying the attributes + /// of that group (see Section 4.9.2, Group XObjects). + /// Note: If a Ref entry (see below) is present, the group attributes also apply to the + /// external page imported by that entry, which allows such an imported page to be + /// treated as a group without further modification. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional)] + public const string Group = "/Group"; + + // further keys: + //Ref + //Metadata + //PieceInfo + //LastModified + //StructParent + //StructParents + //OPI + //OC + //Name + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfFormXObjectTable.cs b/PdfSharp/Pdf.Advanced/PdfFormXObjectTable.cs new file mode 100644 index 0000000..aee3c24 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfFormXObjectTable.cs @@ -0,0 +1,228 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Collections.Generic; +using System.Globalization; +using PdfSharp.Drawing; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Contains all external PDF files from which PdfFormXObjects are imported into the current document. + /// + internal sealed class PdfFormXObjectTable : PdfResourceTable + { + // The name PdfFormXObjectTable is technically not correct, because in contrast to PdfFontTable + // or PdfImageTable this class holds no PdfFormXObject objects. Actually it holds instances of + // the class ImportedObjectTable, one for each external document. The PdfFormXObject instances + // are not cached, because they hold a transformation matrix that make them unique. If the user + // wants to use a particual page of a PdfFormXObject more than once, he must reuse the object + // before he changes the PageNumber or the transformation matrix. In other words this class + // caches the indirect objects of an external form, not the form itself. + + /// + /// Initializes a new instance of this class, which is a singleton for each document. + /// + public PdfFormXObjectTable(PdfDocument document) + : base(document) + { } + + /// + /// Gets a PdfFormXObject from an XPdfForm. Because the returned objects must be unique, always + /// a new instance of PdfFormXObject is created if none exists for the specified form. + /// + public PdfFormXObject GetForm(XForm form) + { + // If the form already has a PdfFormXObject, return it. + if (form._pdfForm != null) + { + Debug.Assert(form.IsTemplate, "An XPdfForm must not have a PdfFormXObject."); + if (ReferenceEquals(form._pdfForm.Owner, Owner)) + return form._pdfForm; + //throw new InvalidOperationException("Because of a current limitation of PDFsharp an XPdfForm object can be used only within one single PdfDocument."); + + // Dispose PdfFromXObject when document has changed + form._pdfForm = null; + } + + XPdfForm pdfForm = form as XPdfForm; + if (pdfForm != null) + { + // Is the external PDF file from which is imported already known for the current document? + Selector selector = new Selector(form); + PdfImportedObjectTable importedObjectTable; + if (!_forms.TryGetValue(selector, out importedObjectTable)) + { + // No: Get the external document from the form and create ImportedObjectTable. + PdfDocument doc = pdfForm.ExternalDocument; + importedObjectTable = new PdfImportedObjectTable(Owner, doc); + _forms[selector] = importedObjectTable; + } + + PdfFormXObject xObject = importedObjectTable.GetXObject(pdfForm.PageNumber); + if (xObject == null) + { + xObject = new PdfFormXObject(Owner, importedObjectTable, pdfForm); + importedObjectTable.SetXObject(pdfForm.PageNumber, xObject); + } + return xObject; + } + Debug.Assert(form.GetType() == typeof(XForm)); + form._pdfForm = new PdfFormXObject(Owner, form); + return form._pdfForm; + } + + /// + /// Gets the imported object table. + /// + public PdfImportedObjectTable GetImportedObjectTable(PdfPage page) + { + // Is the external PDF file from which is imported already known for the current document? + Selector selector = new Selector(page); + PdfImportedObjectTable importedObjectTable; + if (!_forms.TryGetValue(selector, out importedObjectTable)) + { + importedObjectTable = new PdfImportedObjectTable(Owner, page.Owner); + _forms[selector] = importedObjectTable; + } + return importedObjectTable; + } + + /// + /// Gets the imported object table. + /// + public PdfImportedObjectTable GetImportedObjectTable(PdfDocument document) + { + if (document == null) + throw new ArgumentNullException("document"); + + // Is the external PDF file from which is imported already known for the current document? + Selector selector = new Selector(document); + PdfImportedObjectTable importedObjectTable; + if (!_forms.TryGetValue(selector, out importedObjectTable)) + { + // Create new table for document. + importedObjectTable = new PdfImportedObjectTable(Owner, document); + _forms[selector] = importedObjectTable; + } + return importedObjectTable; + } + + public void DetachDocument(PdfDocument.DocumentHandle handle) + { + if (handle.IsAlive) + { + foreach (Selector selector in _forms.Keys) + { + PdfImportedObjectTable table = _forms[selector]; + if (table.ExternalDocument != null && table.ExternalDocument.Handle == handle) + { + _forms.Remove(selector); + break; + } + } + } + + // Clean table + bool itemRemoved = true; + while (itemRemoved) + { + itemRemoved = false; + foreach (Selector selector in _forms.Keys) + { + PdfImportedObjectTable table = _forms[selector]; + if (table.ExternalDocument == null) + { + _forms.Remove(selector); + itemRemoved = true; + break; + } + } + } + } + + /// + /// Map from Selector to PdfImportedObjectTable. + /// + readonly Dictionary _forms = new Dictionary(); + + /// + /// A collection of information that uniquely identifies a particular ImportedObjectTable. + /// + public class Selector + { + /// + /// Initializes a new instance of FormSelector from an XPdfForm. + /// + public Selector(XForm form) + { + // HACK: just use full path to identify + _path = form._path.ToLowerInvariant(); + } + + /// + /// Initializes a new instance of FormSelector from a PdfPage. + /// + public Selector(PdfPage page) + { + PdfDocument owner = page.Owner; + _path = "*" + owner.Guid.ToString("B"); + _path = _path.ToLowerInvariant(); + } + + public Selector(PdfDocument document) + { + _path = "*" + document.Guid.ToString("B"); + _path = _path.ToLowerInvariant(); + } + + public string Path + { + get { return _path; } + set { _path = value; } + } + string _path; + + public override bool Equals(object obj) + { + Selector selector = obj as Selector; + if (selector == null) + return false; + return _path == selector._path; + } + + public override int GetHashCode() + { + return _path.GetHashCode(); + } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfGroupAttributes.cs b/PdfSharp/Pdf.Advanced/PdfGroupAttributes.cs new file mode 100644 index 0000000..44eb7f3 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfGroupAttributes.cs @@ -0,0 +1,90 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a PDF group XObject. + /// + public abstract class PdfGroupAttributes : PdfDictionary + { + internal PdfGroupAttributes(PdfDocument thisDocument) + : base(thisDocument) + { + Elements.SetName(Keys.Type, "/Group"); + } + + /// + /// Predefined keys of this dictionary. + /// + public class Keys : KeysBase + { + /// + ///(Optional) The type of PDF object that this dictionary describes; + ///if present, must be Group for a group attributes dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string Type = "/Type"; + + /// + /// (Required) The group subtype, which identifies the type of group whose + /// attributes this dictionary describes and determines the format and meaning + /// of the dictionarys remaining entries. The only group subtype defined in + /// PDF 1.4 is Transparency. Other group subtypes may be added in the future. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string S = "/S"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf.Advanced/PdfImage.FaxEncode.cs b/PdfSharp/Pdf.Advanced/PdfImage.FaxEncode.cs new file mode 100644 index 0000000..a154f9c --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfImage.FaxEncode.cs @@ -0,0 +1,840 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// Thomas Hövel +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +// Some routines were translated from LibTiff. +// LibTiff copyright notice: +// Copyright (c) 1988-1997 Sam Leffler +// Copyright (c) 1991-1997 Silicon Graphics, Inc. +// +// Permission to use, copy, modify, distribute, and sell this software and +// its documentation for any purpose is hereby granted without fee, provided +// that (i) the above copyright notices and this permission notice appear in +// all copies of the software and related documentation, and (ii) the names of +// Sam Leffler and Silicon Graphics may not be used in any advertising or +// publicity relating to the software without the specific, prior written +// permission of Sam Leffler and Silicon Graphics. +// +// THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +// EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +// WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +// +// IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +// ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +// OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +// WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +// LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +// OF THIS SOFTWARE. + +#endregion + +#define USE_GOTO +using System; +using System.Diagnostics; + +namespace PdfSharp.Pdf.Advanced +{ + partial class PdfImage + { + internal readonly static uint[] WhiteTerminatingCodes = + { + 0x35, 8, //00110101 // 0 + 0x07, 6, //000111 + 0x07, 4, //0111 + 0x08, 4, //1000 + 0x0b, 4, //1011 + 0x0c, 4, //1100 + 0x0e, 4, //1110 + 0x0f, 4, //1111 + 0x13, 5, //10011 + 0x14, 5, //10100 + 0x07, 5, //00111 // 10 + 0x08, 5, //01000 + 0x08, 6, //001000 + 0x03, 6, //000011 + 0x34, 6, //110100 + 0x35, 6, //110101 + 0x2a, 6, //101010 // 16 + 0x2b, 6, //101011 + 0x27, 7, //0100111 + 0x0c, 7, //0001100 + 0x08, 7, //0001000 // 20 + 0x17, 7, //0010111 + 0x03, 7, //0000011 + 0x04, 7, //0000100 + 0x28, 7, //0101000 + 0x2b, 7, //0101011 + 0x13, 7, //0010011 + 0x24, 7, //0100100 + 0x18, 7, //0011000 + 0x02, 8, //00000010 + 0x03, 8, //00000011 // 30 + 0x1a, 8, //00011010 + 0x1b, 8, //00011011 // 32 + 0x12, 8, //00010010 + 0x13, 8, //00010011 + 0x14, 8, //00010100 + 0x15, 8, //00010101 + 0x16, 8, //00010110 + 0x17, 8, //00010111 + 0x28, 8, //00101000 + 0x29, 8, //00101001 // 40 + 0x2a, 8, //00101010 + 0x2b, 8, //00101011 + 0x2c, 8, //00101100 + 0x2d, 8, //00101101 + 0x04, 8, //00000100 + 0x05, 8, //00000101 + 0x0a, 8, //00001010 + 0x0b, 8, //00001011 // 48 + 0x52, 8, //01010010 + 0x53, 8, //01010011 // 50 + 0x54, 8, //01010100 + 0x55, 8, //01010101 + 0x24, 8, //00100100 + 0x25, 8, //00100101 + 0x58, 8, //01011000 + 0x59, 8, //01011001 + 0x5a, 8, //01011010 + 0x5b, 8, //01011011 + 0x4a, 8, //01001010 + 0x4b, 8, //01001011 // 60 + 0x32, 8, //00110010 + 0x33, 8, //00110011 + 0x34, 8, //00110100 // 63 + }; + + internal readonly static uint[] BlackTerminatingCodes = + { + 0x37, 10, //0000110111 // 0 + 0x02, 3, //010 + 0x03, 2, //11 + 0x02, 2, //10 + 0x03, 3, //011 + 0x03, 4, //0011 + 0x02, 4, //0010 + 0x03, 5, //00011 + 0x05, 6, //000101 + 0x04, 6, //000100 + 0x04, 7, //0000100 + 0x05, 7, //0000101 + 0x07, 7, //0000111 + 0x04, 8, //00000100 + 0x07, 8, //00000111 + 0x18, 9, //000011000 + 0x17, 10, //0000010111 // 16 + 0x18, 10, //0000011000 + 0x08, 10, //0000001000 + 0x67, 11, //00001100111 + 0x68, 11, //00001101000 + 0x6c, 11, //00001101100 + 0x37, 11, //00000110111 + 0x28, 11, //00000101000 + 0x17, 11, //00000010111 + 0x18, 11, //00000011000 + 0xca, 12, //000011001010 + 0xcb, 12, //000011001011 + 0xcc, 12, //000011001100 + 0xcd, 12, //000011001101 + 0x68, 12, //000001101000 // 30 + 0x69, 12, //000001101001 + 0x6a, 12, //000001101010 // 32 + 0x6b, 12, //000001101011 + 0xd2, 12, //000011010010 + 0xd3, 12, //000011010011 + 0xd4, 12, //000011010100 + 0xd5, 12, //000011010101 + 0xd6, 12, //000011010110 + 0xd7, 12, //000011010111 + 0x6c, 12, //000001101100 + 0x6d, 12, //000001101101 + 0xda, 12, //000011011010 + 0xdb, 12, //000011011011 + 0x54, 12, //000001010100 + 0x55, 12, //000001010101 + 0x56, 12, //000001010110 + 0x57, 12, //000001010111 + 0x64, 12, //000001100100 // 48 + 0x65, 12, //000001100101 + 0x52, 12, //000001010010 + 0x53, 12, //000001010011 + 0x24, 12, //000000100100 + 0x37, 12, //000000110111 + 0x38, 12, //000000111000 + 0x27, 12, //000000100111 + 0x28, 12, //000000101000 + 0x58, 12, //000001011000 + 0x59, 12, //000001011001 + 0x2b, 12, //000000101011 + 0x2c, 12, //000000101100 + 0x5a, 12, //000001011010 + 0x66, 12, //000001100110 + 0x67, 12, //000001100111 // 63 + }; + + internal readonly static uint[] WhiteMakeUpCodes = + { + 0x1b, 5, //11011 64 // 0 + 0x12, 5, //10010 128 + 0x17, 6, //010111 192 + 0x37, 7, //0110111 256 + 0x36, 8, //00110110 320 + 0x37, 8, //00110111 384 + 0x64, 8, //01100100 448 + 0x65, 8, //01100101 512 + 0x68, 8, //01101000 576 + 0x67, 8, //01100111 640 + 0xcc, 9, //011001100 704 // 10 + 0xcd, 9, //011001101 768 + 0xd2, 9, //011010010 832 + 0xd3, 9, //011010011 896 + 0xd4, 9, //011010100 960 + 0xd5, 9, //011010101 1024 + 0xd6, 9, //011010110 1088 // 16 + 0xd7, 9, //011010111 1152 + 0xd8, 9, //011011000 1216 + 0xd9, 9, //011011001 1280 + 0xda, 9, //011011010 1344 + 0xdb, 9, //011011011 1408 + 0x98, 9, //010011000 1472 + 0x99, 9, //010011001 1536 + 0x9a, 9, //010011010 1600 + 0x18, 6, //011000 1664 + 0x9b, 9, //010011011 1728 + // Common codes for white and black: + 0x08, 11, //00000001000 1792 + 0x0c, 11, //00000001100 1856 + 0x0d, 11, //00000001101 1920 + 0x12, 12, //000000010010 1984 + 0x13, 12, //000000010011 2048 + 0x14, 12, //000000010100 2112 // 32 + 0x15, 12, //000000010101 2176 + 0x16, 12, //000000010110 2240 + 0x17, 12, //000000010111 2304 + 0x1c, 12, //000000011100 2368 + 0x1d, 12, //000000011101 2432 + 0x1e, 12, //000000011110 2496 + 0x1f, 12, //000000011111 2560 + 0x01, 12, //000000000001 EOL // 40 + }; + + internal readonly static uint[] BlackMakeUpCodes = + { + 0x0f, 10, //0000001111 64 // 0 + 0xc8, 12, //000011001000 128 + 0xc9, 12, //000011001001 192 + 0x5b, 12, //000001011011 256 + 0x33, 12, //000000110011 320 + 0x34, 12, //000000110100 384 + 0x35, 12, //000000110101 448 + 0x6c, 13, //0000001101100 512 + 0x6d, 13, //0000001101101 576 + 0x4a, 13, //0000001001010 640 + 0x4b, 13, //0000001001011 704 + 0x4c, 13, //0000001001100 768 + 0x4d, 13, //0000001001101 832 + 0x72, 13, //0000001110010 896 + 0x73, 13, //0000001110011 960 + 0x74, 13, //0000001110100 1024 + 0x75, 13, //0000001110101 1088 // 16 + 0x76, 13, //0000001110110 1152 + 0x77, 13, //0000001110111 1216 + 0x52, 13, //0000001010010 1280 + 0x53, 13, //0000001010011 1344 + 0x54, 13, //0000001010100 1408 + 0x55, 13, //0000001010101 1472 + 0x5a, 13, //0000001011010 1536 + 0x5b, 13, //0000001011011 1600 + 0x64, 13, //0000001100100 1664 + 0x65, 13, //0000001100101 1728 + // Common codes for white and black: + 0x08, 11, //00000001000 1792 + 0x0c, 11, //00000001100 1856 + 0x0d, 11, //00000001101 1920 + 0x12, 12, //000000010010 1984 + 0x13, 12, //000000010011 2048 + 0x14, 12, //000000010100 2112 // 32 + 0x15, 12, //000000010101 2176 + 0x16, 12, //000000010110 2240 + 0x17, 12, //000000010111 2304 + 0x1c, 12, //000000011100 2368 + 0x1d, 12, //000000011101 2432 + 0x1e, 12, //000000011110 2496 + 0x1f, 12, //000000011111 2560 + 0x01, 12, //000000000001 EOL // 40 + }; + + internal readonly static uint[] HorizontalCodes = { 0x1, 3 }; /* 001 */ + internal readonly static uint[] PassCodes = { 0x1, 4, }; /* 0001 */ + internal readonly static uint[] VerticalCodes = + { + 0x03, 7, /* 0000 011 */ + 0x03, 6, /* 0000 11 */ + 0x03, 3, /* 011 */ + 0x1, 1, /* 1 */ + 0x2, 3, /* 010 */ + 0x02, 6, /* 0000 10 */ + 0x02, 7, /* 0000 010 */ + }; + + readonly static uint[] _zeroRuns = + { + 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, /* 0x00 - 0x0f */ + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x10 - 0x1f */ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x20 - 0x2f */ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x30 - 0x3f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x40 - 0x4f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x50 - 0x5f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x60 - 0x6f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x70 - 0x7f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 - 0x8f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 - 0x9f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 - 0xaf */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 - 0xbf */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 - 0xcf */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 - 0xdf */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 - 0xef */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xf0 - 0xff */ + }; + + readonly static uint[] _oneRuns = + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 - 0x0f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 - 0x1f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 - 0x2f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 - 0x3f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x4f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 - 0x5f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x6f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 - 0x7f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x80 - 0x8f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x90 - 0x9f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xa0 - 0xaf */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xb0 - 0xbf */ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xc0 - 0xcf */ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xd0 - 0xdf */ + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0xe0 - 0xef */ + 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8, /* 0xf0 - 0xff */ + }; + + /// + /// Counts the consecutive one bits in an image line. + /// + /// The reader. + /// The bits left. + private static uint CountOneBits(BitReader reader, uint bitsLeft) + { + uint found = 0; + for (;;) + { + uint bits; + int @byte = reader.PeekByte(out bits); + uint hits = _oneRuns[@byte]; + if (hits < bits) + { + if (hits > 0) + reader.SkipBits(hits); + found += hits; + return found >= bitsLeft ? bitsLeft : found; + } + found += bits; + if (found >= bitsLeft) + return bitsLeft; + reader.NextByte(); + } + } + + /// + /// Counts the consecutive zero bits in an image line. + /// + /// The reader. + /// The bits left. + private static uint CountZeroBits(BitReader reader, uint bitsLeft) + { + uint found = 0; + for (;;) + { + uint bits; + int @byte = reader.PeekByte(out bits); + uint hits = _zeroRuns[@byte]; + if (hits < bits) + { + if (hits > 0) + reader.SkipBits(hits); + found += hits; + return found >= bitsLeft ? bitsLeft : found; + } + found += bits; + if (found >= bitsLeft) + return bitsLeft; + reader.NextByte(); + } + } + + /// + /// Returns the offset of the next bit in the range + /// [bitStart..bitEnd] that is different from the + /// specified color. The end, bitEnd, is returned + /// if no such bit exists. + /// + /// The reader. + /// The offset of the start bit. + /// The offset of the end bit. + /// If set to true searches "one" (i. e. white), otherwise searches black. + /// The offset of the first non-matching bit. + private static uint FindDifference(BitReader reader, uint bitStart, uint bitEnd, bool searchOne) + { + // Translated from LibTiff + reader.SetPosition(bitStart); + return (bitStart + (searchOne ? CountOneBits(reader, bitEnd - bitStart) : CountZeroBits(reader, bitEnd - bitStart))); + } + + /// + /// Returns the offset of the next bit in the range + /// [bitStart..bitEnd] that is different from the + /// specified color. The end, bitEnd, is returned + /// if no such bit exists. + /// Like FindDifference, but also check the + /// starting bit against the end in case start > end. + /// + /// The reader. + /// The offset of the start bit. + /// The offset of the end bit. + /// If set to true searches "one" (i. e. white), otherwise searches black. + /// The offset of the first non-matching bit. + private static uint FindDifferenceWithCheck(BitReader reader, uint bitStart, uint bitEnd, bool searchOne) + { + // Translated from LibTiff + return ((bitStart < bitEnd) ? FindDifference(reader, bitStart, bitEnd, searchOne) : bitEnd); + } + + /// + /// 2d-encode a row of pixels. Consult the CCITT documentation for the algorithm. + /// + /// The writer. + /// Offset of image data in bitmap file. + /// The bitmap file. + /// Index of the current row. + /// Index of the reference row (0xffffffff if there is none). + /// The width of the image. + /// The height of the image. + /// The bytes per line in the bitmap file. + static void FaxEncode2DRow(BitWriter writer, uint bytesFileOffset, byte[] imageBits, uint currentRow, uint referenceRow, uint width, uint height, uint bytesPerLineBmp) + { + // Translated from LibTiff + uint bytesOffsetRead = bytesFileOffset + (height - 1 - currentRow) * bytesPerLineBmp; + BitReader reader = new BitReader(imageBits, bytesOffsetRead, width); + BitReader readerReference; + if (referenceRow != 0xffffffff) + { + uint bytesOffsetReadReference = bytesFileOffset + (height - 1 - referenceRow) * bytesPerLineBmp; + readerReference = new BitReader(imageBits, bytesOffsetReadReference, width); + } + else + { + byte[] tmpImageBits = new byte[bytesPerLineBmp]; + for (int i = 0; i < bytesPerLineBmp; ++i) + tmpImageBits[i] = 255; + readerReference = new BitReader(tmpImageBits, 0, width); + } + + uint a0 = 0; + uint a1 = !reader.GetBit(0) ? 0 : FindDifference(reader, 0, width, true); + uint b1 = !readerReference.GetBit(0) ? 0 : FindDifference(readerReference, 0, width, true); + // ReSharper disable TooWideLocalVariableScope + uint a2, b2; + // ReSharper restore TooWideLocalVariableScope + + for (;;) + { + b2 = FindDifferenceWithCheck(readerReference, b1, width, readerReference.GetBit(b1)); + if (b2 >= a1) + { + int d = (int)b1 - (int)a1; + if (!(-3 <= d && d <= 3)) + { + /* horizontal mode */ + a2 = FindDifferenceWithCheck(reader, a1, width, reader.GetBit(a1)); + writer.WriteTableLine(HorizontalCodes, 0); + + if (a0 + a1 == 0 || reader.GetBit(a0)) + { + WriteSample(writer, a1 - a0, true); + WriteSample(writer, a2 - a1, false); + } + else + { + WriteSample(writer, a1 - a0, false); + WriteSample(writer, a2 - a1, true); + } + a0 = a2; + } + else + { + /* vertical mode */ + writer.WriteTableLine(VerticalCodes, (uint)(d + 3)); + a0 = a1; + } + } + else + { + /* pass mode */ + writer.WriteTableLine(PassCodes, 0); + a0 = b2; + } + if (a0 >= width) + break; + bool bitA0 = reader.GetBit(a0); + a1 = FindDifference(reader, a0, width, bitA0/*reader.GetBit(a0)*/); + b1 = FindDifference(readerReference, a0, width, !bitA0/*reader.GetBit(a0)*/); + b1 = FindDifferenceWithCheck(readerReference, b1, width, bitA0/*reader.GetBit(a0)*/); + } + } + + /// + /// Encodes a bitonal bitmap using 1D CCITT fax encoding. + /// + /// Space reserved for the fax encoded bitmap. An exception will be thrown if this buffer is too small. + /// The bitmap to be encoded. + /// Offset of image data in bitmap file. + /// The width of the image. + /// The height of the image. + /// The size of the fax encoded image (0 on failure). + private static int DoFaxEncoding(ref byte[] imageData, byte[] imageBits, uint bytesFileOffset, uint width, uint height) + { + try + { + uint bytesPerLineBmp = ((width + 31) / 32) * 4; + BitWriter writer = new BitWriter(ref imageData); + for (uint y = 0; y < height; ++y) + { + uint bytesOffsetRead = bytesFileOffset + (height - 1 - y) * bytesPerLineBmp; + BitReader reader = new BitReader(imageBits, bytesOffsetRead, width); + for (uint bitsRead = 0; bitsRead < width;) + { + uint white = CountOneBits(reader, width - bitsRead); + WriteSample(writer, white, true); + bitsRead += white; + if (bitsRead < width) + { + uint black = CountZeroBits(reader, width - bitsRead); + WriteSample(writer, black, false); + bitsRead += black; + } + } + } + writer.FlushBuffer(); + return writer.BytesWritten(); + } + catch (Exception /*ex*/) + { + //ex.GetType(); + return 0; + } + } + + /// + /// Encodes a bitonal bitmap using 2D group 4 CCITT fax encoding. + /// + /// Space reserved for the fax encoded bitmap. An exception will be thrown if this buffer is too small. + /// The bitmap to be encoded. + /// Offset of image data in bitmap file. + /// The width of the image. + /// The height of the image. + /// The size of the fax encoded image (0 on failure). + internal static int DoFaxEncodingGroup4(ref byte[] imageData, byte[] imageBits, uint bytesFileOffset, uint width, uint height) + { + try + { + uint bytesPerLineBmp = ((width + 31) / 32) * 4; + BitWriter writer = new BitWriter(ref imageData); + for (uint y = 0; y < height; ++y) + { + FaxEncode2DRow(writer, bytesFileOffset, imageBits, y, (y != 0) ? y - 1 : 0xffffffff, width, height, bytesPerLineBmp); + } + writer.FlushBuffer(); + return writer.BytesWritten(); + } + catch (Exception ex) + { + ex.GetType(); + return 0; + } + } + + /// + /// Writes the image data. + /// + /// The writer. + /// The count of bits (pels) to encode. + /// The color of the pels. + private static void WriteSample(BitWriter writer, uint count, bool white) + { + uint[] terminatingCodes = white ? WhiteTerminatingCodes : BlackTerminatingCodes; + uint[] makeUpCodes = white ? WhiteMakeUpCodes : BlackMakeUpCodes; + + // The make-up code for 2560 will be written as often as required: + while (count >= 2624) + { + writer.WriteTableLine(makeUpCodes, 39); // Magic: 2560 + count -= 2560; + } + // A make-up code for a multiple of 64 will be written if required: + if (count > 63) + { + uint line = count / 64 - 1; + writer.WriteTableLine(makeUpCodes, line); + count -= (line + 1) * 64; + } + // And finally the terminating code for the remaining value (0 through 63): + writer.WriteTableLine(terminatingCodes, count); + } + } + + /// + /// The BitReader class is a helper to read bits from an in-memory bitmap file. + /// + class BitReader + { + readonly byte[] _imageBits; + uint _bytesOffsetRead; + readonly uint _bytesFileOffset; + byte _buffer; + uint _bitsInBuffer; + readonly uint _bitsTotal; // Bits we may read (bits per image line) + + /// + /// Initializes a new instance of the class. + /// + /// The in-memory bitmap file. + /// The offset of the line to read. + /// The count of bits that may be read (i. e. the width of the image for normal usage). + internal BitReader(byte[] imageBits, uint bytesFileOffset, uint bits) + { + _imageBits = imageBits; + _bytesFileOffset = bytesFileOffset; + _bitsTotal = bits; + _bytesOffsetRead = bytesFileOffset; + _buffer = imageBits[_bytesOffsetRead]; + _bitsInBuffer = 8; + } + + /// + /// Sets the position within the line (needed for 2D encoding). + /// + /// The new position. + internal void SetPosition(uint position) + { + _bytesOffsetRead = _bytesFileOffset + (position >> 3); + _buffer = _imageBits[_bytesOffsetRead]; + _bitsInBuffer = 8 - (position & 0x07); + } + + /// + /// Gets a single bit at the specified position. + /// + /// The position. + /// True if bit is set. + internal bool GetBit(uint position) + { + if (position >= _bitsTotal) + return false; + SetPosition(position); + uint dummy; + return (PeekByte(out dummy) & 0x80) > 0; + } + + /// + /// Returns the bits that are in the buffer (without changing the position). + /// Data is MSB aligned. + /// + /// The count of bits that were returned (1 through 8). + /// The MSB aligned bits from the buffer. + internal byte PeekByte(out uint bits) + { + // TODO: try to make this faster! + if (_bitsInBuffer == 8) + { + bits = 8; + return _buffer; + } + bits = _bitsInBuffer; + return (byte)(_buffer << (int)(8 - _bitsInBuffer)); + } + + /// + /// Moves the buffer to the next byte. + /// + internal void NextByte() + { + _buffer = _imageBits[++_bytesOffsetRead]; + _bitsInBuffer = 8; + } + + /// + /// "Removes" (eats) bits from the buffer. + /// + /// The count of bits that were processed. + internal void SkipBits(uint bits) + { + Debug.Assert(bits <= _bitsInBuffer, "Buffer underrun"); + if (bits == _bitsInBuffer) + { + NextByte(); + return; + } + _bitsInBuffer -= bits; + } + } + + /// + /// A helper class for writing groups of bits into an array of bytes. + /// + class BitWriter + { + /// + /// Initializes a new instance of the class. + /// + /// The byte array to be written to. + internal BitWriter(ref byte[] imageData) + { + _imageData = imageData; + } + + /// + /// Writes the buffered bits into the byte array. + /// + internal void FlushBuffer() + { + if (_bitsInBuffer > 0) + { + uint bits = 8 - _bitsInBuffer; + WriteBits(0, bits); + } + } + + /// + /// Masks for n bits in a byte (with n = 0 through 8). + /// + static readonly uint[] masks = { 0, 1, 3, 7, 15, 31, 63, 127, 255 }; + + /// + /// Writes bits to the byte array. + /// + /// The bits to be written (LSB aligned). + /// The count of bits. + internal void WriteBits(uint value, uint bits) + { +#if true + // TODO: Try to make this faster! + + // If we have to write more bits than fit into the buffer, we fill + // the buffer and call the same routine recursively for the rest. +#if USE_GOTO + // Use GOTO instead of end recursion: (is this faster?) + SimulateRecursion: +#endif + if (bits + _bitsInBuffer > 8) + { + // We can't add all bits this time. + uint bitsNow = 8 - _bitsInBuffer; + uint bitsRemainder = bits - bitsNow; + WriteBits(value >> (int)(bitsRemainder), bitsNow); // that fits +#if USE_GOTO + bits = bitsRemainder; + goto SimulateRecursion; +#else + WriteBits(value, bitsRemainder); + return; +#endif + } + + _buffer = (_buffer << (int)bits) + (value & masks[bits]); + _bitsInBuffer += bits; + + if (_bitsInBuffer == 8) + { + // The line below will sometimes throw a System.IndexOutOfRangeException while PDFsharp tries different formats for monochrome bitmaps (exception occurs if CCITT encoding requires more space than an uncompressed bitmap). + _imageData[_bytesOffsetWrite] = (byte)_buffer; + _bitsInBuffer = 0; + ++_bytesOffsetWrite; + } +#else + // Simple implementation writing bit by bit: + int mask = 1 << (int)(bits - 1); + for (int b = 0; b < bits; ++b) + { + if ((value & mask) != 0) + buffer = (buffer << 1) + 1; + else + buffer = buffer << 1; + ++bitsInBuffer; + mask /= 2; + if (bitsInBuffer == 8) + { + imageData[bytesOffsetWrite] = (byte)buffer; + bitsInBuffer = 0; + ++bytesOffsetWrite; + } + } +#endif + } + + /// + /// Writes a line from a look-up table. + /// A "line" in the table are two integers, one containing the values, one containing the bit count. + /// + internal void WriteTableLine(uint[] table, uint line) + { + uint value = table[line * 2]; + uint bits = table[line * 2 + 1]; + WriteBits(value, bits); + } + + [Obsolete] + internal void WriteEOL() + { + // Not needed for PDF. + WriteTableLine(PdfImage.WhiteMakeUpCodes, 40); + } + + /// + /// Flushes the buffer and returns the count of bytes written to the array. + /// + internal int BytesWritten() + { + FlushBuffer(); + return _bytesOffsetWrite; + } + + int _bytesOffsetWrite; + readonly byte[] _imageData; + uint _buffer; + uint _bitsInBuffer; + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfImage.cs b/PdfSharp/Pdf.Advanced/PdfImage.cs new file mode 100644 index 0000000..82af4f0 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfImage.cs @@ -0,0 +1,1683 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// Thomas Hvel +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.IO; +#if CORE +using System.Drawing.Imaging; +#endif +#if GDI +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows.Media.Imaging; +#endif +using PdfSharp.Drawing; +using PdfSharp.Drawing.Internal; +using PdfSharp.Pdf.Filters; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents an image. + /// + public sealed partial class PdfImage : PdfXObject + { + /// + /// Initializes a new instance of PdfImage from an XImage. + /// + public PdfImage(PdfDocument document, XImage image) + : base(document) + { + Elements.SetName(Keys.Type, "/XObject"); + Elements.SetName(Keys.Subtype, "/Image"); + + _image = image; + +#if !SILVERLIGHT + ////// TODO: identify images used multiple times. If the image already exists use the same XRef. + ////_defaultName = PdfImageTable.NextImageName; + + switch (_image.Format.Guid.ToString("B").ToUpper()) + { + // Pdf supports Jpeg, therefore we can write what we've read: + case "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}": //XImageFormat.Jpeg + InitializeJpeg(); + break; + + // All other image formats are converted to PDF bitmaps: + case "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}": //XImageFormat.Png + case "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}": //XImageFormat.Gif + case "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}": //XImageFormat.Tiff + case "{B96B3CB5-0728-11D3-9D7B-0000F81EF32E}": //XImageFormat.Icon + // TODO: possible optimization for PNG (do not decompress/recompress)??? + // TODO: try Jpeg for size optimization??? + InitializeNonJpeg(); + break; + + case "{84570158-DBF0-4C6B-8368-62D6A3CA76E0}": //XImageFormat.Pdf: + Debug.Assert(false, "XPdfForm not expected here."); + break; + + default: + Debug.Assert(false, "Unexpected image type."); + break; + } +#else + InitializeAg(); +#endif + } + +#if SILVERLIGHT + private void InitializeAg() + { + ReadTrueColorMemoryBitmapAg(3, 8, true); + } + + private void ReadTrueColorMemoryBitmapAg(int components, int bits, bool hasAlpha) + { + int pdfVersion = Owner.Version; + MemoryStream memory = new MemoryStream(); + + WriteableBitmap bitmap = null; + if (_image._wpfImage is WriteableBitmap) + bitmap = (WriteableBitmap)_image._wpfImage; + else if (_image._wpfImage is BitmapImage) + bitmap = new WriteableBitmap(_image._wpfImage); + + if (bitmap != null) + { + int height = _image.PixelHeight; + int width = _image.PixelWidth; + + int logicalComponents = components; + if (components == 4) + logicalComponents = 3; + + byte[] imageData = new byte[components * width * height]; + + bool hasMask = false; + bool hasAlphaMask = false; + byte[] alphaMask = hasAlpha ? new byte[width * height] : null; + MonochromeMask mask = hasAlpha ? new MonochromeMask(width, height) : null; + + int nOffsetRead = 0; + if (logicalComponents == 3) + { + for (int y = 0; y < height; ++y) + { + int nOffsetWrite = 3 * y * width; // 3*(height - 1 - y)*width; + int nOffsetWriteAlpha = 0; + if (hasAlpha) + { + mask.StartLine(y); + nOffsetWriteAlpha = y * width; // (height - 1 - y) * width; + } + + for (int x = 0; x < width; ++x) + { + uint pixel = (uint)bitmap.Pixels[nOffsetRead]; + imageData[nOffsetWrite] = (byte)(pixel >> 16); + imageData[nOffsetWrite + 1] = (byte)(pixel >> 8); + imageData[nOffsetWrite + 2] = (byte)(pixel); + if (hasAlpha) + { + byte pel = (byte)(pixel >> 24); + mask.AddPel(pel); + alphaMask[nOffsetWriteAlpha] = pel; + if (!hasMask || !hasAlphaMask) + { + if (pel != 255) + { + hasMask = true; + if (pel != 0) + hasAlphaMask = true; + } + } + ++nOffsetWriteAlpha; + } + //nOffsetRead += hasAlpha ? 4 : components; + ++nOffsetRead; + nOffsetWrite += 3; + } + //nOffsetRead = 4*((nOffsetRead + 3)/4); // Align to 32 bit boundary + } + } + else if (components == 1) + { + // Grayscale + throw new NotImplementedException("Image format not supported (grayscales)."); + } + + FlateDecode fd = new FlateDecode(); + if (hasMask) + { + // monochrome mask is either sufficient or + // provided for compatibility with older reader versions + byte[] maskDataCompressed = fd.Encode(mask.MaskData, _document.Options.FlateEncodeMode); + PdfDictionary pdfMask = new PdfDictionary(_document); + pdfMask.Elements.SetName(Keys.Type, "/XObject"); + pdfMask.Elements.SetName(Keys.Subtype, "/Image"); + + Owner._irefTable.Add(pdfMask); + pdfMask.Stream = new PdfStream(maskDataCompressed, pdfMask); + pdfMask.Elements[Keys.Length] = new PdfInteger(maskDataCompressed.Length); + pdfMask.Elements[Keys.Filter] = new PdfName("/FlateDecode"); + pdfMask.Elements[Keys.Width] = new PdfInteger(width); + pdfMask.Elements[Keys.Height] = new PdfInteger(height); + pdfMask.Elements[Keys.BitsPerComponent] = new PdfInteger(1); + pdfMask.Elements[Keys.ImageMask] = new PdfBoolean(true); + Elements[Keys.Mask] = pdfMask.Reference; + } + if (hasMask && hasAlphaMask && pdfVersion >= 14) + { + // The image provides an alpha mask (requires Arcrobat 5.0 or higher) + byte[] alphaMaskCompressed = fd.Encode(alphaMask, _document.Options.FlateEncodeMode); + PdfDictionary smask = new PdfDictionary(_document); + smask.Elements.SetName(Keys.Type, "/XObject"); + smask.Elements.SetName(Keys.Subtype, "/Image"); + + Owner._irefTable.Add(smask); + smask.Stream = new PdfStream(alphaMaskCompressed, smask); + smask.Elements[Keys.Length] = new PdfInteger(alphaMaskCompressed.Length); + smask.Elements[Keys.Filter] = new PdfName("/FlateDecode"); + smask.Elements[Keys.Width] = new PdfInteger(width); + smask.Elements[Keys.Height] = new PdfInteger(height); + smask.Elements[Keys.BitsPerComponent] = new PdfInteger(8); + smask.Elements[Keys.ColorSpace] = new PdfName("/DeviceGray"); + Elements[Keys.SMask] = smask.Reference; + } + + byte[] imageDataCompressed = fd.Encode(imageData, _document.Options.FlateEncodeMode); + + Stream = new PdfStream(imageDataCompressed, this); + Elements[Keys.Length] = new PdfInteger(imageDataCompressed.Length); + Elements[Keys.Filter] = new PdfName("/FlateDecode"); + Elements[Keys.Width] = new PdfInteger(width); + Elements[Keys.Height] = new PdfInteger(height); + Elements[Keys.BitsPerComponent] = new PdfInteger(8); + // TODO: CMYK + Elements[Keys.ColorSpace] = new PdfName("/DeviceRGB"); + if (_image.Interpolate) + Elements[Keys.Interpolate] = PdfBoolean.True; + } + } +#endif + + /// + /// Gets the underlying XImage object. + /// + public XImage Image + { + get { return _image; } + } + + readonly XImage _image; + + /// + /// Returns 'Image'. + /// + public override string ToString() + { + return "Image"; + } + + /// + /// Creates the keys for a JPEG image. + /// + void InitializeJpeg() + { + // PDF supports JPEG, so there's not much to be done. + MemoryStream memory = null; + // Close the MemoryStream if we create it. + bool ownMemory = false; + + byte[] imageBits = null; + int streamLength = 0; + +#if CORE || GDI || WPF + if (_image._importedImage != null) + { + ImageDataDct idd = (ImageDataDct)_image._importedImage.ImageData; + imageBits = idd.Data; + streamLength = idd.Length; + } +#endif + +#if CORE || GDI + if (_image._importedImage == null) + { + if (!_image._path.StartsWith("*")) + { + // Image does not come from a stream, so we have the path to the file - just use the path. + // If the image was modified in memory, those changes will be lost and the original image, as it was read from the file, will be added to the PDF. + using (FileStream sourceFile = File.OpenRead(_image._path)) + { + int count; + byte[] buffer = new byte[8192]; + memory = new MemoryStream((int)sourceFile.Length); + ownMemory = true; + do + { + count = sourceFile.Read(buffer, 0, buffer.Length); + // memory.Write(buffer, 0, buffer.Length); + memory.Write(buffer, 0, count); + } while (count > 0); + } + } + else + { + memory = new MemoryStream(); + ownMemory = true; + // If we have a stream, copy data from the stream. + if (_image._stream != null && _image._stream.CanSeek) + { + Stream stream = _image._stream; + stream.Seek(0, SeekOrigin.Begin); + byte[] buffer = new byte[32 * 1024]; // 32K buffer. + int bytesRead; + while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) > 0) + { + memory.Write(buffer, 0, bytesRead); + } + } + else + { +#if CORE_WITH_GDI + // No stream, no filename, get image data. + // Save the image to a memory stream. + _image._gdiImage.Save(memory, ImageFormat.Jpeg); +#endif + } + } + + if ((int)memory.Length == 0) + { + Debug.Assert(false, "Internal error? JPEG image, but file not found!"); + } + } +#endif +#if WPF + // AGHACK + //string filename = XImage.GetImageFilename(image._wpfImage); + //if (XImage.ReadJpegFile(filename, -1, ref imageBits)) + //{ + // streamLength = imageBits.Length; + //} + //else + // imageBits = null; +#if !SILVERLIGHT + memory = _image.Memory; +#else + memory = new MemoryStream(); + ownMemory = true; +#endif +#endif +#if NETFX_CORE + memory = new MemoryStream(); + ownMemory = true; +#endif + // THHO4THHO Use ImageImporterJPEG here to avoid redundant code. + + if (imageBits == null) + { + streamLength = (int)memory.Length; + imageBits = new byte[streamLength]; + memory.Seek(0, SeekOrigin.Begin); + memory.Read(imageBits, 0, streamLength); + // ReSharper disable once ConditionIsAlwaysTrueOrFalse + if (ownMemory) + { +#if UWP || true + memory.Dispose(); +#else + memory.Close(); +#endif + } + } + + bool tryFlateDecode = _document.Options.UseFlateDecoderForJpegImages == PdfUseFlateDecoderForJpegImages.Automatic; + bool useFlateDecode = _document.Options.UseFlateDecoderForJpegImages == PdfUseFlateDecoderForJpegImages.Always; + + FlateDecode fd = new FlateDecode(); + byte[] imageDataCompressed = (useFlateDecode || tryFlateDecode) ? fd.Encode(imageBits, _document.Options.FlateEncodeMode) : null; + if (useFlateDecode || tryFlateDecode && imageDataCompressed.Length < imageBits.Length) + { + Stream = new PdfStream(imageDataCompressed, this); + Elements[PdfStream.Keys.Length] = new PdfInteger(imageDataCompressed.Length); + PdfArray arrayFilters = new PdfArray(_document); + arrayFilters.Elements.Add(new PdfName("/FlateDecode")); + arrayFilters.Elements.Add(new PdfName("/DCTDecode")); + Elements[PdfStream.Keys.Filter] = arrayFilters; + } + else + { + Stream = new PdfStream(imageBits, this); + Elements[PdfStream.Keys.Length] = new PdfInteger(streamLength); + Elements[PdfStream.Keys.Filter] = new PdfName("/DCTDecode"); + } + if (_image.Interpolate) + Elements[Keys.Interpolate] = PdfBoolean.True; + Elements[Keys.Width] = new PdfInteger(_image.PixelWidth); + Elements[Keys.Height] = new PdfInteger(_image.PixelHeight); + Elements[Keys.BitsPerComponent] = new PdfInteger(8); + +#if CORE || GDI || WPF + if (_image._importedImage != null) + { + if (_image._importedImage.Information.ImageFormat == ImageInformation.ImageFormats.JPEGCMYK || + _image._importedImage.Information.ImageFormat == ImageInformation.ImageFormats.JPEGRGBW) + { + // TODO: Test with CMYK JPEG files (so far I only found ImageFlags.ColorSpaceYcck JPEG files ...) + Elements[Keys.ColorSpace] = new PdfName("/DeviceCMYK"); + if (_image._importedImage.Information.ImageFormat == ImageInformation.ImageFormats.JPEGRGBW) + Elements["/Decode"] = new PdfLiteral("[1 0 1 0 1 0 1 0]"); // Invert colors from RGBW to CMYK. + } + else if (_image._importedImage.Information.ImageFormat == ImageInformation.ImageFormats.JPEGGRAY) + { + Elements[Keys.ColorSpace] = new PdfName("/DeviceGray"); + } + else + { + Elements[Keys.ColorSpace] = new PdfName("/DeviceRGB"); + } + } +#endif +#if CORE_WITH_GDI + if (_image._importedImage == null) + { + if ((_image._gdiImage.Flags & ((int)ImageFlags.ColorSpaceCmyk | (int)ImageFlags.ColorSpaceYcck)) != 0) + { + // TODO: Test with CMYK JPEG files (so far I only found ImageFlags.ColorSpaceYcck JPEG files ...) + Elements[Keys.ColorSpace] = new PdfName("/DeviceCMYK"); + if ((_image._gdiImage.Flags & (int)ImageFlags.ColorSpaceYcck) != 0) + Elements["/Decode"] = new PdfLiteral("[1 0 1 0 1 0 1 0]"); // Invert colors? Why?? + } + else if ((_image._gdiImage.Flags & (int)ImageFlags.ColorSpaceGray) != 0) + { + Elements[Keys.ColorSpace] = new PdfName("/DeviceGray"); + } + else + { + Elements[Keys.ColorSpace] = new PdfName("/DeviceRGB"); + } + } +#endif +#if GDI + if (_image._importedImage == null) + { + if ((_image._gdiImage.Flags & ((int)ImageFlags.ColorSpaceCmyk | (int)ImageFlags.ColorSpaceYcck)) != 0) + { + // TODO: Test with CMYK JPEG files (so far I only found ImageFlags.ColorSpaceYcck JPEG files ...) + Elements[Keys.ColorSpace] = new PdfName("/DeviceCMYK"); + if ((_image._gdiImage.Flags & (int)ImageFlags.ColorSpaceYcck) != 0) + Elements["/Decode"] = new PdfLiteral("[1 0 1 0 1 0 1 0]"); // Invert colors? Why?? + } + else if ((_image._gdiImage.Flags & (int)ImageFlags.ColorSpaceGray) != 0) + { + Elements[Keys.ColorSpace] = new PdfName("/DeviceGray"); + } + else + { + Elements[Keys.ColorSpace] = new PdfName("/DeviceRGB"); + } + } +#endif +#if WPF + // TODOSILVERLIGHT +#if !SILVERLIGHT + string pixelFormat = _image._wpfImage.Format.ToString(); +#else + string pixelFormat = "xxx"; +#endif + bool isCmyk = _image.IsCmyk; + bool isGrey = pixelFormat == "Gray8"; + if (isCmyk) + { + // TODO: Test with CMYK JPEG files (so far I only found ImageFlags.ColorSpaceYcck JPEG files ...) + Elements[Keys.ColorSpace] = new PdfName("/DeviceCMYK"); + Elements["/Decode"] = new PdfLiteral("[1 0 1 0 1 0 1 0]"); // Invert colors? Why?? + } + else if (isGrey) + { + Elements[Keys.ColorSpace] = new PdfName("/DeviceGray"); + } + else + { + Elements[Keys.ColorSpace] = new PdfName("/DeviceRGB"); + } +#endif + } + + /// + /// Creates the keys for a FLATE image. + /// + void InitializeNonJpeg() + { +#if CORE || GDI || WPF + if (_image._importedImage != null) + { + switch (_image._importedImage.Information.ImageFormat) + { + case ImageInformation.ImageFormats.RGB24: + CreateTrueColorMemoryBitmap(3, 8, false); + break; + + case ImageInformation.ImageFormats.Palette8: + CreateIndexedMemoryBitmap(8); + break; + + case ImageInformation.ImageFormats.Palette4: + CreateIndexedMemoryBitmap(4); + break; + + case ImageInformation.ImageFormats.Palette1: + CreateIndexedMemoryBitmap(1); + break; + + default: + throw new NotImplementedException("Image format not supported."); + } + return; + } +#endif + +#if (CORE_WITH_GDI || GDI) && !WPF + switch (_image._gdiImage.PixelFormat) + { + case PixelFormat.Format24bppRgb: + ReadTrueColorMemoryBitmap(3, 8, false); + break; + + case PixelFormat.Format32bppRgb: + ReadTrueColorMemoryBitmap(4, 8, false); + break; + + case PixelFormat.Format32bppArgb: + case PixelFormat.Format32bppPArgb: + ReadTrueColorMemoryBitmap(3, 8, true); + break; + + case PixelFormat.Format8bppIndexed: + ReadIndexedMemoryBitmap(8); + break; + + case PixelFormat.Format4bppIndexed: + ReadIndexedMemoryBitmap(4); + break; + + case PixelFormat.Format1bppIndexed: + ReadIndexedMemoryBitmap(1); + break; + + default: +#if DEBUGxxx + image.image.Save("$$$.bmp", ImageFormat.Bmp); +#endif + throw new NotImplementedException("Image format not supported."); + } +#endif +#if WPF // && !GDI +#if !SILVERLIGHT + string format = _image._wpfImage.Format.ToString(); +#else + string format = "Bgr24"; +#endif + switch (format) + { + case "Bgr24": //Format24bppRgb: + ReadTrueColorMemoryBitmap(3, 8, false); + break; + + //case .PixelFormat.Format32bppRgb: + // ReadTrueColorMemoryBitmap(4, 8, false); + // break; + + case "Bgra32": //PixelFormat.Format32bppArgb: + //case PixelFormat.Format32bppPArgb: + ReadTrueColorMemoryBitmap(3, 8, true); + break; + + case "Bgr32": + ReadTrueColorMemoryBitmap(4, 8, false); + break; + + case "Pbgra32": + ReadTrueColorMemoryBitmap(3, 8, true); + break; + + case "Indexed8": //Format8bppIndexed: + case "Gray8": + ReadIndexedMemoryBitmap(8); + break; + + case "Indexed4": //Format4bppIndexed: + case "Gray4": + ReadIndexedMemoryBitmap(4); + break; + + case "Indexed2": + ReadIndexedMemoryBitmap(2); + break; + + case "Indexed1": //Format1bppIndexed: + case "BlackWhite": //Format1bppIndexed: + ReadIndexedMemoryBitmap(1); + break; + + default: +#if DEBUGxxx + image.image.Save("$$$.bmp", ImageFormat.Bmp); +#endif + throw new NotImplementedException("Image format \"" + format + "\" not supported."); + } +#endif + } + +#if CORE || GDI || WPF + private void CreateIndexedMemoryBitmap(int bits) + { + ImageDataBitmap idb = (ImageDataBitmap)_image._importedImage.ImageData; + ImageInformation ii = _image._importedImage.Information; + + int pdfVersion = Owner.Version; + int firstMaskColor = -1, lastMaskColor = -1; + bool segmentedColorMask = idb.SegmentedColorMask; + + { + + FlateDecode fd = new FlateDecode(); + if (firstMaskColor != -1 && + lastMaskColor != -1) + { + // Color mask requires Reader 4.0 or higher. + if (!segmentedColorMask && pdfVersion >= 13 && !idb.IsGray) + { + PdfArray array = new PdfArray(_document); + array.Elements.Add(new PdfInteger(firstMaskColor)); + array.Elements.Add(new PdfInteger(lastMaskColor)); + Elements[Keys.Mask] = array; + } + else + { + // Monochrome mask. + byte[] maskDataCompressed = fd.Encode(idb.BitmapMask, _document.Options.FlateEncodeMode); + PdfDictionary pdfMask = new PdfDictionary(_document); + pdfMask.Elements.SetName(Keys.Type, "/XObject"); + pdfMask.Elements.SetName(Keys.Subtype, "/Image"); + + Owner._irefTable.Add(pdfMask); + pdfMask.Stream = new PdfStream(maskDataCompressed, pdfMask); + pdfMask.Elements[PdfStream.Keys.Length] = new PdfInteger(maskDataCompressed.Length); + pdfMask.Elements[PdfStream.Keys.Filter] = new PdfName("/FlateDecode"); + pdfMask.Elements[Keys.Width] = new PdfInteger((int)ii.Width); + pdfMask.Elements[Keys.Height] = new PdfInteger((int)ii.Height); + pdfMask.Elements[Keys.BitsPerComponent] = new PdfInteger(1); + pdfMask.Elements[Keys.ImageMask] = new PdfBoolean(true); + Elements[Keys.Mask] = pdfMask.Reference; + } + } + + byte[] imageDataCompressed = fd.Encode(idb.Data, _document.Options.FlateEncodeMode); + byte[] imageDataFaxCompressed = idb.DataFax != null ? fd.Encode(idb.DataFax, _document.Options.FlateEncodeMode) : null; + + bool usesCcittEncoding = false; + if (idb.DataFax != null && + (idb.LengthFax < imageDataCompressed.Length || + imageDataFaxCompressed.Length < imageDataCompressed.Length)) + { + // /CCITTFaxDecode creates the smaller file (with or without /FlateDecode). + usesCcittEncoding = true; + + if (idb.LengthFax < imageDataCompressed.Length) + { + Stream = new PdfStream(idb.DataFax, this); + Elements[PdfStream.Keys.Length] = new PdfInteger(idb.LengthFax); + Elements[PdfStream.Keys.Filter] = new PdfName("/CCITTFaxDecode"); + PdfDictionary dictionary = new PdfDictionary(); + if (idb.K != 0) + dictionary.Elements.Add("/K", new PdfInteger(idb.K)); + if (idb.IsBitonal < 0) + dictionary.Elements.Add("/BlackIs1", new PdfBoolean(true)); + dictionary.Elements.Add("/EndOfBlock", new PdfBoolean(false)); + dictionary.Elements.Add("/Columns", new PdfInteger((int)ii.Width)); + dictionary.Elements.Add("/Rows", new PdfInteger((int)ii.Height)); + Elements[PdfStream.Keys.DecodeParms] = dictionary; + } + else + { + Stream = new PdfStream(imageDataFaxCompressed, this); + Elements[PdfStream.Keys.Length] = new PdfInteger(imageDataFaxCompressed.Length); + PdfArray arrayFilters = new PdfArray(_document); + arrayFilters.Elements.Add(new PdfName("/FlateDecode")); + arrayFilters.Elements.Add(new PdfName("/CCITTFaxDecode")); + Elements[PdfStream.Keys.Filter] = arrayFilters; + PdfArray arrayDecodeParms = new PdfArray(_document); + + PdfDictionary dictFlateDecodeParms = new PdfDictionary(); + + PdfDictionary dictCcittFaxDecodeParms = new PdfDictionary(); + if (idb.K != 0) + dictCcittFaxDecodeParms.Elements.Add("/K", new PdfInteger(idb.K)); + if (idb.IsBitonal < 0) + dictCcittFaxDecodeParms.Elements.Add("/BlackIs1", new PdfBoolean(true)); + dictCcittFaxDecodeParms.Elements.Add("/EndOfBlock", new PdfBoolean(false)); + dictCcittFaxDecodeParms.Elements.Add("/Columns", new PdfInteger((int)ii.Width)); + dictCcittFaxDecodeParms.Elements.Add("/Rows", new PdfInteger((int)ii.Height)); + + arrayDecodeParms.Elements.Add(dictFlateDecodeParms); // How to add the "null object"? + arrayDecodeParms.Elements.Add(dictCcittFaxDecodeParms); + Elements[PdfStream.Keys.DecodeParms] = arrayDecodeParms; + } + } + else + { + // /FlateDecode creates the smaller file (or no monochrome bitmap). + Stream = new PdfStream(imageDataCompressed, this); + Elements[PdfStream.Keys.Length] = new PdfInteger(imageDataCompressed.Length); + Elements[PdfStream.Keys.Filter] = new PdfName("/FlateDecode"); + } + + Elements[Keys.Width] = new PdfInteger((int)ii.Width); + Elements[Keys.Height] = new PdfInteger((int)ii.Height); + Elements[Keys.BitsPerComponent] = new PdfInteger(bits); + // TODO: CMYK + + // CCITT encoding: we need color palette for isBitonal == 0. + // FlateDecode: we need color palette for isBitonal <= 0 unless we have grayscales. + if ((usesCcittEncoding && idb.IsBitonal == 0) || + (!usesCcittEncoding && idb.IsBitonal <= 0 && !idb.IsGray)) + { + PdfDictionary colorPalette = null; + colorPalette = new PdfDictionary(_document); + byte[] packedPaletteData = idb.PaletteDataLength >= 48 ? fd.Encode(idb.PaletteData, _document.Options.FlateEncodeMode) : null; // don't compress small palettes + if (packedPaletteData != null && packedPaletteData.Length + 20 < idb.PaletteDataLength) // +20: compensate for the overhead (estimated value) + { + // Create compressed color palette. + colorPalette.CreateStream(packedPaletteData); + colorPalette.Elements[PdfStream.Keys.Length] = new PdfInteger(packedPaletteData.Length); + colorPalette.Elements[PdfStream.Keys.Filter] = new PdfName("/FlateDecode"); + } + else + { + // Create uncompressed color palette. + colorPalette.CreateStream(idb.PaletteData); + colorPalette.Elements[PdfStream.Keys.Length] = new PdfInteger(idb.PaletteDataLength); + } + Owner._irefTable.Add(colorPalette); + + PdfArray arrayColorSpace = new PdfArray(_document); + arrayColorSpace.Elements.Add(new PdfName("/Indexed")); + arrayColorSpace.Elements.Add(new PdfName("/DeviceRGB")); + arrayColorSpace.Elements.Add(new PdfInteger((int)ii.ColorsUsed - 1)); + arrayColorSpace.Elements.Add(colorPalette.Reference); + Elements[Keys.ColorSpace] = arrayColorSpace; + } + else + { + Elements[Keys.ColorSpace] = new PdfName("/DeviceGray"); + } + if (_image.Interpolate) + Elements[Keys.Interpolate] = PdfBoolean.True; + } + } + + private void CreateTrueColorMemoryBitmap(int components, int bits, bool hasAlpha) + { + int pdfVersion = Owner.Version; + FlateDecode fd = new FlateDecode(); + ImageDataBitmap idb = (ImageDataBitmap)_image._importedImage.ImageData; + ImageInformation ii = _image._importedImage.Information; + bool hasMask = idb.AlphaMaskLength > 0 || idb.BitmapMaskLength > 0; + bool hasAlphaMask = idb.AlphaMaskLength > 0; + + if (hasMask) + { + // Monochrome mask is either sufficient or + // provided for compatibility with older reader versions. + byte[] maskDataCompressed = fd.Encode(idb.BitmapMask, _document.Options.FlateEncodeMode); + PdfDictionary pdfMask = new PdfDictionary(_document); + pdfMask.Elements.SetName(Keys.Type, "/XObject"); + pdfMask.Elements.SetName(Keys.Subtype, "/Image"); + + Owner._irefTable.Add(pdfMask); + pdfMask.Stream = new PdfStream(maskDataCompressed, pdfMask); + pdfMask.Elements[PdfStream.Keys.Length] = new PdfInteger(maskDataCompressed.Length); + pdfMask.Elements[PdfStream.Keys.Filter] = new PdfName("/FlateDecode"); + pdfMask.Elements[Keys.Width] = new PdfInteger((int)ii.Width); + pdfMask.Elements[Keys.Height] = new PdfInteger((int)ii.Height); + pdfMask.Elements[Keys.BitsPerComponent] = new PdfInteger(1); + pdfMask.Elements[Keys.ImageMask] = new PdfBoolean(true); + Elements[Keys.Mask] = pdfMask.Reference; + } + if (hasMask && hasAlphaMask && pdfVersion >= 14) + { + // The image provides an alpha mask (requires Arcrobat 5.0 or higher). + byte[] alphaMaskCompressed = fd.Encode(idb.AlphaMask, _document.Options.FlateEncodeMode); + PdfDictionary smask = new PdfDictionary(_document); + smask.Elements.SetName(Keys.Type, "/XObject"); + smask.Elements.SetName(Keys.Subtype, "/Image"); + + Owner._irefTable.Add(smask); + smask.Stream = new PdfStream(alphaMaskCompressed, smask); + smask.Elements[PdfStream.Keys.Length] = new PdfInteger(alphaMaskCompressed.Length); + smask.Elements[PdfStream.Keys.Filter] = new PdfName("/FlateDecode"); + smask.Elements[Keys.Width] = new PdfInteger((int)ii.Width); + smask.Elements[Keys.Height] = new PdfInteger((int)ii.Height); + smask.Elements[Keys.BitsPerComponent] = new PdfInteger(8); + smask.Elements[Keys.ColorSpace] = new PdfName("/DeviceGray"); + Elements[Keys.SMask] = smask.Reference; + } + + byte[] imageDataCompressed = fd.Encode(idb.Data, _document.Options.FlateEncodeMode); + + Stream = new PdfStream(imageDataCompressed, this); + Elements[PdfStream.Keys.Length] = new PdfInteger(imageDataCompressed.Length); + Elements[PdfStream.Keys.Filter] = new PdfName("/FlateDecode"); + Elements[Keys.Width] = new PdfInteger((int)ii.Width); + Elements[Keys.Height] = new PdfInteger((int)ii.Height); + Elements[Keys.BitsPerComponent] = new PdfInteger(8); + // TODO: CMYK + Elements[Keys.ColorSpace] = new PdfName("/DeviceRGB"); + if (_image.Interpolate) + Elements[Keys.Interpolate] = PdfBoolean.True; + } +#endif + + private static int ReadWord(byte[] ab, int offset) + { + return ab[offset] + 256 * ab[offset + 1]; + } + + private static int ReadDWord(byte[] ab, int offset) + { + return ReadWord(ab, offset) + 0x10000 * ReadWord(ab, offset + 2); + } + + /// + /// Reads images that are returned from GDI+ without color palette. + /// + /// 4 (32bpp RGB), 3 (24bpp RGB, 32bpp ARGB) + /// 8 + /// true (ARGB), false (RGB) + private void ReadTrueColorMemoryBitmap(int components, int bits, bool hasAlpha) + { +#if DEBUG_ + image.image.Save("$$$.bmp", ImageFormat.Bmp); +#endif + int pdfVersion = Owner.Version; + MemoryStream memory = new MemoryStream(); +#if CORE_WITH_GDI + _image._gdiImage.Save(memory, ImageFormat.Bmp); +#endif +#if GDI + _image._gdiImage.Save(memory, ImageFormat.Bmp); +#endif +#if WPF +#if !SILVERLIGHT + BmpBitmapEncoder encoder = new BmpBitmapEncoder(); + encoder.Frames.Add(BitmapFrame.Create(_image._wpfImage)); + encoder.Save(memory); +#else + // AGHACK + GetType(); +#endif +#endif + // THHO4THHO Use ImageImporterBMP here to avoid redundant code. + + int streamLength = (int)memory.Length; + Debug.Assert(streamLength > 0, "Bitmap image encoding failed."); + if (streamLength > 0) + { +#if !NETFX_CORE && !UWP + // THHO4STLA: available with wrt, but not with wrt81. + // Note: imageBits.Length can be larger than streamLength. Do not use these extra bytes! + byte[] imageBits = memory.GetBuffer(); +#elif NETFX_CORE + byte[] imageBits = new byte[streamLength]; + memory.Seek(0, SeekOrigin.Begin); + memory.Read(imageBits, 0, streamLength); + memory.Close(); +#elif UWP + byte[] imageBits = new byte[streamLength]; + memory.Seek(0, SeekOrigin.Begin); + memory.Read(imageBits, 0, streamLength); + memory.Dispose(); +#endif + + int height = _image.PixelHeight; + int width = _image.PixelWidth; + + // TODO: we could define structures for + // BITMAPFILEHEADER + // { BITMAPINFO } + // BITMAPINFOHEADER + // to avoid ReadWord and ReadDWord ... (but w/o pointers this doesn't help much) + + if (ReadWord(imageBits, 0) != 0x4d42 || // "BM" + ReadDWord(imageBits, 2) != streamLength || + ReadDWord(imageBits, 14) != 40 || // sizeof BITMAPINFOHEADER + ReadDWord(imageBits, 18) != width || + ReadDWord(imageBits, 22) != height) + { + throw new NotImplementedException("ReadTrueColorMemoryBitmap: unsupported format"); + } + if (ReadWord(imageBits, 26) != 1 || + (!hasAlpha && ReadWord(imageBits, 28) != components * bits || + hasAlpha && ReadWord(imageBits, 28) != (components + 1) * bits) || + ReadDWord(imageBits, 30) != 0) + { + throw new NotImplementedException("ReadTrueColorMemoryBitmap: unsupported format #2"); + } + + int nFileOffset = ReadDWord(imageBits, 10); + int logicalComponents = components; + if (components == 4) + logicalComponents = 3; + + byte[] imageData = new byte[components * width * height]; + + bool hasMask = false; + bool hasAlphaMask = false; + byte[] alphaMask = hasAlpha ? new byte[width * height] : null; + MonochromeMask mask = hasAlpha ? + new MonochromeMask(width, height) : null; + + int nOffsetRead = 0; + if (logicalComponents == 3) + { + for (int y = 0; y < height; ++y) + { + int nOffsetWrite = 3 * (height - 1 - y) * width; + int nOffsetWriteAlpha = 0; + if (hasAlpha) + { + mask.StartLine(y); + nOffsetWriteAlpha = (height - 1 - y) * width; + } + + for (int x = 0; x < width; ++x) + { + imageData[nOffsetWrite] = imageBits[nFileOffset + nOffsetRead + 2]; + imageData[nOffsetWrite + 1] = imageBits[nFileOffset + nOffsetRead + 1]; + imageData[nOffsetWrite + 2] = imageBits[nFileOffset + nOffsetRead]; + if (hasAlpha) + { + mask.AddPel(imageBits[nFileOffset + nOffsetRead + 3]); + alphaMask[nOffsetWriteAlpha] = imageBits[nFileOffset + nOffsetRead + 3]; + if (!hasMask || !hasAlphaMask) + { + if (imageBits[nFileOffset + nOffsetRead + 3] != 255) + { + hasMask = true; + if (imageBits[nFileOffset + nOffsetRead + 3] != 0) + hasAlphaMask = true; + } + } + ++nOffsetWriteAlpha; + } + nOffsetRead += hasAlpha ? 4 : components; + nOffsetWrite += 3; + } + nOffsetRead = 4 * ((nOffsetRead + 3) / 4); // Align to 32 bit boundary + } + } + else if (components == 1) + { + // Grayscale + throw new NotImplementedException("Image format not supported (grayscales)."); + } + + FlateDecode fd = new FlateDecode(); + if (hasMask) + { + // Monochrome mask is either sufficient or + // provided for compatibility with older reader versions. + byte[] maskDataCompressed = fd.Encode(mask.MaskData, _document.Options.FlateEncodeMode); + PdfDictionary pdfMask = new PdfDictionary(_document); + pdfMask.Elements.SetName(Keys.Type, "/XObject"); + pdfMask.Elements.SetName(Keys.Subtype, "/Image"); + + Owner._irefTable.Add(pdfMask); + pdfMask.Stream = new PdfStream(maskDataCompressed, pdfMask); + pdfMask.Elements[PdfStream.Keys.Length] = new PdfInteger(maskDataCompressed.Length); + pdfMask.Elements[PdfStream.Keys.Filter] = new PdfName("/FlateDecode"); + pdfMask.Elements[Keys.Width] = new PdfInteger(width); + pdfMask.Elements[Keys.Height] = new PdfInteger(height); + pdfMask.Elements[Keys.BitsPerComponent] = new PdfInteger(1); + pdfMask.Elements[Keys.ImageMask] = new PdfBoolean(true); + Elements[Keys.Mask] = pdfMask.Reference; + } + if (hasMask && hasAlphaMask && pdfVersion >= 14) + { + // The image provides an alpha mask (requires Arcrobat 5.0 or higher). + byte[] alphaMaskCompressed = fd.Encode(alphaMask, _document.Options.FlateEncodeMode); + PdfDictionary smask = new PdfDictionary(_document); + smask.Elements.SetName(Keys.Type, "/XObject"); + smask.Elements.SetName(Keys.Subtype, "/Image"); + + Owner._irefTable.Add(smask); + smask.Stream = new PdfStream(alphaMaskCompressed, smask); + smask.Elements[PdfStream.Keys.Length] = new PdfInteger(alphaMaskCompressed.Length); + smask.Elements[PdfStream.Keys.Filter] = new PdfName("/FlateDecode"); + smask.Elements[Keys.Width] = new PdfInteger(width); + smask.Elements[Keys.Height] = new PdfInteger(height); + smask.Elements[Keys.BitsPerComponent] = new PdfInteger(8); + smask.Elements[Keys.ColorSpace] = new PdfName("/DeviceGray"); + Elements[Keys.SMask] = smask.Reference; + } + + byte[] imageDataCompressed = fd.Encode(imageData, _document.Options.FlateEncodeMode); + + Stream = new PdfStream(imageDataCompressed, this); + Elements[PdfStream.Keys.Length] = new PdfInteger(imageDataCompressed.Length); + Elements[PdfStream.Keys.Filter] = new PdfName("/FlateDecode"); + Elements[Keys.Width] = new PdfInteger(width); + Elements[Keys.Height] = new PdfInteger(height); + Elements[Keys.BitsPerComponent] = new PdfInteger(8); + // TODO: CMYK + Elements[Keys.ColorSpace] = new PdfName("/DeviceRGB"); + if (_image.Interpolate) + Elements[Keys.Interpolate] = PdfBoolean.True; + } + } + + /* BITMAPINFOHEADER struct and byte offsets: + typedef struct tagBITMAPINFOHEADER{ + DWORD biSize; // 14 + LONG biWidth; // 18 + LONG biHeight; // 22 + WORD biPlanes; // 26 + WORD biBitCount; // 28 + DWORD biCompression; // 30 + DWORD biSizeImage; // 34 + LONG biXPelsPerMeter; // 38 + LONG biYPelsPerMeter; // 42 + DWORD biClrUsed; // 46 + DWORD biClrImportant; // 50 + } BITMAPINFOHEADER, *PBITMAPINFOHEADER; + */ + + private void ReadIndexedMemoryBitmap(int bits) + { + int pdfVersion = Owner.Version; + int firstMaskColor = -1, lastMaskColor = -1; + bool segmentedColorMask = false; + + MemoryStream memory = new MemoryStream(); +#if CORE_WITH_GDI + _image._gdiImage.Save(memory, ImageFormat.Bmp); +#endif +#if GDI + _image._gdiImage.Save(memory, ImageFormat.Bmp); +#endif +#if WPF +#if !SILVERLIGHT + BmpBitmapEncoder encoder = new BmpBitmapEncoder(); + //if (!_image._path.StartsWith("*")) + // encoder.Frames.Add(BitmapFrame.Create(new Uri(_image._path), BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.OnLoad)); + //else + encoder.Frames.Add(BitmapFrame.Create(_image._wpfImage)); + encoder.Save(memory); +#else + // AGHACK + GetType(); +#endif +#endif + // THHO4THHO Use ImageImporterBMP here to avoid redundant code. + + int streamLength = (int)memory.Length; + Debug.Assert(streamLength > 0, "Bitmap image encoding failed."); + if (streamLength > 0) + { + byte[] imageBits = new byte[streamLength]; + memory.Seek(0, SeekOrigin.Begin); + memory.Read(imageBits, 0, streamLength); +#if !UWP + memory.Close(); +#else + memory.Dispose(); +#endif + + int height = _image.PixelHeight; + int width = _image.PixelWidth; + + if (ReadWord(imageBits, 0) != 0x4d42 || // "BM" + ReadDWord(imageBits, 2) != streamLength || + ReadDWord(imageBits, 14) != 40 || // sizeof BITMAPINFOHEADER +#if WPF + // TODOWPF: bug with height and width??? With which files??? + ReadDWord(imageBits, 18) != width || + ReadDWord(imageBits, 22) != height) +#else + ReadDWord(imageBits, 18) != width || + ReadDWord(imageBits, 22) != height) +#endif + { + throw new NotImplementedException("ReadIndexedMemoryBitmap: unsupported format"); + } +#if WPF + // TODOWPF: bug with height and width + width = ReadDWord(imageBits, 18); + height = ReadDWord(imageBits, 22); +#endif + int fileBits = ReadWord(imageBits, 28); + if (fileBits != bits) + { + if (fileBits == 1 || fileBits == 4 || fileBits == 8) + bits = fileBits; + } + + if (ReadWord(imageBits, 26) != 1 || + ReadWord(imageBits, 28) != bits || + ReadDWord(imageBits, 30) != 0) + { + throw new NotImplementedException("ReadIndexedMemoryBitmap: unsupported format #2"); + } + + int bytesFileOffset = ReadDWord(imageBits, 10); + const int bytesColorPaletteOffset = 0x36; // GDI+ always returns Windows bitmaps: sizeof BITMAPFILEHEADER + sizeof BITMAPINFOHEADER + int paletteColors = ReadDWord(imageBits, 46); + if ((bytesFileOffset - bytesColorPaletteOffset) / 4 != paletteColors) + { + throw new NotImplementedException("ReadIndexedMemoryBitmap: unsupported format #3"); + } + + MonochromeMask mask = new MonochromeMask(width, height); + + bool isGray = bits == 8 && (paletteColors == 256 || paletteColors == 0); + int isBitonal = 0; // 0: false; >0: true; <0: true (inverted). + byte[] paletteData = new byte[3 * paletteColors]; + for (int color = 0; color < paletteColors; ++color) + { + paletteData[3 * color] = imageBits[bytesColorPaletteOffset + 4 * color + 2]; + paletteData[3 * color + 1] = imageBits[bytesColorPaletteOffset + 4 * color + 1]; + paletteData[3 * color + 2] = imageBits[bytesColorPaletteOffset + 4 * color + 0]; + if (isGray) + isGray = paletteData[3 * color] == paletteData[3 * color + 1] && + paletteData[3 * color] == paletteData[3 * color + 2]; + + if (imageBits[bytesColorPaletteOffset + 4 * color + 3] < 128) + { + // We treat this as transparency. + if (firstMaskColor == -1) + firstMaskColor = color; + if (lastMaskColor == -1 || lastMaskColor == color - 1) + lastMaskColor = color; + if (lastMaskColor != color) + segmentedColorMask = true; + } + //else + //{ + // // We treat this as opacity. + //} + } + + if (bits == 1) + { + if (paletteColors == 0) + isBitonal = 1; + if (paletteColors == 2) + { + if (paletteData[0] == 0 && + paletteData[1] == 0 && + paletteData[2] == 0 && + paletteData[3] == 255 && + paletteData[4] == 255 && + paletteData[5] == 255) + isBitonal = 1; // Black on white + if (paletteData[5] == 0 && + paletteData[4] == 0 && + paletteData[3] == 0 && + paletteData[2] == 255 && + paletteData[1] == 255 && + paletteData[0] == 255) + isBitonal = -1; // White on black + } + } + + bool hasMask = firstMaskColor != -1 && lastMaskColor != -1; + + // NYI: (no sample found where this was required) + // if (segmentedColorMask = true) + // { ... } + + bool isFaxEncoding = false; + byte[] imageData = new byte[((width * bits + 7) / 8) * height]; + byte[] imageDataFax = null; + int k = 0; + + // If fax encoding is allowed, try if fax encoding reduces the size. + if (bits == 1 && _document.Options.EnableCcittCompressionForBilevelImages) + { + // TODO: flag/option? + // We try Group 3 1D and Group 4 (2D) encoding here and keep the smaller byte array. + //byte[] temp = new byte[imageData.Length]; + //int ccittSize = DoFaxEncoding(ref temp, imageBits, (uint)bytesFileOffset, (uint)width, (uint)height); + + // It seems that Group 3 2D encoding never beats both other encodings, therefore we don't call it here. + //byte[] temp2D = new byte[imageData.Length]; + //uint dpiY = (uint)image.VerticalResolution; + //uint kTmp = 0; + //int ccittSize2D = DoFaxEncoding2D((uint)bytesFileOffset, ref temp2D, imageBits, (uint)width, (uint)height, dpiY, out kTmp); + //k = (int) kTmp; + + byte[] tempG4 = new byte[imageData.Length]; + int ccittSizeG4 = DoFaxEncodingGroup4(ref tempG4, imageBits, (uint)bytesFileOffset, (uint)width, (uint)height); + + isFaxEncoding = /*ccittSize > 0 ||*/ ccittSizeG4 > 0; + if (isFaxEncoding) + { + //if (ccittSize == 0) + // ccittSize = 0x7fffffff; + if (ccittSizeG4 == 0) + ccittSizeG4 = 0x7fffffff; + //if (ccittSize <= ccittSizeG4) + //{ + // Array.Resize(ref temp, ccittSize); + // imageDataFax = temp; + // k = 0; + //} + //else + { + Array.Resize(ref tempG4, ccittSizeG4); + imageDataFax = tempG4; + k = -1; + } + } + } + + //if (hasMask) + { + int bytesOffsetRead = 0; + if (bits == 8 || bits == 4 || bits == 1) + { + int bytesPerLine = (width * bits + 7) / 8; + for (int y = 0; y < height; ++y) + { + mask.StartLine(y); + int bytesOffsetWrite = (height - 1 - y) * ((width * bits + 7) / 8); + for (int x = 0; x < bytesPerLine; ++x) + { + if (isGray) + { + // Lookup the gray value from the palette: + imageData[bytesOffsetWrite] = paletteData[3 * imageBits[bytesFileOffset + bytesOffsetRead]]; + } + else + { + // Store the palette index. + imageData[bytesOffsetWrite] = imageBits[bytesFileOffset + bytesOffsetRead]; + } + if (firstMaskColor != -1) + { + int n = imageBits[bytesFileOffset + bytesOffsetRead]; + if (bits == 8) + { + // TODO???: segmentedColorMask == true => bad mask NYI + mask.AddPel((n >= firstMaskColor) && (n <= lastMaskColor)); + } + else if (bits == 4) + { + // TODO???: segmentedColorMask == true => bad mask NYI + int n1 = (n & 0xf0) / 16; + int n2 = (n & 0x0f); + mask.AddPel((n1 >= firstMaskColor) && (n1 <= lastMaskColor)); + mask.AddPel((n2 >= firstMaskColor) && (n2 <= lastMaskColor)); + } + else if (bits == 1) + { + // TODO???: segmentedColorMask == true => bad mask NYI + for (int bit = 1; bit <= 8; ++bit) + { + int n1 = (n & 0x80) / 128; + mask.AddPel((n1 >= firstMaskColor) && (n1 <= lastMaskColor)); + n *= 2; + } + } + } + bytesOffsetRead += 1; + bytesOffsetWrite += 1; + } + bytesOffsetRead = 4 * ((bytesOffsetRead + 3) / 4); // Align to 32 bit boundary. + } + } + else + { + throw new NotImplementedException("ReadIndexedMemoryBitmap: unsupported format #3"); + } + } + + FlateDecode fd = new FlateDecode(); + if (hasMask) + { + // Color mask requires Reader 4.0 or higher. + if (!segmentedColorMask && pdfVersion >= 13 && !isGray) + { + PdfArray array = new PdfArray(_document); + array.Elements.Add(new PdfInteger(firstMaskColor)); + array.Elements.Add(new PdfInteger(lastMaskColor)); + Elements[Keys.Mask] = array; + } + else + { + // Monochrome mask. + byte[] maskDataCompressed = fd.Encode(mask.MaskData, _document.Options.FlateEncodeMode); + PdfDictionary pdfMask = new PdfDictionary(_document); + pdfMask.Elements.SetName(Keys.Type, "/XObject"); + pdfMask.Elements.SetName(Keys.Subtype, "/Image"); + + Owner._irefTable.Add(pdfMask); + pdfMask.Stream = new PdfStream(maskDataCompressed, pdfMask); + pdfMask.Elements[PdfStream.Keys.Length] = new PdfInteger(maskDataCompressed.Length); + pdfMask.Elements[PdfStream.Keys.Filter] = new PdfName("/FlateDecode"); + pdfMask.Elements[Keys.Width] = new PdfInteger(width); + pdfMask.Elements[Keys.Height] = new PdfInteger(height); + pdfMask.Elements[Keys.BitsPerComponent] = new PdfInteger(1); + pdfMask.Elements[Keys.ImageMask] = new PdfBoolean(true); + Elements[Keys.Mask] = pdfMask.Reference; + } + } + + byte[] imageDataCompressed = fd.Encode(imageData, _document.Options.FlateEncodeMode); + byte[] imageDataFaxCompressed = isFaxEncoding ? fd.Encode(imageDataFax, _document.Options.FlateEncodeMode) : null; + + bool usesCcittEncoding = false; + if (isFaxEncoding && + (imageDataFax.Length < imageDataCompressed.Length || + imageDataFaxCompressed.Length < imageDataCompressed.Length)) + { + // /CCITTFaxDecode creates the smaller file (with or without /FlateDecode). + usesCcittEncoding = true; + + if (imageDataFax.Length < imageDataCompressed.Length) + { + Stream = new PdfStream(imageDataFax, this); + Elements[PdfStream.Keys.Length] = new PdfInteger(imageDataFax.Length); + Elements[PdfStream.Keys.Filter] = new PdfName("/CCITTFaxDecode"); + PdfDictionary dictionary = new PdfDictionary(); + if (k != 0) + dictionary.Elements.Add("/K", new PdfInteger(k)); + if (isBitonal < 0) + dictionary.Elements.Add("/BlackIs1", new PdfBoolean(true)); + dictionary.Elements.Add("/EndOfBlock", new PdfBoolean(false)); + dictionary.Elements.Add("/Columns", new PdfInteger(width)); + dictionary.Elements.Add("/Rows", new PdfInteger(height)); + //array2.Elements.Add(dictionary); + Elements[PdfStream.Keys.DecodeParms] = dictionary; // array2; + } + else + { + Stream = new PdfStream(imageDataFaxCompressed, this); + Elements[PdfStream.Keys.Length] = new PdfInteger(imageDataFaxCompressed.Length); + PdfArray arrayFilters = new PdfArray(_document); + arrayFilters.Elements.Add(new PdfName("/FlateDecode")); + arrayFilters.Elements.Add(new PdfName("/CCITTFaxDecode")); + Elements[PdfStream.Keys.Filter] = arrayFilters; + PdfArray arrayDecodeParms = new PdfArray(_document); + + PdfDictionary dictFlateDecodeParms = new PdfDictionary(); + + PdfDictionary dictCcittFaxDecodeParms = new PdfDictionary(); + if (k != 0) + dictCcittFaxDecodeParms.Elements.Add("/K", new PdfInteger(k)); + if (isBitonal < 0) + dictCcittFaxDecodeParms.Elements.Add("/BlackIs1", new PdfBoolean(true)); + dictCcittFaxDecodeParms.Elements.Add("/EndOfBlock", new PdfBoolean(false)); + dictCcittFaxDecodeParms.Elements.Add("/Columns", new PdfInteger(width)); + dictCcittFaxDecodeParms.Elements.Add("/Rows", new PdfInteger(height)); + + arrayDecodeParms.Elements.Add(dictFlateDecodeParms); // How to add the "null object"? + arrayDecodeParms.Elements.Add(dictCcittFaxDecodeParms); + Elements[PdfStream.Keys.DecodeParms] = arrayDecodeParms; + } + } + else + { + // /FlateDecode creates the smaller file (or no monochrome bitmap). + Stream = new PdfStream(imageDataCompressed, this); + Elements[PdfStream.Keys.Length] = new PdfInteger(imageDataCompressed.Length); + Elements[PdfStream.Keys.Filter] = new PdfName("/FlateDecode"); + } + + Elements[Keys.Width] = new PdfInteger(width); + Elements[Keys.Height] = new PdfInteger(height); + Elements[Keys.BitsPerComponent] = new PdfInteger(bits); + // TODO: CMYK + + // CCITT encoding: we need color palette for isBitonal == 0. + // FlateDecode: we need color palette for isBitonal <= 0 unless we have grayscales. + if ((usesCcittEncoding && isBitonal == 0) || + (!usesCcittEncoding && isBitonal <= 0 && !isGray)) + { + PdfDictionary colorPalette = null; + colorPalette = new PdfDictionary(_document); + byte[] packedPaletteData = paletteData.Length >= 48 ? fd.Encode(paletteData, _document.Options.FlateEncodeMode) : null; // don't compress small palettes + if (packedPaletteData != null && packedPaletteData.Length + 20 < paletteData.Length) // +20: compensate for the overhead (estimated value) + { + // Create compressed color palette. + colorPalette.CreateStream(packedPaletteData); + colorPalette.Elements[PdfStream.Keys.Length] = new PdfInteger(packedPaletteData.Length); + colorPalette.Elements[PdfStream.Keys.Filter] = new PdfName("/FlateDecode"); + } + else + { + // Create uncompressed color palette. + colorPalette.CreateStream(paletteData); + colorPalette.Elements[PdfStream.Keys.Length] = new PdfInteger(paletteData.Length); + } + Owner._irefTable.Add(colorPalette); + + PdfArray arrayColorSpace = new PdfArray(_document); + arrayColorSpace.Elements.Add(new PdfName("/Indexed")); + arrayColorSpace.Elements.Add(new PdfName("/DeviceRGB")); + arrayColorSpace.Elements.Add(new PdfInteger(paletteColors - 1)); + arrayColorSpace.Elements.Add(colorPalette.Reference); + Elements[Keys.ColorSpace] = arrayColorSpace; + } + else + { + Elements[Keys.ColorSpace] = new PdfName("/DeviceGray"); + } + if (_image.Interpolate) + Elements[Keys.Interpolate] = PdfBoolean.True; + } + } + + /// + /// Common keys for all streams. + /// + public sealed new class Keys : PdfXObject.Keys + { + // ReSharper disable InconsistentNaming + + /// + /// (Optional) The type of PDF object that this dictionary describes; + /// if present, must be XObject for an image XObject. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string Type = "/Type"; + + /// + /// (Required) The type of XObject that this dictionary describes; + /// must be Image for an image XObject. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string Subtype = "/Subtype"; + + /// + /// (Required) The width of the image, in samples. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string Width = "/Width"; + + /// + /// (Required) The height of the image, in samples. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string Height = "/Height"; + + /// + /// (Required for images, except those that use the JPXDecode filter; not allowed for image masks) + /// The color space in which image samples are specified; it can be any type of color space except + /// Pattern. If the image uses the JPXDecode filter, this entry is optional: + /// If ColorSpace is present, any color space specifications in the JPEG2000 data are ignored. + /// If ColorSpace is absent, the color space specifications in the JPEG2000 data are used. + /// The Decode array is also ignored unless ImageMask is true. + /// + [KeyInfo(KeyType.NameOrArray | KeyType.Required)] + public const string ColorSpace = "/ColorSpace"; + + /// + /// (Required except for image masks and images that use the JPXDecode filter) + /// The number of bits used to represent each color component. Only a single value may be specified; + /// the number of bits is the same for all color components. Valid values are 1, 2, 4, 8, and + /// (in PDF 1.5) 16. If ImageMask is true, this entry is optional, and if specified, its value + /// must be 1. + /// If the image stream uses a filter, the value of BitsPerComponent must be consistent with the + /// size of the data samples that the filter delivers. In particular, a CCITTFaxDecode or JBIG2Decode + /// filter always delivers 1-bit samples, a RunLengthDecode or DCTDecode filter delivers 8-bit samples, + /// and an LZWDecode or FlateDecode filter delivers samples of a specified size if a predictor function + /// is used. + /// If the image stream uses the JPXDecode filter, this entry is optional and ignored if present. + /// The bit depth is determined in the process of decoding the JPEG2000 image. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string BitsPerComponent = "/BitsPerComponent"; + + /// + /// (Optional; PDF 1.1) The name of a color rendering intent to be used in rendering the image. + /// Default value: the current rendering intent in the graphics state. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string Intent = "/Intent"; + + /// + /// (Optional) A flag indicating whether the image is to be treated as an image mask. + /// If this flag is true, the value of BitsPerComponent must be 1 and Mask and ColorSpace should + /// not be specified; unmasked areas are painted using the current nonstroking color. + /// Default value: false. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string ImageMask = "/ImageMask"; + + /// + /// (Optional except for image masks; not allowed for image masks; PDF 1.3) + /// An image XObject defining an image mask to be applied to this image, or an array specifying + /// a range of colors to be applied to it as a color key mask. If ImageMask is true, this entry + /// must not be present. + /// + [KeyInfo(KeyType.StreamOrArray | KeyType.Optional)] + public const string Mask = "/Mask"; + + /// + /// (Optional) An array of numbers describing how to map image samples into the range of values + /// appropriate for the images color space. If ImageMask is true, the array must be either + /// [0 1] or [1 0]; otherwise, its length must be twice the number of color components required + /// by ColorSpace. If the image uses the JPXDecode filter and ImageMask is false, Decode is ignored. + /// Default value: see Decode Arrays. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string Decode = "/Decode"; + + /// + /// (Optional) A flag indicating whether image interpolation is to be performed. + /// Default value: false. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string Interpolate = "/Interpolate"; + + /// + /// (Optional; PDF 1.3) An array of alternate image dictionaries for this image. The order of + /// elements within the array has no significance. This entry may not be present in an image + /// XObject that is itself an alternate image. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string Alternates = "/Alternates"; + + /// + /// (Optional; PDF 1.4) A subsidiary image XObject defining a soft-mask image to be used as a + /// source of mask shape or mask opacity values in the transparent imaging model. The alpha + /// source parameter in the graphics state determines whether the mask values are interpreted as + /// shape or opacity. If present, this entry overrides the current soft mask in the graphics state, + /// as well as the images Mask entry, if any. (However, the other transparency related graphics + /// state parameters blend mode and alpha constant remain in effect.) If SMask is absent, the + /// image has no associated soft mask (although the current soft mask in the graphics state may + /// still apply). + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string SMask = "/SMask"; + + /// + /// (Optional for images that use the JPXDecode filter, meaningless otherwise; PDF 1.5) + /// A code specifying how soft-mask information encoded with image samples should be used: + /// 0 If present, encoded soft-mask image information should be ignored. + /// 1 The images data stream includes encoded soft-mask values. An application can create + /// a soft-mask image from the information to be used as a source of mask shape or mask + /// opacity in the transparency imaging model. + /// 2 The images data stream includes color channels that have been preblended with a + /// background; the image data also includes an opacity channel. An application can create + /// a soft-mask image with a Matte entry from the opacity channel information to be used as + /// a source of mask shape or mask opacity in the transparency model. If this entry has a + /// nonzero value, SMask should not be specified. + /// Default value: 0. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string SMaskInData = "/SMaskInData"; + + /// + /// (Required in PDF 1.0; optional otherwise) The name by which this image XObject is + /// referenced in the XObject subdictionary of the current resource dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string Name = "/Name"; + + /// + /// (Required if the image is a structural content item; PDF 1.3) The integer key of the + /// images entry in the structural parent tree. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string StructParent = "/StructParent"; + + /// + /// (Optional; PDF 1.3; indirect reference preferred) The digital identifier of the images + /// parent Web Capture content set. + /// + [KeyInfo(KeyType.String | KeyType.Optional)] + public const string ID = "/ID"; + + /// + /// (Optional; PDF 1.2) An OPI version dictionary for the image. If ImageMask is true, + /// this entry is ignored. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional)] + public const string OPI = "/OPI"; + + /// + /// (Optional; PDF 1.4) A metadata stream containing metadata for the image. + /// + [KeyInfo(KeyType.Stream | KeyType.Optional)] + public const string Metadata = "/Metadata"; + + /// + /// (Optional; PDF 1.5) An optional content group or optional content membership dictionary, + /// specifying the optional content properties for this image XObject. Before the image is + /// processed, its visibility is determined based on this entry. If it is determined to be + /// invisible, the entire image is skipped, as if there were no Do operator to invoke it. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional)] + public const string OC = "/OC"; + + // ReSharper restore InconsistentNaming + } + } + + /// + /// Helper class for creating bitmap masks (8 pels per byte). + /// + class MonochromeMask + { + /// + /// Returns the bitmap mask that will be written to PDF. + /// + public byte[] MaskData + { + get { return _maskData; } + } + private readonly byte[] _maskData; + + /// + /// Creates a bitmap mask. + /// + public MonochromeMask(int sizeX, int sizeY) + { + _sizeX = sizeX; + _sizeY = sizeY; + int byteSize = ((sizeX + 7) / 8) * sizeY; + _maskData = new byte[byteSize]; + StartLine(0); + } + + /// + /// Starts a new line. + /// + public void StartLine(int newCurrentLine) + { + _bitsWritten = 0; + _byteBuffer = 0; + _writeOffset = ((_sizeX + 7) / 8) * (_sizeY - 1 - newCurrentLine); + } + + /// + /// Adds a pel to the current line. + /// + /// + public void AddPel(bool isTransparent) + { + if (_bitsWritten < _sizeX) + { + // Mask: 0: opaque, 1: transparent (default mapping) + if (isTransparent) + _byteBuffer = (_byteBuffer << 1) + 1; + else + _byteBuffer = _byteBuffer << 1; + ++_bitsWritten; + if ((_bitsWritten & 7) == 0) + { + _maskData[_writeOffset] = (byte)_byteBuffer; + ++_writeOffset; + _byteBuffer = 0; + } + else if (_bitsWritten == _sizeX) + { + int n = 8 - (_bitsWritten & 7); + _byteBuffer = _byteBuffer << n; + _maskData[_writeOffset] = (byte)_byteBuffer; + } + } + } + + /// + /// Adds a pel from an alpha mask value. + /// + public void AddPel(int shade) + { + // NYI: dithering. + AddPel(shade < 128); + } + + private readonly int _sizeX; + private readonly int _sizeY; + private int _writeOffset; + private int _byteBuffer; + private int _bitsWritten; + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfImageTable.cs b/PdfSharp/Pdf.Advanced/PdfImageTable.cs new file mode 100644 index 0000000..6e9a6d3 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfImageTable.cs @@ -0,0 +1,117 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Collections.Generic; +using System.Globalization; +using PdfSharp.Drawing; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Contains all used images of a document. + /// + internal sealed class PdfImageTable : PdfResourceTable + { + /// + /// Initializes a new instance of this class, which is a singleton for each document. + /// + public PdfImageTable(PdfDocument document) + : base(document) + { } + + /// + /// Gets a PdfImage from an XImage. If no PdfImage already exists, a new one is created. + /// + public PdfImage GetImage(XImage image) + { + ImageSelector selector = image._selector; + if (selector == null) + { + selector = new ImageSelector(image); + image._selector = selector; + } + PdfImage pdfImage; + if (!_images.TryGetValue(selector, out pdfImage)) + { + pdfImage = new PdfImage(Owner, image); + //pdfImage.Document = _document; + Debug.Assert(pdfImage.Owner == Owner); + _images[selector] = pdfImage; + } + return pdfImage; + } + + /// + /// Map from ImageSelector to PdfImage. + /// + readonly Dictionary _images = new Dictionary(); + + /// + /// A collection of information that uniquely identifies a particular PdfImage. + /// + public class ImageSelector + { + /// + /// Initializes a new instance of ImageSelector from an XImage. + /// + public ImageSelector(XImage image) + { + // HACK: implement a way to identify images when they are reused + // TODO 4STLA Implementation that calculates MD5 hashes for images generated for the images can be found here: http://forum.pdfsharp.net/viewtopic.php?p=6959#p6959 + if (image._path == null) + image._path = "*" + Guid.NewGuid().ToString("B"); + + // HACK: just use full path to identify + _path = image._path.ToLowerInvariant(); + } + + public string Path + { + get { return _path; } + set { _path = value; } + } + string _path; + + public override bool Equals(object obj) + { + ImageSelector selector = obj as ImageSelector; + if (selector == null) + return false; + return _path == selector._path; + } + + public override int GetHashCode() + { + return _path.GetHashCode(); + } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfImportedObjectTable.cs b/PdfSharp/Pdf.Advanced/PdfImportedObjectTable.cs new file mode 100644 index 0000000..90a646a --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfImportedObjectTable.cs @@ -0,0 +1,117 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents the imported objects of an external document. Used to cache objects that are + /// already imported when a PdfFormXObject is added to a page. + /// + internal sealed class PdfImportedObjectTable + { + /// + /// Initializes a new instance of this class with the document the objects are imported from. + /// + public PdfImportedObjectTable(PdfDocument owner, PdfDocument externalDocument) + { + if (owner == null) + throw new ArgumentNullException("owner"); + if (externalDocument == null) + throw new ArgumentNullException("externalDocument"); + _owner = owner; + _externalDocumentHandle = externalDocument.Handle; + _xObjects = new PdfFormXObject[externalDocument.PageCount]; + } + readonly PdfFormXObject[] _xObjects; + + /// + /// Gets the document this table belongs to. + /// + public PdfDocument Owner + { + get { return _owner; } + } + readonly PdfDocument _owner; + + /// + /// Gets the external document, or null, if the external document is garbage collected. + /// + public PdfDocument ExternalDocument + { + get { return _externalDocumentHandle.IsAlive ? _externalDocumentHandle.Target : null; } + } + readonly PdfDocument.DocumentHandle _externalDocumentHandle; + + public PdfFormXObject GetXObject(int pageNumber) + { + return _xObjects[pageNumber - 1]; + } + + public void SetXObject(int pageNumber, PdfFormXObject xObject) + { + _xObjects[pageNumber - 1] = xObject; + } + + /// + /// Indicates whether the specified object is already imported. + /// + public bool Contains(PdfObjectID externalID) + { + return _externalIDs.ContainsKey(externalID.ToString()); + } + + /// + /// Adds a cloned object to this table. + /// + /// The object identifier in the foreign object. + /// The cross reference to the clone of the foreign object, which belongs to + /// this document. In general the clone has a different object identifier. + public void Add(PdfObjectID externalID, PdfReference iref) + { + _externalIDs[externalID.ToString()] = iref; + } + + /// + /// Gets the cloned object that corresponds to the specified external identifier. + /// + public PdfReference this[PdfObjectID externalID] + { + get { return _externalIDs[externalID.ToString()]; } + } + + /// + /// Maps external object identifiers to cross reference entries of the importing document + /// {PdfObjectID -> PdfReference}. + /// + readonly Dictionary _externalIDs = new Dictionary(); + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfInternals.cs b/PdfSharp/Pdf.Advanced/PdfInternals.cs new file mode 100644 index 0000000..0a69dd6 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfInternals.cs @@ -0,0 +1,298 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Reflection; +using System.Text; +using System.IO; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Provides access to the internal document data structures. This class prevents the public + /// interfaces from pollution with to much internal functions. + /// + public class PdfInternals // TODO: PdfDocumentInternals... PdfPageInterals etc. + { + internal PdfInternals(PdfDocument document) + { + _document = document; + } + readonly PdfDocument _document; + + /// + /// Gets or sets the first document identifier. + /// + public string FirstDocumentID + { + get { return _document._trailer.GetDocumentID(0); } + set { _document._trailer.SetDocumentID(0, value); } + } + + /// + /// Gets the first document identifier as GUID. + /// + public Guid FirstDocumentGuid + { + get { return GuidFromString(_document._trailer.GetDocumentID(0)); } + } + + /// + /// Gets or sets the second document identifier. + /// + public string SecondDocumentID + { + get { return _document._trailer.GetDocumentID(1); } + set { _document._trailer.SetDocumentID(1, value); } + } + + /// + /// Gets the first document identifier as GUID. + /// + public Guid SecondDocumentGuid + { + get { return GuidFromString(_document._trailer.GetDocumentID(0)); } + } + + Guid GuidFromString(string id) + { + if (id == null || id.Length != 16) + return Guid.Empty; + + StringBuilder guid = new StringBuilder(); + for (int idx = 0; idx < 16; idx++) + guid.AppendFormat("{0:X2}", (byte)id[idx]); + + return new Guid(guid.ToString()); + } + + /// + /// Gets the catalog dictionary. + /// + public PdfCatalog Catalog + { + get { return _document.Catalog; } + } + + /// + /// Gets the ExtGStateTable object. + /// + public PdfExtGStateTable ExtGStateTable + { + get { return _document.ExtGStateTable; } + } + + /// + /// Returns the object with the specified Identifier, or null, if no such object exists. + /// + public PdfObject GetObject(PdfObjectID objectID) + { + return _document._irefTable[objectID].Value; + } + + /// + /// Maps the specified external object to the substitute object in this document. + /// Returns null if no such object exists. + /// + public PdfObject MapExternalObject(PdfObject externalObject) + { + PdfFormXObjectTable table = _document.FormTable; + PdfImportedObjectTable iot = table.GetImportedObjectTable(externalObject.Owner); + PdfReference reference = iot[externalObject.ObjectID]; + return reference == null ? null : reference.Value; + } + + /// + /// Returns the PdfReference of the specified object, or null, if the object is not in the + /// document's object table. + /// + public static PdfReference GetReference(PdfObject obj) + { + if (obj == null) + throw new ArgumentNullException("obj"); + return obj.Reference; + } + + /// + /// Gets the object identifier of the specified object. + /// + public static PdfObjectID GetObjectID(PdfObject obj) + { + if (obj == null) + throw new ArgumentNullException("obj"); + return obj.ObjectID; + } + + /// + /// Gets the object number of the specified object. + /// + public static int GetObjectNumber(PdfObject obj) + { + if (obj == null) + throw new ArgumentNullException("obj"); + return obj.ObjectNumber; + } + + /// + /// Gets the generation number of the specified object. + /// + public static int GenerationNumber(PdfObject obj) + { + if (obj == null) + throw new ArgumentNullException("obj"); + return obj.GenerationNumber; + } + + /// + /// Gets all indirect objects ordered by their object identifier. + /// + public PdfObject[] GetAllObjects() + { + PdfReference[] irefs = _document._irefTable.AllReferences; + int count = irefs.Length; + PdfObject[] objects = new PdfObject[count]; + for (int idx = 0; idx < count; idx++) + objects[idx] = irefs[idx].Value; + return objects; + } + + /// + /// Gets all indirect objects ordered by their object identifier. + /// + [Obsolete("Use GetAllObjects.")] // Properties should not return arrays + public PdfObject[] AllObjects + { + get { return GetAllObjects(); } + } + + /// + /// Creates the indirect object of the specified type, adds it to the document, + /// and returns the object. + /// + public T CreateIndirectObject() where T : PdfObject + { +#if true + T obj = Activator.CreateInstance(); + _document._irefTable.Add(obj); +#else + T result = null; +#if !NETFX_CORE && !UWP + ConstructorInfo ctorInfo = typeof(T).GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.ExactBinding, + null, new Type[] { typeof(PdfDocument) }, null); +#else + ConstructorInfo ctorInfo = null; // TODO +#endif + if (ctorInfo != null) + { + result = (T)ctorInfo.Invoke(new object[] { _document }); + Debug.Assert(result != null); + AddObject(result); + } + Debug.Assert(result != null, "CreateIndirectObject failed with type " + typeof(T).FullName); +#endif + return obj; + } + + /// + /// Adds an object to the PDF document. This operation and only this operation makes the object + /// an indirect object owned by this document. + /// + public void AddObject(PdfObject obj) + { + if (obj == null) + throw new ArgumentNullException("obj"); + if (obj.Owner == null) + obj.Document = _document; + else if (obj.Owner != _document) + throw new InvalidOperationException("Object does not belong to this document."); + _document._irefTable.Add(obj); + } + + /// + /// Removes an object from the PDF document. + /// + public void RemoveObject(PdfObject obj) + { + if (obj == null) + throw new ArgumentNullException("obj"); + if (obj.Reference == null) + throw new InvalidOperationException("Only indirect objects can be removed."); + if (obj.Owner != _document) + throw new InvalidOperationException("Object does not belong to this document."); + + _document._irefTable.Remove(obj.Reference); + } + + /// + /// Returns an array containing the specified object as first element follows by its transitive + /// closure. The closure of an object are all objects that can be reached by indirect references. + /// The transitive closure is the result of applying the calculation of the closure to a closure + /// as long as no new objects came along. This is e.g. useful for getting all objects belonging + /// to the resources of a page. + /// + public PdfObject[] GetClosure(PdfObject obj) + { + return GetClosure(obj, Int32.MaxValue); + } + + /// + /// Returns an array containing the specified object as first element follows by its transitive + /// closure limited by the specified number of iterations. + /// + public PdfObject[] GetClosure(PdfObject obj, int depth) + { + PdfReference[] references = _document._irefTable.TransitiveClosure(obj, depth); + int count = references.Length + 1; + PdfObject[] objects = new PdfObject[count]; + objects[0] = obj; + for (int idx = 1; idx < count; idx++) + objects[idx] = references[idx - 1].Value; + return objects; + } + + /// + /// Writes a PdfItem into the specified stream. + /// + // This function exists to keep PdfWriter and PdfItem.WriteObject internal. + public void WriteObject(Stream stream, PdfItem item) + { + // Never write an encrypted object + PdfWriter writer = new PdfWriter(stream, null); + writer.Options = PdfWriterOptions.OmitStream; + item.WriteObject(writer); + } + + /// + /// The name of the custom value key. + /// + public string CustomValueKey = "/PdfSharp.CustomValue"; + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfObjectInternals.cs b/PdfSharp/Pdf.Advanced/PdfObjectInternals.cs new file mode 100644 index 0000000..3dbd1b0 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfObjectInternals.cs @@ -0,0 +1,84 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Provides access to the internal PDF object data structures. This class prevents the public + /// interfaces from pollution with to much internal functions. + /// + public class PdfObjectInternals + { + internal PdfObjectInternals(PdfObject obj) + { + _obj = obj; + } + readonly PdfObject _obj; + + /// + /// Gets the object identifier. Returns PdfObjectID.Empty for direct objects. + /// + public PdfObjectID ObjectID + { + get { return _obj.ObjectID; } + } + + /// + /// Gets the object number. + /// + public int ObjectNumber + { + get { return _obj.ObjectID.ObjectNumber; } + } + + /// + /// Gets the generation number. + /// + public int GenerationNumber + { + get { return _obj.ObjectID.GenerationNumber; } + } + + /// + /// Gets the name of the current type. + /// Not a very useful property, but can be used for data binding. + /// + public string TypeID + { + get + { + if (_obj is PdfArray) + return "array"; + if (_obj is PdfDictionary) + return "dictionary"; + return _obj.GetType().Name; + } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfObjectStream.cs b/PdfSharp/Pdf.Advanced/PdfObjectStream.cs new file mode 100644 index 0000000..7f4f0b7 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfObjectStream.cs @@ -0,0 +1,173 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.IO; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents an object stream that contains compressed objects. + /// PDF 1.5. + /// + public class PdfObjectStream : PdfDictionary + { + // Reference: 3.4.6 Object Streams / Page 100 + + /// + /// Initializes a new instance of the class. + /// + public PdfObjectStream(PdfDocument document) + : base(document) + { +#if DEBUG && CORE + if (Internal.PdfDiagnostics.TraceObjectStreams) + { + Debug.WriteLine("PdfObjectStream(document) created."); + } +#endif + } + + /// + /// Initializes a new instance from an existing dictionary. Used for object type transformation. + /// + internal PdfObjectStream(PdfDictionary dict) + : base(dict) + { + int n = Elements.GetInteger(Keys.N); + int first = Elements.GetInteger(Keys.First); + Stream.TryUnfilter(); + + Parser parser = new Parser(null, new MemoryStream(Stream.Value)); + _header = parser.ReadObjectStreamHeader(n, first); + +#if DEBUG && CORE + if (Internal.PdfDiagnostics.TraceObjectStreams) + { + Debug.WriteLine(String.Format("PdfObjectStream(document) created. Header item count: {0}", _header.GetLength(0))); + } +#endif + } + + /// + /// Reads the compressed object with the specified index. + /// + internal void ReadReferences(PdfCrossReferenceTable xrefTable) + { + ////// Create parser for stream. + ////Parser parser = new Parser(_document, new MemoryStream(Stream.Value)); + for (int idx = 0; idx < _header.Length; idx++) + { + int objectNumber = _header[idx][0]; + int offset = _header[idx][1]; + + PdfObjectID objectID = new PdfObjectID(objectNumber); + + // HACK: -1 indicates compressed object. + PdfReference iref = new PdfReference(objectID, -1); + ////iref.ObjectID = objectID; + ////iref.Value = xrefStream; + if (!xrefTable.Contains(iref.ObjectID)) + { + xrefTable.Add(iref); + } + else + { + GetType(); + } + } + } + + /// + /// Reads the compressed object with the specified index. + /// + internal PdfReference ReadCompressedObject(int index) + { + Parser parser = new Parser(_document, new MemoryStream(Stream.Value)); + int objectNumber = _header[index][0]; + int offset = _header[index][1]; + return parser.ReadCompressedObject(objectNumber, offset); + } + + /// + /// N pairs of integers. + /// The first integer represents the object number of the compressed object. + /// The second integer represents the absolute offset of that object in the decoded stream, + /// i.e. the byte offset plus First entry. + /// + private readonly int[][] _header; // Reference: Page 102 + + /// + /// Predefined keys common to all font dictionaries. + /// + public class Keys : PdfStream.Keys + { + // Reference: TABLE 3.14 Additional entries specific to an object stream dictionary / Page 101 + + /// + /// (Required) The type of PDF object that this dictionary describes; + /// must be ObjStmfor an object stream. + /// + [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "ObjStm")] + public const string Type = "/Type"; + + /// + /// (Required) The number of compressed objects in the stream. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string N = "/N"; + + /// + /// (Required) The byte offset (in the decoded stream) of the first + /// compressed object. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string First = "/First"; + + /// + /// (Optional) A reference to an object stream, of which the current object + /// stream is considered an extension. Both streams are considered part of + /// a collection of object streams (see below). A given collection consists + /// of a set of streams whose Extendslinks form a directed acyclic graph. + /// + [KeyInfo(KeyType.Stream | KeyType.Optional)] + public const string Extends = "/Extends"; + } + } + +#if DEBUG && CORE + static class ObjectStreamDiagnostics + { + public static void AddObjectStreamXRef() + { } + } +#endif +} diff --git a/PdfSharp/Pdf.Advanced/PdfPageInheritableObjects.cs b/PdfSharp/Pdf.Advanced/PdfPageInheritableObjects.cs new file mode 100644 index 0000000..1548b24 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfPageInheritableObjects.cs @@ -0,0 +1,73 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a PDF page object. + /// + internal class PdfPageInheritableObjects : PdfDictionary + { + public PdfPageInheritableObjects() + { } + + // TODO Inheritable Resources not yet supported + + /// + /// + /// + public PdfRectangle MediaBox + { + get { return _mediaBox; } + set { _mediaBox = value; } + } + PdfRectangle _mediaBox; + + public PdfRectangle CropBox + { + get { return _cropBox; } + set { _cropBox = value; } + } + PdfRectangle _cropBox; + + public int Rotate + { + get { return _rotate; } + set + { + if (value % 90 != 0) + throw new ArgumentException("The value must be a multiple of 90.", nameof(value)); + _rotate = value; + } + } + int _rotate; + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfPageInterals.cs b/PdfSharp/Pdf.Advanced/PdfPageInterals.cs new file mode 100644 index 0000000..52414db --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfPageInterals.cs @@ -0,0 +1,41 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Advanced +{ +#if true_ // Not yet used. + /// + /// TODO + /// + public static class PdfPageInterals + { + // TODO + } +#endif +} diff --git a/PdfSharp/Pdf.Advanced/PdfReference.cs b/PdfSharp/Pdf.Advanced/PdfReference.cs new file mode 100644 index 0000000..d682c8a --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfReference.cs @@ -0,0 +1,243 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// With this define each iref object gets a unique number (uid) to make them distinguishable in the debugger +#define UNIQUE_IREF_ + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents an indirect reference to a PdfObject. + /// + [DebuggerDisplay("iref({ObjectNumber}, {GenerationNumber})")] + public sealed class PdfReference : PdfItem + { + // About PdfReference + // + // * A PdfReference holds either the ObjectID or the PdfObject or both. + // + // * Each PdfObject has a PdfReference if and only if it is an indirect object. Direct objects have + // no PdfReference, because they are embedded in a parent objects. + // + // * PdfReference objects are used to reference PdfObject instances. A value in a PDF dictionary + // or array that is a PdfReference represents an indirect reference. A value in a PDF dictionary or + // or array that is a PdfObject represents a direct (or embeddded) object. + // + // * When a PDF file is imported, the PdfXRefTable is filled with PdfReference objects keeping the + // ObjectsIDs and file positions (offsets) of all indirect objects. + // + // * Indirect objects can easily be renumbered because they do not rely on their ObjectsIDs. + // + // * During modification of a document the ObjectID of an indirect object has no meaning, + // except that they must be different in pairs. + + /// + /// Initializes a new PdfReference instance for the specified indirect object. + /// + public PdfReference(PdfObject pdfObject) + { + if (pdfObject.Reference != null) + throw new InvalidOperationException("Must not create iref for an object that already has one."); + _value = pdfObject; + pdfObject.Reference = this; +#if UNIQUE_IREF && DEBUG + _uid = ++s_counter; +#endif + } + + /// + /// Initializes a new PdfReference instance from the specified object identifier and file position. + /// + public PdfReference(PdfObjectID objectID, int position) + { + _objectID = objectID; + _position = position; +#if UNIQUE_IREF && DEBUG + _uid = ++s_counter; +#endif + } + + /// + /// Writes the object in PDF iref table format. + /// + internal void WriteXRefEnty(PdfWriter writer) + { + // PDFsharp does not yet support PDF 1.5 object streams. + + // Each line must be exactly 20 bytes long, otherwise Acrobat repairs the file. + string text = String.Format("{0:0000000000} {1:00000} n\n", + _position, _objectID.GenerationNumber); // InUse ? 'n' : 'f'); + writer.WriteRaw(text); + } + + /// + /// Writes an indirect reference. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.Write(this); + } + + /// + /// Gets or sets the object identifier. + /// + public PdfObjectID ObjectID + { + get { return _objectID; } + set + { + // Ignore redundant invokations. + if (_objectID == value) + return; + + _objectID = value; + if (Document != null) + { + //PdfXRefTable table = Document.xrefTable; + //table.Remove(this); + //objectID = value; + //table.Add(this); + } + } + } + PdfObjectID _objectID; + + /// + /// Gets the object number of the object identifier. + /// + public int ObjectNumber + { + get { return _objectID.ObjectNumber; } + } + + /// + /// Gets the generation number of the object identifier. + /// + public int GenerationNumber + { + get { return _objectID.GenerationNumber; } + } + + /// + /// Gets or sets the file position of the related PdfObject. + /// + public int Position + { + get { return _position; } + set { _position = value; } + } + int _position; // I know it should be long, but I have never seen a 2GB PDF file. + + //public bool InUse + //{ + // get {return inUse;} + // set {inUse = value;} + //} + //bool inUse; + + /// + /// Gets or sets the referenced PdfObject. + /// + public PdfObject Value + { + get { return _value; } + set + { + Debug.Assert(value != null, "The value of a PdfReference must never be null."); + Debug.Assert(value.Reference == null || ReferenceEquals(value.Reference, this), "The reference of the value must be null or this."); + _value = value; + // value must never be null + value.Reference = this; + } + } + PdfObject _value; + + /// + /// Hack for dead objects. + /// + internal void SetObject(PdfObject value) + { + _value = value; + } + + /// + /// Gets or sets the document this object belongs to. + /// + public PdfDocument Document + { + get { return _document; } + set { _document = value; } + } + PdfDocument _document; + + /// + /// Gets a string representing the object identifier. + /// + public override string ToString() + { + return _objectID + " R"; + } + + internal static PdfReferenceComparer Comparer + { + get { return new PdfReferenceComparer(); } + } + + /// + /// Implements a comparer that compares PdfReference objects by their PdfObjectID. + /// + internal class PdfReferenceComparer : IComparer + { + public int Compare(PdfReference x, PdfReference y) + { + PdfReference l = x; + PdfReference r = y; + if (l != null) + { + if (r != null) + return l._objectID.CompareTo(r._objectID); + return -1; + } + if (r != null) + return 1; + return 0; + } + } + +#if UNIQUE_IREF && DEBUG + static int s_counter = 0; + int _uid; +#endif + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfResourceMap.cs b/PdfSharp/Pdf.Advanced/PdfResourceMap.cs new file mode 100644 index 0000000..825443e --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfResourceMap.cs @@ -0,0 +1,72 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Base class for all dictionaries that map resource names to objects. + /// + internal class PdfResourceMap : PdfDictionary //, IEnumerable + { + public PdfResourceMap() + { } + + public PdfResourceMap(PdfDocument document) + : base(document) + { } + + protected PdfResourceMap(PdfDictionary dict) + : base(dict) + { } + + // public int Count + // { + // get {return resources.Count;} + // } + // + // public PdfObject this[string key] + // { + // get {return resources[key] as PdfObject;} + // set {resources[key] = value;} + // } + + /// + /// Adds all imported resource names to the specified hashtable. + /// + internal void CollectResourceNames(Dictionary usedResourceNames) + { + // ?TODO: Imported resources (e.g. fonts) can be reused, but I think this is rather difficult. Will be an issue in PDFsharp 2.0. + PdfName[] names = Elements.KeyNames; + foreach (PdfName name in names) + usedResourceNames.Add(name.ToString(), null); + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfResourceTable.cs b/PdfSharp/Pdf.Advanced/PdfResourceTable.cs new file mode 100644 index 0000000..078785a --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfResourceTable.cs @@ -0,0 +1,58 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Base class for FontTable, ImageTable, FormXObjectTable etc. + /// + public class PdfResourceTable + { + /// + /// Base class for document wide resource tables. + /// + public PdfResourceTable(PdfDocument owner) + { + if (owner == null) + throw new ArgumentNullException("owner"); + _owner = owner; + } + + /// + /// Gets the owning document of this resource table. + /// + protected PdfDocument Owner + { + get { return _owner; } + } + readonly PdfDocument _owner; + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfResources.cs b/PdfSharp/Pdf.Advanced/PdfResources.cs new file mode 100644 index 0000000..c4683de --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfResources.cs @@ -0,0 +1,452 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a PDF resource object. + /// + public sealed class PdfResources : PdfDictionary + { + // Resource management works roughly like this: + // When the user creates an XFont and uses it in the XGraphics of a PdfPage, then at the first time + // a PdfFont is created and cached in the document global font table. If the user creates a new + // XFont object for an exisisting PdfFont, the PdfFont object is reused. When the PdfFont is added + // to the resources of a PdfPage for the first time, it is added to the page local PdfResourceMap for + // fonts and automatically associated with a local resource name. + + /// + /// Initializes a new instance of the class. + /// + /// The document. + public PdfResources(PdfDocument document) + : base(document) + { + Elements[Keys.ProcSet] = new PdfLiteral("[/PDF/Text/ImageB/ImageC/ImageI]"); + } + + internal PdfResources(PdfDictionary dict) + : base(dict) + { } + + /// + /// Adds the specified font to this resource dictionary and returns its local resource name. + /// + public string AddFont(PdfFont font) + { + string name; + if (!_resources.TryGetValue(font, out name)) + { + name = NextFontName; + _resources[font] = name; + if (font.Reference == null) + Owner._irefTable.Add(font); + Fonts.Elements[name] = font.Reference; + } + return name; + } + + /// + /// Adds the specified image to this resource dictionary + /// and returns its local resource name. + /// + public string AddImage(PdfImage image) + { + string name; + if (!_resources.TryGetValue(image, out name)) + { + name = NextImageName; + _resources[image] = name; + if (image.Reference == null) + Owner._irefTable.Add(image); + XObjects.Elements[name] = image.Reference; + } + return name; + } + + /// + /// Adds the specified form object to this resource dictionary + /// and returns its local resource name. + /// + public string AddForm(PdfFormXObject form) + { + string name; + if (!_resources.TryGetValue(form, out name)) + { + name = NextFormName; + _resources[form] = name; + if (form.Reference == null) + Owner._irefTable.Add(form); + XObjects.Elements[name] = form.Reference; + } + return name; + } + + /// + /// Adds the specified graphics state to this resource dictionary + /// and returns its local resource name. + /// + public string AddExtGState(PdfExtGState extGState) + { + string name; + if (!_resources.TryGetValue(extGState, out name)) + { + name = NextExtGStateName; + _resources[extGState] = name; + if (extGState.Reference == null) + Owner._irefTable.Add(extGState); + ExtGStates.Elements[name] = extGState.Reference; + } + return name; + } + + /// + /// Adds the specified pattern to this resource dictionary + /// and returns its local resource name. + /// + public string AddPattern(PdfShadingPattern pattern) + { + string name; + if (!_resources.TryGetValue(pattern, out name)) + { + name = NextPatternName; + _resources[pattern] = name; + if (pattern.Reference == null) + Owner._irefTable.Add(pattern); + Patterns.Elements[name] = pattern.Reference; + } + return name; + } + + /// + /// Adds the specified pattern to this resource dictionary + /// and returns its local resource name. + /// + public string AddPattern(PdfTilingPattern pattern) + { + string name; + if (!_resources.TryGetValue(pattern, out name)) + { + name = NextPatternName; + _resources[pattern] = name; + if (pattern.Reference == null) + Owner._irefTable.Add(pattern); + Patterns.Elements[name] = pattern.Reference; + } + return name; + } + + /// + /// Adds the specified shading to this resource dictionary + /// and returns its local resource name. + /// + public string AddShading(PdfShading shading) + { + string name; + if (!_resources.TryGetValue(shading, out name)) + { + name = NextShadingName; + _resources[shading] = name; + if (shading.Reference == null) + Owner._irefTable.Add(shading); + Shadings.Elements[name] = shading.Reference; + } + return name; + } + + /// + /// Gets the fonts map. + /// + internal PdfResourceMap Fonts + { + get { return _fonts ?? (_fonts = (PdfResourceMap)Elements.GetValue(Keys.Font, VCF.Create)); } + } + PdfResourceMap _fonts; + + /// + /// Gets the external objects map. + /// + internal PdfResourceMap XObjects + { + get { return _xObjects ?? (_xObjects = (PdfResourceMap)Elements.GetValue(Keys.XObject, VCF.Create)); } + } + PdfResourceMap _xObjects; + + // TODO: make own class + internal PdfResourceMap ExtGStates + { + get + { + return _extGStates ?? (_extGStates = (PdfResourceMap)Elements.GetValue(Keys.ExtGState, VCF.Create)); + } + } + PdfResourceMap _extGStates; + + // TODO: make own class + internal PdfResourceMap ColorSpaces + { + get { return _colorSpaces ?? (_colorSpaces = (PdfResourceMap)Elements.GetValue(Keys.ColorSpace, VCF.Create)); } + } + PdfResourceMap _colorSpaces; + + // TODO: make own class + internal PdfResourceMap Patterns + { + get { return _patterns ?? (_patterns = (PdfResourceMap) Elements.GetValue(Keys.Pattern, VCF.Create)); } + } + PdfResourceMap _patterns; + + // TODO: make own class + internal PdfResourceMap Shadings + { + get { return _shadings ?? (_shadings = (PdfResourceMap) Elements.GetValue(Keys.Shading, VCF.Create)); } + } + PdfResourceMap _shadings; + + // TODO: make own class + internal PdfResourceMap Properties + { + get {return _properties ?? (_properties = (PdfResourceMap) Elements.GetValue(Keys.Properties, VCF.Create));} + } + PdfResourceMap _properties; + + /// + /// Gets a new local name for this resource. + /// + string NextFontName + { + get + { + string name; + while (ExistsResourceNames(name = string.Format("/F{0}", _fontNumber++))) { } + return name; + } + } + int _fontNumber; + + /// + /// Gets a new local name for this resource. + /// + string NextImageName + { + get + { + string name; + while (ExistsResourceNames(name = string.Format("/I{0}", _imageNumber++))) { } + return name; + } + } + int _imageNumber; + + /// + /// Gets a new local name for this resource. + /// + string NextFormName + { + get + { + string name; + while (ExistsResourceNames(name = string.Format("/Fm{0}", _formNumber++))) { } + return name; + } + } + int _formNumber; + + /// + /// Gets a new local name for this resource. + /// + string NextExtGStateName + { + get + { + string name; + while (ExistsResourceNames(name = string.Format("/GS{0}", _extGStateNumber++))) { } + return name; + } + } + int _extGStateNumber; + + /// + /// Gets a new local name for this resource. + /// + string NextPatternName + { + get + { + string name; + while (ExistsResourceNames(name = string.Format("/Pa{0}", _patternNumber++))) ; + return name; + } + } + int _patternNumber; + + /// + /// Gets a new local name for this resource. + /// + string NextShadingName + { + get + { + string name; + while (ExistsResourceNames(name = string.Format("/Sh{0}", _shadingNumber++))) ; + return name; + } + } + int _shadingNumber; + + /// + /// Check whether a resource name is already used in the context of this resource dictionary. + /// PDF4NET uses GUIDs as resource names, but I think this weapon is to heavy. + /// + internal bool ExistsResourceNames(string name) + { + // TODO: more precise: is this page imported and is PageOptions != Replace + // BUG: + //if (!Owner.IsImported) + // return false; + + // Collect all resouce names of all imported resources. + if (_importedResourceNames == null) + { + _importedResourceNames = new Dictionary(); + + if (Elements[Keys.Font] != null) + Fonts.CollectResourceNames(_importedResourceNames); + + if (Elements[Keys.XObject] != null) + XObjects.CollectResourceNames(_importedResourceNames); + + if (Elements[Keys.ExtGState] != null) + ExtGStates.CollectResourceNames(_importedResourceNames); + + if (Elements[Keys.ColorSpace] != null) + ColorSpaces.CollectResourceNames(_importedResourceNames); + + if (Elements[Keys.Pattern] != null) + Patterns.CollectResourceNames(_importedResourceNames); + + if (Elements[Keys.Shading] != null) + Shadings.CollectResourceNames(_importedResourceNames); + + if (Elements[Keys.Properties] != null) + Properties.CollectResourceNames(_importedResourceNames); + } + return _importedResourceNames.ContainsKey(name); + // This is superfluous because PDFsharp resource names cannot be double. + // importedResourceNames.Add(name, null); + } + + /// + /// All the names of imported resources. + /// + Dictionary _importedResourceNames; + + /// + /// Maps all PDFsharp resources to their local resource names. + /// + readonly Dictionary _resources = new Dictionary(); + + /// + /// Predefined keys of this dictionary. + /// + public sealed class Keys : KeysBase + { + /// + /// (Optional) A dictionary that maps resource names to graphics state + /// parameter dictionaries. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] + public const string ExtGState = "/ExtGState"; + + /// + /// (Optional) A dictionary that maps each resource name to either the name of a + /// device-dependent color space or an array describing a color space. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] + public const string ColorSpace = "/ColorSpace"; + + /// + /// (Optional) A dictionary that maps each resource name to either the name of a + /// device-dependent color space or an array describing a color space. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] + public const string Pattern = "/Pattern"; + + /// + /// (Optional; PDF 1.3) A dictionary that maps resource names to shading dictionaries. + /// + [KeyInfo("1.3", KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] + public const string Shading = "/Shading"; + + /// + /// (Optional) A dictionary that maps resource names to external objects. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] + public const string XObject = "/XObject"; + + /// + /// (Optional) A dictionary that maps resource names to font dictionaries. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] + public const string Font = "/Font"; + + /// + /// (Optional) An array of predefined procedure set names. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string ProcSet = "/ProcSet"; + + /// + /// (Optional; PDF 1.2) A dictionary that maps resource names to property list + /// dictionaries for marked content. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] + public const string Properties = "/Properties"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfShading.cs b/PdfSharp/Pdf.Advanced/PdfShading.cs new file mode 100644 index 0000000..be6ee99 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfShading.cs @@ -0,0 +1,258 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if GDI +using System.Drawing; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows.Media; +#endif +using PdfSharp.Drawing; +using PdfSharp.Drawing.Pdf; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a shading dictionary. + /// + public sealed class PdfShading : PdfDictionary + { + /// + /// Initializes a new instance of the class. + /// + public PdfShading(PdfDocument document) + : base(document) + { } + + /// + /// Setups the shading from the specified brush. + /// + internal void SetupFromBrush(XLinearGradientBrush brush, XGraphicsPdfRenderer renderer) + { + if (brush == null) + throw new ArgumentNullException("brush"); + + PdfColorMode colorMode = _document.Options.ColorMode; + XColor color1 = ColorSpaceHelper.EnsureColorMode(colorMode, brush._color1); + XColor color2 = ColorSpaceHelper.EnsureColorMode(colorMode, brush._color2); + + PdfDictionary function = new PdfDictionary(); + + Elements[Keys.ShadingType] = new PdfInteger(2); + if (colorMode != PdfColorMode.Cmyk) + Elements[Keys.ColorSpace] = new PdfName("/DeviceRGB"); + else + Elements[Keys.ColorSpace] = new PdfName("/DeviceCMYK"); + + double x1 = 0, y1 = 0, x2 = 0, y2 = 0; + if (brush._useRect) + { + XPoint pt1 = renderer.WorldToView(brush._rect.TopLeft); + XPoint pt2 = renderer.WorldToView(brush._rect.BottomRight); + + switch (brush._linearGradientMode) + { + case XLinearGradientMode.Horizontal: + x1 = pt1.X; + y1 = pt1.Y; + x2 = pt2.X; + y2 = pt1.Y; + break; + + case XLinearGradientMode.Vertical: + x1 = pt1.X; + y1 = pt1.Y; + x2 = pt1.X; + y2 = pt2.Y; + break; + + case XLinearGradientMode.ForwardDiagonal: + x1 = pt1.X; + y1 = pt1.Y; + x2 = pt2.X; + y2 = pt2.Y; + break; + + case XLinearGradientMode.BackwardDiagonal: + x1 = pt2.X; + y1 = pt1.Y; + x2 = pt1.X; + y2 = pt2.Y; + break; + } + } + else + { + XPoint pt1 = renderer.WorldToView(brush._point1); + XPoint pt2 = renderer.WorldToView(brush._point2); + + x1 = pt1.X; + y1 = pt1.Y; + x2 = pt2.X; + y2 = pt2.Y; + } + + const string format = Config.SignificantFigures3; + Elements[Keys.Coords] = new PdfLiteral("[{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "}]", x1, y1, x2, y2); + + //Elements[Keys.Background] = new PdfRawItem("[0 1 1]"); + //Elements[Keys.Domain] = + Elements[Keys.Function] = function; + //Elements[Keys.Extend] = new PdfRawItem("[true true]"); + + string clr1 = "[" + PdfEncoders.ToString(color1, colorMode) + "]"; + string clr2 = "[" + PdfEncoders.ToString(color2, colorMode) + "]"; + + function.Elements["/FunctionType"] = new PdfInteger(2); + function.Elements["/C0"] = new PdfLiteral(clr1); + function.Elements["/C1"] = new PdfLiteral(clr2); + function.Elements["/Domain"] = new PdfLiteral("[0 1]"); + function.Elements["/N"] = new PdfInteger(1); + } + + /// + /// Common keys for all streams. + /// + internal sealed class Keys : KeysBase + { + /// + /// (Required) The shading type: + /// 1 Function-based shading + /// 2 Axial shading + /// 3 Radial shading + /// 4 Free-form Gouraud-shaded triangle mesh + /// 5 Lattice-form Gouraud-shaded triangle mesh + /// 6 Coons patch mesh + /// 7 Tensor-product patch mesh + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string ShadingType = "/ShadingType"; + + /// + /// (Required) The color space in which color values are expressed. This may be any device, + /// CIE-based, or special color space except a Pattern space. + /// + [KeyInfo(KeyType.NameOrArray | KeyType.Required)] + public const string ColorSpace = "/ColorSpace"; + + /// + /// (Optional) An array of color components appropriate to the color space, specifying + /// a single background color value. If present, this color is used, before any painting + /// operation involving the shading, to fill those portions of the area to be painted + /// that lie outside the bounds of the shading object. In the opaque imaging model, + /// the effect is as if the painting operation were performed twice: first with the + /// background color and then with the shading. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string Background = "/Background"; + + /// + /// (Optional) An array of four numbers giving the left, bottom, right, and top coordinates, + /// respectively, of the shadings bounding box. The coordinates are interpreted in the + /// shadings target coordinate space. If present, this bounding box is applied as a temporary + /// clipping boundary when the shading is painted, in addition to the current clipping path + /// and any other clipping boundaries in effect at that time. + /// + [KeyInfo(KeyType.Rectangle | KeyType.Optional)] + public const string BBox = "/BBox"; + + /// + /// (Optional) A flag indicating whether to filter the shading function to prevent aliasing + /// artifacts. The shading operators sample shading functions at a rate determined by the + /// resolution of the output device. Aliasing can occur if the function is not smooththat + /// is, if it has a high spatial frequency relative to the sampling rate. Anti-aliasing can + /// be computationally expensive and is usually unnecessary, since most shading functions + /// are smooth enough or are sampled at a high enough frequency to avoid aliasing effects. + /// Anti-aliasing may not be implemented on some output devices, in which case this flag + /// is ignored. + /// Default value: false. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string AntiAlias = "/AntiAlias"; + + // ---- Type 2 ---------------------------------------------------------- + + /// + /// (Required) An array of four numbers [x0 y0 x1 y1] specifying the starting and + /// ending coordinates of the axis, expressed in the shadings target coordinate space. + /// + [KeyInfo(KeyType.Array | KeyType.Required)] + public const string Coords = "/Coords"; + + /// + /// (Optional) An array of two numbers [t0 t1] specifying the limiting values of a + /// parametric variable t. The variable is considered to vary linearly between these + /// two values as the color gradient varies between the starting and ending points of + /// the axis. The variable t becomes the input argument to the color function(s). + /// Default value: [0.0 1.0]. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string Domain = "/Domain"; + + /// + /// (Required) A 1-in, n-out function or an array of n 1-in, 1-out functions (where n + /// is the number of color components in the shading dictionarys color space). The + /// function(s) are called with values of the parametric variable t in the domain defined + /// by the Domain entry. Each functions domain must be a superset of that of the shading + /// dictionary. If the value returned by the function for a given color component is out + /// of range, it is adjusted to the nearest valid value. + /// + [KeyInfo(KeyType.Function | KeyType.Required)] + public const string Function = "/Function"; + + /// + /// (Optional) An array of two boolean values specifying whether to extend the shading + /// beyond the starting and ending points of the axis, respectively. + /// Default value: [false false]. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string Extend = "/Extend"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfShadingPattern.cs b/PdfSharp/Pdf.Advanced/PdfShadingPattern.cs new file mode 100644 index 0000000..f27eba7 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfShadingPattern.cs @@ -0,0 +1,132 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if GDI +using System.Drawing; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows.Media; +#endif +using PdfSharp.Drawing; +using PdfSharp.Drawing.Pdf; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a shading pattern dictionary. + /// + public sealed class PdfShadingPattern : PdfDictionaryWithContentStream + { + /// + /// Initializes a new instance of the class. + /// + public PdfShadingPattern(PdfDocument document) + : base(document) + { + Elements.SetName(Keys.Type, "/Pattern"); + Elements[Keys.PatternType] = new PdfInteger(2); + } + + /// + /// Setups the shading pattern from the specified brush. + /// + internal void SetupFromBrush(XLinearGradientBrush brush, XMatrix matrix, XGraphicsPdfRenderer renderer) + { + if (brush == null) + throw new ArgumentNullException("brush"); + + PdfShading shading = new PdfShading(_document); + shading.SetupFromBrush(brush, renderer); + Elements[Keys.Shading] = shading; + //Elements[Keys.Matrix] = new PdfLiteral("[" + PdfEncoders.ToString(matrix) + "]"); + Elements.SetMatrix(Keys.Matrix, matrix); + } + + /// + /// Common keys for all streams. + /// + internal sealed new class Keys : PdfDictionaryWithContentStream.Keys + { + /// + /// (Optional) The type of PDF object that this dictionary describes; if present, + /// must be Pattern for a pattern dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string Type = "/Type"; + + /// + /// (Required) A code identifying the type of pattern that this dictionary describes; + /// must be 2 for a shading pattern. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string PatternType = "/PatternType"; + + /// + /// (Required) A shading object (see below) defining the shading patterns gradient fill. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required)] + public const string Shading = "/Shading"; + + /// + /// (Optional) An array of six numbers specifying the pattern matrix. + /// Default value: the identity matrix [1 0 0 1 0 0]. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string Matrix = "/Matrix"; + + /// + /// (Optional) A graphics state parameter dictionary containing graphics state parameters + /// to be put into effect temporarily while the shading pattern is painted. Any parameters + /// that are not so specified are inherited from the graphics state that was in effect + /// at the beginning of the content stream in which the pattern is defined as a resource. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional)] + public const string ExtGState = "/ExtGState"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfSoftMask.cs b/PdfSharp/Pdf.Advanced/PdfSoftMask.cs new file mode 100644 index 0000000..6d21230 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfSoftMask.cs @@ -0,0 +1,110 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a PDF soft mask. + /// + public class PdfSoftMask : PdfDictionary + { + /// + /// Initializes a new instance of the class. + /// + /// The document that owns the object. + public PdfSoftMask(PdfDocument document) + : base(document) + { + Elements.SetName(Keys.Type, "/Mask"); + } + + /// + /// Predefined keys of this dictionary. + /// + public class Keys : KeysBase + { + /// + /// (Optional) The type of PDF object that this dictionary describes; + /// if present, must be Mask for a soft-mask dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Optional, FixedValue = "Mask")] + public const string Type = "/Type"; + + /// + /// (Required) A subtype specifying the method to be used in deriving the mask values + /// from the transparency group specified by the G entry: + /// Alpha: Use the groups computed alpha, disregarding its color. + /// Luminosity: Convert the groups computed color to a single-component luminosity value. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string S = "/S"; + + /// + /// (Required) A transparency group XObject to be used as the source of alpha + /// or color values for deriving the mask. If the subtype S is Luminosity, the + /// group attributes dictionary must contain a CS entry defining the color space + /// in which the compositing computation is to be performed. + /// + [KeyInfo(KeyType.Stream | KeyType.Required)] + public const string G = "/G"; + + /// + /// (Optional) An array of component values specifying the color to be used + /// as the backdrop against which to composite the transparency group XObject G. + /// This entry is consulted only if the subtype S is Luminosity. The array consists of + /// n numbers, where n is the number of components in the color space specified + /// by the CS entry in the group attributes dictionary. + /// Default value: the color spaces initial value, representing black. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string BC = "/BC"; + + /// + /// (Optional) A function object specifying the transfer function to be used in + /// deriving the mask values. The function accepts one input, the computed + /// group alpha or luminosity (depending on the value of the subtype S), and + /// returns one output, the resulting mask value. Both the input and output + /// must be in the range 0.0 to 1.0; if the computed output falls outside this + /// range, it is forced to the nearest valid value. The name Identity may be + /// specified in place of a function object to designate the identity function. + /// Default value: Identity. + /// + [KeyInfo(KeyType.FunctionOrName | KeyType.Optional)] + public const string TR = "/TR"; + } + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf.Advanced/PdfTilingPattern.cs b/PdfSharp/Pdf.Advanced/PdfTilingPattern.cs new file mode 100644 index 0000000..48c5dc8 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfTilingPattern.cs @@ -0,0 +1,177 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if GDI +using System.Drawing; +using System.Drawing.Imaging; +#endif +#if WPF +using System.Windows.Media; +#endif + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a tiling pattern dictionary. + /// + public sealed class PdfTilingPattern : PdfDictionaryWithContentStream + { + /// + /// Initializes a new instance of the class. + /// + public PdfTilingPattern(PdfDocument document) + : base(document) + { + Elements.SetName(Keys.Type, "/Pattern"); + Elements[Keys.PatternType] = new PdfInteger(1); + } + + ///// + ///// Setups the shading pattern from the specified brush. + ///// + //public void SetupFromBrush(XLinearGradientBrush brush, XMatrix matrix) + //{ + // if (brush == null) + // throw new ArgumentNullException("brush"); + + // PdfShading shading = new PdfShading(document); + // shading.SetupFromBrush(brush); + // Elements[Keys.Shading] = shading; + // Elements[Keys.Matrix] = new PdfLiteral("[" + PdfEncoders.ToString(matrix) + "]"); + //} + + /// + /// Common keys for all streams. + /// + internal sealed new class Keys : PdfDictionaryWithContentStream.Keys + { + /// + /// (Optional) The type of PDF object that this dictionary describes; if present, + /// must be Pattern for a pattern dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string Type = "/Type"; + + /// + /// (Required) A code identifying the type of pattern that this dictionary describes; + /// must be 1 for a tiling pattern. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string PatternType = "/PatternType"; + + /// + /// (Required) A code that determines how the color of the pattern cell is to be specified: + /// 1: Colored tiling pattern. The patterns content stream specifies the colors used to + /// paint the pattern cell. When the content stream begins execution, the current color + /// is the one that was initially in effect in the patterns parent content stream. + /// 2: Uncolored tiling pattern. The patterns content stream does not specify any color + /// information. Instead, the entire pattern cell is painted with a separately specified color + /// each time the pattern is used. Essentially, the content stream describes a stencil + /// through which the current color is to be poured. The content stream must not invoke + /// operators that specify colors or other color-related parameters in the graphics state; + /// otherwise, an error occurs. The content stream may paint an image mask, however, + /// since it does not specify any color information. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string PaintType = "/PaintType"; + + /// + /// (Required) A code that controls adjustments to the spacing of tiles relative to the device + /// pixel grid: + /// 1: Constant spacing. Pattern cells are spaced consistentlythat is, by a multiple of a + /// device pixel. To achieve this, the application may need to distort the pattern cell slightly + /// by making small adjustments to XStep, YStep, and the transformation matrix. The amount + /// of distortion does not exceed 1 device pixel. + /// 2: No distortion. The pattern cell is not distorted, but the spacing between pattern cells + /// may vary by as much as 1 device pixel, both horizontally and vertically, when the pattern + /// is painted. This achieves the spacing requested by XStep and YStep on average but not + /// necessarily for each individual pattern cell. + /// 3: Constant spacing and faster tiling. Pattern cells are spaced consistently as in tiling + /// type 1 but with additional distortion permitted to enable a more efficient implementation. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string TilingType = "/TilingType"; + + /// + /// (Required) An array of four numbers in the pattern coordinate system giving the + /// coordinates of the left, bottom, right, and top edges, respectively, of the pattern + /// cells bounding box. These boundaries are used to clip the pattern cell. + /// + [KeyInfo(KeyType.Rectangle | KeyType.Optional)] + public const string BBox = "/BBox"; + + /// + /// (Required) The desired horizontal spacing between pattern cells, measured in the + /// pattern coordinate system. + /// + [KeyInfo(KeyType.Real | KeyType.Required)] + public const string XStep = "/XStep"; + + /// + /// (Required) The desired vertical spacing between pattern cells, measured in the pattern + /// coordinate system. Note that XStep and YStep may differ from the dimensions of the + /// pattern cell implied by the BBox entry. This allows tiling with irregularly shaped figures. + /// XStep and YStep may be either positive or negative but not zero. + /// + [KeyInfo(KeyType.Real | KeyType.Required)] + public const string YStep = "/YStep"; + + /// + /// (Required) A resource dictionary containing all of the named resources required by + /// the patterns content stream (see Section 3.7.2, Resource Dictionaries). + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required)] + public new const string Resources = "/Resources"; + + /// + /// (Optional) An array of six numbers specifying the pattern matrix. + /// Default value: the identity matrix [1 0 0 1 0 0]. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string Matrix = "/Matrix"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfToUnicodeMap.cs b/PdfSharp/Pdf.Advanced/PdfToUnicodeMap.cs new file mode 100644 index 0000000..e5946b0 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfToUnicodeMap.cs @@ -0,0 +1,148 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using PdfSharp.Fonts; +using PdfSharp.Pdf.Filters; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a ToUnicode map for composite font. + /// + internal sealed class PdfToUnicodeMap : PdfDictionary + { + public PdfToUnicodeMap(PdfDocument document) + : base(document) + { } + + public PdfToUnicodeMap(PdfDocument document, CMapInfo cmapInfo) + : base(document) + { + _cmapInfo = cmapInfo; + } + + /// + /// Gets or sets the CMap info. + /// + public CMapInfo CMapInfo + { + get { return _cmapInfo; } + set { _cmapInfo = value; } + } + CMapInfo _cmapInfo; + + /// + /// Creates the ToUnicode map from the CMapInfo. + /// + internal override void PrepareForSave() + { + base.PrepareForSave(); + + // This code comes literally from PDF Reference + string prefix = + "/CIDInit /ProcSet findresource begin\n" + + "12 dict begin\n" + + "begincmap\n" + + "/CIDSystemInfo << /Registry (Adobe)/Ordering (UCS)/Supplement 0>> def\n" + + "/CMapName /Adobe-Identity-UCS def /CMapType 2 def\n"; + string suffix = "endcmap CMapName currentdict /CMap defineresource pop end end"; + + Dictionary glyphIndexToCharacter = new Dictionary(); + int lowIndex = 65536, hiIndex = -1; + foreach (KeyValuePair entry in _cmapInfo.CharacterToGlyphIndex) + { + int index = (int)entry.Value; + lowIndex = Math.Min(lowIndex, index); + hiIndex = Math.Max(hiIndex, index); + //glyphIndexToCharacter.Add(index, entry.Key); + glyphIndexToCharacter[index] = entry.Key; + } + + MemoryStream ms = new MemoryStream(); +#if !SILVERLIGHT && !NETFX_CORE + StreamWriter wrt = new StreamWriter(ms, Encoding.ASCII); +#else + StreamWriter wrt = new StreamWriter(ms, Encoding.UTF8); +#endif + wrt.Write(prefix); + + wrt.WriteLine("1 begincodespacerange"); + wrt.WriteLine(String.Format("<{0:X4}><{1:X4}>", lowIndex, hiIndex)); + wrt.WriteLine("endcodespacerange"); + + // Sorting seems not necessary. The limit is 100 entries, we will see. + wrt.WriteLine(String.Format("{0} beginbfrange", glyphIndexToCharacter.Count)); + foreach (KeyValuePair entry in glyphIndexToCharacter) + wrt.WriteLine(String.Format("<{0:X4}><{0:X4}><{1:X4}>", entry.Key, (int)entry.Value)); + wrt.WriteLine("endbfrange"); + + wrt.Write(suffix); +#if !UWP + wrt.Close(); +#else + wrt.Dispose(); +#endif + + // Compress like content streams + byte[] bytes = ms.ToArray(); +#if !UWP + ms.Close(); +#else + ms.Dispose(); +#endif + if (Owner.Options.CompressContentStreams) + { + Elements.SetName("/Filter", "/FlateDecode"); + bytes = Filtering.FlateDecode.Encode(bytes, _document.Options.FlateEncodeMode); + } + //PdfStream stream = CreateStream(bytes); + else + { + Elements.Remove("/Filter"); + } + + if (Stream == null) + CreateStream(bytes); + else + { + Stream.Value = bytes; + Elements.SetInteger(PdfStream.Keys.Length, Stream.Length); + } + } + + public sealed class Keys : PdfStream.Keys + { + // No new keys. + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfTrailer.cs b/PdfSharp/Pdf.Advanced/PdfTrailer.cs new file mode 100644 index 0000000..dc68fb9 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfTrailer.cs @@ -0,0 +1,297 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.Security; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a PDF trailer dictionary. Even though trailers are dictionaries they never have a cross + /// reference entry in PdfReferenceTable. + /// + internal class PdfTrailer : PdfDictionary // Reference: 3.4.4 File Trailer / Page 96 + { + /// + /// Initializes a new instance of PdfTrailer. + /// + public PdfTrailer(PdfDocument document) + : base(document) + { + _document = document; + } + + /// + /// Initializes a new instance of the class from a . + /// + public PdfTrailer(PdfCrossReferenceStream trailer) + : base(trailer._document) + { + _document = trailer._document; + + // /ID [<09F877EBF282E9408ED1882A9A21D9F2><2A4938E896006F499AC1C2EA7BFB08E4>] + // /Info 7 0 R + // /Root 1 0 R + // /Size 10 + + PdfReference iref = trailer.Elements.GetReference(Keys.Info); + if (iref != null) + Elements.SetReference(Keys.Info, iref); + + Elements.SetReference(Keys.Root, trailer.Elements.GetReference(Keys.Root)); + + Elements.SetInteger(Keys.Size, trailer.Elements.GetInteger(Keys.Size)); + + PdfArray id = trailer.Elements.GetArray(Keys.ID); + if (id != null) + Elements.SetValue(Keys.ID, id); + } + + public int Size + { + get { return Elements.GetInteger(Keys.Size); } + set { Elements.SetInteger(Keys.Size, value); } + } + + // TODO: needed when linearized... + //public int Prev + //{ + // get {return Elements.GetInteger(Keys.Prev);} + //} + + public PdfDocumentInformation Info + { + get { return (PdfDocumentInformation)Elements.GetValue(Keys.Info, VCF.CreateIndirect); } + } + + /// + /// (Required; must be an indirect reference) + /// The catalog dictionary for the PDF document contained in the file. + /// + public PdfCatalog Root + { + get { return (PdfCatalog)Elements.GetValue(PdfTrailer.Keys.Root, VCF.CreateIndirect); } + } + + /// + /// Gets the first or second document identifier. + /// + public string GetDocumentID(int index) + { + if (index < 0 || index > 1) + throw new ArgumentOutOfRangeException("index", index, "Index must be 0 or 1."); + + PdfArray array = Elements[Keys.ID] as PdfArray; + if (array == null || array.Elements.Count < 2) + return ""; + PdfItem item = array.Elements[index]; + if (item is PdfString) + return ((PdfString)item).Value; + return ""; + } + + /// + /// Sets the first or second document identifier. + /// + public void SetDocumentID(int index, string value) + { + if (index < 0 || index > 1) + throw new ArgumentOutOfRangeException("index", index, "Index must be 0 or 1."); + + PdfArray array = Elements[Keys.ID] as PdfArray; + if (array == null || array.Elements.Count < 2) + array = CreateNewDocumentIDs(); + array.Elements[index] = new PdfString(value, PdfStringFlags.HexLiteral); + } + + /// + /// Creates and sets two identical new document IDs. + /// + internal PdfArray CreateNewDocumentIDs() + { + PdfArray array = new PdfArray(_document); + byte[] docID = Guid.NewGuid().ToByteArray(); + string id = PdfEncoders.RawEncoding.GetString(docID, 0, docID.Length); + array.Elements.Add(new PdfString(id, PdfStringFlags.HexLiteral)); + array.Elements.Add(new PdfString(id, PdfStringFlags.HexLiteral)); + Elements[Keys.ID] = array; + return array; + } + + /// + /// Gets the standard security handler. + /// + public PdfStandardSecurityHandler SecurityHandler + { + get + { + if (_securityHandler == null) + _securityHandler = (PdfStandardSecurityHandler)Elements.GetValue(Keys.Encrypt, VCF.CreateIndirect); + return _securityHandler; + } + } + internal PdfStandardSecurityHandler _securityHandler; + + internal override void WriteObject(PdfWriter writer) + { + // Delete /XRefStm entry, if any. + // HACK: + _elements.Remove(Keys.XRefStm); + + // Don't encrypt myself + PdfStandardSecurityHandler securityHandler = writer.SecurityHandler; + writer.SecurityHandler = null; + base.WriteObject(writer); + writer.SecurityHandler = securityHandler; + } + + /// + /// Replace temporary irefs by their correct counterparts from the iref table. + /// + internal void Finish() + { + // /Root + PdfReference iref = _document._trailer.Elements[Keys.Root] as PdfReference; + if (iref != null && iref.Value == null) + { + iref = _document._irefTable[iref.ObjectID]; + Debug.Assert(iref.Value != null); + _document._trailer.Elements[Keys.Root] = iref; + } + + // /Info + iref = _document._trailer.Elements[PdfTrailer.Keys.Info] as PdfReference; + if (iref != null && iref.Value == null) + { + iref = _document._irefTable[iref.ObjectID]; + Debug.Assert(iref.Value != null); + _document._trailer.Elements[Keys.Info] = iref; + } + + // /Encrypt + iref = _document._trailer.Elements[Keys.Encrypt] as PdfReference; + if (iref != null) + { + iref = _document._irefTable[iref.ObjectID]; + Debug.Assert(iref.Value != null); + _document._trailer.Elements[Keys.Encrypt] = iref; + + // The encryption dictionary (security handler) was read in before the XRefTable construction + // was completed. The next lines fix that state (it took several hours to find these bugs...). + iref.Value = _document._trailer._securityHandler; + _document._trailer._securityHandler.Reference = iref; + iref.Value.Reference = iref; + } + + Elements.Remove(Keys.Prev); + + Debug.Assert(_document._irefTable.IsUnderConstruction == false); + _document._irefTable.IsUnderConstruction = false; + } + + /// + /// Predefined keys of this dictionary. + /// + internal class Keys : KeysBase // Reference: TABLE 3.13 Entries in the file trailer dictionary / Page 97 + { + /// + /// (Required; must not be an indirect reference) The total number of entries in the files + /// cross-reference table, as defined by the combination of the original section and all + /// update sections. Equivalently, this value is 1 greater than the highest object number + /// used in the file. + /// Note: Any object in a cross-reference section whose number is greater than this value is + /// ignored and considered missing. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string Size = "/Size"; + + /// + /// (Present only if the file has more than one cross-reference section; must not be an indirect + /// reference) The byte offset from the beginning of the file to the beginning of the previous + /// cross-reference section. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string Prev = "/Prev"; + + /// + /// (Required; must be an indirect reference) The catalog dictionary for the PDF document + /// contained in the file. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required, typeof(PdfCatalog))] + public const string Root = "/Root"; + + /// + /// (Required if document is encrypted; PDF 1.1) The documents encryption dictionary. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfStandardSecurityHandler))] + public const string Encrypt = "/Encrypt"; + + /// + /// (Optional; must be an indirect reference) The documents information dictionary. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfDocumentInformation))] + public const string Info = "/Info"; + + /// + /// (Optional, but strongly recommended; PDF 1.1) An array of two strings constituting + /// a file identifier for the file. Although this entry is optional, + /// its absence might prevent the file from functioning in some workflows + /// that depend on files being uniquely identified. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string ID = "/ID"; + + /// + /// (Optional) The byte offset from the beginning of the file of a cross-reference stream. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string XRefStm = "/XRefStm"; + + /// + /// Gets the KeysMeta for these keys. + /// + public static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfTransparencyGroupAttributes.cs b/PdfSharp/Pdf.Advanced/PdfTransparencyGroupAttributes.cs new file mode 100644 index 0000000..f5c4072 --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfTransparencyGroupAttributes.cs @@ -0,0 +1,129 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a PDF transparency group XObject. + /// + public sealed class PdfTransparencyGroupAttributes : PdfGroupAttributes + { + internal PdfTransparencyGroupAttributes(PdfDocument thisDocument) + : base(thisDocument) + { + Elements.SetName(Keys.S, "/Transparency"); + } + + /// + /// Predefined keys of this dictionary. + /// + public sealed new class Keys : PdfGroupAttributes.Keys + { + /// + /// (Sometimes required, as discussed below) + /// The group color space, which is used for the following purposes: + /// As the color space into which colors are converted when painted into the group + /// As the blending color space in which objects are composited within the group + /// As the color space of the group as a whole when it in turn is painted as an object onto its backdrop + /// The group color space may be any device or CIE-based color space that + /// treats its components as independent additive or subtractive values in the + /// range 0.0 to 1.0, subject to the restrictions described in Section 7.2.3, Blending Color Space. + /// These restrictions exclude Lab and lightness-chromaticity ICCBased color spaces, + /// as well as the special color spaces Pattern, Indexed, Separation, and DeviceN. + /// Device color spaces are subject to remapping according to the DefaultGray, + /// DefaultRGB, and DefaultCMYK entries in the ColorSpace subdictionary of the + /// current resource dictionary. + /// Ordinarily, the CS entry is allowed only for isolated transparency groups + /// (those for which I, below, is true), and even then it is optional. However, + /// this entry is required in the group attributes dictionary for any transparency + /// group XObject that has no parent group or page from which to inherit in + /// particular, one that is the value of the G entry in a soft-mask dictionary of + /// subtype Luminosity. + /// In addition, it is always permissible to specify CS in the group attributes + /// dictionary associated with a page object, even if I is false or absent. In the + /// normal case in which the page is imposed directly on the output medium, + /// the page group is effectively isolated regardless of the I value, and the + /// specified CS value is therefore honored. But if the page is in turn used as an + /// element of some other page and if the group is non-isolated, CS is ignored + /// and the color space is inherited from the actual backdrop with which the + /// page is composited. + /// Default value: the color space of the parent group or page into which this + /// transparency group is painted. (The parents color space in turn can be + /// either explicitly specified or inherited.) + /// + [KeyInfo(KeyType.NameOrArray | KeyType.Optional)] + public const string CS = "/CS"; + + /// + /// (Optional) A flag specifying whether the transparency group is isolated. + /// If this flag is true, objects within the group are composited against a fully + /// transparent initial backdrop; if false, they are composited against the + /// groups backdrop. + /// Default value: false. + /// In the group attributes dictionary for a page, the interpretation of this + /// entry is slightly altered. In the normal case in which the page is imposed + /// directly on the output medium, the page group is effectively isolated and + /// the specified I value is ignored. But if the page is in turn used as an + /// element of some other page, it is treated as if it were a transparency + /// group XObject; the I value is interpreted in the normal way to determine + /// whether the page group is isolated. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string I = "/I"; + + /// + /// (Optional) A flag specifying whether the transparency group is a knockout + /// group. If this flag is false, later objects within the group are composited + /// with earlier ones with which they overlap; if true, they are composited with + /// the groups initial backdrop and overwrite (knock out) any earlier + /// overlapping objects. + /// Default value: false. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string K = "/K"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static new DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfTrueTypeFont.cs b/PdfSharp/Pdf.Advanced/PdfTrueTypeFont.cs new file mode 100644 index 0000000..f63f37d --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfTrueTypeFont.cs @@ -0,0 +1,254 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using PdfSharp.Fonts; +using PdfSharp.Fonts.OpenType; +using PdfSharp.Drawing; +using PdfSharp.Pdf.Filters; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a TrueType font. + /// + internal class PdfTrueTypeFont : PdfFont + { + public PdfTrueTypeFont(PdfDocument document) + : base(document) + { } + + /// + /// Initializes a new instance of PdfTrueTypeFont from an XFont. + /// + public PdfTrueTypeFont(PdfDocument document, XFont font) + : base(document) + { + Elements.SetName(Keys.Type, "/Font"); + Elements.SetName(Keys.Subtype, "/TrueType"); + + // TrueType with WinAnsiEncoding only. + OpenTypeDescriptor ttDescriptor = (OpenTypeDescriptor)FontDescriptorCache.GetOrCreateDescriptorFor(font); + FontDescriptor = new PdfFontDescriptor(document, ttDescriptor); + _fontOptions = font.PdfOptions; + Debug.Assert(_fontOptions != null); + + //cmapInfo = new CMapInfo(null/*ttDescriptor*/); + _cmapInfo = new CMapInfo(ttDescriptor); + + BaseFont = font.GlyphTypeface.GetBaseName(); + + if (_fontOptions.FontEmbedding == PdfFontEmbedding.Always) + BaseFont = PdfFont.CreateEmbeddedFontSubsetName(BaseFont); + FontDescriptor.FontName = BaseFont; + + Debug.Assert(_fontOptions.FontEncoding == PdfFontEncoding.WinAnsi); + if (!IsSymbolFont) + Encoding = "/WinAnsiEncoding"; + + Owner._irefTable.Add(FontDescriptor); + Elements[Keys.FontDescriptor] = FontDescriptor.Reference; + + FontEncoding = font.PdfOptions.FontEncoding; + } + + XPdfFontOptions FontOptions + { + get { return _fontOptions; } + } + readonly XPdfFontOptions _fontOptions; + + public string BaseFont + { + get { return Elements.GetName(Keys.BaseFont); } + set { Elements.SetName(Keys.BaseFont, value); } + } + + public int FirstChar + { + get { return Elements.GetInteger(Keys.FirstChar); } + set { Elements.SetInteger(Keys.FirstChar, value); } + } + + public int LastChar + { + get { return Elements.GetInteger(Keys.LastChar); } + set { Elements.SetInteger(Keys.LastChar, value); } + } + + public PdfArray Widths + { + get { return (PdfArray)Elements.GetValue(Keys.Widths, VCF.Create); } + } + + public string Encoding + { + get { return Elements.GetName(Keys.Encoding); } + set { Elements.SetName(Keys.Encoding, value); } + } + + /// + /// Prepares the object to get saved. + /// + internal override void PrepareForSave() + { + base.PrepareForSave(); + + // Fonts are always embedded. + OpenTypeFontface subSet = FontDescriptor._descriptor.FontFace.CreateFontSubSet(_cmapInfo.GlyphIndices, false); + byte[] fontData = subSet.FontSource.Bytes; + + PdfDictionary fontStream = new PdfDictionary(Owner); + Owner.Internals.AddObject(fontStream); + FontDescriptor.Elements[PdfFontDescriptor.Keys.FontFile2] = fontStream.Reference; + + fontStream.Elements["/Length1"] = new PdfInteger(fontData.Length); + if (!Owner.Options.NoCompression) + { + fontData = Filtering.FlateDecode.Encode(fontData, _document.Options.FlateEncodeMode); + fontStream.Elements["/Filter"] = new PdfName("/FlateDecode"); + } + fontStream.Elements["/Length"] = new PdfInteger(fontData.Length); + fontStream.CreateStream(fontData); + + FirstChar = 0; + LastChar = 255; + PdfArray width = Widths; + //width.Elements.Clear(); + for (int idx = 0; idx < 256; idx++) + width.Elements.Add(new PdfInteger(FontDescriptor._descriptor.Widths[idx])); + } + + /// + /// Predefined keys of this dictionary. + /// + public new sealed class Keys : PdfFont.Keys + { + /// + /// (Required) The type of PDF object that this dictionary describes; + /// must be Font for a font dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Font")] + public new const string Type = "/Type"; + + /// + /// (Required) The type of font; must be TrueType for a TrueType font. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public new const string Subtype = "/Subtype"; + + /// + /// (Required in PDF 1.0; optional otherwise) The name by which this font is + /// referenced in the Font subdictionary of the current resource dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string Name = "/Name"; + + /// + /// (Required) The PostScript name of the font. For Type 1 fonts, this is usually + /// the value of the FontName entry in the font program; for more information. + /// The Post-Script name of the font can be used to find the fonts definition in + /// the consumer application or its environment. It is also the name that is used when + /// printing to a PostScript output device. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public new const string BaseFont = "/BaseFont"; + + /// + /// (Required except for the standard 14 fonts) The first character code defined + /// in the fonts Widths array. + /// + [KeyInfo(KeyType.Integer)] + public const string FirstChar = "/FirstChar"; + + /// + /// (Required except for the standard 14 fonts) The last character code defined + /// in the fonts Widths array. + /// + [KeyInfo(KeyType.Integer)] + public const string LastChar = "/LastChar"; + + /// + /// (Required except for the standard 14 fonts; indirect reference preferred) + /// An array of (LastChar - FirstChar + 1) widths, each element being the glyph width + /// for the character code that equals FirstChar plus the array index. For character + /// codes outside the range FirstChar to LastChar, the value of MissingWidth from the + /// FontDescriptor entry for this font is used. The glyph widths are measured in units + /// in which 1000 units corresponds to 1 unit in text space. These widths must be + /// consistent with the actual widths given in the font program. + /// + [KeyInfo(KeyType.Array, typeof(PdfArray))] + public const string Widths = "/Widths"; + + /// + /// (Required except for the standard 14 fonts; must be an indirect reference) + /// A font descriptor describing the fonts metrics other than its glyph widths. + /// Note: For the standard 14 fonts, the entries FirstChar, LastChar, Widths, and + /// FontDescriptor must either all be present or all be absent. Ordinarily, they are + /// absent; specifying them enables a standard font to be overridden. + /// + [KeyInfo(KeyType.Dictionary | KeyType.MustBeIndirect, typeof(PdfFontDescriptor))] + public new const string FontDescriptor = "/FontDescriptor"; + + /// + /// (Optional) A specification of the fonts character encoding if different from its + /// built-in encoding. The value of Encoding is either the name of a predefined + /// encoding (MacRomanEncoding, MacExpertEncoding, or WinAnsiEncoding, as described in + /// Appendix D) or an encoding dictionary that specifies differences from the fonts + /// built-in encoding or from a specified predefined encoding. + /// + [KeyInfo(KeyType.Name | KeyType.Dictionary)] + public const string Encoding = "/Encoding"; + + /// + /// (Optional; PDF 1.2) A stream containing a CMap file that maps character + /// codes to Unicode values. + /// + [KeyInfo(KeyType.Stream | KeyType.Optional)] + public const string ToUnicode = "/ToUnicode"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfType0Font.cs b/PdfSharp/Pdf.Advanced/PdfType0Font.cs new file mode 100644 index 0000000..423fa7f --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfType0Font.cs @@ -0,0 +1,241 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using System.Text; +using PdfSharp.Fonts; +using PdfSharp.Fonts.OpenType; +using PdfSharp.Drawing; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Represents a composite font. Used for Unicode encoding. + /// + internal sealed class PdfType0Font : PdfFont + { + public PdfType0Font(PdfDocument document) + : base(document) + { } + + public PdfType0Font(PdfDocument document, XFont font, bool vertical) + : base(document) + { + Elements.SetName(Keys.Type, "/Font"); + Elements.SetName(Keys.Subtype, "/Type0"); + Elements.SetName(Keys.Encoding, vertical ? "/Identity-V" : "/Identity-H"); + + OpenTypeDescriptor ttDescriptor = (OpenTypeDescriptor)FontDescriptorCache.GetOrCreateDescriptorFor(font); + FontDescriptor = new PdfFontDescriptor(document, ttDescriptor); + _fontOptions = font.PdfOptions; + Debug.Assert(_fontOptions != null); + + _cmapInfo = new CMapInfo(ttDescriptor); + _descendantFont = new PdfCIDFont(document, FontDescriptor, font); + _descendantFont.CMapInfo = _cmapInfo; + + // Create ToUnicode map + _toUnicode = new PdfToUnicodeMap(document, _cmapInfo); + document.Internals.AddObject(_toUnicode); + Elements.Add(Keys.ToUnicode, _toUnicode); + + BaseFont = font.GlyphTypeface.GetBaseName(); + // CID fonts are always embedded + BaseFont = PdfFont.CreateEmbeddedFontSubsetName(BaseFont); + + FontDescriptor.FontName = BaseFont; + _descendantFont.BaseFont = BaseFont; + + PdfArray descendantFonts = new PdfArray(document); + Owner._irefTable.Add(_descendantFont); + descendantFonts.Elements.Add(_descendantFont.Reference); + Elements[Keys.DescendantFonts] = descendantFonts; + } + + public PdfType0Font(PdfDocument document, string idName, byte[] fontData, bool vertical) + : base(document) + { + Elements.SetName(Keys.Type, "/Font"); + Elements.SetName(Keys.Subtype, "/Type0"); + Elements.SetName(Keys.Encoding, vertical ? "/Identity-V" : "/Identity-H"); + + OpenTypeDescriptor ttDescriptor = (OpenTypeDescriptor)FontDescriptorCache.GetOrCreateDescriptor(idName, fontData); + FontDescriptor = new PdfFontDescriptor(document, ttDescriptor); + _fontOptions = new XPdfFontOptions(PdfFontEncoding.Unicode); + Debug.Assert(_fontOptions != null); + + _cmapInfo = new CMapInfo(ttDescriptor); + _descendantFont = new PdfCIDFont(document, FontDescriptor, fontData); + _descendantFont.CMapInfo = _cmapInfo; + + // Create ToUnicode map + _toUnicode = new PdfToUnicodeMap(document, _cmapInfo); + document.Internals.AddObject(_toUnicode); + Elements.Add(Keys.ToUnicode, _toUnicode); + + //BaseFont = ttDescriptor.FontName.Replace(" ", ""); + BaseFont = ttDescriptor.FontName; + + // CID fonts are always embedded + if (!BaseFont.Contains("+")) // HACK in PdfType0Font + BaseFont = CreateEmbeddedFontSubsetName(BaseFont); + + FontDescriptor.FontName = BaseFont; + _descendantFont.BaseFont = BaseFont; + + PdfArray descendantFonts = new PdfArray(document); + Owner._irefTable.Add(_descendantFont); + descendantFonts.Elements.Add(_descendantFont.Reference); + Elements[Keys.DescendantFonts] = descendantFonts; + } + + XPdfFontOptions FontOptions + { + get { return _fontOptions; } + } + XPdfFontOptions _fontOptions; + + public string BaseFont + { + get { return Elements.GetName(Keys.BaseFont); } + set { Elements.SetName(Keys.BaseFont, value); } + } + + internal PdfCIDFont DescendantFont + { + get { return _descendantFont; } + } + readonly PdfCIDFont _descendantFont; + + internal override void PrepareForSave() + { + base.PrepareForSave(); + + // Use GetGlyphIndices to create the widths array. + OpenTypeDescriptor descriptor = (OpenTypeDescriptor)FontDescriptor._descriptor; + StringBuilder w = new StringBuilder("["); + if (_cmapInfo != null) + { + int[] glyphIndices = _cmapInfo.GetGlyphIndices(); + int count = glyphIndices.Length; + int[] glyphWidths = new int[count]; + + for (int idx = 0; idx < count; idx++) + glyphWidths[idx] = descriptor.GlyphIndexToPdfWidth(glyphIndices[idx]); + + //TODO: optimize order of indices + + for (int idx = 0; idx < count; idx++) + w.AppendFormat("{0}[{1}]", glyphIndices[idx], glyphWidths[idx]); + w.Append("]"); + _descendantFont.Elements.SetValue(PdfCIDFont.Keys.W, new PdfLiteral(w.ToString())); + + } + _descendantFont.PrepareForSave(); + _toUnicode.PrepareForSave(); + } + + /// + /// Predefined keys of this dictionary. + /// + public new sealed class Keys : PdfFont.Keys + { + /// + /// (Required) The type of PDF object that this dictionary describes; + /// must be Font for a font dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Font")] + public new const string Type = "/Type"; + + /// + /// (Required) The type of font; must be Type0 for a Type 0 font. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public new const string Subtype = "/Subtype"; + + /// + /// (Required) The PostScript name of the font. In principle, this is an arbitrary + /// name, since there is no font program associated directly with a Type 0 font + /// dictionary. The conventions described here ensure maximum compatibility + /// with existing Acrobat products. + /// If the descendant is a Type 0 CIDFont, this name should be the concatenation + /// of the CIDFonts BaseFont name, a hyphen, and the CMap name given in the + /// Encoding entry (or the CMapName entry in the CMap). If the descendant is a + /// Type 2 CIDFont, this name should be the same as the CIDFonts BaseFont name. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public new const string BaseFont = "/BaseFont"; + + /// + /// (Required) The name of a predefined CMap, or a stream containing a CMap + /// that maps character codes to font numbers and CIDs. If the descendant is a + /// Type 2 CIDFont whose associated TrueType font program is not embedded + /// in the PDF file, the Encoding entry must be a predefined CMap name. + /// + [KeyInfo(KeyType.StreamOrName | KeyType.Required)] + public const string Encoding = "/Encoding"; + + /// + /// (Required) A one-element array specifying the CIDFont dictionary that is the + /// descendant of this Type 0 font. + /// + [KeyInfo(KeyType.Array | KeyType.Required)] + public const string DescendantFonts = "/DescendantFonts"; + + /// + /// ((Optional) A stream containing a CMap file that maps character codes to + /// Unicode values. + /// + [KeyInfo(KeyType.Stream | KeyType.Optional)] + public const string ToUnicode = "/ToUnicode"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get + { + if (Keys._meta == null) + Keys._meta = CreateMeta(typeof(Keys)); + return Keys._meta; + } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Advanced/PdfType1Font.cs b/PdfSharp/Pdf.Advanced/PdfType1Font.cs new file mode 100644 index 0000000..57cc9eb --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfType1Font.cs @@ -0,0 +1,184 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if true_ // Not yet implemented- + +using System; +using System.Collections; +using System.Text; +using System.IO; +using PdfSharp.Internal; + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Not implemented - just for illustration of the class hierarchy. + /// + internal sealed class PdfType1Font : PdfFont + { + public PdfType1Font(PdfDocument document) + : base(document) + { + Elements["\\Type"] = new PdfName("Font"); + Elements["\\Subtype"] = new PdfName("Type1"); + } + + //public string BaseFont + //{ + // get {return baseFont;} + // set {baseFont = value;} + //} + //string baseFont; + + + // internal override void AssignObjectID(ref int objectID) + // { + // SetObjectID(ref objectID); + // } + // + // internal override void WriteObject(Stream stream) + // { + // base.WriteObject(stream); + // StringBuilder pdf = new StringBuilder(); + // pdf.AppendFormat("{0} 0 obj\n<<\n/Type /Font\n/Subtype /Type1\n/BaseFont /Helvetica\n/Encoding /WinAnsiEncoding\n>>\nendobj\n", ObjectID); + // WriteString(stream, pdf.ToString()); + // } + /// + /// Predefined keys of this dictionary. + /// + public new sealed class Keys : PdfFont.Keys + { + /// + /// (Required) The type of PDF object that this dictionary describes; + /// must be Font for a font dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Font")] + public new const string Type = "/Type"; + + /// + /// (Required) The type of font; must be Type1 for a Type 1 font. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public new const string Subtype = "/Subtype"; + + /// + /// (Required in PDF 1.0; optional otherwise) The name by which this font is + /// referenced in the Font subdictionary of the current resource dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string Name = "/Name"; + + /// + /// (Required) The PostScript name of the font. For Type 1 fonts, this is usually + /// the value of the FontName entry in the font program; for more information. + /// The Post-Script name of the font can be used to find the fonts definition in + /// the consumer application or its environment. It is also the name that is used when + /// printing to a PostScript output device. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public new const string BaseFont = "/BaseFont"; + + /// + /// (Required except for the standard 14 fonts) The first character code defined + /// in the fonts Widths array. + /// + [KeyInfo(KeyType.Integer)] + public const string FirstChar = "/FirstChar"; + + /// + /// (Required except for the standard 14 fonts) The last character code defined + /// in the fonts Widths array. + /// + [KeyInfo(KeyType.Integer)] + public const string LastChar = "/LastChar"; + + /// + /// (Required except for the standard 14 fonts; indirect reference preferred) + /// An array of (LastChar - FirstChar + 1) widths, each element being the glyph width + /// for the character code that equals FirstChar plus the array index. For character + /// codes outside the range FirstChar to LastChar, the value of MissingWidth from the + /// FontDescriptor entry for this font is used. The glyph widths are measured in units + /// in which 1000 units corresponds to 1 unit in text space. These widths must be + /// consistent with the actual widths given in the font program. + /// + [KeyInfo(KeyType.Array, typeof(PdfArray))] + public const string Widths = "/Widths"; + + /// + /// (Required except for the standard 14 fonts; must be an indirect reference) + /// A font descriptor describing the fonts metrics other than its glyph widths. + /// Note: For the standard 14 fonts, the entries FirstChar, LastChar, Widths, and + /// FontDescriptor must either all be present or all be absent. Ordinarily, they are + /// absent; specifying them enables a standard font to be overridden. + /// + [KeyInfo(KeyType.Dictionary | KeyType.MustBeIndirect, typeof(PdfFontDescriptor))] + public new const string FontDescriptor = "/FontDescriptor"; + + /// + /// (Optional) A specification of the fonts character encoding if different from its + /// built-in encoding. The value of Encoding is either the name of a predefined + /// encoding (MacRomanEncoding, MacExpertEncoding, or WinAnsiEncoding, as described in + /// Appendix D) or an encoding dictionary that specifies differences from the fonts + /// built-in encoding or from a specified predefined encoding. + /// + [KeyInfo(KeyType.Name | KeyType.Dictionary)] + public const string Encoding = "/Encoding"; + + /// + /// (Optional; PDF 1.2) A stream containing a CMap file that maps character + /// codes to Unicode values. + /// + [KeyInfo(KeyType.Stream | KeyType.Optional)] + public const string ToUnicode = "/ToUnicode"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get + { + if (_meta == null) + _meta = CreateMeta(typeof(Keys)); + return _meta; + } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} +#endif diff --git a/PdfSharp/Pdf.Advanced/PdfXObject.cs b/PdfSharp/Pdf.Advanced/PdfXObject.cs new file mode 100644 index 0000000..667e27d --- /dev/null +++ b/PdfSharp/Pdf.Advanced/PdfXObject.cs @@ -0,0 +1,51 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Advanced +{ + /// + /// Base class for all PDF external objects. + /// + public abstract class PdfXObject : PdfDictionary + { + /// + /// Initializes a new instance of the class. + /// + /// The document that owns the object. + protected PdfXObject(PdfDocument document) + : base(document) + { } + + /// + /// Predefined keys of this dictionary. + /// + public class Keys : PdfStream.Keys + { } + } +} diff --git a/PdfSharp/Pdf.Annotations/PdfAnnotation.cs b/PdfSharp/Pdf.Annotations/PdfAnnotation.cs new file mode 100644 index 0000000..d51cd6b --- /dev/null +++ b/PdfSharp/Pdf.Annotations/PdfAnnotation.cs @@ -0,0 +1,399 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Pdf.Annotations +{ + /// + /// Represents the base class of all annotations. + /// + public abstract class PdfAnnotation : PdfDictionary + { + /// + /// Initializes a new instance of the class. + /// + protected PdfAnnotation() + { + Initialize(); + } + + /// + /// Initializes a new instance of the class. + /// + protected PdfAnnotation(PdfDocument document) + : base(document) + { + Initialize(); + } + + /// + /// Initializes a new instance of the class. + /// + internal PdfAnnotation(PdfDictionary dict) + : base(dict) + { } + + void Initialize() + { + Elements.SetName(Keys.Type, "/Annot"); + Elements.SetString(Keys.NM, Guid.NewGuid().ToString("D")); + Elements.SetDateTime(Keys.M, DateTime.Now); + } + + /// + /// Removes an annotation from the document + /// + /// + [Obsolete("Use 'Parent.Remove(this)'")] + public void Delete() + { + Parent.Remove(this); + } + + /// + /// Gets or sets the annotation flags of this instance. + /// + public PdfAnnotationFlags Flags + { + get { return (PdfAnnotationFlags)Elements.GetInteger(Keys.F); } + set + { + Elements.SetInteger(Keys.F, (int)value); + Elements.SetDateTime(Keys.M, DateTime.Now); + } + } + + /// + /// Gets or sets the PdfAnnotations object that this annotation belongs to. + /// + public PdfAnnotations Parent + { + get { return _parent; } + set { _parent = value; } + } + PdfAnnotations _parent; + + /// + /// Gets or sets the annotation rectangle, defining the location of the annotation + /// on the page in default user space units. + /// + public PdfRectangle Rectangle + { + get { return Elements.GetRectangle(Keys.Rect, true); } + set + { + Elements.SetRectangle(Keys.Rect, value); + Elements.SetDateTime(Keys.M, DateTime.Now); + } + } + + /// + /// Gets or sets the text label to be displayed in the title bar of the annotations + /// pop-up window when open and active. By convention, this entry identifies + /// the user who added the annotation. + /// + public string Title + { + get { return Elements.GetString(Keys.T, true); } + set + { + Elements.SetString(Keys.T, value); + Elements.SetDateTime(Keys.M, DateTime.Now); + } + } + + /// + /// Gets or sets text representing a short description of the subject being + /// addressed by the annotation. + /// + public string Subject + { + get { return Elements.GetString(Keys.Subj, true); } + set + { + Elements.SetString(Keys.Subj, value); + Elements.SetDateTime(Keys.M, DateTime.Now); + } + } + + /// + /// Gets or sets the text to be displayed for the annotation or, if this type of + /// annotation does not display text, an alternate description of the annotations + /// contents in human-readable form. + /// + public string Contents + { + get { return Elements.GetString(Keys.Contents, true); } + set + { + Elements.SetString(Keys.Contents, value); + Elements.SetDateTime(Keys.M, DateTime.Now); + } + } + + /// + /// Gets or sets the color representing the components of the annotation. If the color + /// has an alpha value other than 1, it is ignored. Use property Opacity to get or set the + /// opacity of an annotation. + /// + public XColor Color + { + get + { + PdfItem item = Elements[Keys.C]; + PdfArray array = item as PdfArray; + if (array != null) // TODO: check for iref? + { + if (array.Elements.Count == 3) + { + // TODO: an array.GetColor() function may be useful here + return XColor.FromArgb( + (int)(array.Elements.GetReal(0) * 255), + (int)(array.Elements.GetReal(1) * 255), + (int)(array.Elements.GetReal(2) * 255)); + } + } + return XColors.Black; + } + set + { + // TODO: an array.SetColor(clr) function may be useful here + PdfArray array = new PdfArray(Owner, new PdfReal[] { new PdfReal(value.R / 255.0), new PdfReal(value.G / 255.0), new PdfReal(value.B / 255.0) }); + Elements[Keys.C] = array; + Elements.SetDateTime(Keys.M, DateTime.Now); + } + } + + /// + /// Gets or sets the constant opacity value to be used in painting the annotation. + /// This value applies to all visible elements of the annotation in its closed state + /// (including its background and border) but not to the popup window that appears when + /// the annotation is opened. + /// + public double Opacity + { + get + { + if (!Elements.ContainsKey(Keys.CA)) + return 1; + return Elements.GetReal(Keys.CA, true); + } + set + { + if (value < 0 || value > 1) + throw new ArgumentOutOfRangeException("value", value, "Opacity must be a value in the range from 0 to 1."); + Elements.SetReal(Keys.CA, value); + Elements.SetDateTime(Keys.M, DateTime.Now); + } + } + + /// + /// Predefined keys of this dictionary. + /// + public class Keys : KeysBase + { + // ReSharper disable InconsistentNaming + + /// + /// (Optional) The type of PDF object that this dictionary describes; if present, + /// must be Annot for an annotation dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Optional, FixedValue = "Annot")] + public const string Type = "/Type"; + + /// + /// (Required) The type of annotation that this dictionary describes. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string Subtype = "/Subtype"; + + /// + /// (Required) The annotation rectangle, defining the location of the annotation + /// on the page in default user space units. + /// + [KeyInfo(KeyType.Rectangle | KeyType.Required)] + public const string Rect = "/Rect"; + + /// + /// (Optional) Text to be displayed for the annotation or, if this type of annotation + /// does not display text, an alternate description of the annotations contents + /// in human-readable form. In either case, this text is useful when + /// extracting the documents contents in support of accessibility to users with + /// disabilities or for other purposes. + /// + [KeyInfo(KeyType.TextString | KeyType.Optional)] + public const string Contents = "/Contents"; + + // P + + /// + /// (Optional; PDF 1.4) The annotation name, a text string uniquely identifying it + /// among all the annotations on its page. + /// + [KeyInfo(KeyType.TextString | KeyType.Optional)] + public const string NM = "/NM"; + + /// + /// (Optional; PDF 1.1) The date and time when the annotation was most recently + /// modified. The preferred format is a date string, but viewer applications should be + /// prepared to accept and display a string in any format. + /// + [KeyInfo(KeyType.Date | KeyType.Optional)] + public const string M = "/M"; + + /// + /// (Optional; PDF 1.1) A set of flags specifying various characteristics of the annotation. + /// Default value: 0. + /// + [KeyInfo("1.1", KeyType.Integer | KeyType.Optional)] + public const string F = "/F"; + + /// + /// (Optional; PDF 1.2) A border style dictionary specifying the characteristics of + /// the annotations border. + /// + [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional)] + public const string BS = "/BS"; + + /// + /// (Optional; PDF 1.2) An appearance dictionary specifying how the annotation + /// is presented visually on the page. Individual annotation handlers may ignore + /// this entry and provide their own appearances. + /// + [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional)] + public const string AP = "/AP"; + + /// + /// (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) + /// The annotations appearance state, which selects the applicable appearance stream from + /// an appearance subdictionary. + /// + [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional)] + public const string AS = "/AS"; + + /// + /// (Optional) An array specifying the characteristics of the annotations border. + /// The border is specified as a rounded rectangle. + /// In PDF 1.0, the array consists of three numbers defining the horizontal corner + /// radius, vertical corner radius, and border width, all in default user space units. + /// If the corner radii are 0, the border has square (not rounded) corners; if the border + /// width is 0, no border is drawn. + /// In PDF 1.1, the array may have a fourth element, an optional dash array defining a + /// pattern of dashes and gaps to be used in drawing the border. The dash array is + /// specified in the same format as in the line dash pattern parameter of the graphics state. + /// For example, a Border value of [0 0 1 [3 2]] specifies a border 1 unit wide, with + /// square corners, drawn with 3-unit dashes alternating with 2-unit gaps. Note that no + /// dash phase is specified; the phase is assumed to be 0. + /// Note: In PDF 1.2 or later, this entry may be ignored in favor of the BS entry. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string Border = "/Border"; + + /// + /// (Optional; PDF 1.1) An array of three numbers in the range 0.0 to 1.0, representing + /// the components of a color in the DeviceRGB color space. This color is used for the + /// following purposes: + /// The background of the annotations icon when closed + /// The title bar of the annotations pop-up window + /// The border of a link annotation + /// + [KeyInfo("1.1", KeyType.Array | KeyType.Optional)] + public const string C = "/C"; + + // @PDF/UA + /// + /// (Required if the annotation is a structural content item; PDF 1.3) + /// The integer key of the annotations entry in the structural parent tree. + /// + [KeyInfo("1.3", KeyType.Integer | KeyType.Optional)] + public const string StructParent = "/StructParent"; + + /// + /// (Optional; PDF 1.1) An action to be performed when the annotation is activated. + /// Note: This entry is not permitted in link annotations if a Dest entry is present. + /// Also note that the A entry in movie annotations has a different meaning. + /// + [KeyInfo("1.1", KeyType.Dictionary | KeyType.Optional)] + public const string A = "/A"; + + // AA + // StructParent + // OC + + // ----- Excerpt of entries specific to markup annotations ---------------------------------- + + /// + /// (Optional; PDF 1.1) The text label to be displayed in the title bar of the annotations + /// pop-up window when open and active. By convention, this entry identifies + /// the user who added the annotation. + /// + [KeyInfo(KeyType.TextString | KeyType.Optional)] + public const string T = "/T"; + + /// + /// (Optional; PDF 1.3) An indirect reference to a pop-up annotation for entering or + /// editing the text associated with this annotation. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional)] + public const string Popup = "/Popup"; + + /// + /// (Optional; PDF 1.4) The constant opacity value to be used in painting the annotation. + /// This value applies to all visible elements of the annotation in its closed state + /// (including its background and border) but not to the popup window that appears when + /// the annotation is opened. + /// The specified value is not used if the annotation has an appearance stream; in that + /// case, the appearance stream must specify any transparency. (However, if the viewer + /// regenerates the annotations appearance stream, it may incorporate the CA value + /// into the streams content.) + /// The implicit blend mode is Normal. + /// Default value: 1.0. + /// + [KeyInfo(KeyType.Real | KeyType.Optional)] + public const string CA = "/CA"; + + //RC + //CreationDate + //IRT + + /// + /// (Optional; PDF 1.5) Text representing a short description of the subject being + /// addressed by the annotation. + /// + [KeyInfo("1.5", KeyType.TextString | KeyType.Optional)] + public const string Subj = "/Subj"; + + //RT + //IT + // ReSharper restore InconsistentNaming + } + } +} diff --git a/PdfSharp/Pdf.Annotations/PdfAnnotations.cs b/PdfSharp/Pdf.Annotations/PdfAnnotations.cs new file mode 100644 index 0000000..4b9dc61 --- /dev/null +++ b/PdfSharp/Pdf.Annotations/PdfAnnotations.cs @@ -0,0 +1,229 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Collections; +using System.Text; +using System.IO; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.IO; +using System.Collections.Generic; + +namespace PdfSharp.Pdf.Annotations +{ + /// + /// Represents the annotations array of a page. + /// + public sealed class PdfAnnotations : PdfArray + { + internal PdfAnnotations(PdfDocument document) + : base(document) + { } + + internal PdfAnnotations(PdfArray array) + : base(array) + { } + + /// + /// Adds the specified annotation. + /// + /// The annotation. + public void Add(PdfAnnotation annotation) + { + annotation.Document = Owner; + Owner._irefTable.Add(annotation); + Elements.Add(annotation.Reference); + } + + /// + /// Removes an annotation from the document. + /// + public void Remove(PdfAnnotation annotation) + { + if (annotation.Owner != Owner) + throw new InvalidOperationException("The annotation does not belong to this document."); + + Owner.Internals.RemoveObject(annotation); + Elements.Remove(annotation.Reference); + } + + /// + /// Removes all the annotations from the current page. + /// + public void Clear() + { + for (int idx = Count - 1; idx >= 0; idx--) + Page.Annotations.Remove(_page.Annotations[idx]); + } + + //public void Insert(int index, PdfAnnotation annotation) + //{ + // annotation.Document = Document; + // annotations.Insert(index, annotation); + //} + + /// + /// Gets the number of annotations in this collection. + /// + public int Count + { + get { return Elements.Count; } + } + + /// + /// Gets the at the specified index. + /// + public PdfAnnotation this[int index] + { + get + { + PdfReference iref; + PdfDictionary dict; + PdfItem item = Elements[index]; + if ((iref = item as PdfReference) != null) + { + Debug.Assert(iref.Value is PdfDictionary, "Reference to dictionary expected."); + dict = (PdfDictionary)iref.Value; + } + else + { + Debug.Assert(item is PdfDictionary, "Dictionary expected."); + dict = (PdfDictionary)item; + } + PdfAnnotation annotation = dict as PdfAnnotation; + if (annotation == null) + { + annotation = new PdfGenericAnnotation(dict); + if (iref == null) + Elements[index] = annotation; + } + return annotation; + } + } + + //public PdfAnnotation this[int index] + //{ + // get + // { + // //DMH 6/7/06 + // //Broke this out to simplfy debugging + // //Use a generic annotation to access the Meta data + // //Assign this as the parent of the annotation + // PdfReference r = Elements[index] as PdfReference; + // PdfDictionary d = r.Value as PdfDictionary; + // PdfGenericAnnotation a = new PdfGenericAnnotation(d); + // a.Collection = this; + // return a; + // } + //} + + /// + /// Gets the page the annotations belongs to. + /// + internal PdfPage Page + { + get { return _page; } + set { _page = value; } + } + PdfPage _page; + + /// + /// Fixes the /P element in imported annotation. + /// + internal static void FixImportedAnnotation(PdfPage page) + { + PdfArray annots = page.Elements.GetArray(PdfPage.Keys.Annots); + if (annots != null) + { + int count = annots.Elements.Count; + for (int idx = 0; idx < count; idx++) + { + PdfDictionary annot = annots.Elements.GetDictionary(idx); + if (annot != null && annot.Elements.ContainsKey("/P")) + annot.Elements["/P"] = page.Reference; + } + } + } + + /// + /// Returns an enumerator that iterates through a collection. + /// + public override IEnumerator GetEnumerator() + { + return (IEnumerator)new AnnotationsIterator(this); + } + // THHO4STLA: AnnotationsIterator: Implementation does not work http://forum.pdfsharp.net/viewtopic.php?p=3285#p3285 + // Code using the enumerator like this will crash: + //foreach (var annotation in page.Annotations) + //{ + // annotation.GetType(); + //} + + //!!!new 2015-10-15: use PdfItem instead of PdfAnnotation. + // TODO Should we change this to "public new IEnumerator GetEnumerator()"? + + class AnnotationsIterator : IEnumerator + { + public AnnotationsIterator(PdfAnnotations annotations) + { + _annotations = annotations; + _index = -1; + } + + public PdfItem/*PdfAnnotation*/ Current + { + get { return _annotations[_index]; } + } + + object IEnumerator.Current + { + get { return Current; } + } + + public bool MoveNext() + { + return ++_index < _annotations.Count; + } + + public void Reset() + { + _index = -1; + } + + public void Dispose() + { + //throw new NotImplementedException(); + } + + readonly PdfAnnotations _annotations; + int _index; + } + } +} diff --git a/PdfSharp/Pdf.Annotations/PdfGenericAnnotation.cs b/PdfSharp/Pdf.Annotations/PdfGenericAnnotation.cs new file mode 100644 index 0000000..c1ab1fd --- /dev/null +++ b/PdfSharp/Pdf.Annotations/PdfGenericAnnotation.cs @@ -0,0 +1,64 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Annotations +{ + /// + /// Represents a generic annotation. Used for annotation dictionaries unknown to PDFsharp. + /// + internal sealed class PdfGenericAnnotation : PdfAnnotation + { + //DMH 6/7/06 + //Make this public so we can use it in PdfAnnotations to + //get the Meta data from existings annotations. + public PdfGenericAnnotation(PdfDictionary dict) + : base(dict) + { } + + /// + /// Predefined keys of this dictionary. + /// + internal new class Keys : PdfAnnotation.Keys + { + public static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Annotations/PdfLinkAnnotation.cs b/PdfSharp/Pdf.Annotations/PdfLinkAnnotation.cs new file mode 100644 index 0000000..1606d5d --- /dev/null +++ b/PdfSharp/Pdf.Annotations/PdfLinkAnnotation.cs @@ -0,0 +1,224 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf.Annotations +{ + /// + /// Represents a link annotation. + /// + public sealed class PdfLinkAnnotation : PdfAnnotation + { + // Just a hack to make MigraDoc work with this code. + enum LinkType + { + None, Document, Web, File + } + + /// + /// Initializes a new instance of the class. + /// + public PdfLinkAnnotation() + { + _linkType = LinkType.None; + Elements.SetName(PdfAnnotation.Keys.Subtype, "/Link"); + } + + /// + /// Initializes a new instance of the class. + /// + public PdfLinkAnnotation(PdfDocument document) + : base(document) + { + _linkType = LinkType.None; + Elements.SetName(PdfAnnotation.Keys.Subtype, "/Link"); + } + + /// + /// Creates a link within the current document. + /// + /// The link area in default page coordinates. + /// The one-based destination page number. + public static PdfLinkAnnotation CreateDocumentLink(PdfRectangle rect, int destinationPage) + { + if (destinationPage < 1) + throw new ArgumentException("Invalid destination page in call to CreateDocumentLink: page number is one-based and must be 1 or higher.", "destinationPage"); + + PdfLinkAnnotation link = new PdfLinkAnnotation(); + link._linkType = LinkType.Document; + link.Rectangle = rect; + link._destPage = destinationPage; + return link; + } + int _destPage; + LinkType _linkType; + string _url; + + /// + /// Creates a link to the web. + /// + public static PdfLinkAnnotation CreateWebLink(PdfRectangle rect, string url) + { + PdfLinkAnnotation link = new PdfLinkAnnotation(); + link._linkType = PdfLinkAnnotation.LinkType.Web; + link.Rectangle = rect; + link._url = url; + return link; + } + + /// + /// Creates a link to a file. + /// + public static PdfLinkAnnotation CreateFileLink(PdfRectangle rect, string fileName) + { + PdfLinkAnnotation link = new PdfLinkAnnotation(); + link._linkType = LinkType.File; + // TODO: Adjust bleed box here (if possible) + link.Rectangle = rect; + link._url = fileName; + return link; + } + + internal override void WriteObject(PdfWriter writer) + { + PdfPage dest = null; + //pdf.AppendFormat(CultureInfo.InvariantCulture, + // "{0} 0 obj\n<<\n/Type/Annot\n/Subtype/Link\n" + + // "/Rect[{1} {2} {3} {4}]\n/BS<>\n/Border[0 0 0]\n/C[0 0 0]\n", + // ObjectID.ObjectNumber, rect.X1, rect.Y1, rect.X2, rect.Y2); + + // Older Adobe Reader versions uses a border width of 0 as default value if neither Border nor BS are present. + // But the PDF Reference specifies: + // "If neither the Border nor the BS entry is present, the border is drawn as a solid line with a width of 1 point." + // After this issue was fixed in newer Reader versions older PDFsharp created documents show an ugly solid border. + // The following hack fixes this by specifying a 0 width border. + if (Elements[PdfAnnotation.Keys.BS] == null) + Elements[PdfAnnotation.Keys.BS] = new PdfLiteral("<>"); + + // May be superfluous. See comment above. + if (Elements[PdfAnnotation.Keys.Border] == null) + Elements[PdfAnnotation.Keys.Border] = new PdfLiteral("[0 0 0]"); + + switch (_linkType) + { + case LinkType.None: + break; + + case LinkType.Document: + // destIndex > Owner.PageCount can happen when rendering pages using PDFsharp directly. + int destIndex = _destPage; + if (destIndex > Owner.PageCount) + destIndex = Owner.PageCount; + destIndex--; + dest = Owner.Pages[destIndex]; + //pdf.AppendFormat("/Dest[{0} 0 R/XYZ null null 0]\n", dest.ObjectID); + Elements[Keys.Dest] = new PdfLiteral("[{0} 0 R/XYZ null null 0]", dest.ObjectNumber); + break; + + case LinkType.Web: + //pdf.AppendFormat("/A<>\n", PdfEncoders.EncodeAsLiteral(url)); + Elements[PdfAnnotation.Keys.A] = new PdfLiteral("<>", //PdfEncoders.EncodeAsLiteral(url)); + PdfEncoders.ToStringLiteral(_url, PdfStringEncoding.WinAnsiEncoding, writer.SecurityHandler)); + break; + + case LinkType.File: + //pdf.AppendFormat("/A<> >>\n", + // PdfEncoders.EncodeAsLiteral(url)); + Elements[PdfAnnotation.Keys.A] = new PdfLiteral("<> >>", + //PdfEncoders.EncodeAsLiteral(url)); + PdfEncoders.ToStringLiteral(_url, PdfStringEncoding.WinAnsiEncoding, writer.SecurityHandler)); + break; + } + base.WriteObject(writer); + } + + /// + /// Predefined keys of this dictionary. + /// + internal new class Keys : PdfAnnotation.Keys + { + // /// + // /// (Required) The type of annotation that this dictionary describes; + // /// must be Link for a link annotation. + // /// + // inherited from base class + + /// + /// (Optional; not permitted if an A entry is present) A destination to be displayed + /// when the annotation is activated. + /// + [KeyInfo(KeyType.ArrayOrNameOrString | KeyType.Optional)] + public const string Dest = "/Dest"; + + /// + /// (Optional; PDF 1.2) The annotations highlighting mode, the visual effect to be + /// used when the mouse button is pressed or held down inside its active area: + /// N (None) No highlighting. + /// I (Invert) Invert the contents of the annotation rectangle. + /// O (Outline) Invert the annotations border. + /// P (Push) Display the annotation as if it were being pushed below the surface of the page. + /// Default value: I. + /// Note: In PDF 1.1, highlighting is always done by inverting colors inside the annotation rectangle. + /// + [KeyInfo("1.2", KeyType.Name | KeyType.Optional)] + public const string H = "/H"; + + /// + /// (Optional; PDF 1.3) A URI action formerly associated with this annotation. When Web + /// Capture changes and annotation from a URI to a go-to action, it uses this entry to save + /// the data from the original URI action so that it can be changed back in case the target page for + /// the go-to action is subsequently deleted. + /// + [KeyInfo("1.3", KeyType.Dictionary | KeyType.Optional)] + public const string PA = "/PA"; + + // QuadPoints + + /// + /// Gets the KeysMeta for these keys. + /// + public static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Annotations/PdfRubberStampAnnotation.cs b/PdfSharp/Pdf.Annotations/PdfRubberStampAnnotation.cs new file mode 100644 index 0000000..602adb7 --- /dev/null +++ b/PdfSharp/Pdf.Annotations/PdfRubberStampAnnotation.cs @@ -0,0 +1,133 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Pdf.Annotations +{ + /// + /// Represents a rubber stamp annotation. + /// + public sealed class PdfRubberStampAnnotation : PdfAnnotation + { + /// + /// Initializes a new instance of the class. + /// + public PdfRubberStampAnnotation() + { + Initialize(); + } + + /// + /// Initializes a new instance of the class. + /// + /// The document. + public PdfRubberStampAnnotation(PdfDocument document) + : base(document) + { + Initialize(); + } + + void Initialize() + { + Elements.SetName(Keys.Subtype, "/Stamp"); + Color = XColors.Yellow; + } + + /// + /// Gets or sets an icon to be used in displaying the annotation. + /// + public PdfRubberStampAnnotationIcon Icon + { + get + { + string value = Elements.GetName(Keys.Name); + if (value == "") + return PdfRubberStampAnnotationIcon.NoIcon; + value = value.Substring(1); + if (!Enum.IsDefined(typeof(PdfRubberStampAnnotationIcon), value)) + return PdfRubberStampAnnotationIcon.NoIcon; + return (PdfRubberStampAnnotationIcon)Enum.Parse(typeof(PdfRubberStampAnnotationIcon), value, false); + } + set + { + if (Enum.IsDefined(typeof(PdfRubberStampAnnotationIcon), value) && + PdfRubberStampAnnotationIcon.NoIcon != value) + { + Elements.SetName(Keys.Name, "/" + value.ToString()); + } + else + Elements.Remove(Keys.Name); + } + } + + /// + /// Predefined keys of this dictionary. + /// + internal new class Keys : PdfAnnotation.Keys + { + /// + /// (Optional) The name of an icon to be used in displaying the annotation. Viewer + /// applications should provide predefined icon appearances for at least the following + /// standard names: + /// Approved + /// AsIs + /// Confidential + /// Departmental + /// Draft + /// Experimental + /// Expired + /// Final + /// ForComment + /// ForPublicRelease + /// NotApproved + /// NotForPublicRelease + /// Sold + /// TopSecret + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string Name = "/Name"; + + public static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Annotations/PdfTextAnnotation.cs b/PdfSharp/Pdf.Annotations/PdfTextAnnotation.cs new file mode 100644 index 0000000..57a7c95 --- /dev/null +++ b/PdfSharp/Pdf.Annotations/PdfTextAnnotation.cs @@ -0,0 +1,154 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.Annotations +{ + /// + /// Represents a text annotation. + /// + public sealed class PdfTextAnnotation : PdfAnnotation + { + /// + /// Initializes a new instance of the class. + /// + public PdfTextAnnotation() + { + Initialize(); + } + + /// + /// Initializes a new instance of the class. + /// + public PdfTextAnnotation(PdfDocument document) + : base(document) + { + Initialize(); + } + + void Initialize() + { + Elements.SetName(Keys.Subtype, "/Text"); + // By default make a yellow comment. + Icon = PdfTextAnnotationIcon.Comment; + //Color = XColors.Yellow; + } + + // public static PdfTextAnnotation CreateDocumentLink(PdfRectangle rect, int destinatinPage) + // { + // PdfTextAnnotation link = new PdfTextAnnotation(); + // //link.linkType = PdfTextAnnotation.LinkType.Document; + // //link.Rectangle = rect; + // //link.destPage = destinatinPage; + // return link; + // } + + /// + /// Gets or sets a flag indicating whether the annotation should initially be displayed open. + /// + public bool Open + { + get { return Elements.GetBoolean(Keys.Open); } + set { Elements.SetBoolean(Keys.Open, value); } + } + + /// + /// Gets or sets an icon to be used in displaying the annotation. + /// + public PdfTextAnnotationIcon Icon + { + get + { + string value = Elements.GetName(Keys.Name); + if (value == "") + return PdfTextAnnotationIcon.NoIcon; + value = value.Substring(1); + if (!Enum.IsDefined(typeof(PdfTextAnnotationIcon), value)) + return PdfTextAnnotationIcon.NoIcon; + return (PdfTextAnnotationIcon)Enum.Parse(typeof(PdfTextAnnotationIcon), value, false); + } + set + { + if (Enum.IsDefined(typeof(PdfTextAnnotationIcon), value) && + PdfTextAnnotationIcon.NoIcon != value) + { + Elements.SetName(Keys.Name, "/" + value.ToString()); + } + else + Elements.Remove(Keys.Name); + } + } + + /// + /// Predefined keys of this dictionary. + /// + internal new class Keys : PdfAnnotation.Keys + { + /// + /// (Optional) A flag specifying whether the annotation should initially be displayed open. + /// Default value: false (closed). + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string Open = "/Open"; + + /// + /// (Optional) The name of an icon to be used in displaying the annotation. Viewer + /// applications should provide predefined icon appearances for at least the following + /// standard names: + /// Comment + /// Help + /// Insert + /// Key + /// NewParagraph + /// Note + /// Paragraph + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string Name = "/Name"; + + //State + //StateModel + + public static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Annotations/PdfWidgetAnnotation.cs b/PdfSharp/Pdf.Annotations/PdfWidgetAnnotation.cs new file mode 100644 index 0000000..dfb4bb8 --- /dev/null +++ b/PdfSharp/Pdf.Annotations/PdfWidgetAnnotation.cs @@ -0,0 +1,97 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Annotations +{ + /// + /// Represents a text annotation. + /// + internal sealed class PdfWidgetAnnotation : PdfAnnotation + { + public PdfWidgetAnnotation() + { + Initialize(); + } + + public PdfWidgetAnnotation(PdfDocument document) + : base(document) + { + Initialize(); + } + + void Initialize() + { + Elements.SetName(Keys.Subtype, "/Widget"); + } + + /// + /// Predefined keys of this dictionary. + /// + internal new class Keys : PdfAnnotation.Keys + { + /// + /// (Optional) The annotations highlighting mode, the visual effect to be used when + /// the mouse button is pressed or held down inside its active area: + /// N (None) No highlighting. + /// I (Invert) Invert the contents of the annotation rectangle. + /// O (Outline) Invert the annotations border. + /// P (Push) Display the annotations down appearance, if any. If no down appearance is defined, + /// offset the contents of the annotation rectangle to appear as if it were being pushed below + /// the surface of the page. + /// T (Toggle) Same as P (which is preferred). + /// A highlighting mode other than P overrides any down appearance defined for the annotation. + /// Default value: I. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string H = "/H"; + + /// + /// (Optional) An appearance characteristics dictionary to be used in constructing a dynamic + /// appearance stream specifying the annotations visual presentation on the page. + /// The name MK for this entry is of historical significance only and has no direct meaning. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional)] + public const string MK = "/MK"; + + public static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf.Annotations/enums/PdfAnnotationFlags.cs b/PdfSharp/Pdf.Annotations/enums/PdfAnnotationFlags.cs new file mode 100644 index 0000000..64a6f1c --- /dev/null +++ b/PdfSharp/Pdf.Annotations/enums/PdfAnnotationFlags.cs @@ -0,0 +1,112 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Annotations +{ + /// + /// Specifies the annotation flags. + /// + [System.Flags] + public enum PdfAnnotationFlags + { + /// + /// If set, do not display the annotation if it does not belong to one of the standard + /// annotation types and no annotation handler is available. If clear, display such an + /// unknown annotation using an appearance stream specified by its appearancedictionary, + /// if any. + /// + Invisible = 1 << (1 - 1), + + /// + /// (PDF 1.2) If set, do not display or print the annotation or allow it to interact + /// with the user, regardless of its annotation type or whether an annotation + /// handler is available. In cases where screen space is limited, the ability to hide + /// and show annotations selectively can be used in combination with appearance + /// streams to display auxiliary pop-up information similar in function to online + /// help systems. + /// + Hidden = 1 << (2 - 1), + + /// + /// (PDF 1.2) If set, print the annotation when the page is printed. If clear, never + /// print the annotation, regardless of whether it is displayed on the screen. This + /// can be useful, for example, for annotations representing interactive pushbuttons, + /// which would serve no meaningful purpose on the printed page. + /// + Print = 1 << (3 - 1), + + /// + /// (PDF 1.3) If set, do not scale the annotations appearance to match the magnification + /// of the page. The location of the annotation on the page (defined by the + /// upper-left corner of its annotation rectangle) remains fixed, regardless of the + /// page magnification. See below for further discussion. + /// + NoZoom = 1 << (4 - 1), + + /// + /// (PDF 1.3) If set, do not rotate the annotations appearance to match the rotation + /// of the page. The upper-left corner of the annotation rectangle remains in a fixed + /// location on the page, regardless of the page rotation. See below for further discussion. + /// + NoRotate = 1 << (5 - 1), + + /// + /// (PDF 1.3) If set, do not display the annotation on the screen or allow it to + /// interact with the user. The annotation may be printed (depending on the setting + /// of the Print flag) but should be considered hidden for purposes of on-screen + /// display and user interaction. + /// + NoView = 1 << (6 - 1), + + /// + /// (PDF 1.3) If set, do not allow the annotation to interact with the user. The + /// annotation may be displayed or printed (depending on the settings of the + /// NoView and Print flags) but should not respond to mouse clicks or change its + /// appearance in response to mouse motions. + /// Note: This flag is ignored for widget annotations; its function is subsumed by + /// the ReadOnly flag of the associated form field. + /// + ReadOnly = 1 << (7 - 1), + + /// + /// (PDF 1.4) If set, do not allow the annotation to be deleted or its properties + /// (including position and size) to be modified by the user. However, this flag does + /// not restrict changes to the annotations contents, such as the value of a form + /// field. + /// + Locked = 1 << (8 - 1), + + /// + /// (PDF 1.5) If set, invert the interpretation of the NoView flag for certain events. + /// A typical use is to have an annotation that appears only when a mouse cursor is + /// held over it. + /// + ToggleNoView = 1 << (9 - 1), + } +} diff --git a/PdfSharp/Pdf.Annotations/enums/PdfRubberStampAnnotationIcon.cs b/PdfSharp/Pdf.Annotations/enums/PdfRubberStampAnnotationIcon.cs new file mode 100644 index 0000000..796d1d5 --- /dev/null +++ b/PdfSharp/Pdf.Annotations/enums/PdfRubberStampAnnotationIcon.cs @@ -0,0 +1,112 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Annotations +{ + /// + /// Specifies the predefined icon names of rubber stamp annotations. + /// + public enum PdfRubberStampAnnotationIcon + { + /// + /// A pre-defined rubber stamp annotation icon. + /// + NoIcon, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + Approved, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + AsIs, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + Confidential, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + Departmental, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + Draft, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + Experimental, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + Expired, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + Final, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + ForComment, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + ForPublicRelease, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + NotApproved, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + NotForPublicRelease, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + Sold, + + /// + /// A pre-defined rubber stamp annotation icon. + /// + TopSecret, + } +} diff --git a/PdfSharp/Pdf.Annotations/enums/PdfTextAnnotationIcon.cs b/PdfSharp/Pdf.Annotations/enums/PdfTextAnnotationIcon.cs new file mode 100644 index 0000000..5eb8b46 --- /dev/null +++ b/PdfSharp/Pdf.Annotations/enums/PdfTextAnnotationIcon.cs @@ -0,0 +1,77 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Annotations +{ + /// + /// Specifies the pre-defined icon names of text annotations. + /// + public enum PdfTextAnnotationIcon + { + /// + /// A pre-defined annotation icon. + /// + NoIcon, + + /// + /// A pre-defined annotation icon. + /// + Comment, + + /// + /// A pre-defined annotation icon. + /// + Help, + + /// + /// A pre-defined annotation icon. + /// + Insert, + + /// + /// A pre-defined annotation icon. + /// + Key, + + /// + /// A pre-defined annotation icon. + /// + NewParagraph, + + /// + /// A pre-defined annotation icon. + /// + Note, + + /// + /// A pre-defined annotation icon. + /// + Paragraph, + } +} diff --git a/PdfSharp/Pdf.Content.Objects/CObjects.cs b/PdfSharp/Pdf.Content.Objects/CObjects.cs new file mode 100644 index 0000000..57446e2 --- /dev/null +++ b/PdfSharp/Pdf.Content.Objects/CObjects.cs @@ -0,0 +1,919 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Collections; +using System.Globalization; +using System.IO; +using System.Text; + +namespace PdfSharp.Pdf.Content.Objects // TODO: split into single files +{ + /// + /// Base class for all PDF content stream objects. + /// + public abstract class CObject : ICloneable + { + /// + /// Initializes a new instance of the class. + /// + protected CObject() + { } + + /// + /// Creates a new object that is a copy of the current instance. + /// + object ICloneable.Clone() + { + return Copy(); + } + + /// + /// Creates a new object that is a copy of the current instance. + /// + public CObject Clone() + { + return Copy(); + } + + /// + /// Implements the copy mechanism. Must be overridden in derived classes. + /// + protected virtual CObject Copy() + { + return (CObject)MemberwiseClone(); + } + + /// + /// + /// + internal abstract void WriteObject(ContentWriter writer); + } + + /// + /// Represents a comment in a PDF content stream. + /// + [DebuggerDisplay("({Text})")] + public class CComment : CObject + { + /// + /// Creates a new object that is a copy of the current instance. + /// + public new CComment Clone() + { + return (CComment)Copy(); + } + + /// + /// Implements the copy mechanism of this class. + /// + protected override CObject Copy() + { + CObject obj = base.Copy(); + return obj; + } + + /// + /// Gets or sets the comment text. + /// + public string Text + { + get { return _text; } + set { _text = value; } + } + string _text; + + /// + /// Returns a string that represents the current comment. + /// + public override string ToString() + { + return "% " + _text; + } + + internal override void WriteObject(ContentWriter writer) + { + writer.WriteLineRaw(ToString()); + } + } + + /// + /// Represents a sequence of objects in a PDF content stream. + /// + [DebuggerDisplay("(count={Count})")] + public class CSequence : CObject, IList // , ICollection, IEnumerable + { + /// + /// Creates a new object that is a copy of the current instance. + /// + public new CSequence Clone() + { + return (CSequence)Copy(); + } + + /// + /// Implements the copy mechanism of this class. + /// + protected override CObject Copy() + { + CObject obj = base.Copy(); + _items = new List(_items); + for (int idx = 0; idx < _items.Count; idx++) + _items[idx] = _items[idx].Clone(); + return obj; + } + + /// + /// Adds the specified sequence. + /// + /// The sequence. + public void Add(CSequence sequence) + { + int count = sequence.Count; + for (int idx = 0; idx < count; idx++) + _items.Add(sequence[idx]); + } + + #region IList Members + + /// + /// Adds the specified value add the end of the sequence. + /// + public void Add(CObject value) + { + _items.Add(value); + } + + /// + /// Removes all elements from the sequence. + /// + public void Clear() + { + _items.Clear(); + } + + //bool IList.Contains(object value) + //{ + // return items.Contains(value); + //} + + /// + /// Determines whether the specified value is in the sequence. + /// + public bool Contains(CObject value) + { + return _items.Contains(value); + } + + /// + /// Returns the index of the specified value in the sequence or -1, if no such value is in the sequence. + /// + public int IndexOf(CObject value) + { + return _items.IndexOf(value); + } + + /// + /// Inserts the specified value in the sequence. + /// + public void Insert(int index, CObject value) + { + _items.Insert(index, value); + } + + /////// + /////// Gets a value indicating whether the sequence has a fixed size. + /////// + ////public bool IsFixedSize + ////{ + //// get { return items.IsFixedSize; } + ////} + + /////// + /////// Gets a value indicating whether the sequence is read-only. + /////// + ////public bool IsReadOnly + ////{ + //// get { return items.IsReadOnly; } + ////} + + /// + /// Removes the specified value from the sequence. + /// + public bool Remove(CObject value) + { + return _items.Remove(value); + } + + /// + /// Removes the value at the specified index from the sequence. + /// + public void RemoveAt(int index) + { + _items.RemoveAt(index); + } + + /// + /// Gets or sets a CObject at the specified index. + /// + /// + public CObject this[int index] + { + get { return (CObject)_items[index]; } + set { _items[index] = value; } + } + #endregion + + #region ICollection Members + + /// + /// Copies the elements of the sequence to the specified array. + /// + public void CopyTo(CObject[] array, int index) + { + _items.CopyTo(array, index); + } + + + /// + /// Gets the number of elements contained in the sequence. + /// + public int Count + { + get { return _items.Count; } + } + + ///// + ///// Gets a value indicating whether access to the sequence is synchronized (thread safe). + ///// + //public bool IsSynchronized + //{ + // get { return items.IsSynchronized; } + //} + + ///// + ///// Gets an object that can be used to synchronize access to the sequence. + ///// + //public object SyncRoot + //{ + // get { return items.SyncRoot; } + //} + + #endregion + + #region IEnumerable Members + + /// + /// Returns an enumerator that iterates through the sequence. + /// + public IEnumerator GetEnumerator() + { + return _items.GetEnumerator(); + } + + #endregion + + /// + /// Converts the sequence to a PDF content stream. + /// + public byte[] ToContent() + { + Stream stream = new MemoryStream(); + ContentWriter writer = new ContentWriter(stream); + WriteObject(writer); + writer.Close(false); + + stream.Position = 0; + int count = (int)stream.Length; + byte[] bytes = new byte[count]; + stream.Read(bytes, 0, count); +#if !UWP + stream.Close(); +#else + stream.Dispose(); +#endif + return bytes; + } + + /// + /// Returns a string containing all elements of the sequence. + /// + public override string ToString() + { + StringBuilder s = new StringBuilder(); + + for (int idx = 0; idx < _items.Count; idx++) + s.Append(_items[idx]); + + return s.ToString(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + internal override void WriteObject(ContentWriter writer) + { + for (int idx = 0; idx < _items.Count; idx++) + _items[idx].WriteObject(writer); + } + + #region IList Members + + int IList.IndexOf(CObject item) + { + throw new NotImplementedException(); + } + + void IList.Insert(int index, CObject item) + { + throw new NotImplementedException(); + } + + void IList.RemoveAt(int index) + { + throw new NotImplementedException(); + } + + CObject IList.this[int index] + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + #endregion + + #region ICollection Members + + void ICollection.Add(CObject item) + { + throw new NotImplementedException(); + } + + void ICollection.Clear() + { + throw new NotImplementedException(); + } + + bool ICollection.Contains(CObject item) + { + throw new NotImplementedException(); + } + + void ICollection.CopyTo(CObject[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + int ICollection.Count + { + get { throw new NotImplementedException(); } + } + + bool ICollection.IsReadOnly + { + get { throw new NotImplementedException(); } + } + + bool ICollection.Remove(CObject item) + { + throw new NotImplementedException(); + } + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + #endregion + + List _items = new List(); + } + + /// + /// Represents the base class for numerical objects in a PDF content stream. + /// + public abstract class CNumber : CObject + { + /// + /// Creates a new object that is a copy of the current instance. + /// + public new CNumber Clone() + { + return (CNumber)Copy(); + } + + /// + /// Implements the copy mechanism of this class. + /// + protected override CObject Copy() + { + CObject obj = base.Copy(); + return obj; + } + + //internal override void WriteObject(ContentWriter writer) + //{ + // throw new Exception("Must not come here."); + //} + } + + /// + /// Represents an integer value in a PDF content stream. + /// + [DebuggerDisplay("({Value})")] + public class CInteger : CNumber + { + /// + /// Creates a new object that is a copy of the current instance. + /// + public new CInteger Clone() + { + return (CInteger)Copy(); + } + + /// + /// Implements the copy mechanism of this class. + /// + protected override CObject Copy() + { + CObject obj = base.Copy(); + return obj; + } + + /// + /// Gets or sets the value. + /// + public int Value + { + get { return _value; } + set { _value = value; } + } + int _value; + + /// + /// Returns a string that represents the current value. + /// + public override string ToString() + { + return _value.ToString(CultureInfo.InvariantCulture); + } + + internal override void WriteObject(ContentWriter writer) + { + writer.WriteRaw(ToString() + " "); + } + } + + /// + /// Represents a real value in a PDF content stream. + /// + [DebuggerDisplay("({Value})")] + public class CReal : CNumber + { + /// + /// Creates a new object that is a copy of the current instance. + /// + public new CReal Clone() + { + return (CReal)Copy(); + } + + /// + /// Implements the copy mechanism of this class. + /// + protected override CObject Copy() + { + CObject obj = base.Copy(); + return obj; + } + + /// + /// Gets or sets the value. + /// + public double Value + { + get { return _value; } + set { _value = value; } + } + double _value; + + /// + /// Returns a string that represents the current value. + /// + public override string ToString() + { + const string format = Config.SignificantFigures1Plus9; + return _value.ToString(format, CultureInfo.InvariantCulture); + } + + internal override void WriteObject(ContentWriter writer) + { + writer.WriteRaw(ToString() + " "); + } + } + + /// + /// Type of the parsed string. + /// + public enum CStringType + { + /// + /// The string has the format "(...)". + /// + String, + + /// + /// The string has the format "<...>". + /// + HexString, + + /// + /// The string... TODO. + /// + UnicodeString, + + /// + /// The string... TODO. + /// + UnicodeHexString, + + /// + /// HACK: The string is the content of a dictionary. + /// Currently there is no parser for dictionaries in Content Streams. + /// + Dictionary, + } + + /// + /// Represents a string value in a PDF content stream. + /// + [DebuggerDisplay("({Value})")] + public class CString : CObject + { + /// + /// Creates a new object that is a copy of the current instance. + /// + public new CString Clone() + { + return (CString)Copy(); + } + + /// + /// Implements the copy mechanism of this class. + /// + protected override CObject Copy() + { + CObject obj = base.Copy(); + return obj; + } + + /// + /// Gets or sets the value. + /// + public string Value + { + get { return _value; } + set { _value = value; } + } + string _value; + + /// + /// Gets or sets the type of the content string. + /// + public CStringType CStringType + { + get { return _cStringType; } + set { _cStringType = value; } + } + CStringType _cStringType; + + /// + /// Returns a string that represents the current value. + /// + public override string ToString() + { + StringBuilder s = new StringBuilder(); + switch (CStringType) + { + case CStringType.String: + s.Append("("); + int length = _value.Length; + for (int ich = 0; ich < length; ich++) + { + char ch = _value[ich]; + switch (ch) + { + case Chars.LF: + s.Append("\\n"); + break; + + case Chars.CR: + s.Append("\\r"); + break; + + case Chars.HT: + s.Append("\\t"); + break; + + case Chars.BS: + s.Append("\\b"); + break; + + case Chars.FF: + s.Append("\\f"); + break; + + case Chars.ParenLeft: + s.Append("\\("); + break; + + case Chars.ParenRight: + s.Append("\\)"); + break; + + case Chars.BackSlash: + s.Append("\\\\"); + break; + + default: +#if true_ + // not absolut necessary to use octal encoding for characters less than blank + if (ch < ' ') + { + s.Append("\\"); + s.Append((char)(((ch >> 6) & 7) + '0')); + s.Append((char)(((ch >> 3) & 7) + '0')); + s.Append((char)((ch & 7) + '0')); + } + else +#endif + s.Append(ch); + break; + } + } + s.Append(')'); + break; + + + case CStringType.HexString: + throw new NotImplementedException(); + //break; + + case CStringType.UnicodeString: + throw new NotImplementedException(); + //break; + + case CStringType.UnicodeHexString: + throw new NotImplementedException(); + //break; + + case CStringType.Dictionary: + s.Append(_value); + break; + + default: + throw new ArgumentOutOfRangeException(); + } + return s.ToString(); + } + + internal override void WriteObject(ContentWriter writer) + { + writer.WriteRaw(ToString()); + } + } + + /// + /// Represents a name in a PDF content stream. + /// + [DebuggerDisplay("({Name})")] + public class CName : CObject + { + /// + /// Initializes a new instance of the class. + /// + public CName() + { + _name = "/"; + } + + /// + /// Initializes a new instance of the class. + /// + /// The name. + public CName(string name) + { + Name = name; + } + + /// + /// Creates a new object that is a copy of the current instance. + /// + public new CName Clone() + { + return (CName)Copy(); + } + + /// + /// Implements the copy mechanism of this class. + /// + protected override CObject Copy() + { + CObject obj = base.Copy(); + return obj; + } + + /// + /// Gets or sets the name. Names must start with a slash. + /// + public string Name + { + get { return _name; } + set + { + if (String.IsNullOrEmpty(_name)) + throw new ArgumentNullException(nameof(value)); + if (_name[0] != '/') + throw new ArgumentException(PSSR.NameMustStartWithSlash); + _name = value; + } + } + string _name; + + /// + /// Returns a string that represents the current value. + /// + public override string ToString() + { + return _name; + } + + internal override void WriteObject(ContentWriter writer) + { + writer.WriteRaw(ToString() + " "); + } + } + + /// + /// Represents an array of objects in a PDF content stream. + /// + [DebuggerDisplay("(count={Count})")] + public class CArray : CSequence + { + /// + /// Creates a new object that is a copy of the current instance. + /// + public new CArray Clone() + { + return (CArray)Copy(); + } + + /// + /// Implements the copy mechanism of this class. + /// + protected override CObject Copy() + { + CObject obj = base.Copy(); + return obj; + } + + /// + /// Returns a string that represents the current value. + /// + public override string ToString() + { + return "[" + base.ToString() + "]"; + } + + internal override void WriteObject(ContentWriter writer) + { + writer.WriteRaw(ToString()); + } + } + + /// + /// Represents an operator a PDF content stream. + /// + [DebuggerDisplay("({Name}, operands={Operands.Count})")] + public class COperator : CObject + { + /// + /// Initializes a new instance of the class. + /// + protected COperator() + { } + + internal COperator(OpCode opcode) + { + _opcode = opcode; + } + + /// + /// Creates a new object that is a copy of the current instance. + /// + public new COperator Clone() + { + return (COperator)Copy(); + } + + /// + /// Implements the copy mechanism of this class. + /// + protected override CObject Copy() + { + CObject obj = base.Copy(); + return obj; + } + + /// + /// Gets or sets the name of the operator + /// + /// The name. + public virtual string Name + { + get { return _opcode.Name; } + } + + /// + /// Gets or sets the operands. + /// + /// The operands. + public CSequence Operands + { + get { return _seqence ?? (_seqence = new CSequence()); } + } + CSequence _seqence; + + /// + /// Gets the operator description for this instance. + /// + public OpCode OpCode + { + get { return _opcode; } + } + readonly OpCode _opcode; + + + /// + /// Returns a string that represents the current operator. + /// + public override string ToString() + { + if (_opcode.OpCodeName == OpCodeName.Dictionary) + return " "; + + return Name; + } + + internal override void WriteObject(ContentWriter writer) + { + int count = _seqence != null ? _seqence.Count : 0; + for (int idx = 0; idx < count; idx++) + { + // ReSharper disable once PossibleNullReferenceException because the loop is not entered if _sequence is null + _seqence[idx].WriteObject(writer); + } + writer.WriteLineRaw(ToString()); + } + } +} diff --git a/PdfSharp/Pdf.Content.Objects/Operators.cs b/PdfSharp/Pdf.Content.Objects/Operators.cs new file mode 100644 index 0000000..6bcac2a --- /dev/null +++ b/PdfSharp/Pdf.Content.Objects/Operators.cs @@ -0,0 +1,367 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using System.Collections.Generic; + +namespace PdfSharp.Pdf.Content.Objects +{ + /// + /// Represents a PDF content stream operator description. + /// + public sealed class OpCode + { + /// + /// Initializes a new instance of the class. + /// + /// The name. + /// The enum value of the operator. + /// The number of operands. + /// The postscript equivalent, or null, if no such operation exists. + /// The flags. + /// The description from Adobe PDF Reference. + internal OpCode(string name, OpCodeName opcodeName, int operands, string postscript, OpCodeFlags flags, string description) + { + Name = name; + OpCodeName = opcodeName; + Operands = operands; + Postscript = postscript; + Flags = flags; + Description = description; + } + + /// + /// The name of the operator. + /// + public readonly string Name; + + /// + /// The enum value of the operator. + /// + public readonly OpCodeName OpCodeName; + + /// + /// The number of operands. -1 indicates a variable number of operands. + /// + public readonly int Operands; + + /// + /// The flags. + /// + public readonly OpCodeFlags Flags; + + /// + /// The postscript equivalent, or null, if no such operation exists. + /// + public readonly string Postscript; + + /// + /// The description from Adobe PDF Reference. + /// + public readonly string Description; + } + + /// + /// Static class with all PDF op-codes. + /// + public static class OpCodes + { + /// + /// Operators from name. + /// + /// The name. + public static COperator OperatorFromName(string name) + { + COperator op = null; + OpCode opcode = StringToOpCode[name]; + if (opcode != null) + { + op = new COperator(opcode); + } + else + { + Debug.Assert(false, "Unknown operator in PDF content stream."); + } + return op; + } + + /// + /// Initializes the class. + /// + static OpCodes() + { + StringToOpCode = new Dictionary(); + for (int idx = 0; idx < ops.Length; idx++) + { + OpCode op = ops[idx]; + StringToOpCode.Add(op.Name, op); + } + } + static readonly Dictionary StringToOpCode; + + // ReSharper disable InconsistentNaming + + static readonly OpCode Dictionary = new OpCode("Dictionary", OpCodeName.Dictionary, -1, "name, dictionary", OpCodeFlags.None, + "E.g.: /Name << ... >>"); + + static readonly OpCode b = new OpCode("b", OpCodeName.b, 0, "closepath, fill, stroke", OpCodeFlags.None, + "Close, fill, and stroke path using nonzero winding number"); + + static readonly OpCode B = new OpCode("B", OpCodeName.B, 0, "fill, stroke", OpCodeFlags.None, + "Fill and stroke path using nonzero winding number rule"); + + static readonly OpCode bx = new OpCode("b*", OpCodeName.bx, 0, "closepath, eofill, stroke", OpCodeFlags.None, + "Close, fill, and stroke path using even-odd rule"); + + static readonly OpCode Bx = new OpCode("B*", OpCodeName.Bx, 0, "eofill, stroke", OpCodeFlags.None, + "Fill and stroke path using even-odd rule"); + + static readonly OpCode BDC = new OpCode("BDC", OpCodeName.BDC, -1, null, OpCodeFlags.None, + "(PDF 1.2) Begin marked-content sequence with property list"); + + static readonly OpCode BI = new OpCode("BI", OpCodeName.BI, 0, null, OpCodeFlags.None, + "Begin inline image object"); + + static readonly OpCode BMC = new OpCode("BMC", OpCodeName.BMC, 1, null, OpCodeFlags.None, + "(PDF 1.2) Begin marked-content sequence"); + + static readonly OpCode BT = new OpCode("BT", OpCodeName.BT, 0, null, OpCodeFlags.None, + "Begin text object"); + + static readonly OpCode BX = new OpCode("BX", OpCodeName.BX, 0, null, OpCodeFlags.None, + "(PDF 1.1) Begin compatibility section"); + + static readonly OpCode c = new OpCode("c", OpCodeName.c, 6, "curveto", OpCodeFlags.None, + "Append curved segment to path (three control points)"); + + static readonly OpCode cm = new OpCode("cm", OpCodeName.cm, 6, "concat", OpCodeFlags.None, + "Concatenate matrix to current transformation matrix"); + + static readonly OpCode CS = new OpCode("CS", OpCodeName.CS, 1, "setcolorspace", OpCodeFlags.None, + "(PDF 1.1) Set color space for stroking operations"); + + static readonly OpCode cs = new OpCode("cs", OpCodeName.cs, 1, "setcolorspace", OpCodeFlags.None, + "(PDF 1.1) Set color space for nonstroking operations"); + + static readonly OpCode d = new OpCode("d", OpCodeName.d, 2, "setdash", OpCodeFlags.None, + "Set line dash pattern"); + + static readonly OpCode d0 = new OpCode("d0", OpCodeName.d0, 2, "setcharwidth", OpCodeFlags.None, + "Set glyph width in Type 3 font"); + + static readonly OpCode d1 = new OpCode("d1", OpCodeName.d1, 6, "setcachedevice", OpCodeFlags.None, + "Set glyph width and bounding box in Type 3 font"); + + static readonly OpCode Do = new OpCode("Do", OpCodeName.Do, 1, null, OpCodeFlags.None, + "Invoke named XObject"); + + static readonly OpCode DP = new OpCode("DP", OpCodeName.DP, 2, null, OpCodeFlags.None, + "(PDF 1.2) Define marked-content point with property list"); + + static readonly OpCode EI = new OpCode("EI", OpCodeName.EI, 0, null, OpCodeFlags.None, + "End inline image object"); + + static readonly OpCode EMC = new OpCode("EMC", OpCodeName.EMC, 0, null, OpCodeFlags.None, + "(PDF 1.2) End marked-content sequence"); + + static readonly OpCode ET = new OpCode("ET", OpCodeName.ET, 0, null, OpCodeFlags.None, + "End text object"); + + static readonly OpCode EX = new OpCode("EX", OpCodeName.EX, 0, null, OpCodeFlags.None, + "(PDF 1.1) End compatibility section"); + + static readonly OpCode f = new OpCode("f", OpCodeName.f, 0, "fill", OpCodeFlags.None, + "Fill path using nonzero winding number rule"); + + static readonly OpCode F = new OpCode("F", OpCodeName.F, 0, "fill", OpCodeFlags.None, + "Fill path using nonzero winding number rule (obsolete)"); + + static readonly OpCode fx = new OpCode("f*", OpCodeName.fx, 0, "eofill", OpCodeFlags.None, + "Fill path using even-odd rule"); + + static readonly OpCode G = new OpCode("G", OpCodeName.G, 1, "setgray", OpCodeFlags.None, + "Set gray level for stroking operations"); + + static readonly OpCode g = new OpCode("g", OpCodeName.g, 1, "setgray", OpCodeFlags.None, + "Set gray level for nonstroking operations"); + + static readonly OpCode gs = new OpCode("gs", OpCodeName.gs, 1, null, OpCodeFlags.None, + "(PDF 1.2) Set parameters from graphics state parameter dictionary"); + + static readonly OpCode h = new OpCode("h", OpCodeName.h, 0, "closepath", OpCodeFlags.None, + "Close subpath"); + + static readonly OpCode i = new OpCode("i", OpCodeName.i, 1, "setflat", OpCodeFlags.None, + "Set flatness tolerance"); + + static readonly OpCode ID = new OpCode("ID", OpCodeName.ID, 0, null, OpCodeFlags.None, + "Begin inline image data"); + + static readonly OpCode j = new OpCode("j", OpCodeName.j, 1, "setlinejoin", OpCodeFlags.None, + "Set line join style"); + + static readonly OpCode J = new OpCode("J", OpCodeName.J, 1, "setlinecap", OpCodeFlags.None, + "Set line cap style"); + + static readonly OpCode K = new OpCode("K", OpCodeName.K, 4, "setcmykcolor", OpCodeFlags.None, + "Set CMYK color for stroking operations"); + + static readonly OpCode k = new OpCode("k", OpCodeName.k, 4, "setcmykcolor", OpCodeFlags.None, + "Set CMYK color for nonstroking operations"); + + static readonly OpCode l = new OpCode("l", OpCodeName.l, 2, "lineto", OpCodeFlags.None, + "Append straight line segment to path"); + + static readonly OpCode m = new OpCode("m", OpCodeName.m, 2, "moveto", OpCodeFlags.None, + "Begin new subpath"); + + static readonly OpCode M = new OpCode("M", OpCodeName.M, 1, "setmiterlimit", OpCodeFlags.None, + "Set miter limit"); + + static readonly OpCode MP = new OpCode("MP", OpCodeName.MP, 1, null, OpCodeFlags.None, + "(PDF 1.2) Define marked-content point"); + + static readonly OpCode n = new OpCode("n", OpCodeName.n, 0, null, OpCodeFlags.None, + "End path without filling or stroking"); + + static readonly OpCode q = new OpCode("q", OpCodeName.q, 0, "gsave", OpCodeFlags.None, + "Save graphics state"); + + static readonly OpCode Q = new OpCode("Q", OpCodeName.Q, 0, "grestore", OpCodeFlags.None, + "Restore graphics state"); + + static readonly OpCode re = new OpCode("re", OpCodeName.re, 4, null, OpCodeFlags.None, + "Append rectangle to path"); + + static readonly OpCode RG = new OpCode("RG", OpCodeName.RG, 3, "setrgbcolor", OpCodeFlags.None, + "Set RGB color for stroking operations"); + + static readonly OpCode rg = new OpCode("rg", OpCodeName.rg, 3, "setrgbcolor", OpCodeFlags.None, + "Set RGB color for nonstroking operations"); + + static readonly OpCode ri = new OpCode("ri", OpCodeName.ri, 1, null, OpCodeFlags.None, + "Set color rendering intent"); + + static readonly OpCode s = new OpCode("s", OpCodeName.s, 0, "closepath,stroke", OpCodeFlags.None, + "Close and stroke path"); + + static readonly OpCode S = new OpCode("S", OpCodeName.S, 0, "stroke", OpCodeFlags.None, + "Stroke path"); + + static readonly OpCode SC = new OpCode("SC", OpCodeName.SC, -1, "setcolor", OpCodeFlags.None, + "(PDF 1.1) Set color for stroking operations"); + + static readonly OpCode sc = new OpCode("sc", OpCodeName.sc, -1, "setcolor", OpCodeFlags.None, + "(PDF 1.1) Set color for nonstroking operations"); + + static readonly OpCode SCN = new OpCode("SCN", OpCodeName.SCN, -1, "setcolor", OpCodeFlags.None, + "(PDF 1.2) Set color for stroking operations (ICCBased and special color spaces)"); + + static readonly OpCode scn = new OpCode("scn", OpCodeName.scn, -1, "setcolor", OpCodeFlags.None, + "(PDF 1.2) Set color for nonstroking operations (ICCBased and special color spaces)"); + + static readonly OpCode sh = new OpCode("sh", OpCodeName.sh, 1, "shfill", OpCodeFlags.None, + "(PDF 1.3) Paint area defined by shading pattern"); + + static readonly OpCode Tx = new OpCode("T*", OpCodeName.Tx, 0, null, OpCodeFlags.None, + "Move to start of next text line"); + + static readonly OpCode Tc = new OpCode("Tc", OpCodeName.Tc, 1, null, OpCodeFlags.None, + "Set character spacing"); + + static readonly OpCode Td = new OpCode("Td", OpCodeName.Td, 2, null, OpCodeFlags.None, + "Move text position"); + + static readonly OpCode TD = new OpCode("TD", OpCodeName.TD, 2, null, OpCodeFlags.None, + "Move text position and set leading"); + + static readonly OpCode Tf = new OpCode("Tf", OpCodeName.Tf, 2, "selectfont", OpCodeFlags.None, + "Set text font and size"); + + static readonly OpCode Tj = new OpCode("Tj", OpCodeName.Tj, 1, "show", OpCodeFlags.TextOut, + "Show text"); + + static readonly OpCode TJ = new OpCode("TJ", OpCodeName.TJ, 1, null, OpCodeFlags.TextOut, + "Show text, allowing individual glyph positioning"); + + static readonly OpCode TL = new OpCode("TL", OpCodeName.TL, 1, null, OpCodeFlags.None, + "Set text leading"); + + static readonly OpCode Tm = new OpCode("Tm", OpCodeName.Tm, 6, null, OpCodeFlags.None, + "Set text matrix and text line matrix"); + + static readonly OpCode Tr = new OpCode("Tr", OpCodeName.Tr, 1, null, OpCodeFlags.None, + "Set text rendering mode"); + + static readonly OpCode Ts = new OpCode("Ts", OpCodeName.Ts, 1, null, OpCodeFlags.None, + "Set text rise"); + + static readonly OpCode Tw = new OpCode("Tw", OpCodeName.Tw, 1, null, OpCodeFlags.None, + "Set word spacing"); + + static readonly OpCode Tz = new OpCode("Tz", OpCodeName.Tz, 1, null, OpCodeFlags.None, + "Set horizontal text scaling"); + + static readonly OpCode v = new OpCode("v", OpCodeName.v, 4, "curveto", OpCodeFlags.None, + "Append curved segment to path (initial point replicated)"); + + static readonly OpCode w = new OpCode("w", OpCodeName.w, 1, "setlinewidth", OpCodeFlags.None, + "Set line width"); + + static readonly OpCode W = new OpCode("W", OpCodeName.W, 0, "clip", OpCodeFlags.None, + "Set clipping path using nonzero winding number rule"); + + static readonly OpCode Wx = new OpCode("W*", OpCodeName.Wx, 0, "eoclip", OpCodeFlags.None, + "Set clipping path using even-odd rule"); + + static readonly OpCode y = new OpCode("y", OpCodeName.y, 4, "curveto", OpCodeFlags.None, + "Append curved segment to path (final point replicated)"); + + static readonly OpCode QuoteSingle = new OpCode("'", OpCodeName.QuoteSingle, 1, null, OpCodeFlags.TextOut, + "Move to next line and show text"); + + static readonly OpCode QuoteDbl = new OpCode("\"", OpCodeName.QuoteDbl, 3, null, OpCodeFlags.TextOut, + "Set word and character spacing, move to next line, and show text"); + + /// + /// Array of all OpCodes. + /// + static readonly OpCode[] ops = // new OpCode[] + { + // Must be defined behind the code above to ensure that the values are initialized. + Dictionary, + b, B, bx, Bx, BDC, BI, BMC, BT, BX, c, cm, CS, cs, d, d0, d1, Do, + DP, EI, EMC, ET, EX, f, F, fx, G, g, gs, h, i, ID, j, J, K, k, l, m, M, MP, + n, q, Q, re, RG, rg, ri, s, S, SC, sc, SCN, scn, sh, + Tx, Tc, Td, TD, Tf, Tj, TJ, TL, Tm, Tr, Ts, Tw, Tz, v, w, W, Wx, y, + QuoteSingle, QuoteDbl + }; + // ReSharper restore InconsistentNaming + } +} diff --git a/PdfSharp/Pdf.Content.Objects/enum/OpCodeFlags.cs b/PdfSharp/Pdf.Content.Objects/enum/OpCodeFlags.cs new file mode 100644 index 0000000..cc6d6bf --- /dev/null +++ b/PdfSharp/Pdf.Content.Objects/enum/OpCodeFlags.cs @@ -0,0 +1,51 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.Content.Objects +{ + /// + /// Specifies the group of operations the op-code belongs to. + /// + [Flags] + public enum OpCodeFlags + { + /// + /// + /// + None, + + /// + /// + /// + TextOut = 0x0001, + //Color, Pattern, Images,... + } +} diff --git a/PdfSharp/Pdf.Content.Objects/enum/OpCodeName.cs b/PdfSharp/Pdf.Content.Objects/enum/OpCodeName.cs new file mode 100644 index 0000000..1148213 --- /dev/null +++ b/PdfSharp/Pdf.Content.Objects/enum/OpCodeName.cs @@ -0,0 +1,185 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#pragma warning disable 1591 + +// ReSharper disable InconsistentNaming + +namespace PdfSharp.Pdf.Content.Objects +{ + /// + /// The names of the op-codes. + /// + public enum OpCodeName + { + Dictionary, // Name followed by dictionary. + + // I know that this is not useable in VB or other languages with no case sensitivity. + + // Reference: TABLE A.1PDF content stream operators / Page 985 + + /// + /// Close, fill, and stroke path using nonzero winding number rule. + /// + b, + + /// + /// Fill and stroke path using nonzero winding number rule. + /// + B, + + /// + /// Close, fill, and stroke path using even-odd rule. + /// + bx, // b* + + /// + /// Fill and stroke path using even-odd rule. + /// + Bx, // B* + + /// + /// (PDF 1.2) Begin marked-content sequence with property list. + /// + BDC, + + /// + /// Begin inline image object. + /// + BI, + + /// + /// (PDF 1.2) Begin marked-content sequence. + /// + BMC, + + /// + /// Begin text object. + /// + BT, + + /// + /// (PDF 1.1) Begin compatibility section. + /// + BX, + + c, + cm, + CS, + cs, + d, + d0, + d1, + Do, + + /// + /// (PDF 1.2) Define marked-content point with property list. + /// + DP, + + EI, + + /// + /// (PDF 1.2) End marked-content sequence. + /// + EMC, + + ET, + + /// + /// (PDF 1.1) End compatibility section. + /// + EX, + + f, + F, + fx, // f* + G, + g, + gs, + h, + i, + ID, + j, + J, + K, + k, + l, + m, + M, + + /// + /// (PDF 1.2) Define marked-content point + /// + MP, + + n, + q, + Q, + re, + RG, + rg, + ri, + s, + S, + SC, + sc, + SCN, + scn, + sh, + Tx, // T* + Tc, + Td, + TD, + Tf, + Tj, + TJ, + TL, + Tm, + Tr, + Ts, + Tw, + Tz, + v, + w, + W, + Wx, // W* + y, + + /// + /// Move to next line and show text. + /// + QuoteSingle, // ' + + /// + /// Set word and character spacing, move to next line, and show text. + /// + QuoteDbl, // " + } +} diff --git a/PdfSharp/Pdf.Content/CLexer.cs b/PdfSharp/Pdf.Content/CLexer.cs new file mode 100644 index 0000000..7058a8a --- /dev/null +++ b/PdfSharp/Pdf.Content/CLexer.cs @@ -0,0 +1,848 @@ + +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Globalization; +using System.Diagnostics; +using System.Text; +using System.IO; +using PdfSharp.Internal; + +#pragma warning disable 1591 + +namespace PdfSharp.Pdf.Content +{ + /// + /// Lexical analyzer for PDF content files. Adobe specifies no grammar, but it seems that it + /// is a simple post-fix notation. + /// + public class CLexer + { + /// + /// Initializes a new instance of the Lexer class. + /// + public CLexer(byte[] content) + { + _content = content; + _charIndex = 0; + } + + /// + /// Initializes a new instance of the Lexer class. + /// + public CLexer(MemoryStream content) + { + _content = content.ToArray(); + _charIndex = 0; + } + + /// + /// Reads the next token and returns its type. + /// + public CSymbol ScanNextToken() + { + Again: + ClearToken(); + char ch = MoveToNonWhiteSpace(); + switch (ch) + { + case '%': + // Eat comments, the parser doesn't handle them + //return symbol = ScanComment(); + ScanComment(); + goto Again; + + case '/': + return _symbol = ScanName(); + + //case 'R': + // if (Lexer.IsWhiteSpace(nextChar)) + // { + // ScanNextChar(); + // return Symbol.R; + // } + // break; + + case '+': + case '-': + return _symbol = ScanNumber(); + + case '[': + ScanNextChar(); + return _symbol = CSymbol.BeginArray; + + case ']': + ScanNextChar(); + return _symbol = CSymbol.EndArray; + + case '(': + return _symbol = ScanLiteralString(); + + case '<': + if (_nextChar == '<') + return _symbol = ScanDictionary(); + return _symbol = ScanHexadecimalString(); + + case '.': + return _symbol = ScanNumber(); + + case '"': + case '\'': + return _symbol = ScanOperator(); + } + if (char.IsDigit(ch)) + return _symbol = ScanNumber(); + + if (char.IsLetter(ch)) + return _symbol = ScanOperator(); + + if (ch == Chars.EOF) + return _symbol = CSymbol.Eof; + + ContentReaderDiagnostics.HandleUnexpectedCharacter(ch); + return _symbol = CSymbol.None; + } + + /// + /// Scans a comment line. (Not yet used, comments are skipped by lexer.) + /// + public CSymbol ScanComment() + { + Debug.Assert(_currChar == Chars.Percent); + + ClearToken(); + char ch; + while ((ch = AppendAndScanNextChar()) != Chars.LF && ch != Chars.EOF) { } + return _symbol = CSymbol.Comment; + } + + /// + /// Scans the bytes of an inline image. + /// NYI: Just scans over it. + /// + public CSymbol ScanInlineImage() + { + // TODO: Implement inline images. + // Skip this: + // BI + // … Key-value pairs … + // ID + // … Image data … + // EI + + bool ascii85 = false; + do + { + ScanNextToken(); + // HACK: Is image ASCII85 decoded? + if (!ascii85 && _symbol == CSymbol.Name && (Token == "/ASCII85Decode" || Token == "/A85")) + ascii85 = true; + } while (_symbol != CSymbol.Operator || Token != "ID"); + + if (ascii85) + { + // Look for '~>' because 'EI' may be part of the encoded image. + while (_currChar != Chars.EOF && (_currChar != '~' || _nextChar != '>')) + ScanNextChar(); + if (_currChar == Chars.EOF) + ContentReaderDiagnostics.HandleUnexpectedCharacter(_currChar); + } + + // Look for 'EI', as 'EI' may be part of the binary image data here too. + while (_currChar != Chars.EOF) + { + if (IsWhiteSpace(_currChar)) + { + if (ScanNextChar() == 'E') + if (ScanNextChar() == 'I') + if (IsWhiteSpace(ScanNextChar())) + break; + } + else + ScanNextChar(); + } + if (_currChar == Chars.EOF) + ContentReaderDiagnostics.HandleUnexpectedCharacter(_currChar); + + // We currently do nothing with inline images. + return CSymbol.None; + } + + /// + /// Scans a name. + /// + public CSymbol ScanName() + { + Debug.Assert(_currChar == Chars.Slash); + + ClearToken(); + while (true) + { + char ch = AppendAndScanNextChar(); + if (IsWhiteSpace(ch) || IsDelimiter(ch)) + return _symbol = CSymbol.Name; + + if (ch == '#') + { + ScanNextChar(); + char[] hex = new char[2]; + hex[0] = _currChar; + hex[1] = _nextChar; + ScanNextChar(); + // TODO Check syntax + ch = (char)(ushort)int.Parse(new string(hex), NumberStyles.AllowHexSpecifier); + _currChar = ch; + } + } + } + + protected CSymbol ScanDictionary() + { + // TODO Do an actual recursive parse instead of this simple scan. + + ClearToken(); + _token.Append(_currChar); // '<' + _token.Append(ScanNextChar()); // '<' + + bool inString = false, inHexString = false; + int nestedDict = 0, nestedStringParen = 0; + char ch; + while (true) + { + _token.Append(ch = ScanNextChar()); + if (ch == '<') + { + if (_nextChar == '<') + { + _token.Append(ScanNextChar()); + ++nestedDict; + } + else + inHexString = true; + } + else if (!inHexString && ch == '(') + { + if (inString) + ++nestedStringParen; + else + { + inString = true; + nestedStringParen = 0; + } + } + else if (inString && ch == ')') + { + if (nestedStringParen > 0) + --nestedStringParen; + else + inString = false; + } + else if (inString && ch == '\\') + _token.Append(ScanNextChar()); + else if (ch == '>') + { + if (inHexString) + inHexString = false; + else if (_nextChar == '>') + { + _token.Append(ScanNextChar()); + if (nestedDict > 0) + --nestedDict; + else + { + ScanNextChar(); + +#if true + return CSymbol.Dictionary; +#else + return CSymbol.String; +#endif + } + } + } + else if (ch == Chars.EOF) + ContentReaderDiagnostics.HandleUnexpectedCharacter(ch); + } + } + + /// + /// Scans an integer or real number. + /// + public CSymbol ScanNumber() + { + long value = 0; + int decimalDigits = 0; + bool period = false; + bool negative = false; + + ClearToken(); + char ch = _currChar; + if (ch == '+' || ch == '-') + { + if (ch == '-') + negative = true; + _token.Append(ch); + ch = ScanNextChar(); + } + while (true) + { + if (char.IsDigit(ch)) + { + _token.Append(ch); + if (decimalDigits < 10) + { + value = 10 * value + ch - '0'; + if (period) + decimalDigits++; + } + } + else if (ch == '.') + { + if (period) + ContentReaderDiagnostics.ThrowContentReaderException("More than one period in number."); + + period = true; + _token.Append(ch); + } + else + break; + ch = ScanNextChar(); + } + + if (negative) + value = -value; + if (period) + { + if (decimalDigits > 0) + { + _tokenAsReal = value / PowersOf10[decimalDigits]; + //_tokenAsLong = value / PowersOf10[decimalDigits]; + } + else + { + _tokenAsReal = value; + _tokenAsLong = value; + } + return CSymbol.Real; + } + _tokenAsLong = value; + _tokenAsReal = Convert.ToDouble(value); + + Debug.Assert(Int64.Parse(_token.ToString(), CultureInfo.InvariantCulture) == value); + + if (value >= Int32.MinValue && value < Int32.MaxValue) + return CSymbol.Integer; + + ContentReaderDiagnostics.ThrowNumberOutOfIntegerRange(value); + return CSymbol.Error; + } + static readonly double[] PowersOf10 = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000 }; + + /// + /// Scans an operator. + /// + public CSymbol ScanOperator() + { + ClearToken(); + char ch = _currChar; + // Scan token + while (IsOperatorChar(ch)) + ch = AppendAndScanNextChar(); + + return _symbol = CSymbol.Operator; + } + + // TODO + public CSymbol ScanLiteralString() + { + Debug.Assert(_currChar == Chars.ParenLeft); + + ClearToken(); + int parenLevel = 0; + char ch = ScanNextChar(); + // Test UNICODE string + if (ch == '\xFE' && _nextChar == '\xFF') + { + // I'm not sure if the code is correct in any case. + // ? Can a UNICODE character not start with ')' as hibyte + // ? What about \# escape sequences + ScanNextChar(); + char chHi = ScanNextChar(); + if (chHi == ')') + { + // The empty unicode string... + ScanNextChar(); + return _symbol = CSymbol.String; + } + char chLo = ScanNextChar(); + ch = (char)(chHi * 256 + chLo); + while (true) + { + SkipChar: + switch (ch) + { + case '(': + parenLevel++; + break; + + case ')': + if (parenLevel == 0) + { + ScanNextChar(); + return _symbol = CSymbol.String; + } + parenLevel--; + break; + + case '\\': + { + // TODO: not sure that this is correct... + ch = ScanNextChar(); + switch (ch) + { + case 'n': + ch = Chars.LF; + break; + + case 'r': + ch = Chars.CR; + break; + + case 't': + ch = Chars.HT; + break; + + case 'b': + ch = Chars.BS; + break; + + case 'f': + ch = Chars.FF; + break; + + case '(': + ch = Chars.ParenLeft; + break; + + case ')': + ch = Chars.ParenRight; + break; + + case '\\': + ch = Chars.BackSlash; + break; + + case Chars.LF: + ch = ScanNextChar(); + goto SkipChar; + + default: + if (char.IsDigit(ch)) + { + // Octal character code + int n = ch - '0'; + if (char.IsDigit(_nextChar)) + { + n = n * 8 + ScanNextChar() - '0'; + if (char.IsDigit(_nextChar)) + n = n * 8 + ScanNextChar() - '0'; + } + ch = (char)n; + } + break; + } + break; + } + + //case '#': + // ContentReaderDiagnostics.HandleUnexpectedCharacter('#'); + // break; + + default: + // Every other char is appended to the token. + break; + } + _token.Append(ch); + chHi = ScanNextChar(); + if (chHi == ')') + { + ScanNextChar(); + return _symbol = CSymbol.String; + } + chLo = ScanNextChar(); + ch = (char)(chHi * 256 + chLo); + } + } + else + { + // 8-bit characters + while (true) + { + SkipChar: + switch (ch) + { + case '(': + parenLevel++; + break; + + case ')': + if (parenLevel == 0) + { + ScanNextChar(); + return _symbol = CSymbol.String; + } + parenLevel--; + break; + + case '\\': + { + ch = ScanNextChar(); + switch (ch) + { + case 'n': + ch = Chars.LF; + break; + + case 'r': + ch = Chars.CR; + break; + + case 't': + ch = Chars.HT; + break; + + case 'b': + ch = Chars.BS; + break; + + case 'f': + ch = Chars.FF; + break; + + case '(': + ch = Chars.ParenLeft; + break; + + case ')': + ch = Chars.ParenRight; + break; + + case '\\': + ch = Chars.BackSlash; + break; + + case Chars.LF: + ch = ScanNextChar(); + goto SkipChar; + + default: + if (char.IsDigit(ch)) + { + // Octal character code. + int n = ch - '0'; + if (char.IsDigit(_nextChar)) + { + n = n * 8 + ScanNextChar() - '0'; + if (char.IsDigit(_nextChar)) + n = n * 8 + ScanNextChar() - '0'; + } + ch = (char)n; + } + break; + } + break; + } + + //case '#': + // ContentReaderDiagnostics.HandleUnexpectedCharacter('#'); + // break; + + default: + // Every other char is appended to the token. + break; + } + _token.Append(ch); + //token.Append(Encoding.GetEncoding(1252).GetString(new byte[] { (byte)ch })); + ch = ScanNextChar(); + } + } + } + + // TODO + public CSymbol ScanHexadecimalString() + { + Debug.Assert(_currChar == Chars.Less); + + ClearToken(); + char[] hex = new char[2]; + ScanNextChar(); + while (true) + { + MoveToNonWhiteSpace(); + if (_currChar == '>') + { + ScanNextChar(); + break; + } + if (char.IsLetterOrDigit(_currChar)) + { + hex[0] = char.ToUpper(_currChar); + hex[1] = char.ToUpper(_nextChar); + int ch = int.Parse(new string(hex), NumberStyles.AllowHexSpecifier); + _token.Append(Convert.ToChar(ch)); + ScanNextChar(); + ScanNextChar(); + } + } + string chars = _token.ToString(); + int count = chars.Length; + if (count > 2 && chars[0] == (char)0xFE && chars[1] == (char)0xFF) + { + Debug.Assert(count % 2 == 0); + _token.Length = 0; + for (int idx = 2; idx < count; idx += 2) + _token.Append((char)(chars[idx] * 256 + chars[idx + 1])); + } + return _symbol = CSymbol.HexString; + } + + /// + /// Move current position one character further in content stream. + /// + internal char ScanNextChar() + { + if (ContLength <= _charIndex) + { + _currChar = Chars.EOF; + if (IsOperatorChar(_nextChar)) + _token.Append(_nextChar); + _nextChar = Chars.EOF; + } + else + { + _currChar = _nextChar; + _nextChar = (char)_content[_charIndex++]; + if (_currChar == Chars.CR) + { + if (_nextChar == Chars.LF) + { + // Treat CR LF as LF + _currChar = _nextChar; + if (ContLength <= _charIndex) + _nextChar = Chars.EOF; + else + _nextChar = (char)_content[_charIndex++]; + } + else + { + // Treat single CR as LF + _currChar = Chars.LF; + } + } + } + return _currChar; + } + + /// + /// Resets the current token to the empty string. + /// + void ClearToken() + { + _token.Length = 0; + _tokenAsLong = 0; + _tokenAsReal = 0; + } + + /// + /// Appends current character to the token and reads next one. + /// + internal char AppendAndScanNextChar() + { + _token.Append(_currChar); + return ScanNextChar(); + } + + /// + /// If the current character is not a white space, the function immediately returns it. + /// Otherwise the PDF cursor is moved forward to the first non-white space or EOF. + /// White spaces are NUL, HT, LF, FF, CR, and SP. + /// + public char MoveToNonWhiteSpace() + { + while (_currChar != Chars.EOF) + { + switch (_currChar) + { + case Chars.NUL: + case Chars.HT: + case Chars.LF: + case Chars.FF: + case Chars.CR: + case Chars.SP: + ScanNextChar(); + break; + + default: + return _currChar; + } + } + return _currChar; + } + + /// + /// Gets or sets the current symbol. + /// + public CSymbol Symbol + { + get { return _symbol; } + set { _symbol = value; } + } + + /// + /// Gets the current token. + /// + public string Token + { + get { return _token.ToString(); } + } + + /// + /// Interprets current token as integer literal. + /// + internal int TokenToInteger + { + get + { + Debug.Assert(_tokenAsLong == int.Parse(_token.ToString(), CultureInfo.InvariantCulture)); + return (int)_tokenAsLong; + } + } + + /// + /// Interpret current token as real or integer literal. + /// + internal double TokenToReal + { + get + { + // ReSharper disable once CompareOfFloatsByEqualityOperator + Debug.Assert(_tokenAsReal == double.Parse(_token.ToString(), CultureInfo.InvariantCulture)); + return _tokenAsReal; + } + } + + /// + /// Indicates whether the specified character is a content stream white-space character. + /// + internal static bool IsWhiteSpace(char ch) + { + switch (ch) + { + case Chars.NUL: // 0 Null + case Chars.HT: // 9 Tab + case Chars.LF: // 10 Line feed + case Chars.FF: // 12 Form feed + case Chars.CR: // 13 Carriage return + case Chars.SP: // 32 Space + return true; + } + return false; + } + + /// + /// Indicates whether the specified character is an content operator character. + /// + internal static bool IsOperatorChar(char ch) + { + if (char.IsLetter(ch)) + return true; + switch (ch) + { + case Chars.Asterisk: // * + case Chars.QuoteSingle: // ' + case Chars.QuoteDbl: // " + return true; + } + return false; + } + + /// + /// Indicates whether the specified character is a PDF delimiter character. + /// + internal static bool IsDelimiter(char ch) + { + switch (ch) + { + case '(': + case ')': + case '<': + case '>': + case '[': + case ']': + //case '{': + //case '}': + case '/': + case '%': + return true; + } + return false; + } + + /// + /// Gets the length of the content. + /// + public int ContLength + { + get { return _content.Length; } + } + + // ad + public int Position + { + get { return _charIndex; } + set + { + _charIndex = value; + _currChar = (char)_content[_charIndex - 1]; + _nextChar = (char)_content[_charIndex - 1]; + } + } + + readonly byte[] _content; + int _charIndex; + char _currChar; + char _nextChar; + + readonly StringBuilder _token = new StringBuilder(); + long _tokenAsLong; + double _tokenAsReal; + CSymbol _symbol = CSymbol.None; + } +} diff --git a/PdfSharp/Pdf.Content/CParser.cs b/PdfSharp/Pdf.Content/CParser.cs new file mode 100644 index 0000000..a165b92 --- /dev/null +++ b/PdfSharp/Pdf.Content/CParser.cs @@ -0,0 +1,231 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using System.IO; +using PdfSharp.Internal; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.Content.Objects; + +#pragma warning disable 1591 + +namespace PdfSharp.Pdf.Content +{ + /// + /// Provides the functionality to parse PDF content streams. + /// + public sealed class CParser + { + public CParser(PdfPage page) + { + _page = page; + PdfContent content = page.Contents.CreateSingleContent(); + byte[] bytes = content.Stream.Value; + _lexer = new CLexer(bytes); + } + + public CParser(byte[] content) + { + _lexer = new CLexer(content); + } + + public CParser(MemoryStream content) + { + _lexer = new CLexer(content.ToArray()); + } + + + public CParser(CLexer lexer) + { + _lexer = lexer; + } + + public CSymbol Symbol + { + get { return _lexer.Symbol; } + } + + public CSequence ReadContent() + { + CSequence sequence = new CSequence(); + ParseObject(sequence, CSymbol.Eof); + + return sequence; + } + + /// + /// Parses whatever comes until the specified stop symbol is reached. + /// + void ParseObject(CSequence sequence, CSymbol stop) + { + CSymbol symbol; + while ((symbol = ScanNextToken()) != CSymbol.Eof) + { + if (symbol == stop) + return; + + CString s; + COperator op; + switch (symbol) + { + case CSymbol.Comment: + // ignore comments + break; + + case CSymbol.Integer: + CInteger n = new CInteger(); + n.Value = _lexer.TokenToInteger; + _operands.Add(n); + break; + + case CSymbol.Real: + CReal r = new CReal(); + r.Value = _lexer.TokenToReal; + _operands.Add(r); + break; + + case CSymbol.String: + case CSymbol.HexString: + case CSymbol.UnicodeString: + case CSymbol.UnicodeHexString: + s = new CString(); + s.Value = _lexer.Token; + _operands.Add(s); + break; + + case CSymbol.Dictionary: + s = new CString(); + s.Value = _lexer.Token; + s.CStringType = CStringType.Dictionary; + _operands.Add(s); + op = CreateOperator(OpCodeName.Dictionary); + //_operands.Clear(); + sequence.Add(op); + + break; + + case CSymbol.Name: + CName name = new CName(); + name.Name = _lexer.Token; + _operands.Add(name); + break; + + case CSymbol.Operator: + op = CreateOperator(); + //_operands.Clear(); + sequence.Add(op); + break; + + case CSymbol.BeginArray: + CArray array = new CArray(); + if (_operands.Count != 0) + ContentReaderDiagnostics.ThrowContentReaderException("Array within array..."); + + ParseObject(array, CSymbol.EndArray); + array.Add(_operands); + _operands.Clear(); + _operands.Add((CObject)array); + break; + + case CSymbol.EndArray: + ContentReaderDiagnostics.HandleUnexpectedCharacter(']'); + break; + +#if DEBUG + default: + Debug.Assert(false); + break; +#endif + } + } + } + + COperator CreateOperator() + { + string name = _lexer.Token; + COperator op = OpCodes.OperatorFromName(name); + return CreateOperator(op); + } + + COperator CreateOperator(OpCodeName nameop) + { + string name = nameop.ToString(); + COperator op = OpCodes.OperatorFromName(name); + return CreateOperator(op); + } + + COperator CreateOperator(COperator op) + { + if (op.OpCode.OpCodeName == OpCodeName.BI) + { + _lexer.ScanInlineImage(); + } +#if DEBUG + if (op.OpCode.Operands != -1 && op.OpCode.Operands != _operands.Count) + { + if (op.OpCode.OpCodeName != OpCodeName.ID) + { + GetType(); + Debug.Assert(false, "Invalid number of operands."); + } + } +#endif + op.Operands.Add(_operands); + _operands.Clear(); + return op; + } + + CSymbol ScanNextToken() + { + return _lexer.ScanNextToken(); + } + + CSymbol ScanNextToken(out string token) + { + CSymbol symbol = _lexer.ScanNextToken(); + token = _lexer.Token; + return symbol; + } + + /// + /// Reads the next symbol that must be the specified one. + /// + CSymbol ReadSymbol(CSymbol symbol) + { + CSymbol current = _lexer.ScanNextToken(); + if (symbol != current) + ContentReaderDiagnostics.ThrowContentReaderException(PSSR.UnexpectedToken(_lexer.Token)); + return current; + } + + readonly CSequence _operands = new CSequence(); + PdfPage _page; + readonly CLexer _lexer; + } +} diff --git a/PdfSharp/Pdf.Content/Chars.cs b/PdfSharp/Pdf.Content/Chars.cs new file mode 100644 index 0000000..4accbb2 --- /dev/null +++ b/PdfSharp/Pdf.Content/Chars.cs @@ -0,0 +1,80 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// ReSharper disable InconsistentNaming + +namespace PdfSharp.Pdf.Content +{ + /// + /// Character table by name. Same as PdfSharp.Pdf.IO.Chars. Not yet clear if necessary. + /// + internal static class Chars + { + public const char EOF = (char)65535; //unchecked((char)(-1)); + public const char NUL = '\0'; // EOF + public const char CR = '\x0D'; // ignored by lexer + public const char LF = '\x0A'; // Line feed + public const char BEL = '\a'; // Bell + public const char BS = '\b'; // Backspace + public const char FF = '\f'; // Form feed + public const char HT = '\t'; // Horizontal tab + public const char VT = '\v'; // Vertical tab + public const char NonBreakableSpace = (char)160; // char(160) + + // The following names come from "PDF Reference Third Edition" + // Appendix D.1, Latin Character Set and Encoding + public const char SP = ' '; + public const char QuoteDbl = '"'; + public const char QuoteSingle = '\''; + public const char ParenLeft = '('; + public const char ParenRight = ')'; + public const char BraceLeft = '{'; + public const char BraceRight = '}'; + public const char BracketLeft = '['; + public const char BracketRight = ']'; + public const char Less = '<'; + public const char Greater = '>'; + public const char Equal = '='; + public const char Period = '.'; + public const char Semicolon = ';'; + public const char Colon = ':'; + public const char Slash = '/'; + public const char Bar = '|'; + public const char BackSlash = '\\'; + public const char Percent = '%'; + public const char Dollar = '$'; + public const char At = '@'; + public const char NumberSign = '#'; + public const char Asterisk = '*'; + public const char Question = '?'; + public const char Hyphen = '-'; // char(45) + public const char SoftHyphen = '­'; // char(173) + public const char Currency = '¤'; + } +} diff --git a/PdfSharp/Pdf.Content/ContentReader.cs b/PdfSharp/Pdf.Content/ContentReader.cs new file mode 100644 index 0000000..0955d22 --- /dev/null +++ b/PdfSharp/Pdf.Content/ContentReader.cs @@ -0,0 +1,74 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.IO; +using PdfSharp.Pdf.Content.Objects; + +namespace PdfSharp.Pdf.Content +{ + /// + /// Represents the functionality for reading PDF content streams. + /// + public static class ContentReader + { + /// + /// Reads the content stream(s) of the specified page. + /// + /// The page. + static public CSequence ReadContent(PdfPage page) + { + CParser parser = new CParser(page); + CSequence sequence = parser.ReadContent(); + + return sequence; + } + + /// + /// Reads the specified content. + /// + /// The content. + static public CSequence ReadContent(byte[] content) + { + CParser parser = new CParser(content); + CSequence sequence = parser.ReadContent(); + return sequence; + } + + /// + /// Reads the specified content. + /// + /// The content. + static public CSequence ReadContent(MemoryStream content) + { + CParser parser = new CParser(content); + CSequence sequence = parser.ReadContent(); + return sequence; + } + } +} diff --git a/PdfSharp/Pdf.Content/ContentReaderException.cs b/PdfSharp/Pdf.Content/ContentReaderException.cs new file mode 100644 index 0000000..0b8b81e --- /dev/null +++ b/PdfSharp/Pdf.Content/ContentReaderException.cs @@ -0,0 +1,62 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.Content +{ + /// + /// Exception thrown by ContentReader. + /// + public class ContentReaderException : PdfSharpException + { + /// + /// Initializes a new instance of the class. + /// + public ContentReaderException() + { } + + /// + /// Initializes a new instance of the class. + /// + /// The message. + public ContentReaderException(string message) + : base(message) + { } + + /// + /// Initializes a new instance of the class. + /// + /// The message. + /// The inner exception. + public ContentReaderException(string message, Exception innerException) : + base(message, innerException) + { } + } +} diff --git a/PdfSharp/Pdf.Content/ContentWriter.cs b/PdfSharp/Pdf.Content/ContentWriter.cs new file mode 100644 index 0000000..e43a21f --- /dev/null +++ b/PdfSharp/Pdf.Content/ContentWriter.cs @@ -0,0 +1,231 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.IO; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf.Content +{ + /// + /// Represents a writer for generation of PDF streams. + /// + internal class ContentWriter + { + public ContentWriter(Stream contentStream) + { + _stream = contentStream; +#if DEBUG + //layout = PdfWriterLayout.Verbose; +#endif + } + + public void Close(bool closeUnderlyingStream) + { + if (_stream != null && closeUnderlyingStream) + { +#if UWP + _stream.Dispose(); +#else + _stream.Close(); +#endif + _stream = null; + } + } + + public void Close() + { + Close(true); + } + + public int Position + { + get { return (int)_stream.Position; } + } + + //public PdfWriterLayout Layout + //{ + // get { return layout; } + // set { layout = value; } + //} + //PdfWriterLayout layout; + + //public PdfWriterOptions Options + //{ + // get { return options; } + // set { options = value; } + //} + //PdfWriterOptions options; + + // ----------------------------------------------------------- + + /// + /// Writes the specified value to the PDF stream. + /// + public void Write(bool value) + { + //WriteSeparator(CharCat.Character); + //WriteRaw(value ? bool.TrueString : bool.FalseString); + //lastCat = CharCat.Character; + } + + public void WriteRaw(string rawString) + { + if (String.IsNullOrEmpty(rawString)) + return; + //AppendBlank(rawString[0]); + byte[] bytes = PdfEncoders.RawEncoding.GetBytes(rawString); + _stream.Write(bytes, 0, bytes.Length); + _lastCat = GetCategory((char)bytes[bytes.Length - 1]); + } + + public void WriteLineRaw(string rawString) + { + if (String.IsNullOrEmpty(rawString)) + return; + //AppendBlank(rawString[0]); + byte[] bytes = PdfEncoders.RawEncoding.GetBytes(rawString); + _stream.Write(bytes, 0, bytes.Length); + _stream.Write(new byte[] { (byte)'\n' }, 0, 1); + _lastCat = GetCategory((char)bytes[bytes.Length - 1]); + } + + public void WriteRaw(char ch) + { + Debug.Assert(ch < 256, "Raw character greater than 255 detected."); + _stream.WriteByte((byte)ch); + _lastCat = GetCategory(ch); + } + + /// + /// Gets or sets the indentation for a new indentation level. + /// + internal int Indent + { + get { return _indent; } + set { _indent = value; } + } + protected int _indent = 2; + protected int _writeIndent = 0; + + /// + /// Increases indent level. + /// + void IncreaseIndent() + { + _writeIndent += _indent; + } + + /// + /// Decreases indent level. + /// + void DecreaseIndent() + { + _writeIndent -= _indent; + } + + /// + /// Gets an indent string of current indent. + /// + string IndentBlanks + { + get { return new string(' ', _writeIndent); } + } + + void WriteIndent() + { + WriteRaw(IndentBlanks); + } + + void WriteSeparator(CharCat cat, char ch) + { + switch (_lastCat) + { + //case CharCat.NewLine: + // if (this.layout == PdfWriterLayout.Verbose) + // WriteIndent(); + // break; + + case CharCat.Delimiter: + break; + + //case CharCat.Character: + // if (this.layout == PdfWriterLayout.Verbose) + // { + // //if (cat == CharCat.Character || ch == '/') + // this.stream.WriteByte((byte)' '); + // } + // else + // { + // if (cat == CharCat.Character) + // this.stream.WriteByte((byte)' '); + // } + // break; + } + } + + void WriteSeparator(CharCat cat) + { + WriteSeparator(cat, '\0'); + } + + public void NewLine() + { + if (_lastCat != CharCat.NewLine) + WriteRaw('\n'); + } + + CharCat GetCategory(char ch) + { + //if (Lexer.IsDelimiter(ch)) + // return CharCat.Delimiter; + //if (ch == Chars.LF) + // return CharCat.NewLine; + return CharCat.Character; + } + + enum CharCat + { + NewLine, + Character, + Delimiter, + } + CharCat _lastCat; + + /// + /// Gets the underlying stream. + /// + internal Stream Stream + { + get { return _stream; } + } + Stream _stream; + } +} diff --git a/PdfSharp/Pdf.Content/enums/Symbol.cs b/PdfSharp/Pdf.Content/enums/Symbol.cs new file mode 100644 index 0000000..1516dad --- /dev/null +++ b/PdfSharp/Pdf.Content/enums/Symbol.cs @@ -0,0 +1,55 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Content +{ + /// + /// Terminal symbols recognized by PDF content stream lexer. + /// + public enum CSymbol + { +#pragma warning disable 1591 + None, + Comment, + Integer, + Real, + /*Boolean?,*/ + String, + HexString, + UnicodeString, + UnicodeHexString, + Name, + Operator, + BeginArray, + EndArray, + Dictionary, // HACK: << ... >> is scanned as string literal. + Eof, + Error = -1, + } +} diff --git a/PdfSharp/Pdf.Filters/Ascii85Decode.cs b/PdfSharp/Pdf.Filters/Ascii85Decode.cs new file mode 100644 index 0000000..0bd3d3c --- /dev/null +++ b/PdfSharp/Pdf.Filters/Ascii85Decode.cs @@ -0,0 +1,285 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.Filters +{ + /// + /// Implements the ASCII85Decode filter. + /// + public class Ascii85Decode : Filter + { + // Reference: 3.3.2 ASCII85Decode Filter / Page 69 + + /// + /// Encodes the specified data. + /// + public override byte[] Encode(byte[] data) + { + if (data == null) + throw new ArgumentNullException("data"); + + int length = data.Length; // length == 0 is must not be treated as a special case. + int words = length / 4; + int rest = length - (words * 4); + byte[] result = new byte[words * 5 + (rest == 0 ? 0 : rest + 1) + 2]; + + int idxIn = 0, idxOut = 0; + int wCount = 0; + while (wCount < words) + { + uint val = ((uint)data[idxIn++] << 24) + ((uint)data[idxIn++] << 16) + ((uint)data[idxIn++] << 8) + data[idxIn++]; + if (val == 0) + { + result[idxOut++] = (byte)'z'; + } + else + { + byte c5 = (byte)(val % 85 + '!'); + val /= 85; + byte c4 = (byte)(val % 85 + '!'); + val /= 85; + byte c3 = (byte)(val % 85 + '!'); + val /= 85; + byte c2 = (byte)(val % 85 + '!'); + val /= 85; + byte c1 = (byte)(val + '!'); + + result[idxOut++] = c1; + result[idxOut++] = c2; + result[idxOut++] = c3; + result[idxOut++] = c4; + result[idxOut++] = c5; + } + wCount++; + } + if (rest == 1) + { + uint val = (uint)data[idxIn] << 24; + val /= 85 * 85 * 85; + byte c2 = (byte)(val % 85 + '!'); + val /= 85; + byte c1 = (byte)(val + '!'); + + result[idxOut++] = c1; + result[idxOut++] = c2; + } + else if (rest == 2) + { + uint val = ((uint)data[idxIn++] << 24) + ((uint)data[idxIn] << 16); + val /= 85 * 85; + byte c3 = (byte)(val % 85 + '!'); + val /= 85; + byte c2 = (byte)(val % 85 + '!'); + val /= 85; + byte c1 = (byte)(val + '!'); + + result[idxOut++] = c1; + result[idxOut++] = c2; + result[idxOut++] = c3; + } + else if (rest == 3) + { + uint val = ((uint)data[idxIn++] << 24) + ((uint)data[idxIn++] << 16) + ((uint)data[idxIn] << 8); + val /= 85; + byte c4 = (byte)(val % 85 + '!'); + val /= 85; + byte c3 = (byte)(val % 85 + '!'); + val /= 85; + byte c2 = (byte)(val % 85 + '!'); + val /= 85; + byte c1 = (byte)(val + '!'); + + result[idxOut++] = c1; + result[idxOut++] = c2; + result[idxOut++] = c3; + result[idxOut++] = c4; + } + result[idxOut++] = (byte)'~'; + result[idxOut++] = (byte)'>'; + + if (idxOut < result.Length) + Array.Resize(ref result, idxOut); + + return result; + } + + /// + /// Decodes the specified data. + /// + public override byte[] Decode(byte[] data, FilterParms parms) + { + if (data == null) + throw new ArgumentNullException("data"); + + int idx; + int length = data.Length; + int zCount = 0; + int idxOut = 0; + for (idx = 0; idx < length; idx++) + { + char ch = (char)data[idx]; + if (ch >= '!' && ch <= 'u') + data[idxOut++] = (byte)ch; + else if (ch == 'z') + { + data[idxOut++] = (byte)ch; + zCount++; + } + else if (ch == '~') + { + if ((char)data[idx + 1] != '>') + throw new ArgumentException("Illegal character.", "data"); + break; + } + // ingnore unknown character + } + // Loop not ended with break? + if (idx == length) + throw new ArgumentException("Illegal character.", "data"); + + length = idxOut; + int nonZero = length - zCount; + int byteCount = 4 * (zCount + (nonZero / 5)); // full 4 byte blocks + + int remainder = nonZero % 5; + if (remainder == 1) + throw new InvalidOperationException("Illegal character."); + + if (remainder != 0) + byteCount += remainder - 1; + + byte[] output = new byte[byteCount]; + + idxOut = 0; + idx = 0; + while (idx + 4 < length) + { + char ch = (char)data[idx]; + if (ch == 'z') + { + idx++; + idxOut += 4; + } + else + { + // TODO: check + long value = + (long)(data[idx++] - '!') * (85 * 85 * 85 * 85) + + (uint)(data[idx++] - '!') * (85 * 85 * 85) + + (uint)(data[idx++] - '!') * (85 * 85) + + (uint)(data[idx++] - '!') * 85 + + (uint)(data[idx++] - '!'); + + if (value > UInt32.MaxValue) + throw new InvalidOperationException("Value of group greater than 2 power 32 - 1."); + + output[idxOut++] = (byte)(value >> 24); + output[idxOut++] = (byte)(value >> 16); + output[idxOut++] = (byte)(value >> 8); + output[idxOut++] = (byte)value; + } + } + + // I have found no appropriate algorithm, so I write my own. In some rare cases the value must not + // increased by one, but I cannot found a general formula or a proof. + // All possible cases are tested programmatically. + if (remainder == 2) // one byte + { + uint value = + (uint)(data[idx++] - '!') * (85 * 85 * 85 * 85) + + (uint)(data[idx] - '!') * (85 * 85 * 85); + + // Always increase if not zero (tried out). + if (value != 0) + value += 0x01000000; + + output[idxOut] = (byte)(value >> 24); + } + else if (remainder == 3) // two bytes + { + int idxIn = idx; + uint value = + (uint)(data[idx++] - '!') * (85 * 85 * 85 * 85) + + (uint)(data[idx++] - '!') * (85 * 85 * 85) + + (uint)(data[idx] - '!') * (85 * 85); + + if (value != 0) + { + value &= 0xFFFF0000; + uint val = value / (85 * 85); + byte c3 = (byte)(val % 85 + '!'); + val /= 85; + byte c2 = (byte)(val % 85 + '!'); + val /= 85; + byte c1 = (byte)(val + '!'); + if (c1 != data[idxIn] || c2 != data[idxIn + 1] || c3 != data[idxIn + 2]) + { + value += 0x00010000; + //Count2++; + } + } + output[idxOut++] = (byte)(value >> 24); + output[idxOut] = (byte)(value >> 16); + } + else if (remainder == 4) // three bytes + { + int idxIn = idx; + uint value = + (uint)(data[idx++] - '!') * (85 * 85 * 85 * 85) + + (uint)(data[idx++] - '!') * (85 * 85 * 85) + + (uint)(data[idx++] - '!') * (85 * 85) + + (uint)(data[idx] - '!') * 85; + + if (value != 0) + { + value &= 0xFFFFFF00; + uint val = value / 85; + byte c4 = (byte)(val % 85 + '!'); + val /= 85; + byte c3 = (byte)(val % 85 + '!'); + val /= 85; + byte c2 = (byte)(val % 85 + '!'); + val /= 85; + byte c1 = (byte)(val + '!'); + if (c1 != data[idxIn] || c2 != data[idxIn + 1] || c3 != data[idxIn + 2] || c4 != data[idxIn + 3]) + { + value += 0x00000100; + //Count3++; + } + } + output[idxOut++] = (byte)(value >> 24); + output[idxOut++] = (byte)(value >> 16); + output[idxOut] = (byte)(value >> 8); + } + return output; + } + } +} diff --git a/PdfSharp/Pdf.Filters/AsciiHexDecode.cs b/PdfSharp/Pdf.Filters/AsciiHexDecode.cs new file mode 100644 index 0000000..b720048 --- /dev/null +++ b/PdfSharp/Pdf.Filters/AsciiHexDecode.cs @@ -0,0 +1,98 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.Filters +{ + /// + /// Implements the ASCIIHexDecode filter. + /// + public class AsciiHexDecode : Filter + { + // Reference: 3.3.1 ASCIIHexDecode Filter / Page 69 + + /// + /// Encodes the specified data. + /// + public override byte[] Encode(byte[] data) + { + if (data == null) + throw new ArgumentNullException("data"); + + int count = data.Length; + byte[] bytes = new byte[2 * count]; + for (int i = 0, j = 0; i < count; i++) + { + byte b = data[i]; + bytes[j++] = (byte)((b >> 4) + ((b >> 4) < 10 ? (byte)'0' : (byte)('A' - 10))); + bytes[j++] = (byte)((b & 0xF) + ((b & 0xF) < 10 ? (byte)'0' : (byte)('A' - 10))); + } + return bytes; + } + + /// + /// Decodes the specified data. + /// + public override byte[] Decode(byte[] data, FilterParms parms) + { + if (data == null) + throw new ArgumentNullException("data"); + + data = RemoveWhiteSpace(data); + int count = data.Length; + // Ignore EOD (end of data) character. + // EOD can be anywhere in the stream, but makes sense only at the end of the stream. + if (count > 0 && data[count - 1] == '>') + --count; + if (count % 2 == 1) + { + count++; + byte[] temp = data; + data = new byte[count]; + temp.CopyTo(data, 0); + } + count >>= 1; + byte[] bytes = new byte[count]; + for (int i = 0, j = 0; i < count; i++) + { + // Must support 0-9, A-F, a-f - "Any other characters cause an error." + byte hi = data[j++]; + byte lo = data[j++]; + if (hi >= 'a' && hi <= 'f') + hi -= 32; + if (lo >= 'a' && lo <= 'f') + lo -= 32; + // TODO Throw on invalid characters. Stop when encountering EOD. Add one more byte if EOD is the lo byte. + bytes[i] = (byte)((hi > '9' ? hi - '7'/*'A' + 10*/: hi - '0') * 16 + (lo > '9' ? lo - '7'/*'A' + 10*/: lo - '0')); + } + return bytes; + } + } +} diff --git a/PdfSharp/Pdf.Filters/Filter.cs b/PdfSharp/Pdf.Filters/Filter.cs new file mode 100644 index 0000000..1f1c875 --- /dev/null +++ b/PdfSharp/Pdf.Filters/Filter.cs @@ -0,0 +1,130 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf.Filters +{ + /// + /// Reserved for future extension. + /// + public class FilterParms + { + // not yet used + } + + /// + /// Base class for all stream filters + /// + public abstract class Filter + { + /// + /// When implemented in a derived class encodes the specified data. + /// + public abstract byte[] Encode(byte[] data); + + /// + /// Encodes a raw string. + /// + public virtual byte[] Encode(string rawString) + { + byte[] bytes = PdfEncoders.RawEncoding.GetBytes(rawString); + bytes = Encode(bytes); + return bytes; + } + + /// + /// When implemented in a derived class decodes the specified data. + /// + public abstract byte[] Decode(byte[] data, FilterParms parms); + + /// + /// Decodes the specified data. + /// + public byte[] Decode(byte[] data) + { + return Decode(data, null); + } + + /// + /// Decodes to a raw string. + /// + public virtual string DecodeToString(byte[] data, FilterParms parms) + { + byte[] bytes = Decode(data, parms); + string text = PdfEncoders.RawEncoding.GetString(bytes, 0, bytes.Length); + return text; + } + + /// + /// Decodes to a raw string. + /// + public string DecodeToString(byte[] data) + { + return DecodeToString(data, null); + } + + /// + /// Removes all white spaces from the data. The function assumes that the bytes are characters. + /// + protected byte[] RemoveWhiteSpace(byte[] data) + { + int count = data.Length; + int j = 0; + for (int i = 0; i < count; i++, j++) + { + switch (data[i]) + { + case (byte)Chars.NUL: // 0 Null + case (byte)Chars.HT: // 9 Tab + case (byte)Chars.LF: // 10 Line feed + case (byte)Chars.FF: // 12 Form feed + case (byte)Chars.CR: // 13 Carriage return + case (byte)Chars.SP: // 32 Space + j--; + break; + + default: + if (i != j) + data[j] = data[i]; + break; + } + } + if (j < count) + { + byte[] temp = data; + data = new byte[j]; + for (int idx = 0; idx < j; idx++) + data[idx] = temp[idx]; + } + return data; + } + } +} diff --git a/PdfSharp/Pdf.Filters/Filtering.cs b/PdfSharp/Pdf.Filters/Filtering.cs new file mode 100644 index 0000000..802d44c --- /dev/null +++ b/PdfSharp/Pdf.Filters/Filtering.cs @@ -0,0 +1,242 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; + +namespace PdfSharp.Pdf.Filters +{ + /// + /// Applies standard filters to streams. + /// + public static class Filtering + { + /// + /// Gets the filter specified by the case sensitive name. + /// + public static Filter GetFilter(string filterName) + { + if (filterName.StartsWith("/")) + filterName = filterName.Substring(1); + + // Some tools use abbreviations + switch (filterName) + { + case "ASCIIHexDecode": + case "AHx": + return _asciiHexDecode ?? (_asciiHexDecode = new AsciiHexDecode()); + + case "ASCII85Decode": + case "A85": + return _ascii85Decode ?? (_ascii85Decode = new Ascii85Decode()); + + case "LZWDecode": + case "LZW": + return _lzwDecode ?? (_lzwDecode = new LzwDecode()); + + case "FlateDecode": + case "Fl": + return _flateDecode ?? (_flateDecode = new FlateDecode()); + + //case "RunLengthDecode": + // if (RunLengthDecode == null) + // RunLengthDecode = new RunLengthDecode(); + // return RunLengthDecode; + // + //case "CCITTFaxDecode": + // if (CCITTFaxDecode == null) + // CCITTFaxDecode = new CCITTFaxDecode(); + // return CCITTFaxDecode; + // + //case "JBIG2Decode": + // if (JBIG2Decode == null) + // JBIG2Decode = new JBIG2Decode(); + // return JBIG2Decode; + // + //case "DCTDecode": + // if (DCTDecode == null) + // DCTDecode = new DCTDecode(); + // return DCTDecode; + // + //case "JPXDecode": + // if (JPXDecode == null) + // JPXDecode = new JPXDecode(); + // return JPXDecode; + // + //case "Crypt": + // if (Crypt == null) + // Crypt = new Crypt(); + // return Crypt; + + case "RunLengthDecode": + case "CCITTFaxDecode": + case "JBIG2Decode": + case "DCTDecode": + case "JPXDecode": + case "Crypt": + Debug.WriteLine("Filter not implemented: " + filterName); + return null; + } + throw new NotImplementedException("Unknown filter: " + filterName); + } + + /// + /// Gets the filter singleton. + /// + // ReSharper disable InconsistentNaming + public static AsciiHexDecode ASCIIHexDecode + // ReSharper restore InconsistentNaming + { + get { return _asciiHexDecode ?? (_asciiHexDecode = new AsciiHexDecode()); } + } + static AsciiHexDecode _asciiHexDecode; + + /// + /// Gets the filter singleton. + /// + public static Ascii85Decode ASCII85Decode + { + get { return _ascii85Decode ?? (_ascii85Decode = new Ascii85Decode()); } + } + static Ascii85Decode _ascii85Decode; + + /// + /// Gets the filter singleton. + /// + public static LzwDecode LzwDecode + { + get { return _lzwDecode ?? (_lzwDecode = new LzwDecode()); } + } + static LzwDecode _lzwDecode; + + /// + /// Gets the filter singleton. + /// + public static FlateDecode FlateDecode + { + get { return _flateDecode ?? (_flateDecode = new FlateDecode()); } + } + static FlateDecode _flateDecode; + + //runLengthDecode + //ccittFaxDecode + //jbig2Decode + //dctDecode + //jpxDecode + //crypt + + /// + /// Encodes the data with the specified filter. + /// + public static byte[] Encode(byte[] data, string filterName) + { + Filter filter = GetFilter(filterName); + if (filter != null) + return filter.Encode(data); + return null; + } + + /// + /// Encodes a raw string with the specified filter. + /// + public static byte[] Encode(string rawString, string filterName) + { + Filter filter = GetFilter(filterName); + if (filter != null) + return filter.Encode(rawString); + return null; + } + + /// + /// Decodes the data with the specified filter. + /// + public static byte[] Decode(byte[] data, string filterName, FilterParms parms) + { + Filter filter = GetFilter(filterName); + if (filter != null) + return filter.Decode(data, parms); + return null; + } + + /// + /// Decodes the data with the specified filter. + /// + public static byte[] Decode(byte[] data, string filterName) + { + Filter filter = GetFilter(filterName); + if (filter != null) + return filter.Decode(data, null); + return null; + } + + /// + /// Decodes the data with the specified filter. + /// + public static byte[] Decode(byte[] data, PdfItem filterItem) + { + byte[] result = null; + if (filterItem is PdfName) + { + Filter filter = GetFilter(filterItem.ToString()); + if (filter != null) + result = filter.Decode(data); + } + else if (filterItem is PdfArray) + { + PdfArray array = (PdfArray)filterItem; + foreach (PdfItem item in array) + data = Decode(data, item); + result = data; + } + return result; + } + + /// + /// Decodes to a raw string with the specified filter. + /// + public static string DecodeToString(byte[] data, string filterName, FilterParms parms) + { + Filter filter = GetFilter(filterName); + if (filter != null) + return filter.DecodeToString(data, parms); + return null; + } + + /// + /// Decodes to a raw string with the specified filter. + /// + public static string DecodeToString(byte[] data, string filterName) + { + Filter filter = GetFilter(filterName); + if (filter != null) + return filter.DecodeToString(data, null); + return null; + } + } +} diff --git a/PdfSharp/Pdf.Filters/FlateDecode.cs b/PdfSharp/Pdf.Filters/FlateDecode.cs new file mode 100644 index 0000000..58c6d87 --- /dev/null +++ b/PdfSharp/Pdf.Filters/FlateDecode.cs @@ -0,0 +1,220 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.IO; +using PdfSharp.Internal; +#if NET_ZIP +using System.IO.Compression; +#else +using PdfSharp.SharpZipLib.Zip.Compression; +using PdfSharp.SharpZipLib.Zip.Compression.Streams; +#endif + +namespace PdfSharp.Pdf.Filters +{ + /// + /// Implements the FlateDecode filter by wrapping SharpZipLib. + /// + public class FlateDecode : Filter + { + // Reference: 3.3.3 LZWDecode and FlateDecode Filters / Page 71 + + /// + /// Encodes the specified data. + /// + public override byte[] Encode(byte[] data) + { + return Encode(data, PdfFlateEncodeMode.Default); + } + + /// + /// Encodes the specified data. + /// + public byte[] Encode(byte[] data, PdfFlateEncodeMode mode) + { + MemoryStream ms = new MemoryStream(); + + // DeflateStream/GZipStream does not work immediately and I have not the leisure to work it out. + // So I keep on using SharpZipLib even with .NET 2.0. +#if NET_ZIP + // See http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=97064 + // + // Excerpt from the RFC 1950 specs for first byte: + // + // CMF (Compression Method and flags) + // This byte is divided into a 4-bit compression method and a 4- + // bit information field depending on the compression method. + // + // bits 0 to 3 CM Compression method + // bits 4 to 7 CINFO Compression info + // + // CM (Compression method) + // This identifies the compression method used in the file. CM = 8 + // denotes the "deflate" compression method with a window size up + // to 32K. This is the method used by gzip and PNG (see + // references [1] and [2] in Chapter 3, below, for the reference + // documents). CM = 15 is reserved. It might be used in a future + // version of this specification to indicate the presence of an + // extra field before the compressed data. + // + // CINFO (Compression info) + // For CM = 8, CINFO is the base-2 logarithm of the LZ77 window + // size, minus eight (CINFO=7 indicates a 32K window size). Values + // of CINFO above 7 are not allowed in this version of the + // specification. CINFO is not defined in this specification for + // CM not equal to 8. + ms.WriteByte(0x78); + + // Excerpt from the RFC 1950 specs for second byte: + // + // FLG (FLaGs) + // This flag byte is divided as follows: + // + // bits 0 to 4 FCHECK (check bits for CMF and FLG) + // bit 5 FDICT (preset dictionary) + // bits 6 to 7 FLEVEL (compression level) + // + // The FCHECK value must be such that CMF and FLG, when viewed as + // a 16-bit unsigned integer stored in MSB order (CMF*256 + FLG), + // is a multiple of 31. + // + // FDICT (Preset dictionary) + // If FDICT is set, a DICT dictionary identifier is present + // immediately after the FLG byte. The dictionary is a sequence of + // bytes which are initially fed to the compressor without + // producing any compressed output. DICT is the Adler-32 checksum + // of this sequence of bytes (see the definition of ADLER32 + // below). The decompressor can use this identifier to determine + // which dictionary has been used by the compressor. + // + // FLEVEL (Compression level) + // These flags are available for use by specific compression + // methods. The "deflate" method (CM = 8) sets these flags as + // follows: + // + // 0 - compressor used fastest algorithm + // 1 - compressor used fast algorithm + // 2 - compressor used default algorithm + // 3 - compressor used maximum compression, slowest algorithm + // + // The information in FLEVEL is not needed for decompression; it + // is there to indicate if recompression might be worthwhile. + ms.WriteByte(0x49); + + DeflateStream zip = new DeflateStream(ms, CompressionMode.Compress, true); + zip.Write(data, 0, data.Length); + zip.Close(); +#else + int level = Deflater.DEFAULT_COMPRESSION; + switch (mode) + { + case PdfFlateEncodeMode.BestCompression: + level = Deflater.BEST_COMPRESSION; + break; + case PdfFlateEncodeMode.BestSpeed: + level = Deflater.BEST_SPEED; + break; + } + DeflaterOutputStream zip = new DeflaterOutputStream(ms, new Deflater(level, false)); + zip.Write(data, 0, data.Length); + zip.Finish(); +#endif +#if !NETFX_CORE && !UWP + ms.Capacity = (int)ms.Length; + return ms.GetBuffer(); +#else + return ms.ToArray(); +#endif + } + + /// + /// Decodes the specified data. + /// + public override byte[] Decode(byte[] data, FilterParms parms) + { + MemoryStream msInput = new MemoryStream(data); + MemoryStream msOutput = new MemoryStream(); +#if NET_ZIP + // See http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=97064 + // It seems to work when skipping the first two bytes. + byte header; // 0x30 0x59 + header = (byte)msInput.ReadByte(); + //Debug.Assert(header == 48); + header = (byte)msInput.ReadByte(); + //Debug.Assert(header == 89); + DeflateStream zip = new DeflateStream(msInput, CompressionMode.Decompress, true); + int cbRead; + byte[] abResult = new byte[1024]; + do + { + cbRead = zip.Read(abResult, 0, abResult.Length); + if (cbRead > 0) + msOutput.Write(abResult, 0, cbRead); + } + while (cbRead > 0); + zip.Close(); + msOutput.Flush(); + if (msOutput.Length >= 0) + { + msOutput.Capacity = (int)msOutput.Length; + return msOutput.GetBuffer(); + } + return null; +#else + InflaterInputStream iis = new InflaterInputStream(msInput, new Inflater(false)); + int cbRead; + byte[] abResult = new byte[32768]; + do + { + cbRead = iis.Read(abResult, 0, abResult.Length); + if (cbRead > 0) + msOutput.Write(abResult, 0, cbRead); + } + while (cbRead > 0); +#if UWP + iis.Dispose(); +#else + iis.Close(); +#endif + msOutput.Flush(); + if (msOutput.Length >= 0) + { +#if NETFX_CORE || UWP + return msOutput.ToArray(); +#else + msOutput.Capacity = (int)msOutput.Length; + return msOutput.GetBuffer(); +#endif + } + return null; +#endif + } + } +} diff --git a/PdfSharp/Pdf.Filters/LzwDecode.cs b/PdfSharp/Pdf.Filters/LzwDecode.cs new file mode 100644 index 0000000..1f2843f --- /dev/null +++ b/PdfSharp/Pdf.Filters/LzwDecode.cs @@ -0,0 +1,189 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// David Stephensen +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.IO; + +namespace PdfSharp.Pdf.Filters +{ + /// + /// Implements the LzwDecode filter. + /// + public class LzwDecode : Filter + { + // Reference: 3.3.3 LZWDecode and FlateDecode Filters / Page 71 + + /// + /// Throws a NotImplementedException because the obsolete LZW encoding is not supported by PDFsharp. + /// + public override byte[] Encode(byte[] data) + { + throw new NotImplementedException("PDFsharp does not support LZW encoding."); + } + + /// + /// Decodes the specified data. + /// + public override byte[] Decode(byte[] data, FilterParms parms) + { + if (data[0] == 0x00 && data[1] == 0x01) + throw new Exception("LZW flavour not supported."); + + MemoryStream outputStream = new MemoryStream(); + + InitializeDictionary(); + + _data = data; + _bytePointer = 0; + _nextData = 0; + _nextBits = 0; + int code, oldCode = 0; + byte[] str; + + while ((code = NextCode) != 257) + { + if (code == 256) + { + InitializeDictionary(); + code = NextCode; + if (code == 257) + { + break; + } + outputStream.Write(_stringTable[code], 0, _stringTable[code].Length); + oldCode = code; + + } + else + { + if (code < _tableIndex) + { + str = _stringTable[code]; + outputStream.Write(str, 0, str.Length); + AddEntry(_stringTable[oldCode], str[0]); + oldCode = code; + } + else + { + str = _stringTable[oldCode]; + outputStream.Write(str, 0, str.Length); + AddEntry(str, str[0]); + oldCode = code; + } + } + } + + if (outputStream.Length >= 0) + { +#if !NETFX_CORE && !UWP + outputStream.Capacity = (int)outputStream.Length; + return outputStream.GetBuffer(); +#else + return outputStream.ToArray(); +#endif + } + return null; + } + + /// + /// Initialize the dictionary. + /// + void InitializeDictionary() + { + _stringTable = new byte[8192][]; + + for (int i = 0; i < 256; i++) + { + _stringTable[i] = new byte[1]; + _stringTable[i][0] = (byte)i; + } + + _tableIndex = 258; + _bitsToGet = 9; + } + + /// + /// Add a new entry to the Dictionary. + /// + void AddEntry(byte[] oldstring, byte newstring) + { + int length = oldstring.Length; + byte[] str = new byte[length + 1]; + Array.Copy(oldstring, 0, str, 0, length); + str[length] = newstring; + + _stringTable[_tableIndex++] = str; + + if (_tableIndex == 511) + _bitsToGet = 10; + else if (_tableIndex == 1023) + _bitsToGet = 11; + else if (_tableIndex == 2047) + _bitsToGet = 12; + } + + /// + /// Returns the next set of bits. + /// + int NextCode + { + get + { + try + { + _nextData = (_nextData << 8) | (_data[_bytePointer++] & 0xff); + _nextBits += 8; + + if (_nextBits < _bitsToGet) + { + _nextData = (_nextData << 8) | (_data[_bytePointer++] & 0xff); + _nextBits += 8; + } + + int code = (_nextData >> (_nextBits - _bitsToGet)) & _andTable[_bitsToGet - 9]; + _nextBits -= _bitsToGet; + + return code; + } + catch + { + return 257; + } + } + } + + readonly int[] _andTable = { 511, 1023, 2047, 4095 }; + byte[][] _stringTable; + byte[] _data; + int _tableIndex, _bitsToGet = 9; + int _bytePointer; + int _nextData = 0; + int _nextBits = 0; + } +} diff --git a/PdfSharp/Pdf.IO/Chars.cs b/PdfSharp/Pdf.IO/Chars.cs new file mode 100644 index 0000000..67011a5 --- /dev/null +++ b/PdfSharp/Pdf.IO/Chars.cs @@ -0,0 +1,189 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.IO +{ + /// + /// Character table by name. + /// + public sealed class Chars + { + // ReSharper disable InconsistentNaming + + /// + /// The EOF marker. + /// + public const char EOF = (char)65535; //unchecked((char)(-1)); + /// + /// The null byte. + /// + public const char NUL = '\0'; // EOF + /// + /// The carriage return character (ignored by lexer). + /// + public const char CR = '\x0D'; // ignored by lexer + /// + /// The line feed character. + /// + public const char LF = '\x0A'; // Line feed + /// + /// The bell character. + /// + public const char BEL = '\a'; // Bell + /// + /// The backspace character. + /// + public const char BS = '\b'; // Backspace + /// + /// The form feed character. + /// + public const char FF = '\f'; // Form feed + /// + /// The horizontal tab character. + /// + public const char HT = '\t'; // Horizontal tab + /// + /// The vertical tab character. + /// + public const char VT = '\v'; // Vertical tab + /// + /// The non-breakable space character (aka no-break space or non-breaking space). + /// + public const char NonBreakableSpace = (char)160; // char(160) + + // The following names come from "PDF Reference Third Edition" + // Appendix D.1, Latin Character Set and Encoding + /// + /// The space character. + /// + public const char SP = ' '; + /// + /// The double quote character. + /// + public const char QuoteDbl = '"'; + /// + /// The single quote character. + /// + public const char QuoteSingle = '\''; + /// + /// The left parenthesis. + /// + public const char ParenLeft = '('; + /// + /// The right parenthesis. + /// + public const char ParenRight = ')'; + /// + /// The left brace. + /// + public const char BraceLeft = '{'; + /// + /// The right brace. + /// + public const char BraceRight = '}'; + /// + /// The left bracket. + /// + public const char BracketLeft = '['; + /// + /// The right bracket. + /// + public const char BracketRight = ']'; + /// + /// The less-than sign. + /// + public const char Less = '<'; + /// + /// The greater-than sign. + /// + public const char Greater = '>'; + /// + /// The equal sign. + /// + public const char Equal = '='; + /// + /// The period. + /// + public const char Period = '.'; + /// + /// The semicolon. + /// + public const char Semicolon = ';'; + /// + /// The colon. + /// + public const char Colon = ':'; + /// + /// The slash. + /// + public const char Slash = '/'; + /// + /// The bar character. + /// + public const char Bar = '|'; + /// + /// The back slash. + /// + public const char BackSlash = '\\'; + /// + /// The percent sign. + /// + public const char Percent = '%'; + /// + /// The dollar sign. + /// + public const char Dollar = '$'; + /// + /// The at sign. + /// + public const char At = '@'; + /// + /// The number sign. + /// + public const char NumberSign = '#'; + /// + /// The question mark. + /// + public const char Question = '?'; + /// + /// The hyphen. + /// + public const char Hyphen = '-'; // char(45) + /// + /// The soft hyphen. + /// + public const char SoftHyphen = '­'; // char(173) + /// + /// The currency sign. + /// + public const char Currency = '¤'; + + // ReSharper restore InconsistentNaming + } +} diff --git a/PdfSharp/Pdf.IO/Lexer.cs b/PdfSharp/Pdf.IO/Lexer.cs new file mode 100644 index 0000000..171157a --- /dev/null +++ b/PdfSharp/Pdf.IO/Lexer.cs @@ -0,0 +1,902 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Globalization; +using System.Diagnostics; +using System.Text; +using System.IO; +using PdfSharp.Internal; +using PdfSharp.Pdf.Internal; + +#pragma warning disable 1591 + +namespace PdfSharp.Pdf.IO +{ + /// + /// Lexical analyzer for PDF files. Technically a PDF file is a stream of bytes. Some chunks + /// of bytes represent strings in several encodings. The actual encoding depends on the + /// context where the string is used. Therefore the bytes are 'raw encoded' into characters, + /// i.e. a character or token read by the lexer has always character values in the range from + /// 0 to 255. + /// + public class Lexer + { + /// + /// Initializes a new instance of the Lexer class. + /// + public Lexer(Stream pdfInputStream) + { + _pdfSteam = pdfInputStream; + _pdfLength = (int)_pdfSteam.Length; + _idxChar = 0; + Position = 0; + } + + /// + /// Gets or sets the position within the PDF stream. + /// + public int Position + { + get { return _idxChar; } + set + { + _idxChar = value; + _pdfSteam.Position = value; + // ReadByte return -1 (eof) at the end of the stream. + _currChar = (char)_pdfSteam.ReadByte(); + _nextChar = (char)_pdfSteam.ReadByte(); + _token = new StringBuilder(); + } + } + + /// + /// Reads the next token and returns its type. If the token starts with a digit, the parameter + /// testReference specifies how to treat it. If it is false, the lexer scans for a single integer. + /// If it is true, the lexer checks if the digit is the prefix of a reference. If it is a reference, + /// the token is set to the object ID followed by the generation number separated by a blank + /// (the 'R' is omitted from the token). + /// + // /// Indicates whether to test the next token if it is a reference. + public Symbol ScanNextToken() + { + Again: + _token = new StringBuilder(); + + char ch = MoveToNonWhiteSpace(); + switch (ch) + { + case '%': + // Eat comments, the parser doesn't handle them + //return symbol = ScanComment(); + ScanComment(); + goto Again; + + case '/': + return _symbol = ScanName(); + + //case 'R': + // if (Lexer.IsWhiteSpace(nextChar)) + // { + // ScanNextChar(); + // return Symbol.R; + // } + // break; + + case '+': //TODO is it so easy? + case '-': + return _symbol = ScanNumber(); + + case '(': + return _symbol = ScanLiteralString(); + + case '[': + ScanNextChar(true); + return _symbol = Symbol.BeginArray; + + case ']': + ScanNextChar(true); + return _symbol = Symbol.EndArray; + + case '<': + if (_nextChar == '<') + { + ScanNextChar(true); + ScanNextChar(true); + return _symbol = Symbol.BeginDictionary; + } + return _symbol = ScanHexadecimalString(); + + case '>': + if (_nextChar == '>') + { + ScanNextChar(true); + ScanNextChar(true); + return _symbol = Symbol.EndDictionary; + } + ParserDiagnostics.HandleUnexpectedCharacter(_nextChar); + break; + + case '.': + return _symbol = ScanNumber(); + } + if (char.IsDigit(ch)) +#if true_ + return ScanNumberOrReference(); +#else + if (PeekReference()) + return _symbol = ScanNumber(); + else + return _symbol = ScanNumber(); +#endif + + if (char.IsLetter(ch)) + return _symbol = ScanKeyword(); + + if (ch == Chars.EOF) + return _symbol = Symbol.Eof; + + // #??? + + ParserDiagnostics.HandleUnexpectedCharacter(ch); + return _symbol = Symbol.None; + } + + /// + /// Reads the raw content of a stream. + /// + public byte[] ReadStream(int length) + { + int pos; + + // Skip illegal blanks behind stream. + while (_currChar == Chars.SP) + ScanNextChar(true); + + // Skip new line behind stream. + if (_currChar == Chars.CR) + { + if (_nextChar == Chars.LF) + pos = _idxChar + 2; + else + pos = _idxChar + 1; + } + else + pos = _idxChar + 1; + + _pdfSteam.Position = pos; + byte[] bytes = new byte[length]; + int read = _pdfSteam.Read(bytes, 0, length); + Debug.Assert(read == length); + // With corrupted files, read could be different from length. + if (bytes.Length != read) + { + Array.Resize(ref bytes, read); + } + + // Synchronize idxChar etc. + Position = pos + read; + return bytes; + } + + /// + /// Reads a string in raw encoding. + /// + public String ReadRawString(int position, int length) + { + _pdfSteam.Position = position; + byte[] bytes = new byte[length]; + _pdfSteam.Read(bytes, 0, length); + return PdfEncoders.RawEncoding.GetString(bytes, 0, bytes.Length); + } + + /// + /// Scans a comment line. + /// + public Symbol ScanComment() + { + Debug.Assert(_currChar == Chars.Percent); + + _token = new StringBuilder(); + while (true) + { + char ch = AppendAndScanNextChar(); + if (ch == Chars.LF || ch == Chars.EOF) + break; + } + // TODO: not correct + if (_token.ToString().StartsWith("%%EOF")) + return Symbol.Eof; + return _symbol = Symbol.Comment; + } + + /// + /// Scans a name. + /// + public Symbol ScanName() + { + Debug.Assert(_currChar == Chars.Slash); + + _token = new StringBuilder(); + while (true) + { + char ch = AppendAndScanNextChar(); + if (IsWhiteSpace(ch) || IsDelimiter(ch) || ch == Chars.EOF) + return _symbol = Symbol.Name; + + if (ch == '#') + { + ScanNextChar(true); + char[] hex = new char[2]; + hex[0] = _currChar; + hex[1] = _nextChar; + ScanNextChar(true); + // TODO Check syntax + ch = (char)(ushort)int.Parse(new string(hex), NumberStyles.AllowHexSpecifier); + _currChar = ch; + } + } + } + + /// + /// Scans a number. + /// + public Symbol ScanNumber() + { + // I found a PDF file created with Acrobat 7 with this entry + // /Checksum 2996984786 + // What is this? It is neither an integer nor a real. + // I introduced an UInteger... + bool period = false; + //bool sign; + + _token = new StringBuilder(); + char ch = _currChar; + if (ch == '+' || ch == '-') + { + //sign = true; + _token.Append(ch); + ch = ScanNextChar(true); + } + while (true) + { + if (char.IsDigit(ch)) + { + _token.Append(ch); + } + else if (ch == '.') + { + if (period) + ParserDiagnostics.ThrowParserException("More than one period in number."); + + period = true; + _token.Append(ch); + } + else + break; + ch = ScanNextChar(true); + } + + if (period) + return Symbol.Real; + long l = Int64.Parse(_token.ToString(), CultureInfo.InvariantCulture); + if (l >= Int32.MinValue && l <= Int32.MaxValue) + return Symbol.Integer; + if (l > 0 && l <= UInt32.MaxValue) + return Symbol.UInteger; + + // Got an AutoCAD PDF file that contains this: /C 264584027963392 + // Best we can do is to convert it to real value. + return Symbol.Real; + //thr ow new PdfReaderException("Number exceeds integer range."); + } + + public Symbol ScanNumberOrReference() + { + Symbol result = ScanNumber(); + if (result == Symbol.Integer) + { + int pos = Position; + string objectNumber = Token; + } + return result; + } + + /// + /// Scans a keyword. + /// + public Symbol ScanKeyword() + { + _token = new StringBuilder(); + char ch = _currChar; + // Scan token + while (true) + { + if (char.IsLetter(ch)) + _token.Append(ch); + else + break; + ch = ScanNextChar(false); + } + + // Check known tokens. + switch (_token.ToString()) + { + case "obj": + return _symbol = Symbol.Obj; + + case "endobj": + return _symbol = Symbol.EndObj; + + case "null": + return _symbol = Symbol.Null; + + case "true": + case "false": + return _symbol = Symbol.Boolean; + + case "R": + return _symbol = Symbol.R; + + case "stream": + return _symbol = Symbol.BeginStream; + + case "endstream": + return _symbol = Symbol.EndStream; + + case "xref": + return _symbol = Symbol.XRef; + + case "trailer": + return _symbol = Symbol.Trailer; + + case "startxref": + return _symbol = Symbol.StartXRef; + } + + // Anything else is treated as a keyword. Samples are f or n in iref. + return _symbol = Symbol.Keyword; + } + + /// + /// Scans a literal string, contained between "(" and ")". + /// + public Symbol ScanLiteralString() + { + // Reference: 3.2.3 String Objects / Page 53 + // Reference: TABLE 3.32 String Types / Page 157 + + Debug.Assert(_currChar == Chars.ParenLeft); + _token = new StringBuilder(); + int parenLevel = 0; + char ch = ScanNextChar(false); + + // Phase 1: deal with escape characters. + while (ch != Chars.EOF) + { + switch (ch) + { + case '(': + parenLevel++; + break; + + case ')': + if (parenLevel == 0) + { + ScanNextChar(false); + // Is goto evil? We could move Phase 2 code here or create a subroutine for Phase 1. + goto Phase2; + } + parenLevel--; + break; + + case '\\': + { + ch = ScanNextChar(false); + switch (ch) + { + case 'n': + ch = Chars.LF; + break; + + case 'r': + ch = Chars.CR; + break; + + case 't': + ch = Chars.HT; + break; + + case 'b': + ch = Chars.BS; + break; + + case 'f': + ch = Chars.FF; + break; + + case '(': + ch = Chars.ParenLeft; + break; + + case ')': + ch = Chars.ParenRight; + break; + + case '\\': + ch = Chars.BackSlash; + break; + + // AutoCAD PDFs my contain such strings: (\ ) + case ' ': + ch = ' '; + break; + + case Chars.CR: + case Chars.LF: + ch = ScanNextChar(false); + continue; + + default: + // TODO IsOctalDigit(ch). + if (char.IsDigit(ch) && _nextChar != '8' && _nextChar != '9') // First octal character. + { + //// Octal character code. + //if (ch >= '8') + // ParserDiagnostics.HandleUnexpectedCharacter(ch); + + int n = ch - '0'; + if (char.IsDigit(_nextChar) && _nextChar != '8' && _nextChar != '9') // Second octal character. + { + ch = ScanNextChar(false); + //if (ch >= '8') + // ParserDiagnostics.HandleUnexpectedCharacter(ch); + + n = n * 8 + ch - '0'; + if (char.IsDigit(_nextChar) && _nextChar != '8' && _nextChar != '9') // Third octal character. + { + ch = ScanNextChar(false); + //if (ch >= '8') + // ParserDiagnostics.HandleUnexpectedCharacter(ch); + + n = n * 8 + ch - '0'; + } + } + ch = (char)n; + } + else + { + // PDF 32000: "If the character following the REVERSE SOLIDUS is not one of those shown in Table 3, the REVERSE SOLIDUS shall be ignored." + //TODO + // Debug.As sert(false, "Not implemented; unknown escape character."); + // ParserDiagnostics.HandleUnexpectedCharacter(ch); + //GetType(); + } + break; + } + break; + } + default: + break; + } + + _token.Append(ch); + ch = ScanNextChar(false); + } + + // Phase 2: deal with UTF-16BE if necessary. + // UTF-16BE Unicode strings start with U+FEFF (""). There can be empty strings with UTF-16BE prefix. + Phase2: + if (_token.Length >= 2 && _token[0] == '\xFE' && _token[1] == '\xFF') + { + // Combine two ANSI characters to get one Unicode character. + StringBuilder temp = _token; + int length = temp.Length; + if ((length & 1) == 1) + { + // TODO What does the PDF Reference say about this case? Assume (char)0 or treat the file as corrupted? + temp.Append(0); + ++length; + DebugBreak.Break(); + } + _token = new StringBuilder(); + for (int i = 2; i < length; i += 2) + { + _token.Append((char)(256 * temp[i] + temp[i + 1])); + } + return _symbol = Symbol.UnicodeString; + } + // Adobe Reader also supports UTF-16LE. + if (_token.Length >= 2 && _token[0] == '\xFF' && _token[1] == '\xFE') + { + // Combine two ANSI characters to get one Unicode character. + StringBuilder temp = _token; + int length = temp.Length; + if ((length & 1) == 1) + { + // TODO What does the PDF Reference say about this case? Assume (char)0 or treat the file as corrupted? + temp.Append(0); + ++length; + DebugBreak.Break(); + } + _token = new StringBuilder(); + for (int i = 2; i < length; i += 2) + { + _token.Append((char)(256 * temp[i + 1] + temp[i])); + } + return _symbol = Symbol.UnicodeString; + } + return _symbol = Symbol.String; + } + + public Symbol ScanHexadecimalString() + { + Debug.Assert(_currChar == Chars.Less); + + _token = new StringBuilder(); + char[] hex = new char[2]; + ScanNextChar(true); + while (true) + { + MoveToNonWhiteSpace(); + if (_currChar == '>') + { + ScanNextChar(true); + break; + } + if (char.IsLetterOrDigit(_currChar)) + { + hex[0] = char.ToUpper(_currChar); + // Second char is optional in PDF spec. + if (char.IsLetterOrDigit(_nextChar)) + { + hex[1] = char.ToUpper(_nextChar); + ScanNextChar(true); + } + else + { + // We could check for ">" here and throw if we find anything else. The throw comes after the next iteration anyway. + hex[1] = '0'; + } + ScanNextChar(true); + + int ch = int.Parse(new string(hex), NumberStyles.AllowHexSpecifier); + _token.Append(Convert.ToChar(ch)); + } + else + ParserDiagnostics.HandleUnexpectedCharacter(_currChar); + } + string chars = _token.ToString(); + int count = chars.Length; + if (count > 2 && chars[0] == (char)0xFE && chars[1] == (char)0xFF) + { + Debug.Assert(count % 2 == 0); + _token.Length = 0; + for (int idx = 2; idx < count; idx += 2) + _token.Append((char)(chars[idx] * 256 + chars[idx + 1])); + return _symbol = Symbol.UnicodeHexString; + } + return _symbol = Symbol.HexString; + } + + /// + /// Move current position one character further in PDF stream. + /// + internal char ScanNextChar(bool handleCRLF) + { + if (_pdfLength <= _idxChar) + { + _currChar = Chars.EOF; + _nextChar = Chars.EOF; + } + else + { + _currChar = _nextChar; + _nextChar = (char)_pdfSteam.ReadByte(); + _idxChar++; + if (handleCRLF && _currChar == Chars.CR) + { + if (_nextChar == Chars.LF) + { + // Treat CR LF as LF. + _currChar = _nextChar; + _nextChar = (char)_pdfSteam.ReadByte(); + _idxChar++; + } + else + { + // Treat single CR as LF. + _currChar = Chars.LF; + } + } + } + return _currChar; + } + + ///// + ///// Resets the current token to the empty string. + ///// + //void ClearToken() + //{ + // _token.Length = 0; + //} + + bool PeekReference() + { + // A Reference has the form "nnn mmm R". The implementation of the parser used a + // reduce/shift algorithm in the first place. But this case is the only one we need to + // look ahead 3 tokens. + int positon = Position; + + // Skip digits. + while (char.IsDigit(_currChar)) + ScanNextChar(true); + + // Space expected. + if (_currChar != Chars.SP) + goto False; + + // Skip spaces. + while (_currChar == Chars.SP) + ScanNextChar(true); + + // Digit expected. + if (!char.IsDigit(_currChar)) + goto False; + + // Skip digits. + while (char.IsDigit(_currChar)) + ScanNextChar(true); + + // Space expected. + if (_currChar != Chars.SP) + goto False; + + // Skip spaces. + while (_currChar == Chars.SP) + ScanNextChar(true); + + // "R" expected. + // We can ignore _nextChar because there is no other valid token that starts with an 'R'. + if (_currChar != 'R') + goto False; + + Position = positon; + return true; + + False: + Position = positon; + return false; + } + + /// + /// Appends current character to the token and reads next one. + /// + internal char AppendAndScanNextChar() + { + if (_currChar == Chars.EOF) + ParserDiagnostics.ThrowParserException("Undetected EOF reached."); + + _token.Append(_currChar); + return ScanNextChar(true); + } + + /// + /// If the current character is not a white space, the function immediately returns it. + /// Otherwise the PDF cursor is moved forward to the first non-white space or EOF. + /// White spaces are NUL, HT, LF, FF, CR, and SP. + /// + public char MoveToNonWhiteSpace() + { + while (_currChar != Chars.EOF) + { + switch (_currChar) + { + case Chars.NUL: + case Chars.HT: + case Chars.LF: + case Chars.FF: + case Chars.CR: + case Chars.SP: + ScanNextChar(true); + break; + + case (char)11: + case (char)173: + ScanNextChar(true); + break; + + + default: + return _currChar; + } + } + return _currChar; + } + +#if DEBUG + public string SurroundingsOfCurrentPosition(bool hex) + { + const int range = 20; + int start = Math.Max(Position - range, 0); + int length = Math.Min(2 * range, PdfLength - start); + long posOld = _pdfSteam.Position; + _pdfSteam.Position = start; + byte[] bytes = new byte[length]; + _pdfSteam.Read(bytes, 0, length); + _pdfSteam.Position = posOld; + string result = ""; + if (hex) + { + for (int idx = 0; idx < length; idx++) + result += ((int)bytes[idx]).ToString("x2"); + //result += string.Format("{0:", (int) bytes[idx]); + } + else + { + for (int idx = 0; idx < length; idx++) + result += (char)bytes[idx]; + } + return result; + } +#endif + + /// + /// Gets the current symbol. + /// + public Symbol Symbol + { + get { return _symbol; } + set { _symbol = value; } + } + + /// + /// Gets the current token. + /// + public string Token + { + get { return _token.ToString(); } + } + + /// + /// Interprets current token as boolean literal. + /// + public bool TokenToBoolean + { + get + { + Debug.Assert(_token.ToString() == "true" || _token.ToString() == "false"); + return _token.ToString()[0] == 't'; + } + } + + /// + /// Interprets current token as integer literal. + /// + public int TokenToInteger + { + get + { + //Debug.As sert(_token.ToString().IndexOf('.') == -1); + return int.Parse(_token.ToString(), CultureInfo.InvariantCulture); + } + } + + /// + /// Interprets current token as unsigned integer literal. + /// + public uint TokenToUInteger + { + get + { + //Debug.As sert(_token.ToString().IndexOf('.') == -1); + return uint.Parse(_token.ToString(), CultureInfo.InvariantCulture); + } + } + + /// + /// Interprets current token as real or integer literal. + /// + public double TokenToReal + { + get { return double.Parse(_token.ToString(), CultureInfo.InvariantCulture); } + } + + /// + /// Interprets current token as object ID. + /// + public PdfObjectID TokenToObjectID + { + get + { + string[] numbers = Token.Split('|'); + int objectNumber = Int32.Parse(numbers[0]); + int generationNumber = Int32.Parse(numbers[1]); + return new PdfObjectID(objectNumber, generationNumber); + } + } + + /// + /// Indicates whether the specified character is a PDF white-space character. + /// + internal static bool IsWhiteSpace(char ch) + { + switch (ch) + { + case Chars.NUL: // 0 Null + case Chars.HT: // 9 Horizontal Tab + case Chars.LF: // 10 Line Feed + case Chars.FF: // 12 Form Feed + case Chars.CR: // 13 Carriage Return + case Chars.SP: // 32 Space + return true; + } + return false; + } + + /// + /// Indicates whether the specified character is a PDF delimiter character. + /// + internal static bool IsDelimiter(char ch) + { + switch (ch) + { + case '(': + case ')': + case '<': + case '>': + case '[': + case ']': + case '{': + case '}': + case '/': + case '%': + return true; + } + return false; + } + + /// + /// Gets the length of the PDF output. + /// + public int PdfLength + { + get { return _pdfLength; } + } + + readonly int _pdfLength; + int _idxChar; + char _currChar; + char _nextChar; + StringBuilder _token; + Symbol _symbol = Symbol.None; + + readonly Stream _pdfSteam; + } +} diff --git a/PdfSharp/Pdf.IO/Parser.cs b/PdfSharp/Pdf.IO/Parser.cs new file mode 100644 index 0000000..f9779a0 --- /dev/null +++ b/PdfSharp/Pdf.IO/Parser.cs @@ -0,0 +1,1818 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using PdfSharp.Internal; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf.IO +{ + /* + Direct and indirect objects + + * If a simple object (boolean, integer, number, date, string, rectangle etc.) is referenced indirect, + the parser reads this objects immediately and consumes the indirection. + + * If a composite object (dictionary, array etc.) is referenced indirect, a PdfReference objects + is returned. + + * If a composite object is a direct object, no PdfReference is created and the object is + parsed immediately. + + * A reference to a non existing object is specified as legal, therefore null is returned. + */ + + /// + /// Provides the functionality to parse PDF documents. + /// + internal sealed class Parser + { + public Parser(PdfDocument document, Stream pdf) + { + _document = document; + _lexer = new Lexer(pdf); + _stack = new ShiftStack(); + } + + public Parser(PdfDocument document) + { + _document = document; + _lexer = document._lexer; + _stack = new ShiftStack(); + } + + /// + /// Sets PDF input stream position to the specified object. + /// + public int MoveToObject(PdfObjectID objectID) + { + int position = _document._irefTable[objectID].Position; + return _lexer.Position = position; + } + + public Symbol Symbol + { + get { return _lexer.Symbol; } + } + + public PdfObjectID ReadObjectNumber(int position) + { + _lexer.Position = position; + int objectNumber = ReadInteger(); + int generationNumber = ReadInteger(); +#if DEBUG && CORE + if (objectNumber == 1074) + GetType(); +#endif + return new PdfObjectID(objectNumber, generationNumber); + } + + + /// + /// Reads PDF object from input stream. + /// + /// Either the instance of a derived type or null. If it is null + /// an appropriate object is created. + /// The address of the object. + /// If true, specifies that all indirect objects + /// are included recursively. + /// If true, the objects is parsed from an object stream. + public PdfObject ReadObject(PdfObject pdfObject, PdfObjectID objectID, bool includeReferences, bool fromObjecStream) + { +#if DEBUG_ + Debug.WriteLine("ReadObject: " + objectID); + if (objectID.ObjectNumber == 20) + GetType(); +#endif + int objectNumber = objectID.ObjectNumber; + int generationNumber = objectID.GenerationNumber; + if (!fromObjecStream) + { + MoveToObject(objectID); + objectNumber = ReadInteger(); + generationNumber = ReadInteger(); + } +#if DEBUG + // The following assertion sometime failed (see below) + //Debug.Assert(objectID == new PdfObjectID(objectNumber, generationNumber)); + if (!fromObjecStream && objectID != new PdfObjectID(objectNumber, generationNumber)) + { + // A special kind of bug? Or is this an undocumented PDF feature? + // PDF4NET 2.6 provides a sample called 'Unicode', which produces a file 'unicode.pdf' + // The iref table of this file contains the following entries: + // iref + // 0 148 + // 0000000000 65535 f + // 0000000015 00000 n + // 0000000346 00000 n + // .... + // 0000083236 00000 n + // 0000083045 00000 n + // 0000083045 00000 n + // 0000083045 00000 n + // 0000083045 00000 n + // 0000080334 00000 n + // .... + // Object 84, 85, 86, and 87 maps to the same dictionary, but all PDF readers I tested + // ignores this mismatch! The following assertion failed about 50 times with this file. +#if true_ + string message = String.Format("xref entry {0} {1} maps to object {2} {3}.", + objectID.ObjectNumber, objectID.GenerationNumber, objectNumber, generationNumber); + Debug.Assert(false, message); +#endif + } +#endif + // Always use object ID from iref table (see above). + objectNumber = objectID.ObjectNumber; + generationNumber = objectID.GenerationNumber; +#if true_ + Debug.WriteLine(String.Format("obj: {0} {1}", objectNumber, generationNumber)); +#endif + if (!fromObjecStream) + ReadSymbol(Symbol.Obj); + + bool checkForStream = false; + Symbol symbol = ScanNextToken(); + switch (symbol) + { + case Symbol.BeginArray: + PdfArray array; + if (pdfObject == null) + array = new PdfArray(_document); + else + array = (PdfArray)pdfObject; + //PdfObject.RegisterObject(array, objectID, generation); + pdfObject = ReadArray(array, includeReferences); + pdfObject.SetObjectID(objectNumber, generationNumber); + break; + + case Symbol.BeginDictionary: + PdfDictionary dict; + if (pdfObject == null) + dict = new PdfDictionary(_document); + else + dict = (PdfDictionary)pdfObject; + //PdfObject.RegisterObject(dict, objectID, generation); + checkForStream = true; + pdfObject = ReadDictionary(dict, includeReferences); + pdfObject.SetObjectID(objectNumber, generationNumber); + break; + + // Acrobat 6 Professional proudly presents: The Null object! + // Even with a one-digit object number an indirect reference x 0 R to this object is + // one character larger than the direct use of null. Probable this is the reason why + // it is true that Acrobat Web Capture 6.0 creates this object, but obviously never + // creates a reference to it! + case Symbol.Null: + pdfObject = new PdfNullObject(_document); + pdfObject.SetObjectID(objectNumber, generationNumber); + if (!fromObjecStream) + ReadSymbol(Symbol.EndObj); + return pdfObject; + + // Empty object. Invalid PDF, but we need to handle it. Treat as null object. + case Symbol.EndObj: + pdfObject = new PdfNullObject(_document); + pdfObject.SetObjectID(objectNumber, generationNumber); + return pdfObject; + + case Symbol.Boolean: + pdfObject = new PdfBooleanObject(_document, String.Compare(_lexer.Token, Boolean.TrueString, StringComparison.OrdinalIgnoreCase) == 0); + pdfObject.SetObjectID(objectNumber, generationNumber); + if (!fromObjecStream) + ReadSymbol(Symbol.EndObj); + return pdfObject; + + case Symbol.Integer: + pdfObject = new PdfIntegerObject(_document, _lexer.TokenToInteger); + pdfObject.SetObjectID(objectNumber, generationNumber); + if (!fromObjecStream) + ReadSymbol(Symbol.EndObj); + return pdfObject; + + case Symbol.UInteger: + pdfObject = new PdfUIntegerObject(_document, _lexer.TokenToUInteger); + pdfObject.SetObjectID(objectNumber, generationNumber); + if (!fromObjecStream) + ReadSymbol(Symbol.EndObj); + return pdfObject; + + case Symbol.Real: + pdfObject = new PdfRealObject(_document, _lexer.TokenToReal); + pdfObject.SetObjectID(objectNumber, generationNumber); + if (!fromObjecStream) + ReadSymbol(Symbol.EndObj); + return pdfObject; + + case Symbol.String: + case Symbol.UnicodeString: + case Symbol.HexString: + case Symbol.UnicodeHexString: + pdfObject = new PdfStringObject(_document, _lexer.Token); + pdfObject.SetObjectID(objectNumber, generationNumber); + if (!fromObjecStream) + ReadSymbol(Symbol.EndObj); + return pdfObject; + + case Symbol.Name: + pdfObject = new PdfNameObject(_document, _lexer.Token); + pdfObject.SetObjectID(objectNumber, generationNumber); + if (!fromObjecStream) + ReadSymbol(Symbol.EndObj); + return pdfObject; + + case Symbol.Keyword: + // Should not come here anymore. + ParserDiagnostics.HandleUnexpectedToken(_lexer.Token); + break; + + default: + // Should not come here anymore. + ParserDiagnostics.HandleUnexpectedToken(_lexer.Token); + break; + } + symbol = ScanNextToken(); + if (symbol == Symbol.BeginStream) + { + PdfDictionary dict = (PdfDictionary)pdfObject; + Debug.Assert(checkForStream, "Unexpected stream..."); +#if true_ + ReadStream(dict); +#else + int length = GetStreamLength(dict); + byte[] bytes = _lexer.ReadStream(length); +#if true_ + if (dict.Elements.GetString("/Filter") == "/FlateDecode") + { + if (dict.Elements["/Subtype"] == null) + { + try + { + byte[] decoded = Filtering.FlateDecode.Decode(bytes); + if (decoded.Length == 0) + goto End; + string pageContent = Filtering.FlateDecode.DecodeToString(bytes); + if (pageContent.Length > 100) + pageContent = pageContent.Substring(pageContent.Length - 100); + pageContent.GetType(); + bytes = decoded; + dict.Elements.Remove("/Filter"); + dict.Elements.SetInteger("/Length", bytes.Length); + } + catch + { + } + } + End: ; + } +#endif + PdfDictionary.PdfStream stream = new PdfDictionary.PdfStream(bytes, dict); + dict.Stream = stream; + ReadSymbol(Symbol.EndStream); + symbol = ScanNextToken(); +#endif + } + if (!fromObjecStream && symbol != Symbol.EndObj) + ParserDiagnostics.ThrowParserException(PSSR.UnexpectedToken(_lexer.Token)); + return pdfObject; + } + + //public PdfObject ReadObject(PdfObject obj, bool includeReferences) + + /// + /// Reads the stream of a dictionary. + /// + private void ReadStream(PdfDictionary dict) + { + Symbol symbol = _lexer.Symbol; + Debug.Assert(symbol == Symbol.BeginStream); + int length = GetStreamLength(dict); + byte[] bytes = _lexer.ReadStream(length); + PdfDictionary.PdfStream stream = new PdfDictionary.PdfStream(bytes, dict); + Debug.Assert(dict.Stream == null, "Dictionary already has a stream."); + dict.Stream = stream; + ReadSymbol(Symbol.EndStream); + ScanNextToken(); + } + + // HACK: Solve problem more general. + private int GetStreamLength(PdfDictionary dict) + { + if (dict.Elements["/F"] != null) + throw new NotImplementedException("File streams are not yet implemented."); + + PdfItem value = dict.Elements["/Length"]; + if (value is PdfInteger) + return Convert.ToInt32(value); + + PdfReference reference = value as PdfReference; + if (reference != null) + { + ParserState state = SaveState(); + object length = ReadObject(null, reference.ObjectID, false, false); + RestoreState(state); + int len = ((PdfIntegerObject)length).Value; + dict.Elements["/Length"] = new PdfInteger(len); + return len; + } + throw new InvalidOperationException("Cannot retrieve stream length."); + } + + public PdfArray ReadArray(PdfArray array, bool includeReferences) + { + Debug.Assert(Symbol == Symbol.BeginArray); + + if (array == null) + array = new PdfArray(_document); + + int sp = _stack.SP; + ParseObject(Symbol.EndArray); + int count = _stack.SP - sp; + PdfItem[] items = _stack.ToArray(sp, count); + _stack.Reduce(count); + for (int idx = 0; idx < count; idx++) + { + PdfItem val = items[idx]; + if (includeReferences && val is PdfReference) + val = ReadReference((PdfReference)val, true); + array.Elements.Add(val); + } + return array; + } + +#if DEBUG_ + static int ReadDictionaryCounter; +#endif + + internal PdfDictionary ReadDictionary(PdfDictionary dict, bool includeReferences) + { + Debug.Assert(Symbol == Symbol.BeginDictionary); + +#if DEBUG_ + ReadDictionaryCounter++; + Debug.WriteLine(ReadDictionaryCounter.ToString()); + if (ReadDictionaryCounter == 101) + GetType(); +#endif + + if (dict == null) + dict = new PdfDictionary(_document); + DictionaryMeta meta = dict.Meta; + + int sp = _stack.SP; + ParseObject(Symbol.EndDictionary); + int count = _stack.SP - sp; + Debug.Assert(count % 2 == 0); + PdfItem[] items = _stack.ToArray(sp, count); + _stack.Reduce(count); + for (int idx = 0; idx < count; idx += 2) + { + PdfItem val = items[idx]; + if (!(val is PdfName)) + ParserDiagnostics.ThrowParserException("Name expected."); // TODO L10N using PSSR. + + string key = val.ToString(); + val = items[idx + 1]; + if (includeReferences && val is PdfReference) + val = ReadReference((PdfReference)val, true); + dict.Elements[key] = val; + } + return dict; + } + +#if DEBUG_ + static int ParseObjectCounter; +#endif + + /// + /// Parses whatever comes until the specified stop symbol is reached. + /// + private void ParseObject(Symbol stop) + { +#if DEBUG_ + ParseObjectCounter++; + Debug.WriteLine(ParseObjectCounter.ToString()); + if (ParseObjectCounter == 178) + GetType(); +#endif + Symbol symbol; + while ((symbol = ScanNextToken()) != Symbol.Eof) + { + if (symbol == stop) + return; + + switch (symbol) + { + case Symbol.Comment: + // ignore comments + break; + + case Symbol.Null: + _stack.Shift(PdfNull.Value); + break; + + case Symbol.Boolean: + _stack.Shift(new PdfBoolean(_lexer.TokenToBoolean)); + break; + + case Symbol.Integer: + _stack.Shift(new PdfInteger(_lexer.TokenToInteger)); + break; + + case Symbol.UInteger: + _stack.Shift(new PdfUInteger(_lexer.TokenToUInteger)); + break; + + case Symbol.Real: + _stack.Shift(new PdfReal(_lexer.TokenToReal)); + break; + + case Symbol.String: + //stack.Shift(new PdfString(lexer.Token, PdfStringFlags.PDFDocEncoding)); + _stack.Shift(new PdfString(_lexer.Token, PdfStringFlags.RawEncoding)); + break; + + case Symbol.UnicodeString: + _stack.Shift(new PdfString(_lexer.Token, PdfStringFlags.Unicode)); + break; + + case Symbol.HexString: + _stack.Shift(new PdfString(_lexer.Token, PdfStringFlags.HexLiteral)); + break; + + case Symbol.UnicodeHexString: + _stack.Shift(new PdfString(_lexer.Token, PdfStringFlags.Unicode | PdfStringFlags.HexLiteral)); + break; + + case Symbol.Name: + _stack.Shift(new PdfName(_lexer.Token)); + break; + + case Symbol.R: + { + Debug.Assert(_stack.GetItem(-1) is PdfInteger && _stack.GetItem(-2) is PdfInteger); + PdfObjectID objectID = new PdfObjectID(_stack.GetInteger(-2), _stack.GetInteger(-1)); + + PdfReference iref = _document._irefTable[objectID]; + if (iref == null) + { + // If a document has more than one PdfXRefTable it is possible that the first trailer has + // indirect references to objects whose iref entry is not yet read in. + if (_document._irefTable.IsUnderConstruction) + { + // XRefTable not complete when trailer is read. Create temporary irefs that are + // removed later in PdfTrailer.FixXRefs. + iref = new PdfReference(objectID, 0); + _stack.Reduce(iref, 2); + break; + } + // PDF Reference section 3.2.9: + // An indirect reference to an undefined object is not an error; + // it is simply treated as a reference to the null object. + _stack.Reduce(PdfNull.Value, 2); + // Let's see what null objects are good for... + //Debug.Assert(false, "Null object detected!"); + //stack.Reduce(PdfNull.Value, 2); + } + else + _stack.Reduce(iref, 2); + break; + } + + case Symbol.BeginArray: + PdfArray array = new PdfArray(_document); + ReadArray(array, false); + _stack.Shift(array); + break; + + case Symbol.BeginDictionary: + PdfDictionary dict = new PdfDictionary(_document); + ReadDictionary(dict, false); + _stack.Shift(dict); + break; + + case Symbol.BeginStream: + throw new NotImplementedException(); + + // Not expected here: + //case Symbol.None: + //case Symbol.Keyword: + //case Symbol.EndStream: + //case Symbol.EndArray: + //case Symbol.EndDictionary: + //case Symbol.Obj: + //case Symbol.EndObj: + //case Symbol.XRef: + //case Symbol.Trailer: + //case Symbol.StartXRef: + //case Symbol.Eof: + default: + ParserDiagnostics.HandleUnexpectedToken(_lexer.Token); + SkipCharsUntil(stop); + return; + } + } + ParserDiagnostics.ThrowParserException("Unexpected end of file."); // TODO L10N using PSSR. + } + + private Symbol ScanNextToken() + { + return _lexer.ScanNextToken(); + } + + private Symbol ScanNextToken(out string token) + { + Symbol symbol = _lexer.ScanNextToken(); + token = _lexer.Token; + return symbol; + } + + private Symbol SkipCharsUntil(Symbol stop) + { + Symbol symbol; + switch (stop) + { + case Symbol.EndDictionary: + return SkipCharsUntil(">>", stop); + + default: + do + { + symbol = ScanNextToken(); + } while (symbol != stop && symbol != Symbol.Eof); + return symbol; + } + } + + private Symbol SkipCharsUntil(string text, Symbol stop) + { + int length = text.Length; + int idx = 0; + char ch; + while ((ch = _lexer.ScanNextChar(true)) != Chars.EOF) + { + if (ch == text[idx]) + { + if (idx + 1 == length) + { + _lexer.ScanNextChar(true); + return stop; + } + idx++; + } + else + idx = 0; + } + return Symbol.Eof; + } + + //protected Symbol ScanNextToken(out string token, bool testReference) + //{ + // Symbol symbol = lexer.ScanNextToken(testReference); + // token = lexer.Token; + // return symbol; + //} + + // internal object ReadObject(int position) + // { + // lexer.Position = position; + // return ReadObject(false); + // } + // + // internal virtual object ReadObject(bool directObject) + // { + // throw new InvalidOperationException("PdfParser.ReadObject() base class called"); + // } + + /// + /// Reads the object ID and the generation and sets it into the specified object. + /// + private void ReadObjectID(PdfObject obj) + { + int objectNubmer = ReadInteger(); + int generationNumber = ReadInteger(); + ReadSymbol(Symbol.Obj); + if (obj != null) + obj.SetObjectID(objectNubmer, generationNumber); + } + + private PdfItem ReadReference(PdfReference iref, bool includeReferences) + { + throw new NotImplementedException("ReadReference"); + } + + /// + /// Reads the next symbol that must be the specified one. + /// + private Symbol ReadSymbol(Symbol symbol) + { + if (symbol == Symbol.EndStream) + { + Skip: + char ch = _lexer.MoveToNonWhiteSpace(); + + if (ch == Chars.EOF) + ParserDiagnostics.HandleUnexpectedCharacter(ch); + + if (ch != 'e') + { + _lexer.ScanNextChar(false); + goto Skip; + } + } + Symbol current = _lexer.ScanNextToken(); + if (symbol != current) + ParserDiagnostics.HandleUnexpectedToken(_lexer.Token); + return current; + } + + /// + /// Reads the next token that must be the specified one. + /// + private Symbol ReadToken(string token) + { + Symbol current = _lexer.ScanNextToken(); + if (token != _lexer.Token) + ParserDiagnostics.HandleUnexpectedToken(_lexer.Token); + return current; + } + + /// + /// Reads a name from the PDF data stream. The preceding slash is part of the result string. + /// + private string ReadName() + { + string name; + Symbol symbol = ScanNextToken(out name); + if (symbol != Symbol.Name) + ParserDiagnostics.HandleUnexpectedToken(name); + return name; + } + + /* + /// + /// Reads a string immediately or (optionally) indirectly from the PDF data stream. + /// + protected string ReadString(bool canBeIndirect) + { + Symbol symbol = Symbol.None; //lexer.ScanNextToken(canBeIndirect); + if (symbol == Symbol.String || symbol == Symbol.UnicodeString || symbol == Symbol.HexString || symbol == Symbol.UnicodeHexString) + return lexer.Token; + else if (symbol == Symbol.R) + { + int position = lexer.Position; + MoveToObject(lexer.Token); + ReadObjectID(null); + string s = ReadString(); + ReadSymbol(Symbol.EndObj); + lexer.Position = position; + return s; + } + thr ow new PdfReaderException(PSSR.UnexpectedToken(lexer.Token)); + } + + protected string ReadString() + { + return ReadString(false); + } + + /// + /// Reads a string immediately or (optionally) indirectly from the PDF data stream. + /// + protected bool ReadBoolean(bool canBeIndirect) + { + Symbol symbol = lexer.ScanNextToken(canBeIndirect); + if (symbol == Symbol.Boolean) + return lexer.TokenToBoolean; + else if (symbol == Symbol.R) + { + int position = lexer.Position; + MoveToObject(lexer.Token); + ReadObjectID(null); + bool b = ReadBoolean(); + ReadSymbol(Symbol.EndObj); + lexer.Position = position; + return b; + } + thr ow new PdfReaderException(PSSR.UnexpectedToken(lexer.Token)); + } + + protected bool ReadBoolean() + { + return ReadBoolean(false); + } + */ + + /// + /// Reads an integer value directly from the PDF data stream. + /// + private int ReadInteger(bool canBeIndirect) + { + Symbol symbol = _lexer.ScanNextToken(); + if (symbol == Symbol.Integer) + return _lexer.TokenToInteger; + + if (symbol == Symbol.R) + { + int position = _lexer.Position; + // MoveToObject(lexer.Token); + ReadObjectID(null); + int n = ReadInteger(); + ReadSymbol(Symbol.EndObj); + _lexer.Position = position; + return n; + } + ParserDiagnostics.HandleUnexpectedToken(_lexer.Token); + return 0; + } + + private int ReadInteger() + { + return ReadInteger(false); + } + + // /// + // /// Reads a real value directly or (optionally) indirectly from the PDF data stream. + // /// + // double ReadReal(bool canBeIndirect) + // { + // Symbol symbol = lexer.ScanNextToken(canBeIndirect); + // if (symbol == Symbol.Real || symbol == Symbol.Integer) + // return lexer.TokenToReal; + // else if (symbol == Symbol.R) + // { + // int position = lexer.Position; + //// MoveToObject(lexer.Token); + // ReadObjectID(null); + // double f = ReadReal(); + // ReadSymbol(Symbol.EndObj); + // lexer.Position = position; + // return f; + // } + // thr ow new PdfReaderException(PSSR.UnexpectedToken(lexer.Token)); + // } + // + // double ReadReal() + // { + // return ReadReal(false); + // } + + // /// + // /// Reads an object from the PDF input stream. If the object has a specialized parser, it it used. + // /// + // public static PdfObject ReadObject(PdfObject pdfObject, PdfObjectID objectID) + // { + // if (pdfObject == null) + // thr ow new ArgumentNullException("pdfObject"); + // if (pdfObject.Document == null) + // th row new ArgumentException(PSSR.OwningDocumentRequired, "pdfObject"); + // + // Type type = pdfObject.GetType(); + // PdfParser parser = CreateParser(pdfObject.Document, type); + // return parser.ReadObject(pdfObject, objectID, false); + // } + + /// + /// Reads an object from the PDF input stream using the default parser. + /// + public static PdfObject ReadObject(PdfDocument owner, PdfObjectID objectID) + { + if (owner == null) + throw new ArgumentNullException("owner"); + + Parser parser = new Parser(owner); + return parser.ReadObject(null, objectID, false, false); + } + + /// + /// Reads the irefs from the compressed object with the specified index in the object stream + /// of the object with the specified object id. + /// + internal void ReadIRefsFromCompressedObject(PdfObjectID objectID) + { + PdfReference iref; + + Debug.Assert(_document._irefTable.ObjectTable.ContainsKey(objectID)); + if (!_document._irefTable.ObjectTable.TryGetValue(objectID, out iref)) + { + // We should never come here because the object stream must be a type 1 entry in the xref stream + // and iref was created before. + throw new NotImplementedException("This case is not coded or something else went wrong"); + } + + // Read in object stream object when we come here for the very first time. + if (iref.Value == null) + { + try + { + Debug.Assert(_document._irefTable.Contains(iref.ObjectID)); + PdfDictionary pdfObject = (PdfDictionary)ReadObject(null, iref.ObjectID, false, false); + PdfObjectStream objectStream = new PdfObjectStream(pdfObject); + Debug.Assert(objectStream.Reference == iref); + // objectStream.Reference = iref; Superfluous, see Assert in line before. + Debug.Assert(objectStream.Reference.Value != null, "Something went wrong."); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + throw; + } + } + Debug.Assert(iref.Value != null); + + PdfObjectStream objectStreamStream = iref.Value as PdfObjectStream; + if (objectStreamStream == null) + { + Debug.Assert(((PdfDictionary)iref.Value).Elements.GetName("/Type") == "/ObjStm"); + + objectStreamStream = new PdfObjectStream((PdfDictionary)iref.Value); + Debug.Assert(objectStreamStream.Reference == iref); + // objectStream.Reference = iref; Superfluous, see Assert in line before. + Debug.Assert(objectStreamStream.Reference.Value != null, "Something went wrong."); + } + Debug.Assert(objectStreamStream != null); + + + //PdfObjectStream objectStreamStream = (PdfObjectStream)iref.Value; + if (objectStreamStream == null) + throw new Exception("Something went wrong here."); + objectStreamStream.ReadReferences(_document._irefTable); + } + + /// + /// Reads the compressed object with the specified index in the object stream + /// of the object with the specified object id. + /// + internal PdfReference ReadCompressedObject(PdfObjectID objectID, int index) + { + PdfReference iref; +#if true + Debug.Assert(_document._irefTable.ObjectTable.ContainsKey(objectID)); + if (!_document._irefTable.ObjectTable.TryGetValue(objectID, out iref)) + { + throw new NotImplementedException("This case is not coded or something else went wrong"); + } +#else + // We should never come here because the object stream must be a type 1 entry in the xref stream + // and iref was created before. + + // Has the specified object already an iref in the object table? + if (!_document._irefTable.ObjectTable.TryGetValue(objectID, out iref)) + { + try + { +#if true_ + iref = new PdfReference(objectID,); + iref.ObjectID = objectID; + _document._irefTable.Add(os); +#else + PdfDictionary dict = (PdfDictionary)ReadObject(null, objectID, false, false); + PdfObjectStream os = new PdfObjectStream(dict); + iref = new PdfReference(os); + iref.ObjectID = objectID; + _document._irefTable.Add(os); +#endif + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + throw; + } + } +#endif + + // Read in object stream object when we come here for the very first time. + if (iref.Value == null) + { + try + { + Debug.Assert(_document._irefTable.Contains(iref.ObjectID)); + PdfDictionary pdfObject = (PdfDictionary)ReadObject(null, iref.ObjectID, false, false); + PdfObjectStream objectStream = new PdfObjectStream(pdfObject); + Debug.Assert(objectStream.Reference == iref); + // objectStream.Reference = iref; Superfluous, see Assert in line before. + Debug.Assert(objectStream.Reference.Value != null, "Something went wrong."); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + throw; + } + } + Debug.Assert(iref.Value != null); + + PdfObjectStream objectStreamStream = iref.Value as PdfObjectStream; + if (objectStreamStream == null) + { + Debug.Assert(((PdfDictionary)iref.Value).Elements.GetName("/Type") == "/ObjStm"); + + objectStreamStream = new PdfObjectStream((PdfDictionary)iref.Value); + Debug.Assert(objectStreamStream.Reference == iref); + // objectStream.Reference = iref; Superfluous, see Assert in line before. + Debug.Assert(objectStreamStream.Reference.Value != null, "Something went wrong."); + } + Debug.Assert(objectStreamStream != null); + + + //PdfObjectStream objectStreamStream = (PdfObjectStream)iref.Value; + if (objectStreamStream == null) + throw new Exception("Something went wrong here."); + return objectStreamStream.ReadCompressedObject(index); + } + + /// + /// Reads the compressed object with the specified number at the given offset. + /// The parser must be initialized with the stream an object stream object. + /// + internal PdfReference ReadCompressedObject(int objectNumber, int offset) + { +#if DEBUG__ + if (objectNumber == 1034) + GetType(); +#endif + // Generation is always 0 for compressed objects. + PdfObjectID objectID = new PdfObjectID(objectNumber); + _lexer.Position = offset; + PdfObject obj = ReadObject(null, objectID, false, true); + return obj.Reference; + } + + /// + /// Reads the object stream header as pairs of integers from the beginning of the + /// stream of an object stream. Parameter first is the value of the First entry of + /// the object stream object. + /// + internal int[][] ReadObjectStreamHeader(int n, int first) + { + // TODO: Concept for general error handling. + // If the stream is corrupted a lot of things can go wrong here. + // Make it sense to do a more detailed error checking? + + // Create n pairs of integers with object number and offset. + int[][] header = new int[n][]; + for (int idx = 0; idx < n; idx++) + { + int number = ReadInteger(); +#if DEBUG + if (number == 1074) + GetType(); +#endif + int offset = ReadInteger() + first; // Calculate absolute offset. + header[idx] = new int[] { number, offset }; + } + return header; + } + + /// + /// Reads the cross-reference table(s) and their trailer dictionary or + /// cross-reference streams. + /// + internal PdfTrailer ReadTrailer() + { + int length = _lexer.PdfLength; + + // Implementation note 18 Appendix H: + // Acrobat viewers require only that the %%EOF marker appear somewhere within the last 1024 bytes of the file. + int idx; + if (length < 1030) + { + // Reading the final 30 bytes should work for all files. But often it does not. + string trail = _lexer.ReadRawString(length - 31, 30); //lexer.Pdf.Substring(length - 30); + idx = trail.LastIndexOf("startxref", StringComparison.Ordinal); + _lexer.Position = length - 31 + idx; + } + else + { + // For larger files we read 1 kiB - in most cases we find "startxref" in that range. + string trail = _lexer.ReadRawString(length - 1031, 1030); + idx = trail.LastIndexOf("startxref", StringComparison.Ordinal); + _lexer.Position = length - 1031 + idx; + } + + // SAP sometimes creates files with a size of several MByte and places "startxref" somewhere in the middle... + if (idx == -1) + { + // If "startxref" was still not found yet, read the file completely. + string trail = _lexer.ReadRawString(0, length); + idx = trail.LastIndexOf("startxref", StringComparison.Ordinal); + _lexer.Position = idx; + } + if (idx == -1) + throw new Exception("The StartXRef table could not be found, the file cannot be opened."); + + ReadSymbol(Symbol.StartXRef); + _lexer.Position = ReadInteger(); + + // Read all trailers. + while (true) + { + PdfTrailer trailer = ReadXRefTableAndTrailer(_document._irefTable); + // 1st trailer seems to be the best. + if (_document._trailer == null) + _document._trailer = trailer; + int prev = trailer != null ? trailer.Elements.GetInteger(PdfTrailer.Keys.Prev) : 0; + if (prev == 0) + break; + //if (prev > lexer.PdfLength) + // break; + _lexer.Position = prev; + } + + return _document._trailer; + } + + /// + /// Reads cross reference table(s) and trailer(s). + /// + private PdfTrailer ReadXRefTableAndTrailer(PdfCrossReferenceTable xrefTable) + { + Debug.Assert(xrefTable != null); + + Symbol symbol = ScanNextToken(); + + if (symbol == Symbol.XRef) // Is it a cross-reference table? + { + // Reference: 3.4.3 Cross-Reference Table / Page 93 + while (true) + { + symbol = ScanNextToken(); + if (symbol == Symbol.Integer) + { + int start = _lexer.TokenToInteger; + int length = ReadInteger(); + for (int id = start; id < start + length; id++) + { + int position = ReadInteger(); + int generation = ReadInteger(); + ReadSymbol(Symbol.Keyword); + string token = _lexer.Token; + // Skip start entry. + if (id == 0) + continue; + // Skip unused entries. + if (token != "n") + continue; +#if true + //!!!new 2018-03-14 begin + // Check if the object at the address has the correct ID and generation. + int idToUse = id; + int idChecked, generationChecked; + if (!CheckXRefTableEntry(position, id, generation, out idChecked, out generationChecked)) + { + // Found the keyword "obj", but ID or generation did not match. + // There is a tool where ID is off by one. In this case we use the ID from the object, not the ID from the XRef table. + if (generation == generationChecked && id == idChecked + 1) + idToUse = idChecked; + else + ParserDiagnostics.ThrowParserException("Invalid entry in XRef table, ID=" + id + ", Generation=" + generation + ", Position=" + position + ", ID of referenced object=" + idChecked + ", Generation of referenced object=" + generationChecked); // TODO L10N using PSSR. + } + //!!!new 2018-03-14 end +#endif + // Even if it is restricted, an object can exist in more than one subsection. + // (PDF Reference Implementation Notes 15). + PdfObjectID objectID = new PdfObjectID(idToUse, generation); + // Ignore the latter one. + if (xrefTable.Contains(objectID)) + continue; + xrefTable.Add(new PdfReference(objectID, position)); + } + } + else if (symbol == Symbol.Trailer) + { + ReadSymbol(Symbol.BeginDictionary); + PdfTrailer trailer = new PdfTrailer(_document); + ReadDictionary(trailer, false); + return trailer; + } + else + ParserDiagnostics.HandleUnexpectedToken(_lexer.Token); + } + } + // ReSharper disable once RedundantIfElseBlock because of code readability. + else if (symbol == Symbol.Integer) // Is it an cross-reference stream? + { + // Reference: 3.4.7 Cross-Reference Streams / Page 93 + // TODO: Handle PDF files larger than 2 GiB, see implementation note 21 in Appendix H. + + // The parsed integer is the object id of the cross-reference stream. + return ReadXRefStream(xrefTable); + } + return null; + } + + /// + /// Checks the x reference table entry. Returns true if everything is correct. + /// Return false if the keyword "obj" was found, but ID or Generation are incorrect. + /// Throws an exception otherwise. + /// + /// The position where the object is supposed to be. + /// The ID from the XRef table. + /// The generation from the XRef table. + /// The identifier found in the PDF file. + /// The generation found in the PDF file. + /// + private bool CheckXRefTableEntry(int position, int id, int generation, out int idChecked, out int generationChecked) + { + int origin = _lexer.Position; + idChecked = -1; + generationChecked = -1; + try + { + _lexer.Position = position; + idChecked = ReadInteger(); + generationChecked = ReadInteger(); + //// TODO Should we use ScanKeyword here? + //ReadKSymbol(Symbol.Keyword); + //string token = _lexer.Token; + Symbol symbol = _lexer.ScanNextToken(); + if (symbol != Symbol.Obj) + ParserDiagnostics.ThrowParserException("Invalid entry in XRef table, ID=" + id + ", Generation=" + generation + ", Position=" + position); // TODO L10N using PSSR. + + if (id != idChecked || generation != generationChecked) + return false; + } + catch (PdfReaderException) + { + throw; + } + catch (Exception ex) + { + ParserDiagnostics.ThrowParserException("Invalid entry in XRef table, ID=" + id + ", Generation=" + generation + ", Position=" + position, ex); // TODO L10N using PSSR. + } + finally + { + _lexer.Position = origin; + } + return true; + } + + /// + /// Reads cross reference stream(s). + /// + private PdfTrailer ReadXRefStream(PdfCrossReferenceTable xrefTable) + { + // Read cross reference stream. + //Debug.Assert(_lexer.Symbol == Symbol.Integer); + + int number = _lexer.TokenToInteger; + int generation = ReadInteger(); + Debug.Assert(generation == 0); + + ReadSymbol(Symbol.Obj); + ReadSymbol(Symbol.BeginDictionary); + PdfObjectID objectID = new PdfObjectID(number, generation); + + PdfCrossReferenceStream xrefStream = new PdfCrossReferenceStream(_document); + + ReadDictionary(xrefStream, false); + ReadSymbol(Symbol.BeginStream); + ReadStream(xrefStream); + + //xrefTable.Add(new PdfReference(objectID, position)); + PdfReference iref = new PdfReference(xrefStream); + iref.ObjectID = objectID; + iref.Value = xrefStream; + xrefTable.Add(iref); + + Debug.Assert(xrefStream.Stream != null); + //string sValue = new RawEncoding().GetString(xrefStream.Stream.UnfilteredValue,); + //sValue.GetType(); + byte[] bytesRaw = xrefStream.Stream.UnfilteredValue; + byte[] bytes = bytesRaw; + + // HACK: Should be done in UnfilteredValue. + if (xrefStream.Stream.HasDecodeParams) + { + int predictor = xrefStream.Stream.DecodePredictor; + int columns = xrefStream.Stream.DecodeColumns; + bytes = DecodeCrossReferenceStream(bytesRaw, columns, predictor); + } + +#if DEBUG_ + for (int idx = 0; idx < bytes.Length; idx++) + { + if (idx % 4 == 0) + Console.WriteLine(); + Console.Write("{0:000} ", (int)bytes[idx]); + } + Console.WriteLine(); +#endif + + // bytes.GetType(); + // Add to table. + // xrefTable.Add(new PdfReference(objectID, -1)); + + int size = xrefStream.Elements.GetInteger(PdfCrossReferenceStream.Keys.Size); + PdfArray index = xrefStream.Elements.GetValue(PdfCrossReferenceStream.Keys.Index) as PdfArray; + int prev = xrefStream.Elements.GetInteger(PdfCrossReferenceStream.Keys.Prev); + PdfArray w = (PdfArray)xrefStream.Elements.GetValue(PdfCrossReferenceStream.Keys.W); + + // E.g.: W[1 2 1] Index[7 12] Size 19 + + // Setup subsections. + int subsectionCount; + int[][] subsections = null; + int subsectionEntryCount = 0; + if (index == null) + { + // Setup with default values. + subsectionCount = 1; + subsections = new int[subsectionCount][]; + subsections[0] = new int[] { 0, size }; // HACK: What is size? Contradiction in PDF reference. + subsectionEntryCount = size; + } + else + { + // Read subsections from array. + Debug.Assert(index.Elements.Count % 2 == 0); + subsectionCount = index.Elements.Count / 2; + subsections = new int[subsectionCount][]; + for (int idx = 0; idx < subsectionCount; idx++) + { + subsections[idx] = new int[] { index.Elements.GetInteger(2 * idx), index.Elements.GetInteger(2 * idx + 1) }; + subsectionEntryCount += subsections[idx][1]; + } + } + + // W key. + Debug.Assert(w.Elements.Count == 3); + int[] wsize = { w.Elements.GetInteger(0), w.Elements.GetInteger(1), w.Elements.GetInteger(2) }; + int wsum = StreamHelper.WSize(wsize); + if (wsum * subsectionEntryCount != bytes.Length) + GetType(); + Debug.Assert(wsum * subsectionEntryCount == bytes.Length, "Check implementation here."); + int testcount = subsections[0][1]; + int[] currentSubsection = subsections[0]; +#if DEBUG && CORE + if (PdfDiagnostics.TraceXrefStreams) + { + for (int idx = 0; idx < testcount; idx++) + { + uint field1 = StreamHelper.ReadBytes(bytes, idx * wsum, wsize[0]); + uint field2 = StreamHelper.ReadBytes(bytes, idx * wsum + wsize[0], wsize[1]); + uint field3 = StreamHelper.ReadBytes(bytes, idx * wsum + wsize[0] + wsize[1], wsize[2]); + string res = String.Format("{0,2:00}: {1} {2,5} {3} // ", idx, field1, field2, field3); + switch (field1) + { + case 0: + res += "Fee list: object number, generation number"; + break; + + case 1: + res += "Not compresed: offset, generation number"; + break; + + case 2: + res += "Compressed: object stream object number, index in stream"; + break; + + default: + res += "??? Type undefined"; + break; + } + Debug.WriteLine(res); + } + } +#endif + + int index2 = -1; + for (int ssc = 0; ssc < subsectionCount; ssc++) + { + int abc = subsections[ssc][1]; + for (int idx = 0; idx < abc; idx++) + { + index2++; + + PdfCrossReferenceStream.CrossReferenceStreamEntry item = + new PdfCrossReferenceStream.CrossReferenceStreamEntry(); + + item.Type = StreamHelper.ReadBytes(bytes, index2 * wsum, wsize[0]); + item.Field2 = StreamHelper.ReadBytes(bytes, index2 * wsum + wsize[0], wsize[1]); + item.Field3 = StreamHelper.ReadBytes(bytes, index2 * wsum + wsize[0] + wsize[1], wsize[2]); + + xrefStream.Entries.Add(item); + + switch (item.Type) + { + case 0: + // Nothing to do, not needed. + break; + + case 1: // offset / generation number + //// Even it is restricted, an object can exists in more than one subsection. + //// (PDF Reference Implementation Notes 15). + + int position = (int)item.Field2; + objectID = ReadObjectNumber(position); +#if DEBUG + if (objectID.ObjectNumber == 1074) + GetType(); +#endif + Debug.Assert(objectID.GenerationNumber == item.Field3); + + //// Ignore the latter one. + if (!xrefTable.Contains(objectID)) + { +#if DEBUG + GetType(); +#endif + // Add iref for all uncrompressed objects. + xrefTable.Add(new PdfReference(objectID, position)); + + } + break; + + case 2: + // Nothing to do yet. + break; + } + } + } + return xrefStream; + } + + /// + /// Parses a PDF date string. + /// + internal static DateTime ParseDateTime(string date, DateTime errorValue) // TODO: TryParseDateTime + { + DateTime datetime = errorValue; + try + { + if (date.StartsWith("D:")) + { + // Format is + // D:YYYYMMDDHHmmSSOHH'mm' + // ^2 ^10 ^16 ^20 + int length = date.Length; + int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0, hh = 0, mm = 0; + char o = 'Z'; + if (length >= 10) + { + year = Int32.Parse(date.Substring(2, 4)); + month = Int32.Parse(date.Substring(6, 2)); + day = Int32.Parse(date.Substring(8, 2)); + if (length >= 16) + { + hour = Int32.Parse(date.Substring(10, 2)); + minute = Int32.Parse(date.Substring(12, 2)); + second = Int32.Parse(date.Substring(14, 2)); + if (length >= 23) + { + if ((o = date[16]) != 'Z') + { + hh = Int32.Parse(date.Substring(17, 2)); + mm = Int32.Parse(date.Substring(20, 2)); + } + } + } + } + // There are miserable PDF tools around the world. + month = Math.Min(Math.Max(month, 1), 12); + datetime = new DateTime(year, month, day, hour, minute, second); + if (o != 'Z') + { + TimeSpan ts = new TimeSpan(hh, mm, 0); + if (o == '-') + datetime = datetime.Add(ts); + else + datetime = datetime.Subtract(ts); + } + // Now that we converted datetime to UTC, mark it as UTC. + DateTime.SpecifyKind(datetime, DateTimeKind.Utc); + } + else + { + // Some libraries use plain English format. + datetime = DateTime.Parse(date, CultureInfo.InvariantCulture); + } + } + // ReSharper disable once EmptyGeneralCatchClause + catch (Exception ex) + { + // If we cannot parse datetime, just eat it, but give a hint in DEBUG build. + Debug.Assert(false, ex.Message); + } + return datetime; + } + + // /// + // /// Creates a parser for the specified PDF object type. A PDF object can define a specialized + // /// parser in the optional PdfObjectInfoAttribute. If no parser is specified, the default + // /// Parser object is returned. + // /// + // public static Parser CreateParser(PdfDocument document, Type pdfObjectType) + // { + // // TODO: ParserFactory + // object[] attribs = null; //pdfObjectType.GetCustomAttributes(typeof(PdfObjectInfoAttribute), false); + // if (attribs.Length == 1) + // { + // PdfObjectInfoAttribute attrib = null; //(PdfObjectInfoAttribute)attribs[0]; + // Type parserType = attrib.Parser; + // if (parserType != null) + // { + // ConstructorInfo ctorInfo = parserType.GetConstructor( + // BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, + // new Type[]{typeof(PdfDocument)}, null); + // Parser parser = (Parser)ctorInfo.Invoke(new object[]{document}); + // Debug.Assert(parser != null, "Creation of parser failed."); + // return parser; + // } + // } + // return new Parser(document); + // } + + /* + /// + /// Reads a date value directly or (optionally) indirectly from the PDF data stream. + /// + protected DateTime ReadDate(bool canBeIndirect) + { + Symbol symbol = lexer.ScanNextToken(canBeIndirect); + if (symbol == Symbol.String || symbol == Symbol.UnicodeString || symbol == Symbol.HexString || symbol == Symbol.UnicodeHexString) + { + // D:YYYYMMDDHHmmSSOHH'mm' + // ^2 ^10 ^16 ^20 + string date = lexer.Token; + int length = date.Length; + int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0, hh = 0, mm = 0; + char o = 'Z'; + if (length >= 10) + { + year = Int32.Parse(date.Substring(2, 4)); + month = Int32.Parse(date.Substring(6, 2)); + day = Int32.Parse(date.Substring(8, 2)); + if (length >= 16) + { + hour = Int32.Parse(date.Substring(10, 2)); + minute = Int32.Parse(date.Substring(12, 2)); + second = Int32.Parse(date.Substring(14, 2)); + if (length >= 23) + { + if ((o = date[16]) != 'Z') + { + hh = Int32.Parse(date.Substring(17, 2)); + mm = Int32.Parse(date.Substring(20, 2)); + } + } + } + } + DateTime datetime = new DateTime(year, month, day, hour, minute, second); + if (o != 'Z') + { + TimeSpan ts = new TimeSpan(hh, mm, 0); + if (o == '+') + datetime.Add(ts); + else + datetime.Subtract(ts); + } + return datetime; + } + else if (symbol == Symbol.R) + { + int position = lexer.Position; + MoveToObject(lexer.Token); + ReadObjectID(null); + DateTime d = ReadDate(); + ReadSymbol(Symbol.EndObj); + lexer.Position = position; + return d; + } + thr ow new PdfReaderException(PSSR.UnexpectedToken(lexer.Token)); + } + + protected DateTime ReadDate() + { + return ReadDate(false); + } + + /// + /// Reads a PdfRectangle value directly or (optionally) indirectly from the PDF data stream. + /// + protected PdfRectangle ReadRectangle(bool canBeIndirect) + { + Symbol symbol = lexer.ScanNextToken(canBeIndirect); + if (symbol == Symbol.BeginArray) + { + PdfRectangle rect = new PdfRectangle(); + rect.X1 = ReadReal(); + rect.Y1 = ReadReal(); + rect.X2 = ReadReal(); + rect.Y2 = ReadReal(); + ReadSymbol(Symbol.EndArray); + return rect; + } + else if (symbol == Symbol.R) + { + int position = lexer.Position; + MoveToObject(lexer.Token); + ReadObjectID(null); + PdfRectangle rect = ReadRectangle(); + ReadSymbol(Symbol.EndObj); + lexer.Position = position; + return rect; + } + thr ow new PdfReaderException(PSSR.UnexpectedToken(lexer.Token)); + } + + /// + /// Short cut for ReadRectangle(false). + /// + protected PdfRectangle ReadRectangle() + { + return ReadRectangle(false); + } + + /// + /// Reads a generic dictionary. + /// + protected PdfDictionary ReadDictionary(bool canBeIndirect) + { + // Just read over dictionary + PdfDictionary dictionary = new PdfDictionary(); + Symbol symbol = lexer.ScanNextToken(canBeIndirect); + if (symbol == Symbol.BeginDictionary) + { + int nestingLevel = 0; + symbol = ScanNextToken(); + while (symbol != Symbol.Eof) + { + switch (symbol) + { + case Symbol.BeginDictionary: + nestingLevel++; + break; + + case Symbol.EndDictionary: + if (nestingLevel == 0) + return dictionary; + else + nestingLevel--; + break; + } + symbol = ScanNextToken(); + } + Debug.Assert(false, "Must not come here"); + return dictionary; + } + else if (symbol == Symbol.R) + { + return dictionary; + } + thr ow new PdfReaderException(PSSR.UnexpectedToken(lexer.Token)); + } + + /// + /// Short cut for ReadDictionary(false). + /// + protected PdfDictionary ReadDictionary() + { + return ReadDictionary(false); + } + + /// + /// Reads a generic array. + /// + protected PdfArray ReadArray(bool canBeIndirect) + { + // Just read over array + PdfArray array = new PdfArray(); + Symbol symbol = lexer.ScanNextToken(canBeIndirect); + if (symbol == Symbol.BeginArray) + { + int nestingLevel = 0; + symbol = ScanNextToken(); + while (symbol != Symbol.Eof) + { + switch (symbol) + { + case Symbol.BeginArray: + nestingLevel++; + break; + + case Symbol.EndArray: + if (nestingLevel == 0) + return array; + else + nestingLevel--; + break; + } + symbol = ScanNextToken(); + } + Debug.Assert(false, "Must not come here"); + return array; + } + else if (symbol == Symbol.R) + { + return array; + } + th row new PdfReaderException(PSSR.UnexpectedToken(lexer.Token)); + } + + protected PdfArray ReadArray() + { + return ReadArray(false); + } + + protected object ReadGeneric(KeysMeta meta, string token) + { + KeyDescriptor descriptor = meta[token]; + Debug.Assert(descriptor != null); + object result = null; + switch (descriptor.KeyType & KeyType.TypeMask) + { + case KeyType.Name: + result = ReadName(); + break; + + case KeyType.String: + result = ReadString(descriptor.CanBeIndirect); + break; + + case KeyType.Boolean: + result = ReadBoolean(descriptor.CanBeIndirect); + break; + + case KeyType.Integer: + result = ReadInteger(descriptor.CanBeIndirect); + break; + + case KeyType.Real: + result = ReadReal(descriptor.CanBeIndirect); + break; + + case KeyType.Date: + result = ReadDate(descriptor.CanBeIndirect); + break; + + case KeyType.Rectangle: + result = ReadRectangle(descriptor.CanBeIndirect); + break; + + case KeyType.Array: + result = ReadArray(descriptor.CanBeIndirect); + break; + + case KeyType.Dictionary: + result = ReadDictionary(descriptor.CanBeIndirect); + break; + + case KeyType.Stream: + break; + + case KeyType.NumberTree: + thr ow new NotImplementedException("KeyType.NumberTree"); + + case KeyType.NameOrArray: + char ch = lexer.MoveToNonWhiteSpace(); + if (ch == '/') + result = ReadName(); + else if (ch == '[') + result = ReadArray(); + else + th row new NotImplementedException("KeyType.NameOrArray"); + break; + + case KeyType.ArrayOrDictionary: + thr ow new NotImplementedException("KeyType.ArrayOrDictionary"); + } + //Debug.Assert(false, "ReadGeneric"); + return result; + } + + // /// + // /// Gets the current symbol from the lexer. + // /// + // protected Symbol Symbol + // { + // get {return lexer.Symbol;} + // } + // + // /// + // /// Gets the current token from the lexer. + // /// + // protected string Token + // { + // get {return lexer.Token.ToString();} + // } + + public static object Read(PdfObject o, string key) + { + return null; + } + */ + + private ParserState SaveState() + { + ParserState state = new ParserState(); + state.Position = _lexer.Position; + state.Symbol = _lexer.Symbol; + return state; + } + + private void RestoreState(ParserState state) + { + _lexer.Position = state.Position; + _lexer.Symbol = state.Symbol; + } + + private class ParserState + { + public int Position; + public Symbol Symbol; + } + + byte[] DecodeCrossReferenceStream(byte[] bytes, int columns, int predictor) + { + int size = bytes.Length; + if (predictor < 10 || predictor > 15) + throw new ArgumentException("Invalid predictor.", "predictor"); + + int rowSizeRaw = columns + 1; + + if (size % rowSizeRaw != 0) + throw new ArgumentException("Columns and size of array do not match."); + + int rows = size / rowSizeRaw; + + byte[] result = new byte[rows * columns]; +#if DEBUG + for (int i = 0; i < result.Length; ++i) + result[i] = 88; +#endif + + for (int row = 0; row < rows; ++row) + { + if (bytes[row * rowSizeRaw] != 2) + throw new ArgumentException("Invalid predictor in array."); + + for (int col = 0; col < columns; ++col) + { + // Copy data for first row. + if (row == 0) + result[row * columns + col] = bytes[row * rowSizeRaw + col + 1]; + else + { + // For other rows, add previous row. + result[row * columns + col] = (byte)(result[row * columns - columns + col] + bytes[row * rowSizeRaw + col + 1]); + } + } + } + return result; + } + + private readonly PdfDocument _document; + private readonly Lexer _lexer; + private readonly ShiftStack _stack; + } + + static class StreamHelper + { + public static int WSize(int[] w) + { + Debug.Assert(w.Length == 3); + return w[0] + w[1] + w[2]; + } + + public static uint ReadBytes(byte[] bytes, int index, int byteCount) + { + uint value = 0; + for (int idx = 0; idx < byteCount; idx++) + { + value *= 256; + value += bytes[index + idx]; + } + return value; + } + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf.IO/PdfReader.cs b/PdfSharp/Pdf.IO/PdfReader.cs new file mode 100644 index 0000000..d2d59eb --- /dev/null +++ b/PdfSharp/Pdf.IO/PdfReader.cs @@ -0,0 +1,519 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using PdfSharp.Internal; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.Security; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf.IO +{ + /// + /// Encapsulates the arguments of the PdfPasswordProvider delegate. + /// + public class PdfPasswordProviderArgs + { + /// + /// Sets the password to open the document with. + /// + public string Password; + + /// + /// When set to true the PdfReader.Open function returns null indicating that no PdfDocument was created. + /// + public bool Abort; + } + + /// + /// A delegated used by the PdfReader.Open function to retrieve a password if the document is protected. + /// + public delegate void PdfPasswordProvider(PdfPasswordProviderArgs args); + + /// + /// Represents the functionality for reading PDF documents. + /// + public static class PdfReader + { + /// + /// Determines whether the file specified by its path is a PDF file by inspecting the first eight + /// bytes of the data. If the file header has the form %PDF-x.y the function returns the version + /// number as integer (e.g. 14 for PDF 1.4). If the file header is invalid or inaccessible + /// for any reason, 0 is returned. The function never throws an exception. + /// + public static int TestPdfFile(string path) + { +#if !NETFX_CORE + FileStream stream = null; + try + { + int pageNumber; + string realPath = Drawing.XPdfForm.ExtractPageNumber(path, out pageNumber); + if (File.Exists(realPath)) // prevent unwanted exceptions during debugging + { + stream = new FileStream(realPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + byte[] bytes = new byte[1024]; + stream.Read(bytes, 0, 1024); + return GetPdfFileVersion(bytes); + } + } + // ReSharper disable once EmptyGeneralCatchClause + catch { } + finally + { + try + { + if (stream != null) + { +#if UWP + stream.Dispose(); +#else + stream.Close(); +#endif + } + } + // ReSharper disable once EmptyGeneralCatchClause + catch + { + } + } +#endif + return 0; + } + + /// + /// Determines whether the specified stream is a PDF file by inspecting the first eight + /// bytes of the data. If the data begins with %PDF-x.y the function returns the version + /// number as integer (e.g. 14 for PDF 1.4). If the data is invalid or inaccessible + /// for any reason, 0 is returned. The function never throws an exception. + /// + public static int TestPdfFile(Stream stream) + { + long pos = -1; + try + { + pos = stream.Position; + byte[] bytes = new byte[1024]; + stream.Read(bytes, 0, 1024); + return GetPdfFileVersion(bytes); + } + // ReSharper disable once EmptyGeneralCatchClause + catch { } + finally + { + try + { + if (pos != -1) + stream.Position = pos; + } + // ReSharper disable once EmptyGeneralCatchClause + catch { } + } + return 0; + } + + /// + /// Determines whether the specified data is a PDF file by inspecting the first eight + /// bytes of the data. If the data begins with %PDF-x.y the function returns the version + /// number as integer (e.g. 14 for PDF 1.4). If the data is invalid or inaccessible + /// for any reason, 0 is returned. The function never throws an exception. + /// + public static int TestPdfFile(byte[] data) + { + return GetPdfFileVersion(data); + } + + /// + /// Implements scanning the PDF file version. + /// + internal static int GetPdfFileVersion(byte[] bytes) + { + try + { + // Acrobat accepts headers like %!PS-Adobe-N.n PDF-M.m... + string header = PdfEncoders.RawEncoding.GetString(bytes, 0, bytes.Length); // Encoding.ASCII.GetString(bytes); + if (header[0] == '%' || header.IndexOf("%PDF", StringComparison.Ordinal) >= 0) + { + int ich = header.IndexOf("PDF-", StringComparison.Ordinal); + if (ich > 0 && header[ich + 5] == '.') + { + char major = header[ich + 4]; + char minor = header[ich + 6]; + if (major >= '1' && major < '2' && minor >= '0' && minor <= '9') + return (major - '0') * 10 + (minor - '0'); + } + } + } + // ReSharper disable once EmptyGeneralCatchClause + catch { } + return 0; + } + + /// + /// Opens an existing PDF document. + /// + public static PdfDocument Open(string path, PdfDocumentOpenMode openmode) + { + return Open(path, null, openmode, null); + } + + /// + /// Opens an existing PDF document. + /// + public static PdfDocument Open(string path, PdfDocumentOpenMode openmode, PdfPasswordProvider provider) + { + return Open(path, null, openmode, provider); + } + + /// + /// Opens an existing PDF document. + /// + public static PdfDocument Open(string path, string password, PdfDocumentOpenMode openmode) + { + return Open(path, password, openmode, null); + } + + /// + /// Opens an existing PDF document. + /// + public static PdfDocument Open(string path, string password, PdfDocumentOpenMode openmode, PdfPasswordProvider provider) + { +#if !NETFX_CORE + PdfDocument document; + Stream stream = null; + try + { + stream = new FileStream(path, FileMode.Open, FileAccess.Read); + document = Open(stream, password, openmode, provider); + if (document != null) + { + document._fullPath = Path.GetFullPath(path); + } + } + finally + { + if (stream != null) +#if !UWP + stream.Close(); +#else + stream.Dispose(); +#endif + } + return document; +#else + return null; +#endif + } + + /// + /// Opens an existing PDF document. + /// + public static PdfDocument Open(string path) + { + return Open(path, null, PdfDocumentOpenMode.Modify, null); + } + + /// + /// Opens an existing PDF document. + /// + public static PdfDocument Open(string path, string password) + { + return Open(path, password, PdfDocumentOpenMode.Modify, null); + } + + /// + /// Opens an existing PDF document. + /// + public static PdfDocument Open(Stream stream, PdfDocumentOpenMode openmode) + { + return Open(stream, null, openmode); + } + + /// + /// Opens an existing PDF document. + /// + public static PdfDocument Open(Stream stream, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider) + { + return Open(stream, null, openmode, passwordProvider); + } + /// + /// Opens an existing PDF document. + /// + public static PdfDocument Open(Stream stream, string password, PdfDocumentOpenMode openmode) + { + return Open(stream, password, openmode, null); + } + + /// + /// Opens an existing PDF document. + /// + public static PdfDocument Open(Stream stream, string password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider) + { + PdfDocument document; + try + { + Lexer lexer = new Lexer(stream); + document = new PdfDocument(lexer); + document._state |= DocumentState.Imported; + document._openMode = openmode; + document._fileSize = stream.Length; + + // Get file version. + byte[] header = new byte[1024]; + stream.Position = 0; + stream.Read(header, 0, 1024); + document._version = GetPdfFileVersion(header); + if (document._version == 0) + throw new InvalidOperationException(PSSR.InvalidPdf); + + document._irefTable.IsUnderConstruction = true; + Parser parser = new Parser(document); + // Read all trailers or cross-reference streams, but no objects. + document._trailer = parser.ReadTrailer(); + if (document._trailer == null) + ParserDiagnostics.ThrowParserException("Invalid PDF file: no trailer found."); // TODO L10N using PSSR. + + Debug.Assert(document._irefTable.IsUnderConstruction); + document._irefTable.IsUnderConstruction = false; + + // Is document encrypted? + PdfReference xrefEncrypt = document._trailer.Elements[PdfTrailer.Keys.Encrypt] as PdfReference; + if (xrefEncrypt != null) + { + //xrefEncrypt.Value = parser.ReadObject(null, xrefEncrypt.ObjectID, false); + PdfObject encrypt = parser.ReadObject(null, xrefEncrypt.ObjectID, false, false); + + encrypt.Reference = xrefEncrypt; + xrefEncrypt.Value = encrypt; + PdfStandardSecurityHandler securityHandler = document.SecurityHandler; + TryAgain: + PasswordValidity validity = securityHandler.ValidatePassword(password); + if (validity == PasswordValidity.Invalid) + { + if (passwordProvider != null) + { + PdfPasswordProviderArgs args = new PdfPasswordProviderArgs(); + passwordProvider(args); + if (args.Abort) + return null; + password = args.Password; + goto TryAgain; + } + else + { + if (password == null) + throw new PdfReaderException(PSSR.PasswordRequired); + else + throw new PdfReaderException(PSSR.InvalidPassword); + } + } + else if (validity == PasswordValidity.UserPassword && openmode == PdfDocumentOpenMode.Modify) + { + if (passwordProvider != null) + { + PdfPasswordProviderArgs args = new PdfPasswordProviderArgs(); + passwordProvider(args); + if (args.Abort) + return null; + password = args.Password; + goto TryAgain; + } + else + throw new PdfReaderException(PSSR.OwnerPasswordRequired); + } + } + else + { + if (password != null) + { + // Password specified but document is not encrypted. + // ignore + } + } + + PdfReference[] irefs2 = document._irefTable.AllReferences; + int count2 = irefs2.Length; + + // 3rd: Create iRefs for all compressed objects. + Dictionary objectStreams = new Dictionary(); + for (int idx = 0; idx < count2; idx++) + { + PdfReference iref = irefs2[idx]; + PdfCrossReferenceStream xrefStream = iref.Value as PdfCrossReferenceStream; + if (xrefStream != null) + { + for (int idx2 = 0; idx2 < xrefStream.Entries.Count; idx2++) + { + PdfCrossReferenceStream.CrossReferenceStreamEntry item = xrefStream.Entries[idx2]; + // Is type xref to compressed object? + if (item.Type == 2) + { + //PdfReference irefNew = parser.ReadCompressedObject(new PdfObjectID((int)item.Field2), (int)item.Field3); + //document._irefTable.Add(irefNew); + int objectNumber = (int)item.Field2; + if (!objectStreams.ContainsKey(objectNumber)) + { + objectStreams.Add(objectNumber, null); + PdfObjectID objectID = new PdfObjectID((int)item.Field2); + parser.ReadIRefsFromCompressedObject(objectID); + } + } + } + } + } + + // 4th: Read compressed objects. + for (int idx = 0; idx < count2; idx++) + { + PdfReference iref = irefs2[idx]; + PdfCrossReferenceStream xrefStream = iref.Value as PdfCrossReferenceStream; + if (xrefStream != null) + { + for (int idx2 = 0; idx2 < xrefStream.Entries.Count; idx2++) + { + PdfCrossReferenceStream.CrossReferenceStreamEntry item = xrefStream.Entries[idx2]; + // Is type xref to compressed object? + if (item.Type == 2) + { + PdfReference irefNew = parser.ReadCompressedObject(new PdfObjectID((int)item.Field2), + (int)item.Field3); + Debug.Assert(document._irefTable.Contains(iref.ObjectID)); + //document._irefTable.Add(irefNew); + } + } + } + } + + + PdfReference[] irefs = document._irefTable.AllReferences; + int count = irefs.Length; + + // Read all indirect objects. + for (int idx = 0; idx < count; idx++) + { + PdfReference iref = irefs[idx]; + if (iref.Value == null) + { +#if DEBUG_ + if (iref.ObjectNumber == 1074) + iref.GetType(); +#endif + try + { + Debug.Assert(document._irefTable.Contains(iref.ObjectID)); + PdfObject pdfObject = parser.ReadObject(null, iref.ObjectID, false, false); + Debug.Assert(pdfObject.Reference == iref); + pdfObject.Reference = iref; + Debug.Assert(pdfObject.Reference.Value != null, "Something went wrong."); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + // 4STLA rethrow exception to notify caller. + throw; + } + } + else + { + Debug.Assert(document._irefTable.Contains(iref.ObjectID)); + //iref.GetType(); + } + // Set maximum object number. + document._irefTable._maxObjectNumber = Math.Max(document._irefTable._maxObjectNumber, + iref.ObjectNumber); + } + + // Encrypt all objects. + if (xrefEncrypt != null) + { + document.SecurityHandler.EncryptDocument(); + } + + // Fix references of trailer values and then objects and irefs are consistent. + document._trailer.Finish(); + +#if DEBUG_ + // Some tests... + PdfReference[] reachables = document.xrefTable.TransitiveClosure(document.trailer); + reachables.GetType(); + reachables = document.xrefTable.AllXRefs; + document.xrefTable.CheckConsistence(); +#endif + + if (openmode == PdfDocumentOpenMode.Modify) + { + // Create new or change existing document IDs. + if (document.Internals.SecondDocumentID == "") + document._trailer.CreateNewDocumentIDs(); + else + { + byte[] agTemp = Guid.NewGuid().ToByteArray(); + document.Internals.SecondDocumentID = PdfEncoders.RawEncoding.GetString(agTemp, 0, agTemp.Length); + } + + // Change modification date + document.Info.ModificationDate = DateTime.Now; + + // Remove all unreachable objects + int removed = document._irefTable.Compact(); + if (removed != 0) + Debug.WriteLine("Number of deleted unreachable objects: " + removed); + + // Force flattening of page tree + PdfPages pages = document.Pages; + Debug.Assert(pages != null); + + //bool b = document.irefTable.Contains(new PdfObjectID(1108)); + //b.GetType(); + + document._irefTable.CheckConsistence(); + document._irefTable.Renumber(); + document._irefTable.CheckConsistence(); + } + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + throw; + } + return document; + } + + /// + /// Opens an existing PDF document. + /// + public static PdfDocument Open(Stream stream) + { + return Open(stream, PdfDocumentOpenMode.Modify); + } + } +} diff --git a/PdfSharp/Pdf.IO/PdfReaderException.cs b/PdfSharp/Pdf.IO/PdfReaderException.cs new file mode 100644 index 0000000..31731d1 --- /dev/null +++ b/PdfSharp/Pdf.IO/PdfReaderException.cs @@ -0,0 +1,63 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.IO +{ + /// + /// Exception thrown by PdfReader. + /// + public class PdfReaderException : PdfSharpException + { + /// + /// Initializes a new instance of the class. + /// + public PdfReaderException() + { } + + /// + /// Initializes a new instance of the class. + /// + /// The message. + public PdfReaderException(string message) + : base(message) + { } + + /// + /// Initializes a new instance of the class. + /// + /// The message. + /// The inner exception. + public PdfReaderException(string message, Exception innerException) + : + base(message, innerException) + { } + } +} diff --git a/PdfSharp/Pdf.IO/PdfWriter.cs b/PdfSharp/Pdf.IO/PdfWriter.cs new file mode 100644 index 0000000..71bec33 --- /dev/null +++ b/PdfSharp/Pdf.IO/PdfWriter.cs @@ -0,0 +1,661 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text; +using System.IO; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.Security; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf.IO +{ + /// + /// Represents a writer for generation of PDF streams. + /// + internal class PdfWriter + { + public PdfWriter(Stream pdfStream, PdfStandardSecurityHandler securityHandler) + { + _stream = pdfStream; + _securityHandler = securityHandler; + //System.Xml.XmlTextWriter +#if DEBUG + _layout = PdfWriterLayout.Verbose; +#endif + } + + public void Close(bool closeUnderlyingStream) + { + if (_stream != null && closeUnderlyingStream) + { +#if UWP + _stream.Dispose(); +#else + _stream.Close(); +#endif + } + _stream = null; + } + + public void Close() + { + Close(true); + } + + public int Position + { + get { return (int)_stream.Position; } + } + + /// + /// Gets or sets the kind of layout. + /// + public PdfWriterLayout Layout + { + get { return _layout; } + set { _layout = value; } + } + PdfWriterLayout _layout; + + public PdfWriterOptions Options + { + get { return _options; } + set { _options = value; } + } + PdfWriterOptions _options; + + // ----------------------------------------------------------- + + /// + /// Writes the specified value to the PDF stream. + /// + public void Write(bool value) + { + WriteSeparator(CharCat.Character); + WriteRaw(value ? bool.TrueString : bool.FalseString); + _lastCat = CharCat.Character; + } + + /// + /// Writes the specified value to the PDF stream. + /// + public void Write(PdfBoolean value) + { + WriteSeparator(CharCat.Character); + WriteRaw(value.Value ? "true" : "false"); + _lastCat = CharCat.Character; + } + + /// + /// Writes the specified value to the PDF stream. + /// + public void Write(int value) + { + WriteSeparator(CharCat.Character); + WriteRaw(value.ToString(CultureInfo.InvariantCulture)); + _lastCat = CharCat.Character; + } + + /// + /// Writes the specified value to the PDF stream. + /// + public void Write(uint value) + { + WriteSeparator(CharCat.Character); + WriteRaw(value.ToString(CultureInfo.InvariantCulture)); + _lastCat = CharCat.Character; + } + + /// + /// Writes the specified value to the PDF stream. + /// + public void Write(PdfInteger value) + { + WriteSeparator(CharCat.Character); + _lastCat = CharCat.Character; + WriteRaw(value.Value.ToString(CultureInfo.InvariantCulture)); + } + + /// + /// Writes the specified value to the PDF stream. + /// + public void Write(PdfUInteger value) + { + WriteSeparator(CharCat.Character); + _lastCat = CharCat.Character; + WriteRaw(value.Value.ToString(CultureInfo.InvariantCulture)); + } + + /// + /// Writes the specified value to the PDF stream. + /// + public void Write(double value) + { + WriteSeparator(CharCat.Character); + WriteRaw(value.ToString(Config.SignificantFigures7, CultureInfo.InvariantCulture)); + _lastCat = CharCat.Character; + } + + /// + /// Writes the specified value to the PDF stream. + /// + public void Write(PdfReal value) + { + WriteSeparator(CharCat.Character); + WriteRaw(value.Value.ToString(Config.SignificantFigures7, CultureInfo.InvariantCulture)); + _lastCat = CharCat.Character; + } + + /// + /// Writes the specified value to the PDF stream. + /// + public void Write(PdfString value) + { + WriteSeparator(CharCat.Delimiter); +#if true + PdfStringEncoding encoding = (PdfStringEncoding)(value.Flags & PdfStringFlags.EncodingMask); + string pdf = (value.Flags & PdfStringFlags.HexLiteral) == 0 ? + PdfEncoders.ToStringLiteral(value.Value, encoding, SecurityHandler) : + PdfEncoders.ToHexStringLiteral(value.Value, encoding, SecurityHandler); + WriteRaw(pdf); +#else + switch (value.Flags & PdfStringFlags.EncodingMask) + { + case PdfStringFlags.Undefined: + case PdfStringFlags.PDFDocEncoding: + if ((value.Flags & PdfStringFlags.HexLiteral) == 0) + WriteRaw(PdfEncoders.DocEncode(value.Value, false)); + else + WriteRaw(PdfEncoders.DocEncodeHex(value.Value, false)); + break; + + case PdfStringFlags.WinAnsiEncoding: + throw new NotImplementedException("Unexpected encoding: WinAnsiEncoding"); + + case PdfStringFlags.Unicode: + if ((value.Flags & PdfStringFlags.HexLiteral) == 0) + WriteRaw(PdfEncoders.DocEncode(value.Value, true)); + else + WriteRaw(PdfEncoders.DocEncodeHex(value.Value, true)); + break; + + case PdfStringFlags.StandardEncoding: + case PdfStringFlags.MacRomanEncoding: + case PdfStringFlags.MacExpertEncoding: + default: + throw new NotImplementedException("Unexpected encoding"); + } +#endif + _lastCat = CharCat.Delimiter; + } + + /// + /// Writes the specified value to the PDF stream. + /// + public void Write(PdfName value) + { + WriteSeparator(CharCat.Delimiter, '/'); + string name = value.Value; + + StringBuilder pdf = new StringBuilder("/"); + for (int idx = 1; idx < name.Length; idx++) + { + char ch = name[idx]; + Debug.Assert(ch < 256); + if (ch > ' ') + switch (ch) + { + // TODO: is this all? + case '%': + case '/': + case '<': + case '>': + case '(': + case ')': + case '[': + case ']': + case '#': + break; + + default: + pdf.Append(name[idx]); + continue; + } + pdf.AppendFormat("#{0:X2}", (int)name[idx]); + } + WriteRaw(pdf.ToString()); + _lastCat = CharCat.Character; + } + + public void Write(PdfLiteral value) + { + WriteSeparator(CharCat.Character); + WriteRaw(value.Value); + _lastCat = CharCat.Character; + } + + public void Write(PdfRectangle rect) + { + const string format = Config.SignificantFigures3; + WriteSeparator(CharCat.Delimiter, '/'); + WriteRaw(PdfEncoders.Format("[{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "}]", rect.X1, rect.Y1, rect.X2, rect.Y2)); + _lastCat = CharCat.Delimiter; + } + + public void Write(PdfReference iref) + { + WriteSeparator(CharCat.Character); + WriteRaw(iref.ToString()); + _lastCat = CharCat.Character; + } + + public void WriteDocString(string text, bool unicode) + { + WriteSeparator(CharCat.Delimiter); + //WriteRaw(PdfEncoders.DocEncode(text, unicode)); + byte[] bytes; + if (!unicode) + bytes = PdfEncoders.DocEncoding.GetBytes(text); + else + bytes = PdfEncoders.UnicodeEncoding.GetBytes(text); + bytes = PdfEncoders.FormatStringLiteral(bytes, unicode, true, false, _securityHandler); + Write(bytes); + _lastCat = CharCat.Delimiter; + } + + public void WriteDocString(string text) + { + WriteSeparator(CharCat.Delimiter); + //WriteRaw(PdfEncoders.DocEncode(text, false)); + byte[] bytes = PdfEncoders.DocEncoding.GetBytes(text); + bytes = PdfEncoders.FormatStringLiteral(bytes, false, false, false, _securityHandler); + Write(bytes); + _lastCat = CharCat.Delimiter; + } + + public void WriteDocStringHex(string text) + { + WriteSeparator(CharCat.Delimiter); + //WriteRaw(PdfEncoders.DocEncodeHex(text)); + byte[] bytes = PdfEncoders.DocEncoding.GetBytes(text); + bytes = PdfEncoders.FormatStringLiteral(bytes, false, false, true, _securityHandler); + _stream.Write(bytes, 0, bytes.Length); + _lastCat = CharCat.Delimiter; + } + + /// + /// Begins a direct or indirect dictionary or array. + /// + public void WriteBeginObject(PdfObject obj) + { + bool indirect = obj.IsIndirect; + if (indirect) + { + WriteObjectAddress(obj); + if (_securityHandler != null) + _securityHandler.SetHashKey(obj.ObjectID); + } + _stack.Add(new StackItem(obj)); + if (indirect) + { + if (obj is PdfArray) + WriteRaw("[\n"); + else if (obj is PdfDictionary) + WriteRaw("<<\n"); + _lastCat = CharCat.NewLine; + } + else + { + if (obj is PdfArray) + { + WriteSeparator(CharCat.Delimiter); + WriteRaw('['); + _lastCat = CharCat.Delimiter; + } + else if (obj is PdfDictionary) + { + NewLine(); + WriteSeparator(CharCat.Delimiter); + WriteRaw("<<\n"); + _lastCat = CharCat.NewLine; + } + } + if (_layout == PdfWriterLayout.Verbose) + IncreaseIndent(); + } + + /// + /// Ends a direct or indirect dictionary or array. + /// + public void WriteEndObject() + { + int count = _stack.Count; + Debug.Assert(count > 0, "PdfWriter stack underflow."); + + StackItem stackItem = _stack[count - 1]; + _stack.RemoveAt(count - 1); + + PdfObject value = stackItem.Object; + bool indirect = value.IsIndirect; + if (_layout == PdfWriterLayout.Verbose) + DecreaseIndent(); + if (value is PdfArray) + { + if (indirect) + { + WriteRaw("\n]\n"); + _lastCat = CharCat.NewLine; + } + else + { + WriteRaw("]"); + _lastCat = CharCat.Delimiter; + } + } + else if (value is PdfDictionary) + { + if (indirect) + { + if (!stackItem.HasStream) + WriteRaw(_lastCat == CharCat.NewLine ? ">>\n" : " >>\n"); + } + else + { + Debug.Assert(!stackItem.HasStream, "Direct object with stream??"); + WriteSeparator(CharCat.NewLine); + WriteRaw(">>\n"); + _lastCat = CharCat.NewLine; + } + } + if (indirect) + { + NewLine(); + WriteRaw("endobj\n"); + if (_layout == PdfWriterLayout.Verbose) + WriteRaw("%--------------------------------------------------------------------------------------------------\n"); + } + } + + /// + /// Writes the stream of the specified dictionary. + /// + public void WriteStream(PdfDictionary value, bool omitStream) + { + StackItem stackItem = _stack[_stack.Count - 1]; + Debug.Assert(stackItem.Object is PdfDictionary); + Debug.Assert(stackItem.Object.IsIndirect); + stackItem.HasStream = true; + + WriteRaw(_lastCat == CharCat.NewLine ? ">>\nstream\n" : " >>\nstream\n"); + + if (omitStream) + { + WriteRaw(" ...stream content omitted...\n"); // useful for debugging only + } + else + { + byte[] bytes = value.Stream.Value; + if (bytes.Length != 0) + { + if (_securityHandler != null) + { + bytes = (byte[])bytes.Clone(); + bytes = _securityHandler.EncryptBytes(bytes); + } + Write(bytes); + if (_lastCat != CharCat.NewLine) + WriteRaw('\n'); + } + } + WriteRaw("endstream\n"); + } + + public void WriteRaw(string rawString) + { + if (String.IsNullOrEmpty(rawString)) + return; + + byte[] bytes = PdfEncoders.RawEncoding.GetBytes(rawString); + _stream.Write(bytes, 0, bytes.Length); + _lastCat = GetCategory((char)bytes[bytes.Length - 1]); + } + + public void WriteRaw(char ch) + { + Debug.Assert(ch < 256, "Raw character greater than 255 detected."); + + _stream.WriteByte((byte)ch); + _lastCat = GetCategory(ch); + } + + public void Write(byte[] bytes) + { + if (bytes == null || bytes.Length == 0) + return; + + _stream.Write(bytes, 0, bytes.Length); + _lastCat = GetCategory((char)bytes[bytes.Length - 1]); + } + + void WriteObjectAddress(PdfObject value) + { + if (_layout == PdfWriterLayout.Verbose) + WriteRaw(String.Format("{0} {1} obj % {2}\n", + value.ObjectID.ObjectNumber, value.ObjectID.GenerationNumber, + value.GetType().FullName)); + else + WriteRaw(String.Format("{0} {1} obj\n", value.ObjectID.ObjectNumber, value.ObjectID.GenerationNumber)); + } + + public void WriteFileHeader(PdfDocument document) + { + StringBuilder header = new StringBuilder("%PDF-"); + int version = document._version; + header.Append((version / 10).ToString(CultureInfo.InvariantCulture) + "." + + (version % 10).ToString(CultureInfo.InvariantCulture) + "\n%\xD3\xF4\xCC\xE1\n"); + WriteRaw(header.ToString()); + + if (_layout == PdfWriterLayout.Verbose) + { + WriteRaw(String.Format("% PDFsharp Version {0} (verbose mode)\n", VersionInfo.Version)); + // Keep some space for later fix-up. + _commentPosition = (int)_stream.Position + 2; + WriteRaw("% \n"); + WriteRaw("% \n"); + WriteRaw("% \n"); + WriteRaw("% \n"); + WriteRaw("% \n"); + WriteRaw("%--------------------------------------------------------------------------------------------------\n"); + } + } + + public void WriteEof(PdfDocument document, int startxref) + { + WriteRaw("startxref\n"); + WriteRaw(startxref.ToString(CultureInfo.InvariantCulture)); + WriteRaw("\n%%EOF\n"); + int fileSize = (int)_stream.Position; + if (_layout == PdfWriterLayout.Verbose) + { + TimeSpan duration = DateTime.Now - document._creation; + + _stream.Position = _commentPosition; + // Without InvariantCulture parameter the following line fails if the current culture is e.g. + // a Far East culture, because the date string contains non-ASCII characters. + // So never never never never use ToString without a culture info. + WriteRaw("Creation date: " + document._creation.ToString("G", CultureInfo.InvariantCulture)); + _stream.Position = _commentPosition + 50; + WriteRaw("Creation time: " + duration.TotalSeconds.ToString("0.000", CultureInfo.InvariantCulture) + " seconds"); + _stream.Position = _commentPosition + 100; + WriteRaw("File size: " + fileSize.ToString(CultureInfo.InvariantCulture) + " bytes"); + _stream.Position = _commentPosition + 150; + WriteRaw("Pages: " + document.Pages.Count.ToString(CultureInfo.InvariantCulture)); + _stream.Position = _commentPosition + 200; + WriteRaw("Objects: " + document._irefTable.ObjectTable.Count.ToString(CultureInfo.InvariantCulture)); + } + } + + /// + /// Gets or sets the indentation for a new indentation level. + /// + internal int Indent + { + get { return _indent; } + set { _indent = value; } + } + int _indent = 2; + int _writeIndent; + + /// + /// Increases indent level. + /// + void IncreaseIndent() + { + _writeIndent += _indent; + } + + /// + /// Decreases indent level. + /// + void DecreaseIndent() + { + _writeIndent -= _indent; + } + + ///// + ///// Returns an indent string of blanks. + ///// + //static string Ind(int _indent) + //{ + // return new String(' ', _indent); + //} + + /// + /// Gets an indent string of current indent. + /// + string IndentBlanks + { + get { return new string(' ', _writeIndent); } + } + + void WriteIndent() + { + WriteRaw(IndentBlanks); + } + + void WriteSeparator(CharCat cat, char ch) + { + switch (_lastCat) + { + case CharCat.NewLine: + if (_layout == PdfWriterLayout.Verbose) + WriteIndent(); + break; + + case CharCat.Delimiter: + break; + + case CharCat.Character: + if (_layout == PdfWriterLayout.Verbose) + { + //if (cat == CharCat.Character || ch == '/') + _stream.WriteByte((byte)' '); + } + else + { + if (cat == CharCat.Character) + _stream.WriteByte((byte)' '); + } + break; + } + } + + void WriteSeparator(CharCat cat) + { + WriteSeparator(cat, '\0'); + } + + public void NewLine() + { + if (_lastCat != CharCat.NewLine) + WriteRaw('\n'); + } + + CharCat GetCategory(char ch) + { + if (Lexer.IsDelimiter(ch)) + return CharCat.Delimiter; + if (ch == Chars.LF) + return CharCat.NewLine; + return CharCat.Character; + } + + enum CharCat + { + NewLine, + Character, + Delimiter, + } + CharCat _lastCat; + + /// + /// Gets the underlying stream. + /// + internal Stream Stream + { + get { return _stream; } + } + Stream _stream; + + internal PdfStandardSecurityHandler SecurityHandler + { + get { return _securityHandler; } + set { _securityHandler = value; } + } + PdfStandardSecurityHandler _securityHandler; + + class StackItem + { + public StackItem(PdfObject value) + { + Object = value; + } + + public readonly PdfObject Object; + public bool HasStream; + } + + readonly List _stack = new List(); + int _commentPosition; + } +} diff --git a/PdfSharp/Pdf.IO/ShiftStack.cs b/PdfSharp/Pdf.IO/ShiftStack.cs new file mode 100644 index 0000000..3f006b0 --- /dev/null +++ b/PdfSharp/Pdf.IO/ShiftStack.cs @@ -0,0 +1,142 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; + +namespace PdfSharp.Pdf.IO +{ + /// + /// Represents the stack for the shift-reduce parser. It seems that it is only needed for + /// reduction of indirect references. + /// + internal class ShiftStack + { + // TODO: make Lexer.PeekChars(20) and scan for 'R' to detect indirect references + + public ShiftStack() + { + _items = new List(); + } + + public PdfItem[] ToArray(int start, int length) + { + PdfItem[] items = new PdfItem[length]; + for (int i = 0, j = start; i < length; i++, j++) + items[i] = _items[j]; + return items; + } + + /// + /// Gets the stack pointer index. + /// + // ReSharper disable InconsistentNaming + public int SP + // ReSharper restore InconsistentNaming + { + get { return _sp; } + } + + /// + /// Gets the value at the specified index. Valid index is in range 0 up to sp-1. + /// + public PdfItem this[int index] + { + get + { + if (index >= _sp) + throw new ArgumentOutOfRangeException("index", index, "Value greater than stack index."); + return _items[index]; + } + } + + /// + /// Gets an item relative to the current stack pointer. The index must be a negative value (-1, -2, etc.). + /// + public PdfItem GetItem(int relativeIndex) + { + if (relativeIndex >= 0 || -relativeIndex > _sp) + throw new ArgumentOutOfRangeException("relativeIndex", relativeIndex, "Value out of stack range."); + return _items[_sp + relativeIndex]; + } + + /// + /// Gets an item relative to the current stack pointer. The index must be a negative value (-1, -2, etc.). + /// + public int GetInteger(int relativeIndex) + { + if (relativeIndex >= 0 || -relativeIndex > _sp) + throw new ArgumentOutOfRangeException("relativeIndex", relativeIndex, "Value out of stack range."); + return ((PdfInteger)_items[_sp + relativeIndex]).Value; + } + + /// + /// Pushes the specified item onto the stack. + /// + public void Shift(PdfItem item) + { + Debug.Assert(item != null); + _items.Add(item); + _sp++; + } + + /// + /// Replaces the last 'count' items with the specified item. + /// + public void Reduce(int count) + { + if (count > _sp) + throw new ArgumentException("count causes stack underflow."); + _items.RemoveRange(_sp - count, count); + _sp -= count; + } + + /// + /// Replaces the last 'count' items with the specified item. + /// + public void Reduce(PdfItem item, int count) + { + Debug.Assert(item != null); + Reduce(count); + _items.Add(item); + _sp++; + } + + /// + /// The stack pointer index. Points to the next free item. + /// + int _sp; + + /// + /// An array representing the stack. + /// + readonly List _items; + } +} diff --git a/PdfSharp/Pdf.IO/enums/PasswordValidity.cs b/PdfSharp/Pdf.IO/enums/PasswordValidity.cs new file mode 100644 index 0000000..a4210a7 --- /dev/null +++ b/PdfSharp/Pdf.IO/enums/PasswordValidity.cs @@ -0,0 +1,52 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.IO +{ + /// + /// Determines the type of the password. + /// + public enum PasswordValidity + { + /// + /// Password is neither user nor owner password. + /// + Invalid, + + /// + /// Password is user password. + /// + UserPassword, + + /// + /// Password is owner password. + /// + OwnerPassword, + } +} diff --git a/PdfSharp/Pdf.IO/enums/PdfDocumentOpenMode.cs b/PdfSharp/Pdf.IO/enums/PdfDocumentOpenMode.cs new file mode 100644 index 0000000..97c4a5b --- /dev/null +++ b/PdfSharp/Pdf.IO/enums/PdfDocumentOpenMode.cs @@ -0,0 +1,63 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.IO +{ + /// + /// Determines how a PDF document is opened. + /// + public enum PdfDocumentOpenMode + { + /// + /// The PDF stream is completely read into memory and can be modified. Pages can be deleted or + /// inserted, but it is not possible to extract pages. This mode is useful for modifying an + /// existing PDF document. + /// + Modify, + + /// + /// The PDF stream is opened for importing pages from it. A document opened in this mode cannot + /// be modified. + /// + Import, + + /// + /// The PDF stream is completely read into memory, but cannot be modified. This mode preserves the + /// original internal structure of the document and is useful for analyzing existing PDF files. + /// + ReadOnly, + + /// + /// The PDF stream is partially read for information purposes only. The only valid operation is to + /// call the Info property at the imported document. This option is very fast and needs less memory + /// and is e.g. useful for browsing information about a collection of PDF documents in a user interface. + /// + InformationOnly, // TODO: not yet implemented + } +} diff --git a/PdfSharp/Pdf.IO/enums/PdfWriterLayout.cs b/PdfSharp/Pdf.IO/enums/PdfWriterLayout.cs new file mode 100644 index 0000000..ec23707 --- /dev/null +++ b/PdfSharp/Pdf.IO/enums/PdfWriterLayout.cs @@ -0,0 +1,61 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.IO +{ + /// + /// Determines how the PDF output stream is formatted. Even all formats create valid PDF files, + /// only Compact or Standard should be used for production purposes. + /// + public enum PdfWriterLayout + { + /// + /// The PDF stream contains no unnecessary characters. This is default in release build. + /// + Compact, + + /// + /// The PDF stream contains some superfluous line feeds, but is more readable. + /// + Standard, + + /// + /// The PDF stream is indented to reflect the nesting levels of the objects. This is useful + /// for analyzing PDF files, but increases the size of the file significantly. + /// + Indented, + + /// + /// The PDF stream is indented to reflect the nesting levels of the objects and contains additional + /// information about the PDFsharp objects. Furthermore content streams are not deflated. This + /// is useful for debugging purposes only and increases the size of the file significantly. + /// + Verbose, + } +} diff --git a/PdfSharp/Pdf.IO/enums/PdfWriterOptions.cs b/PdfSharp/Pdf.IO/enums/PdfWriterOptions.cs new file mode 100644 index 0000000..91f0317 --- /dev/null +++ b/PdfSharp/Pdf.IO/enums/PdfWriterOptions.cs @@ -0,0 +1,56 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.IO +{ + /// + /// INTERNAL USE ONLY. + /// + [Flags] + internal enum PdfWriterOptions + { + /// + /// If only this flag is specified the result is a regular valid PDF stream. + /// + Regular = 0x000000, + + /// + /// Omit writing stream data. For debugging purposes only. + /// With this option the result is not valid PDF. + /// + OmitStream = 0x000001, + + /// + /// Omit inflate filter. For debugging purposes only. + /// + OmitInflation = 0x000002, + } +} diff --git a/PdfSharp/Pdf.IO/enums/Symbol.cs b/PdfSharp/Pdf.IO/enums/Symbol.cs new file mode 100644 index 0000000..9344645 --- /dev/null +++ b/PdfSharp/Pdf.IO/enums/Symbol.cs @@ -0,0 +1,47 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.IO +{ + /// + /// Terminal symbols recognized by lexer. + /// + public enum Symbol + { +#pragma warning disable 1591 + None, + Comment, Null, Integer, UInteger, Real, Boolean, String, HexString, UnicodeString, UnicodeHexString, + Name, Keyword, + BeginStream, EndStream, + BeginArray, EndArray, + BeginDictionary, EndDictionary, + Obj, EndObj, R, XRef, Trailer, StartXRef, Eof, +#pragma warning restore 1591 + } +} diff --git a/PdfSharp/Pdf.Internal/AnsiEncoding.cs b/PdfSharp/Pdf.Internal/AnsiEncoding.cs new file mode 100644 index 0000000..48e076e --- /dev/null +++ b/PdfSharp/Pdf.Internal/AnsiEncoding.cs @@ -0,0 +1,292 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Text; + +namespace PdfSharp.Pdf.Internal +{ + /// + /// An encoder for PDF AnsiEncoding. + /// + public sealed class AnsiEncoding : Encoding + { +#if DEBUG_ && !(SILVERLIGHT || NETFX_CORE) + public static void ProofImplementation() + { + // Implementation was verified with .NET Ansi encoding. + Encoding dotnetImplementation = Encoding.GetEncoding(1252); + Encoding thisImplementation = new AnsiEncoding(); + + // Check ANSI chars. + for (int i = 0; i <= 255; i++) + { + byte[] b = { (byte) i }; + char[] ch1 = dotnetImplementation.GetChars(b, 0, 1); + char[] ch2 = thisImplementation.GetChars(b, 0, 1); + if (ch1[0] != ch2[0]) + Debug.Print("Error"); + byte[] b1 = dotnetImplementation.GetBytes(ch1, 0, 1); + byte[] b2 = thisImplementation.GetBytes(ch1, 0, 1); + if (b1.Length != b2.Length || b1.Length > 1 || b1[0] != b2[0]) + Debug.Print("Error"); + } + + // Check Unicode chars. + for (int i = 0; i <= 65535; i++) + { + if (i >= 256) + break; + if (i == 0x80) + Debug.Print(""); + char[] ch = new char[] { (char)i }; + byte[] b1 = dotnetImplementation.GetBytes(ch, 0, 1); + byte[] b2 = thisImplementation.GetBytes(ch, 0, 1); + if (b1.Length != b2.Length || b1.Length > 1 || b1[0] != b2[0]) + Debug.Print("Error"); + //byte[] b = new byte[] { (byte)i }; + //char ch = (char)i; + char[] ch1 = dotnetImplementation.GetChars(b1, 0, 1); + char[] ch2 = thisImplementation.GetChars(b2, 0, 1); + if (ch1[0] != ch2[0]) + Debug.Print("Error"); + } + } +#endif + + /// + /// Gets the byte count. + /// + public override int GetByteCount(char[] chars, int index, int count) + { + return count; + } + + /// + /// Gets the bytes. + /// + public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) + { + int count = charCount; + for (; charCount > 0; byteIndex++, charIndex++, charCount--) + bytes[byteIndex] = (byte)UnicodeToAnsi(chars[charIndex]); + return count; + } + + /// + /// Gets the character count. + /// + public override int GetCharCount(byte[] bytes, int index, int count) + { + return count; + } + + /// + /// Gets the chars. + /// + public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) + { + for (int idx = byteCount; idx > 0; byteIndex++, charIndex++, idx--) + chars[charIndex] = AnsiToUnicode[bytes[byteIndex]]; + return byteCount; + } + + /// + /// When overridden in a derived class, calculates the maximum number of bytes produced by encoding the specified number of characters. + /// + /// The number of characters to encode. + /// + /// The maximum number of bytes produced by encoding the specified number of characters. + /// + public override int GetMaxByteCount(int charCount) + { + return charCount; + } + + /// + /// When overridden in a derived class, calculates the maximum number of characters produced by decoding the specified number of bytes. + /// + /// The number of bytes to decode. + /// + /// The maximum number of characters produced by decoding the specified number of bytes. + /// + public override int GetMaxCharCount(int byteCount) + { + return byteCount; + } + + /// + /// Indicates whether the specified Unicode character is available in the ANSI code page 1252. + /// + public static bool IsAnsi1252Char(char ch) + { + if (ch < '\u0080' || (ch >= '\u00A0' && ch <= '\u00FF')) + return true; + + switch (ch) + { + case '\u20AC': + case '\u0081': + case '\u201A': + case '\u0192': + case '\u201E': + case '\u2026': + case '\u2020': + case '\u2021': + case '\u02C6': + case '\u2030': + case '\u0160': + case '\u2039': + case '\u0152': + case '\u008D': + case '\u017D': + case '\u008F': + case '\u0090': + case '\u2018': + case '\u2019': + case '\u201C': + case '\u201D': + case '\u2022': + case '\u2013': + case '\u2014': + case '\u02DC': + case '\u2122': + case '\u0161': + case '\u203A': + case '\u0153': + case '\u009D': + case '\u017E': + case '\u0178': + return true; + } + return false; + } + + /// + /// Maps Unicode to ANSI code page 1252. + /// + public static char UnicodeToAnsi(char ch) + { + if (ch < '\u0080' || (ch >= '\u00A0' && ch <= '\u00FF')) + return ch; + + switch (ch) + { + case '\u20AC': + return '\u0080'; + case '\u0081': + return '\u0081'; + case '\u201A': + return '\u0082'; + case '\u0192': + return '\u0083'; + case '\u201E': + return '\u0084'; + case '\u2026': + return '\u0085'; + case '\u2020': + return '\u0086'; + case '\u2021': + return '\u0087'; + case '\u02C6': + return '\u0088'; + case '\u2030': + return '\u0089'; + case '\u0160': + return '\u008A'; + case '\u2039': + return '\u008B'; + case '\u0152': + return '\u008C'; + case '\u008D': + return '\u008D'; + case '\u017D': + return '\u008E'; + case '\u008F': + return '\u008F'; + case '\u0090': + return '\u0090'; + case '\u2018': + return '\u0091'; + case '\u2019': + return '\u0092'; + case '\u201C': + return '\u0093'; + case '\u201D': + return '\u0094'; + case '\u2022': + return '\u0095'; + case '\u2013': + return '\u0096'; + case '\u2014': + return '\u0097'; + case '\u02DC': + return '\u0098'; + case '\u2122': + return '\u0099'; + case '\u0161': + return '\u009A'; + case '\u203A': + return '\u009B'; + case '\u0153': + return '\u009C'; + case '\u009D': + return '\u009D'; + case '\u017E': + return '\u009E'; + case '\u0178': + return '\u009F'; + } + return '\u00A4'; // Char 164 is ANSI value of ''. + } + + /// + /// Maps WinAnsi to Unicode characters. + /// + static readonly char[] AnsiToUnicode = // new char[/*256*/] + { + // 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F + /* 00 */ '\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007', '\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F', + /* 10 */ '\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017', '\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F', + /* 20 */ '\u0020', '\u0021', '\u0022', '\u0023', '\u0024', '\u0025', '\u0026', '\u0027', '\u0028', '\u0029', '\u002A', '\u002B', '\u002C', '\u002D', '\u002E', '\u002F', + /* 30 */ '\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037', '\u0038', '\u0039', '\u003A', '\u003B', '\u003C', '\u003D', '\u003E', '\u003F', + /* 40 */ '\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047', '\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D', '\u004E', '\u004F', + /* 50 */ '\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057', '\u0058', '\u0059', '\u005A', '\u005B', '\u005C', '\u005D', '\u005E', '\u005F', + /* 60 */ '\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065', '\u0066', '\u0067', '\u0068', '\u0069', '\u006A', '\u006B', '\u006C', '\u006D', '\u006E', '\u006F', + /* 70 */ '\u0070', '\u0071', '\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077', '\u0078', '\u0079', '\u007A', '\u007B', '\u007C', '\u007D', '\u007E', '\u007F', + /* 80 */ '\u20AC', '\u0081', '\u201A', '\u0192', '\u201E', '\u2026', '\u2020', '\u2021', '\u02C6', '\u2030', '\u0160', '\u2039', '\u0152', '\u008D', '\u017D', '\u008F', + /* 90 */ '\u0090', '\u2018', '\u2019', '\u201C', '\u201D', '\u2022', '\u2013', '\u2014', '\u02DC', '\u2122', '\u0161', '\u203A', '\u0153', '\u009D', '\u017E', '\u0178', + /* A0 */ '\u00A0', '\u00A1', '\u00A2', '\u00A3', '\u00A4', '\u00A5', '\u00A6', '\u00A7', '\u00A8', '\u00A9', '\u00AA', '\u00AB', '\u00AC', '\u00AD', '\u00AE', '\u00AF', + /* B0 */ '\u00B0', '\u00B1', '\u00B2', '\u00B3', '\u00B4', '\u00B5', '\u00B6', '\u00B7', '\u00B8', '\u00B9', '\u00BA', '\u00BB', '\u00BC', '\u00BD', '\u00BE', '\u00BF', + /* C0 */ '\u00C0', '\u00C1', '\u00C2', '\u00C3', '\u00C4', '\u00C5', '\u00C6', '\u00C7', '\u00C8', '\u00C9', '\u00CA', '\u00CB', '\u00CC', '\u00CD', '\u00CE', '\u00CF', + /* D0 */ '\u00D0', '\u00D1', '\u00D2', '\u00D3', '\u00D4', '\u00D5', '\u00D6', '\u00D7', '\u00D8', '\u00D9', '\u00DA', '\u00DB', '\u00DC', '\u00DD', '\u00DE', '\u00DF', + /* E0 */ '\u00E0', '\u00E1', '\u00E2', '\u00E3', '\u00E4', '\u00E5', '\u00E6', '\u00E7', '\u00E8', '\u00E9', '\u00EA', '\u00EB', '\u00EC', '\u00ED', '\u00EE', '\u00EF', + /* F0 */ '\u00F0', '\u00F1', '\u00F2', '\u00F3', '\u00F4', '\u00F5', '\u00F6', '\u00F7', '\u00F8', '\u00F9', '\u00FA', '\u00FB', '\u00FC', '\u00FD', '\u00FE', '\u00FF' + }; + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf.Internal/ColorSpaceHelper.cs b/PdfSharp/Pdf.Internal/ColorSpaceHelper.cs new file mode 100644 index 0000000..ff757f7 --- /dev/null +++ b/PdfSharp/Pdf.Internal/ColorSpaceHelper.cs @@ -0,0 +1,83 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Drawing; + +namespace PdfSharp.Pdf.Internal +{ + /// + /// Helper functions for RGB and CMYK colors. + /// + static class ColorSpaceHelper + { + /// + /// Checks whether a color mode and a color match. + /// + public static XColor EnsureColorMode(PdfColorMode colorMode, XColor color) + { +#if true + if (colorMode == PdfColorMode.Rgb && color.ColorSpace != XColorSpace.Rgb) + return XColor.FromArgb((int)(color.A * 255), color.R, color.G, color.B); + + if (colorMode == PdfColorMode.Cmyk && color.ColorSpace != XColorSpace.Cmyk) + return XColor.FromCmyk(color.A, color.C, color.M, color.Y, color.K); + + return color; +#else + if (colorMode == PdfColorMode.Rgb && color.ColorSpace != XColorSpace.Rgb) + throw new InvalidOperationException(PSSR.InappropriateColorSpace(colorMode, color.ColorSpace)); + + if (colorMode == PdfColorMode.Cmyk && color.ColorSpace != XColorSpace.Cmyk) + throw new InvalidOperationException(PSSR.InappropriateColorSpace(colorMode, color.ColorSpace)); +#endif + } + + /// + /// Checks whether the color mode of a document and a color match. + /// + public static XColor EnsureColorMode(PdfDocument document, XColor color) + { + if (document == null) + throw new ArgumentNullException("document"); + + return EnsureColorMode(document.Options.ColorMode, color); + } + + /// + /// Determines whether two colors are equal referring to their CMYK color values. + /// + public static bool IsEqualCmyk(XColor x, XColor y) + { + if (x.ColorSpace != XColorSpace.Cmyk || y.ColorSpace != XColorSpace.Cmyk) + return false; + return x.C == y.C && x.M == y.M && x.Y == y.Y && x.K == y.K; + } + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf.Internal/DocEncoding.cs b/PdfSharp/Pdf.Internal/DocEncoding.cs new file mode 100644 index 0000000..36a7da5 --- /dev/null +++ b/PdfSharp/Pdf.Internal/DocEncoding.cs @@ -0,0 +1,147 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Text; + +namespace PdfSharp.Pdf.Internal +{ + /// + /// An encoder for PDF DocEncoding. + /// + internal sealed class DocEncoding : Encoding + { + public DocEncoding() + { } + + public override int GetByteCount(char[] chars, int index, int count) + { + return PdfEncoders.WinAnsiEncoding.GetByteCount(chars, index, count); + } + + public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) + { + byte[] ansi = PdfEncoders.WinAnsiEncoding.GetBytes(chars, charIndex, charCount); + for (int idx = 0, count = ansi.Length; count > 0; idx++, byteIndex++, count--) + bytes[byteIndex] = AnsiToDoc[ansi[idx]]; + return ansi.Length; + } + + public override int GetCharCount(byte[] bytes, int index, int count) + { + //return PdfEncoders.WinAnsiEncoding.GetCharCount(bytes, index, count); + Debug.Assert(PdfEncoders.WinAnsiEncoding.GetCharCount(bytes, index, count) == count); + return count; + } + + public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) + { + PdfDocToUnicode.GetType(); + throw new NotImplementedException("GetChars"); + //for (; byteCount > 0; byteIndex++, charIndex++, byteCount--) + // chars[charIndex] = (char)bytes[byteIndex]; + //return byteCount; + } + + public override int GetMaxByteCount(int charCount) + { + return charCount; + } + + public override int GetMaxCharCount(int byteCount) + { + return byteCount; + } + + /// + /// Converts WinAnsi to DocEncode characters. Based upon PDF Reference 1.6. + /// + static readonly byte[] AnsiToDoc = new byte[256] + { + // x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf + /* 00 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + /* 10 */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + /* 20 */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + /* 30 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + /* 40 */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + /* 50 */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + /* 60 */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + /* 70 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, + /* 80 */ 0xA0, 0x81, 0x91, 0x83, 0x8C, 0x83, 0x81, 0x82, 0x1A, 0x89, 0x97, 0x88, 0x96, 0x8D, 0x99, 0x8F, + /* 90 */ 0x90, 0x8F, 0x90, 0x8D, 0x8E, 0x80, 0x85, 0x84, 0x1F, 0x92, 0x90, 0x89, 0x9C, 0x9D, 0x9E, 0x98, + /* a0 */ 0x20, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, + /* b0 */ 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, + /* c0 */ 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, + /* d0 */ 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + /* e0 */ 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + /* f0 */ 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, + + ////// Converts WinAnsi to DocEncode characters. Incomplete, just maps € and some other characters. + ////// x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf + /////* 00 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + /////* 10 */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + /////* 20 */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + /////* 30 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + /////* 40 */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + /////* 50 */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + /////* 60 */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + /////* 70 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, + /////* 80 */ 0xA0,#0x7F, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, + /////* 90 */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95,#0x8A,#0x8C, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, + /////* a0 */ 0x20, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, + /////* b0 */ 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, + /////* c0 */ 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, + /////* d0 */ 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + /////* e0 */ 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + /////* f0 */ 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, + }; + + // TODO: use this table + static readonly char[] PdfDocToUnicode = new char[] + { + '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0A', '\x0B', '\x0C', '\x0D', '\x0E', '\x0F', + '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1A', '\x1B', '\x1C', '\x1D', '\x1E', '\x1F', + '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2A', '\x2B', '\x2C', '\x2D', '\x2E', '\x2F', + '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3A', '\x3B', '\x3C', '\x3D', '\x3E', '\x3F', + '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4A', '\x4B', '\x4C', '\x4D', '\x4E', '\x4F', + '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5A', '\x5B', '\x5C', '\x5D', '\x5E', '\x5F', + '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6A', '\x6B', '\x6C', '\x6D', '\x6E', '\x6F', + '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7A', '\x7B', '\x7C', '\x7D', '\x7E', '\x7F', + '\x2022', '\x2020', '\x2021', '\x2026', '\x2014', '\x2013', '\x0192', '\x2044', '\x2039', '\x203A', '\x2212', '\x2030', '\x201E', '\x201C', '\x201D', '\x2018', + '\x2019', '\x201A', '\x2122', '\xFB01', '\xFB02', '\x0141', '\x0152', '\x0160', '\x0178', '\x017D', '\x0131', '\x0142', '\x0153', '\x0161', '\x017E', '\xFFFD', + '\x20AC', '\xA1', '\xA2', '\xA3', '\xA4', '\xA5', '\xA6', '\xA7', '\xA8', '\xA9', '\xAA', '\xAB', '\xAC', '\xAD', '\xAE', '\xAF', + '\xB0', '\xB1', '\xB2', '\xB3', '\xB4', '\xB5', '\xB6', '\xB7', '\xB8', '\xB9', '\xBA', '\xBB', '\xBC', '\xBD', '\xBE', '\xBF', + '\xC0', '\xC1', '\xC2', '\xC3', '\xC4', '\xC5', '\xC6', '\xC7', '\xC8', '\xC9', '\xCA', '\xCB', '\xCC', '\xCD', '\xCE', '\xCF', + '\xD0', '\xD1', '\xD2', '\xD3', '\xD4', '\xD5', '\xD6', '\xD7', '\xD8', '\xD9', '\xDA', '\xDB', '\xDC', '\xDD', '\xDE', '\xDF', + '\xE0', '\xE1', '\xE2', '\xE3', '\xE4', '\xE5', '\xE6', '\xE7', '\xE8', '\xE9', '\xEA', '\xEB', '\xEC', '\xED', '\xEE', '\xEF', + '\xF0', '\xF1', '\xF2', '\xF3', '\xF4', '\xF5', '\xF6', '\xF7', '\xF8', '\xF9', '\xFA', '\xFB', '\xFC', '\xFD', '\xFE', '\xFF', + }; + } +} diff --git a/PdfSharp/Pdf.Internal/GlobalObjectTable.cs b/PdfSharp/Pdf.Internal/GlobalObjectTable.cs new file mode 100644 index 0000000..4644952 --- /dev/null +++ b/PdfSharp/Pdf.Internal/GlobalObjectTable.cs @@ -0,0 +1,125 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Collections.Generic; + +namespace PdfSharp.Pdf.Internal +{ +#if true_ + /// + /// Provides a thread-local cache for large objects. + /// + internal class GlobalObjectTable_not_in_use + { + public GlobalObjectTable_not_in_use() + { } + + public void AttatchDocument(PdfDocument.DocumentHandle handle) + { + lo ck (_documentHandles) + { + _documentHandles.Add(handle); + } + } + + public void DetatchDocument(PdfDocument.DocumentHandle handle) + { + lo ck (_documentHandles) + { + // Notify other documents about detach + int count = _documentHandles.Count; + for (int idx = 0; idx < count; idx++) + { + if (((PdfDocument.DocumentHandle)_documentHandles[idx]).IsAlive) + { + PdfDocument target = ((PdfDocument.DocumentHandle)_documentHandles[idx]).Target; + if (target != null) + target.OnExternalDocumentFinalized(handle); + } + } + + // Clean up table + for (int idx = 0; idx < _documentHandles.Count; idx++) + { + PdfDocument target = ((PdfDocument.DocumentHandle)_documentHandles[idx]).Target; + if (target == null) + { + _documentHandles.RemoveAt(idx); + idx--; + } + } + } + + //lo ck (documents) + //{ + // int index = IndexOf(document); + // if (index != -1) + // { + // documents.RemoveAt(index); + // int count = documents.Count; + // for (int idx = 0; idx < count; idx++) + // { + // PdfDocument target = ((WeakReference)documents[idx]).Target as PdfDocument; + // if (target != null) + // target.OnExternalDocumentFinalized(document); + // } + + // for (int idx = 0; idx < documents.Count; idx++) + // { + // PdfDocument target = ((WeakReference)documents[idx]).Target as PdfDocument; + // if (target == null) + // { + // documents.RemoveAt(idx); + // idx--; + // } + // } + // } + //} + } + + //int IndexOf(PdfDocument.Handle handle) + //{ + // int count = documents.Count; + // for (int idx = 0; idx < count; idx++) + // { + // if ((PdfDocument.Handle)documents[idx] == handle) + // return idx; + // //if (Object.ReferenceEquals(((WeakReference)documents[idx]).Target, document)) + // // return idx; + // } + // return -1; + //} + + /// + /// Array of handles to all documents. + /// + readonly List _documentHandles = new List(); + } +#endif +} diff --git a/PdfSharp/Pdf.Internal/PdfDiagnostics.cs b/PdfSharp/Pdf.Internal/PdfDiagnostics.cs new file mode 100644 index 0000000..555ef93 --- /dev/null +++ b/PdfSharp/Pdf.Internal/PdfDiagnostics.cs @@ -0,0 +1,55 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Internal +{ + class PdfDiagnostics + { + public static bool TraceCompressedObjects + { + get { return _traceCompressedObjects; } + set { _traceCompressedObjects = value; } + } + static bool _traceCompressedObjects = true; + + public static bool TraceXrefStreams + { + get { return _traceXrefStreams && TraceCompressedObjects; } + set { _traceXrefStreams = value; } + } + static bool _traceXrefStreams = true; + + public static bool TraceObjectStreams + { + get { return _traceObjectStreams && TraceCompressedObjects; } + set { _traceObjectStreams = value; } + } + static bool _traceObjectStreams = true; + } +} diff --git a/PdfSharp/Pdf.Internal/PdfEncoders.cs b/PdfSharp/Pdf.Internal/PdfEncoders.cs new file mode 100644 index 0000000..d3632cd --- /dev/null +++ b/PdfSharp/Pdf.Internal/PdfEncoders.cs @@ -0,0 +1,662 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using System.Text; +using PdfSharp.Drawing; +using PdfSharp.Pdf.Security; + +namespace PdfSharp.Pdf.Internal +{ + /// + /// Groups a set of static encoding helper functions. + /// + internal static class PdfEncoders + { + /// + /// Gets the raw encoding. + /// + public static Encoding RawEncoding + { + get { return _rawEncoding ?? (_rawEncoding = new RawEncoding()); } + } + static Encoding _rawEncoding; + + /// + /// Gets the raw Unicode encoding. + /// + public static Encoding RawUnicodeEncoding + { + get { return _rawUnicodeEncoding ?? (_rawUnicodeEncoding = new RawUnicodeEncoding()); } + } + static Encoding _rawUnicodeEncoding; + + /// + /// Gets the Windows 1252 (ANSI) encoding. + /// + public static Encoding WinAnsiEncoding + { + get + { + if (_winAnsiEncoding == null) + { +#if !SILVERLIGHT && !NETFX_CORE && !UWP && !CORE + // Use .net encoder if available. + _winAnsiEncoding = Encoding.GetEncoding(1252); +#else + // Use own implementation in Silverlight and WinRT + _winAnsiEncoding = new AnsiEncoding(); +#endif + } + return _winAnsiEncoding; + } + } + static Encoding _winAnsiEncoding; + + /// + /// Gets the PDF DocEncoding encoding. + /// + public static Encoding DocEncoding + { + get { return _docEncoding ?? (_docEncoding = new DocEncoding()); } + } + static Encoding _docEncoding; + + /// + /// Gets the UNICODE little-endian encoding. + /// + public static Encoding UnicodeEncoding + { + get { return _unicodeEncoding ?? (_unicodeEncoding = Encoding.Unicode); } + } + static Encoding _unicodeEncoding; + + ///// + ///// Encodes a string from a byte array. Each character gets the code of the corresponding byte. + ///// + //public static string RawString(byte[] bytes, int offset, int length) + //{ + // char[] chars = new char[length]; + // for (int idx = offset, ch = 0; idx < offset + length; idx++, ch++) + // chars[ch] = (char)bytes[idx]; + // return new string(chars, 0, length); + //} + // + //public static string RawString(byte[] bytes) + //{ + // return RawString(bytes, 0, bytes.Length); + //} + +#if true_ + public static string EncodeAsLiteral(string text, bool unicode) + { + if (text == null || text == "") + return "<>"; + + StringBuilder pdf = new StringBuilder(""); + if (!unicode) + { + byte[] bytes = WinAnsiEncoding.GetBytes(text); + int count = bytes.Length; + pdf.Append("("); + for (int idx = 0; idx < count; idx++) + { + char ch = (char)bytes[idx]; + if (ch < 32) + { + switch (ch) + { + case '\n': + pdf.Append("\\n"); + break; + + case '\r': + pdf.Append("\\r"); + break; + + case '\t': + pdf.Append("\\t"); + break; + + case '\f': + pdf.Append("\\f"); + break; + + default: + pdf.Append(InvalidChar); // TODO + break; + } + } + else + { + switch (ch) + { + case '(': + pdf.Append("\\("); + break; + + case ')': + pdf.Append("\\)"); + break; + + case '\\': + pdf.Append("\\\\"); + break; + + default: + pdf.Append(ch); + break; + } + } + } + pdf.Append(')'); + } + else + { + pdf.Append("<"); + byte[] bytes = UnicodeEncoding.GetBytes(text); + int count = bytes.Length; + for (int idx = 0; idx < count; idx += 2) + { + pdf.AppendFormat("{0:X2}{1:X2}", bytes[idx + 1], bytes[idx]); + if (idx != 0 && (idx % 48) == 0) + pdf.Append("\n"); + } + pdf.Append(">"); + } + return pdf.ToString(); + } +#endif + + //public static string EncodeAsLiteral(string text) + //{ + // return EncodeAsLiteral(text, false); + //} + + /// + /// Converts a raw string into a raw string literal, possibly encrypted. + /// + public static string ToStringLiteral(string text, PdfStringEncoding encoding, PdfStandardSecurityHandler securityHandler) + { + if (String.IsNullOrEmpty(text)) + return "()"; + + byte[] bytes; + switch (encoding) + { + case PdfStringEncoding.RawEncoding: + bytes = RawEncoding.GetBytes(text); + break; + + case PdfStringEncoding.WinAnsiEncoding: + bytes = WinAnsiEncoding.GetBytes(text); + break; + + case PdfStringEncoding.PDFDocEncoding: + bytes = DocEncoding.GetBytes(text); + break; + + case PdfStringEncoding.Unicode: + bytes = RawUnicodeEncoding.GetBytes(text); + break; + + default: + throw new NotImplementedException(encoding.ToString()); + } + byte[] temp = FormatStringLiteral(bytes, encoding == PdfStringEncoding.Unicode, true, false, securityHandler); + return RawEncoding.GetString(temp, 0, temp.Length); + } + + /// + /// Converts a raw string into a raw string literal, possibly encrypted. + /// + public static string ToStringLiteral(byte[] bytes, bool unicode, PdfStandardSecurityHandler securityHandler) + { + if (bytes == null || bytes.Length == 0) + return "()"; + + byte[] temp = FormatStringLiteral(bytes, unicode, true, false, securityHandler); + return RawEncoding.GetString(temp, 0, temp.Length); + } + + /// + /// Converts a raw string into a raw hexadecimal string literal, possibly encrypted. + /// + public static string ToHexStringLiteral(string text, PdfStringEncoding encoding, PdfStandardSecurityHandler securityHandler) + { + if (String.IsNullOrEmpty(text)) + return "<>"; + + byte[] bytes; + switch (encoding) + { + case PdfStringEncoding.RawEncoding: + bytes = RawEncoding.GetBytes(text); + break; + + case PdfStringEncoding.WinAnsiEncoding: + bytes = WinAnsiEncoding.GetBytes(text); + break; + + case PdfStringEncoding.PDFDocEncoding: + bytes = DocEncoding.GetBytes(text); + break; + + case PdfStringEncoding.Unicode: + //bytes = UnicodeEncoding.GetBytes(text); + bytes = RawUnicodeEncoding.GetBytes(text); + break; + + default: + throw new NotImplementedException(encoding.ToString()); + } + + byte[] agTemp = FormatStringLiteral(bytes, encoding == PdfStringEncoding.Unicode, true, true, securityHandler); + return RawEncoding.GetString(agTemp, 0, agTemp.Length); + } + + /// + /// Converts a raw string into a raw hexadecimal string literal, possibly encrypted. + /// + public static string ToHexStringLiteral(byte[] bytes, bool unicode, PdfStandardSecurityHandler securityHandler) + { + if (bytes == null || bytes.Length == 0) + return "<>"; + + byte[] agTemp = FormatStringLiteral(bytes, unicode, true, true, securityHandler); + return RawEncoding.GetString(agTemp, 0, agTemp.Length); + } + + /// + /// Converts the specified byte array into a byte array representing a string literal. + /// + /// The bytes of the string. + /// Indicates whether one or two bytes are one character. + /// Indicates whether to use Unicode prefix. + /// Indicates whether to create a hexadecimal string literal. + /// Encrypts the bytes if specified. + /// The PDF bytes. + public static byte[] FormatStringLiteral(byte[] bytes, bool unicode, bool prefix, bool hex, PdfStandardSecurityHandler securityHandler) + { + if (bytes == null || bytes.Length == 0) + return hex ? new byte[] { (byte)'<', (byte)'>' } : new byte[] { (byte)'(', (byte)')' }; + + Debug.Assert(!unicode || bytes.Length % 2 == 0, "Odd number of bytes in Unicode string."); + + byte[] originalBytes = null; + + bool encrypted = false; + if (securityHandler != null && !hex) + { + originalBytes = bytes; + bytes = (byte[])bytes.Clone(); + bytes = securityHandler.EncryptBytes(bytes); + encrypted = true; + } + + int count = bytes.Length; + StringBuilder pdf = new StringBuilder(); + if (!unicode) + { + if (!hex) + { + pdf.Append("("); + for (int idx = 0; idx < count; idx++) + { + char ch = (char)bytes[idx]; + if (ch < 32) + { + switch (ch) + { + case '\n': + pdf.Append("\\n"); + break; + + case '\r': + pdf.Append("\\r"); + break; + + case '\t': + pdf.Append("\\t"); + break; + + case '\b': + pdf.Append("\\b"); + break; + + // Corrupts encrypted text. + //case '\f': + // pdf.Append("\\f"); + // break; + + default: + // Don't escape characters less than 32 if the string is encrypted, because it is + // unreadable anyway. + encrypted = true; + if (!encrypted) + { + pdf.Append("\\0"); + pdf.Append((char)(ch % 8 + '0')); + pdf.Append((char)(ch / 8 + '0')); + } + else + pdf.Append(ch); + break; + } + } + else + { + switch (ch) + { + case '(': + pdf.Append("\\("); + break; + + case ')': + pdf.Append("\\)"); + break; + + case '\\': + pdf.Append("\\\\"); + break; + + default: + pdf.Append(ch); + break; + } + } + } + pdf.Append(')'); + } + else + { + pdf.Append('<'); + for (int idx = 0; idx < count; idx++) + pdf.AppendFormat("{0:X2}", bytes[idx]); + pdf.Append('>'); + } + } + else + { + //Hex: + if (hex) + { + if (securityHandler != null && prefix) + { + // TODO Reduce redundancy. + // Encrypt data after padding BOM. + var bytes2 = new byte[bytes.Length + 2]; + // Add BOM. + bytes2[0] = 0xfe; + bytes2[1] = 0xff; + // Copy bytes. + Array.Copy(bytes, 0, bytes2, 2, bytes.Length); + // Encyption. + bytes2 = securityHandler.EncryptBytes(bytes2); + encrypted = true; + pdf.Append("<"); + var count2 = bytes2.Length; + for (int idx = 0; idx < count2; idx += 2) + { + pdf.AppendFormat("{0:X2}{1:X2}", bytes2[idx], bytes2[idx + 1]); + if (idx != 0 && (idx % 48) == 0) + pdf.Append("\n"); + } + pdf.Append(">"); + } + else + { + // No prefix or no encryption. + pdf.Append(prefix ? ""); + } + } + else + { + // TODO non hex literals... not sure how to treat linefeeds, '(', '\' etc. + if (encrypted) + { + // Hack: Call self with hex := true. + return FormatStringLiteral(originalBytes, unicode, prefix, true, securityHandler); + } + else + { + // Hack: Call self with hex := true. + return FormatStringLiteral(bytes, true, prefix, true, null); + } + } + } + return RawEncoding.GetBytes(pdf.ToString()); + } + + /// + /// Converts WinAnsi to DocEncode characters. Incomplete, just maps € and some other characters. + /// + static byte[] docencode_______ = new byte[256] + { + // TODO: + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, + 0xA0, 0x7F, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x8A, 0x8C, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, + 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, + 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, + 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, + 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, + }; + + //public static string DocEncode(string text, bool unicode)//, PdfStandardSecurityHandler securityHandler) + //{ + // if (text == null || text == "") + // return "()"; + // + // int length = text.Length; + // StringBuilder encoded = new StringBuilder(2 * length); + // if (!unicode) + // { + // byte[] bytes = WinAnsiEncoding.GetBytes(text); + // encoded.Append('('); + // for (int idx = 0; idx < length; idx++) + // { + // char ch = (char)bytes[idx]; + // if (ch > 255) + // { + // //TODO unicode? + // encoded.Append(InvalidChar); + // //encoded.Append(ch); + // continue; + // } + // ch = (char)docencode[(int)ch]; + // if (ch < 32) + // { + // switch (ch) + // { + // case '\n': + // encoded.Append("\\n"); + // break; + // + // case '\r': + // encoded.Append("\\r"); + // break; + // + // case '\t': + // encoded.Append("\\t"); + // break; + // + // case '\f': + // encoded.Append("\\f"); + // break; + // + // default: + // encoded.Append(InvalidChar); // TODO + // break; + // } + // } + // else + // { + // switch (ch) + // { + // case '(': + // encoded.Append("\\("); + // break; + // + // case ')': + // encoded.Append("\\)"); + // break; + // + // case '\\': + // encoded.Append("\\\\"); + // break; + // + // default: + // encoded.Append(ch); + // break; + // } + // } + // } + // encoded.Append(')'); + // } + // else + // { + // encoded.Append("'); + // } + // return encoded.ToString(); + //} + + //public static string DocEncode(string text) + //{ + // return DocEncode(text, false); + //} + + ///// + ///// Encodes a hexadecimal doc-encoded string literal. + ///// + //public static string DocEncodeHex(string text, bool unicode) + //{ + // if (text == null || text == "") + // return "<>"; + // + // int length = text.Length; + // StringBuilder encoded = new StringBuilder(3 * length); + // if (!unicode) + // { + // byte[] bytes = WinAnsiEncoding.GetBytes(text); + // encoded.Append('<'); + // for (int idx = 0; idx < length; idx++) + // encoded.AppendFormat("{0:X2}", docencode[bytes[idx]]); + // encoded.Append('>'); + // } + // else + // { + // encoded.Append("'); + // } + // return encoded.ToString(); + //} + + //public static string DocEncodeHex(string text) + //{ + // return DocEncodeHex(text, false); + //} + + /// + /// ...because I always forget CultureInfo.InvariantCulture and wonder why Acrobat + /// cannot understand my German decimal separator... + /// + public static string Format(string format, params object[] args) + { + return String.Format(CultureInfo.InvariantCulture, format, args); + } + + /// + /// Converts a float into a string with up to 3 decimal digits and a decimal point. + /// + public static string ToString(double val) + { + return val.ToString(Config.SignificantFigures3, CultureInfo.InvariantCulture); + } + + /// + /// Converts an XColor into a string with up to 3 decimal digits and a decimal point. + /// + public static string ToString(XColor color, PdfColorMode colorMode) + { + const string format = Config.SignificantFigures3; + + // If not defined let color decide + if (colorMode == PdfColorMode.Undefined) + colorMode = color.ColorSpace == XColorSpace.Cmyk ? PdfColorMode.Cmyk : PdfColorMode.Rgb; + + switch (colorMode) + { + case PdfColorMode.Cmyk: + return String.Format(CultureInfo.InvariantCulture, "{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "}", + color.C, color.M, color.Y, color.K); + + default: + return String.Format(CultureInfo.InvariantCulture, "{0:" + format + "} {1:" + format + "} {2:" + format + "}", + color.R / 255.0, color.G / 255.0, color.B / 255.0); + } + } + + /// + /// Converts an XMatrix into a string with up to 4 decimal digits and a decimal point. + /// + public static string ToString(XMatrix matrix) + { + const string format = Config.SignificantFigures4; + return String.Format(CultureInfo.InvariantCulture, + "{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "} {4:" + format + "} {5:" + format + "}", + matrix.M11, matrix.M12, matrix.M21, matrix.M22, matrix.OffsetX, matrix.OffsetY); + } + } +} diff --git a/PdfSharp/Pdf.Internal/RawEncoding.cs b/PdfSharp/Pdf.Internal/RawEncoding.cs new file mode 100644 index 0000000..5ed5723 --- /dev/null +++ b/PdfSharp/Pdf.Internal/RawEncoding.cs @@ -0,0 +1,165 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Text; + +namespace PdfSharp.Pdf.Internal +{ + /// + /// An encoder for raw strings. The raw encoding is simply the identity relation between + /// characters and bytes. PDFsharp internally works with raw encoded strings instead of + /// byte arrays because strings are much more handy than byte arrays. + /// + /// + /// Raw encoded strings represent an array of bytes. Therefore a character greater than + /// 255 is not valid in a raw encoded string. + /// + public sealed class RawEncoding : Encoding + { + /// + /// Initializes a new instance of the class. + /// + // ReSharper disable EmptyConstructor + public RawEncoding() + { } + // ReSharper restore EmptyConstructor + + /// + /// When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters from the specified character array. + /// + /// The character array containing the set of characters to encode. + /// The index of the first character to encode. + /// The number of characters to encode. + /// + /// The number of bytes produced by encoding the specified characters. + /// + public override int GetByteCount(char[] chars, int index, int count) + { + return count; + } + + /// + /// When overridden in a derived class, encodes a set of characters from the specified character array into the specified byte array. + /// + /// The character array containing the set of characters to encode. + /// The index of the first character to encode. + /// The number of characters to encode. + /// The byte array to contain the resulting sequence of bytes. + /// The index at which to start writing the resulting sequence of bytes. + /// + /// The actual number of bytes written into . + /// + public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) + { + for (int count = charCount; count > 0; charIndex++, byteIndex++, count--) + { +#if DEBUG_ + if ((uint) chars[charIndex] > 255) + Debug-Break.Break(true); +#endif + //Debug.Assert((uint)chars[charIndex] < 256, "Raw string contains invalid character with a value > 255."); + bytes[byteIndex] = (byte)chars[charIndex]; + //#warning Here is a HACK that must not be ignored! + // HACK: + // bytes[byteIndex] = (byte)chars[charIndex]; + } + return charCount; + } + + /// + /// When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array. + /// + /// The byte array containing the sequence of bytes to decode. + /// The index of the first byte to decode. + /// The number of bytes to decode. + /// + /// The number of characters produced by decoding the specified sequence of bytes. + /// + public override int GetCharCount(byte[] bytes, int index, int count) + { + return count; + } + + /// + /// When overridden in a derived class, decodes a sequence of bytes from the specified byte array into the specified character array. + /// + /// The byte array containing the sequence of bytes to decode. + /// The index of the first byte to decode. + /// The number of bytes to decode. + /// The character array to contain the resulting set of characters. + /// The index at which to start writing the resulting set of characters. + /// + /// The actual number of characters written into . + /// + public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) + { + for (int count = byteCount; count > 0; byteIndex++, charIndex++, count--) + chars[charIndex] = (char)bytes[byteIndex]; + return byteCount; + } + + /// + /// When overridden in a derived class, calculates the maximum number of bytes produced by encoding the specified number of characters. + /// + /// The number of characters to encode. + /// + /// The maximum number of bytes produced by encoding the specified number of characters. + /// + public override int GetMaxByteCount(int charCount) + { + return charCount; + } + + /// + /// When overridden in a derived class, calculates the maximum number of characters produced by decoding the specified number of bytes. + /// + /// The number of bytes to decode. + /// + /// The maximum number of characters produced by decoding the specified number of bytes. + /// + public override int GetMaxCharCount(int byteCount) + { + return byteCount; + } + +#if SILVERLIGHT + /// + /// When overridden in a derived class, decodes all the bytes in the specified byte array into a string. + /// + /// The byte array containing the sequence of bytes to decode. + /// + /// A containing the results of decoding the specified sequence of bytes. + /// + public string GetString(byte[] bytes) + { + return GetString(bytes, 0, bytes.Length); + } +#endif + } +} diff --git a/PdfSharp/Pdf.Internal/RawUnicodeEncoding.cs b/PdfSharp/Pdf.Internal/RawUnicodeEncoding.cs new file mode 100644 index 0000000..9b82ba3 --- /dev/null +++ b/PdfSharp/Pdf.Internal/RawUnicodeEncoding.cs @@ -0,0 +1,84 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Text; + +namespace PdfSharp.Pdf.Internal +{ + /// + /// An encoder for Unicode strings. + /// (That means, a character represents a glyph index.) + /// + internal sealed class RawUnicodeEncoding : Encoding + { + public RawUnicodeEncoding() + { } + + public override int GetByteCount(char[] chars, int index, int count) + { + // Each character represents exactly an ushort value, which is a glyph index. + return 2 * count; + } + + public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) + { + for (int count = charCount; count > 0; charIndex++, count--) + { + char ch = chars[charIndex]; + bytes[byteIndex++] = (byte)(ch >> 8); + bytes[byteIndex++] = (byte)ch; + } + return charCount * 2; + } + + public override int GetCharCount(byte[] bytes, int index, int count) + { + return count / 2; + } + + public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) + { + for (int count = byteCount; count > 0; byteIndex += 2, charIndex++, count--) + { + chars[charIndex] = (char)((int)bytes[byteIndex] << 8 + (int)bytes[byteIndex + 1]); + } + return byteCount; + } + + public override int GetMaxByteCount(int charCount) + { + return charCount * 2; + } + + public override int GetMaxCharCount(int byteCount) + { + return byteCount / 2; + } + } +} diff --git a/PdfSharp/Pdf.Internal/ThreadLocalStorage.cs b/PdfSharp/Pdf.Internal/ThreadLocalStorage.cs new file mode 100644 index 0000000..e904e53 --- /dev/null +++ b/PdfSharp/Pdf.Internal/ThreadLocalStorage.cs @@ -0,0 +1,128 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf.Internal +{ + /// + /// Provides a thread-local cache for large objects. + /// + internal class ThreadLocalStorage // #??? + { + public ThreadLocalStorage() + { + _importedDocuments = new Dictionary(StringComparer.OrdinalIgnoreCase); + } + + public void AddDocument(string path, PdfDocument document) + { + _importedDocuments.Add(path, document.Handle); + } + + public void RemoveDocument(string path) + { + _importedDocuments.Remove(path); + } + + public PdfDocument GetDocument(string path) + { + Debug.Assert(path.StartsWith("*") || Path.IsPathRooted(path), "Path must be full qualified."); + + PdfDocument document = null; + PdfDocument.DocumentHandle handle; + if (_importedDocuments.TryGetValue(path, out handle)) + { + document = handle.Target; + if (document == null) + RemoveDocument(path); + } + if (document == null) + { + document = PdfReader.Open(path, PdfDocumentOpenMode.Import); + _importedDocuments.Add(path, document.Handle); + } + return document; + } + + public PdfDocument[] Documents + { + get + { + List list = new List(); + foreach (PdfDocument.DocumentHandle handle in _importedDocuments.Values) + { + if (handle.IsAlive) + list.Add(handle.Target); + } + return list.ToArray(); + } + } + + public void DetachDocument(PdfDocument.DocumentHandle handle) + { + if (handle.IsAlive) + { + foreach (string path in _importedDocuments.Keys) + { + if (_importedDocuments[path] == handle) + { + _importedDocuments.Remove(path); + break; + } + } + } + + // Clean table + bool itemRemoved = true; + while (itemRemoved) + { + itemRemoved = false; + foreach (string path in _importedDocuments.Keys) + { + if (!_importedDocuments[path].IsAlive) + { + _importedDocuments.Remove(path); + itemRemoved = true; + break; + } + } + } + } + + /// + /// Maps path to document handle. + /// + readonly Dictionary _importedDocuments; + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf.Printing/PdfFilePrinter.cs b/PdfSharp/Pdf.Printing/PdfFilePrinter.cs new file mode 100644 index 0000000..7f7e614 --- /dev/null +++ b/PdfSharp/Pdf.Printing/PdfFilePrinter.cs @@ -0,0 +1,254 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// Removed + +#if true_ +namespace PdfSharp.Pdf.Printing +{ + // Some googled inforamtion about command line switches: + // + // AcroRd32.exe filename Executes the reader and displays a file. + // AcroRd32.exe /p filename Executes the reader and prints a file. + // AcroRd32.exe /t path printername drivername portname Executes the reader and prints a file + // while suppressing the Acrobat print + // dialog box, then terminating the Reader. + // + // The four parameters of the /t option evaluate to strings. + // printername The name of the Printer. + // drivername Your printer drivers name i.e. whatever apperars in the Driver Used box when viewing printer properties. + // portname The printers port. portname cannot contain any "/" characters; if it does, output is routed to + // the default port for that printer. + // + // + // Acrobat.exe /n Launch a separate instance of the Acrobat application + // Acrobat.exe /s Open Acrobat suppressing the splash screen + // Acrobat.exe /o Open Acrobat suppressing the openfile dialog + // Acrobat.exe /h Open Acrobat in hidden mode + + + /// + /// A wrapper around Adobe Reader or Adobe Acrobat that helps to print PDF files. + /// The property AdobeReaderPath must be set before the class can be used for printing. + /// The class was tested with Adobe Reader 7.0.7. + /// If this stuff does not work, please don't write me mails! + /// If you enhance this class, please let me know. + /// + public class PdfFilePrinter + { + /// + /// Initializes a new instance of the class. + /// + public PdfFilePrinter() + { } + + /// + /// Initializes a new instance of the class. + /// + /// Name of the PDF file. + public PdfFilePrinter(string pdfFileName) + { + PdfFileName = pdfFileName; + } + + /// + /// Initializes a new instance of the class. + /// + /// Name of the PDF file. + /// Name of the printer. + public PdfFilePrinter(string pdfFileName, string printerName) + { + _pdfFileName = pdfFileName; + _printerName = printerName; + } + + /// + /// Gets or sets the name of the PDF file to print. + /// + public string PdfFileName + { + get { return _pdfFileName; } + set { _pdfFileName = value; } + } + string _pdfFileName; + + /// + /// Gets or sets the name of the printer. A typical name looks like '\\myserver\HP LaserJet PCL5'. + /// + /// The name of the printer. + public string PrinterName + { + get { return _printerName; } + set { _printerName = value; } + } + string _printerName; + + /// + /// Gets or sets the working directory. + /// + public string WorkingDirectory + { + get { return _workingDirectory; } + set { _workingDirectory = value; } + } + string _workingDirectory; + + /// + /// Prints the PDF file. + /// + public void Print() + { + Print(-1); + } + + /// + /// Prints the PDF file. + /// + /// The number of milliseconds to wait for completing the print job. + public void Print(int milliseconds) + { + if (String.IsNullOrEmpty(_printerName)) + _printerName = _defaultPrinterName; + + if (String.IsNullOrEmpty(_adobeReaderPath)) + throw new InvalidOperationException("No full qualified path to AcroRd32.exe or Acrobat.exe is set."); + + if (String.IsNullOrEmpty(_printerName)) + throw new InvalidOperationException("No printer name set."); + + // Check whether file exists. + string fqName; + if (!string.IsNullOrEmpty(_workingDirectory)) + fqName = Path.Combine(_workingDirectory, _pdfFileName); + else + fqName = Path.Combine(Directory.GetCurrentDirectory(), _pdfFileName); + if (!File.Exists(fqName)) + throw new InvalidOperationException(String.Format("The file {0} does not exist.", fqName)); + + // TODO: Check whether printer exists. + + try + { + DoSomeVeryDirtyHacksToMakeItWork(); + + //acrord32.exe /t <- seems to work best + //acrord32.exe /h /p <- some swear by this version + ProcessStartInfo startInfo = new ProcessStartInfo(); + startInfo.FileName = _adobeReaderPath; + string args = String.Format("/t \"{0}\" \"{1}\"", _pdfFileName, _printerName); + //Debug.WriteLine(args); + startInfo.Arguments = args; + startInfo.CreateNoWindow = true; + startInfo.ErrorDialog = false; + startInfo.UseShellExecute = false; + if (!String.IsNullOrEmpty(_workingDirectory)) + startInfo.WorkingDirectory = _workingDirectory; + + Process process = Process.Start(startInfo); + if (!process.WaitForExit(milliseconds)) + { + // Kill Adobe Reader/Acrobat + process.Kill(); + } + } + catch (Exception ex) + { + // ReSharper disable PossibleIntendedRethrow + throw ex; + // ReSharper restore PossibleIntendedRethrow + } + } + + /// + /// For reasons only Adobe knows the Reader seams to open and shows the document instead of printing it + /// when it was not already running. + /// If you use PDFsharp and have any suggestions to circumvent this function, please let us know. + /// + void DoSomeVeryDirtyHacksToMakeItWork() + { + if (_runningAcro != null) + { + if (!_runningAcro.HasExited) + return; + _runningAcro.Dispose(); + _runningAcro = null; + } + // Is any Adobe Reader/Acrobat running? + Process[] processes = Process.GetProcesses(); + int count = processes.Length; + for (int idx = 0; idx < count; idx++) + { + try + { + Process process = processes[idx]; + ProcessModule module = process.MainModule; + + if (String.Compare(Path.GetFileName(module.FileName), Path.GetFileName(_adobeReaderPath), StringComparison.OrdinalIgnoreCase) == 0) + { + // Yes: Fine, we can print. + _runningAcro = process; + break; + } + } + catch { } + } + if (_runningAcro == null) + { + // No: Start an Adobe Reader/Acrobat. + // If you are within ASP.NET, good luck... + _runningAcro = Process.Start(_adobeReaderPath); + if (_runningAcro != null) + _runningAcro.WaitForInputIdle(); + } + } + static Process _runningAcro; + + /// + /// Gets or sets the Adobe Reader or Adobe Acrobat path. + /// A typical name looks like 'C:\Program Files\Adobe\Adobe Reader 7.0\AcroRd32.exe'. + /// + static public string AdobeReaderPath + { + get { return _adobeReaderPath; } + set { _adobeReaderPath = value; } + } + static string _adobeReaderPath; + + /// + /// Gets or sets the name of the default printer. A typical name looks like '\\myserver\HP LaserJet PCL5'. + /// + static public string DefaultPrinterName + { + get { return _defaultPrinterName; } + set { _defaultPrinterName = value; } + } + static string _defaultPrinterName; + } +} +#endif \ No newline at end of file diff --git a/PdfSharp/Pdf.Security/MD5Managed.cs b/PdfSharp/Pdf.Security/MD5Managed.cs new file mode 100644 index 0000000..adafb17 --- /dev/null +++ b/PdfSharp/Pdf.Security/MD5Managed.cs @@ -0,0 +1,426 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// Based on code from here: +// http://archive.msdn.microsoft.com/SilverlightMD5/Release/ProjectReleases.aspx?ReleaseId=2206 +// +// ************************************************************** +// * Raw implementation of the MD5 hash algorithm +// * from RFC 1321. +// * +// * Written By: Reid Borsuk and Jenny Zheng +// * Copyright (c) Microsoft Corporation. All rights reserved. +// ************************************************************** + +using System; +using System.Diagnostics; +#if !NETFX_CORE && !UWP +using System.Security.Cryptography; +#endif + +// ReSharper disable InconsistentNaming + +#if SILVERLIGHT || WINDOWS_PHONE || UWP || (GDI && DEBUG) +namespace PdfSharp.Pdf.Security +{ +#if UWP + class HashAlgorithm + { + public int HashSizeValue { get; set; } + + public virtual void Initialize() + { } + + protected virtual void HashCore(byte[] array, int ibStart, int cbSize) + { } + + protected virtual byte[] HashFinal() + { + return null; + } + + public byte[] HashValue { get; set; } + + public void TransformBlock(byte[] a, int b, int c, byte[] d, int e) + { } + + public void TransformFinalBlock(byte[] a, int b, int c) + { } + + public byte[] ComputeHash(byte[] a) + { + return null; + } + + public byte[] Hash + { + get { return null; } + } + } +#endif + /// + /// A managed implementation of the MD5 algorithm. + /// Necessary because MD5 is not part of the framework in Silverlight and WP. + /// + class MD5Managed + //#if !UWP + : HashAlgorithm // TODO: WinRT has not even a HashAlgorithm base class. + //#endif + { + // Intitial values as defined in RFC 1321. + const uint A = 0x67452301; + const uint B = 0xefcdab89; + const uint C = 0x98badcfe; + const uint D = 0x10325476; + + public MD5Managed() + { + HashSizeValue = 128; + Initialize(); + } + + public sealed override void Initialize() + { + _data = new byte[64]; + _dataSize = 0; + _totalLength = 0; + _abcd = new MD5Core.ABCDStruct(); + + // Intitial values as defined in RFC 1321. + _abcd.A = A; + _abcd.B = B; + _abcd.C = C; + _abcd.D = D; + } + + protected override void HashCore(byte[] array, int ibStart, int cbSize) + { + int startIndex = ibStart; + int totalArrayLength = _dataSize + cbSize; + if (totalArrayLength >= 64) + { + Array.Copy(array, startIndex, _data, _dataSize, 64 - _dataSize); + // Process message of 64 bytes (512 bits) + MD5Core.GetHashBlock(_data, ref _abcd, 0); + startIndex += 64 - _dataSize; + totalArrayLength -= 64; + while (totalArrayLength >= 64) + { + Array.Copy(array, startIndex, _data, 0, 64); + MD5Core.GetHashBlock(array, ref _abcd, startIndex); + totalArrayLength -= 64; + startIndex += 64; + } + _dataSize = totalArrayLength; + Array.Copy(array, startIndex, _data, 0, totalArrayLength); + } + else + { + Array.Copy(array, startIndex, _data, _dataSize, cbSize); + _dataSize = totalArrayLength; + } + _totalLength += cbSize; + } + + protected override byte[] HashFinal() + { + HashValue = MD5Core.GetHashFinalBlock(_data, 0, _dataSize, _abcd, _totalLength * 8); + return HashValue; + } + + byte[] _data; + MD5Core.ABCDStruct _abcd; + Int64 _totalLength; + int _dataSize; + + static class MD5Core + { +#if true + public static byte[] GetHash(byte[] input) + { + if (null == input) + throw new ArgumentNullException("input"); + + // Intitial values defined in RFC 1321. + ABCDStruct abcd = new ABCDStruct(); + abcd.A = A; + abcd.B = B; + abcd.C = C; + abcd.D = D; + + // We pass in the input array by block, the final block of data must be handled specially for padding & length embeding. + int startIndex = 0; + while (startIndex <= input.Length - 64) + { + GetHashBlock(input, ref abcd, startIndex); + startIndex += 64; + } + // The final data block. + return GetHashFinalBlock(input, startIndex, input.Length - startIndex, abcd, (Int64)input.Length * 8); + } +#endif + + internal static byte[] GetHashFinalBlock(byte[] input, int ibStart, int cbSize, ABCDStruct abcd, Int64 len) + { + byte[] working = new byte[64]; + byte[] length = BitConverter.GetBytes(len); + + // Padding is a single bit 1, followed by the number of 0s required to make size congruent to 448 modulo 512. Step 1 of RFC 1321 + // The CLR ensures that our buffer is 0-assigned, we don't need to explicitly set it. This is why it ends up being quicker to just + // use a temporary array rather then doing in-place assignment (5% for small inputs) + Array.Copy(input, ibStart, working, 0, cbSize); + working[cbSize] = 0x80; + + // We have enough room to store the length in this chunk. + if (cbSize <= 56) + { + Array.Copy(length, 0, working, 56, 8); + GetHashBlock(working, ref abcd, 0); + } + else // We need an aditional chunk to store the length. + { + GetHashBlock(working, ref abcd, 0); + // Create an entirely new chunk due to the 0-assigned trick mentioned above, to avoid an extra function call clearing the array. + working = new byte[64]; + Array.Copy(length, 0, working, 56, 8); + GetHashBlock(working, ref abcd, 0); + } + byte[] output = new byte[16]; + Array.Copy(BitConverter.GetBytes(abcd.A), 0, output, 0, 4); + Array.Copy(BitConverter.GetBytes(abcd.B), 0, output, 4, 4); + Array.Copy(BitConverter.GetBytes(abcd.C), 0, output, 8, 4); + Array.Copy(BitConverter.GetBytes(abcd.D), 0, output, 12, 4); + return output; + } + + internal static void GetHashBlock(byte[] input, ref ABCDStruct ABCDValue, int ibStart) + { + uint[] temp = Converter(input, ibStart); + uint a = ABCDValue.A; + uint b = ABCDValue.B; + uint c = ABCDValue.C; + uint d = ABCDValue.D; + + a = r1(a, b, c, d, temp[0], 7, 0xd76aa478); + d = r1(d, a, b, c, temp[1], 12, 0xe8c7b756); + c = r1(c, d, a, b, temp[2], 17, 0x242070db); + b = r1(b, c, d, a, temp[3], 22, 0xc1bdceee); + a = r1(a, b, c, d, temp[4], 7, 0xf57c0faf); + d = r1(d, a, b, c, temp[5], 12, 0x4787c62a); + c = r1(c, d, a, b, temp[6], 17, 0xa8304613); + b = r1(b, c, d, a, temp[7], 22, 0xfd469501); + a = r1(a, b, c, d, temp[8], 7, 0x698098d8); + d = r1(d, a, b, c, temp[9], 12, 0x8b44f7af); + c = r1(c, d, a, b, temp[10], 17, 0xffff5bb1); + b = r1(b, c, d, a, temp[11], 22, 0x895cd7be); + a = r1(a, b, c, d, temp[12], 7, 0x6b901122); + d = r1(d, a, b, c, temp[13], 12, 0xfd987193); + c = r1(c, d, a, b, temp[14], 17, 0xa679438e); + b = r1(b, c, d, a, temp[15], 22, 0x49b40821); + + a = r2(a, b, c, d, temp[1], 5, 0xf61e2562); + d = r2(d, a, b, c, temp[6], 9, 0xc040b340); + c = r2(c, d, a, b, temp[11], 14, 0x265e5a51); + b = r2(b, c, d, a, temp[0], 20, 0xe9b6c7aa); + a = r2(a, b, c, d, temp[5], 5, 0xd62f105d); + d = r2(d, a, b, c, temp[10], 9, 0x02441453); + c = r2(c, d, a, b, temp[15], 14, 0xd8a1e681); + b = r2(b, c, d, a, temp[4], 20, 0xe7d3fbc8); + a = r2(a, b, c, d, temp[9], 5, 0x21e1cde6); + d = r2(d, a, b, c, temp[14], 9, 0xc33707d6); + c = r2(c, d, a, b, temp[3], 14, 0xf4d50d87); + b = r2(b, c, d, a, temp[8], 20, 0x455a14ed); + a = r2(a, b, c, d, temp[13], 5, 0xa9e3e905); + d = r2(d, a, b, c, temp[2], 9, 0xfcefa3f8); + c = r2(c, d, a, b, temp[7], 14, 0x676f02d9); + b = r2(b, c, d, a, temp[12], 20, 0x8d2a4c8a); + + a = r3(a, b, c, d, temp[5], 4, 0xfffa3942); + d = r3(d, a, b, c, temp[8], 11, 0x8771f681); + c = r3(c, d, a, b, temp[11], 16, 0x6d9d6122); + b = r3(b, c, d, a, temp[14], 23, 0xfde5380c); + a = r3(a, b, c, d, temp[1], 4, 0xa4beea44); + d = r3(d, a, b, c, temp[4], 11, 0x4bdecfa9); + c = r3(c, d, a, b, temp[7], 16, 0xf6bb4b60); + b = r3(b, c, d, a, temp[10], 23, 0xbebfbc70); + a = r3(a, b, c, d, temp[13], 4, 0x289b7ec6); + d = r3(d, a, b, c, temp[0], 11, 0xeaa127fa); + c = r3(c, d, a, b, temp[3], 16, 0xd4ef3085); + b = r3(b, c, d, a, temp[6], 23, 0x04881d05); + a = r3(a, b, c, d, temp[9], 4, 0xd9d4d039); + d = r3(d, a, b, c, temp[12], 11, 0xe6db99e5); + c = r3(c, d, a, b, temp[15], 16, 0x1fa27cf8); + b = r3(b, c, d, a, temp[2], 23, 0xc4ac5665); + + a = r4(a, b, c, d, temp[0], 6, 0xf4292244); + d = r4(d, a, b, c, temp[7], 10, 0x432aff97); + c = r4(c, d, a, b, temp[14], 15, 0xab9423a7); + b = r4(b, c, d, a, temp[5], 21, 0xfc93a039); + a = r4(a, b, c, d, temp[12], 6, 0x655b59c3); + d = r4(d, a, b, c, temp[3], 10, 0x8f0ccc92); + c = r4(c, d, a, b, temp[10], 15, 0xffeff47d); + b = r4(b, c, d, a, temp[1], 21, 0x85845dd1); + a = r4(a, b, c, d, temp[8], 6, 0x6fa87e4f); + d = r4(d, a, b, c, temp[15], 10, 0xfe2ce6e0); + c = r4(c, d, a, b, temp[6], 15, 0xa3014314); + b = r4(b, c, d, a, temp[13], 21, 0x4e0811a1); + a = r4(a, b, c, d, temp[4], 6, 0xf7537e82); + d = r4(d, a, b, c, temp[11], 10, 0xbd3af235); + c = r4(c, d, a, b, temp[2], 15, 0x2ad7d2bb); + b = r4(b, c, d, a, temp[9], 21, 0xeb86d391); + + ABCDValue.A = unchecked(a + ABCDValue.A); + ABCDValue.B = unchecked(b + ABCDValue.B); + ABCDValue.C = unchecked(c + ABCDValue.C); + ABCDValue.D = unchecked(d + ABCDValue.D); + } + + // Manually unrolling these equations nets us a 20% performance improvement + private static uint r1(uint a, uint b, uint c, uint d, uint x, int s, uint t) + { + // (b + LSR((a + F(b, c, d) + x + t), s)) + // F(x, y, z) ((x & y) | ((x ^ 0xFFFFFFFF) & z)) + return unchecked(b + LSR((a + ((b & c) | ((b ^ 0xFFFFFFFF) & d)) + x + t), s)); + } + + private static uint r2(uint a, uint b, uint c, uint d, uint x, int s, uint t) + { + // (b + LSR((a + G(b, c, d) + x + t), s)) + // G(x, y, z) ((x & z) | (y & (z ^ 0xFFFFFFFF))) + return unchecked(b + LSR((a + ((b & d) | (c & (d ^ 0xFFFFFFFF))) + x + t), s)); + } + + private static uint r3(uint a, uint b, uint c, uint d, uint x, int s, uint t) + { + // (b + LSR((a + H(b, c, d) + k + i), s)) + // H(x, y, z) (x ^ y ^ z) + return unchecked(b + LSR((a + (b ^ c ^ d) + x + t), s)); + } + + private static uint r4(uint a, uint b, uint c, uint d, uint x, int s, uint t) + { + // (b + LSR((a + I(b, c, d) + k + i), s)) + // I(x, y, z) (y ^ (x | (z ^ 0xFFFFFFFF))) + return unchecked(b + LSR((a + (c ^ (b | (d ^ 0xFFFFFFFF))) + x + t), s)); + } + + // Implementation of left rotate + // s is an int instead of a uint becuase the CLR requires the argument passed to >>/<< is of + // type int. Doing the demoting inside this function would add overhead. + private static uint LSR(uint i, int s) + { + return (i << s) | (i >> (32 - s)); + } + + // Convert input array into array of UInts. + static uint[] Converter(byte[] input, int ibStart) + { + if (null == input) + throw new ArgumentNullException("input"); + + uint[] result = new uint[16]; + for (int idx = 0; idx < 16; idx++) + { + result[idx] = (uint)input[ibStart + idx * 4]; + result[idx] += (uint)input[ibStart + idx * 4 + 1] << 8; + result[idx] += (uint)input[ibStart + idx * 4 + 2] << 16; + result[idx] += (uint)input[ibStart + idx * 4 + 3] << 24; + + Debug.Assert(result[idx] == + (input[ibStart + idx * 4]) + + ((uint)input[ibStart + idx * 4 + 1] << 8) + + ((uint)input[ibStart + idx * 4 + 2] << 16) + + ((uint)input[ibStart + idx * 4 + 3] << 24)); + } + return result; + } + + // Simple struct for the (a,b,c,d) which is used to compute the mesage digest. + public struct ABCDStruct + { + public uint A; + public uint B; + public uint C; + public uint D; + } + } + } + +#if GDI && DEBUG && true_ + + // See here for details: http://archive.msdn.microsoft.com/SilverlightMD5/WorkItem/View.aspx?WorkItemId=3 + + public static class TestMD5 + { + public static void Test() + { + Random rnd = new Random(); + for (int i = 0; i < 10000; i++) + { + int count = rnd.Next(1000) + 1; + Console.WriteLine(String.Format("{0}: {1}", i, count)); + Test2(count); + } + } + + static void Test2(int count) + { + byte[] bytes = new byte[count]; + + for (int idx = 0; idx < count; idx += 16) + Array.Copy(Guid.NewGuid().ToByteArray(), 0, bytes, idx, Math.Min(16, count - idx)); + + MD5 md5dotNet = new MD5CryptoServiceProvider(); + md5dotNet.Initialize(); + MD5Managed md5m = new MD5Managed(); + md5m.Initialize(); + + byte[] result1 = md5dotNet.ComputeHash(bytes); + byte[] result2 = md5m.ComputeHash(bytes); + + if (!CompareBytes(result1, result2)) + { + count.GetType(); + //throw new Exception("Bug in MD5Managed..."); + } + } + + static bool CompareBytes(byte[] bytes1, byte[] bytes2) + { + for (int idx = 0; idx < bytes1.Length; idx++) + { + if (bytes1[idx] != bytes2[idx]) + return false; + } + return true; + } + } +#endif +} +#endif \ No newline at end of file diff --git a/PdfSharp/Pdf.Security/PdfSecurityHandler.cs b/PdfSharp/Pdf.Security/PdfSecurityHandler.cs new file mode 100644 index 0000000..e3f930b --- /dev/null +++ b/PdfSharp/Pdf.Security/PdfSecurityHandler.cs @@ -0,0 +1,137 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// ReSharper disable InconsistentNaming + +namespace PdfSharp.Pdf.Security +{ + /// + /// Represents the base of all security handlers. + /// + public abstract class PdfSecurityHandler : PdfDictionary + { + internal PdfSecurityHandler(PdfDocument document) + : base(document) + { } + + internal PdfSecurityHandler(PdfDictionary dict) + : base(dict) + { } + + /// + /// Predefined keys of this dictionary. + /// + internal class Keys : KeysBase + { + /// + /// (Required) The name of the preferred security handler for this document. Typically, + /// it is the name of the security handler that was used to encrypt the document. If + /// SubFilter is not present, only this security handler should be used when opening + /// the document. If it is present, consumer applications can use any security handler + /// that implements the format specified by SubFilter. + /// Standard is the name of the built-in password-based security handler. Names for other + /// security handlers can be registered by using the procedure described in Appendix E. + /// + [KeyInfo(KeyType.Name | KeyType.Required)] + public const string Filter = "/Filter"; + + /// + /// (Optional; PDF 1.3) A name that completely specifies the format and interpretation of + /// the contents of the encryption dictionary. It is needed to allow security handlers other + /// than the one specified by Filter to decrypt the document. If this entry is absent, other + /// security handlers should not be allowed to decrypt the document. + /// + [KeyInfo("1.3", KeyType.Name | KeyType.Optional)] + public const string SubFilter = "/SubFilter"; + + /// + /// (Optional but strongly recommended) A code specifying the algorithm to be used in encrypting + /// and decrypting the document: + /// 0 An algorithm that is undocumented and no longer supported, and whose use is strongly discouraged. + /// 1 Algorithm 3.1, with an encryption key length of 40 bits. + /// 2 (PDF 1.4) Algorithm 3.1, but permitting encryption key lengths greater than 40 bits. + /// 3 (PDF 1.4) An unpublished algorithm that permits encryption key lengths ranging from 40 to 128 bits. + /// 4 (PDF 1.5) The security handler defines the use of encryption and decryption in the document, using + /// the rules specified by the CF, StmF, and StrF entries. + /// The default value if this entry is omitted is 0, but a value of 1 or greater is strongly recommended. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string V = "/V"; + + /// + /// (Optional; PDF 1.4; only if V is 2 or 3) The length of the encryption key, in bits. + /// The value must be a multiple of 8, in the range 40 to 128. Default value: 40. + /// + [KeyInfo("1.4", KeyType.Integer | KeyType.Optional)] + public const string Length = "/Length"; + + /// + /// (Optional; meaningful only when the value of V is 4; PDF 1.5) + /// A dictionary whose keys are crypt filter names and whose values are the corresponding + /// crypt filter dictionaries. Every crypt filter used in the document must have an entry + /// in this dictionary, except for the standard crypt filter names. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional)] + public const string CF = "/CF"; + + /// + /// (Optional; meaningful only when the value of V is 4; PDF 1.5) + /// The name of the crypt filter that is used by default when decrypting streams. + /// The name must be a key in the CF dictionary or a standard crypt filter name. All streams + /// in the document, except for cross-reference streams or streams that have a Crypt entry in + /// their Filter array, are decrypted by the security handler, using this crypt filter. + /// Default value: Identity. + /// + [KeyInfo("1.5", KeyType.Name | KeyType.Optional)] + public const string StmF = "/StmF"; + + /// + /// (Optional; meaningful only when the value of V is 4; PDF 1.) + /// The name of the crypt filter that is used when decrypting all strings in the document. + /// The name must be a key in the CF dictionary or a standard crypt filter name. + /// Default value: Identity. + /// + [KeyInfo("1.5", KeyType.Name | KeyType.Optional)] + public const string StrF = "/StrF"; + + /// + /// (Optional; meaningful only when the value of V is 4; PDF 1.6) + /// The name of the crypt filter that should be used by default when encrypting embedded + /// file streams; it must correspond to a key in the CF dictionary or a standard crypt + /// filter name. This entry is provided by the security handler. Applications should respect + /// this value when encrypting embedded files, except for embedded file streams that have + /// their own crypt filter specifier. If this entry is not present, and the embedded file + /// stream does not contain a crypt filter specifier, the stream should be encrypted using + /// the default stream crypt filter specified by StmF. + /// + [KeyInfo("1.6", KeyType.Name | KeyType.Optional)] + public const string EFF = "/EFF"; + } + } +} diff --git a/PdfSharp/Pdf.Security/PdfSecuritySettings.cs b/PdfSharp/Pdf.Security/PdfSecuritySettings.cs new file mode 100644 index 0000000..4e1cf54 --- /dev/null +++ b/PdfSharp/Pdf.Security/PdfSecuritySettings.cs @@ -0,0 +1,253 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.Security +{ + /// + /// Encapsulates access to the security settings of a PDF document. + /// + public sealed class PdfSecuritySettings + { + internal PdfSecuritySettings(PdfDocument document) + { + _document = document; + } + readonly PdfDocument _document; + + /// + /// Indicates whether the granted access to the document is 'owner permission'. Returns true if the document + /// is unprotected or was opened with the owner password. Returns false if the document was opened with the + /// user password. + /// + public bool HasOwnerPermissions + { + get { return _hasOwnerPermissions; } + } + internal bool _hasOwnerPermissions = true; + + /// + /// Gets or sets the document security level. If you set the security level to anything but PdfDocumentSecurityLevel.None + /// you must also set a user and/or an owner password. Otherwise saving the document will fail. + /// + public PdfDocumentSecurityLevel DocumentSecurityLevel + { + get { return _documentSecurityLevel; } + set { _documentSecurityLevel = value; } + } + PdfDocumentSecurityLevel _documentSecurityLevel; + + /// + /// Sets the user password of the document. Setting a password automatically sets the + /// PdfDocumentSecurityLevel to PdfDocumentSecurityLevel.Encrypted128Bit if its current + /// value is PdfDocumentSecurityLevel.None. + /// + public string UserPassword + { + set { SecurityHandler.UserPassword = value; } + } + + /// + /// Sets the owner password of the document. Setting a password automatically sets the + /// PdfDocumentSecurityLevel to PdfDocumentSecurityLevel.Encrypted128Bit if its current + /// value is PdfDocumentSecurityLevel.None. + /// + public string OwnerPassword + { + set { SecurityHandler.OwnerPassword = value; } + } + + /// + /// Determines whether the document can be saved. + /// + internal bool CanSave(ref string message) + { + if (_documentSecurityLevel != PdfDocumentSecurityLevel.None) + { + if (String.IsNullOrEmpty(SecurityHandler._userPassword) && String.IsNullOrEmpty(SecurityHandler._ownerPassword)) + { + message = PSSR.UserOrOwnerPasswordRequired; + return false; + } + } + return true; + } + + #region Permissions + //TODO: Use documentation from our English Acrobat 6.0 version. + + /// + /// Permits printing the document. Should be used in conjunction with PermitFullQualityPrint. + /// + public bool PermitPrint + { + get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitPrint) != 0; } + set + { + PdfUserAccessPermission permission = SecurityHandler.Permission; + if (value) + permission |= PdfUserAccessPermission.PermitPrint; + else + permission &= ~PdfUserAccessPermission.PermitPrint; + SecurityHandler.Permission = permission; + } + } + + /// + /// Permits modifying the document. + /// + public bool PermitModifyDocument + { + get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitModifyDocument) != 0; } + set + { + PdfUserAccessPermission permission = SecurityHandler.Permission; + if (value) + permission |= PdfUserAccessPermission.PermitModifyDocument; + else + permission &= ~PdfUserAccessPermission.PermitModifyDocument; + SecurityHandler.Permission = permission; + } + } + + /// + /// Permits content copying or extraction. + /// + public bool PermitExtractContent + { + get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitExtractContent) != 0; } + set + { + PdfUserAccessPermission permission = SecurityHandler.Permission; + if (value) + permission |= PdfUserAccessPermission.PermitExtractContent; + else + permission &= ~PdfUserAccessPermission.PermitExtractContent; + SecurityHandler.Permission = permission; + } + } + + /// + /// Permits commenting the document. + /// + public bool PermitAnnotations + { + get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitAnnotations) != 0; } + set + { + PdfUserAccessPermission permission = SecurityHandler.Permission; + if (value) + permission |= PdfUserAccessPermission.PermitAnnotations; + else + permission &= ~PdfUserAccessPermission.PermitAnnotations; + SecurityHandler.Permission = permission; + } + } + + /// + /// Permits filling of form fields. + /// + public bool PermitFormsFill + { + get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitFormsFill) != 0; } + set + { + PdfUserAccessPermission permission = SecurityHandler.Permission; + if (value) + permission |= PdfUserAccessPermission.PermitFormsFill; + else + permission &= ~PdfUserAccessPermission.PermitFormsFill; + SecurityHandler.Permission = permission; + } + } + + /// + /// Permits content extraction for accessibility. + /// + public bool PermitAccessibilityExtractContent + { + get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitAccessibilityExtractContent) != 0; } + set + { + PdfUserAccessPermission permission = SecurityHandler.Permission; + if (value) + permission |= PdfUserAccessPermission.PermitAccessibilityExtractContent; + else + permission &= ~PdfUserAccessPermission.PermitAccessibilityExtractContent; + SecurityHandler.Permission = permission; + } + } + + /// + /// Permits to insert, rotate, or delete pages and create bookmarks or thumbnail images even if + /// PermitModifyDocument is not set. + /// + public bool PermitAssembleDocument + { + get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitAssembleDocument) != 0; } + set + { + PdfUserAccessPermission permission = SecurityHandler.Permission; + if (value) + permission |= PdfUserAccessPermission.PermitAssembleDocument; + else + permission &= ~PdfUserAccessPermission.PermitAssembleDocument; + SecurityHandler.Permission = permission; + } + } + + /// + /// Permits to print in high quality. insert, rotate, or delete pages and create bookmarks or thumbnail images + /// even if PermitModifyDocument is not set. + /// + public bool PermitFullQualityPrint + { + get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitFullQualityPrint) != 0; } + set + { + PdfUserAccessPermission permission = SecurityHandler.Permission; + if (value) + permission |= PdfUserAccessPermission.PermitFullQualityPrint; + else + permission &= ~PdfUserAccessPermission.PermitFullQualityPrint; + SecurityHandler.Permission = permission; + } + } + #endregion + + /// + /// PdfStandardSecurityHandler is the only implemented handler. + /// + internal PdfStandardSecurityHandler SecurityHandler + { + get { return _document._trailer.SecurityHandler; } + } + } +} diff --git a/PdfSharp/Pdf.Security/PdfStandardSecurityHandler.cs b/PdfSharp/Pdf.Security/PdfStandardSecurityHandler.cs new file mode 100644 index 0000000..bdce51f --- /dev/null +++ b/PdfSharp/Pdf.Security/PdfStandardSecurityHandler.cs @@ -0,0 +1,737 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using PdfSharp.Pdf; +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.Internal; +#if !NETFX_CORE && !UWP +using System.Security.Cryptography; +#endif + +#pragma warning disable 0169 +#pragma warning disable 0649 + +namespace PdfSharp.Pdf.Security +{ + /// + /// Represents the standard PDF security handler. + /// + public sealed class PdfStandardSecurityHandler : PdfSecurityHandler + { + internal PdfStandardSecurityHandler(PdfDocument document) + : base(document) + { } + + internal PdfStandardSecurityHandler(PdfDictionary dict) + : base(dict) + { } + + /// + /// Sets the user password of the document. Setting a password automatically sets the + /// PdfDocumentSecurityLevel to PdfDocumentSecurityLevel.Encrypted128Bit if its current + /// value is PdfDocumentSecurityLevel.None. + /// + public string UserPassword + { + set + { + if (_document._securitySettings.DocumentSecurityLevel == PdfDocumentSecurityLevel.None) + _document._securitySettings.DocumentSecurityLevel = PdfDocumentSecurityLevel.Encrypted128Bit; + _userPassword = value; + } + } + internal string _userPassword; + + /// + /// Sets the owner password of the document. Setting a password automatically sets the + /// PdfDocumentSecurityLevel to PdfDocumentSecurityLevel.Encrypted128Bit if its current + /// value is PdfDocumentSecurityLevel.None. + /// + public string OwnerPassword + { + set + { + if (_document._securitySettings.DocumentSecurityLevel == PdfDocumentSecurityLevel.None) + _document._securitySettings.DocumentSecurityLevel = PdfDocumentSecurityLevel.Encrypted128Bit; + _ownerPassword = value; + } + } + internal string _ownerPassword; + + /// + /// Gets or sets the user access permission represented as an integer in the P key. + /// + internal PdfUserAccessPermission Permission + { + get + { + PdfUserAccessPermission permission = (PdfUserAccessPermission)Elements.GetInteger(Keys.P); + if ((int)permission == 0) + permission = PdfUserAccessPermission.PermitAll; + return permission; + } + set { Elements.SetInteger(Keys.P, (int)value); } + } + + /// + /// Encrypts the whole document. + /// + public void EncryptDocument() + { + foreach (PdfReference iref in _document._irefTable.AllReferences) + { + if (!ReferenceEquals(iref.Value, this)) + EncryptObject(iref.Value); + } + } + + /// + /// Encrypts an indirect object. + /// + internal void EncryptObject(PdfObject value) + { + Debug.Assert(value.Reference != null); + + SetHashKey(value.ObjectID); +#if DEBUG + if (value.ObjectID.ObjectNumber == 10) + GetType(); +#endif + + PdfDictionary dict; + PdfArray array; + PdfStringObject str; + if ((dict = value as PdfDictionary) != null) + EncryptDictionary(dict); + else if ((array = value as PdfArray) != null) + EncryptArray(array); + else if ((str = value as PdfStringObject) != null) + { + if (str.Length != 0) + { + byte[] bytes = str.EncryptionValue; + PrepareKey(); + EncryptRC4(bytes); + str.EncryptionValue = bytes; + } + } + } + + /// + /// Encrypts a dictionary. + /// + void EncryptDictionary(PdfDictionary dict) + { + PdfName[] names = dict.Elements.KeyNames; + foreach (KeyValuePair item in dict.Elements) + { + PdfString value1; + PdfDictionary value2; + PdfArray value3; + if ((value1 = item.Value as PdfString) != null) + EncryptString(value1); + else if ((value2 = item.Value as PdfDictionary) != null) + EncryptDictionary(value2); + else if ((value3 = item.Value as PdfArray) != null) + EncryptArray(value3); + } + if (dict.Stream != null) + { + byte[] bytes = dict.Stream.Value; + if (bytes.Length != 0) + { + PrepareKey(); + EncryptRC4(bytes); + dict.Stream.Value = bytes; + } + } + } + + /// + /// Encrypts an array. + /// + void EncryptArray(PdfArray array) + { + int count = array.Elements.Count; + for (int idx = 0; idx < count; idx++) + { + PdfItem item = array.Elements[idx]; + PdfString value1; + PdfDictionary value2; + PdfArray value3; + if ((value1 = item as PdfString) != null) + EncryptString(value1); + else if ((value2 = item as PdfDictionary) != null) + EncryptDictionary(value2); + else if ((value3 = item as PdfArray) != null) + EncryptArray(value3); + } + } + + /// + /// Encrypts a string. + /// + void EncryptString(PdfString value) + { + if (value.Length != 0) + { + byte[] bytes = value.EncryptionValue; + PrepareKey(); + EncryptRC4(bytes); + value.EncryptionValue = bytes; + } + } + + /// + /// Encrypts an array. + /// + internal byte[] EncryptBytes(byte[] bytes) + { + if (bytes != null && bytes.Length != 0) + { + PrepareKey(); + EncryptRC4(bytes); + } + return bytes; + } + + #region Encryption Algorithms + + /// + /// Checks the password. + /// + /// Password or null if no password is provided. + public PasswordValidity ValidatePassword(string inputPassword) + { + // We can handle 40 and 128 bit standard encryption. + string filter = Elements.GetName(PdfSecurityHandler.Keys.Filter); + int v = Elements.GetInteger(PdfSecurityHandler.Keys.V); + if (filter != "/Standard" || !(v >= 1 && v <= 3)) + throw new PdfReaderException(PSSR.UnknownEncryption); + + byte[] documentID = PdfEncoders.RawEncoding.GetBytes(Owner.Internals.FirstDocumentID); + byte[] oValue = PdfEncoders.RawEncoding.GetBytes(Elements.GetString(Keys.O)); + byte[] uValue = PdfEncoders.RawEncoding.GetBytes(Elements.GetString(Keys.U)); + int pValue = Elements.GetInteger(Keys.P); + int rValue = Elements.GetInteger(Keys.R); + + if (inputPassword == null) + inputPassword = ""; + + bool strongEncryption = rValue == 3; + int keyLength = strongEncryption ? 16 : 32; + + // Try owner password first. + //byte[] password = PdfEncoders.RawEncoding.GetBytes(inputPassword); + InitWithOwnerPassword(documentID, inputPassword, oValue, pValue, strongEncryption); + if (EqualsKey(uValue, keyLength)) + { + _document.SecuritySettings._hasOwnerPermissions = true; + return PasswordValidity.OwnerPassword; + } + _document.SecuritySettings._hasOwnerPermissions = false; + + // Now try user password. + //password = PdfEncoders.RawEncoding.GetBytes(inputPassword); + InitWithUserPassword(documentID, inputPassword, oValue, pValue, strongEncryption); + if (EqualsKey(uValue, keyLength)) + return PasswordValidity.UserPassword; + return PasswordValidity.Invalid; + } + + [Conditional("DEBUG")] + static void DumpBytes(string tag, byte[] bytes) + { + string dump = tag + ": "; + for (int idx = 0; idx < bytes.Length; idx++) + dump += String.Format("{0:X2}", bytes[idx]); + Debug.WriteLine(dump); + } + + /// + /// Pads a password to a 32 byte array. + /// + static byte[] PadPassword(string password) + { + byte[] padded = new byte[32]; + if (password == null) + Array.Copy(PasswordPadding, 0, padded, 0, 32); + else + { + int length = password.Length; + Array.Copy(PdfEncoders.RawEncoding.GetBytes(password), 0, padded, 0, Math.Min(length, 32)); + if (length < 32) + Array.Copy(PasswordPadding, 0, padded, length, 32 - length); + } + return padded; + } + static readonly byte[] PasswordPadding = // 32 bytes password padding defined by Adobe + { + 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08, + 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A, + }; + + /// + /// Generates the user key based on the padded user password. + /// + void InitWithUserPassword(byte[] documentID, string userPassword, byte[] ownerKey, int permissions, bool strongEncryption) + { + InitEncryptionKey(documentID, PadPassword(userPassword), ownerKey, permissions, strongEncryption); + SetupUserKey(documentID); + } + + /// + /// Generates the user key based on the padded owner password. + /// + void InitWithOwnerPassword(byte[] documentID, string ownerPassword, byte[] ownerKey, int permissions, bool strongEncryption) + { + byte[] userPad = ComputeOwnerKey(ownerKey, PadPassword(ownerPassword), strongEncryption); + InitEncryptionKey(documentID, userPad, ownerKey, permissions, strongEncryption); + SetupUserKey(documentID); + } + + /// + /// Computes the padded user password from the padded owner password. + /// + byte[] ComputeOwnerKey(byte[] userPad, byte[] ownerPad, bool strongEncryption) + { + byte[] ownerKey = new byte[32]; + //#if !SILVERLIGHT + byte[] digest = _md5.ComputeHash(ownerPad); + if (strongEncryption) + { + byte[] mkey = new byte[16]; + // Hash the pad 50 times + for (int idx = 0; idx < 50; idx++) + digest = _md5.ComputeHash(digest); + Array.Copy(userPad, 0, ownerKey, 0, 32); + // Encrypt the key + for (int i = 0; i < 20; i++) + { + for (int j = 0; j < mkey.Length; ++j) + mkey[j] = (byte)(digest[j] ^ i); + PrepareRC4Key(mkey); + EncryptRC4(ownerKey); + } + } + else + { + PrepareRC4Key(digest, 0, 5); + EncryptRC4(userPad, ownerKey); + } + //#endif + return ownerKey; + } + + /// + /// Computes the encryption key. + /// + void InitEncryptionKey(byte[] documentID, byte[] userPad, byte[] ownerKey, int permissions, bool strongEncryption) + { + //#if !SILVERLIGHT + _ownerKey = ownerKey; + _encryptionKey = new byte[strongEncryption ? 16 : 5]; + +#if !NETFX_CORE + _md5.Initialize(); + _md5.TransformBlock(userPad, 0, userPad.Length, userPad, 0); + _md5.TransformBlock(ownerKey, 0, ownerKey.Length, ownerKey, 0); + + // Split permission into 4 bytes + byte[] permission = new byte[4]; + permission[0] = (byte)permissions; + permission[1] = (byte)(permissions >> 8); + permission[2] = (byte)(permissions >> 16); + permission[3] = (byte)(permissions >> 24); + _md5.TransformBlock(permission, 0, 4, permission, 0); + _md5.TransformBlock(documentID, 0, documentID.Length, documentID, 0); + _md5.TransformFinalBlock(permission, 0, 0); + byte[] digest = _md5.Hash; + _md5.Initialize(); + // Create the hash 50 times (only for 128 bit) + if (_encryptionKey.Length == 16) + { + for (int idx = 0; idx < 50; idx++) + { + digest = _md5.ComputeHash(digest); + _md5.Initialize(); + } + } + Array.Copy(digest, 0, _encryptionKey, 0, _encryptionKey.Length); + //#endif +#endif + } + + /// + /// Computes the user key. + /// + void SetupUserKey(byte[] documentID) + { +#if !NETFX_CORE + //#if !SILVERLIGHT + if (_encryptionKey.Length == 16) + { + _md5.TransformBlock(PasswordPadding, 0, PasswordPadding.Length, PasswordPadding, 0); + _md5.TransformFinalBlock(documentID, 0, documentID.Length); + byte[] digest = _md5.Hash; + _md5.Initialize(); + Array.Copy(digest, 0, _userKey, 0, 16); + for (int idx = 16; idx < 32; idx++) + _userKey[idx] = 0; + //Encrypt the key + for (int i = 0; i < 20; i++) + { + for (int j = 0; j < _encryptionKey.Length; j++) + digest[j] = (byte)(_encryptionKey[j] ^ i); + PrepareRC4Key(digest, 0, _encryptionKey.Length); + EncryptRC4(_userKey, 0, 16); + } + } + else + { + PrepareRC4Key(_encryptionKey); + EncryptRC4(PasswordPadding, _userKey); + } + //#endif +#endif + } + + /// + /// Prepare the encryption key. + /// + void PrepareKey() + { + if (_key != null && _keySize > 0) //!!!mod 2017-11-06 Added "if" because PrepareRC4Key fails if _key is null. But _key appears to be always null, so maybe PrepareKey() is obsolete. + PrepareRC4Key(_key, 0, _keySize); + } + + /// + /// Prepare the encryption key. + /// + void PrepareRC4Key(byte[] key) + { + PrepareRC4Key(key, 0, key.Length); + } + + /// + /// Prepare the encryption key. + /// + void PrepareRC4Key(byte[] key, int offset, int length) + { + int idx1 = 0; + int idx2 = 0; + for (int idx = 0; idx < 256; idx++) + _state[idx] = (byte)idx; + byte tmp; + for (int idx = 0; idx < 256; idx++) + { + idx2 = (key[idx1 + offset] + _state[idx] + idx2) & 255; + tmp = _state[idx]; + _state[idx] = _state[idx2]; + _state[idx2] = tmp; + idx1 = (idx1 + 1) % length; + } + } + + /// + /// Encrypts the data. + /// + // ReSharper disable InconsistentNaming + void EncryptRC4(byte[] data) + // ReSharper restore InconsistentNaming + { + EncryptRC4(data, 0, data.Length, data); + } + + /// + /// Encrypts the data. + /// + // ReSharper disable InconsistentNaming + void EncryptRC4(byte[] data, int offset, int length) + // ReSharper restore InconsistentNaming + { + EncryptRC4(data, offset, length, data); + } + + /// + /// Encrypts the data. + /// + void EncryptRC4(byte[] inputData, byte[] outputData) + { + EncryptRC4(inputData, 0, inputData.Length, outputData); + } + + /// + /// Encrypts the data. + /// + void EncryptRC4(byte[] inputData, int offset, int length, byte[] outputData) + { + length += offset; + int x = 0, y = 0; + byte b; + for (int idx = offset; idx < length; idx++) + { + x = (x + 1) & 255; + y = (_state[x] + y) & 255; + b = _state[x]; + _state[x] = _state[y]; + _state[y] = b; + outputData[idx] = (byte)(inputData[idx] ^ _state[(_state[x] + _state[y]) & 255]); + } + } + + /// + /// Checks whether the calculated key correct. + /// + bool EqualsKey(byte[] value, int length) + { + for (int idx = 0; idx < length; idx++) + { + if (_userKey[idx] != value[idx]) + return false; + } + return true; + } + + /// + /// Set the hash key for the specified object. + /// + internal void SetHashKey(PdfObjectID id) + { +#if !NETFX_CORE + //#if !SILVERLIGHT + byte[] objectId = new byte[5]; + _md5.Initialize(); + // Split the object number and generation + objectId[0] = (byte)id.ObjectNumber; + objectId[1] = (byte)(id.ObjectNumber >> 8); + objectId[2] = (byte)(id.ObjectNumber >> 16); + objectId[3] = (byte)id.GenerationNumber; + objectId[4] = (byte)(id.GenerationNumber >> 8); + _md5.TransformBlock(_encryptionKey, 0, _encryptionKey.Length, _encryptionKey, 0); + _md5.TransformFinalBlock(objectId, 0, objectId.Length); + _key = _md5.Hash; + _md5.Initialize(); + _keySize = _encryptionKey.Length + 5; + if (_keySize > 16) + _keySize = 16; + //#endif +#endif + } + + /// + /// Prepares the security handler for encrypting the document. + /// + public void PrepareEncryption() + { + //#if !SILVERLIGHT + Debug.Assert(_document._securitySettings.DocumentSecurityLevel != PdfDocumentSecurityLevel.None); + int permissions = (int)Permission; + bool strongEncryption = _document._securitySettings.DocumentSecurityLevel == PdfDocumentSecurityLevel.Encrypted128Bit; + + PdfInteger vValue; + PdfInteger length; + PdfInteger rValue; + + if (strongEncryption) + { + vValue = new PdfInteger(2); + length = new PdfInteger(128); + rValue = new PdfInteger(3); + } + else + { + vValue = new PdfInteger(1); + length = new PdfInteger(40); + rValue = new PdfInteger(2); + } + + if (String.IsNullOrEmpty(_userPassword)) + _userPassword = ""; + // Use user password twice if no owner password provided. + if (String.IsNullOrEmpty(_ownerPassword)) + _ownerPassword = _userPassword; + + // Correct permission bits + permissions |= (int)(strongEncryption ? (uint)0xfffff0c0 : (uint)0xffffffc0); + permissions &= unchecked((int)0xfffffffc); + + PdfInteger pValue = new PdfInteger(permissions); + + Debug.Assert(_ownerPassword.Length > 0, "Empty owner password."); + byte[] userPad = PadPassword(_userPassword); + byte[] ownerPad = PadPassword(_ownerPassword); + + _md5.Initialize(); + _ownerKey = ComputeOwnerKey(userPad, ownerPad, strongEncryption); + byte[] documentID = PdfEncoders.RawEncoding.GetBytes(_document.Internals.FirstDocumentID); + InitWithUserPassword(documentID, _userPassword, _ownerKey, permissions, strongEncryption); + + PdfString oValue = new PdfString(PdfEncoders.RawEncoding.GetString(_ownerKey, 0, _ownerKey.Length)); + PdfString uValue = new PdfString(PdfEncoders.RawEncoding.GetString(_userKey, 0, _userKey.Length)); + + Elements[Keys.Filter] = new PdfName("/Standard"); + Elements[Keys.V] = vValue; + Elements[Keys.Length] = length; + Elements[Keys.R] = rValue; + Elements[Keys.O] = oValue; + Elements[Keys.U] = uValue; + Elements[Keys.P] = pValue; + //#endif + } + + /// + /// The global encryption key. + /// + byte[] _encryptionKey; + +#if !SILVERLIGHT && !UWP + /// + /// The message digest algorithm MD5. + /// + readonly MD5 _md5 = new MD5CryptoServiceProvider(); +#if DEBUG_ + readonly MD5Managed _md5M = new MD5Managed(); +#endif +#else + readonly MD5Managed _md5 = new MD5Managed(); +#endif +#if NETFX_CORE + // readonly MD5Managed _md5 = new MD5Managed(); +#endif + /// + /// Bytes used for RC4 encryption. + /// + readonly byte[] _state = new byte[256]; + + /// + /// The encryption key for the owner. + /// + byte[] _ownerKey = new byte[32]; + + /// + /// The encryption key for the user. + /// + readonly byte[] _userKey = new byte[32]; + + /// + /// The encryption key for a particular object/generation. + /// + byte[] _key; + + /// + /// The encryption key length for a particular object/generation. + /// + int _keySize; + + #endregion + + internal override void WriteObject(PdfWriter writer) + { + // Don't encrypt myself. + PdfStandardSecurityHandler securityHandler = writer.SecurityHandler; + writer.SecurityHandler = null; + base.WriteObject(writer); + writer.SecurityHandler = securityHandler; + } + + #region Keys + /// + /// Predefined keys of this dictionary. + /// + internal sealed new class Keys : PdfSecurityHandler.Keys + { + /// + /// (Required) A number specifying which revision of the standard security handler + /// should be used to interpret this dictionary: + /// 2 if the document is encrypted with a V value less than 2 and does not have any of + /// the access permissions set (by means of the P entry, below) that are designated + /// "Revision 3 or greater". + /// 3 if the document is encrypted with a V value of 2 or 3, or has any "Revision 3 or + /// greater" access permissions set. + /// 4 if the document is encrypted with a V value of 4 + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string R = "/R"; + + /// + /// (Required) A 32-byte string, based on both the owner and user passwords, that is + /// used in computing the encryption key and in determining whether a valid owner + /// password was entered. + /// + [KeyInfo(KeyType.String | KeyType.Required)] + public const string O = "/O"; + + /// + /// (Required) A 32-byte string, based on the user password, that is used in determining + /// whether to prompt the user for a password and, if so, whether a valid user or owner + /// password was entered. + /// + [KeyInfo(KeyType.String | KeyType.Required)] + public const string U = "/U"; + + /// + /// (Required) A set of flags specifying which operations are permitted when the document + /// is opened with user access. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string P = "/P"; + + /// + /// (Optional; meaningful only when the value of V is 4; PDF 1.5) Indicates whether + /// the document-level metadata stream is to be encrypted. Applications should respect this value. + /// Default value: true. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string EncryptMetadata = "/EncryptMetadata"; + + /// + /// Gets the KeysMeta for these keys. + /// + public static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + #endregion + } +} diff --git a/PdfSharp/Pdf.Security/enums/PdfDocumentSecurity.cs b/PdfSharp/Pdf.Security/enums/PdfDocumentSecurity.cs new file mode 100644 index 0000000..11b9fb3 --- /dev/null +++ b/PdfSharp/Pdf.Security/enums/PdfDocumentSecurity.cs @@ -0,0 +1,53 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf.Security +{ + /// + /// Specifies the security level of the PDF document. + /// + public enum PdfDocumentSecurityLevel + { + /// + /// Document is not protected. + /// + None, + + /// + /// Document is protected with 40-bit security. This option is for compatibility with + /// Acrobat 3 and 4 only. Use Encrypted128Bit whenever possible. + /// + Encrypted40Bit, + + /// + /// Document is protected with 128-bit security. + /// + Encrypted128Bit, + } +} diff --git a/PdfSharp/Pdf.Security/enums/PdfUserAccessPermission.cs b/PdfSharp/Pdf.Security/enums/PdfUserAccessPermission.cs new file mode 100644 index 0000000..82e657a --- /dev/null +++ b/PdfSharp/Pdf.Security/enums/PdfUserAccessPermission.cs @@ -0,0 +1,92 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf.Security +{ + /// + /// Specifies which operations are permitted when the document is opened with user access. + /// + [Flags] + internal enum PdfUserAccessPermission + { + /// + /// Permits everything. This is the default value. + /// + PermitAll = -3, // = 0xFFFFFFFC, + + // Bit 12 Reserved; must be 0. + + // Bit 3 (Revision 2) Print the document. + // (Revision 3 or greater) Print the document (possibly not at the highest + // quality level, depending on whether bit 12 is also set). + PermitPrint = 0x00000004, //1 << (3 - 1), + + // Bit 4 Modify the contents of the document by operations other than + // those controlled by bits 6, 9, and 11. + PermitModifyDocument = 0x00000008, //1 << (4 - 1), + + // Bit 5 (Revision 2) Copy or otherwise extract text and graphics from the + // document, including extracting text and graphics (in support of accessibility + // to users with disabilities or for other purposes). + // (Revision 3 or greater) Copy or otherwise extract text and graphics + // from the document by operations other than that controlled by bit 10. + PermitExtractContent = 0x00000010, //1 << (5 - 1), + + // Bit 6 Add or modify text annotations, fill in interactive form fields, and, + // if bit 4 is also set, create or modify interactive form fields (including + // signature fields). + PermitAnnotations = 0x00000020, //1 << (6 - 1), + + // Bit 78 Reserved; must be 1. + + // 9 (Revision 3 or greater) Fill in existing interactive form fields (including + // signature fields), even if bit 6 is clear. + PermitFormsFill = 0x00000100, //1 << (9 - 1), + + // Bit 10 (Revision 3 or greater) Extract text and graphics (in support of accessibility + // to users with disabilities or for other purposes). + PermitAccessibilityExtractContent = 0x00000200, //1 << (10 - 1), + + // Bit 11 (Revision 3 or greater) Assemble the document (insert, rotate, or delete + // pages and create bookmarks or thumbnail images), even if bit 4 + // is clear. + PermitAssembleDocument = 0x00000400, //1 << (11 - 1), + + // Bit 12 (Revision 3 or greater) Print the document to a representation from + // which a faithful digital copy of the PDF content could be generated. + // When this bit is clear (and bit 3 is set), printing is limited to a lowlevel + // representation of the appearance, possibly of degraded quality. + // (See implementation note 24 in Appendix H.) + PermitFullQualityPrint = 0x00000800, //1 << (12 - 1), + + //Bit 1332 (Revision 3 or greater) Reserved; must be 1. + } +} diff --git a/PdfSharp/Pdf/EntryInfoAttribute.cs b/PdfSharp/Pdf/EntryInfoAttribute.cs new file mode 100644 index 0000000..7e5ad0d --- /dev/null +++ b/PdfSharp/Pdf/EntryInfoAttribute.cs @@ -0,0 +1,135 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf +{ + /// + /// Specifies the type of a key's value in a dictionary. + /// + [Flags] + internal enum KeyType + { + Name = 0x00000001, + String = 0x00000002, + Boolean = 0x00000003, + Integer = 0x00000004, + Real = 0x00000005, + Date = 0x00000006, + Rectangle = 0x00000007, + Array = 0x00000008, + Dictionary = 0x00000009, + Stream = 0x0000000A, + NumberTree = 0x0000000B, + Function = 0x0000000C, + TextString = 0x0000000D, + ByteString = 0x0000000E, + + NameOrArray = 0x00000010, + NameOrDictionary = 0x00000020, + ArrayOrDictionary = 0x00000030, + StreamOrArray = 0x00000040, + StreamOrName = 0x00000050, + ArrayOrNameOrString = 0x00000060, + FunctionOrName = 0x000000070, + Various = 0x000000080, + + TypeMask = 0x000000FF, + + Optional = 0x00000100, + Required = 0x00000200, + Inheritable = 0x00000400, + MustBeIndirect = 0x00001000, + MustNotBeIndirect = 0x00002000, + } + + /// + /// Summary description for KeyInfo. + /// + internal class KeyInfoAttribute : Attribute + { + public KeyInfoAttribute() + { } + + public KeyInfoAttribute(KeyType keyType) + { + //_version = version; + KeyType = keyType; + } + + public KeyInfoAttribute(string version, KeyType keyType) + { + _version = version; + KeyType = keyType; + } + + public KeyInfoAttribute(KeyType keyType, Type objectType) + { + //_version = version; + KeyType = keyType; + _objectType = objectType; + } + + public KeyInfoAttribute(string version, KeyType keyType, Type objectType) + { + //_version = version; + KeyType = keyType; + _objectType = objectType; + } + + public string Version + { + get { return _version; } + set { _version = value; } + } + string _version = "1.0"; + + public KeyType KeyType + { + get { return _entryType; } + set { _entryType = value; } + } + KeyType _entryType; + + public Type ObjectType + { + get { return _objectType; } + set { _objectType = value; } + } + Type _objectType; + + public string FixedValue + { + get { return _fixedValue; } + set { _fixedValue = value; } + } + string _fixedValue; + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/KeysBase.cs b/PdfSharp/Pdf/KeysBase.cs new file mode 100644 index 0000000..3029980 --- /dev/null +++ b/PdfSharp/Pdf/KeysBase.cs @@ -0,0 +1,44 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf +{ + /// + /// Base class for all dictionary Keys classes. + /// + public class KeysBase + { + internal static DictionaryMeta CreateMeta(Type type) + { + return new DictionaryMeta(type); + } + } +} diff --git a/PdfSharp/Pdf/KeysMeta.cs b/PdfSharp/Pdf/KeysMeta.cs new file mode 100644 index 0000000..590b9b1 --- /dev/null +++ b/PdfSharp/Pdf/KeysMeta.cs @@ -0,0 +1,301 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Collections.Generic; +using System.Reflection; + +namespace PdfSharp.Pdf +{ + /// + /// Holds information about the value of a key in a dictionary. This information is used to create + /// and interpret this value. + /// + internal sealed class KeyDescriptor + { + /// + /// Initializes a new instance of KeyDescriptor from the specified attribute during a KeysMeta + /// initializes itself using reflection. + /// + public KeyDescriptor(KeyInfoAttribute attribute) + { + _version = attribute.Version; + _keyType = attribute.KeyType; + _fixedValue = attribute.FixedValue; + _objectType = attribute.ObjectType; + + if (_version == "") + _version = "1.0"; + } + + /// + /// Gets or sets the PDF version starting with the availability of the described key. + /// + public string Version + { + get { return _version; } + set { _version = value; } + } + string _version; + + public KeyType KeyType + { + get { return _keyType; } + set { _keyType = value; } + } + KeyType _keyType; + + public string KeyValue + { + get { return _keyValue; } + set { _keyValue = value; } + } + string _keyValue; + + public string FixedValue + { + get { return _fixedValue; } + } + readonly string _fixedValue; + + public Type ObjectType + { + get { return _objectType; } + set { _objectType = value; } + } + Type _objectType; + + public bool CanBeIndirect + { + get { return (_keyType & KeyType.MustNotBeIndirect) == 0; } + } + + /// + /// Returns the type of the object to be created as value for the described key. + /// + public Type GetValueType() + { + Type type = _objectType; + if (type == null) + { + // If we have no ObjectType specified, use the KeyType enumeration. + switch (_keyType & KeyType.TypeMask) + { + case KeyType.Name: + type = typeof(PdfName); + break; + + case KeyType.String: + type = typeof(PdfString); + break; + + case KeyType.Boolean: + type = typeof(PdfBoolean); + break; + + case KeyType.Integer: + type = typeof(PdfInteger); + break; + + case KeyType.Real: + type = typeof(PdfReal); + break; + + case KeyType.Date: + type = typeof(PdfDate); + break; + + case KeyType.Rectangle: + type = typeof(PdfRectangle); + break; + + case KeyType.Array: + type = typeof(PdfArray); + break; + + case KeyType.Dictionary: + type = typeof(PdfDictionary); + break; + + case KeyType.Stream: + type = typeof(PdfDictionary); + break; + + // The following types are not yet used + + case KeyType.NumberTree: + throw new NotImplementedException("KeyType.NumberTree"); + + case KeyType.NameOrArray: + throw new NotImplementedException("KeyType.NameOrArray"); + + case KeyType.ArrayOrDictionary: + throw new NotImplementedException("KeyType.ArrayOrDictionary"); + + case KeyType.StreamOrArray: + throw new NotImplementedException("KeyType.StreamOrArray"); + + case KeyType.ArrayOrNameOrString: + return null; // HACK: Make PdfOutline work + //throw new NotImplementedException("KeyType.ArrayOrNameOrString"); + + default: + Debug.Assert(false, "Invalid KeyType: " + _keyType); + break; + } + } + return type; + } + } + + /// + /// Contains meta information about all keys of a PDF dictionary. + /// + internal class DictionaryMeta + { + public DictionaryMeta(Type type) + { + //#if (NETFX_CORE && DEBUG) || CORE + // if (type == typeof(PdfPages.Keys)) + // { + // var x = typeof(PdfPages).GetRuntimeFields(); + // var y = typeof(PdfPages).GetTypeInfo().DeclaredFields; + // x.GetType(); + // y.GetType(); + // Debug-Break.Break(); + // Test.It(); + // } + //#endif +#if !NETFX_CORE && !UWP + FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy); + foreach (FieldInfo field in fields) + { + object[] attributes = field.GetCustomAttributes(typeof(KeyInfoAttribute), false); + if (attributes.Length == 1) + { + KeyInfoAttribute attribute = (KeyInfoAttribute)attributes[0]; + KeyDescriptor descriptor = new KeyDescriptor(attribute); + descriptor.KeyValue = (string)field.GetValue(null); + _keyDescriptors[descriptor.KeyValue] = descriptor; + } + } +#else + // Rewritten for WinRT. + CollectKeyDescriptors(type); + //var fields = type.GetRuntimeFields(); // does not work + //fields2.GetType(); + //foreach (FieldInfo field in fields) + //{ + // var attributes = field.GetCustomAttributes(typeof(KeyInfoAttribute), false); + // foreach (var attribute in attributes) + // { + // KeyDescriptor descriptor = new KeyDescriptor((KeyInfoAttribute)attribute); + // descriptor.KeyValue = (string)field.GetValue(null); + // _keyDescriptors[descriptor.KeyValue] = descriptor; + // } + //} +#endif + } + +#if NETFX_CORE || UWP + // Background: The function GetRuntimeFields gets constant fields only for the specified type, + // not for its base types. So we have to walk recursively through base classes. + // The docmentation says full trust for the immediate caller is required for property BaseClass. + // TODO: Rewrite this stuff for medium trust. + void CollectKeyDescriptors(Type type) + { + // Get fields of the specified type only. + var fields = type.GetTypeInfo().DeclaredFields; + foreach (FieldInfo field in fields) + { + var attributes = field.GetCustomAttributes(typeof(KeyInfoAttribute), false); + foreach (var attribute in attributes) + { + KeyDescriptor descriptor = new KeyDescriptor((KeyInfoAttribute)attribute); + descriptor.KeyValue = (string)field.GetValue(null); + _keyDescriptors[descriptor.KeyValue] = descriptor; + } + } + type = type.GetTypeInfo().BaseType; + if (type != typeof(object) && type != typeof(PdfObject)) + CollectKeyDescriptors(type); + } +#endif + +#if (NETFX_CORE || CORE) && true_ + public class A + { + public string _a; + public const string _ca = "x"; + } + public class B : A + { + public string _b; + public const string _cb = "x"; + + void Foo() + { + var str = A._ca; + } + } + class Test + { + public static void It() + { + string s = "Runtime fields of B:"; + foreach (var fieldInfo in typeof(B).GetRuntimeFields()) { s += " " + fieldInfo.Name; } + Debug.WriteLine(s); + + s = "Declared fields of B:"; + foreach (var fieldInfo in typeof(B).GetTypeInfo().DeclaredFields) { s += " " + fieldInfo.Name; } + Debug.WriteLine(s); + + s = "Runtime fields of PdfPages.Keys:"; + foreach (var fieldInfo in typeof(PdfPages.Keys).GetRuntimeFields()) { s += " " + fieldInfo.Name; } + Debug.WriteLine(s); + } + } +#endif + /// + /// Gets the KeyDescriptor of the specified key, or null if no such descriptor exits. + /// + public KeyDescriptor this[string key] + { + get + { + KeyDescriptor keyDescriptor; + _keyDescriptors.TryGetValue(key, out keyDescriptor); + return keyDescriptor; + } + } + + readonly Dictionary _keyDescriptors = new Dictionary(); + } +} diff --git a/PdfSharp/Pdf/PdfArray.cs b/PdfSharp/Pdf/PdfArray.cs new file mode 100644 index 0000000..58179cb --- /dev/null +++ b/PdfSharp/Pdf/PdfArray.cs @@ -0,0 +1,630 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Collections; +using System.Globalization; +using System.Text; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents a PDF array object. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + public class PdfArray : PdfObject, IEnumerable + { + /// + /// Initializes a new instance of the class. + /// + public PdfArray() + { } + + /// + /// Initializes a new instance of the class. + /// + /// The document. + public PdfArray(PdfDocument document) + : base(document) + { } + + /// + /// Initializes a new instance of the class. + /// + /// The document. + /// The items. + public PdfArray(PdfDocument document, params PdfItem[] items) + : base(document) + { + foreach (PdfItem item in items) + Elements.Add(item); + } + + /// + /// Initializes a new instance from an existing dictionary. Used for object type transformation. + /// + /// The array. + protected PdfArray(PdfArray array) + : base(array) + { + if (array._elements != null) + array._elements.ChangeOwner(this); + } + + /// + /// Creates a copy of this array. Direct elements are deep copied. + /// Indirect references are not modified. + /// + public new PdfArray Clone() + { + return (PdfArray)Copy(); + } + + /// + /// Implements the copy mechanism. + /// + protected override object Copy() + { + PdfArray array = (PdfArray)base.Copy(); + if (array._elements != null) + { + array._elements = array._elements.Clone(); + int count = array._elements.Count; + for (int idx = 0; idx < count; idx++) + { + PdfItem item = array._elements[idx]; + if (item is PdfObject) + array._elements[idx] = item.Clone(); + } + } + return array; + } + + /// + /// Gets the collection containing the elements of this object. + /// + public ArrayElements Elements + { + get { return _elements ?? (_elements = new ArrayElements(this)); } + } + + /// + /// Returns an enumerator that iterates through a collection. + /// + public virtual IEnumerator GetEnumerator() + { + return Elements.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + /// Returns a string with the content of this object in a readable form. Useful for debugging purposes only. + /// + public override string ToString() + { + StringBuilder pdf = new StringBuilder(); + pdf.Append("[ "); + int count = Elements.Count; + for (int idx = 0; idx < count; idx++) + pdf.Append(Elements[idx] + " "); + pdf.Append("]"); + return pdf.ToString(); + } + + internal override void WriteObject(PdfWriter writer) + { + writer.WriteBeginObject(this); + int count = Elements.Count; + for (int idx = 0; idx < count; idx++) + { + PdfItem value = Elements[idx]; + value.WriteObject(writer); + } + writer.WriteEndObject(); + } + + /// + /// Represents the elements of an PdfArray. + /// + public sealed class ArrayElements : IList, ICloneable + { + internal ArrayElements(PdfArray array) + { + _elements = new List(); + _ownerArray = array; + } + + object ICloneable.Clone() + { + ArrayElements elements = (ArrayElements)MemberwiseClone(); + elements._elements = new List(elements._elements); + elements._ownerArray = null; + return elements; + } + + /// + /// Creates a shallow copy of this object. + /// + public ArrayElements Clone() + { + return (ArrayElements)((ICloneable)this).Clone(); + } + + /// + /// Moves this instance to another array during object type transformation. + /// + internal void ChangeOwner(PdfArray array) + { + if (_ownerArray != null) + { + // ??? + } + + // Set new owner. + _ownerArray = array; + + // Set owners elements to this. + array._elements = this; + } + + /// + /// Converts the specified value to boolean. + /// If the value does not exist, the function returns false. + /// If the value is not convertible, the function throws an InvalidCastException. + /// If the index is out of range, the function throws an ArgumentOutOfRangeException. + /// + public bool GetBoolean(int index) + { + if (index < 0 || index >= Count) + throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); + + object obj = this[index]; + if (obj == null) + return false; + + PdfBoolean boolean = obj as PdfBoolean; + if (boolean != null) + return boolean.Value; + + PdfBooleanObject booleanObject = obj as PdfBooleanObject; + if (booleanObject != null) + return booleanObject.Value; + + throw new InvalidCastException("GetBoolean: Object is not a boolean."); + } + + /// + /// Converts the specified value to integer. + /// If the value does not exist, the function returns 0. + /// If the value is not convertible, the function throws an InvalidCastException. + /// If the index is out of range, the function throws an ArgumentOutOfRangeException. + /// + public int GetInteger(int index) + { + if (index < 0 || index >= Count) + throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); + + object obj = this[index]; + if (obj == null) + return 0; + + PdfInteger integer = obj as PdfInteger; + if (integer != null) + return integer.Value; + + PdfIntegerObject integerObject = obj as PdfIntegerObject; + if (integerObject != null) + return integerObject.Value; + + throw new InvalidCastException("GetInteger: Object is not an integer."); + } + + /// + /// Converts the specified value to double. + /// If the value does not exist, the function returns 0. + /// If the value is not convertible, the function throws an InvalidCastException. + /// If the index is out of range, the function throws an ArgumentOutOfRangeException. + /// + public double GetReal(int index) + { + if (index < 0 || index >= Count) + throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); + + object obj = this[index]; + if (obj == null) + return 0; + + PdfReal real = obj as PdfReal; + if (real != null) + return real.Value; + + PdfRealObject realObject = obj as PdfRealObject; + if (realObject != null) + return realObject.Value; + + PdfInteger integer = obj as PdfInteger; + if (integer != null) + return integer.Value; + + PdfIntegerObject integerObject = obj as PdfIntegerObject; + if (integerObject != null) + return integerObject.Value; + + throw new InvalidCastException("GetReal: Object is not a number."); + } + + /// + /// Converts the specified value to double?. + /// If the value does not exist, the function returns null. + /// If the value is not convertible, the function throws an InvalidCastException. + /// If the index is out of range, the function throws an ArgumentOutOfRangeException. + /// + public double? GetNullableReal(int index) + { + if (index < 0 || index >= Count) + throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); + + object obj = this[index]; + if (obj == null) + return null; + + PdfNull @null = obj as PdfNull; + if (@null != null) + return null; + + PdfNullObject nullObject = obj as PdfNullObject; + if (nullObject != null) + return null; + + PdfReal real = obj as PdfReal; + if (real != null) + return real.Value; + + PdfRealObject realObject = obj as PdfRealObject; + if (realObject != null) + return realObject.Value; + + PdfInteger integer = obj as PdfInteger; + if (integer != null) + return integer.Value; + + PdfIntegerObject integerObject = obj as PdfIntegerObject; + if (integerObject != null) + return integerObject.Value; + + throw new InvalidCastException("GetReal: Object is not a number."); + } + + /// + /// Converts the specified value to string. + /// If the value does not exist, the function returns the empty string. + /// If the value is not convertible, the function throws an InvalidCastException. + /// If the index is out of range, the function throws an ArgumentOutOfRangeException. + /// + public string GetString(int index) + { + if (index < 0 || index >= Count) + throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); + + object obj = this[index]; + if (obj == null) + return String.Empty; + + PdfString str = obj as PdfString; + if (str != null) + return str.Value; + + PdfStringObject strObject = obj as PdfStringObject; + if (strObject != null) + return strObject.Value; + + throw new InvalidCastException("GetString: Object is not a string."); + } + + /// + /// Converts the specified value to a name. + /// If the value does not exist, the function returns the empty string. + /// If the value is not convertible, the function throws an InvalidCastException. + /// If the index is out of range, the function throws an ArgumentOutOfRangeException. + /// + public string GetName(int index) + { + if (index < 0 || index >= Count) + throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); + + object obj = this[index]; + if (obj == null) + return String.Empty; + + PdfName name = obj as PdfName; + if (name != null) + return name.Value; + + PdfNameObject nameObject = obj as PdfNameObject; + if (nameObject != null) + return nameObject.Value; + + throw new InvalidCastException("GetName: Object is not a name."); + } + + /// + /// Returns the indirect object if the value at the specified index is a PdfReference. + /// + [Obsolete("Use GetObject, GetDictionary, GetArray, or GetReference")] + public PdfObject GetIndirectObject(int index) + { + if (index < 0 || index >= Count) + throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); + + PdfReference reference = this[index] as PdfReference; + if (reference != null) + return reference.Value; + + return null; + } + + /// + /// Gets the PdfObject with the specified index, or null, if no such object exists. If the index refers to + /// a reference, the referenced PdfObject is returned. + /// + public PdfObject GetObject(int index) + { + if (index < 0 || index >= Count) + throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); + + PdfItem item = this[index]; + PdfReference reference = item as PdfReference; + if (reference != null) + return reference.Value; + + return item as PdfObject; + } + + /// + /// Gets the PdfArray with the specified index, or null, if no such object exists. If the index refers to + /// a reference, the referenced PdfArray is returned. + /// + public PdfDictionary GetDictionary(int index) + { + return GetObject(index) as PdfDictionary; + } + + /// + /// Gets the PdfArray with the specified index, or null, if no such object exists. If the index refers to + /// a reference, the referenced PdfArray is returned. + /// + public PdfArray GetArray(int index) + { + return GetObject(index) as PdfArray; + } + + /// + /// Gets the PdfReference with the specified index, or null, if no such object exists. + /// + public PdfReference GetReference(int index) + { + PdfItem item = this[index]; + return item as PdfReference; + } + + /// + /// Gets all items of this array. + /// + public PdfItem[] Items + { + get { return _elements.ToArray(); } + } + + #region IList Members + + /// + /// Returns false. + /// + public bool IsReadOnly + { + get { return false; } + } + + /// + /// Gets or sets an item at the specified index. + /// + /// + public PdfItem this[int index] + { + get { return _elements[index]; } + set + { + if (value == null) + throw new ArgumentNullException("value"); + _elements[index] = value; + } + } + + /// + /// Removes the item at the specified index. + /// + public void RemoveAt(int index) + { + _elements.RemoveAt(index); + } + + /// + /// Removes the first occurrence of a specific object from the array/>. + /// + public bool Remove(PdfItem item) + { + return _elements.Remove(item); + } + + /// + /// Inserts the item the specified index. + /// + public void Insert(int index, PdfItem value) + { + _elements.Insert(index, value); + } + + /// + /// Determines whether the specified value is in the array. + /// + public bool Contains(PdfItem value) + { + return _elements.Contains(value); + } + + /// + /// Removes all items from the array. + /// + public void Clear() + { + _elements.Clear(); + } + + /// + /// Gets the index of the specified item. + /// + public int IndexOf(PdfItem value) + { + return _elements.IndexOf(value); + } + + /// + /// Appends the specified object to the array. + /// + public void Add(PdfItem value) + { + // TODO: ??? + //Debug.Assert((value is PdfObject && ((PdfObject)value).Reference == null) | !(value is PdfObject), + // "You try to set an indirect object directly into an array."); + + PdfObject obj = value as PdfObject; + if (obj != null && obj.IsIndirect) + _elements.Add(obj.Reference); + else + _elements.Add(value); + } + + /// + /// Returns false. + /// + public bool IsFixedSize + { + get { return false; } + } + + #endregion + + #region ICollection Members + + /// + /// Returns false. + /// + public bool IsSynchronized + { + get { return false; } + } + + /// + /// Gets the number of elements in the array. + /// + public int Count + { + get { return _elements.Count; } + } + + /// + /// Copies the elements of the array to the specified array. + /// + public void CopyTo(PdfItem[] array, int index) + { + _elements.CopyTo(array, index); + } + + /// + /// The current implementation return null. + /// + public object SyncRoot + { + get { return null; } + } + + #endregion + + /// + /// Returns an enumerator that iterates through the array. + /// + public IEnumerator GetEnumerator() + { + return _elements.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return _elements.GetEnumerator(); + } + + /// + /// The elements of the array. + /// + List _elements; + + /// + /// The array this objects belongs to. + /// + PdfArray _ownerArray; + } + + ArrayElements _elements; + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + // ReSharper disable UnusedMember.Local + string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get + { +#if true + return String.Format(CultureInfo.InvariantCulture, "array({0},[{1}])", ObjectID.DebuggerDisplay, _elements == null ? 0 : _elements.Count); +#else + return String.Format(CultureInfo.InvariantCulture, "array({0},[{1}])", ObjectID.DebuggerDisplay, _elements == null ? 0 : _elements.Count); +#endif + } + } + } +} diff --git a/PdfSharp/Pdf/PdfBoolean.cs b/PdfSharp/Pdf/PdfBoolean.cs new file mode 100644 index 0000000..09f3bf8 --- /dev/null +++ b/PdfSharp/Pdf/PdfBoolean.cs @@ -0,0 +1,91 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents a direct boolean value. + /// + [DebuggerDisplay("({Value})")] + public sealed class PdfBoolean : PdfItem + { + /// + /// Initializes a new instance of the class. + /// + public PdfBoolean() + { } + + /// + /// Initializes a new instance of the class. + /// + public PdfBoolean(bool value) + { + _value = value; + } + + /// + /// Gets the value of this instance as boolean value. + /// + public bool Value + { + // This class must behave like a value type. Therefore it cannot be changed (like System.String). + get { return _value; } + } + readonly bool _value; + + /// + /// A pre-defined value that represents true. + /// + public static readonly PdfBoolean True = new PdfBoolean(true); + + /// + /// A pre-defined value that represents false. + /// + public static readonly PdfBoolean False = new PdfBoolean(false); + + /// + /// Returns 'false' or 'true'. + /// + public override string ToString() + { + return _value ? bool.TrueString : bool.FalseString; + } + + /// + /// Writes 'true' or 'false'. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.Write(this); + } + } +} diff --git a/PdfSharp/Pdf/PdfBooleanObject.cs b/PdfSharp/Pdf/PdfBooleanObject.cs new file mode 100644 index 0000000..6b03214 --- /dev/null +++ b/PdfSharp/Pdf/PdfBooleanObject.cs @@ -0,0 +1,94 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents an indirect boolean value. This type is not used by PDFsharp. If it is imported from + /// an external PDF file, the value is converted into a direct object. + /// + [DebuggerDisplay("({Value})")] + public sealed class PdfBooleanObject : PdfObject + { + /// + /// Initializes a new instance of the class. + /// + public PdfBooleanObject() + { } + + /// + /// Initializes a new instance of the class. + /// + public PdfBooleanObject(bool value) + { + _value = value; + } + + /// + /// Initializes a new instance of the class. + /// + public PdfBooleanObject(PdfDocument document, bool value) + : base(document) + { + _value = value; + } + + /// + /// Gets the value of this instance as boolean value. + /// + public bool Value + { + get { return _value; } + //set { _value = value; } + } + + readonly bool _value; + + /// + /// Returns "false" or "true". + /// + public override string ToString() + { + return _value ? bool.TrueString : bool.FalseString; + } + + /// + /// Writes the keyword false or true. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.WriteBeginObject(this); + writer.Write(_value); + writer.WriteEndObject(); + } + } +} diff --git a/PdfSharp/Pdf/PdfCustomValue.cs b/PdfSharp/Pdf/PdfCustomValue.cs new file mode 100644 index 0000000..08ced4d --- /dev/null +++ b/PdfSharp/Pdf/PdfCustomValue.cs @@ -0,0 +1,79 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf +{ + /// + /// This class is intended for empira internal use only and may change or drop in future releases. + /// + public class PdfCustomValue : PdfDictionary + { + /// + /// This function is intended for empira internal use only. + /// + public PdfCustomValue() + { + CreateStream(new byte[] { }); + } + + /// + /// This function is intended for empira internal use only. + /// + public PdfCustomValue(byte[] bytes) + { + CreateStream(bytes); + } + + internal PdfCustomValue(PdfDocument document) + : base(document) + { + CreateStream(new byte[] { }); + } + + internal PdfCustomValue(PdfDictionary dict) + : base(dict) + { + // TODO: uncompress stream + } + + /// + /// This property is intended for empira internal use only. + /// + public PdfCustomValueCompressionMode CompressionMode; + + /// + /// This property is intended for empira internal use only. + /// + public byte[] Value + { + get { return Stream.Value; } + set { Stream.Value = value; } + } + } +} diff --git a/PdfSharp/Pdf/PdfCustomValues.cs b/PdfSharp/Pdf/PdfCustomValues.cs new file mode 100644 index 0000000..eb14827 --- /dev/null +++ b/PdfSharp/Pdf/PdfCustomValues.cs @@ -0,0 +1,161 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf +{ + /// + /// This class is intended for empira internal use only and may change or drop in future releases. + /// + public class PdfCustomValues : PdfDictionary + { + internal PdfCustomValues() + { } + + internal PdfCustomValues(PdfDocument document) + : base(document) + { } + + internal PdfCustomValues(PdfDictionary dict) + : base(dict) + { } + + /// + /// This function is intended for empira internal use only. + /// + public PdfCustomValueCompressionMode CompressionMode + { + set { throw new NotImplementedException(); } + } + + /// + /// This function is intended for empira internal use only. + /// + public bool Contains(string key) + { + return Elements.ContainsKey(key); + } + + /// + /// This function is intended for empira internal use only. + /// + public PdfCustomValue this[string key] + { + get + { + PdfDictionary dict = Elements.GetDictionary(key); + if (dict == null) + return null; + PdfCustomValue cust = dict as PdfCustomValue; + if (cust == null) + cust = new PdfCustomValue(dict); + return cust; + } + set + { + if (value == null) + { + Elements.Remove(key); + } + else + { + Owner.Internals.AddObject(value); + Elements.SetReference(key, value); + } + } +#if old + get + { + PdfDictionary dict = Elements.GetDictionary(key); + if (dict == null) + return null; + if (!(dict is PdfCustomValue)) + dict = new PdfCustomValue(dict); + return dict.Stream.Value; + } + set + { + PdfCustomValue cust; + PdfDictionary dict = Elements.GetDictionary(key); + if (dict == null) + { + cust = new PdfCustomValue(); + Owner.Internals.AddObject(cust); + Elements.Add(key, cust); + } + else + { + cust = dict as PdfCustomValue; + if (cust == null) + cust = new PdfCustomValue(dict); + } + cust.Value = value; + } +#endif + } + + /// + /// This function is intended for empira internal use only. + /// + public static void ClearAllCustomValues(PdfDocument document) + { + document.CustomValues = null; + foreach (PdfPage page in document.Pages) + page.CustomValues = null; + } + + //public static string Key = "/PdfSharp.CustomValue"; + + internal static PdfCustomValues Get(DictionaryElements elem) + { + string key = elem.Owner.Owner.Internals.CustomValueKey; + PdfCustomValues customValues; + PdfDictionary dict = elem.GetDictionary(key); + if (dict == null) + { + customValues = new PdfCustomValues(); + elem.Owner.Owner.Internals.AddObject(customValues); + elem.Add(key, customValues); + } + else + { + customValues = dict as PdfCustomValues; + if (customValues == null) + customValues = new PdfCustomValues(dict); + } + return customValues; + } + + internal static void Remove(DictionaryElements elem) + { + elem.Remove(elem.Owner.Owner.Internals.CustomValueKey); + } + } +} diff --git a/PdfSharp/Pdf/PdfDate.cs b/PdfSharp/Pdf/PdfDate.cs new file mode 100644 index 0000000..3f374b1 --- /dev/null +++ b/PdfSharp/Pdf/PdfDate.cs @@ -0,0 +1,91 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents a direct date value. + /// + [DebuggerDisplay("({Value})")] + public sealed class PdfDate : PdfItem + { + /// + /// Initializes a new instance of the class. + /// + public PdfDate() + { } + + /// + /// Initializes a new instance of the class. + /// + public PdfDate(string value) + { + _value = Parser.ParseDateTime(value, DateTime.MinValue); + } + + /// + /// Initializes a new instance of the class. + /// + public PdfDate(DateTime value) + { + _value = value; + } + + /// + /// Gets the value as DateTime. + /// + public DateTime Value + { + // This class must behave like a value type. Therefore it cannot be changed (like System.String). + get { return _value; } + } + DateTime _value; + + /// + /// Returns the value in the PDF date format. + /// + public override string ToString() + { + string delta = _value.ToString("zzz").Replace(':', '\''); + return String.Format("D:{0:yyyyMMddHHmmss}{1}'", _value, delta); + } + + /// + /// Writes the value in the PDF date format. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.WriteDocString(ToString()); + } + } +} diff --git a/PdfSharp/Pdf/PdfDictionary.cs b/PdfSharp/Pdf/PdfDictionary.cs new file mode 100644 index 0000000..9788be3 --- /dev/null +++ b/PdfSharp/Pdf/PdfDictionary.cs @@ -0,0 +1,1912 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Reflection; +using System.Text; +using PdfSharp.Drawing; +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.Filters; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf +{ + /// + /// Value creation flags. Specifies whether and how a value that does not exist is created. + /// + // ReSharper disable InconsistentNaming + public enum VCF + // ReSharper restore InconsistentNaming + { + /// + /// Don't create the value. + /// + None, + + /// + /// Create the value as direct object. + /// + Create, + + /// + /// Create the value as indirect object. + /// + CreateIndirect, + } + + /// + /// Represents a PDF dictionary object. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + public class PdfDictionary : PdfObject, IEnumerable> + { + // Reference: 3.2.6  Dictionary Objects / Page 59 + + /// + /// Initializes a new instance of the class. + /// + public PdfDictionary() + { } + + /// + /// Initializes a new instance of the class. + /// + /// The document. + public PdfDictionary(PdfDocument document) + : base(document) + { } + + /// + /// Initializes a new instance from an existing dictionary. Used for object type transformation. + /// + protected PdfDictionary(PdfDictionary dict) + : base(dict) + { + if (dict._elements != null) + dict._elements.ChangeOwner(this); + if (dict._stream != null) + dict._stream.ChangeOwner(this); + } + + /// + /// Creates a copy of this dictionary. Direct values are deep copied. Indirect references are not + /// modified. + /// + public new PdfDictionary Clone() + { + return (PdfDictionary)Copy(); + } + + /// + /// This function is useful for importing objects from external documents. The returned object is not + /// yet complete. irefs refer to external objects and directed objects are cloned but their document + /// property is null. A cloned dictionary or array needs a 'fix-up' to be a valid object. + /// + protected override object Copy() + { + PdfDictionary dict = (PdfDictionary)base.Copy(); + if (dict._elements != null) + { + dict._elements = dict._elements.Clone(); + dict._elements.ChangeOwner(dict); + PdfName[] names = dict._elements.KeyNames; + foreach (PdfName name in names) + { + PdfObject obj = dict._elements[name] as PdfObject; + if (obj != null) + { + obj = obj.Clone(); + // Recall that obj.Document is now null. + dict._elements[name] = obj; + } + } + } + if (dict._stream != null) + { + dict._stream = dict._stream.Clone(); + dict._stream.ChangeOwner(dict); + } + return dict; + } + + /// + /// Gets the dictionary containing the elements of this dictionary. + /// + public DictionaryElements Elements + { + get { return _elements ?? (_elements = new DictionaryElements(this)); } + } + + /// + /// The elements of the dictionary. + /// + internal DictionaryElements _elements; + + /// + /// Returns an enumerator that iterates through the dictionary elements. + /// + public IEnumerator> GetEnumerator() + { + return Elements.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + /// Returns a string with the content of this object in a readable form. Useful for debugging purposes only. + /// + public override string ToString() + { + // Get keys and sort. + PdfName[] keys = Elements.KeyNames; + List list = new List(keys); + list.Sort(PdfName.Comparer); + list.CopyTo(keys, 0); + + StringBuilder pdf = new StringBuilder(); + pdf.Append("<< "); + foreach (PdfName key in keys) + pdf.Append(key + " " + Elements[key] + " "); + pdf.Append(">>"); + + return pdf.ToString(); + } + + internal override void WriteObject(PdfWriter writer) + { + writer.WriteBeginObject(this); + //int count = Elements.Count; + PdfName[] keys = Elements.KeyNames; + +#if DEBUG + // TODO: automatically set length + if (_stream != null) + Debug.Assert(Elements.ContainsKey(PdfStream.Keys.Length), "Dictionary has a stream but no length is set."); +#endif + +#if DEBUG + // Sort keys for debugging purposes. Comparing PDF files with for example programs like + // Araxis Merge is easier with sorted keys. + if (writer.Layout == PdfWriterLayout.Verbose) + { + List list = new List(keys); + list.Sort(PdfName.Comparer); + list.CopyTo(keys, 0); + } +#endif + + foreach (PdfName key in keys) + WriteDictionaryElement(writer, key); + if (Stream != null) + WriteDictionaryStream(writer); + writer.WriteEndObject(); + } + + /// + /// Writes a key/value pair of this dictionary. This function is intended to be overridden + /// in derived classes. + /// + internal virtual void WriteDictionaryElement(PdfWriter writer, PdfName key) + { + if (key == null) + throw new ArgumentNullException("key"); + PdfItem item = Elements[key]; +#if DEBUG + // TODO: simplify PDFsharp + if (item is PdfObject && ((PdfObject)item).IsIndirect) + { + // Replace an indirect object by its Reference. + item = ((PdfObject)item).Reference; + Debug.Assert(false, "Check when we come here."); + } +#endif + key.WriteObject(writer); + item.WriteObject(writer); + writer.NewLine(); + } + + /// + /// Writes the stream of this dictionary. This function is intended to be overridden + /// in a derived class. + /// + internal virtual void WriteDictionaryStream(PdfWriter writer) + { + writer.WriteStream(this, (writer.Options & PdfWriterOptions.OmitStream) == PdfWriterOptions.OmitStream); + } + + /// + /// Gets or sets the PDF stream belonging to this dictionary. Returns null if the dictionary has + /// no stream. To create the stream, call the CreateStream function. + /// + public PdfStream Stream + { + get { return _stream; } + set { _stream = value; } + } + PdfStream _stream; + + /// + /// Creates the stream of this dictionary and initializes it with the specified byte array. + /// The function must not be called if the dictionary already has a stream. + /// + public PdfStream CreateStream(byte[] value) + { + if (_stream != null) + throw new InvalidOperationException("The dictionary already has a stream."); + + _stream = new PdfStream(value, this); + // Always set the length. + Elements[PdfStream.Keys.Length] = new PdfInteger(_stream.Length); + return _stream; + } + + /// + /// When overridden in a derived class, gets the KeysMeta of this dictionary type. + /// + internal virtual DictionaryMeta Meta + { + get { return null; } + } + + /// + /// Represents the interface to the elements of a PDF dictionary. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + public sealed class DictionaryElements : IDictionary, ICloneable + { + internal DictionaryElements(PdfDictionary ownerDictionary) + { + _elements = new Dictionary(); + _ownerDictionary = ownerDictionary; + } + + object ICloneable.Clone() + { + DictionaryElements dictionaryElements = (DictionaryElements)MemberwiseClone(); + dictionaryElements._elements = new Dictionary(dictionaryElements._elements); + dictionaryElements._ownerDictionary = null; + return dictionaryElements; + } + + /// + /// Creates a shallow copy of this object. The clone is not owned by a dictionary anymore. + /// + public DictionaryElements Clone() + { + return (DictionaryElements)((ICloneable)this).Clone(); + } + + /// + /// Moves this instance to another dictionary during object type transformation. + /// + internal void ChangeOwner(PdfDictionary ownerDictionary) + { + if (_ownerDictionary != null) + { + // ??? + } + + // Set new owner. + _ownerDictionary = ownerDictionary; + + // Set owners elements to this. + ownerDictionary._elements = this; + } + + /// + /// Gets the dictionary to which this elements object belongs to. + /// + internal PdfDictionary Owner + { + get { return _ownerDictionary; } + } + + /// + /// Converts the specified value to boolean. + /// If the value does not exist, the function returns false. + /// If the value is not convertible, the function throws an InvalidCastException. + /// + public bool GetBoolean(string key, bool create) + { + object obj = this[key]; + if (obj == null) + { + if (create) + this[key] = new PdfBoolean(); + return false; + } + + if (obj is PdfReference) + obj = ((PdfReference)obj).Value; + + PdfBoolean boolean = obj as PdfBoolean; + if (boolean != null) + return boolean.Value; + + PdfBooleanObject booleanObject = obj as PdfBooleanObject; + if (booleanObject != null) + return booleanObject.Value; + throw new InvalidCastException("GetBoolean: Object is not a boolean."); + } + + /// + /// Converts the specified value to boolean. + /// If the value does not exist, the function returns false. + /// If the value is not convertible, the function throws an InvalidCastException. + /// + public bool GetBoolean(string key) + { + return GetBoolean(key, false); + } + + /// + /// Sets the entry to a direct boolean value. + /// + public void SetBoolean(string key, bool value) + { + this[key] = new PdfBoolean(value); + } + + /// + /// Converts the specified value to integer. + /// If the value does not exist, the function returns 0. + /// If the value is not convertible, the function throws an InvalidCastException. + /// + public int GetInteger(string key, bool create) + { + object obj = this[key]; + if (obj == null) + { + if (create) + this[key] = new PdfInteger(); + return 0; + } + PdfReference reference = obj as PdfReference; + if (reference != null) + obj = reference.Value; + + PdfInteger integer = obj as PdfInteger; + if (integer != null) + return integer.Value; + + PdfIntegerObject integerObject = obj as PdfIntegerObject; + if (integerObject != null) + return integerObject.Value; + + throw new InvalidCastException("GetInteger: Object is not an integer."); + } + + /// + /// Converts the specified value to integer. + /// If the value does not exist, the function returns 0. + /// If the value is not convertible, the function throws an InvalidCastException. + /// + public int GetInteger(string key) + { + return GetInteger(key, false); + } + + /// + /// Sets the entry to a direct integer value. + /// + public void SetInteger(string key, int value) + { + this[key] = new PdfInteger(value); + } + + /// + /// Converts the specified value to double. + /// If the value does not exist, the function returns 0. + /// If the value is not convertible, the function throws an InvalidCastException. + /// + public double GetReal(string key, bool create) + { + object obj = this[key]; + if (obj == null) + { + if (create) + this[key] = new PdfReal(); + return 0; + } + + PdfReference reference = obj as PdfReference; + if (reference != null) + obj = reference.Value; + + PdfReal real = obj as PdfReal; + if (real != null) + return real.Value; + + PdfRealObject realObject = obj as PdfRealObject; + if (realObject != null) + return realObject.Value; + + PdfInteger integer = obj as PdfInteger; + if (integer != null) + return integer.Value; + + PdfIntegerObject integerObject = obj as PdfIntegerObject; + if (integerObject != null) + return integerObject.Value; + + throw new InvalidCastException("GetReal: Object is not a number."); + } + + /// + /// Converts the specified value to double. + /// If the value does not exist, the function returns 0. + /// If the value is not convertible, the function throws an InvalidCastException. + /// + public double GetReal(string key) + { + return GetReal(key, false); + } + + /// + /// Sets the entry to a direct double value. + /// + public void SetReal(string key, double value) + { + this[key] = new PdfReal(value); + } + + /// + /// Converts the specified value to String. + /// If the value does not exist, the function returns the empty string. + /// + public string GetString(string key, bool create) + { + object obj = this[key]; + if (obj == null) + { + if (create) + this[key] = new PdfString(); + return ""; + } + + PdfReference reference = obj as PdfReference; + if (reference != null) + obj = reference.Value; + + PdfString str = obj as PdfString; + if (str != null) + return str.Value; + + PdfStringObject strObject = obj as PdfStringObject; + if (strObject != null) + return strObject.Value; + + PdfName name = obj as PdfName; + if (name != null) + return name.Value; + + PdfNameObject nameObject = obj as PdfNameObject; + if (nameObject != null) + return nameObject.Value; + + throw new InvalidCastException("GetString: Object is not a string."); + } + + /// + /// Converts the specified value to String. + /// If the value does not exist, the function returns the empty string. + /// + public string GetString(string key) + { + return GetString(key, false); + } + + /// + /// Tries to get the string. TODO: more TryGet... + /// + public bool TryGetString(string key, out string value) + { + value = null; + object obj = this[key]; + if (obj == null) + return false; + + PdfReference reference = obj as PdfReference; + if (reference != null) + obj = reference.Value; + + PdfString str = obj as PdfString; + if (str != null) + { + value = str.Value; + return true; + } + + PdfStringObject strObject = obj as PdfStringObject; + if (strObject != null) + { + value = strObject.Value; + return true; + } + + PdfName name = obj as PdfName; + if (name != null) + { + value = name.Value; + return true; + } + + PdfNameObject nameObject = obj as PdfNameObject; + if (nameObject != null) + { + value = nameObject.Value; + return true; + } + + return false; + } + + /// + /// Sets the entry to a direct string value. + /// + public void SetString(string key, string value) + { + this[key] = new PdfString(value); + } + + /// + /// Converts the specified value to a name. + /// If the value does not exist, the function returns the empty string. + /// + public string GetName(string key) + { + object obj = this[key]; + if (obj == null) + { + //if (create) + // this[key] = new Pdf(); + return String.Empty; + } + + PdfReference reference = obj as PdfReference; + if (reference != null) + obj = reference.Value; + + PdfName name = obj as PdfName; + if (name != null) + return name.Value; + + PdfNameObject nameObject = obj as PdfNameObject; + if (nameObject != null) + return nameObject.Value; + + throw new InvalidCastException("GetName: Object is not a name."); + } + + /// + /// Sets the specified name value. + /// If the value doesn't start with a slash, it is added automatically. + /// + public void SetName(string key, string value) + { + if (value == null) + throw new ArgumentNullException("value"); + + if (value.Length == 0 || value[0] != '/') + value = "/" + value; + + this[key] = new PdfName(value); + } + + /// + /// Converts the specified value to PdfRectangle. + /// If the value does not exist, the function returns an empty rectangle. + /// If the value is not convertible, the function throws an InvalidCastException. + /// + public PdfRectangle GetRectangle(string key, bool create) + { + PdfRectangle value = new PdfRectangle(); + object obj = this[key]; + if (obj == null) + { + if (create) + this[key] = value = new PdfRectangle(); + return value; + } + if (obj is PdfReference) + obj = ((PdfReference)obj).Value; + + PdfArray array = obj as PdfArray; + if (array != null && array.Elements.Count == 4) + { + value = new PdfRectangle(array.Elements.GetReal(0), array.Elements.GetReal(1), + array.Elements.GetReal(2), array.Elements.GetReal(3)); + this[key] = value; + } + else + value = (PdfRectangle)obj; + return value; + } + + /// + /// Converts the specified value to PdfRectangle. + /// If the value does not exist, the function returns an empty rectangle. + /// If the value is not convertible, the function throws an InvalidCastException. + /// + public PdfRectangle GetRectangle(string key) + { + return GetRectangle(key, false); + } + + /// + /// Sets the entry to a direct rectangle value, represented by an array with four values. + /// + public void SetRectangle(string key, PdfRectangle rect) + { + _elements[key] = rect; + } + + /// Converts the specified value to XMatrix. + /// If the value does not exist, the function returns an identity matrix. + /// If the value is not convertible, the function throws an InvalidCastException. + public XMatrix GetMatrix(string key, bool create) + { + XMatrix value = new XMatrix(); + object obj = this[key]; + if (obj == null) + { + if (create) + this[key] = new PdfLiteral("[1 0 0 1 0 0]"); // cannot be parsed, implement a PdfMatrix... + return value; + } + PdfReference reference = obj as PdfReference; + if (reference != null) + obj = reference.Value; + + PdfArray array = obj as PdfArray; + if (array != null && array.Elements.Count == 6) + { + value = new XMatrix(array.Elements.GetReal(0), array.Elements.GetReal(1), array.Elements.GetReal(2), + array.Elements.GetReal(3), array.Elements.GetReal(4), array.Elements.GetReal(5)); + } + else if (obj is PdfLiteral) + { + throw new NotImplementedException("Parsing matrix from literal."); + } + else + throw new InvalidCastException("Element is not an array with 6 values."); + return value; + } + + /// Converts the specified value to XMatrix. + /// If the value does not exist, the function returns an identity matrix. + /// If the value is not convertible, the function throws an InvalidCastException. + public XMatrix GetMatrix(string key) + { + return GetMatrix(key, false); + } + + /// + /// Sets the entry to a direct matrix value, represented by an array with six values. + /// + public void SetMatrix(string key, XMatrix matrix) + { + _elements[key] = PdfLiteral.FromMatrix(matrix); + } + + /// + /// Converts the specified value to DateTime. + /// If the value does not exist, the function returns the specified default value. + /// If the value is not convertible, the function throws an InvalidCastException. + /// + public DateTime GetDateTime(string key, DateTime defaultValue) + { + object obj = this[key]; + if (obj == null) + { + return defaultValue; + } + + PdfReference reference = obj as PdfReference; + if (reference != null) + obj = reference.Value; + + PdfDate date = obj as PdfDate; + if (date != null) + return date.Value; + + string strDate; + PdfString pdfString = obj as PdfString; + if (pdfString != null) + strDate = pdfString.Value; + else + { + PdfStringObject stringObject = obj as PdfStringObject; + if (stringObject != null) + strDate = stringObject.Value; + else + throw new InvalidCastException("GetName: Object is not a name."); + } + + if (strDate != "") + { + try + { + defaultValue = Parser.ParseDateTime(strDate, defaultValue); + } + // ReSharper disable EmptyGeneralCatchClause + catch { } + // ReSharper restore EmptyGeneralCatchClause + } + return defaultValue; + } + + /// + /// Sets the entry to a direct datetime value. + /// + public void SetDateTime(string key, DateTime value) + { + _elements[key] = new PdfDate(value); + } + + internal int GetEnumFromName(string key, object defaultValue, bool create) + { + if (!(defaultValue is Enum)) + throw new ArgumentException("defaultValue"); + + object obj = this[key]; + if (obj == null) + { + if (create) + this[key] = new PdfName(defaultValue.ToString()); + + // ReSharper disable once PossibleInvalidCastException because Enum objects can always be casted to int. + return (int)defaultValue; + } + Debug.Assert(obj is Enum); + return (int)Enum.Parse(defaultValue.GetType(), obj.ToString().Substring(1), false); + } + + internal int GetEnumFromName(string key, object defaultValue) + { + return GetEnumFromName(key, defaultValue, false); + } + + internal void SetEnumAsName(string key, object value) + { + if (!(value is Enum)) + throw new ArgumentException("value"); + _elements[key] = new PdfName("/" + value); + } + + /// + /// Gets the value for the specified key. If the value does not exist, it is optionally created. + /// + public PdfItem GetValue(string key, VCF options) + { + PdfObject obj; + PdfDictionary dict; + PdfArray array; + PdfReference iref; + PdfItem value = this[key]; + if (value == null || + value is PdfNull || + value is PdfReference && ((PdfReference)value).Value is PdfNullObject) + { + if (options != VCF.None) + { +#if NETFX_CORE && DEBUG_ + if (key == "/Resources") + Debug-Break.Break(); +#endif + Type type = GetValueType(key); + if (type != null) + { +#if !NETFX_CORE + Debug.Assert(typeof(PdfItem).IsAssignableFrom(type), "Type not allowed."); + if (typeof(PdfDictionary).IsAssignableFrom(type)) + { + value = obj = CreateDictionary(type, null); + } + else if (typeof(PdfArray).IsAssignableFrom(type)) + { + value = obj = CreateArray(type, null); + } + else + throw new NotImplementedException("Type other than array or dictionary."); +#else + // Rewritten WinRT style. + TypeInfo typeInfo = type.GetTypeInfo(); + Debug.Assert(typeof(PdfItem).GetTypeInfo().IsAssignableFrom(typeInfo), "Type not allowed."); + if (typeof(PdfDictionary).GetTypeInfo().IsAssignableFrom(typeInfo)) + { + value = obj = CreateDictionary(type, null); + } + else if (typeof(PdfArray).GetTypeInfo().IsAssignableFrom(typeInfo)) + { + value = obj = CreateArray(type, null); + } + else + throw new NotImplementedException("Type other than array or dictionary."); +#endif + if (options == VCF.CreateIndirect) + { + _ownerDictionary.Owner._irefTable.Add(obj); + this[key] = obj.Reference; + } + else + this[key] = obj; + } + else + throw new NotImplementedException("Cannot create value for key: " + key); + } + } + else + { + // The value exists and can be returned. But for imported documents check for necessary + // object type transformation. + if ((iref = value as PdfReference) != null) + { + // Case: value is an indirect reference. + value = iref.Value; + if (value == null) + { + // If we come here PDF file is corrupted. + throw new InvalidOperationException("Indirect reference without value."); + } + + if (true) // || _owner.Document.IsImported) + { + Type type = GetValueType(key); + Debug.Assert(type != null, "No value type specified in meta information. Please send this file to PDFsharp support."); + +#if !NETFX_CORE + if (type != null && type != value.GetType()) + { + if (typeof(PdfDictionary).IsAssignableFrom(type)) + { + Debug.Assert(value is PdfDictionary, "Bug in PDFsharp. Please send this file to PDFsharp support."); + value = CreateDictionary(type, (PdfDictionary)value); + } + else if (typeof(PdfArray).IsAssignableFrom(type)) + { + Debug.Assert(value is PdfArray, "Bug in PDFsharp. Please send this file to PDFsharp support."); + value = CreateArray(type, (PdfArray)value); + } + else + throw new NotImplementedException("Type other than array or dictionary."); + } +#else + // Rewritten WinRT style. + TypeInfo typeInfo = type.GetTypeInfo(); + if (type != null && type != value.GetType()) + { + if (typeof(PdfDictionary).GetTypeInfo().IsAssignableFrom(typeInfo)) + { + Debug.Assert(value is PdfDictionary, "Bug in PDFsharp. Please send this file to PDFsharp support."); + value = CreateDictionary(type, (PdfDictionary)value); + } + else if (typeof(PdfArray).GetTypeInfo().IsAssignableFrom(typeInfo)) + { + Debug.Assert(value is PdfArray, "Bug in PDFsharp. Please send this file to PDFsharp support."); + value = CreateArray(type, (PdfArray)value); + } + else + throw new NotImplementedException("Type other than array or dictionary."); + } +#endif + } + return value; + } + + // Transformation is only possible after PDF import. + if (true) // || _owner.Document.IsImported) + { + // Case: value is a direct object + if ((dict = value as PdfDictionary) != null) + { + Debug.Assert(!dict.IsIndirect); + + Type type = GetValueType(key); + Debug.Assert(type != null, "No value type specified in meta information. Please send this file to PDFsharp support."); + if (dict.GetType() != type) + dict = CreateDictionary(type, dict); + return dict; + } + + if ((array = value as PdfArray) != null) + { + Debug.Assert(!array.IsIndirect); + + Type type = GetValueType(key); + // This is more complicated. If type is null do nothing + //Debug.Assert(type != null, "No value type specified in meta information. Please send this file to PDFsharp support."); + if (type != null && type != array.GetType()) + array = CreateArray(type, array); + return array; + } + } + } + return value; + } + + /// + /// Short cut for GetValue(key, VCF.None). + /// + public PdfItem GetValue(string key) + { + return GetValue(key, VCF.None); + } + + /// + /// Returns the type of the object to be created as value of the specified key. + /// + Type GetValueType(string key) // TODO: move to PdfObject + { + Type type = null; + DictionaryMeta meta = _ownerDictionary.Meta; + if (meta != null) + { + KeyDescriptor kd = meta[key]; + if (kd != null) + type = kd.GetValueType(); + //else + // Debug.WriteLine("Warning: Key not descriptor table: " + key); // TODO: check what this means... + } + //else + // Debug.WriteLine("Warning: No meta provided for type: " + _owner.GetType().Name); // TODO: check what this means... + return type; + } + + PdfArray CreateArray(Type type, PdfArray oldArray) + { +#if !NETFX_CORE && !UWP + ConstructorInfo ctorInfo; + PdfArray array; + if (oldArray == null) + { + // Use constructor with signature 'Ctor(PdfDocument owner)'. + ctorInfo = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, + null, new Type[] { typeof(PdfDocument) }, null); + Debug.Assert(ctorInfo != null, "No appropriate constructor found for type: " + type.Name); + array = ctorInfo.Invoke(new object[] { _ownerDictionary.Owner }) as PdfArray; + } + else + { + // Use constructor with signature 'Ctor(PdfDictionary dict)'. + ctorInfo = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, + null, new Type[] { typeof(PdfArray) }, null); + Debug.Assert(ctorInfo != null, "No appropriate constructor found for type: " + type.Name); + array = ctorInfo.Invoke(new object[] { oldArray }) as PdfArray; + } + return array; +#else + // Rewritten WinRT style. + PdfArray array = null; + if (oldArray == null) + { + // Use constructor with signature 'Ctor(PdfDocument owner)'. + var ctorInfos = type.GetTypeInfo().DeclaredConstructors; //.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, + //null, new Type[] { typeof(PdfDocument) }, null); + foreach (var ctorInfo in ctorInfos) + { + var parameters = ctorInfo.GetParameters(); + if (parameters.Length == 1 && parameters[0].ParameterType == typeof(PdfDocument)) + { + array = ctorInfo.Invoke(new object[] { _ownerDictionary.Owner }) as PdfArray; + break; + } + } + Debug.Assert(array != null, "No appropriate constructor found for type: " + type.Name); + } + else + { + // Use constructor with signature 'Ctor(PdfDictionary dict)'. + var ctorInfos = type.GetTypeInfo().DeclaredConstructors; // .GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, + //null, new Type[] { typeof(PdfArray) }, null); + foreach (var ctorInfo in ctorInfos) + { + var parameters = ctorInfo.GetParameters(); + if (parameters.Length == 1 && parameters[0].ParameterType == typeof(PdfArray)) + { + array = ctorInfo.Invoke(new object[] { oldArray }) as PdfArray; + break; + } + } + Debug.Assert(array != null, "No appropriate constructor found for type: " + type.Name); + } + return array; +#endif + } + + PdfDictionary CreateDictionary(Type type, PdfDictionary oldDictionary) + { +#if !NETFX_CORE && !UWP + ConstructorInfo ctorInfo; + PdfDictionary dict; + if (oldDictionary == null) + { + // Use constructor with signature 'Ctor(PdfDocument owner)'. + ctorInfo = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, + null, new Type[] { typeof(PdfDocument) }, null); + Debug.Assert(ctorInfo != null, "No appropriate constructor found for type: " + type.Name); + dict = ctorInfo.Invoke(new object[] { _ownerDictionary.Owner }) as PdfDictionary; + } + else + { + // Use constructor with signature 'Ctor(PdfDictionary dict)'. + ctorInfo = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, + null, new Type[] { typeof(PdfDictionary) }, null); + Debug.Assert(ctorInfo != null, "No appropriate constructor found for type: " + type.Name); + dict = ctorInfo.Invoke(new object[] { oldDictionary }) as PdfDictionary; + } + return dict; +#else + // Rewritten WinRT style. + PdfDictionary dict = null; + if (oldDictionary == null) + { + // Use constructor with signature 'Ctor(PdfDocument owner)'. + var ctorInfos = type.GetTypeInfo().DeclaredConstructors; //GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, + //null, new Type[] { typeof(PdfDocument) }, null); + foreach (var ctorInfo in ctorInfos) + { + var parameters = ctorInfo.GetParameters(); + if (parameters.Length == 1 && parameters[0].ParameterType == typeof(PdfDocument)) + { + dict = ctorInfo.Invoke(new object[] { _ownerDictionary.Owner }) as PdfDictionary; + break; + } + } + Debug.Assert(dict != null, "No appropriate constructor found for type: " + type.Name); + } + else + { + var ctorInfos = type.GetTypeInfo().DeclaredConstructors; // GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[] { typeof(PdfDictionary) }, null); + foreach (var ctorInfo in ctorInfos) + { + var parameters = ctorInfo.GetParameters(); + if (parameters.Length == 1 && parameters[0].ParameterType == typeof(PdfDictionary)) + { + dict = ctorInfo.Invoke(new object[] { _ownerDictionary.Owner }) as PdfDictionary; + break; + } + } + Debug.Assert(dict != null, "No appropriate constructor found for type: " + type.Name); + } + return dict; +#endif + } + + PdfItem CreateValue(Type type, PdfDictionary oldValue) + { +#if !NETFX_CORE && !UWP + ConstructorInfo ctorInfo = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, + null, new Type[] { typeof(PdfDocument) }, null); + PdfObject obj = ctorInfo.Invoke(new object[] { _ownerDictionary.Owner }) as PdfObject; + if (oldValue != null) + { + obj.Reference = oldValue.Reference; + obj.Reference.Value = obj; + if (obj is PdfDictionary) + { + PdfDictionary dict = (PdfDictionary)obj; + dict._elements = oldValue._elements; + } + } + return obj; +#else + // Rewritten WinRT style. + PdfObject obj = null; + var ctorInfos = type.GetTypeInfo().DeclaredConstructors; // GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[] { typeof(PdfDocument) }, null); + foreach (var ctorInfo in ctorInfos) + { + var parameters = ctorInfo.GetParameters(); + if (parameters.Length == 1 && parameters[0].ParameterType == typeof(PdfDocument)) + { + obj = ctorInfo.Invoke(new object[] { _ownerDictionary.Owner }) as PdfObject; + break; + } + } + Debug.Assert(obj != null, "No appropriate constructor found for type: " + type.Name); + if (oldValue != null) + { + obj.Reference = oldValue.Reference; + obj.Reference.Value = obj; + if (obj is PdfDictionary) + { + PdfDictionary dict = (PdfDictionary)obj; + dict._elements = oldValue._elements; + } + } + return obj; +#endif + } + + /// + /// Sets the entry with the specified value. DON'T USE THIS FUNCTION - IT MAY BE REMOVED. + /// + public void SetValue(string key, PdfItem value) + { + Debug.Assert((value is PdfObject && ((PdfObject)value).Reference == null) | !(value is PdfObject), + "You try to set an indirect object directly into a dictionary."); + + // HACK? + _elements[key] = value; + } + + ///// + ///// Returns the indirect object if the value of the specified key is a PdfReference. + ///// + //[Obsolete("Use GetObject, GetDictionary, GetArray, or GetReference")] + //public PdfObject GetIndirectObject(string key) + //{ + // PdfItem item = this[key]; + // if (item is PdfReference) + // return ((PdfReference)item).Value; + // return null; + //} + + /// + /// Gets the PdfObject with the specified key, or null, if no such object exists. If the key refers to + /// a reference, the referenced PdfObject is returned. + /// + public PdfObject GetObject(string key) + { + PdfItem item = this[key]; + PdfReference reference = item as PdfReference; + if (reference != null) + return reference.Value; + return item as PdfObject; + } + + /// + /// Gets the PdfDictionary with the specified key, or null, if no such object exists. If the key refers to + /// a reference, the referenced PdfDictionary is returned. + /// + public PdfDictionary GetDictionary(string key) + { + return GetObject(key) as PdfDictionary; + } + + /// + /// Gets the PdfArray with the specified key, or null, if no such object exists. If the key refers to + /// a reference, the referenced PdfArray is returned. + /// + public PdfArray GetArray(string key) + { + return GetObject(key) as PdfArray; + } + + /// + /// Gets the PdfReference with the specified key, or null, if no such object exists. + /// + public PdfReference GetReference(string key) + { + PdfItem item = this[key]; + return item as PdfReference; + } + + /// + /// Sets the entry to the specified object. The object must not be an indirect object, + /// otherwise an exception is raised. + /// + public void SetObject(string key, PdfObject obj) + { + if (obj.Reference != null) + throw new ArgumentException("PdfObject must not be an indirect object.", "obj"); + this[key] = obj; + } + + /// + /// Sets the entry as a reference to the specified object. The object must be an indirect object, + /// otherwise an exception is raised. + /// + public void SetReference(string key, PdfObject obj) + { + if (obj.Reference == null) + throw new ArgumentException("PdfObject must be an indirect object.", "obj"); + this[key] = obj.Reference; + } + + /// + /// Sets the entry as a reference to the specified iref. + /// + public void SetReference(string key, PdfReference iref) + { + if (iref == null) + throw new ArgumentNullException("iref"); + this[key] = iref; + } + + #region IDictionary Members + + /// + /// Gets a value indicating whether the object is read-only. + /// + public bool IsReadOnly + { + get { return false; } + } + + /// + /// Returns an object for the object. + /// + public IEnumerator> GetEnumerator() + { + return _elements.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return ((ICollection)_elements).GetEnumerator(); + } + + /// + /// Gets or sets an entry in the dictionary. The specified key must be a valid PDF name + /// starting with a slash '/'. This property provides full access to the elements of the + /// PDF dictionary. Wrong use can lead to errors or corrupt PDF files. + /// + public PdfItem this[string key] + { + get + { + PdfItem item; + _elements.TryGetValue(key, out item); + return item; + } + set + { + if (value == null) + throw new ArgumentNullException("value"); +#if DEBUG_ + if (key == "/MediaBox") + key.GetType(); + + //if (value is PdfObject) + //{ + // PdfObject obj = (PdfObject)value; + // if (obj.Reference != null) + // throw new ArgumentException("An object with an indirect reference cannot be a direct value. Try to set an indirect reference."); + //} + if (value is PdfDictionary) + { + PdfDictionary dict = (PdfDictionary)value; + if (dict._stream != null) + throw new ArgumentException("A dictionary with stream cannot be a direct value."); + } +#endif + PdfObject obj = value as PdfObject; + if (obj != null && obj.IsIndirect) + value = obj.Reference; + _elements[key] = value; + } + } + + /// + /// Gets or sets an entry in the dictionary identified by a PdfName object. + /// + public PdfItem this[PdfName key] + { + get { return this[key.Value]; } + set + { + if (value == null) + throw new ArgumentNullException("value"); + +#if DEBUG + PdfDictionary dictionary = value as PdfDictionary; + if (dictionary != null) + { + PdfDictionary dict = dictionary; + if (dict._stream != null) + throw new ArgumentException("A dictionary with stream cannot be a direct value."); + } +#endif + + PdfObject obj = value as PdfObject; + if (obj != null && obj.IsIndirect) + value = obj.Reference; + _elements[key.Value] = value; + } + } + + /// + /// Removes the value with the specified key. + /// + public bool Remove(string key) + { + return _elements.Remove(key); + } + + /// + /// Removes the value with the specified key. + /// + public bool Remove(KeyValuePair item) + { + throw new NotImplementedException(); + } + + ///// + ///// Determines whether the dictionary contains the specified name. + ///// + //[Obsolete("Use ContainsKey.")] + //public bool Contains(string key) + //{ + // return _elements.ContainsKey(key); + //} + + /// + /// Determines whether the dictionary contains the specified name. + /// + public bool ContainsKey(string key) + { + return _elements.ContainsKey(key); + } + + /// + /// Determines whether the dictionary contains a specific value. + /// + public bool Contains(KeyValuePair item) + { + throw new NotImplementedException(); + } + + /// + /// Removes all elements from the dictionary. + /// + public void Clear() + { + _elements.Clear(); + } + + /// + /// Adds the specified value to the dictionary. + /// + public void Add(string key, PdfItem value) + { + if (String.IsNullOrEmpty(key)) + throw new ArgumentNullException("key"); + + if (key[0] != '/') + throw new ArgumentException("The key must start with a slash '/'."); + + // If object is indirect automatically convert value to reference. + PdfObject obj = value as PdfObject; + if (obj != null && obj.IsIndirect) + value = obj.Reference; + + _elements.Add(key, value); + } + + /// + /// Adds an item to the dictionary. + /// + public void Add(KeyValuePair item) + { + Add(item.Key, item.Value); + } + + /// + /// Gets all keys currently in use in this dictionary as an array of PdfName objects. + /// + public PdfName[] KeyNames + { + get + { + ICollection values = _elements.Keys; + int count = values.Count; + string[] strings = new string[count]; + values.CopyTo(strings, 0); + PdfName[] names = new PdfName[count]; + for (int idx = 0; idx < count; idx++) + names[idx] = new PdfName(strings[idx]); + return names; + } + } + + /// + /// Get all keys currently in use in this dictionary as an array of string objects. + /// + public ICollection Keys + { + // It is by design not to return _elements.Keys, but a copy. + get + { + ICollection values = _elements.Keys; + int count = values.Count; + string[] keys = new string[count]; + values.CopyTo(keys, 0); + return keys; + } + } + + /// + /// Gets the value associated with the specified key. + /// + public bool TryGetValue(string key, out PdfItem value) + { + return _elements.TryGetValue(key, out value); + } + + /// + /// Gets all values currently in use in this dictionary as an array of PdfItem objects. + /// + //public ICollection Values + public ICollection Values + { + // It is by design not to return _elements.Values, but a copy. + get + { + ICollection values = _elements.Values; + PdfItem[] items = new PdfItem[values.Count]; + values.CopyTo(items, 0); + return items; + } + } + + /// + /// Return false. + /// + public bool IsFixedSize + { + get { return false; } + } + + #endregion + + #region ICollection Members + + /// + /// Return false. + /// + public bool IsSynchronized + { + get { return false; } + } + + /// + /// Gets the number of elements contained in the dictionary. + /// + public int Count + { + get { return _elements.Count; } + } + + /// + /// Copies the elements of the dictionary to an array, starting at a particular index. + /// + public void CopyTo(KeyValuePair[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + /// + /// The current implementation returns null. + /// + public object SyncRoot + { + get { return null; } + } + + #endregion + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + // ReSharper disable UnusedMember.Local + internal string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get + { + StringBuilder sb = new StringBuilder(); + sb.AppendFormat(CultureInfo.InvariantCulture, "key={0}:(", _elements.Count); + bool addSpace = false; + ICollection keys = _elements.Keys; + foreach (string key in keys) + { + if (addSpace) + sb.Append(' '); + addSpace = true; + sb.Append(key); + } + sb.Append(")"); + return sb.ToString(); + } + } + + /// + /// The elements of the dictionary with a string as key. + /// Because the string is a name it starts always with a '/'. + /// + Dictionary _elements; + + /// + /// The dictionary this objects belongs to. + /// + PdfDictionary _ownerDictionary; + } + + /// + /// The PDF stream objects. + /// + public sealed class PdfStream + { + internal PdfStream(PdfDictionary ownerDictionary) + { + if (ownerDictionary == null) + throw new ArgumentNullException("ownerDictionary"); + _ownerDictionary = ownerDictionary; + } + + /// + /// A .NET string can contain char(0) as a valid character. + /// + internal PdfStream(byte[] value, PdfDictionary owner) + : this(owner) + { + _value = value; + } + + /// + /// Clones this stream by creating a deep copy. + /// + public PdfStream Clone() + { + PdfStream stream = (PdfStream)MemberwiseClone(); + stream._ownerDictionary = null; + if (stream._value != null) + { + stream._value = new byte[stream._value.Length]; + _value.CopyTo(stream._value, 0); + } + return stream; + } + + /// + /// Moves this instance to another dictionary during object type transformation. + /// + internal void ChangeOwner(PdfDictionary dict) + { + if (_ownerDictionary != null) + { + // ??? + } + + // Set new owner. + _ownerDictionary = dict; + + // Set owners stream to this. + _ownerDictionary._stream = this; + } + + /// + /// The dictionary the stream belongs to. + /// + PdfDictionary _ownerDictionary; + + /// + /// Gets the length of the stream, i.e. the actual number of bytes in the stream. + /// + public int Length + { + get { return _value != null ? _value.Length : 0; } + } + + /// + /// Gets a value indicating whether this stream has decode parameters. + /// + internal bool HasDecodeParams + { + // TODO: Move to Stream.Internals + get + { + // TODO: DecodeParams can be an array. + PdfDictionary dictionary = _ownerDictionary.Elements.GetDictionary(Keys.DecodeParms); + if (dictionary != null) + { + // More to do here? + return true; + } + return false; + } + } + + /// + /// Gets the decode predictor for LZW- or FlateDecode. + /// Returns 0 if no such value exists. + /// + internal int DecodePredictor // Reference: TABLE 3.8 Predictor values / Page 76 + { + get + { + PdfDictionary dictionary = _ownerDictionary.Elements.GetDictionary(Keys.DecodeParms); + if (dictionary != null) + { + return dictionary.Elements.GetInteger("/Predictor"); + } + return 0; + } + } + + /// + /// Gets the decode Columns for LZW- or FlateDecode. + /// Returns 0 if no such value exists. + /// + internal int DecodeColumns // Reference: TABLE 3.8 Predictor values / Page 76 + { + get + { + PdfDictionary dictionary = _ownerDictionary.Elements.GetDictionary(Keys.DecodeParms); + if (dictionary != null) + { + return dictionary.Elements.GetInteger("/Columns"); + } + return 0; + } + } + + /// + /// Get or sets the bytes of the stream as they are, i.e. if one or more filters exist the bytes are + /// not unfiltered. + /// + public byte[] Value + { + get { return _value; } + set + { + if (value == null) + throw new ArgumentNullException("value"); + _value = value; + _ownerDictionary.Elements.SetInteger(Keys.Length, value.Length); + } + } + byte[] _value; + + /// + /// Gets the value of the stream unfiltered. The stream content is not modified by this operation. + /// + public byte[] UnfilteredValue + { + get + { + byte[] bytes = null; + if (_value != null) + { + PdfItem filter = _ownerDictionary.Elements["/Filter"]; + if (filter != null) + { + bytes = Filtering.Decode(_value, filter); + if (bytes == null) + { + string message = String.Format("«Cannot decode filter '{0}'»", filter); + bytes = PdfEncoders.RawEncoding.GetBytes(message); + } + } + else + { + bytes = new byte[_value.Length]; + _value.CopyTo(bytes, 0); + } + } + return bytes ?? new byte[0]; + } + } + + /// + /// Tries to unfilter the bytes of the stream. If the stream is filtered and PDFsharp knows the filter + /// algorithm, the stream content is replaced by its unfiltered value and the function returns true. + /// Otherwise the content remains untouched and the function returns false. + /// The function is useful for analyzing existing PDF files. + /// + public bool TryUnfilter() // TODO: Take DecodeParams into account. + { + if (_value != null) + { + PdfItem filter = _ownerDictionary.Elements["/Filter"]; + if (filter != null) + { + // PDFsharp can only uncompress streams that are compressed with the ZIP or LZH algorithm. + byte[] bytes = Filtering.Decode(_value, filter); + if (bytes != null) + { + _ownerDictionary.Elements.Remove(Keys.Filter); + Value = bytes; + } + else + return false; + } + } + return true; + } + + /// + /// Compresses the stream with the FlateDecode filter. + /// If a filter is already defined, the function has no effect. + /// + public void Zip() + { + if (_value == null) + return; + + if (!_ownerDictionary.Elements.ContainsKey("/Filter")) + { + _value = Filtering.FlateDecode.Encode(_value, _ownerDictionary._document.Options.FlateEncodeMode); + _ownerDictionary.Elements["/Filter"] = new PdfName("/FlateDecode"); + _ownerDictionary.Elements["/Length"] = new PdfInteger(_value.Length); + } + } + + /// + /// Returns the stream content as a raw string. + /// + public override string ToString() + { + if (_value == null) + return "«null»"; + + string stream; + PdfItem filter = _ownerDictionary.Elements["/Filter"]; + if (filter != null) + { +#if true + byte[] bytes = Filtering.Decode(_value, filter); + if (bytes != null) + stream = PdfEncoders.RawEncoding.GetString(bytes, 0, bytes.Length); +#else + + if (_owner.Elements.GetString("/Filter") == "/FlateDecode") + { + stream = Filtering.FlateDecode.DecodeToString(_value); + } +#endif + else + throw new NotImplementedException("Unknown filter"); + } + else + stream = PdfEncoders.RawEncoding.GetString(_value, 0, _value.Length); + + return stream; + } + + //internal void WriteObject_(Stream stream) + //{ + // if (_value != null) + // stream.Write(_value, 0, value.Length); + //} + + ///// + ///// Converts a raw encoded string into a byte array. + ///// + //public static byte[] RawEncode(string content) + //{ + // return PdfEncoders.RawEncoding.GetBytes(content); + //} + + /// + /// Common keys for all streams. + /// + public class Keys : KeysBase + { + // ReSharper disable InconsistentNaming + + /// + /// (Required) The number of bytes from the beginning of the line following the keyword + /// stream to the last byte just before the keyword endstream. (There may be an additional + /// EOL marker, preceding endstream, that is not included in the count and is not logically + /// part of the stream data.) + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string Length = "/Length"; + + /// + /// (Optional) The name of a filter to be applied in processing the stream data found between + /// the keywords stream and endstream, or an array of such names. Multiple filters should be + /// specified in the order in which they are to be applied. + /// + [KeyInfo(KeyType.NameOrArray | KeyType.Optional)] + public const string Filter = "/Filter"; + + /// + /// (Optional) A parameter dictionary or an array of such dictionaries, used by the filters + /// specified by Filter. If there is only one filter and that filter has parameters, DecodeParms + /// must be set to the filter’s parameter dictionary unless all the filter’s parameters have + /// their default values, in which case the DecodeParms entry may be omitted. If there are + /// multiple filters and any of the filters has parameters set to nondefault values, DecodeParms + /// must be an array with one entry for each filter: either the parameter dictionary for that + /// filter, or the null object if that filter has no parameters (or if all of its parameters have + /// their default values). If none of the filters have parameters, or if all their parameters + /// have default values, the DecodeParms entry may be omitted. + /// + [KeyInfo(KeyType.ArrayOrDictionary | KeyType.Optional)] + public const string DecodeParms = "/DecodeParms"; + + /// + /// (Optional; PDF 1.2) The file containing the stream data. If this entry is present, the bytes + /// between stream and endstream are ignored, the filters are specified by FFilter rather than + /// Filter, and the filter parameters are specified by FDecodeParms rather than DecodeParms. + /// However, the Length entry should still specify the number of those bytes. (Usually, there are + /// no bytes and Length is 0.) + /// + [KeyInfo("1.2", KeyType.String | KeyType.Optional)] + public const string F = "/F"; + + /// + /// (Optional; PDF 1.2) The name of a filter to be applied in processing the data found in the + /// stream’s external file, or an array of such names. The same rules apply as for Filter. + /// + [KeyInfo("1.2", KeyType.NameOrArray | KeyType.Optional)] + public const string FFilter = "/FFilter"; + + /// + /// (Optional; PDF 1.2) A parameter dictionary, or an array of such dictionaries, used by the + /// filters specified by FFilter. The same rules apply as for DecodeParms. + /// + [KeyInfo("1.2", KeyType.ArrayOrDictionary | KeyType.Optional)] + public const string FDecodeParms = "/FDecodeParms"; + + /// + /// Optional; PDF 1.5) A non-negative integer representing the number of bytes in the decoded + /// (defiltered) stream. It can be used to determine, for example, whether enough disk space is + /// available to write a stream to a file. + /// This value should be considered a hint only; for some stream filters, it may not be possible + /// to determine this value precisely. + /// + [KeyInfo("1.5", KeyType.Integer | KeyType.Optional)] + public const string DL = "/DL"; + + // ReSharper restore InconsistentNaming + } + } + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + // ReSharper disable UnusedMember.Local + string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get + { +#if true + return String.Format(CultureInfo.InvariantCulture, "dictionary({0},[{1}])={2}", + ObjectID.DebuggerDisplay, + Elements.Count, + _elements.DebuggerDisplay); +#else + return String.Format(CultureInfo.InvariantCulture, "dictionary({0},[{1}])=", ObjectID.DebuggerDisplay, _elements.DebuggerDisplay); +#endif + } + } + } +} diff --git a/PdfSharp/Pdf/PdfDocument.cs b/PdfSharp/Pdf/PdfDocument.cs new file mode 100644 index 0000000..188e3d7 --- /dev/null +++ b/PdfSharp/Pdf/PdfDocument.cs @@ -0,0 +1,958 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.IO; +#if NETFX_CORE +using System.Threading.Tasks; +#endif +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.Internal; +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.AcroForms; +using PdfSharp.Pdf.Security; + +// ReSharper disable ConvertPropertyToExpressionBody + +namespace PdfSharp.Pdf +{ + /// + /// Represents a PDF document. + /// + [DebuggerDisplay("(Name={Name})")] // A name makes debugging easier + public sealed class PdfDocument : PdfObject, IDisposable + { + internal DocumentState _state; + internal PdfDocumentOpenMode _openMode; + +#if DEBUG_ + static PdfDocument() + { + PSSR.TestResourceMessages(); + //string test = PSSR.ResMngr.GetString("SampleMessage1"); + //test.GetType(); + } +#endif + + /// + /// Creates a new PDF document in memory. + /// To open an existing PDF file, use the PdfReader class. + /// + public PdfDocument() + { + //PdfDocument.Gob.AttatchDocument(Handle); + + _creation = DateTime.Now; + _state = DocumentState.Created; + _version = 14; + Initialize(); + Info.CreationDate = _creation; + } + + /// + /// Creates a new PDF document with the specified file name. The file is immediately created and keeps + /// locked until the document is closed, at that time the document is saved automatically. + /// Do not call Save() for documents created with this constructor, just call Close(). + /// To open an existing PDF file and import it, use the PdfReader class. + /// + public PdfDocument(string filename) + { + //PdfDocument.Gob.AttatchDocument(Handle); + + _creation = DateTime.Now; + _state = DocumentState.Created; + _version = 14; + Initialize(); + Info.CreationDate = _creation; + + // TODO 4STLA: encapsulate the whole c'tor with #if !NETFX_CORE? +#if !NETFX_CORE + _outStream = new FileStream(filename, FileMode.Create); +#else + throw new NotImplementedException(); +#endif + } + + /// + /// Creates a new PDF document using the specified stream. + /// The stream won't be used until the document is closed, at that time the document is saved automatically. + /// Do not call Save() for documents created with this constructor, just call Close(). + /// To open an existing PDF file, use the PdfReader class. + /// + public PdfDocument(Stream outputStream) + { + //PdfDocument.Gob.AttatchDocument(Handle); + + _creation = DateTime.Now; + _state = DocumentState.Created; + Initialize(); + Info.CreationDate = _creation; + + _outStream = outputStream; + } + + internal PdfDocument(Lexer lexer) + { + //PdfDocument.Gob.AttatchDocument(Handle); + + _creation = DateTime.Now; + _state = DocumentState.Imported; + + //_info = new PdfInfo(this); + //_pages = new PdfPages(this); + //_fontTable = new PdfFontTable(); + //_catalog = new PdfCatalog(this); + ////_font = new PdfFont(); + //_objects = new PdfObjectTable(this); + //_trailer = new PdfTrailer(this); + _irefTable = new PdfCrossReferenceTable(this); + _lexer = lexer; + } + + void Initialize() + { + //_info = new PdfInfo(this); + _fontTable = new PdfFontTable(this); + _imageTable = new PdfImageTable(this); + _trailer = new PdfTrailer(this); + _irefTable = new PdfCrossReferenceTable(this); + _trailer.CreateNewDocumentIDs(); + } + + //~PdfDocument() + //{ + // Dispose(false); + //} + + /// + /// Disposes all references to this document stored in other documents. This function should be called + /// for documents you finished importing pages from. Calling Dispose is technically not necessary but + /// useful for earlier reclaiming memory of documents you do not need anymore. + /// + public void Dispose() + { + Dispose(true); + //GC.SuppressFinalize(this); + } + + void Dispose(bool disposing) + { + if (_state != DocumentState.Disposed) + { + if (disposing) + { + // Dispose managed resources. + } + //PdfDocument.Gob.DetatchDocument(Handle); + } + _state = DocumentState.Disposed; + } + + /// + /// Gets or sets a user defined object that contains arbitrary information associated with this document. + /// The tag is not used by PDFsharp. + /// + public object Tag + { + get { return _tag; } + set { _tag = value; } + } + object _tag; + + /// + /// Gets or sets a value used to distinguish PdfDocument objects. + /// The name is not used by PDFsharp. + /// + string Name + { + get { return _name; } + set { _name = value; } + } + string _name = NewName(); + + /// + /// Get a new default name for a new document. + /// + static string NewName() + { +#if DEBUG_ + if (PdfDocument.nameCount == 57) + PdfDocument.nameCount.GetType(); +#endif + return "Document " + _nameCount++; + } + static int _nameCount; + + internal bool CanModify + { + //get {return _state == DocumentState.Created || _state == DocumentState.Modifyable;} + get { return true; } + } + + /// + /// Closes this instance. + /// + public void Close() + { + if (!CanModify) + throw new InvalidOperationException(PSSR.CannotModify); + + if (_outStream != null) + { + // Get security handler if document gets encrypted + PdfStandardSecurityHandler securityHandler = null; + if (SecuritySettings.DocumentSecurityLevel != PdfDocumentSecurityLevel.None) + securityHandler = SecuritySettings.SecurityHandler; + + PdfWriter writer = new PdfWriter(_outStream, securityHandler); + try + { + DoSave(writer); + } + finally + { + writer.Close(); + } + } + } + +#if true //!NETFX_CORE + /// + /// Saves the document to the specified path. If a file already exists, it will be overwritten. + /// + public void Save(string path) + { + if (!CanModify) + throw new InvalidOperationException(PSSR.CannotModify); + +#if !NETFX_CORE + using (Stream stream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None)) + { + Save(stream); + } +#else + var task = SaveAsync(path, true); + + ////var file = await Windows.Storage.ApplicationData.Current.LocalFolder.CreateFileAsync("MyWav.wav", Windows.Storage.CreationCollisionOption.ReplaceExisting); + ////var stream = file.OpenStreamForWriteAsync(); + ////var writer = new StreamWriter(stream); + ////Save(stream); + + //var ms = new MemoryStream(); + //Save(ms, false); + //byte[] pdf = ms.ToArray(); + //ms.Close(); +#endif + } +#endif + +#if NETFX_CORE + /// + /// Saves the document to the specified path. If a file already exists, it will be overwritten. + /// + public async Task SaveAsync(string path, bool closeStream) + { + if (!CanModify) + throw new InvalidOperationException(PSSR.CannotModify); + + // Just march through... + + var file = await Windows.Storage.ApplicationData.Current.LocalFolder.CreateFileAsync("My1st.pdf", Windows.Storage.CreationCollisionOption.ReplaceExisting); + var stream = await file.OpenStreamForWriteAsync(); + using (var writer = new StreamWriter(stream)) + { + Save(stream, false); + } + + //var ms = new MemoryStream(); + //Save(ms, false); + //byte[] pdf = ms.ToArray(); + //ms.Close(); + //await stream.WriteAsync(pdf, 0, pdf.Length); + //stream.Close(); + } +#endif + + /// + /// Saves the document to the specified stream. + /// + public void Save(Stream stream, bool closeStream) + { + if (!CanModify) + throw new InvalidOperationException(PSSR.CannotModify); + + // TODO: more diagnostic checks + string message = ""; + if (!CanSave(ref message)) + throw new PdfSharpException(message); + + // Get security handler if document gets encrypted. + PdfStandardSecurityHandler securityHandler = null; + if (SecuritySettings.DocumentSecurityLevel != PdfDocumentSecurityLevel.None) + securityHandler = SecuritySettings.SecurityHandler; + + PdfWriter writer = null; + try + { + writer = new PdfWriter(stream, securityHandler); + DoSave(writer); + } + finally + { + if (stream != null) + { + if (closeStream) +#if UWP + stream.Dispose(); +#else + stream.Close(); +#endif + else + { + if (stream.CanRead && stream.CanSeek) + stream.Position = 0; // Reset the stream position if the stream is kept open. + } + } + if (writer != null) + writer.Close(closeStream); + } + } + + /// + /// Saves the document to the specified stream. + /// The stream is not closed by this function. + /// (Older versions of PDFsharp closes the stream. That was not very useful.) + /// + public void Save(Stream stream) + { + Save(stream, false); + } + + /// + /// Implements saving a PDF file. + /// + void DoSave(PdfWriter writer) + { + if (_pages == null || _pages.Count == 0) + { + if (_outStream != null) + { + // Give feedback if the wrong constructor was used. + throw new InvalidOperationException("Cannot save a PDF document with no pages. Do not use \"public PdfDocument(string filename)\" or \"public PdfDocument(Stream outputStream)\" if you want to open an existing PDF document from a file or stream; use PdfReader.Open() for that purpose."); + } + throw new InvalidOperationException("Cannot save a PDF document with no pages."); + } + + try + { + // HACK: Remove XRefTrailer + if (_trailer is PdfCrossReferenceStream) + { + // HACK^2: Preserve the SecurityHandler. + PdfStandardSecurityHandler securityHandler = _securitySettings.SecurityHandler; + _trailer = new PdfTrailer((PdfCrossReferenceStream)_trailer); + _trailer._securityHandler = securityHandler; + } + + bool encrypt = _securitySettings.DocumentSecurityLevel != PdfDocumentSecurityLevel.None; + if (encrypt) + { + PdfStandardSecurityHandler securityHandler = _securitySettings.SecurityHandler; + if (securityHandler.Reference == null) + _irefTable.Add(securityHandler); + else + Debug.Assert(_irefTable.Contains(securityHandler.ObjectID)); + _trailer.Elements[PdfTrailer.Keys.Encrypt] = _securitySettings.SecurityHandler.Reference; + } + else + _trailer.Elements.Remove(PdfTrailer.Keys.Encrypt); + + PrepareForSave(); + + if (encrypt) + _securitySettings.SecurityHandler.PrepareEncryption(); + + writer.WriteFileHeader(this); + PdfReference[] irefs = _irefTable.AllReferences; + int count = irefs.Length; + for (int idx = 0; idx < count; idx++) + { + PdfReference iref = irefs[idx]; +#if DEBUG_ + if (iref.ObjectNumber == 378) + GetType(); +#endif + iref.Position = writer.Position; + iref.Value.WriteObject(writer); + } + int startxref = writer.Position; + _irefTable.WriteObject(writer); + writer.WriteRaw("trailer\n"); + _trailer.Elements.SetInteger("/Size", count + 1); + _trailer.WriteObject(writer); + writer.WriteEof(this, startxref); + + //if (encrypt) + //{ + // state &= ~DocumentState.SavingEncrypted; + // //_securitySettings.SecurityHandler.EncryptDocument(); + //} + } + finally + { + if (writer != null) + { + writer.Stream.Flush(); + // DO NOT CLOSE WRITER HERE + //writer.Close(); + } + } + } + + /// + /// Dispatches PrepareForSave to the objects that need it. + /// + internal override void PrepareForSave() + { + PdfDocumentInformation info = Info; + + // Add patch level to producer if it is not '0'. + string pdfSharpProducer = VersionInfo.Producer; + if (!ProductVersionInfo.VersionPatch.Equals("0")) + pdfSharpProducer = ProductVersionInfo.Producer2; + + // Set Creator if value is undefined. + if (info.Elements[PdfDocumentInformation.Keys.Creator] == null) + info.Creator = pdfSharpProducer; + + // Keep original producer if file was imported. + string producer = info.Producer; + if (producer.Length == 0) + producer = pdfSharpProducer; + else + { + // Prevent endless concatenation if file is edited with PDFsharp more than once. + if (!producer.StartsWith(VersionInfo.Title)) + producer = pdfSharpProducer + " (Original: " + producer + ")"; + } + info.Elements.SetString(PdfDocumentInformation.Keys.Producer, producer); + + // Prepare used fonts. + if (_fontTable != null) + _fontTable.PrepareForSave(); + + // Let catalog do the rest. + Catalog.PrepareForSave(); + +#if true + // Remove all unreachable objects (e.g. from deleted pages) + int removed = _irefTable.Compact(); + if (removed != 0) + Debug.WriteLine("PrepareForSave: Number of deleted unreachable objects: " + removed); + _irefTable.Renumber(); +#endif + } + + /// + /// Determines whether the document can be saved. + /// + public bool CanSave(ref string message) + { + if (!SecuritySettings.CanSave(ref message)) + return false; + + return true; + } + + internal bool HasVersion(string version) + { + return String.Compare(Catalog.Version, version) >= 0; + } + + /// + /// Gets the document options used for saving the document. + /// + public PdfDocumentOptions Options + { + get + { + if (_options == null) + _options = new PdfDocumentOptions(this); + return _options; + } + } + PdfDocumentOptions _options; + + /// + /// Gets PDF specific document settings. + /// + public PdfDocumentSettings Settings + { + get + { + if (_settings == null) + _settings = new PdfDocumentSettings(this); + return _settings; + } + } + PdfDocumentSettings _settings; + + /// + /// NYI Indicates whether large objects are written immediately to the output stream to relieve + /// memory consumption. + /// + internal bool EarlyWrite + { + get { return false; } + } + + /// + /// Gets or sets the PDF version number. Return value 14 e.g. means PDF 1.4 / Acrobat 5 etc. + /// + public int Version + { + get { return _version; } + set + { + if (!CanModify) + throw new InvalidOperationException(PSSR.CannotModify); + if (value < 12 || value > 17) // TODO not really implemented + throw new ArgumentException(PSSR.InvalidVersionNumber, "value"); + _version = value; + } + } + internal int _version; + + /// + /// Gets the number of pages in the document. + /// + public int PageCount + { + get + { + if (CanModify) + return Pages.Count; + // PdfOpenMode is InformationOnly + PdfDictionary pageTreeRoot = (PdfDictionary)Catalog.Elements.GetObject(PdfCatalog.Keys.Pages); + return pageTreeRoot.Elements.GetInteger(PdfPages.Keys.Count); + } + } + + /// + /// Gets the file size of the document. + /// + public long FileSize + { + get { return _fileSize; } + } + internal long _fileSize; // TODO: make private + + /// + /// Gets the full qualified file name if the document was read form a file, or an empty string otherwise. + /// + public string FullPath + { + get { return _fullPath; } + } + internal string _fullPath = String.Empty; // TODO: make private + + /// + /// Gets a Guid that uniquely identifies this instance of PdfDocument. + /// + public Guid Guid + { + get { return _guid; } + } + Guid _guid = Guid.NewGuid(); + + internal DocumentHandle Handle + { + get + { + if (_handle == null) + _handle = new DocumentHandle(this); + return _handle; + } + } + DocumentHandle _handle; + + /// + /// Returns a value indicating whether the document was newly created or opened from an existing document. + /// Returns true if the document was opened with the PdfReader.Open function, false otherwise. + /// + public bool IsImported + { + get { return (_state & DocumentState.Imported) != 0; } + } + + /// + /// Returns a value indicating whether the document is read only or can be modified. + /// + public bool IsReadOnly + { + get { return (_openMode != PdfDocumentOpenMode.Modify); } + } + + internal Exception DocumentNotImported() + { + return new InvalidOperationException("Document not imported."); + } + + /// + /// Gets information about the document. + /// + public PdfDocumentInformation Info + { + get + { + if (_info == null) + _info = _trailer.Info; + return _info; + } + } + PdfDocumentInformation _info; // never changes if once created + + /// + /// This function is intended to be undocumented. + /// + public PdfCustomValues CustomValues + { + get + { + if (_customValues == null) + _customValues = PdfCustomValues.Get(Catalog.Elements); + return _customValues; + } + set + { + if (value != null) + throw new ArgumentException("Only null is allowed to clear all custom values."); + PdfCustomValues.Remove(Catalog.Elements); + _customValues = null; + } + } + PdfCustomValues _customValues; + + /// + /// Get the pages dictionary. + /// + public PdfPages Pages + { + get + { + if (_pages == null) + _pages = Catalog.Pages; + return _pages; + } + } + PdfPages _pages; // never changes if once created + + /// + /// Gets or sets a value specifying the page layout to be used when the document is opened. + /// + public PdfPageLayout PageLayout + { + get { return Catalog.PageLayout; } + set + { + if (!CanModify) + throw new InvalidOperationException(PSSR.CannotModify); + Catalog.PageLayout = value; + } + } + + /// + /// Gets or sets a value specifying how the document should be displayed when opened. + /// + public PdfPageMode PageMode + { + get { return Catalog.PageMode; } + set + { + if (!CanModify) + throw new InvalidOperationException(PSSR.CannotModify); + Catalog.PageMode = value; + } + } + + /// + /// Gets the viewer preferences of this document. + /// + public PdfViewerPreferences ViewerPreferences + { + get { return Catalog.ViewerPreferences; } + } + + /// + /// Gets the root of the outline (or bookmark) tree. + /// + public PdfOutlineCollection Outlines + { + get { return Catalog.Outlines; } + } + + /// + /// Get the AcroForm dictionary. + /// + public PdfAcroForm AcroForm + { + get { return Catalog.AcroForm; } + } + + /// + /// Gets or sets the default language of the document. + /// + public string Language + { + get { return Catalog.Language; } + set { Catalog.Language = value; } + } + + /// + /// Gets the security settings of this document. + /// + public PdfSecuritySettings SecuritySettings + { + get { return _securitySettings ?? (_securitySettings = new PdfSecuritySettings(this)); } + } + internal PdfSecuritySettings _securitySettings; + + /// + /// Gets the document font table that holds all fonts used in the current document. + /// + internal PdfFontTable FontTable + { + get { return _fontTable ?? (_fontTable = new PdfFontTable(this)); } + } + PdfFontTable _fontTable; + + /// + /// Gets the document image table that holds all images used in the current document. + /// + internal PdfImageTable ImageTable + { + get + { + if (_imageTable == null) + _imageTable = new PdfImageTable(this); + return _imageTable; + } + } + PdfImageTable _imageTable; + + /// + /// Gets the document form table that holds all form external objects used in the current document. + /// + internal PdfFormXObjectTable FormTable // TODO: Rename to ExternalDocumentTable. + { + get { return _formTable ?? (_formTable = new PdfFormXObjectTable(this)); } + } + PdfFormXObjectTable _formTable; + + /// + /// Gets the document ExtGState table that holds all form state objects used in the current document. + /// + internal PdfExtGStateTable ExtGStateTable + { + get { return _extGStateTable ?? (_extGStateTable = new PdfExtGStateTable(this)); } + } + PdfExtGStateTable _extGStateTable; + + /// + /// Gets the PdfCatalog of the current document. + /// + internal PdfCatalog Catalog + { + get { return _catalog ?? (_catalog = _trailer.Root); } + } + PdfCatalog _catalog; // never changes if once created + + /// + /// Gets the PdfInternals object of this document, that grants access to some internal structures + /// which are not part of the public interface of PdfDocument. + /// + public new PdfInternals Internals + { + get { return _internals ?? (_internals = new PdfInternals(this)); } + } + PdfInternals _internals; + + /// + /// Creates a new page and adds it to this document. + /// Depending of the IsMetric property of the current region the page size is set to + /// A4 or Letter respectively. If this size is not appropriate it should be changed before + /// any drawing operations are performed on the page. + /// + public PdfPage AddPage() + { + if (!CanModify) + throw new InvalidOperationException(PSSR.CannotModify); + return Catalog.Pages.Add(); + } + + /// + /// Adds the specified page to this document. If the page is from an external document, + /// it is imported to this document. In this case the returned page is not the same + /// object as the specified one. + /// + public PdfPage AddPage(PdfPage page) + { + if (!CanModify) + throw new InvalidOperationException(PSSR.CannotModify); + return Catalog.Pages.Add(page); + } + + /// + /// Creates a new page and inserts it in this document at the specified position. + /// + public PdfPage InsertPage(int index) + { + if (!CanModify) + throw new InvalidOperationException(PSSR.CannotModify); + return Catalog.Pages.Insert(index); + } + + /// + /// Inserts the specified page in this document. If the page is from an external document, + /// it is imported to this document. In this case the returned page is not the same + /// object as the specified one. + /// + public PdfPage InsertPage(int index, PdfPage page) + { + if (!CanModify) + throw new InvalidOperationException(PSSR.CannotModify); + return Catalog.Pages.Insert(index, page); + } + + /// + /// Flattens a document (make the fields non-editable). + /// + public void Flatten() + { + for (int idx = 0; idx < AcroForm.Fields.Count; idx++) + { + AcroForm.Fields[idx].ReadOnly = true; + } + } + + /// + /// Gets the security handler. + /// + public PdfStandardSecurityHandler SecurityHandler + { + get { return _trailer.SecurityHandler; } + } + + internal PdfTrailer _trailer; + internal PdfCrossReferenceTable _irefTable; + internal Stream _outStream; + + // Imported Document + internal Lexer _lexer; + + internal DateTime _creation; + + /// + /// Occurs when the specified document is not used anymore for importing content. + /// + internal void OnExternalDocumentFinalized(PdfDocument.DocumentHandle handle) + { + if (tls != null) + { + //PdfDocument[] documents = tls.Documents; + tls.DetachDocument(handle); + } + + if (_formTable != null) + _formTable.DetachDocument(handle); + } + + //internal static GlobalObjectTable Gob = new GlobalObjectTable(); + + /// + /// Gets the ThreadLocalStorage object. It is used for caching objects that should created + /// only once. + /// + internal static ThreadLocalStorage Tls + { + get { return tls ?? (tls = new ThreadLocalStorage()); } + } + [ThreadStatic] + static ThreadLocalStorage tls; + + [DebuggerDisplay("(ID={ID}, alive={IsAlive})")] + internal class DocumentHandle + { + public DocumentHandle(PdfDocument document) + { + _weakRef = new WeakReference(document); + ID = document._guid.ToString("B").ToUpper(); + } + + public bool IsAlive + { + get { return _weakRef.IsAlive; } + } + + public PdfDocument Target + { + get { return _weakRef.Target as PdfDocument; } + } + readonly WeakReference _weakRef; + + public string ID; + + public override bool Equals(object obj) + { + DocumentHandle handle = obj as DocumentHandle; + if (!ReferenceEquals(handle, null)) + return ID == handle.ID; + return false; + } + + public override int GetHashCode() + { + return ID.GetHashCode(); + } + + public static bool operator ==(DocumentHandle left, DocumentHandle right) + { + if (ReferenceEquals(left, null)) + return ReferenceEquals(right, null); + return left.Equals(right); + } + + public static bool operator !=(DocumentHandle left, DocumentHandle right) + { + return !(left == right); + } + } + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/PdfDocumentInformation.cs b/PdfSharp/Pdf/PdfDocumentInformation.cs new file mode 100644 index 0000000..837d55d --- /dev/null +++ b/PdfSharp/Pdf/PdfDocumentInformation.cs @@ -0,0 +1,207 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf +{ + /// + /// Represents the PDF document information dictionary. + /// + public sealed class PdfDocumentInformation : PdfDictionary + { + /// + /// Initializes a new instance of the class. + /// + public PdfDocumentInformation(PdfDocument document) + : base(document) + { } + + internal PdfDocumentInformation(PdfDictionary dict) + : base(dict) + { } + + /// + /// Gets or sets the document's title. + /// + public string Title + { + get { return Elements.GetString(Keys.Title); } + set { Elements.SetString(Keys.Title, value); } + } + + /// + /// Gets or sets the name of the person who created the document. + /// + public string Author + { + get { return Elements.GetString(Keys.Author); } + set { Elements.SetString(Keys.Author, value); } + } + + /// + /// Gets or sets the name of the subject of the document. + /// + public string Subject + { + get { return Elements.GetString(Keys.Subject); } + set { Elements.SetString(Keys.Subject, value); } + } + + /// + /// Gets or sets keywords associated with the document. + /// + public string Keywords + { + get { return Elements.GetString(Keys.Keywords); } + set { Elements.SetString(Keys.Keywords, value); } + } + + /// + /// Gets or sets the name of the application (for example, MigraDoc) that created the document. + /// + public string Creator + { + get { return Elements.GetString(Keys.Creator); } + set { Elements.SetString(Keys.Creator, value); } + } + + /// + /// Gets the producer application (for example, PDFsharp). + /// + public string Producer + { + get { return Elements.GetString(Keys.Producer); } + } + + /// + /// Gets or sets the creation date of the document. + /// Breaking Change: If the date is not set in a PDF file DateTime.MinValue is returned. + /// + public DateTime CreationDate + { + get { return Elements.GetDateTime(Keys.CreationDate, DateTime.MinValue); } + set { Elements.SetDateTime(Keys.CreationDate, value); } + } + + /// + /// Gets or sets the modification date of the document. + /// Breaking Change: If the date is not set in a PDF file DateTime.MinValue is returned. + /// + public DateTime ModificationDate + { + get { return Elements.GetDateTime(Keys.ModDate, DateTime.MinValue); } + set { Elements.SetDateTime(Keys.ModDate, value); } + } + + // TODO CustomProperties and meta data + + /// + /// Predefined keys of this dictionary. + /// + internal sealed class Keys : KeysBase + { + /// + /// (Optional; PDF 1.1) The documents title. + /// + [KeyInfo(KeyType.String | KeyType.Optional)] + public const string Title = "/Title"; + + /// + /// (Optional) The name of the person who created the document. + /// + [KeyInfo(KeyType.String | KeyType.Optional)] + public const string Author = "/Author"; + + /// + /// (Optional; PDF 1.1) The subject of the document. + /// + [KeyInfo(KeyType.String | KeyType.Optional)] + public const string Subject = "/Subject"; + + /// + /// (Optional; PDF 1.1) Keywords associated with the document. + /// + [KeyInfo(KeyType.String | KeyType.Optional)] + public const string Keywords = "/Keywords"; + + /// + /// (Optional) If the document was converted to PDF from another format, + /// the name of the application (for example, empira MigraDoc) that created the + /// original document from which it was converted. + /// + [KeyInfo(KeyType.String | KeyType.Optional)] + public const string Creator = "/Creator"; + + /// + /// (Optional) If the document was converted to PDF from another format, + /// the name of the application (for example, this library) that converted it to PDF. + /// + [KeyInfo(KeyType.String | KeyType.Optional)] + public const string Producer = "/Producer"; + + /// + /// (Optional) The date and time the document was created, in human-readable form. + /// + [KeyInfo(KeyType.Date | KeyType.Optional)] + public const string CreationDate = "/CreationDate"; + + /// + /// (Required if PieceInfo is present in the document catalog; otherwise optional; PDF 1.1) + /// The date and time the document was most recently modified, in human-readable form. + /// + [KeyInfo(KeyType.String | KeyType.Optional)] + public const string ModDate = "/ModDate"; + + /// + /// (Optional; PDF 1.3) A name object indicating whether the document has been modified + /// to include trapping information. + /// + [KeyInfo("1.3", KeyType.Name | KeyType.Optional)] + public const string Trapped = "/Trapped"; + + /// + /// Gets the KeysMeta for these keys. + /// + public static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf/PdfDocumentOptions.cs b/PdfSharp/Pdf/PdfDocumentOptions.cs new file mode 100644 index 0000000..ee9ea88 --- /dev/null +++ b/PdfSharp/Pdf/PdfDocumentOptions.cs @@ -0,0 +1,111 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// ReSharper disable ConvertToAutoProperty + +namespace PdfSharp.Pdf +{ + /// + /// Holds information how to handle the document when it is saved as PDF stream. + /// + public sealed class PdfDocumentOptions + { + internal PdfDocumentOptions(PdfDocument document) + { + //_deflateContents = true; + //_writeProcedureSets = true; + } + + /// + /// Gets or sets the color mode. + /// + public PdfColorMode ColorMode + { + get { return _colorMode; } + set { _colorMode = value; } + } + PdfColorMode _colorMode = PdfColorMode.Rgb; + + /// + /// Gets or sets a value indicating whether to compress content streams of PDF pages. + /// + public bool CompressContentStreams + { + get { return _compressContentStreams; } + set { _compressContentStreams = value; } + } +#if DEBUG + bool _compressContentStreams = false; +#else + bool _compressContentStreams = true; +#endif + + /// + /// Gets or sets a value indicating that all objects are not compressed. + /// + public bool NoCompression + { + get { return _noCompression; } + set { _noCompression = value; } + } + bool _noCompression; + + /// + /// Gets or sets the flate encode mode. Besides the balanced default mode you can set modes for best compression (slower) or best speed (larger files). + /// + public PdfFlateEncodeMode FlateEncodeMode + { + get { return _flateEncodeMode; } + set { _flateEncodeMode = value; } + } + PdfFlateEncodeMode _flateEncodeMode = PdfFlateEncodeMode.Default; + + /// + /// Gets or sets a value indicating whether to compress bilevel images using CCITT compression. + /// With true, PDFsharp will try FlateDecode CCITT and will use the smallest one or a combination of both. + /// With false, PDFsharp will always use FlateDecode only - files may be a few bytes larger, but file creation is faster. + /// + public bool EnableCcittCompressionForBilevelImages + { + get { return _enableCcittCompressionForBilevelImages; } + set { _enableCcittCompressionForBilevelImages = value; } + } + bool _enableCcittCompressionForBilevelImages = false; + + /// + /// Gets or sets a value indicating whether to compress JPEG images with the FlateDecode filter. + /// + public PdfUseFlateDecoderForJpegImages UseFlateDecoderForJpegImages + { + get { return _useFlateDecoderForJpegImages; } + set { _useFlateDecoderForJpegImages = value; } + } + PdfUseFlateDecoderForJpegImages _useFlateDecoderForJpegImages = PdfUseFlateDecoderForJpegImages.Never; + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/PdfDocumentSettings.cs b/PdfSharp/Pdf/PdfDocumentSettings.cs new file mode 100644 index 0000000..40bfd46 --- /dev/null +++ b/PdfSharp/Pdf/PdfDocumentSettings.cs @@ -0,0 +1,68 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf +{ + /// + /// Holds PDF specific information of the document. + /// + public sealed class PdfDocumentSettings + { + internal PdfDocumentSettings(PdfDocument document) + { } + + /// + /// Gets or sets the default trim margins. + /// + public TrimMargins TrimMargins + { + get + { + if (_trimMargins == null) + _trimMargins = new TrimMargins(); + return _trimMargins; + } + set + { + if (_trimMargins == null) + _trimMargins = new TrimMargins(); + if (value != null) + { + _trimMargins.Left = value.Left; + _trimMargins.Right = value.Right; + _trimMargins.Top = value.Top; + _trimMargins.Bottom = value.Bottom; + } + else + _trimMargins.All = 0; + } + } + TrimMargins _trimMargins = new TrimMargins(); + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/PdfInteger.cs b/PdfSharp/Pdf/PdfInteger.cs new file mode 100644 index 0000000..cf51d46 --- /dev/null +++ b/PdfSharp/Pdf/PdfInteger.cs @@ -0,0 +1,178 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents a direct integer value. + /// + [DebuggerDisplay("({Value})")] + public sealed class PdfInteger : PdfNumber, IConvertible + { + /// + /// Initializes a new instance of the class. + /// + public PdfInteger() + { } + + /// + /// Initializes a new instance of the class. + /// + /// The value. + public PdfInteger(int value) + { + _value = value; + } + + /// + /// Gets the value as integer. + /// + public int Value + { + // This class must behave like a value type. Therefore it cannot be changed (like System.String). + get { return _value; } + } + readonly int _value; + + /// + /// Returns the integer as string. + /// + public override string ToString() + { + return _value.ToString(CultureInfo.InvariantCulture); + } + + /// + /// Writes the integer as string. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.Write(this); + } + + #region IConvertible Members + + ulong IConvertible.ToUInt64(IFormatProvider provider) + { + return Convert.ToUInt64(_value); + } + + sbyte IConvertible.ToSByte(IFormatProvider provider) + { + throw new InvalidCastException(); + } + + double IConvertible.ToDouble(IFormatProvider provider) + { + return _value; + } + + DateTime IConvertible.ToDateTime(IFormatProvider provider) + { + // TODO: Add PdfInteger.ToDateTime implementation + return new DateTime(); + } + + float IConvertible.ToSingle(IFormatProvider provider) + { + return _value; + } + + bool IConvertible.ToBoolean(IFormatProvider provider) + { + return Convert.ToBoolean(_value); + } + + int IConvertible.ToInt32(IFormatProvider provider) + { + return _value; + } + + ushort IConvertible.ToUInt16(IFormatProvider provider) + { + return Convert.ToUInt16(_value); + } + + short IConvertible.ToInt16(IFormatProvider provider) + { + return Convert.ToInt16(_value); + } + + string IConvertible.ToString(IFormatProvider provider) + { + return _value.ToString(provider); + } + + byte IConvertible.ToByte(IFormatProvider provider) + { + return Convert.ToByte(_value); + } + + char IConvertible.ToChar(IFormatProvider provider) + { + return Convert.ToChar(_value); + } + + long IConvertible.ToInt64(IFormatProvider provider) + { + return _value; + } + + /// + /// Returns TypeCode for 32-bit integers. + /// + public TypeCode GetTypeCode() + { + return TypeCode.Int32; + } + + decimal IConvertible.ToDecimal(IFormatProvider provider) + { + return _value; + } + + object IConvertible.ToType(Type conversionType, IFormatProvider provider) + { + // TODO: Add PdfInteger.ToType implementation + return null; + } + + uint IConvertible.ToUInt32(IFormatProvider provider) + { + return Convert.ToUInt32(_value); + } + + #endregion + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/PdfIntegerObject.cs b/PdfSharp/Pdf/PdfIntegerObject.cs new file mode 100644 index 0000000..4a186d2 --- /dev/null +++ b/PdfSharp/Pdf/PdfIntegerObject.cs @@ -0,0 +1,94 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using System.Globalization; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents an indirect integer value. This type is not used by PDFsharp. If it is imported from + /// an external PDF file, the value is converted into a direct object. + /// + [DebuggerDisplay("({Value})")] + public sealed class PdfIntegerObject : PdfNumberObject + { + /// + /// Initializes a new instance of the class. + /// + public PdfIntegerObject() + { } + + /// + /// Initializes a new instance of the class. + /// + public PdfIntegerObject(int value) + { + _value = value; + } + + /// + /// Initializes a new instance of the class. + /// + public PdfIntegerObject(PdfDocument document, int value) + : base(document) + { + _value = value; + } + + /// + /// Gets the value as integer. + /// + public int Value + { + get { return _value; } + //set {_value = value;} + } + readonly int _value; + + /// + /// Returns the integer as string. + /// + public override string ToString() + { + return _value.ToString(CultureInfo.InvariantCulture); + } + + /// + /// Writes the integer literal. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.WriteBeginObject(this); + writer.Write(_value); + writer.WriteEndObject(); + } + } +} diff --git a/PdfSharp/Pdf/PdfItem.cs b/PdfSharp/Pdf/PdfItem.cs new file mode 100644 index 0000000..f1987d9 --- /dev/null +++ b/PdfSharp/Pdf/PdfItem.cs @@ -0,0 +1,69 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// The base class of all PDF objects and simple PDF types. + /// + public abstract class PdfItem : ICloneable + { + // All simple types (i.e. derived from PdfItem but not from PdfObject) must be immutable. + + object ICloneable.Clone() + { + return Copy(); + } + + /// + /// Creates a copy of this object. + /// + public PdfItem Clone() + { + return (PdfItem)Copy(); + } + + /// + /// Implements the copy mechanism. Must be overridden in derived classes. + /// + protected virtual object Copy() + { + return MemberwiseClone(); + } + + /// + /// When overridden in a derived class, appends a raw string representation of this object + /// to the specified PdfWriter. + /// + internal abstract void WriteObject(PdfWriter writer); + } +} diff --git a/PdfSharp/Pdf/PdfLiteral.cs b/PdfSharp/Pdf/PdfLiteral.cs new file mode 100644 index 0000000..6459dd2 --- /dev/null +++ b/PdfSharp/Pdf/PdfLiteral.cs @@ -0,0 +1,101 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections; +using System.Globalization; +using System.Text; +using System.IO; +using PdfSharp.Drawing; +using PdfSharp.Internal; +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf +{ + /// + /// Represents text that is written 'as it is' into the PDF stream. This class can lead to invalid PDF files. + /// E.g. strings in a literal are not encrypted when the document is saved with a password. + /// + public sealed class PdfLiteral : PdfItem + { + /// + /// Initializes a new instance of the class. + /// + public PdfLiteral() + { } + + /// + /// Initializes a new instance with the specified string. + /// + public PdfLiteral(string value) + { + _value = value; + } + + /// + /// Initializes a new instance with the culture invariant formatted specified arguments. + /// + public PdfLiteral(string format, params object[] args) + { + _value = PdfEncoders.Format(format, args); + } + + /// + /// Creates a literal from an XMatrix + /// + public static PdfLiteral FromMatrix(XMatrix matrix) + { + return new PdfLiteral("[" + PdfEncoders.ToString(matrix) + "]"); + } + + /// + /// Gets the value as litaral string. + /// + public string Value + { + // This class must behave like a value type. Therefore it cannot be changed (like System.String). + get { return _value; } + } + readonly string _value = String.Empty; + + /// + /// Returns a string that represents the current value. + /// + public override string ToString() + { + return _value; + } + + internal override void WriteObject(PdfWriter writer) + { + writer.Write(this); + } + } +} diff --git a/PdfSharp/Pdf/PdfName.cs b/PdfSharp/Pdf/PdfName.cs new file mode 100644 index 0000000..c45c9d9 --- /dev/null +++ b/PdfSharp/Pdf/PdfName.cs @@ -0,0 +1,170 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-20165 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents a PDF name value. + /// + [DebuggerDisplay("({Value})")] + public sealed class PdfName : PdfItem + { + /// + /// Initializes a new instance of the class. + /// + public PdfName() + { + _value = "/"; // Empty name. + } + + /// + /// Initializes a new instance of the class. + /// Parameter value always must start with a '/'. + /// + public PdfName(string value) + { + if (value == null) + throw new ArgumentNullException("value"); + if (value.Length == 0 || value[0] != '/') + throw new ArgumentException(PSSR.NameMustStartWithSlash); + + _value = value; + } + + /// + /// Determines whether the specified object is equal to this name. + /// + public override bool Equals(object obj) + { + return _value.Equals(obj); + } + + /// + /// Returns the hash code for this instance. + /// + public override int GetHashCode() + { + return _value.GetHashCode(); + } + + /// + /// Gets the name as a string. + /// + public string Value + { + // This class must behave like a value type. Therefore it cannot be changed (like System.String). + get { return _value; } + } + readonly string _value; + + /// + /// Returns the name. The string always begins with a slash. + /// + public override string ToString() + { + return _value; + } + + /// + /// Determines whether the specified name and string are equal. + /// + public static bool operator ==(PdfName name, string str) + { + if (ReferenceEquals(name, null)) + return str == null; + + return name._value == str; + } + + /// + /// Determines whether the specified name and string are not equal. + /// + public static bool operator !=(PdfName name, string str) + { + if (ReferenceEquals(name, null)) + return str != null; + + return name._value != str; + } + + /// + /// Represents the empty name. + /// + public static readonly PdfName Empty = new PdfName("/"); + + /// + /// Writes the name including the leading slash. + /// + internal override void WriteObject(PdfWriter writer) + { + // TODO: what if unicode character are part of the name? + writer.Write(this); + } + + /// + /// Gets the comparer for this type. + /// + public static PdfXNameComparer Comparer + { + get { return new PdfXNameComparer(); } + } + + /// + /// Implements a comparer that compares PdfName objects. + /// + public class PdfXNameComparer : IComparer + { + /// + /// Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. + /// + /// The first object to compare. + /// The second object to compare. + public int Compare(PdfName l, PdfName r) + { +#if true_ +#else + if (l != null) + { + if (r != null) + return String.Compare(l._value, r._value, StringComparison.Ordinal); + return -1; + } + if (r != null) + return 1; + return 0; +#endif + } + } + } +} diff --git a/PdfSharp/Pdf/PdfNameObject.cs b/PdfSharp/Pdf/PdfNameObject.cs new file mode 100644 index 0000000..6e381a9 --- /dev/null +++ b/PdfSharp/Pdf/PdfNameObject.cs @@ -0,0 +1,151 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents an indirect name value. This type is not used by PDFsharp. If it is imported from + /// an external PDF file, the value is converted into a direct object. Acrobat sometime uses indirect + /// names to save space, because an indirect reference to a name may be shorter than a long name. + /// + [DebuggerDisplay("({Value})")] + public sealed class PdfNameObject : PdfObject + { + /// + /// Initializes a new instance of the class. + /// + public PdfNameObject() + { + _value = "/"; // Empty name. + } + + /// + /// Initializes a new instance of the class. + /// + /// The document. + /// The value. + public PdfNameObject(PdfDocument document, string value) + : base(document) + { + if (value == null) + throw new ArgumentNullException("value"); + if (value.Length == 0 || value[0] != '/') + throw new ArgumentException(PSSR.NameMustStartWithSlash); + + _value = value; + } + + /// + /// Determines whether the specified object is equal to the current object. + /// + public override bool Equals(object obj) + { + return _value.Equals(obj); + } + + /// + /// Serves as a hash function for this type. + /// + public override int GetHashCode() + { + return _value.GetHashCode(); + } + + /// + /// Gets or sets the name value. + /// + public string Value + { + get { return _value; } + set { _value = value; } + } + string _value; + + /// + /// Returns the name. The string always begins with a slash. + /// + public override string ToString() + { + // TODO: Encode characters. + return _value; + } + + /// + /// Determines whether a name is equal to a string. + /// + public static bool operator ==(PdfNameObject name, string str) + { + return name._value == str; + } + + /// + /// Determines whether a name is not equal to a string. + /// + public static bool operator !=(PdfNameObject name, string str) + { + return name._value != str; + } + +#if leads_to_ambiguity + public static bool operator ==(string str, PdfName name) + { + return str == name.value; + } + + public static bool operator !=(string str, PdfName name) + { + return str == name.value; + } + + public static bool operator ==(PdfName name1, PdfName name2) + { + return name1.value == name2.value; + } + + public static bool operator !=(PdfName name1, PdfName name2) + { + return name1.value != name2.value; + } +#endif + + /// + /// Writes the name including the leading slash. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.WriteBeginObject(this); + writer.Write(new PdfName(_value)); + writer.WriteEndObject(); + } + } +} diff --git a/PdfSharp/Pdf/PdfNull.cs b/PdfSharp/Pdf/PdfNull.cs new file mode 100644 index 0000000..8b4c7e0 --- /dev/null +++ b/PdfSharp/Pdf/PdfNull.cs @@ -0,0 +1,66 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents a indirect reference that is not in the cross reference table. + /// + public sealed class PdfNull : PdfItem + { + // Reference: 3.2.8 Null Object / Page 63 + + PdfNull() + { } + + /// + /// Returns a that represents the current . + /// + /// + /// A that represents the current . + /// + public override string ToString() + { + return "null"; + } + + internal override void WriteObject(PdfWriter writer) + { + // Implementet because it must be overridden. + writer.WriteRaw(" null "); + } + + /// + /// The only instance of this class. + /// + public static readonly PdfNull Value = new PdfNull(); + } +} diff --git a/PdfSharp/Pdf/PdfNullObject.cs b/PdfSharp/Pdf/PdfNullObject.cs new file mode 100644 index 0000000..157c8be --- /dev/null +++ b/PdfSharp/Pdf/PdfNullObject.cs @@ -0,0 +1,74 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents an indirect null value. This type is not used by PDFsharp, but at least + /// one tool from Adobe creates PDF files with a null object. + /// + public sealed class PdfNullObject : PdfObject + { + // Reference: 3.2.8 Null Object / Page 63 + + /// + /// Initializes a new instance of the class. + /// + public PdfNullObject() + { } + + /// + /// Initializes a new instance of the class. + /// + /// The document. + public PdfNullObject(PdfDocument document) + : base(document) + { } + + /// + /// Returns the string "null". + /// + public override string ToString() + { + return "null"; + } + + /// + /// Writes the keyword null. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.WriteBeginObject(this); + writer.WriteRaw(" null "); + writer.WriteEndObject(); + } + } +} diff --git a/PdfSharp/Pdf/PdfNumber.cs b/PdfSharp/Pdf/PdfNumber.cs new file mode 100644 index 0000000..e3a7f60 --- /dev/null +++ b/PdfSharp/Pdf/PdfNumber.cs @@ -0,0 +1,39 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf +{ + /// + /// Base class for direct number values (not yet used, maybe superfluous). + /// + public abstract class PdfNumber : PdfItem + { + // No code in base class. + } +} diff --git a/PdfSharp/Pdf/PdfNumberObject.cs b/PdfSharp/Pdf/PdfNumberObject.cs new file mode 100644 index 0000000..d182ee8 --- /dev/null +++ b/PdfSharp/Pdf/PdfNumberObject.cs @@ -0,0 +1,51 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf +{ + /// + /// Base class for indirect number values (not yet used, maybe superfluous). + /// + public abstract class PdfNumberObject : PdfObject + { + /// + /// Initializes a new instance of the class. + /// + protected PdfNumberObject() + { } + + /// + /// Initializes a new instance of the class. + /// + /// The document. + protected PdfNumberObject(PdfDocument document) + : base(document) + { } + } +} diff --git a/PdfSharp/Pdf/PdfObject.cs b/PdfSharp/Pdf/PdfObject.cs new file mode 100644 index 0000000..d4a30e7 --- /dev/null +++ b/PdfSharp/Pdf/PdfObject.cs @@ -0,0 +1,602 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Base class of all composite PDF objects. + /// + public abstract class PdfObject : PdfItem + { + /// + /// Initializes a new instance of the class. + /// + protected PdfObject() + { } + + /// + /// Initializes a new instance of the class. + /// + protected PdfObject(PdfDocument document) + { + // Calling a virtual member in a constructor is dangerous. + // In PDFsharp Document is overridden in PdfPage and the code is checked to be save + // when called for a not completely initialized object. + Document = document; + } + + /// + /// Initializes a new instance from an existing object. Used for object type transformation. + /// + protected PdfObject(PdfObject obj) + : this(obj.Owner) + { + // If the object that was transformed to an instance of a derived class was an indirect object + // set the value of the reference to this. + if (obj._iref != null) + obj._iref.Value = this; +#if DEBUG_ // BUG + else + { + // If this occurs it is an internal error + Debug.Assert(false, "Object type transformation must not be done with direct objects"); + } +#endif + } + + /// + /// Creates a copy of this object. The clone does not belong to a document, i.e. its owner and its iref are null. + /// + public new PdfObject Clone() + { + return (PdfObject)Copy(); + } + + /// + /// Implements the copy mechanism. Must be overridden in derived classes. + /// + protected override object Copy() + { + PdfObject obj = (PdfObject)base.Copy(); + obj._document = null; + obj._iref = null; + return obj; + } + +#if true_ // works, but may lead to other problems that I cannot assess + /// + /// Determines whether the specified object is equal to the current PdfObject. + /// + public override bool Equals(object obj) + { + if (obj is PdfObject) + { + PdfObject other = (PdfObject)obj; + // Take object type transformation into account + if (_iref != null && other._iref != null) + { + Debug.Assert(_iref.Value != null, "iref without value."); + Debug.Assert(other.iref.Value != null, "iref without value."); + return Object.ReferenceEquals(_iref.Value, other.iref.Value); + } + } + return base.Equals(obj); + } + + public override int GetHashCode() + { + if (_iref != null) + { + Debug.Assert(_iref.Value != null, "iref without value."); + return _iref.GetHashCode(); + } + return base.GetHashCode(); + } +#endif + + /// + /// Sets the object and generation number. + /// Setting the object identifier makes this object an indirect object, i.e. the object gets + /// a PdfReference entry in the PdfReferenceTable. + /// + internal void SetObjectID(int objectNumber, int generationNumber) + { + PdfObjectID objectID = new PdfObjectID(objectNumber, generationNumber); + + // TODO: check imported + if (_iref == null) + _iref = _document._irefTable[objectID]; + if (_iref == null) + { + // ReSharper disable once ObjectCreationAsStatement because the new object is set to this object + // in the constructor of PdfReference. + new PdfReference(this); + Debug.Assert(_iref != null); + _iref.ObjectID = objectID; + } + _iref.Value = this; + _iref.Document = _document; + } + + /// + /// Gets the PdfDocument this object belongs to. + /// + public virtual PdfDocument Owner + { + get { return _document; } + } + + /// + /// Sets the PdfDocument this object belongs to. + /// + internal virtual PdfDocument Document + { + set + { + if (!ReferenceEquals(_document, value)) + { + if (_document != null) + throw new InvalidOperationException("Cannot change document."); + _document = value; + if (_iref != null) + _iref.Document = value; + } + } + } + internal PdfDocument _document; + + /// + /// Indicates whether the object is an indirect object. + /// + public bool IsIndirect + { + // An object is an indirect object if and only if is has an indirect reference value. + get { return _iref != null; } + } + + /// + /// Gets the PdfInternals object of this document, that grants access to some internal structures + /// which are not part of the public interface of PdfDocument. + /// + public PdfObjectInternals Internals + { + get { return _internals ?? (_internals = new PdfObjectInternals(this)); } + } + PdfObjectInternals _internals; + + /// + /// When overridden in a derived class, prepares the object to get saved. + /// + internal virtual void PrepareForSave() + { } + + /// + /// Saves the stream position. 2nd Edition. + /// + internal override void WriteObject(PdfWriter writer) + { + Debug.Assert(false, "Must not come here!"); + //Debug.Assert(_inStreamOffset <= 0); + //if (_inStreamOffset == 0) + //{ + // //_InStreamOffset = stream.Position; + // _document.xrefTable.AddObject(this); + // return Format("{0} {1} obj\n", _objectID, _generation); + //} + //else if (_inStreamOffset == -1) + //{ + //} + //return null; + } + + /// + /// Gets the object identifier. Returns PdfObjectID.Empty for direct objects, + /// i.e. never returns null. + /// + internal PdfObjectID ObjectID + { + get { return _iref != null ? _iref.ObjectID : PdfObjectID.Empty; } + } + + /// + /// Gets the object number. + /// + internal int ObjectNumber + { + get { return ObjectID.ObjectNumber; } + } + + /// + /// Gets the generation number. + /// + internal int GenerationNumber + { + get { return ObjectID.GenerationNumber; } + } + + ///// + ///// Creates a deep copy of the specified value and its transitive closure and adds the + ///// new objects to the specified owner document. + ///// + /// The document that owns the cloned objects. + /// The root object to be cloned. + /// The clone of the root object + internal static PdfObject DeepCopyClosure(PdfDocument owner, PdfObject externalObject) + { + // Get transitive closure. + PdfObject[] elements = externalObject.Owner.Internals.GetClosure(externalObject); + int count = elements.Length; +#if DEBUG_ + for (int idx = 0; idx < count; idx++) + { + Debug.Assert(elements[idx].XRef != null); + Debug.Assert(elements[idx].XRef.Document != null); + Debug.Assert(elements[idx].Document != null); + if (elements[idx].ObjectID.ObjectNumber == 12) + GetType(); + } +#endif + // 1st loop. Replace all objects by their clones. + PdfImportedObjectTable iot = new PdfImportedObjectTable(owner, externalObject.Owner); + for (int idx = 0; idx < count; idx++) + { + PdfObject obj = elements[idx]; + PdfObject clone = obj.Clone(); + Debug.Assert(clone.Reference == null); + clone.Document = owner; + if (obj.Reference != null) + { + // Case: The cloned object was an indirect object. + // Add clone to new owner document. + owner._irefTable.Add(clone); + // The clone gets an iref by adding it to its new owner. + Debug.Assert(clone.Reference != null); + // Save an association from old object identifier to new iref. + iot.Add(obj.ObjectID, clone.Reference); + } + else + { + // Case: The cloned object was an direct object. + // Only the root object can be a direct object. + Debug.Assert(idx == 0); + } + // Replace external object by its clone. + elements[idx] = clone; + } +#if DEBUG_ + for (int idx = 0; idx < count; idx++) + { + Debug.Assert(elements[idx]._iref != null); + Debug.Assert(elements[idx]._iref.Document != null); + Debug.Assert(resources[idx].Document != null); + if (elements[idx].ObjectID.ObjectNumber == 12) + GetType(); + } +#endif + + // 2nd loop. Fix up all indirect references that still refers to the import document. + for (int idx = 0; idx < count; idx++) + { + PdfObject obj = elements[idx]; + Debug.Assert(obj.Owner == owner); + FixUpObject(iot, owner, obj); + } + + // Return the clone of the former root object. + return elements[0]; + } + + ///// + ///// Imports an object and its transitive closure to the specified document. + ///// + /// The imported object table of the owner for the external document. + /// The document that owns the cloned objects. + /// The root object to be cloned. + /// The clone of the root object + internal static PdfObject ImportClosure(PdfImportedObjectTable importedObjectTable, PdfDocument owner, PdfObject externalObject) + { + Debug.Assert(ReferenceEquals(importedObjectTable.Owner, owner), "importedObjectTable does not belong to the owner."); + Debug.Assert(ReferenceEquals(importedObjectTable.ExternalDocument, externalObject.Owner), + "The ExternalDocument of the importedObjectTable does not belong to the owner of object to be imported."); + + // Get transitive closure of external object. + PdfObject[] elements = externalObject.Owner.Internals.GetClosure(externalObject); + int count = elements.Length; +#if DEBUG_ + for (int idx = 0; idx < count; idx++) + { + Debug.Assert(elements[idx].XRef != null); + Debug.Assert(elements[idx].XRef.Document != null); + Debug.Assert(elements[idx].Document != null); + if (elements[idx].ObjectID.ObjectNumber == 12) + GetType(); + } +#endif + // 1st loop. Already imported objects are reused and new ones are cloned. + for (int idx = 0; idx < count; idx++) + { + PdfObject obj = elements[idx]; + Debug.Assert(!ReferenceEquals(obj.Owner, owner)); + + if (importedObjectTable.Contains(obj.ObjectID)) + { +#if DEBUG_ + if (obj.ObjectID.ObjectNumber == 5894) + obj.GetType(); +#endif + // Case: External object was already imported. + PdfReference iref = importedObjectTable[obj.ObjectID]; + Debug.Assert(iref != null); + Debug.Assert(iref.Value != null); + Debug.Assert(iref.Document == owner); + // Replace external object by the already cloned counterpart. + elements[idx] = iref.Value; + } + else + { + // Case: External object was not yet imported earlier and must be cloned. + PdfObject clone = obj.Clone(); + Debug.Assert(clone.Reference == null); + clone.Document = owner; + if (obj.Reference != null) + { + // Case: The cloned object was an indirect object. + // Add clone to new owner document. + owner._irefTable.Add(clone); + Debug.Assert(clone.Reference != null); + // Save an association from old object identifier to new iref. + importedObjectTable.Add(obj.ObjectID, clone.Reference); + } + else + { + // Case: The cloned object was a direct object. + // Only the root object can be a direct object. + Debug.Assert(idx == 0); + } + // Replace external object by its clone. + elements[idx] = clone; + } + } +#if DEBUG_ + for (int idx = 0; idx < count; idx++) + { + //Debug.Assert(elements[idx].Reference != null); + //Debug.Assert(elements[idx].Reference.Document != null); + Debug.Assert(elements[idx].IsIndirect == false); + Debug.Assert(elements[idx].Owner != null); + //if (elements[idx].ObjectID.ObjectNumber == 12) + // GetType(); + } +#endif + // 2nd loop. Fix up indirect references that still refers to the external document. + for (int idx = 0; idx < count; idx++) + { + PdfObject obj = elements[idx]; + Debug.Assert(owner != null); + FixUpObject(importedObjectTable, importedObjectTable.Owner, obj); + } + + // Return the imported root object. + return elements[0]; + } + + /// + /// Replace all indirect references to external objects by their cloned counterparts + /// owned by the importer document. + /// + static void FixUpObject(PdfImportedObjectTable iot, PdfDocument owner, PdfObject value) + { + Debug.Assert(ReferenceEquals(iot.Owner, owner)); + + PdfDictionary dict; + PdfArray array; + if ((dict = value as PdfDictionary) != null) + { + // Case: The object is a dictionary. + // Set document for cloned direct objects. + if (dict.Owner == null) + { + // If the dictionary has not yet an owner set the owner to the importing document. + dict.Document = owner; + } + else + { + // If the dictionary already has an owner it must be the importing document. + Debug.Assert(dict.Owner == owner); + } + + // Search for indirect references in all dictionary elements. + PdfName[] names = dict.Elements.KeyNames; + foreach (PdfName name in names) + { + PdfItem item = dict.Elements[name]; + Debug.Assert(item != null, "A dictionary element cannot be null."); + + // Is item an iref? + PdfReference iref = item as PdfReference; + if (iref != null) + { + // Case: The item is a reference. + // Does the iref already belongs to the new owner? + if (iref.Document == owner) + { + // Yes: fine. Happens when an already cloned object is reused. + continue; + } + + //Debug.Assert(iref.Document == iot.Document); + // No: Replace with iref of cloned object. + PdfReference newXRef = iot[iref.ObjectID]; // TODO: Explain this line of code in all details. + Debug.Assert(newXRef != null); + Debug.Assert(newXRef.Document == owner); + dict.Elements[name] = newXRef; + } + else + { + // Case: The item is not a reference. + // If item is an object recursively fix its inner items. + PdfObject pdfObject = item as PdfObject; + if (pdfObject != null) + { + // Fix up inner objects, i.e. recursively walk down the object tree. + FixUpObject(iot, owner, pdfObject); + } + else + { + // The item is something else, e.g. a name. + // Nothing to do. + + // ...but let's double check this case in DEBUG build. + DebugCheckNonObjects(item); + } + } + } + } + else if ((array = value as PdfArray) != null) + { + // Case: The object is an array. + // Set document for cloned direct objects. + if (array.Owner == null) + { + // If the array has not yet an owner set the owner to the importing document. + array.Document = owner; + } + else + { + // If the array already has an owner it must be the importing document. + Debug.Assert(array.Owner == owner); + } + + // Search for indirect references in all array elements. + int count = array.Elements.Count; + for (int idx = 0; idx < count; idx++) + { + PdfItem item = array.Elements[idx]; + Debug.Assert(item != null, "An array element cannot be null."); + + // Is item an iref? + PdfReference iref = item as PdfReference; + if (iref != null) + { + // Case: The item is a reference. + // Does the iref already belongs to the owner? + if (iref.Document == owner) + { + // Yes: fine. Happens when an already cloned object is reused. + continue; + } + + // No: replace with iref of cloned object. + Debug.Assert(iref.Document == iot.ExternalDocument); + PdfReference newXRef = iot[iref.ObjectID]; + Debug.Assert(newXRef != null); + Debug.Assert(newXRef.Document == owner); + array.Elements[idx] = newXRef; + } + else + { + // Case: The item is not a reference. + // If item is an object recursively fix its inner items. + PdfObject pdfObject = item as PdfObject; + if (pdfObject != null) + { + // Fix up inner objects, i.e. recursively walk down the object tree. + FixUpObject(iot, owner, pdfObject); + } + else + { + // The item is something else, e.g. a name. + // Nothing to do. + + // ...but let's double check this case in DEBUG build. + DebugCheckNonObjects(item); + } + } + } + } + else + { + // Case: The item is some other indirect object. + // Indirect integers, booleans, etc. are allowed, but PDFsharp do not create them. + // If such objects occur in imported PDF files from other producers, nothing more is to do. + // The owner was already set, which is double checked by the assertions below. + if (value is PdfNameObject || value is PdfStringObject || value is PdfBooleanObject || value is PdfIntegerObject || value is PdfNumberObject) + { + Debug.Assert(value.IsIndirect); + Debug.Assert(value.Owner == owner); + } + else + Debug.Assert(false, "Should not come here. Object is neither a dictionary nor an array."); + } + } + + /// + /// Ensure for future versions of PDFsharp not to forget code for a new kind of PdfItem. + /// + /// The item. + [Conditional("DEBUG")] + static void DebugCheckNonObjects(PdfItem item) + { + if (item is PdfName) + return; + if (item is PdfBoolean) + return; + if (item is PdfInteger) + return; + if (item is PdfNumber) + return; + if (item is PdfString) + return; + if (item is PdfRectangle) + return; + if (item is PdfNull) + return; + + Type type = item.GetType(); + Debug.Assert(type != null, string.Format("CheckNonObjects: Add {0} to the list.", type.Name)); + } + + /// + /// Gets the indirect reference of this object. If the value is null, this object is a direct object. + /// + public PdfReference Reference + { + get { return _iref; } + + // Setting the reference outside PDFsharp is not considered as a valid operation. + internal set { _iref = value; } + } + PdfReference _iref; + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/PdfObjectID.cs b/PdfSharp/Pdf/PdfObjectID.cs new file mode 100644 index 0000000..ea3ee64 --- /dev/null +++ b/PdfSharp/Pdf/PdfObjectID.cs @@ -0,0 +1,179 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; + +namespace PdfSharp.Pdf +{ + /// + /// Represents a PDF object identifier, a pair of object and generation number. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + public struct PdfObjectID : IComparable + { + /// + /// Initializes a new instance of the class. + /// + /// The object number. + public PdfObjectID(int objectNumber) + { + Debug.Assert(objectNumber >= 1, "Object number out of range."); + _objectNumber = objectNumber; + _generationNumber = 0; +#if DEBUG_ + // Just a place for a breakpoint during debugging. + if (objectNumber == 5894) + GetType(); +#endif + } + + /// + /// Initializes a new instance of the class. + /// + /// The object number. + /// The generation number. + public PdfObjectID(int objectNumber, int generationNumber) + { + Debug.Assert(objectNumber >= 1, "Object number out of range."); + //Debug.Assert(generationNumber >= 0 && generationNumber <= 65535, "Generation number out of range."); +#if DEBUG_ + // iText creates generation numbers with a value of 65536... + if (generationNumber > 65535) + Debug.WriteLine(String.Format("Generation number: {0}", generationNumber)); +#endif + _objectNumber = objectNumber; + _generationNumber = (ushort)generationNumber; + } + + /// + /// Gets or sets the object number. + /// + public int ObjectNumber + { + get { return _objectNumber; } + } + readonly int _objectNumber; + + /// + /// Gets or sets the generation number. + /// + public int GenerationNumber + { + get { return _generationNumber; } + } + readonly ushort _generationNumber; + + /// + /// Indicates whether this object is an empty object identifier. + /// + public bool IsEmpty + { + get { return _objectNumber == 0; } + } + + /// + /// Indicates whether this instance and a specified object are equal. + /// + public override bool Equals(object obj) + { + if (obj is PdfObjectID) + { + PdfObjectID id = (PdfObjectID)obj; + if (_objectNumber == id._objectNumber) + return _generationNumber == id._generationNumber; + } + return false; + } + + /// + /// Returns the hash code for this instance. + /// + public override int GetHashCode() + { + return _objectNumber ^ _generationNumber; + } + + /// + /// Determines whether the two objects are equal. + /// + public static bool operator ==(PdfObjectID left, PdfObjectID right) + { + return left.Equals(right); + } + + /// + /// Determines whether the tow objects not are equal. + /// + public static bool operator !=(PdfObjectID left, PdfObjectID right) + { + return !left.Equals(right); + } + + /// + /// Returns the object and generation numbers as a string. + /// + public override string ToString() + { + return _objectNumber.ToString(CultureInfo.InvariantCulture) + " " + _generationNumber.ToString(CultureInfo.InvariantCulture); + } + + /// + /// Creates an empty object identifier. + /// + public static PdfObjectID Empty + { + get { return new PdfObjectID(); } + } + + /// + /// Compares the current object id with another object. + /// + public int CompareTo(object obj) + { + if (obj is PdfObjectID) + { + PdfObjectID id = (PdfObjectID)obj; + if (_objectNumber == id._objectNumber) + return _generationNumber - id._generationNumber; + return _objectNumber - id._objectNumber; + } + return 1; + } + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + internal string DebuggerDisplay + { + get { return String.Format("id=({0})", ToString()); } + } + } +} diff --git a/PdfSharp/Pdf/PdfOutline.cs b/PdfSharp/Pdf/PdfOutline.cs new file mode 100644 index 0000000..c21dfae --- /dev/null +++ b/PdfSharp/Pdf/PdfOutline.cs @@ -0,0 +1,836 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2018 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// Review: Under construction - StL/14-10-05 + +using System; +using System.Diagnostics; +using System.Globalization; +using System.Text; +using PdfSharp.Drawing; +using PdfSharp.Pdf.Actions; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf +{ + /// + /// Represents an outline item in the outlines tree. An 'outline' is also known as a 'bookmark'. + /// + public sealed class PdfOutline : PdfDictionary + { + // Reference: 8.2.2Document Outline / Page 584 + + /// + /// Initializes a new instance of the class. + /// + public PdfOutline() + { + // Create _outlines on demand. + //_outlines = new PdfOutlineCollection(this); + } + + /// + /// Initializes a new instance of the class. + /// + /// The document. + internal PdfOutline(PdfDocument document) + : base(document) + { + // Create _outlines on demand. + //_outlines = new PdfOutlineCollection(this); + } + + /// + /// Initializes a new instance from an existing dictionary. Used for object type transformation. + /// + public PdfOutline(PdfDictionary dict) + : base(dict) + { + Initialize(); + } + + /// + /// Initializes a new instance of the class. + /// + /// The outline text. + /// The destination page. + /// Specifies whether the node is displayed expanded (opened) or collapsed. + /// The font style used to draw the outline text. + /// The color used to draw the outline text. + public PdfOutline(string title, PdfPage destinationPage, bool opened, PdfOutlineStyle style, XColor textColor) + { + Title = title; + DestinationPage = destinationPage; + Opened = opened; + Style = style; + TextColor = textColor; + } + + /// + /// Initializes a new instance of the class. + /// + /// The outline text. + /// The destination page. + /// Specifies whether the node is displayed expanded (opened) or collapsed. + /// The font style used to draw the outline text. + public PdfOutline(string title, PdfPage destinationPage, bool opened, PdfOutlineStyle style) + { + Title = title; + DestinationPage = destinationPage; + Opened = opened; + Style = style; + } + + /// + /// Initializes a new instance of the class. + /// + /// The outline text. + /// The destination page. + /// Specifies whether the node is displayed expanded (opened) or collapsed. + public PdfOutline(string title, PdfPage destinationPage, bool opened) + { + Title = title; + DestinationPage = destinationPage; + Opened = opened; + } + + /// + /// Initializes a new instance of the class. + /// + /// The outline text. + /// The destination page. + public PdfOutline(string title, PdfPage destinationPage) + { + Title = title; + DestinationPage = destinationPage; + } + + internal int Count + { + get { return _count; } + set { _count = value; } + } + int _count; + + /// + /// The total number of open descendants at all lower levels. + /// + internal int OpenCount; + + /// + /// Counts the open outline items. Not yet used. + /// + internal int CountOpen() + { + int count = _opened ? 1 : 0; + if (_outlines != null) + count += _outlines.CountOpen(); + return count; + } + + /// + /// Gets the parent of this outline item. The root item has no parent and returns null. + /// + public PdfOutline Parent + { + get { return _parent; } + internal set { _parent = value; } + } + PdfOutline _parent; + + /// + /// Gets or sets the title. + /// + public string Title + { + get { return Elements.GetString(Keys.Title); } + set + { + PdfString s = new PdfString(value, PdfStringEncoding.Unicode); + Elements.SetValue(Keys.Title, s); + } + } + + /// + /// Gets or sets the destination page. + /// + public PdfPage DestinationPage + { + get { return _destinationPage; } + set { _destinationPage = value; } + } + PdfPage _destinationPage; + + /// + /// Gets or sets the left position of the page positioned at the left side of the window. + /// Applies only if PageDestinationType is Xyz, FitV, FitR, or FitBV. + /// + public double? Left + { + get { return _left; } + set { _left = value; } + } + double? _left = null; + + /// + /// Gets or sets the top position of the page positioned at the top side of the window. + /// Applies only if PageDestinationType is Xyz, FitH, FitR, ob FitBH. + /// + public double? Top + { + get { return _top; } + set { _top = value; } + } + double? _top = null; + + /// + /// Gets or sets the right position of the page positioned at the right side of the window. + /// Applies only if PageDestinationType is FitR. + /// + public double Right // Cannot be null in a valid PDF. + { + get { return _right; } + set { _right = value; } + } + double _right = double.NaN; + + /// + /// Gets or sets the bottom position of the page positioned at the bottom side of the window. + /// Applies only if PageDestinationType is FitR. + /// + public double Bottom // Cannot be null in a valid PDF. + { + get { return _bottom; } + set { _bottom = value; } + } + double _bottom = double.NaN; + + /// + /// Gets or sets the zoom faction of the page. + /// Applies only if PageDestinationType is Xyz. + /// + public double? Zoom + { + get { return _zoom; } + set + { + if (value.HasValue && value.Value == 0) + _zoom = null; + else + _zoom = value; + } + } + double? _zoom; // PDF treats 0 and null equally. + + /// + /// Gets or sets whether the outline item is opened (or expanded). + /// + public bool Opened + { + get { return _opened; } +#if true + set { _opened = value; } +#else + // TODO: adjust openCount of ascendant... + set + { + if (_opened != value) + { + _opened = value; + int sign = value ? 1 : -1; + PdfOutline parent = _parent; + if (_opened) + { + while (parent != null) + parent.openCount += 1 + _openCount; + } + else + { + } + } + } +#endif + } + bool _opened; + + /// + /// Gets or sets the style of the outline text. + /// + public PdfOutlineStyle Style + { + get { return (PdfOutlineStyle)Elements.GetInteger(Keys.F); } + set { Elements.SetInteger(Keys.F, (int)value); } + } + + /// + /// Gets or sets the type of the page destination. + /// + public PdfPageDestinationType PageDestinationType + { + get { return _pageDestinationType; } + set { _pageDestinationType = value; } + } + PdfPageDestinationType _pageDestinationType = PdfPageDestinationType.Xyz; + + /// + /// Gets or sets the color of the text. + /// + /// The color of the text. + public XColor TextColor + { + get { return _textColor; } + set { _textColor = value; } + } + XColor _textColor; + + /// + /// Gets a value indicating whether this outline object has child items. + /// + public bool HasChildren + { + get { return _outlines != null && _outlines.Count > 0; } + } + + /// + /// Gets the outline collection of this node. + /// + public PdfOutlineCollection Outlines + { + get { return _outlines ?? (_outlines = new PdfOutlineCollection(Owner, this)); } + } + PdfOutlineCollection _outlines; + + /// + /// Initializes this instance from an existing PDF document. + /// + void Initialize() + { + string title; + if (Elements.TryGetString(Keys.Title, out title)) + Title = title; + + PdfReference parentRef = Elements.GetReference(Keys.Parent); + if (parentRef != null) + { + PdfOutline parent = parentRef.Value as PdfOutline; + if (parent != null) + Parent = parent; + } + + Count = Elements.GetInteger(Keys.Count); + + PdfArray colors = Elements.GetArray(Keys.C); + if (colors != null && colors.Elements.Count == 3) + { + double r = colors.Elements.GetReal(0); + double g = colors.Elements.GetReal(1); + double b = colors.Elements.GetReal(2); + TextColor = XColor.FromArgb((int)(r * 255), (int)(g * 255), (int)(b * 255)); + } + + // Style directly works on dictionary element. + + PdfItem dest = Elements.GetValue(Keys.Dest); + PdfItem a = Elements.GetValue(Keys.A); + Debug.Assert(dest == null || a == null, "Either destination or goto action."); + + PdfArray destArray = null; + if (dest != null) + { + destArray = dest as PdfArray; + if (destArray != null) + { + SplitDestinationPage(destArray); + } + else + { + Debug.Assert(false, "See what to do when this happened."); + } + } + else if (a != null) + { + // The dictionary should be a GoTo action. + PdfDictionary action = a as PdfDictionary; + if (action != null && action.Elements.GetName(PdfAction.Keys.S) == "/GoTo") + { + dest = action.Elements[PdfGoToAction.Keys.D]; + destArray = dest as PdfArray; + if (destArray != null) + { + // Replace Action with /Dest entry. + Elements.Remove(Keys.A); + Elements.Add(Keys.Dest, destArray); + SplitDestinationPage(destArray); + } + else + { + throw new Exception("Destination Array expected."); + } + } + else + { + Debug.Assert(false, "See what to do when this happened."); + } + } + else + { + // Neither destination page nor GoTo action. + } + + InitializeChildren(); + } + + void SplitDestinationPage(PdfArray destination) // Reference: 8.2 Destination syntax / Page 582 + { + // ReSharper disable HeuristicUnreachableCode +#pragma warning disable 162 + + // The destination page may not yet have been transformed to PdfPage. + PdfDictionary destPage = (PdfDictionary)((PdfReference)destination.Elements[0]).Value; + PdfPage page = destPage as PdfPage; + if (page == null) + page = new PdfPage(destPage); + + DestinationPage = page; + PdfName type = destination.Elements[1] as PdfName; + if (type != null) + { + PageDestinationType = (PdfPageDestinationType)Enum.Parse(typeof(PdfPageDestinationType), type.Value.Substring(1), true); + switch (PageDestinationType) + { + // [page /XYZ left top zoom] -- left, top, and zoom can be null. + case PdfPageDestinationType.Xyz: + Left = destination.Elements.GetNullableReal(2); + Top = destination.Elements.GetNullableReal(3); + Zoom = destination.Elements.GetNullableReal(4); // For this parameter, null and 0 have the same meaning. + break; + + // [page /Fit] + case PdfPageDestinationType.Fit: + // /Fit has no parameters. + break; + + // [page /FitH top] -- top can be null. + case PdfPageDestinationType.FitH: + Top = destination.Elements.GetNullableReal(2); + break; + + // [page /FitV left] -- left can be null. + case PdfPageDestinationType.FitV: + Left = destination.Elements.GetNullableReal(2); + break; + + // [page /FitR left bottom right top] -- left, bottom, right, and top must not be null. + // TODO An exception in GetReal leads to an inconsistent document. Deal with that - e.g. by registering the corruption and preventing the user from saving the corrupted document. + case PdfPageDestinationType.FitR: + Left = destination.Elements.GetReal(2); + Bottom = destination.Elements.GetReal(3); + Right = destination.Elements.GetReal(4); + Top = destination.Elements.GetReal(5); + break; + + // [page /FitB] + case PdfPageDestinationType.FitB: + // /Fit has no parameters. + break; + + // [page /FitBH top] -- top can be null. + case PdfPageDestinationType.FitBH: + Top = destination.Elements.GetReal(2); + break; + + // [page /FitBV left] -- left can be null. + case PdfPageDestinationType.FitBV: + Left = destination.Elements.GetReal(2); + break; + + default: + throw new ArgumentOutOfRangeException(); + } + } + +#pragma warning restore 162 + // ReSharper restore HeuristicUnreachableCode + } + + void InitializeChildren() + { + PdfReference firstRef = Elements.GetReference(Keys.First); + PdfReference lastRef = Elements.GetReference(Keys.Last); + PdfReference current = firstRef; + while (current != null) + { + // Create item and add it to outline items dictionary. + PdfOutline item = new PdfOutline((PdfDictionary)current.Value); + Outlines.Add(item); + + current = item.Elements.GetReference(Keys.Next); +#if DEBUG_ + if (current == null) + { + if (item.Reference != lastRef) + { + // Word produces PDFs that come to this case. + GetType(); + } + } +#endif + } + } + + /// + /// Creates key/values pairs according to the object structure. + /// + internal override void PrepareForSave() + { + bool hasKids = HasChildren; + // Is something to do at all? + if (_parent != null || hasKids) + { + if (_parent == null) + { + // Case: This is the outline dictionary (the root). + // Reference: TABLE 8.3 Entries in the outline dictionary / Page 585 + Debug.Assert(_outlines != null && _outlines.Count > 0 && _outlines[0] != null); + Elements[Keys.First] = _outlines[0].Reference; + Elements[Keys.Last] = _outlines[_outlines.Count - 1].Reference; + + // TODO: /Count - the meaning is not completely clear to me. + // Get PDFs created with Acrobat and analyze what to implement. + if (OpenCount > 0) + Elements[Keys.Count] = new PdfInteger(OpenCount); + } + else + { + // Case: This is an outline item dictionary. + // Reference: TABLE 8.4 Entries in the outline item dictionary / Page 585 + Elements[Keys.Parent] = _parent.Reference; + + int count = _parent._outlines.Count; + int index = _parent._outlines.IndexOf(this); + Debug.Assert(index != -1); + + // Has destination? + if (DestinationPage != null) + Elements[Keys.Dest] = CreateDestArray(); + + // Not the first element? + if (index > 0) + Elements[Keys.Prev] = _parent._outlines[index - 1].Reference; + + // Not the last element? + if (index < count - 1) + Elements[Keys.Next] = _parent._outlines[index + 1].Reference; + + if (hasKids) + { + Elements[Keys.First] = _outlines[0].Reference; + Elements[Keys.Last] = _outlines[_outlines.Count - 1].Reference; + } + // TODO: /Count - the meaning is not completely clear to me + if (OpenCount > 0) + Elements[Keys.Count] = new PdfInteger((_opened ? 1 : -1) * OpenCount); + + if (_textColor != XColor.Empty && Owner.HasVersion("1.4")) + Elements[Keys.C] = new PdfLiteral("[{0}]", PdfEncoders.ToString(_textColor, PdfColorMode.Rgb)); + + // if (Style != PdfOutlineStyle.Regular && Document.HasVersion("1.4")) + // //pdf.AppendFormat("/F {0}\n", (int)_style); + // Elements[Keys.F] = new PdfInteger((int)_style); + } + + // Prepare child elements. + if (hasKids) + { + foreach (PdfOutline outline in _outlines) + outline.PrepareForSave(); + } + } + } + + PdfArray CreateDestArray() + { + PdfArray dest = null; + switch (PageDestinationType) + { + // [page /XYZ left top zoom] + case PdfPageDestinationType.Xyz: + dest = new PdfArray(Owner, + DestinationPage.Reference, new PdfLiteral(String.Format("/XYZ {0} {1} {2}", Fd(Left), Fd(Top), Fd(Zoom)))); + break; + + // [page /Fit] + case PdfPageDestinationType.Fit: + dest = new PdfArray(Owner, + DestinationPage.Reference, new PdfLiteral("/Fit")); + break; + + // [page /FitH top] + case PdfPageDestinationType.FitH: + dest = new PdfArray(Owner, + DestinationPage.Reference, new PdfLiteral(String.Format("/FitH {0}", Fd(Top)))); + break; + + // [page /FitV left] + case PdfPageDestinationType.FitV: + dest = new PdfArray(Owner, + DestinationPage.Reference, new PdfLiteral(String.Format("/FitV {0}", Fd(Left)))); + break; + + // [page /FitR left bottom right top] + case PdfPageDestinationType.FitR: + dest = new PdfArray(Owner, + DestinationPage.Reference, new PdfLiteral(String.Format("/FitR {0} {1} {2} {3}", Fd(Left), Fd(Bottom), Fd(Right), Fd(Top)))); + break; + + // [page /FitB] + case PdfPageDestinationType.FitB: + dest = new PdfArray(Owner, + DestinationPage.Reference, new PdfLiteral("/FitB")); + break; + + // [page /FitBH top] + case PdfPageDestinationType.FitBH: + dest = new PdfArray(Owner, + DestinationPage.Reference, new PdfLiteral(String.Format("/FitBH {0}", Fd(Top)))); + break; + + // [page /FitBV left] + case PdfPageDestinationType.FitBV: + dest = new PdfArray(Owner, + DestinationPage.Reference, new PdfLiteral(String.Format("/FitBV {0}", Fd(Left)))); + break; + + default: + throw new ArgumentOutOfRangeException(); + } + return dest; + } + + /// + /// Format double. + /// + string Fd(double value) + { + if (Double.IsNaN(value)) + throw new InvalidOperationException("Value is not a valid Double."); + return value.ToString("#.##", CultureInfo.InvariantCulture); + + //return Double.IsNaN(value) ? "null" : value.ToString("#.##", CultureInfo.InvariantCulture); + } + + /// + /// Format nullable double. + /// + string Fd(double? value) + { + return value.HasValue ? value.Value.ToString("#.##", CultureInfo.InvariantCulture) : "null"; + } + + internal override void WriteObject(PdfWriter writer) + { +#if DEBUG + writer.WriteRaw("% Title = " + FilterUnicode(Title) + "\n"); +#endif + // TODO: Proof that there is nothing to do here. + bool hasKids = HasChildren; + if (_parent != null || hasKids) + { + ////// Everything done in PrepareForSave + ////if (_parent == null) + ////{ + //// // This is the outline dictionary (the root) + ////} + ////else + ////{ + //// // This is an outline item dictionary + ////} + base.WriteObject(writer); + } + } + +#if DEBUG + private string FilterUnicode(string text) + { + StringBuilder result = new StringBuilder(); + foreach (char ch in text) + result.Append((uint)ch < 256 ? (ch != '\r' && ch != '\n' ? ch : ' ') : '?'); + return result.ToString(); + } +#endif + + /// + /// Predefined keys of this dictionary. + /// + internal sealed class Keys : KeysBase + { + // ReSharper disable InconsistentNaming + + /// + /// (Optional) The type of PDF object that this dictionary describes; if present, + /// must be Outlines for an outline dictionary. + /// + [KeyInfo(KeyType.Name | KeyType.Optional, FixedValue = "Outlines")] + public const string Type = "/Type"; + + // Outline and outline item are combined + ///// + ///// (Required if there are any open or closed outline entries; must be an indirect reference) + ///// An outline item dictionary representing the first top-level item in the outline. + ///// + //[KeyInfo(KeyType.Dictionary)] + //public const string First = "/First"; + // + ///// + ///// (Required if there are any open or closed outline entries; must be an indirect reference) + ///// An outline item dictionary representing the last top-level item in the outline. + ///// + //[KeyInfo(KeyType.Dictionary)] + //public const string Last = "/Last"; + // + ///// + ///// (Required if the document has any open outline entries) The total number of open items at all + ///// levels of the outline. This entry should be omitted if there are no open outline items. + ///// + //[KeyInfo(KeyType.Integer)] + //public const string Count = "/Count"; + + /// + /// (Required) The text to be displayed on the screen for this item. + /// + [KeyInfo(KeyType.String | KeyType.Required)] + public const string Title = "/Title"; + + /// + /// (Required; must be an indirect reference) The parent of this item in the outline hierarchy. + /// The parent of a top-level item is the outline dictionary itself. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required)] + public const string Parent = "/Parent"; + + /// + /// (Required for all but the first item at each level; must be an indirect reference) + /// The previous item at this outline level. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required)] + public const string Prev = "/Prev"; + + /// + /// (Required for all but the last item at each level; must be an indirect reference) + /// The next item at this outline level. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required)] + public const string Next = "/Next"; + + /// + /// (Required if the item has any descendants; must be an indirect reference) + /// The first of this items immediate children in the outline hierarchy. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required)] + public const string First = "/First"; + + /// + /// (Required if the item has any descendants; must be an indirect reference) + /// The last of this items immediate children in the outline hierarchy. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required)] + public const string Last = "/Last"; + + /// + /// (Required if the item has any descendants) If the item is open, the total number of its + /// open descendants at all lower levels of the outline hierarchy. If the item is closed, a + /// negative integer whose absolute value specifies how many descendants would appear if the + /// item were reopened. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string Count = "/Count"; + + /// + /// (Optional; not permitted if an A entry is present) The destination to be displayed when this + /// item is activated. + /// + [KeyInfo(KeyType.ArrayOrNameOrString | KeyType.Optional)] + public const string Dest = "/Dest"; + + /// + /// (Optional; not permitted if a Dest entry is present) The action to be performed when + /// this item is activated. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional)] + public const string A = "/A"; + + /// + /// (Optional; PDF 1.3; must be an indirect reference) The structure element to which the item + /// refers. + /// Note: The ability to associate an outline item with a structure element (such as the beginning + /// of a chapter) is a PDF 1.3 feature. For backward compatibility with earlier PDF versions, such + /// an item should also specify a destination (Dest) corresponding to an area of a page where the + /// contents of the designated structure element are displayed. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Optional)] + public const string SE = "/SE"; + + /// + /// (Optional; PDF 1.4) An array of three numbers in the range 0.0 to 1.0, representing the + /// components in the DeviceRGB color space of the color to be used for the outline entrys text. + /// Default value: [0.0 0.0 0.0]. + /// + [KeyInfo(KeyType.Array | KeyType.Optional)] + public const string C = "/C"; + + /// + /// (Optional; PDF 1.4) A set of flags specifying style characteristics for displaying the outline + /// items text. Default value: 0. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string F = "/F"; + + /// + /// Gets the KeysMeta for these keys. + /// + public static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + + // ReSharper restore InconsistentNaming + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf/PdfOutlineCollection.cs b/PdfSharp/Pdf/PdfOutlineCollection.cs new file mode 100644 index 0000000..6cd3258 --- /dev/null +++ b/PdfSharp/Pdf/PdfOutlineCollection.cs @@ -0,0 +1,338 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Collections; +using PdfSharp.Drawing; + +// Review: CountOpen does not work. - StL/14-10-05 + +namespace PdfSharp.Pdf +{ + /// + /// Represents a collection of outlines. + /// + public class PdfOutlineCollection : PdfObject, ICollection, IList + { + /// + /// Can only be created as part of PdfOutline. + /// + internal PdfOutlineCollection(PdfDocument document, PdfOutline parent) + : base(document) + { + _parent = parent; + } + + /// + /// Indicates whether the outline collection has at least one entry. + /// + [Obsolete("Use 'Count > 0' - HasOutline will throw exception.")] + public bool HasOutline // DELETE: 15-10-01 + { + get + { + //return Count > 0; + throw new InvalidOperationException("Use 'Count > 0'"); + } + } + + /// + /// Removes the first occurrence of a specific item from the collection. + /// + public bool Remove(PdfOutline item) + { + if (_outlines.Remove(item)) + { + RemoveFromOutlinesTree(item); + return true; + } + return false; + } + + /// + /// Gets the number of entries in this collection. + /// + public int Count + { + get { return _outlines.Count; } + } + + /// + /// Returns false. + /// + public bool IsReadOnly + { + get { return false; } + } + + /// + /// Adds the specified outline. + /// + public void Add(PdfOutline outline) + { + if (outline == null) + throw new ArgumentNullException("outline"); + + // DestinationPage is optional. PDFsharp does not yet support outlines with action ("/A") instead of destination page ("/DEST") + if (outline.DestinationPage != null && !ReferenceEquals(Owner, outline.DestinationPage.Owner)) + throw new ArgumentException("Destination page must belong to this document."); + + //// TODO check the parent problems... + ////outline.Document = Owner; + ////outline.Parent = _parent; + ////Owner._irefTable.Add(outline); + + AddToOutlinesTree(outline); + _outlines.Add(outline); + + if (outline.Opened) + { + outline = _parent; + while (outline != null) + { + outline.OpenCount++; + outline = outline.Parent; + } + } + } + + /// + /// Removes all elements form the collection. + /// + public void Clear() + { + if (Count > 0) + { + PdfOutline[] array = new PdfOutline[Count]; + _outlines.CopyTo(array); + _outlines.Clear(); + foreach (PdfOutline item in array) + { + RemoveFromOutlinesTree(item); + } + } + } + + /// + /// Determines whether the specified element is in the collection. + /// + public bool Contains(PdfOutline item) + { + return _outlines.Contains(item); + } + + /// + /// Copies the collection to an array, starting at the specified index of the target array. + /// + public void CopyTo(PdfOutline[] array, int arrayIndex) + { + _outlines.CopyTo(array, arrayIndex); + } + + /// + /// Adds the specified outline entry. + /// + /// The outline text. + /// The destination page. + /// Specifies whether the node is displayed expanded (opened) or collapsed. + /// The font style used to draw the outline text. + /// The color used to draw the outline text. + public PdfOutline Add(string title, PdfPage destinationPage, bool opened, PdfOutlineStyle style, XColor textColor) + { + PdfOutline outline = new PdfOutline(title, destinationPage, opened, style, textColor); + Add(outline); + return outline; + } + + /// + /// Adds the specified outline entry. + /// + /// The outline text. + /// The destination page. + /// Specifies whether the node is displayed expanded (opened) or collapsed. + /// The font style used to draw the outline text. + public PdfOutline Add(string title, PdfPage destinationPage, bool opened, PdfOutlineStyle style) + { + PdfOutline outline = new PdfOutline(title, destinationPage, opened, style); + Add(outline); + return outline; + } + + /// + /// Adds the specified outline entry. + /// + /// The outline text. + /// The destination page. + /// Specifies whether the node is displayed expanded (opened) or collapsed. + public PdfOutline Add(string title, PdfPage destinationPage, bool opened) + { + PdfOutline outline = new PdfOutline(title, destinationPage, opened); + Add(outline); + return outline; + } + + /// + /// Creates a PdfOutline and adds it into the outline collection. + /// + public PdfOutline Add(string title, PdfPage destinationPage) + { + PdfOutline outline = new PdfOutline(title, destinationPage); + Add(outline); + return outline; + } + + /// + /// Gets the index of the specified item. + /// + public int IndexOf(PdfOutline item) + { + return _outlines.IndexOf(item); + } + + /// + /// Inserts the item at the specified index. + /// + public void Insert(int index, PdfOutline outline) + { + if (outline == null) + throw new ArgumentNullException("outline"); + if (index < 0 || index >= _outlines.Count) + throw new ArgumentOutOfRangeException("index", index, PSSR.OutlineIndexOutOfRange); + + AddToOutlinesTree(outline); + _outlines.Insert(index, outline); + } + + /// + /// Removes the outline item at the specified index. + /// + public void RemoveAt(int index) + { + PdfOutline outline = _outlines[index]; + _outlines.RemoveAt(index); + RemoveFromOutlinesTree(outline); + } + + /// + /// Gets the at the specified index. + /// + public PdfOutline this[int index] + { + get + { + if (index < 0 || index >= _outlines.Count) + throw new ArgumentOutOfRangeException("index", index, PSSR.OutlineIndexOutOfRange); + return _outlines[index]; + } + set + { + if (index < 0 || index >= _outlines.Count) + throw new ArgumentOutOfRangeException("index", index, PSSR.OutlineIndexOutOfRange); + if (value == null) + throw new ArgumentOutOfRangeException("value", null, PSSR.SetValueMustNotBeNull); + + AddToOutlinesTree(value); + _outlines[index] = value; + } + } + + /// + /// Returns an enumerator that iterates through the outline collection. + /// + public IEnumerator GetEnumerator() + { + return _outlines.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + internal int CountOpen() + { + int count = 0; + //foreach (PdfOutline outline in _outlines) + // count += outline.CountOpen(); + return count; + } + + void AddToOutlinesTree(PdfOutline outline) + { + if (outline == null) + throw new ArgumentNullException("outline"); + + // DestinationPage is optional. PDFsharp does not yet support outlines with action ("/A") instead of destination page ("/DEST") + if (outline.DestinationPage != null && !ReferenceEquals(Owner, outline.DestinationPage.Owner)) + throw new ArgumentException("Destination page must belong to this document."); + + // TODO check the parent problems... + outline.Document = Owner; + outline.Parent = _parent; + + //_outlines.Add(outline); + if (!Owner._irefTable.Contains(outline.ObjectID)) + Owner._irefTable.Add(outline); + else + { + outline.GetType(); + } + + //if (outline.Opened) + //{ + // outline = _parent; + // while (outline != null) + // { + // outline.OpenCount++; + // outline = outline.Parent; + // } + //} + } + + void RemoveFromOutlinesTree(PdfOutline outline) + { + if (outline == null) + throw new ArgumentNullException("outline"); + + // TODO check the parent problems... + //outline.Document = Owner; + outline.Parent = null; + + Owner._irefTable.Remove(outline.Reference); + } + + /// + /// The parent outine of this collection. + /// + readonly PdfOutline _parent; + + readonly List _outlines = new List(); + } +} diff --git a/PdfSharp/Pdf/PdfPage.cs b/PdfSharp/Pdf/PdfPage.cs new file mode 100644 index 0000000..e574ee9 --- /dev/null +++ b/PdfSharp/Pdf/PdfPage.cs @@ -0,0 +1,1028 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using System.ComponentModel; +using PdfSharp.Pdf.IO; +using PdfSharp.Drawing; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.Annotations; + +namespace PdfSharp.Pdf +{ + /// + /// Represents a page in a PDF document. + /// + public sealed class PdfPage : PdfDictionary, IContentStream + { + /// + /// Initializes a new page. The page must be added to a document before it can be used. + /// Depending of the IsMetric property of the current region the page size is set to + /// A4 or Letter respectively. If this size is not appropriate it should be changed before + /// any drawing operations are performed on the page. + /// + public PdfPage() + { + Elements.SetName(Keys.Type, "/Page"); + Initialize(); + } + + /// + /// Initializes a new instance of the class. + /// + /// The document. + public PdfPage(PdfDocument document) + : base(document) + { + Elements.SetName(Keys.Type, "/Page"); + Elements[Keys.Parent] = document.Pages.Reference; + Initialize(); + } + + internal PdfPage(PdfDictionary dict) + : base(dict) + { + // Set Orientation depending on /Rotate. + + //!!!modTHHO 2016-06-16 Do not set Orientation here. Setting Orientation is not enough. Other properties must also be changed when setting Orientation. + //!!!modTHHO 2018-04-05 Restored the old behavior. Commenting the next three lines out is not enough either. + // New approach: remember that Orientation was set based on rotation. + int rotate = Elements.GetInteger(InheritablePageKeys.Rotate); + if (Math.Abs((rotate / 90)) % 2 == 1) + { +#if true + _orientation = PageOrientation.Landscape; + // Hacky approach: do not swap width and height on saving when orientation was set here. + _orientationSetByCodeForRotatedDocument = true; +#else + // Cleaner approach: Swap width and height here. But some drawing routines will not draw the XPdfForm correctly, so this needs more testing and more changes. + // When saving, width and height will be swapped. So we have to swap them here too. + PdfRectangle mediaBox = MediaBox; + MediaBox = new PdfRectangle(mediaBox.X1, mediaBox.Y1, mediaBox.Y2, mediaBox.X2); +#endif + } + } + + void Initialize() + { + Size = RegionInfo.CurrentRegion.IsMetric ? PageSize.A4 : PageSize.Letter; + +#pragma warning disable 168 + // Force creation of MediaBox object by invoking property. + PdfRectangle rect = MediaBox; +#pragma warning restore 168 + } + + /// + /// Gets or sets a user defined object that contains arbitrary information associated with this PDF page. + /// The tag is not used by PDFsharp. + /// + public object Tag + { + get { return _tag; } + set { _tag = value; } + } + object _tag; + + /// + /// Closes the page. A closed page cannot be modified anymore and it is not possible to + /// get an XGraphics object for a closed page. Closing a page is not required, but may save + /// resources if the document has many pages. + /// + public void Close() + { + //// Close renderer, if any + //if (_content.pdfRenderer != null) + // _content.pdfRenderer.endp.Close(); + _closed = true; + } + bool _closed; + + /// + /// Gets a value indicating whether the page is closed. + /// + internal bool IsClosed + { + get { return _closed; } + } + + /// + /// Gets or sets the PdfDocument this page belongs to. + /// + internal override PdfDocument Document + { + set + { + if (!ReferenceEquals(_document, value)) + { + if (_document != null) + throw new InvalidOperationException("Cannot change document."); + _document = value; + if (Reference != null) + Reference.Document = value; + Elements[Keys.Parent] = _document.Pages.Reference; + } + } + } + + /// + /// Gets or sets the orientation of the page. The default value PageOrientation.Portrait. + /// If an imported page has a /Rotate value that matches the formula 90 + n * 180 the + /// orientation is set to PageOrientation.Landscape. + /// + public PageOrientation Orientation + { + get { return _orientation; } + set + { + _orientation = value; + _orientationSetByCodeForRotatedDocument = false; + } + } + PageOrientation _orientation; + bool _orientationSetByCodeForRotatedDocument; + // TODO Simplify the implementation. Should /Rotate 90 lead to Landscape format? + // TODO Clean implementation without _orientationSetByCodeForRotatedDocument. + + /// + /// Gets or sets one of the predefined standard sizes like. + /// + public PageSize Size + { + get { return _pageSize; } + set + { + if (!Enum.IsDefined(typeof(PageSize), value)) + throw new InvalidEnumArgumentException("value", (int)value, typeof(PageSize)); + + XSize size = PageSizeConverter.ToSize(value); + // MediaBox is always in Portrait mode (see Height, Width). + // So take Orientation NOT into account. + MediaBox = new PdfRectangle(0, 0, size.Width, size.Height); + _pageSize = value; + } + } + PageSize _pageSize; + + /// + /// Gets or sets the trim margins. + /// + public TrimMargins TrimMargins + { + get + { + if (_trimMargins == null) + _trimMargins = new TrimMargins(); + return _trimMargins; + } + set + { + if (_trimMargins == null) + _trimMargins = new TrimMargins(); + if (value != null) + { + _trimMargins.Left = value.Left; + _trimMargins.Right = value.Right; + _trimMargins.Top = value.Top; + _trimMargins.Bottom = value.Bottom; + } + else + _trimMargins.All = 0; + } + } + TrimMargins _trimMargins = new TrimMargins(); + + /// + /// Gets or sets the media box directly. XGrahics is not prepared to work with a media box + /// with an origin other than (0,0). + /// + public PdfRectangle MediaBox + { + get { return Elements.GetRectangle(Keys.MediaBox, true); } + set { Elements.SetRectangle(Keys.MediaBox, value); } + } + + /// + /// Gets or sets the crop box. + /// + public PdfRectangle CropBox + { + get { return Elements.GetRectangle(Keys.CropBox, true); } + set { Elements.SetRectangle(Keys.CropBox, value); } + } + + /// + /// Gets or sets the bleed box. + /// + public PdfRectangle BleedBox + { + get { return Elements.GetRectangle(Keys.BleedBox, true); } + set { Elements.SetRectangle(Keys.BleedBox, value); } + } + + /// + /// Gets or sets the art box. + /// + public PdfRectangle ArtBox + { + get { return Elements.GetRectangle(Keys.ArtBox, true); } + set { Elements.SetRectangle(Keys.ArtBox, value); } + } + + /// + /// Gets or sets the trim box. + /// + public PdfRectangle TrimBox + { + get { return Elements.GetRectangle(Keys.TrimBox, true); } + set { Elements.SetRectangle(Keys.TrimBox, value); } + } + + /// + /// Gets or sets the height of the page. If orientation is Landscape, this function applies to + /// the width. + /// + public XUnit Height + { + get + { + PdfRectangle rect = MediaBox; + return _orientation == PageOrientation.Portrait ? rect.Height : rect.Width; + } + set + { + PdfRectangle rect = MediaBox; + if (_orientation == PageOrientation.Portrait) + MediaBox = new PdfRectangle(rect.X1, 0, rect.X2, value); + else + MediaBox = new PdfRectangle(0, rect.Y1, value, rect.Y2); + _pageSize = PageSize.Undefined; + } + } + + /// + /// Gets or sets the width of the page. If orientation is Landscape, this function applies to + /// the height. + /// + public XUnit Width + { + get + { + PdfRectangle rect = MediaBox; + return _orientation == PageOrientation.Portrait ? rect.Width : rect.Height; + } + set + { + PdfRectangle rect = MediaBox; + if (_orientation == PageOrientation.Portrait) + MediaBox = new PdfRectangle(0, rect.Y1, value, rect.Y2); + else + MediaBox = new PdfRectangle(rect.X1, 0, rect.X2, value); + _pageSize = PageSize.Undefined; + } + } + + /// + /// Gets or sets the /Rotate entry of the PDF page. The value is the number of degrees by which the page + /// should be rotated clockwise when displayed or printed. The value must be a multiple of 90. + /// PDFsharp does not set this value, but for imported pages this value can be set and must be taken + /// into account when adding graphic to such a page. + /// + public int Rotate + { + get { return _elements.GetInteger(InheritablePageKeys.Rotate); } + set + { + if (value % 90 != 0) + throw new ArgumentException("Value must be a multiple of 90."); + _elements.SetInteger(InheritablePageKeys.Rotate, value); + } + } + + // TODO: PdfAnnotations + // TODO: PdfActions + // TODO: PdfPageTransition + + /// + /// The content stream currently used by an XGraphics object for rendering. + /// + internal PdfContent RenderContent; + + /// + /// Gets the array of content streams of the page. + /// + public PdfContents Contents + { + get + { + if (_contents == null) + { + if (true) // || Document.IsImported) + { + PdfItem item = Elements[Keys.Contents]; + if (item == null) + { + _contents = new PdfContents(Owner); + //Owner.irefTable.Add(_contents); + } + else + { + if (item is PdfReference) + item = ((PdfReference)item).Value; + + PdfArray array = item as PdfArray; + if (array != null) + { + // It is already an array of content streams. + if (array.IsIndirect) + { + // Make it a direct array + array = array.Clone(); + array.Document = Owner; + } + // TODO 4STLA: Causes Exception "Object type transformation must not be done with direct objects" in "protected PdfObject(PdfObject obj)" + _contents = new PdfContents(array); + } + else + { + // Only one content stream -> create array + _contents = new PdfContents(Owner); + //Owner.irefTable.Add(_contents); + PdfContent content = new PdfContent((PdfDictionary)item); + _contents.Elements.Add(content.Reference); + } + } + } + //else + //{ + // _content = new PdfContent(Document); + // Document.xrefTable.Add(_content); + //} + Debug.Assert(_contents.Reference == null); + Elements[Keys.Contents] = _contents; + } + return _contents; + } + } + PdfContents _contents; + +#region Annotations + + /// + /// Gets the annotations array of this page. + /// + public bool HasAnnotations + { + get + { + if (_annotations == null) + { + // Get annotations array if exists. + _annotations = (PdfAnnotations)Elements.GetValue(Keys.Annots); + _annotations.Page = this; + } + return _annotations != null; + } + } + + /// + /// Gets the annotations array of this page. + /// + public PdfAnnotations Annotations + { + get + { + if (_annotations == null) + { + // Get or create annotations array. + _annotations = (PdfAnnotations)Elements.GetValue(Keys.Annots, VCF.Create); + _annotations.Page = this; + } + return _annotations; + } + } + PdfAnnotations _annotations; + + /// + /// Adds an intra document link. + /// + /// The rect. + /// The destination page. + public PdfLinkAnnotation AddDocumentLink(PdfRectangle rect, int destinationPage) + { + PdfLinkAnnotation annotation = PdfLinkAnnotation.CreateDocumentLink(rect, destinationPage); + Annotations.Add(annotation); + return annotation; + } + + /// + /// Adds a link to the Web. + /// + /// The rect. + /// The URL. + public PdfLinkAnnotation AddWebLink(PdfRectangle rect, string url) + { + PdfLinkAnnotation annotation = PdfLinkAnnotation.CreateWebLink(rect, url); + Annotations.Add(annotation); + return annotation; + } + + /// + /// Adds a link to a file. + /// + /// The rect. + /// Name of the file. + public PdfLinkAnnotation AddFileLink(PdfRectangle rect, string fileName) + { + PdfLinkAnnotation annotation = PdfLinkAnnotation.CreateFileLink(rect, fileName); + Annotations.Add(annotation); + return annotation; + } + +#endregion + + /// + /// Gets or sets the custom values. + /// + public PdfCustomValues CustomValues + { + get + { + if (_customValues == null) + _customValues = PdfCustomValues.Get(Elements); + return _customValues; + } + set + { + if (value != null) + throw new ArgumentException("Only null is allowed to clear all custom values."); + PdfCustomValues.Remove(Elements); + _customValues = null; + } + } + PdfCustomValues _customValues; + + /// + /// Gets the PdfResources object of this page. + /// + public PdfResources Resources + { + get + { + if (_resources == null) + _resources = (PdfResources)Elements.GetValue(Keys.Resources, VCF.Create); //VCF.CreateIndirect + return _resources; + } + } + PdfResources _resources; + + /// + /// Implements the interface because the primary function is internal. + /// + PdfResources IContentStream.Resources + { + get { return Resources; } + } + + /// + /// Gets the resource name of the specified font within this page. + /// + internal string GetFontName(XFont font, out PdfFont pdfFont) + { + pdfFont = _document.FontTable.GetFont(font); + Debug.Assert(pdfFont != null); + string name = Resources.AddFont(pdfFont); + return name; + } + + string IContentStream.GetFontName(XFont font, out PdfFont pdfFont) + { + return GetFontName(font, out pdfFont); + } + + /// + /// Tries to get the resource name of the specified font data within this page. + /// Returns null if no such font exists. + /// + internal string TryGetFontName(string idName, out PdfFont pdfFont) + { + pdfFont = _document.FontTable.TryGetFont(idName); + string name = null; + if (pdfFont != null) + name = Resources.AddFont(pdfFont); + return name; + } + + /// + /// Gets the resource name of the specified font data within this page. + /// + internal string GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) + { + pdfFont = _document.FontTable.GetFont(idName, fontData); + //pdfFont = new PdfType0Font(Owner, idName, fontData); + //pdfFont.Document = _document; + Debug.Assert(pdfFont != null); + string name = Resources.AddFont(pdfFont); + return name; + } + + string IContentStream.GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) + { + return GetFontName(idName, fontData, out pdfFont); + } + + /// + /// Gets the resource name of the specified image within this page. + /// + internal string GetImageName(XImage image) + { + PdfImage pdfImage = _document.ImageTable.GetImage(image); + Debug.Assert(pdfImage != null); + string name = Resources.AddImage(pdfImage); + return name; + } + + /// + /// Implements the interface because the primary function is internal. + /// + string IContentStream.GetImageName(XImage image) + { + return GetImageName(image); + } + + /// + /// Gets the resource name of the specified form within this page. + /// + internal string GetFormName(XForm form) + { + PdfFormXObject pdfForm = _document.FormTable.GetForm(form); + Debug.Assert(pdfForm != null); + string name = Resources.AddForm(pdfForm); + return name; + } + + /// + /// Implements the interface because the primary function is internal. + /// + string IContentStream.GetFormName(XForm form) + { + return GetFormName(form); + } + + internal override void WriteObject(PdfWriter writer) + { + // HACK: temporarily flip media box if Landscape + PdfRectangle mediaBox = MediaBox; + // TODO: Take /Rotate into account + //!!!newTHHO 2018-04-05 Stop manipulating the MediaBox - Height and Width properties already take orientation into account. + //!!!delTHHO 2018-04-05 if (_orientation == PageOrientation.Landscape) + //!!!delTHHO 2018-04-05 MediaBox = new PdfRectangle(mediaBox.X1, mediaBox.Y1, mediaBox.Y2, mediaBox.X2); + // One step back - swap members in MediaBox for landscape orientation. + if (_orientation == PageOrientation.Landscape && !_orientationSetByCodeForRotatedDocument) + MediaBox = new PdfRectangle(mediaBox.X1, mediaBox.Y1, mediaBox.Y2, mediaBox.X2); + +#if true + // Add transparency group to prevent rendering problems of Adobe viewer. + // Update (PDFsharp 1.50 beta 3): Add transparency group only if ColorMode is defined. + // Rgb is the default for the ColorMode, but if user sets it to Undefined then + // we respect this and skip the transparency group. + TransparencyUsed = true; // TODO: check XObjects + if (TransparencyUsed && !Elements.ContainsKey(Keys.Group) && + _document.Options.ColorMode != PdfColorMode.Undefined) + { + PdfDictionary group = new PdfDictionary(); + _elements["/Group"] = group; + if (_document.Options.ColorMode != PdfColorMode.Cmyk) + group.Elements.SetName("/CS", "/DeviceRGB"); + else + group.Elements.SetName("/CS", "/DeviceCMYK"); + group.Elements.SetName("/S", "/Transparency"); + //False is default: group.Elements["/I"] = new PdfBoolean(false); + //False is default: group.Elements["/K"] = new PdfBoolean(false); + } +#endif + +#if DEBUG_ + PdfItem item = Elements["/MediaBox"]; + if (item != null) + item.GetType(); +#endif + base.WriteObject(writer); + + //!!!delTHHO 2018-04-05 if (_orientation == PageOrientation.Landscape) + //!!!delTHHO 2018-04-05 MediaBox = mediaBox; + // One step back - swap members in MediaBox for landscape orientation. + if (_orientation == PageOrientation.Landscape && !_orientationSetByCodeForRotatedDocument) + MediaBox = mediaBox; + } + + /// + /// Hack to indicate that a page-level transparency group must be created. + /// + internal bool TransparencyUsed; + + /// + /// Inherit values from parent node. + /// + internal static void InheritValues(PdfDictionary page, InheritedValues values) + { + // HACK: I'M ABSOLUTELY NOT SURE WHETHER THIS CODE COVERS ALL CASES. + if (values.Resources != null) + { + PdfDictionary resources; + PdfItem res = page.Elements[InheritablePageKeys.Resources]; + if (res is PdfReference) + { + resources = (PdfDictionary)((PdfReference)res).Value.Clone(); + resources.Document = page.Owner; + } + else + resources = (PdfDictionary)res; + + if (resources == null) + { + resources = values.Resources.Clone(); + resources.Document = page.Owner; + page.Elements.Add(InheritablePageKeys.Resources, resources); + } + else + { + foreach (PdfName name in values.Resources.Elements.KeyNames) + { + if (!resources.Elements.ContainsKey(name.Value)) + { + PdfItem item = values.Resources.Elements[name]; + if (item is PdfObject) + item = item.Clone(); + resources.Elements.Add(name.ToString(), item); + } + } + } + } + + if (values.MediaBox != null && page.Elements[InheritablePageKeys.MediaBox] == null) + page.Elements[InheritablePageKeys.MediaBox] = values.MediaBox; + + if (values.CropBox != null && page.Elements[InheritablePageKeys.CropBox] == null) + page.Elements[InheritablePageKeys.CropBox] = values.CropBox; + + if (values.Rotate != null && page.Elements[InheritablePageKeys.Rotate] == null) + page.Elements[InheritablePageKeys.Rotate] = values.Rotate; + } + + /// + /// Add all inheritable values from the specified page to the specified values structure. + /// + internal static void InheritValues(PdfDictionary page, ref InheritedValues values) + { + PdfItem item = page.Elements[InheritablePageKeys.Resources]; + if (item != null) + { + PdfReference reference = item as PdfReference; + if (reference != null) + values.Resources = (PdfDictionary)(reference.Value); + else + values.Resources = (PdfDictionary)item; + } + + item = page.Elements[InheritablePageKeys.MediaBox]; + if (item != null) + values.MediaBox = new PdfRectangle(item); + + item = page.Elements[InheritablePageKeys.CropBox]; + if (item != null) + values.CropBox = new PdfRectangle(item); + + item = page.Elements[InheritablePageKeys.Rotate]; + if (item != null) + { + if (item is PdfReference) + item = ((PdfReference)item).Value; + values.Rotate = (PdfInteger)item; + } + } + + internal override void PrepareForSave() + { + if (_trimMargins.AreSet) + { + // These are the values InDesign set for an A4 page with 3mm crop margin at each edge. + // (recall that PDF rect are two points and NOT a point and a width) + // /MediaBox[0.0 0.0 612.283 858.898] 216 302.7 + // /CropBox[0.0 0.0 612.283 858.898] + // /BleedBox[0.0 0.0 612.283 858.898] + // /ArtBox[8.50394 8.50394 603.78 850.394] 3 3 213 300 + // /TrimBox[8.50394 8.50394 603.78 850.394] + + double width = _trimMargins.Left.Point + Width.Point + _trimMargins.Right.Point; + double height = _trimMargins.Top.Point + Height.Point + _trimMargins.Bottom.Point; + + MediaBox = new PdfRectangle(0, 0, width, height); + CropBox = new PdfRectangle(0, 0, width, height); + BleedBox = new PdfRectangle(0, 0, width, height); + + PdfRectangle rect = new PdfRectangle(_trimMargins.Left.Point, _trimMargins.Top.Point, + width - _trimMargins.Right.Point, height - _trimMargins.Bottom.Point); + TrimBox = rect; + ArtBox = rect.Clone(); + } + } + + /// + /// Predefined keys of this dictionary. + /// + internal sealed class Keys : InheritablePageKeys + { + /// + /// (Required) The type of PDF object that this dictionary describes; + /// must be Page for a page object. + /// + [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Page")] + public const string Type = "/Type"; + + /// + /// (Required; must be an indirect reference) + /// The page tree node that is the immediate parent of this page object. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required | KeyType.MustBeIndirect)] + public const string Parent = "/Parent"; + + /// + /// (Required if PieceInfo is present; optional otherwise; PDF 1.3) The date and time + /// when the pages contents were most recently modified. If a page-piece dictionary + /// (PieceInfo) is present, the modification date is used to ascertain which of the + /// application data dictionaries that it contains correspond to the current content + /// of the page. + /// + [KeyInfo(KeyType.Date)] + public const string LastModified = "/LastModified"; + + /// + /// (Optional; PDF 1.3) A rectangle, expressed in default user space units, defining the + /// region to which the contents of the page should be clipped when output in a production + /// environment. Default value: the value of CropBox. + /// + [KeyInfo("1.3", KeyType.Rectangle | KeyType.Optional)] + public const string BleedBox = "/BleedBox"; + + /// + /// (Optional; PDF 1.3) A rectangle, expressed in default user space units, defining the + /// intended dimensions of the finished page after trimming. Default value: the value of + /// CropBox. + /// + [KeyInfo("1.3", KeyType.Rectangle | KeyType.Optional)] + public const string TrimBox = "/TrimBox"; + + /// + /// (Optional; PDF 1.3) A rectangle, expressed in default user space units, defining the + /// extent of the pages meaningful content (including potential white space) as intended + /// by the pages creator. Default value: the value of CropBox. + /// + [KeyInfo("1.3", KeyType.Rectangle | KeyType.Optional)] + public const string ArtBox = "/ArtBox"; + + /// + /// (Optional; PDF 1.4) A box color information dictionary specifying the colors and other + /// visual characteristics to be used in displaying guidelines on the screen for the various + /// page boundaries. If this entry is absent, the application should use its own current + /// default settings. + /// + [KeyInfo("1.4", KeyType.Dictionary | KeyType.Optional)] + public const string BoxColorInfo = "/BoxColorInfo"; + + /// + /// (Optional) A content stream describing the contents of this page. If this entry is absent, + /// the page is empty. The value may be either a single stream or an array of streams. If the + /// value is an array, the effect is as if all of the streams in the array were concatenated, + /// in order, to form a single stream. This allows PDF producers to create image objects and + /// other resources as they occur, even though they interrupt the content stream. The division + /// between streams may occur only at the boundaries between lexical tokens but is unrelated + /// to the pages logical content or organization. Applications that consume or produce PDF + /// files are not required to preserve the existing structure of the Contents array. + /// + [KeyInfo(KeyType.Array | KeyType.Stream | KeyType.Optional)] + public const string Contents = "/Contents"; + + /// + /// (Optional; PDF 1.4) A group attributes dictionary specifying the attributes of the pages + /// page group for use in the transparent imaging model. + /// + [KeyInfo("1.4", KeyType.Dictionary | KeyType.Optional)] + public const string Group = "/Group"; + + /// + /// (Optional) A stream object defining the pages thumbnail image. + /// + [KeyInfo(KeyType.Stream | KeyType.Optional)] + public const string Thumb = "/Thumb"; + + /// + /// (Optional; PDF 1.1; recommended if the page contains article beads) An array of indirect + /// references to article beads appearing on the page. The beads are listed in the array in + /// natural reading order. + /// + [KeyInfo("1.1", KeyType.Array | KeyType.Optional)] + public const string B = "/B"; + + /// + /// (Optional; PDF 1.1) The pages display duration (also called its advance timing): the + /// maximum length of time, in seconds, that the page is displayed during presentations before + /// the viewer application automatically advances to the next page. By default, the viewer does + /// not advance automatically. + /// + [KeyInfo("1.1", KeyType.Real | KeyType.Optional)] + public const string Dur = "/Dur"; + + /// + /// (Optional; PDF 1.1) A transition dictionary describing the transition effect to be used + /// when displaying the page during presentations. + /// + [KeyInfo("1.1", KeyType.Dictionary | KeyType.Optional)] + public const string Trans = "/Trans"; + + /// + /// (Optional) An array of annotation dictionaries representing annotations associated with + /// the page. + /// + [KeyInfo(KeyType.Array | KeyType.Optional, typeof(PdfAnnotations))] + public const string Annots = "/Annots"; + + /// + /// (Optional; PDF 1.2) An additional-actions dictionary defining actions to be performed + /// when the page is opened or closed. + /// + [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional)] + public const string AA = "/AA"; + + /// + /// (Optional; PDF 1.4) A metadata stream containing metadata for the page. + /// + [KeyInfo("1.4", KeyType.Stream | KeyType.Optional)] + public const string Metadata = "/Metadata"; + + /// + /// (Optional; PDF 1.3) A page-piece dictionary associated with the page. + /// + [KeyInfo("1.3", KeyType.Dictionary | KeyType.Optional)] + public const string PieceInfo = "/PieceInfo"; + + /// + /// (Required if the page contains structural content items; PDF 1.3) + /// The integer key of the pages entry in the structural parent tree. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string StructParents = "/StructParents"; + + /// + /// (Optional; PDF 1.3; indirect reference preferred) The digital identifier of + /// the pages parent Web Capture content set. + /// + [KeyInfo("1.3", KeyType.String | KeyType.Optional)] + public const string ID = "/ID"; + + /// + /// (Optional; PDF 1.3) The pages preferred zoom (magnification) factor: the factor + /// by which it should be scaled to achieve the natural display magnification. + /// + [KeyInfo("1.3", KeyType.Real | KeyType.Optional)] + public const string PZ = "/PZ"; + + /// + /// (Optional; PDF 1.3) A separation dictionary containing information needed + /// to generate color separations for the page. + /// + [KeyInfo("1.3", KeyType.Dictionary | KeyType.Optional)] + public const string SeparationInfo = "/SeparationInfo"; + + /// + /// (Optional; PDF 1.5) A name specifying the tab order to be used for annotations + /// on the page. The possible values are R (row order), C (column order), + /// and S (structure order). + /// + [KeyInfo("1.5", KeyType.Name | KeyType.Optional)] + public const string Tabs = "/Tabs"; + + /// + /// (Required if this page was created from a named page object; PDF 1.5) + /// The name of the originating page object. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string TemplateInstantiated = "/TemplateInstantiated"; + + /// + /// (Optional; PDF 1.5) A navigation node dictionary representing the first node + /// on the page. + /// + [KeyInfo("1.5", KeyType.Dictionary | KeyType.Optional)] + public const string PresSteps = "/PresSteps"; + + /// + /// (Optional; PDF 1.6) A positive number giving the size of default user space units, + /// in multiples of 1/72 inch. The range of supported values is implementation-dependent. + /// + [KeyInfo("1.6", KeyType.Real | KeyType.Optional)] + public const string UserUnit = "/UserUnit"; + + /// + /// (Optional; PDF 1.6) An array of viewport dictionaries specifying rectangular regions + /// of the page. + /// + [KeyInfo("1.6", KeyType.Dictionary | KeyType.Optional)] + public const string VP = "/VP"; + + /// + /// Gets the KeysMeta for these keys. + /// + internal static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + + /// + /// Predefined keys common to PdfPage and PdfPages. + /// + internal class InheritablePageKeys : KeysBase + { + /// + /// (Required; inheritable) A dictionary containing any resources required by the page. + /// If the page requires no resources, the value of this entry should be an empty dictionary. + /// Omitting the entry entirely indicates that the resources are to be inherited from an + /// ancestor node in the page tree. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required | KeyType.Inheritable, typeof(PdfResources))] + public const string Resources = "/Resources"; + + /// + /// (Required; inheritable) A rectangle, expressed in default user space units, defining the + /// boundaries of the physical medium on which the page is intended to be displayed or printed. + /// + [KeyInfo(KeyType.Rectangle | KeyType.Required | KeyType.Inheritable)] + public const string MediaBox = "/MediaBox"; + + /// + /// (Optional; inheritable) A rectangle, expressed in default user space units, defining the + /// visible region of default user space. When the page is displayed or printed, its contents + /// are to be clipped (cropped) to this rectangle and then imposed on the output medium in some + /// implementation defined manner. Default value: the value of MediaBox. + /// + [KeyInfo(KeyType.Rectangle | KeyType.Optional | KeyType.Inheritable)] + public const string CropBox = "/CropBox"; + + /// + /// (Optional; inheritable) The number of degrees by which the page should be rotated clockwise + /// when displayed or printed. The value must be a multiple of 90. Default value: 0. + /// + [KeyInfo(KeyType.Integer | KeyType.Optional)] + public const string Rotate = "/Rotate"; + } + + /// + /// Values inherited from a parent in the parent chain of a page tree. + /// + internal struct InheritedValues + { + public PdfDictionary Resources; + public PdfRectangle MediaBox; + public PdfRectangle CropBox; + public PdfInteger Rotate; + } + } +} diff --git a/PdfSharp/Pdf/PdfPages.cs b/PdfSharp/Pdf/PdfPages.cs new file mode 100644 index 0000000..920fa45 --- /dev/null +++ b/PdfSharp/Pdf/PdfPages.cs @@ -0,0 +1,749 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Collections; +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.Annotations; + +namespace PdfSharp.Pdf +{ + /// + /// Represents the pages of the document. + /// + [DebuggerDisplay("(PageCount={Count})")] + public sealed class PdfPages : PdfDictionary, IEnumerable + { + internal PdfPages(PdfDocument document) + : base(document) + { + Elements.SetName(Keys.Type, "/Pages"); + Elements[Keys.Count] = new PdfInteger(0); + } + + internal PdfPages(PdfDictionary dictionary) + : base(dictionary) + { } + + /// + /// Gets the number of pages. + /// + public int Count + { + get { return PagesArray.Elements.Count; } + } + + /// + /// Gets the page with the specified index. + /// + public PdfPage this[int index] + { + get + { + if (index < 0 || index >= Count) + throw new ArgumentOutOfRangeException("index", index, PSSR.PageIndexOutOfRange); + + PdfDictionary dict = (PdfDictionary)((PdfReference)PagesArray.Elements[index]).Value; + if (!(dict is PdfPage)) + dict = new PdfPage(dict); + return (PdfPage)dict; + } + } + + /// + /// Finds a page by its id. Transforms it to PdfPage if necessary. + /// + internal PdfPage FindPage(PdfObjectID id) // TODO: public? + { + PdfPage page = null; + foreach (PdfItem item in PagesArray) + { + PdfReference reference = item as PdfReference; + if (reference != null) + { + PdfDictionary dictionary = reference.Value as PdfDictionary; + if (dictionary != null && dictionary.ObjectID == id) + { + page = dictionary as PdfPage ?? new PdfPage(dictionary); + break; + } + } + } + return page; + } + + /// + /// Creates a new PdfPage, adds it to the end of this document, and returns it. + /// + public PdfPage Add() + { + PdfPage page = new PdfPage(); + Insert(Count, page); + return page; + } + + /// + /// Adds the specified PdfPage to the end of this document and maybe returns a new PdfPage object. + /// The value returned is a new object if the added page comes from a foreign document. + /// + public PdfPage Add(PdfPage page) + { + return Insert(Count, page); + } + + /// + /// Creates a new PdfPage, inserts it at the specified position into this document, and returns it. + /// + public PdfPage Insert(int index) + { + PdfPage page = new PdfPage(); + Insert(index, page); + return page; + } + + /// + /// Inserts the specified PdfPage at the specified position to this document and maybe returns a new PdfPage object. + /// The value returned is a new object if the inserted page comes from a foreign document. + /// + public PdfPage Insert(int index, PdfPage page) + { + if (page == null) + throw new ArgumentNullException("page"); + + // Is the page already owned by this document? + if (page.Owner == Owner) + { + // Case: Page is first removed and than inserted again, maybe at another position. + int count = Count; + // Check if page is not already part of the document. + for (int idx = 0; idx < count; idx++) + { + if (ReferenceEquals(this[idx], page)) + throw new InvalidOperationException(PSSR.MultiplePageInsert); + } + + // TODO: check this case + // Because the owner of the inserted page is this document we assume that the page was former part of it + // and it is therefore well-defined. + Owner._irefTable.Add(page); + Debug.Assert(page.Owner == Owner); + + // Insert page in array. + PagesArray.Elements.Insert(index, page.Reference); + + // Update page count. + Elements.SetInteger(Keys.Count, PagesArray.Elements.Count); + + return page; + } + + // All new page insertions come here. + if (page.Owner == null) + { + // Case: New page was newly created and inserted now. + page.Document = Owner; + + Owner._irefTable.Add(page); + Debug.Assert(page.Owner == Owner); + PagesArray.Elements.Insert(index, page.Reference); + Elements.SetInteger(Keys.Count, PagesArray.Elements.Count); + } + else + { + // Case: Page is from an external document -> import it. + PdfPage importPage = page; + page = ImportExternalPage(importPage); + Owner._irefTable.Add(page); + + // Add page substitute to importedObjectTable. + PdfImportedObjectTable importedObjectTable = Owner.FormTable.GetImportedObjectTable(importPage); + importedObjectTable.Add(importPage.ObjectID, page.Reference); + + PagesArray.Elements.Insert(index, page.Reference); + Elements.SetInteger(Keys.Count, PagesArray.Elements.Count); + PdfAnnotations.FixImportedAnnotation(page); + } + if (Owner.Settings.TrimMargins.AreSet) + page.TrimMargins = Owner.Settings.TrimMargins; + + return page; + } + + /// + /// Inserts pages of the specified document into this document. + /// + /// The index in this document where to insert the page . + /// The document to be inserted. + /// The index of the first page to be inserted. + /// The number of pages to be inserted. + public void InsertRange(int index, PdfDocument document, int startIndex, int pageCount) + { + if (document == null) + throw new ArgumentNullException("document"); + + if (index < 0 || index > Count) + throw new ArgumentOutOfRangeException("index", "Argument 'index' out of range."); + + int importDocumentPageCount = document.PageCount; + + if (startIndex < 0 || startIndex + pageCount > importDocumentPageCount) + throw new ArgumentOutOfRangeException("startIndex", "Argument 'startIndex' out of range."); + + if (pageCount > importDocumentPageCount) + throw new ArgumentOutOfRangeException("pageCount", "Argument 'pageCount' out of range."); + + PdfPage[] insertPages = new PdfPage[pageCount]; + PdfPage[] importPages = new PdfPage[pageCount]; + + // 1st create all new pages. + for (int idx = 0, insertIndex = index, importIndex = startIndex; + importIndex < startIndex + pageCount; + idx++, insertIndex++, importIndex++) + { + PdfPage importPage = document.Pages[importIndex]; + PdfPage page = ImportExternalPage(importPage); + insertPages[idx] = page; + importPages[idx] = importPage; + + Owner._irefTable.Add(page); + + // Add page substitute to importedObjectTable. + PdfImportedObjectTable importedObjectTable = Owner.FormTable.GetImportedObjectTable(importPage); + importedObjectTable.Add(importPage.ObjectID, page.Reference); + + PagesArray.Elements.Insert(insertIndex, page.Reference); + + if (Owner.Settings.TrimMargins.AreSet) + page.TrimMargins = Owner.Settings.TrimMargins; + } + Elements.SetInteger(Keys.Count, PagesArray.Elements.Count); + + // 2nd copy link annotations that are in the range of the imported pages. + for (int idx = 0, importIndex = startIndex; + importIndex < startIndex + pageCount; + idx++, importIndex++) + { + PdfPage importPage = document.Pages[importIndex]; + PdfPage page = insertPages[idx]; + + // Get annotations. + PdfArray annots = importPage.Elements.GetArray(PdfPage.Keys.Annots); + if (annots != null) + { + PdfAnnotations annotations = new PdfAnnotations(Owner); + + // Loop through annotations. + int count = annots.Elements.Count; + for (int idxAnnotation = 0; idxAnnotation < count; idxAnnotation++) + { + PdfDictionary annot = annots.Elements.GetDictionary(idxAnnotation); + if (annot != null) + { + string subtype = annot.Elements.GetString(PdfAnnotation.Keys.Subtype); + if (subtype == "/Link") + { + bool addAnnotation = false; + PdfLinkAnnotation newAnnotation = new PdfLinkAnnotation(Owner); + + PdfName[] importAnnotationKeyNames = annot.Elements.KeyNames; + foreach (PdfName pdfItem in importAnnotationKeyNames) + { + PdfItem impItem; + switch (pdfItem.Value) + { + case "/BS": + newAnnotation.Elements.Add("/BS", new PdfLiteral("<>")); + break; + + case "/F": // /F 4 + impItem = annot.Elements.GetValue("/F"); + Debug.Assert(impItem is PdfInteger); + newAnnotation.Elements.Add("/F", impItem.Clone()); + break; + + case "/Rect": // /Rect [68.6 681.08 145.71 702.53] + impItem = annot.Elements.GetValue("/Rect"); + Debug.Assert(impItem is PdfArray); + newAnnotation.Elements.Add("/Rect", impItem.Clone()); + break; + + case "/StructParent": // /StructParent 3 + impItem = annot.Elements.GetValue("/StructParent"); + Debug.Assert(impItem is PdfInteger); + newAnnotation.Elements.Add("/StructParent", impItem.Clone()); + break; + + case "/Subtype": // Already set. + break; + + case "/Dest": // /Dest [30 0 R /XYZ 68 771 0] + impItem = annot.Elements.GetValue("/Dest"); + impItem = impItem.Clone(); + + // Is value an array with 5 elements where the first one is an iref? + PdfArray destArray = impItem as PdfArray; + if (destArray != null && destArray.Elements.Count == 5) + { + PdfReference iref = destArray.Elements[0] as PdfReference; + if (iref != null) + { + iref = RemapReference(insertPages, importPages, iref); + if (iref != null) + { + destArray.Elements[0] = iref; + newAnnotation.Elements.Add("/Dest", destArray); + addAnnotation = true; + } + } + } + break; + + default: +#if DEBUG_ + Debug-Break.Break(true); +#endif + break; + + } + } + // Add newAnnotations only it points to an imported page. + if (addAnnotation) + annotations.Add(newAnnotation); + } + } + } + + // At least one link annotation found? + if (annotations.Count > 0) + { + //Owner._irefTable.Add(annotations); + page.Elements.Add(PdfPage.Keys.Annots, annotations); + } + } + + } + } + + /// + /// Inserts all pages of the specified document into this document. + /// + /// The index in this document where to insert the page . + /// The document to be inserted. + public void InsertRange(int index, PdfDocument document) + { + if (document == null) + throw new ArgumentNullException("document"); + + InsertRange(index, document, 0, document.PageCount); + } + + /// + /// Inserts all pages of the specified document into this document. + /// + /// The index in this document where to insert the page . + /// The document to be inserted. + /// The index of the first page to be inserted. + public void InsertRange(int index, PdfDocument document, int startIndex) + { + if (document == null) + throw new ArgumentNullException("document"); + + InsertRange(index, document, startIndex, document.PageCount - startIndex); + } + + /// + /// Removes the specified page from the document. + /// + public void Remove(PdfPage page) + { + PagesArray.Elements.Remove(page.Reference); + Elements.SetInteger(Keys.Count, PagesArray.Elements.Count); + } + + /// + /// Removes the specified page from the document. + /// + public void RemoveAt(int index) + { + PagesArray.Elements.RemoveAt(index); + Elements.SetInteger(Keys.Count, PagesArray.Elements.Count); + } + + /// + /// Moves a page within the page sequence. + /// + /// The page index before this operation. + /// The page index after this operation. + public void MovePage(int oldIndex, int newIndex) + { + if (oldIndex < 0 || oldIndex >= Count) + throw new ArgumentOutOfRangeException("oldIndex"); + if (newIndex < 0 || newIndex >= Count) + throw new ArgumentOutOfRangeException("newIndex"); + if (oldIndex == newIndex) + return; + + //PdfPage page = (PdfPage)pagesArray.Elements[oldIndex]; + PdfReference page = (PdfReference)_pagesArray.Elements[oldIndex]; + _pagesArray.Elements.RemoveAt(oldIndex); + _pagesArray.Elements.Insert(newIndex, page); + } + + /// + /// Imports an external page. The elements of the imported page are cloned and added to this document. + /// Important: In contrast to PdfFormXObject adding an external page always make a deep copy + /// of their transitive closure. Any reuse of already imported objects is not intended because + /// any modification of an imported page must not change another page. + /// + PdfPage ImportExternalPage(PdfPage importPage) + { + if (importPage.Owner._openMode != PdfDocumentOpenMode.Import) + throw new InvalidOperationException("A PDF document must be opened with PdfDocumentOpenMode.Import to import pages from it."); + + PdfPage page = new PdfPage(_document); + + // ReSharper disable AccessToStaticMemberViaDerivedType for a better code readability. + CloneElement(page, importPage, PdfPage.Keys.Resources, false); + CloneElement(page, importPage, PdfPage.Keys.Contents, false); + CloneElement(page, importPage, PdfPage.Keys.MediaBox, true); + CloneElement(page, importPage, PdfPage.Keys.CropBox, true); + CloneElement(page, importPage, PdfPage.Keys.Rotate, true); + CloneElement(page, importPage, PdfPage.Keys.BleedBox, true); + CloneElement(page, importPage, PdfPage.Keys.TrimBox, true); + CloneElement(page, importPage, PdfPage.Keys.ArtBox, true); +#if true + // Do not deep copy annotations. + CloneElement(page, importPage, PdfPage.Keys.Annots, false); +#else + // Deep copy annotations. + CloneElement(page, importPage, PdfPage.Keys.Annots, true); +#endif + // ReSharper restore AccessToStaticMemberViaDerivedType + // TODO more elements? + return page; + } + + /// + /// Helper function for ImportExternalPage. + /// + void CloneElement(PdfPage page, PdfPage importPage, string key, bool deepcopy) + { + Debug.Assert(page != null); + Debug.Assert(page.Owner == _document); + Debug.Assert(importPage.Owner != null); + Debug.Assert(importPage.Owner != _document); + + PdfItem item = importPage.Elements[key]; + if (item != null) + { + PdfImportedObjectTable importedObjectTable = null; + if (!deepcopy) + importedObjectTable = Owner.FormTable.GetImportedObjectTable(importPage); + + // The item can be indirect. If so, replace it by its value. + if (item is PdfReference) + item = ((PdfReference)item).Value; + if (item is PdfObject) + { + PdfObject root = (PdfObject)item; + if (deepcopy) + { + Debug.Assert(root.Owner != null, "See 'else' case for details"); + root = DeepCopyClosure(_document, root); + } + else + { + // The owner can be null if the item is not a reference. + if (root.Owner == null) + root.Document = importPage.Owner; + root = ImportClosure(importedObjectTable, page.Owner, root); + } + + if (root.Reference == null) + page.Elements[key] = root; + else + page.Elements[key] = root.Reference; + } + else + { + // Simple items are just cloned. + page.Elements[key] = item.Clone(); + } + } + } + + static PdfReference RemapReference(PdfPage[] newPages, PdfPage[] impPages, PdfReference iref) + { + // Directs the iref to a one of the imported pages? + for (int idx = 0; idx < newPages.Length; idx++) + { + if (impPages[idx].Reference == iref) + return newPages[idx].Reference; + } + return null; + } + + /// + /// Gets a PdfArray containing all pages of this document. The array must not be modified. + /// + public PdfArray PagesArray + { + get + { + if (_pagesArray == null) + _pagesArray = (PdfArray)Elements.GetValue(Keys.Kids, VCF.Create); + return _pagesArray; + } + } + PdfArray _pagesArray; + + /// + /// Replaces the page tree by a flat array of indirect references to the pages objects. + /// + internal void FlattenPageTree() + { + // Acrobat creates a balanced tree if the number of pages is roughly more than ten. This is + // not difficult but obviously also not necessary. I created a document with 50000 pages with + // PDF4NET and Acrobat opened it in less than 2 seconds. + + //PdfReference xrefRoot = Document.Catalog.Elements[PdfCatalog.Keys.Pages] as PdfReference; + //PdfDictionary[] pages = GetKids(xrefRoot, null); + + // Promote inheritable values down the page tree + PdfPage.InheritedValues values = new PdfPage.InheritedValues(); + PdfPage.InheritValues(this, ref values); + PdfDictionary[] pages = GetKids(Reference, values, null); + + // Replace /Pages in catalog by this object + // xrefRoot.Value = this; + + PdfArray array = new PdfArray(Owner); + foreach (PdfDictionary page in pages) + { + // Fix the parent + page.Elements[PdfPage.Keys.Parent] = Reference; + array.Elements.Add(page.Reference); + } + + Elements.SetName(Keys.Type, "/Pages"); +#if true + // Direct array. + Elements.SetValue(Keys.Kids, array); +#else + // Indirect array. + Document.xrefTable.Add(array); + Elements.SetValue(Keys.Kids, array.XRef); +#endif + Elements.SetInteger(Keys.Count, array.Elements.Count); + } + + /// + /// Recursively converts the page tree into a flat array. + /// + PdfDictionary[] GetKids(PdfReference iref, PdfPage.InheritedValues values, PdfDictionary parent) + { + // TODO: inherit inheritable keys... + PdfDictionary kid = (PdfDictionary)iref.Value; + +#if true + string type = kid.Elements.GetName(Keys.Type); + if (type == "/Page") + { + PdfPage.InheritValues(kid, values); + return new PdfDictionary[] { kid }; + } + + if (string.IsNullOrEmpty(type)) + { + // Type is required. If type is missing, assume it is "/Page" and hope it will work. + // TODO Implement a "Strict" mode in PDFsharp and don't do this in "Strict" mode. + PdfPage.InheritValues(kid, values); + return new PdfDictionary[] { kid }; + } + +#else + if (kid.Elements.GetName(Keys.Type) == "/Page") + { + PdfPage.InheritValues(kid, values); + return new PdfDictionary[] { kid }; + } +#endif + + Debug.Assert(kid.Elements.GetName(Keys.Type) == "/Pages"); + PdfPage.InheritValues(kid, ref values); + List list = new List(); + PdfArray kids = kid.Elements["/Kids"] as PdfArray; + + if (kids == null) + { + PdfReference xref3 = kid.Elements["/Kids"] as PdfReference; + if (xref3 != null) + kids = xref3.Value as PdfArray; + } + + foreach (PdfReference xref2 in kids) + list.AddRange(GetKids(xref2, values, kid)); + int count = list.Count; + Debug.Assert(count == kid.Elements.GetInteger("/Count")); + return list.ToArray(); + } + + /// + /// Prepares the document for saving. + /// + internal override void PrepareForSave() + { + // TODO: Close all open content streams + + // TODO: Create the page tree. + // Arrays have a limit of 8192 entries, but I successfully tested documents + // with 50000 pages and no page tree. + // ==> wait for bug report. + int count = _pagesArray.Elements.Count; + for (int idx = 0; idx < count; idx++) + { + PdfPage page = this[idx]; + page.PrepareForSave(); + } + } + + /// + /// Gets the enumerator. + /// + public new IEnumerator GetEnumerator() + { + return new PdfPagesEnumerator(this); + } + + class PdfPagesEnumerator : IEnumerator + { + internal PdfPagesEnumerator(PdfPages list) + { + _list = list; + _index = -1; + } + + public bool MoveNext() + { + if (_index < _list.Count - 1) + { + _index++; + _currentElement = _list[_index]; + return true; + } + _index = _list.Count; + return false; + } + + public void Reset() + { + _currentElement = null; + _index = -1; + } + + object IEnumerator.Current + { + get { return Current; } + } + + public PdfPage Current + { + get + { + if (_index == -1 || _index >= _list.Count) + throw new InvalidOperationException(PSSR.ListEnumCurrentOutOfRange); + return _currentElement; + } + } + + public void Dispose() + { + // Nothing to do. + } + + PdfPage _currentElement; + int _index; + readonly PdfPages _list; + } + + /// + /// Predefined keys of this dictionary. + /// + internal sealed class Keys : PdfPage.InheritablePageKeys + { + /// + /// (Required) The type of PDF object that this dictionary describes; + /// must be Pages for a page tree node. + /// + [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Pages")] + public const string Type = "/Type"; + + /// + /// (Required except in root node; must be an indirect reference) + /// The page tree node that is the immediate parent of this one. + /// + [KeyInfo(KeyType.Dictionary | KeyType.Required)] + public const string Parent = "/Parent"; + + /// + /// (Required) An array of indirect references to the immediate children of this node. + /// The children may be page objects or other page tree nodes. + /// + [KeyInfo(KeyType.Array | KeyType.Required)] + public const string Kids = "/Kids"; + + /// + /// (Required) The number of leaf nodes (page objects) that are descendants of this node + /// within the page tree. + /// + [KeyInfo(KeyType.Integer | KeyType.Required)] + public const string Count = "/Count"; + + /// + /// Gets the KeysMeta for these keys. + /// + public static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} diff --git a/PdfSharp/Pdf/PdfReal.cs b/PdfSharp/Pdf/PdfReal.cs new file mode 100644 index 0000000..4a936f3 --- /dev/null +++ b/PdfSharp/Pdf/PdfReal.cs @@ -0,0 +1,83 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using System.Globalization; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents a direct real value. + /// + [DebuggerDisplay("({Value})")] + public sealed class PdfReal : PdfNumber + { + /// + /// Initializes a new instance of the class. + /// + public PdfReal() + { } + + /// + /// Initializes a new instance of the class. + /// + /// The value. + public PdfReal(double value) + { + _value = value; + } + + /// + /// Gets the value as double. + /// + public double Value + { + // This class must behave like a value type. Therefore it cannot be changed (like System.String). + get { return _value; } + } + readonly double _value; + + /// + /// Returns the real number as string. + /// + public override string ToString() + { + return _value.ToString(Config.SignificantFigures3, CultureInfo.InvariantCulture); + } + + /// + /// Writes the real value with up to three digits. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.Write(this); + } + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/PdfRealObject.cs b/PdfSharp/Pdf/PdfRealObject.cs new file mode 100644 index 0000000..0e828da --- /dev/null +++ b/PdfSharp/Pdf/PdfRealObject.cs @@ -0,0 +1,95 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Globalization; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents an indirect real value. This type is not used by PDFsharp. If it is imported from + /// an external PDF file, the value is converted into a direct object. + /// + public sealed class PdfRealObject : PdfNumberObject + { + /// + /// Initializes a new instance of the class. + /// + public PdfRealObject() + { } + + /// + /// Initializes a new instance of the class. + /// + /// The value. + public PdfRealObject(double value) + { + _value = value; + } + + /// + /// Initializes a new instance of the class. + /// + /// The document. + /// The value. + public PdfRealObject(PdfDocument document, double value) + : base(document) + { + _value = value; + } + + /// + /// Gets or sets the value. + /// + public double Value + { + get { return _value; } + set { _value = value; } + } + double _value; + + /// + /// Returns the real as a culture invariant string. + /// + public override string ToString() + { + return _value.ToString(CultureInfo.InvariantCulture); + } + + /// + /// Writes the real literal. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.WriteBeginObject(this); + writer.Write(_value); + writer.WriteEndObject(); + } + } +} diff --git a/PdfSharp/Pdf/PdfRectangle.cs b/PdfSharp/Pdf/PdfRectangle.cs new file mode 100644 index 0000000..f44a480 --- /dev/null +++ b/PdfSharp/Pdf/PdfRectangle.cs @@ -0,0 +1,499 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows.Media; +#endif +using PdfSharp.Drawing; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf +{ + /// + /// Represents a PDF rectangle value, that is internally an array with 4 real values. + /// + [DebuggerDisplay("{DebuggerDisplay}")] + public sealed class PdfRectangle : PdfItem + { + // This class must behave like a value type. Therefore it cannot be changed (like System.String). + + /// + /// Initializes a new instance of the PdfRectangle class. + /// + public PdfRectangle() + { } + + /// + /// Initializes a new instance of the PdfRectangle class with two points specifying + /// two diagonally opposite corners. Notice that in contrast to GDI+ convention the + /// 3rd and the 4th parameter specify a point and not a width. This is so much confusing + /// that this function is for internal use only. + /// + internal PdfRectangle(double x1, double y1, double x2, double y2) + { + _x1 = x1; + _y1 = y1; + _x2 = x2; + _y2 = y2; + } + +#if GDI + /// + /// Initializes a new instance of the PdfRectangle class with two points specifying + /// two diagonally opposite corners. + /// + public PdfRectangle(PointF pt1, PointF pt2) + { + _x1 = pt1.X; + _y1 = pt1.Y; + _x2 = pt2.X; + _y2 = pt2.Y; + } +#endif + + /// + /// Initializes a new instance of the PdfRectangle class with two points specifying + /// two diagonally opposite corners. + /// + public PdfRectangle(XPoint pt1, XPoint pt2) + { + _x1 = pt1.X; + _y1 = pt1.Y; + _x2 = pt2.X; + _y2 = pt2.Y; + } + +#if GDI + /// + /// Initializes a new instance of the PdfRectangle class with the specified location and size. + /// + public PdfRectangle(PointF pt, SizeF size) + { + _x1 = pt.X; + _y1 = pt.Y; + _x2 = pt.X + size.Width; + _y2 = pt.Y + size.Height; + } +#endif + + /// + /// Initializes a new instance of the PdfRectangle class with the specified location and size. + /// + public PdfRectangle(XPoint pt, XSize size) + { + _x1 = pt.X; + _y1 = pt.Y; + _x2 = pt.X + size.Width; + _y2 = pt.Y + size.Height; + } + + /// + /// Initializes a new instance of the PdfRectangle class with the specified XRect. + /// + public PdfRectangle(XRect rect) + { + _x1 = rect.X; + _y1 = rect.Y; + _x2 = rect.X + rect.Width; + _y2 = rect.Y + rect.Height; + } + + /// + /// Initializes a new instance of the PdfRectangle class with the specified PdfArray. + /// + internal PdfRectangle(PdfItem item) + { + if (item == null || item is PdfNull) + return; + + if (item is PdfReference) + item = ((PdfReference)item).Value; + + PdfArray array = item as PdfArray; + if (array == null) + throw new InvalidOperationException(PSSR.UnexpectedTokenInPdfFile); + + _x1 = array.Elements.GetReal(0); + _y1 = array.Elements.GetReal(1); + _x2 = array.Elements.GetReal(2); + _y2 = array.Elements.GetReal(3); + } + + /// + /// Clones this instance. + /// + public new PdfRectangle Clone() + { + return (PdfRectangle)Copy(); + } + + /// + /// Implements cloning this instance. + /// + protected override object Copy() + { + PdfRectangle rect = (PdfRectangle)base.Copy(); + return rect; + } + + /// + /// Tests whether all coordinate are zero. + /// + public bool IsEmpty + { + // ReSharper disable CompareOfFloatsByEqualityOperator + get { return _x1 == 0 && _y1 == 0 && _x2 == 0 && _y2 == 0; } + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Tests whether the specified object is a PdfRectangle and has equal coordinates. + /// + public override bool Equals(object obj) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + PdfRectangle rectangle = obj as PdfRectangle; + if (rectangle != null) + { + PdfRectangle rect = rectangle; + return rect._x1 == _x1 && rect._y1 == _y1 && rect._x2 == _x2 && rect._y2 == _y2; + } + return false; + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Serves as a hash function for a particular type. + /// + public override int GetHashCode() + { + // This code is from System.Drawing... + return (int)(((((uint)_x1) ^ ((((uint)_y1) << 13) | + (((uint)_y1) >> 0x13))) ^ ((((uint)_x2) << 0x1a) | + (((uint)_x2) >> 6))) ^ ((((uint)_y2) << 7) | + (((uint)_y2) >> 0x19))); + } + + /// + /// Tests whether two structures have equal coordinates. + /// + public static bool operator ==(PdfRectangle left, PdfRectangle right) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + // use: if (Object.ReferenceEquals(left, null)) + if ((object)left != null) + { + if ((object)right != null) + return left._x1 == right._x1 && left._y1 == right._y1 && left._x2 == right._x2 && left._y2 == right._y2; + return false; + } + return (object)right == null; + // ReSharper restore CompareOfFloatsByEqualityOperator + } + + /// + /// Tests whether two structures differ in one or more coordinates. + /// + public static bool operator !=(PdfRectangle left, PdfRectangle right) + { + return !(left == right); + } + + /// + /// Gets or sets the x-coordinate of the first corner of this PdfRectangle. + /// + public double X1 + { + get { return _x1; } + } + readonly double _x1; + + /// + /// Gets or sets the y-coordinate of the first corner of this PdfRectangle. + /// + public double Y1 + { + get { return _y1; } + } + readonly double _y1; + + /// + /// Gets or sets the x-coordinate of the second corner of this PdfRectangle. + /// + public double X2 + { + get { return _x2; } + } + readonly double _x2; + + /// + /// Gets or sets the y-coordinate of the second corner of this PdfRectangle. + /// + public double Y2 + { + get { return _y2; } + } + readonly double _y2; + + /// + /// Gets X2 - X1. + /// + public double Width + { + get { return _x2 - _x1; } + } + + /// + /// Gets Y2 - Y1. + /// + public double Height + { + get { return _y2 - _y1; } + } + + /// + /// Gets or sets the coordinates of the first point of this PdfRectangle. + /// + public XPoint Location + { + get { return new XPoint(_x1, _y1); } + } + + /// + /// Gets or sets the size of this PdfRectangle. + /// + public XSize Size + { + get { return new XSize(_x2 - _x1, _y2 - _y1); } + } + +#if GDI + /// + /// Determines if the specified point is contained within this PdfRectangle. + /// + public bool Contains(PointF pt) + { + return Contains(pt.X, pt.Y); + } +#endif + + /// + /// Determines if the specified point is contained within this PdfRectangle. + /// + public bool Contains(XPoint pt) + { + return Contains(pt.X, pt.Y); + } + + /// + /// Determines if the specified point is contained within this PdfRectangle. + /// + public bool Contains(double x, double y) + { + // Treat rectangle inclusive/inclusive. + return _x1 <= x && x <= _x2 && _y1 <= y && y <= _y2; + } + +#if GDI + /// + /// Determines if the rectangular region represented by rect is entirely contained within this PdfRectangle. + /// + public bool Contains(RectangleF rect) + { + return _x1 <= rect.X && (rect.X + rect.Width) <= _x2 && + _y1 <= rect.Y && (rect.Y + rect.Height) <= _y2; + } +#endif + + /// + /// Determines if the rectangular region represented by rect is entirely contained within this PdfRectangle. + /// + public bool Contains(XRect rect) + { + return _x1 <= rect.X && (rect.X + rect.Width) <= _x2 && + _y1 <= rect.Y && (rect.Y + rect.Height) <= _y2; + } + + /// + /// Determines if the rectangular region represented by rect is entirely contained within this PdfRectangle. + /// + public bool Contains(PdfRectangle rect) + { + return _x1 <= rect._x1 && rect._x2 <= _x2 && + _y1 <= rect._y1 && rect._y2 <= _y2; + } + + /// + /// Returns the rectangle as an XRect object. + /// + public XRect ToXRect() + { + return new XRect(_x1, _y1, Width, Height); + } + + /// + /// Returns the rectangle as a string in the form [x1 y1 x2 y2]. + /// + public override string ToString() + { + const string format = Config.SignificantFigures3; + return PdfEncoders.Format("[{0:" + format + "} {1:" + format + "} {2:" + format + "} {3:" + format + "}]", _x1, _y1, _x2, _y2); + } + + /// + /// Writes the rectangle. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.Write(this); + } + + /// + /// Gets the DebuggerDisplayAttribute text. + /// + // ReSharper disable UnusedMember.Local + string DebuggerDisplay + // ReSharper restore UnusedMember.Local + { + get + { + const string format = Config.SignificantFigures10; + return String.Format(CultureInfo.InvariantCulture, + "X1={0:" + format + "}, Y1={1:" + format + "}, X2={2:" + format + "}, Y2={3:" + format + "}", _x1, _y1, _x2, _y2); + } + } + +#if false // This object is considered as immutable. + // /// + // /// Adjusts the location of this PdfRectangle by the specified amount. + // /// + // public void Offset(PointF pos) + // { + // Offset(pos.X, pos.Y); + // } + // + // /// + // /// Adjusts the location of this PdfRectangle by the specified amount. + // /// + // public void Offset(double x, double y) + // { + // _x1 += x; + // _y1 += y; + // _x2 += x; + // _y2 += y; + // } + // + // /// + // /// Inflates this PdfRectangle by the specified amount. + // /// + // public void Inflate(double x, double y) + // { + // _x1 -= x; + // _y1 -= y; + // _x2 += x; + // _y2 += y; + // } + // + // /// + // /// Inflates this PdfRectangle by the specified amount. + // /// + // public void Inflate(SizeF size) + // { + // Inflate(size.Width, size.Height); + // } + // + // /// + // /// Creates and returns an inflated copy of the specified PdfRectangle. + // /// + // public static PdfRectangle Inflate(PdfRectangle rect, double x, double y) + // { + // rect.Inflate(x, y); + // return rect; + // } + // + // /// + // /// Replaces this PdfRectangle with the intersection of itself and the specified PdfRectangle. + // /// + // public void Intersect(PdfRectangle rect) + // { + // PdfRectangle rect2 = PdfRectangle.Intersect(rect, this); + // _x1 = rect2.x1; + // _y1 = rect2.y1; + // _x2 = rect2.x2; + // _y2 = rect2.y2; + // } + // + // /// + // /// Returns a PdfRectangle that represents the intersection of two rectangles. If there is no intersection, + // /// an empty PdfRectangle is returned. + // /// + // public static PdfRectangle Intersect(PdfRectangle rect1, PdfRectangle rect2) + // { + // double xx1 = Math.Max(rect1.x1, rect2.x1); + // double xx2 = Math.Min(rect1.x2, rect2.x2); + // double yy1 = Math.Max(rect1.y1, rect2.y1); + // double yy2 = Math.Min(rect1.y2, rect2.y2); + // if (xx2 >= xx1 && yy2 >= yy1) + // return new PdfRectangle(xx1, yy1, xx2, yy2); + // return PdfRectangle.Empty; + // } + // + // /// + // /// Determines if this rectangle intersects with the specified PdfRectangle. + // /// + // public bool IntersectsWith(PdfRectangle rect) + // { + // return rect.x1 < _x2 && _x1 < rect.x2 && rect.y1 < _y2 && _y1 < rect.y2; + // } + // + // /// + // /// Creates the smallest rectangle that can contain both of two specified rectangles. + // /// + // public static PdfRectangle Union(PdfRectangle rect1, PdfRectangle rect2) + // { + // return new PdfRectangle( + // Math.Min(rect1.x1, rect2.x1), Math.Max(rect1.x2, rect2.x2), + // Math.Min(rect1.y1, rect2.y1), Math.Max(rect1.y2, rect2.y2)); + // } +#endif + + /// + /// Represents an empty PdfRectangle. + /// + public static readonly PdfRectangle Empty = new PdfRectangle(); + } +} diff --git a/PdfSharp/Pdf/PdfReferenceTable.cs b/PdfSharp/Pdf/PdfReferenceTable.cs new file mode 100644 index 0000000..a39ebee --- /dev/null +++ b/PdfSharp/Pdf/PdfReferenceTable.cs @@ -0,0 +1,560 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Collections; +using System.Collections.Generic; +using PdfSharp.Pdf.Advanced; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + // NOT YET IN USE ANYMORE. REPLACEED PdfSharp.Pdf.Advanced.PdfCrossReferenceTable. + + /// + /// Represents the cross-reference table of a PDF document. + /// It contains all indirect objects of a document. + /// + internal sealed class PdfReferenceTable_old // Must not be derive from PdfObject. + { + public PdfReferenceTable_old(PdfDocument document) + { + _document = document; + } + readonly PdfDocument _document; + + /// + /// Represents the relation between PdfObjectID and PdfReference for a PdfDocument. + /// + public Dictionary ObjectTable = new Dictionary(); + + internal bool IsUnderConstruction + { + get { return _isUnderConstruction; } + set { _isUnderConstruction = value; } + } + bool _isUnderConstruction; + + /// + /// Adds a cross reference entry to the table. Used when parsing the trailer. + /// + public void Add(PdfReference iref) + { + if (iref.ObjectID.IsEmpty) + iref.ObjectID = new PdfObjectID(GetNewObjectNumber()); + + if (ObjectTable.ContainsKey(iref.ObjectID)) + throw new InvalidOperationException("Object already in table."); + + ObjectTable.Add(iref.ObjectID, iref); + } + + /// + /// Adds a PdfObject to the table. + /// + public void Add(PdfObject value) + { + if (value.Owner == null) + value.Document = _document; + else + Debug.Assert(value.Owner == _document); + + if (value.ObjectID.IsEmpty) + value.SetObjectID(GetNewObjectNumber(), 0); + + if (ObjectTable.ContainsKey(value.ObjectID)) + throw new InvalidOperationException("Object already in table."); + + ObjectTable.Add(value.ObjectID, value.Reference); + } + + public void Remove(PdfReference iref) + { + ObjectTable.Remove(iref.ObjectID); + } + + /// + /// Gets a cross reference entry from an object identifier. + /// Returns null if no object with the specified ID exists in the object table. + /// + public PdfReference this[PdfObjectID objectID] + { + get + { + PdfReference iref; + ObjectTable.TryGetValue(objectID, out iref); + return iref; + } + } + + /// + /// Indicates whether the specified object identifier is in the table. + /// + public bool Contains(PdfObjectID objectID) + { + return ObjectTable.ContainsKey(objectID); + } + + //public PdfObject GetObject(PdfObjectID objectID) + //{ + // return this[objectID].Value; + //} + + // /// + // /// Gets the entry for the specified object, or null, if the object is not in + // /// this XRef table. + // /// + // internal PdfReference GetEntry(PdfObjectID objectID) + // { + // return this[objectID]; + // } + + /// + /// Returns the next free object number. + /// + public int GetNewObjectNumber() + { + // New objects are numbered consecutively. If a document is imported, maxObjectNumber is + // set to the highest object number used in the document. + return ++_maxObjectNumber; + } + internal int _maxObjectNumber; + + /// + /// Writes the xref section in pdf stream. + /// + internal void WriteObject(PdfWriter writer) + { + writer.WriteRaw("xref\n"); + + PdfReference[] irefs = AllReferences; + + int count = irefs.Length; + writer.WriteRaw(String.Format("0 {0}\n", count + 1)); + writer.WriteRaw(String.Format("{0:0000000000} {1:00000} {2} \n", 0, 65535, "f")); + //PdfEncoders.WriteAnsi(stream, text); + + for (int idx = 0; idx < count; idx++) + { + PdfReference iref = irefs[idx]; + + // Acrobat is very pedantic; it must be exactly 20 bytes per line. + writer.WriteRaw(String.Format("{0:0000000000} {1:00000} {2} \n", iref.Position, iref.GenerationNumber, "n")); + } + } + + /// + /// Gets an array of all object identifier. For debugging purposes only. + /// + internal PdfObjectID[] AllObjectIDs + { + get + { + ICollection collection = ObjectTable.Keys; + PdfObjectID[] objectIDs = new PdfObjectID[collection.Count]; + collection.CopyTo(objectIDs, 0); + return objectIDs; + } + } + + /// + /// Gets an array of all cross references in ascending order by their object identifier. + /// + internal PdfReference[] AllReferences + { + get + { + Dictionary.ValueCollection collection = ObjectTable.Values; + List list = new List(collection); + list.Sort(PdfReference.Comparer); + PdfReference[] irefs = new PdfReference[collection.Count]; + list.CopyTo(irefs, 0); + return irefs; + } + } + + internal void HandleOrphanedReferences() + { } + + /// + /// Removes all objects that cannot be reached from the trailer. + /// Returns the number of removed objects. + /// + internal int Compact() + { + // TODO: remove PdfBooleanObject, PdfIntegerObject etc. + int removed = ObjectTable.Count; + //CheckConsistence(); + // TODO: Is this really so easy? + PdfReference[] irefs = TransitiveClosure(_document._trailer); + +#if DEBUG + // Have any two objects the same ID? + Dictionary ids = new Dictionary(); + foreach (PdfObjectID objID in ObjectTable.Keys) + { + ids.Add(objID.ObjectNumber, 0); + } + + // Have any two irefs the same value? + //Dictionary ids = new Dictionary(); + ids.Clear(); + foreach (PdfReference iref in ObjectTable.Values) + { + ids.Add(iref.ObjectNumber, 0); + } + + // + Dictionary refs = new Dictionary(); + foreach (PdfReference iref in irefs) + { + refs.Add(iref, 0); + } + foreach (PdfReference value in ObjectTable.Values) + { + if (!refs.ContainsKey(value)) + value.GetType(); + } + + foreach (PdfReference iref in ObjectTable.Values) + { + if (iref.Value == null) + GetType(); + Debug.Assert(iref.Value != null); + } + + foreach (PdfReference iref in irefs) + { + if (!ObjectTable.ContainsKey(iref.ObjectID)) + GetType(); + Debug.Assert(ObjectTable.ContainsKey(iref.ObjectID)); + + if (iref.Value == null) + GetType(); + Debug.Assert(iref.Value != null); + } +#endif + + _maxObjectNumber = 0; + ObjectTable.Clear(); + foreach (PdfReference iref in irefs) + { + // This if is needed for corrupt PDF files from the wild. + // Without the if, an exception will be thrown if the file contains duplicate IDs ("An item with the same key has already been added to the dictionary."). + // With the if, the first object with the ID will be used and later objects with the same ID will be ignored. + if (!ObjectTable.ContainsKey(iref.ObjectID)) + { + ObjectTable.Add(iref.ObjectID, iref); + _maxObjectNumber = Math.Max(_maxObjectNumber, iref.ObjectNumber); + } + } + //CheckConsistence(); + removed -= ObjectTable.Count; + return removed; + } + + /// + /// Renumbers the objects starting at 1. + /// + internal void Renumber() + { + //CheckConsistence(); + PdfReference[] irefs = AllReferences; + ObjectTable.Clear(); + // Give all objects a new number. + int count = irefs.Length; + for (int idx = 0; idx < count; idx++) + { + PdfReference iref = irefs[idx]; +#if DEBUG_ + if (iref.ObjectNumber == 1108) + GetType(); +#endif + iref.ObjectID = new PdfObjectID(idx + 1); + // Rehash with new number. + ObjectTable.Add(iref.ObjectID, iref); + } + _maxObjectNumber = count; + //CheckConsistence(); + } + + /// + /// Checks the logical consistence for debugging purposes (useful after reconstruction work). + /// + [Conditional("DEBUG_")] + public void CheckConsistence() + { + Dictionary ht1 = new Dictionary(); + foreach (PdfReference iref in ObjectTable.Values) + { + Debug.Assert(!ht1.ContainsKey(iref), "Duplicate iref."); + Debug.Assert(iref.Value != null); + ht1.Add(iref, null); + } + + Dictionary ht2 = new Dictionary(); + foreach (PdfReference iref in ObjectTable.Values) + { + Debug.Assert(!ht2.ContainsKey(iref.ObjectID), "Duplicate iref."); + ht2.Add(iref.ObjectID, null); + } + + ICollection collection = ObjectTable.Values; + int count = collection.Count; + PdfReference[] irefs = new PdfReference[count]; + collection.CopyTo(irefs, 0); +#if true + for (int i = 0; i < count; i++) + for (int j = 0; j < count; j++) + if (i != j) + { + Debug.Assert(ReferenceEquals(irefs[i].Document, _document)); + Debug.Assert(irefs[i] != irefs[j]); + Debug.Assert(!ReferenceEquals(irefs[i], irefs[j])); + Debug.Assert(!ReferenceEquals(irefs[i].Value, irefs[j].Value)); + Debug.Assert(!Equals(irefs[i].ObjectID, irefs[j].Value.ObjectID)); + Debug.Assert(irefs[i].ObjectNumber != irefs[j].Value.ObjectNumber); + Debug.Assert(ReferenceEquals(irefs[i].Document, irefs[j].Document)); + GetType(); + } +#endif + } + + ///// + ///// The garbage collector for PDF objects. + ///// + //public sealed class GC + //{ + // PdfXRefTable xrefTable; + // + // internal GC(PdfXRefTable xrefTable) + // { + // _xrefTable = xrefTable; + // } + // + // public void Collect() + // { } + // + // public PdfReference[] ReachableObjects() + // { + // Hash_table objects = new Hash_table(); + // TransitiveClosure(objects, _xrefTable.document.trailer); + // } + + /// + /// Calculates the transitive closure of the specified PdfObject, i.e. all indirect objects + /// recursively reachable from the specified object. + /// + public PdfReference[] TransitiveClosure(PdfObject pdfObject) + { + return TransitiveClosure(pdfObject, Int16.MaxValue); + } + + /// + /// Calculates the transitive closure of the specified PdfObject with the specified depth, i.e. all indirect objects + /// recursively reachable from the specified object in up to maximally depth steps. + /// + public PdfReference[] TransitiveClosure(PdfObject pdfObject, int depth) + { + CheckConsistence(); + Dictionary objects = new Dictionary(); + _overflow = new Dictionary(); + TransitiveClosureImplementation(objects, pdfObject /*, ref depth*/); + TryAgain: + if (_overflow.Count > 0) + { + PdfObject[] array = new PdfObject[_overflow.Count]; + _overflow.Keys.CopyTo(array, 0); + _overflow = new Dictionary(); + for (int idx = 0; idx < array.Length; idx++) + { + PdfObject obj = array[idx]; + TransitiveClosureImplementation(objects, obj /*, ref depth*/); + } + goto TryAgain; + } + + CheckConsistence(); + + ICollection collection = objects.Keys; + int count = collection.Count; + PdfReference[] irefs = new PdfReference[count]; + collection.CopyTo(irefs, 0); + +#if true_ + for (int i = 0; i < count; i++) + for (int j = 0; j < count; j++) + if (i != j) + { + Debug.Assert(ReferenceEquals(irefs[i].Document, _document)); + Debug.Assert(irefs[i] != irefs[j]); + Debug.Assert(!ReferenceEquals(irefs[i], irefs[j])); + Debug.Assert(!ReferenceEquals(irefs[i].Value, irefs[j].Value)); + Debug.Assert(!Equals(irefs[i].ObjectID, irefs[j].Value.ObjectID)); + Debug.Assert(irefs[i].ObjectNumber != irefs[j].Value.ObjectNumber); + Debug.Assert(ReferenceEquals(irefs[i].Document, irefs[j].Document)); + GetType(); + } +#endif + return irefs; + } + + static int _nestingLevel; + Dictionary _overflow = new Dictionary(); + + void TransitiveClosureImplementation(Dictionary objects, PdfObject pdfObject/*, ref int depth*/) + { + try + { + _nestingLevel++; + if (_nestingLevel >= 1000) + { + if (!_overflow.ContainsKey(pdfObject)) + _overflow.Add(pdfObject, null); + return; + } +#if DEBUG_ + //enterCount++; + if (enterCount == 5400) + GetType(); + //if (!Object.ReferenceEquals(pdfObject.Owner, _document)) + // GetType(); + //////Debug.Assert(Object.ReferenceEquals(pdfObject27.Document, _document)); + // if (item is PdfObject && ((PdfObject)item).ObjectID.ObjectNumber == 5) + // Debug.WriteLine("items: " + ((PdfObject)item).ObjectID.ToString()); + //if (pdfObject.ObjectNumber == 5) + // GetType(); +#endif + + IEnumerable enumerable = null; //(IEnumerator)pdfObject; + PdfDictionary dict; + PdfArray array; + if ((dict = pdfObject as PdfDictionary) != null) + enumerable = dict.Elements.Values; + else if ((array = pdfObject as PdfArray) != null) + enumerable = array.Elements; + else + Debug.Assert(false, "Should not come here."); + + if (enumerable != null) + { + foreach (PdfItem item in enumerable) + { + PdfReference iref = item as PdfReference; + if (iref != null) + { + // Is this an indirect reference to an object that does not exist? + //if (iref.Document == null) + //{ + // Debug.WriteLine("Dead object detected: " + iref.ObjectID.ToString()); + // PdfReference dead = DeadObject; + // iref.ObjectID = dead.ObjectID; + // iref.Document = _document; + // iref.SetObject(dead.Value); + // PdfDictionary dict = (PdfDictionary)dead.Value; + + // dict.Elements["/DeadObjectCount"] = + // new PdfInteger(dict.Elements.GetInteger("/DeadObjectCount") + 1); + + // iref = dead; + //} + + if (!ReferenceEquals(iref.Document, _document)) + { + GetType(); + Debug.WriteLine(String.Format("Bad iref: {0}", iref.ObjectID.ToString())); + } + Debug.Assert(ReferenceEquals(iref.Document, _document) || iref.Document == null, "External object detected!"); +#if DEBUG_ + if (iref.ObjectID.ObjectNumber == 23) + GetType(); +#endif + if (!objects.ContainsKey(iref)) + { + PdfObject value = iref.Value; + + // Ignore unreachable objects. + if (iref.Document != null) + { + // ... from trailer hack + if (value == null) + { + iref = ObjectTable[iref.ObjectID]; + Debug.Assert(iref.Value != null); + value = iref.Value; + } + Debug.Assert(ReferenceEquals(iref.Document, _document)); + objects.Add(iref, null); + //Debug.WriteLine(String.Format("objects.Add('{0}', null);", iref.ObjectID.ToString())); + if (value is PdfArray || value is PdfDictionary) + TransitiveClosureImplementation(objects, value /*, ref depth*/); + } + //else + //{ + // objects2.Add(this[iref.ObjectID], null); + //} + } + } + else + { + PdfObject pdfObject28 = item as PdfObject; + //if (pdfObject28 != null) + // Debug.Assert(Object.ReferenceEquals(pdfObject28.Document, _document)); + if (pdfObject28 != null && (pdfObject28 is PdfDictionary || pdfObject28 is PdfArray)) + TransitiveClosureImplementation(objects, pdfObject28 /*, ref depth*/); + } + } + } + } + finally + { + _nestingLevel--; + } + } + + /// + /// Gets the cross reference to an objects used for undefined indirect references. + /// + public PdfReference DeadObject + { + get + { + if (_deadObject == null) + { + _deadObject = new PdfDictionary(_document); + Add(_deadObject); + _deadObject.Elements.Add("/DeadObjectCount", new PdfInteger()); + } + return _deadObject.Reference; + } + } + PdfDictionary _deadObject; + } +} diff --git a/PdfSharp/Pdf/PdfString.cs b/PdfSharp/Pdf/PdfString.cs new file mode 100644 index 0000000..96fa3b1 --- /dev/null +++ b/PdfSharp/Pdf/PdfString.cs @@ -0,0 +1,327 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Text; +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf +{ + /// + /// Determines the encoding of a PdfString or PdfStringObject. + /// + [Flags] + public enum PdfStringEncoding + { + /// + /// The characters of the string are actually bytes with an unknown or context specific meaning or encoding. + /// With this encoding the 8 high bits of each character is zero. + /// + RawEncoding = PdfStringFlags.RawEncoding, + + /// + /// Not yet used by PDFsharp. + /// + StandardEncoding = PdfStringFlags.StandardEncoding, + + /// + /// The characters of the string are actually bytes with PDF document encoding. + /// With this encoding the 8 high bits of each character is zero. + /// + // ReSharper disable InconsistentNaming because the name is spelled as in the Adobe reference. + PDFDocEncoding = PdfStringFlags.PDFDocEncoding, + // ReSharper restore InconsistentNaming + + /// + /// The characters of the string are actually bytes with Windows ANSI encoding. + /// With this encoding the 8 high bits of each character is zero. + /// + WinAnsiEncoding = PdfStringFlags.WinAnsiEncoding, + + /// + /// Not yet used by PDFsharp. + /// + MacRomanEncoding = PdfStringFlags.MacExpertEncoding, + + /// + /// Not yet used by PDFsharp. + /// + MacExpertEncoding = PdfStringFlags.MacExpertEncoding, + + /// + /// The characters of the string are Unicode characters. + /// + Unicode = PdfStringFlags.Unicode, + } + + /// + /// Internal wrapper for PdfStringEncoding. + /// + [Flags] + enum PdfStringFlags + { + // ReSharper disable InconsistentNaming + RawEncoding = 0x00, + StandardEncoding = 0x01, // not used by PDFsharp + PDFDocEncoding = 0x02, + WinAnsiEncoding = 0x03, + MacRomanEncoding = 0x04, // not used by PDFsharp + MacExpertEncoding = 0x05, // not used by PDFsharp + Unicode = 0x06, + EncodingMask = 0x0F, + + HexLiteral = 0x80, + // ReSharper restore InconsistentNaming + } + + /// + /// Represents a direct text string value. + /// + [DebuggerDisplay("({Value})")] + public sealed class PdfString : PdfItem + { + /// + /// Initializes a new instance of the class. + /// + public PdfString() + { + // Redundant assignment. + //_flags = PdfStringFlags.RawEncoding; + } + + /// + /// Initializes a new instance of the class. + /// + /// The value. + public PdfString(string value) + { +#if true + if (!IsRawEncoding(value)) + _flags = PdfStringFlags.Unicode; + _value = value; +#else + CheckRawEncoding(value); + _value = value; + //_flags = PdfStringFlags.RawEncoding; +#endif + } + + /// + /// Initializes a new instance of the class. + /// + /// The value. + /// The encoding. + public PdfString(string value, PdfStringEncoding encoding) + { + switch (encoding) + { + case PdfStringEncoding.RawEncoding: + CheckRawEncoding(value); + break; + + case PdfStringEncoding.StandardEncoding: + break; + + case PdfStringEncoding.PDFDocEncoding: + break; + + case PdfStringEncoding.WinAnsiEncoding: + CheckRawEncoding(value); + break; + + case PdfStringEncoding.MacRomanEncoding: + break; + + case PdfStringEncoding.Unicode: + break; + + default: + throw new ArgumentOutOfRangeException("encoding"); + } + _value = value; + //if ((flags & PdfStringFlags.EncodingMask) == 0) + // flags |= PdfStringFlags.PDFDocEncoding; + _flags = (PdfStringFlags)encoding; + } + + internal PdfString(string value, PdfStringFlags flags) + { + _value = value; + _flags = flags; + } + + /// + /// Gets the number of characters in this string. + /// + public int Length + { + get { return _value == null ? 0 : _value.Length; } + } + + /// + /// Gets the encoding. + /// + public PdfStringEncoding Encoding + { + get { return (PdfStringEncoding)(_flags & PdfStringFlags.EncodingMask); } + } + + /// + /// Gets a value indicating whether the string is a hexadecimal literal. + /// + public bool HexLiteral + { + get { return (_flags & PdfStringFlags.HexLiteral) != 0; } + } + + internal PdfStringFlags Flags + { + get { return _flags; } + } + readonly PdfStringFlags _flags; + + /// + /// Gets the string value. + /// + public string Value + { + // This class must behave like a value type. Therefore it cannot be changed (like System.String). + get { return _value ?? ""; } + } + string _value; + + /// + /// Gets or sets the string value for encryption purposes. + /// + internal byte[] EncryptionValue + { + // TODO: Unicode case is not handled! + get { return _value == null ? new byte[0] : PdfEncoders.RawEncoding.GetBytes(_value); } + // BUG: May lead to trouble with the value semantics of PdfString + set { _value = PdfEncoders.RawEncoding.GetString(value, 0, value.Length); } + } + + /// + /// Returns the string. + /// + public override string ToString() + { +#if true + PdfStringEncoding encoding = (PdfStringEncoding)(_flags & PdfStringFlags.EncodingMask); + string pdf = (_flags & PdfStringFlags.HexLiteral) == 0 ? + PdfEncoders.ToStringLiteral(_value, encoding, null) : + PdfEncoders.ToHexStringLiteral(_value, encoding, null); + return pdf; +#else + return _value; +#endif + } + + /// + /// Hack for document encoded bookmarks. + /// + public string ToStringFromPdfDocEncoded() + { + int length = _value.Length; + char[] bytes = new char[length]; + for (int idx = 0; idx < length; idx++) + { + char ch = _value[idx]; + if (ch <= 255) + { + bytes[idx] = Encode[ch]; + } + else + { + //Debug-Break.Break(); + throw new InvalidOperationException("DocEncoded string contains char greater 255."); + } + } + StringBuilder sb = new StringBuilder(length); + for (int idx = 0; idx < length; idx++) + sb.Append((char)bytes[idx]); + return sb.ToString(); + } + static readonly char[] Encode = + { + '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0A', '\x0B', '\x0C', '\x0D', '\x0E', '\x0F', + '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1A', '\x1B', '\x1C', '\x1D', '\x1E', '\x1F', + '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2A', '\x2B', '\x2C', '\x2D', '\x2E', '\x2F', + '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3A', '\x3B', '\x3C', '\x3D', '\x3E', '\x3F', + '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4A', '\x4B', '\x4C', '\x4D', '\x4E', '\x4F', + '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5A', '\x5B', '\x5C', '\x5D', '\x5E', '\x5F', + '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6A', '\x6B', '\x6C', '\x6D', '\x6E', '\x6F', + '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7A', '\x7B', '\x7C', '\x7D', '\x7E', '\x7F', + '\x2022', '\x2020', '\x2021', '\x2026', '\x2014', '\x2013', '\x0192', '\x2044', '\x2039', '\x203A', '\x2212', '\x2030', '\x201E', '\x201C', '\x201D', '\x2018', + '\x2019', '\x201A', '\x2122', '\xFB01', '\xFB02', '\x0141', '\x0152', '\x0160', '\x0178', '\x017D', '\x0131', '\x0142', '\x0153', '\x0161', '\x017E', '\xFFFD', + '\x20AC', '\xA1', '\xA2', '\xA3', '\xA4', '\xA5', '\xA6', '\xA7', '\xA8', '\xA9', '\xAA', '\xAB', '\xAC', '\xAD', '\xAE', '\xAF', + '\xB0', '\xB1', '\xB2', '\xB3', '\xB4', '\xB5', '\xB6', '\xB7', '\xB8', '\xB9', '\xBA', '\xBB', '\xBC', '\xBD', '\xBE', '\xBF', + '\xC0', '\xC1', '\xC2', '\xC3', '\xC4', '\xC5', '\xC6', '\xC7', '\xC8', '\xC9', '\xCA', '\xCB', '\xCC', '\xCD', '\xCE', '\xCF', + '\xD0', '\xD1', '\xD2', '\xD3', '\xD4', '\xD5', '\xD6', '\xD7', '\xD8', '\xD9', '\xDA', '\xDB', '\xDC', '\xDD', '\xDE', '\xDF', + '\xE0', '\xE1', '\xE2', '\xE3', '\xE4', '\xE5', '\xE6', '\xE7', '\xE8', '\xE9', '\xEA', '\xEB', '\xEC', '\xED', '\xEE', '\xEF', + '\xF0', '\xF1', '\xF2', '\xF3', '\xF4', '\xF5', '\xF6', '\xF7', '\xF8', '\xF9', '\xFA', '\xFB', '\xFC', '\xFD', '\xFE', '\xFF', + }; + + static void CheckRawEncoding(string s) + { + if (String.IsNullOrEmpty(s)) + return; + + int length = s.Length; + for (int idx = 0; idx < length; idx++) + { + Debug.Assert(s[idx] < 256, "RawString contains invalid character."); + } + } + + static bool IsRawEncoding(string s) + { + if (String.IsNullOrEmpty(s)) + return true; + + int length = s.Length; + for (int idx = 0; idx < length; idx++) + { + if (!(s[idx] < 256)) + return false; + } + return true; + } + + /// + /// Writes the string DocEncoded. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.Write(this); + } + } +} diff --git a/PdfSharp/Pdf/PdfStringObject.cs b/PdfSharp/Pdf/PdfStringObject.cs new file mode 100644 index 0000000..7c3832c --- /dev/null +++ b/PdfSharp/Pdf/PdfStringObject.cs @@ -0,0 +1,149 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using PdfSharp.Pdf.IO; +using PdfSharp.Pdf.Internal; + +namespace PdfSharp.Pdf +{ + /// + /// Represents an indirect text string value. This type is not used by PDFsharp. If it is imported from + /// an external PDF file, the value is converted into a direct object. + /// + [DebuggerDisplay("({Value})")] + public sealed class PdfStringObject : PdfObject + { + /// + /// Initializes a new instance of the class. + /// + public PdfStringObject() + { + _flags = PdfStringFlags.RawEncoding; + } + + /// + /// Initializes a new instance of the class. + /// + /// The document. + /// The value. + public PdfStringObject(PdfDocument document, string value) + : base(document) + { + _value = value; + _flags = PdfStringFlags.RawEncoding; + } + + /// + /// Initializes a new instance of the class. + /// + /// The value. + /// The encoding. + public PdfStringObject(string value, PdfStringEncoding encoding) + { + _value = value; + //if ((flags & PdfStringFlags.EncodingMask) == 0) + // flags |= PdfStringFlags.PDFDocEncoding; + _flags = (PdfStringFlags)encoding; + } + + internal PdfStringObject(string value, PdfStringFlags flags) + { + _value = value; + //if ((flags & PdfStringFlags.EncodingMask) == 0) + // flags |= PdfStringFlags.PDFDocEncoding; + _flags = flags; + } + + /// + /// Gets the number of characters in this string. + /// + public int Length + { + get { return _value == null ? 0 : _value.Length; } + } + + /// + /// Gets or sets the encoding. + /// + public PdfStringEncoding Encoding + { + get { return (PdfStringEncoding)(_flags & PdfStringFlags.EncodingMask); } + set { _flags = (_flags & ~PdfStringFlags.EncodingMask) | ((PdfStringFlags)value & PdfStringFlags.EncodingMask); } + } + + /// + /// Gets a value indicating whether the string is a hexadecimal literal. + /// + public bool HexLiteral + { + get { return (_flags & PdfStringFlags.HexLiteral) != 0; } + set { _flags = value ? _flags | PdfStringFlags.HexLiteral : _flags & ~PdfStringFlags.HexLiteral; } + } + PdfStringFlags _flags; + + /// + /// Gets or sets the value as string + /// + public string Value + { + get { return _value ?? ""; } + set { _value = value ?? ""; } + } + string _value; + + /// + /// Gets or sets the string value for encryption purposes. + /// + internal byte[] EncryptionValue + { + // TODO: Unicode case is not handled! + get { return _value == null ? new byte[0] : PdfEncoders.RawEncoding.GetBytes(_value); } + set { _value = PdfEncoders.RawEncoding.GetString(value, 0, value.Length); } + } + + /// + /// Returns the string. + /// + public override string ToString() + { + return _value; + } + + /// + /// Writes the string literal with encoding DOCEncoded. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.WriteBeginObject(this); + writer.Write(new PdfString(_value, _flags)); + writer.WriteEndObject(); + } + } +} diff --git a/PdfSharp/Pdf/PdfUInteger.cs b/PdfSharp/Pdf/PdfUInteger.cs new file mode 100644 index 0000000..164cf9c --- /dev/null +++ b/PdfSharp/Pdf/PdfUInteger.cs @@ -0,0 +1,228 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Globalization; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents a direct unsigned integer value. + /// + [DebuggerDisplay("({Value})")] + public sealed class PdfUInteger : PdfNumber, IConvertible + { + /// + /// Initializes a new instance of the class. + /// + public PdfUInteger() + { } + + /// + /// Initializes a new instance of the class. + /// + public PdfUInteger(uint value) + { + _value = value; + } + + /// + /// Gets the value as integer. + /// + public uint Value + { + // This class must behave like a value type. Therefore it cannot be changed (like System.String). + get { return _value; } + } + readonly uint _value; + + /// + /// Returns the unsigned integer as string. + /// + public override string ToString() + { + // ToString is impure but does not change the value of _value. + // ReSharper disable ImpureMethodCallOnReadonlyValueField + return _value.ToString(CultureInfo.InvariantCulture); + // ReSharper restore ImpureMethodCallOnReadonlyValueField + } + + /// + /// Writes the integer as string. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.Write(this); + } + + #region IConvertible Members + + /// + /// Converts the value of this instance to an equivalent 64-bit unsigned integer. + /// + public ulong ToUInt64(IFormatProvider provider) + { + return Convert.ToUInt64(_value); + } + + /// + /// Converts the value of this instance to an equivalent 8-bit signed integer. + /// + public sbyte ToSByte(IFormatProvider provider) + { + throw new InvalidCastException(); + } + + /// + /// Converts the value of this instance to an equivalent double-precision floating-point number. + /// + public double ToDouble(IFormatProvider provider) + { + return _value; + } + + /// + /// Returns an undefined DateTime structure. + /// + public DateTime ToDateTime(IFormatProvider provider) + { + // TODO: Add PdfUInteger.ToDateTime implementation + return new DateTime(); + } + + /// + /// Converts the value of this instance to an equivalent single-precision floating-point number. + /// + public float ToSingle(IFormatProvider provider) + { + return _value; + } + + /// + /// Converts the value of this instance to an equivalent Boolean value. + /// + public bool ToBoolean(IFormatProvider provider) + { + return Convert.ToBoolean(_value); + } + + /// + /// Converts the value of this instance to an equivalent 32-bit signed integer. + /// + public int ToInt32(IFormatProvider provider) + { + return Convert.ToInt32(_value); + } + + /// + /// Converts the value of this instance to an equivalent 16-bit unsigned integer. + /// + public ushort ToUInt16(IFormatProvider provider) + { + return Convert.ToUInt16(_value); + } + + /// + /// Converts the value of this instance to an equivalent 16-bit signed integer. + /// + public short ToInt16(IFormatProvider provider) + { + return Convert.ToInt16(_value); + } + + /// + /// Converts the value of this instance to an equivalent . + /// + string IConvertible.ToString(IFormatProvider provider) + { + return _value.ToString(provider); + } + + /// + /// Converts the value of this instance to an equivalent 8-bit unsigned integer. + /// + public byte ToByte(IFormatProvider provider) + { + return Convert.ToByte(_value); + } + + /// + /// Converts the value of this instance to an equivalent Unicode character. + /// + public char ToChar(IFormatProvider provider) + { + return Convert.ToChar(_value); + } + + /// + /// Converts the value of this instance to an equivalent 64-bit signed integer. + /// + public long ToInt64(IFormatProvider provider) + { + return _value; + } + + /// + /// Returns type code for 32-bit integers. + /// + public TypeCode GetTypeCode() + { + return TypeCode.Int32; + } + + /// + /// Converts the value of this instance to an equivalent number. + /// + public decimal ToDecimal(IFormatProvider provider) + { + return _value; + } + + /// + /// Returns null. + /// + public object ToType(Type conversionType, IFormatProvider provider) + { + // TODO: Add PdfUInteger.ToType implementation + return null; + } + + /// + /// Converts the value of this instance to an equivalent 32-bit unsigned integer. + /// + public uint ToUInt32(IFormatProvider provider) + { + return Convert.ToUInt32(_value); + } + + #endregion + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/PdfUIntegerObject.cs b/PdfSharp/Pdf/PdfUIntegerObject.cs new file mode 100644 index 0000000..972461f --- /dev/null +++ b/PdfSharp/Pdf/PdfUIntegerObject.cs @@ -0,0 +1,96 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using System.Globalization; +using PdfSharp.Pdf.IO; + +namespace PdfSharp.Pdf +{ + /// + /// Represents an indirect integer value. This type is not used by PDFsharp. If it is imported from + /// an external PDF file, the value is converted into a direct object. + /// + [DebuggerDisplay("({Value})")] + public sealed class PdfUIntegerObject : PdfNumberObject + { + /// + /// Initializes a new instance of the class. + /// + public PdfUIntegerObject() + { } + + /// + /// Initializes a new instance of the class. + /// + /// The value. + public PdfUIntegerObject(uint value) + { + _value = value; + } + + /// + /// Initializes a new instance of the class. + /// + /// The document. + /// The value. + public PdfUIntegerObject(PdfDocument document, uint value) + : base(document) + { + _value = value; + } + + /// + /// Gets the value as unsigned integer. + /// + public uint Value + { + get { return _value; } + } + readonly uint _value; + + /// + /// Returns the integer as string. + /// + public override string ToString() + { + return _value.ToString(CultureInfo.InvariantCulture); + } + + /// + /// Writes the integer literal. + /// + internal override void WriteObject(PdfWriter writer) + { + writer.WriteBeginObject(this); + writer.Write(_value); + writer.WriteEndObject(); + } + } +} diff --git a/PdfSharp/Pdf/PdfViewerPreferences.cs b/PdfSharp/Pdf/PdfViewerPreferences.cs new file mode 100644 index 0000000..b139480 --- /dev/null +++ b/PdfSharp/Pdf/PdfViewerPreferences.cs @@ -0,0 +1,308 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf +{ + /// + /// Represents the PDF document viewer preferences dictionary. + /// + public sealed class PdfViewerPreferences : PdfDictionary + { + internal PdfViewerPreferences(PdfDocument document) + : base(document) + { } + + /// + /// Initializes a new instance of the class. + /// + PdfViewerPreferences(PdfDictionary dict) + : base(dict) + { } + + /// + /// Gets or sets a value indicating whether to hide the viewer applications tool + /// bars when the document is active. + /// + public bool HideToolbar + { + get { return Elements.GetBoolean(Keys.HideToolbar); } + set { Elements.SetBoolean(Keys.HideToolbar, value); } + } + + /// + /// Gets or sets a value indicating whether to hide the viewer applications + /// menu bar when the document is active. + /// + public bool HideMenubar + { + get { return Elements.GetBoolean(Keys.HideMenubar); } + set { Elements.SetBoolean(Keys.HideMenubar, value); } + } + + /// + /// Gets or sets a value indicating whether to hide user interface elements in + /// the documents window (such as scroll bars and navigation controls), + /// leaving only the documents contents displayed. + /// + public bool HideWindowUI + { + get { return Elements.GetBoolean(Keys.HideWindowUI); } + set { Elements.SetBoolean(Keys.HideWindowUI, value); } + } + + /// + /// Gets or sets a value indicating whether to resize the documents window to + /// fit the size of the first displayed page. + /// + public bool FitWindow + { + get { return Elements.GetBoolean(Keys.FitWindow); } + set { Elements.SetBoolean(Keys.FitWindow, value); } + } + + /// + /// Gets or sets a value indicating whether to position the documents window + /// in the center of the screen. + /// + public bool CenterWindow + { + get { return Elements.GetBoolean(Keys.CenterWindow); } + set { Elements.SetBoolean(Keys.CenterWindow, value); } + } + + /// + /// Gets or sets a value indicating whether the windows title bar + /// should display the document title taken from the Title entry of the document + /// information dictionary. If false, the title bar should instead display the name + /// of the PDF file containing the document. + /// + public bool DisplayDocTitle + { + get { return Elements.GetBoolean(Keys.DisplayDocTitle); } + set { Elements.SetBoolean(Keys.DisplayDocTitle, value); } + } + + /// + /// The predominant reading order for text: LeftToRight or RightToLeft + /// (including vertical writing systems, such as Chinese, Japanese, and Korean). + /// This entry has no direct effect on the documents contents or page numbering + /// but can be used to determine the relative positioning of pages when displayed + /// side by side or printed n-up. Default value: LeftToRight. + /// + public PdfReadingDirection? Direction + { + get + { + switch (Elements.GetName(Keys.Direction)) + { + case "L2R": + return PdfReadingDirection.LeftToRight; + + case "R2L": + return PdfReadingDirection.RightToLeft; + } + return null; + } + set + { + if (value.HasValue) + { + switch (value.Value) + { + case PdfReadingDirection.RightToLeft: + Elements.SetName(Keys.Direction, "R2L"); + break; + + default: + Elements.SetName(Keys.Direction, "L2R"); + break; + } + } + else + Elements.Remove(Keys.Direction); + } + } + + /// + /// Predefined keys of this dictionary. + /// + internal sealed class Keys : KeysBase + { + /// + /// (Optional) A flag specifying whether to hide the viewer applications tool + /// bars when the document is active. Default value: false. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string HideToolbar = "/HideToolbar"; + + /// + /// (Optional) A flag specifying whether to hide the viewer applications + /// menu bar when the document is active. Default value: false. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string HideMenubar = "/HideMenubar"; + + /// + /// (Optional) A flag specifying whether to hide user interface elements in + /// the documents window (such as scroll bars and navigation controls), + /// leaving only the documents contents displayed. Default value: false. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string HideWindowUI = "/HideWindowUI"; + + /// + /// (Optional) A flag specifying whether to resize the documents window to + /// fit the size of the first displayed page. Default value: false. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string FitWindow = "/FitWindow"; + + /// + /// (Optional) A flag specifying whether to position the documents window + /// in the center of the screen. Default value: false. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string CenterWindow = "/CenterWindow"; + + /// + /// (Optional; PDF 1.4) A flag specifying whether the windows title bar + /// should display the document title taken from the Title entry of the document + /// information dictionary. If false, the title bar should instead display the name + /// of the PDF file containing the document. Default value: false. + /// + [KeyInfo(KeyType.Boolean | KeyType.Optional)] + public const string DisplayDocTitle = "/DisplayDocTitle"; + + /// + /// (Optional) The documents page mode, specifying how to display the document on + /// exiting full-screen mode: + /// UseNone Neither document outline nor thumbnail images visible + /// UseOutlines Document outline visible + /// UseThumbs Thumbnail images visible + /// UseOC Optional content group panel visible + /// This entry is meaningful only if the value of the PageMode entry in the catalog + /// dictionary is FullScreen; it is ignored otherwise. Default value: UseNone. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string NonFullScreenPageMode = "/NonFullScreenPageMode"; + + /// + /// (Optional; PDF 1.3) The predominant reading order for text: + /// L2R Left to right + /// R2L Right to left (including vertical writing systems, such as Chinese, Japanese, and Korean) + /// This entry has no direct effect on the documents contents or page numbering + /// but can be used to determine the relative positioning of pages when displayed + /// side by side or printed n-up. Default value: L2R. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string Direction = "/Direction"; + + /// + /// (Optional; PDF 1.4) The name of the page boundary representing the area of a page + /// to be displayed when viewing the document on the screen. The value is the key + /// designating the relevant page boundary in the page object. If the specified page + /// boundary is not defined in the page object, its default value is used. + /// Default value: CropBox. + /// Note: This entry is intended primarily for use by prepress applications that + /// interpret or manipulate the page boundaries as described in Section 10.10.1, Page Boundaries. + /// Most PDF consumer applications disregard it. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string ViewArea = "/ViewArea"; + + /// + /// (Optional; PDF 1.4) The name of the page boundary to which the contents of a page + /// are to be clipped when viewing the document on the screen. The value is the key + /// designating the relevant page boundary in the page object. If the specified page + /// boundary is not defined in the page object, its default value is used. + /// Default value: CropBox. + /// Note: This entry is intended primarily for use by prepress applications that + /// interpret or manipulate the page boundaries as described in Section 10.10.1, Page Boundaries. + /// Most PDF consumer applications disregard it. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string ViewClip = "/ViewClip"; + + /// + /// (Optional; PDF 1.4) The name of the page boundary representing the area of a page + /// to be rendered when printing the document. The value is the key designating the + /// relevant page boundary in the page object. If the specified page boundary is not + /// defined in the page object, its default value is used. + /// Default value: CropBox. + /// Note: This entry is intended primarily for use by prepress applications that + /// interpret or manipulate the page boundaries as described in Section 10.10.1, Page Boundaries. + /// Most PDF consumer applications disregard it. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string PrintArea = "/PrintArea"; + + /// + /// (Optional; PDF 1.4) The name of the page boundary to which the contents of a page + /// are to be clipped when printing the document. The value is the key designating the + /// relevant page boundary in the page object. If the specified page boundary is not + /// defined in the page object, its default value is used. + /// Default value: CropBox. + /// Note: This entry is intended primarily for use by prepress applications that interpret + /// or manipulate the page boundaries. Most PDF consumer applications disregard it. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string PrintClip = "/PrintClip"; + + /// + /// (Optional; PDF 1.6) The page scaling option to be selected when a print dialog is + /// displayed for this document. Valid values are None, which indicates that the print + /// dialog should reflect no page scaling, and AppDefault, which indicates that + /// applications should use the current print scaling. If this entry has an unrecognized + /// value, applications should use the current print scaling. + /// Default value: AppDefault. + /// Note: If the print dialog is suppressed and its parameters are provided directly + /// by the application, the value of this entry should still be used. + /// + [KeyInfo(KeyType.Name | KeyType.Optional)] + public const string PrintScaling = "/PrintScaling"; + + /// + /// Gets the KeysMeta for these keys. + /// + public static DictionaryMeta Meta + { + get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } + } + static DictionaryMeta _meta; + } + + /// + /// Gets the KeysMeta of this dictionary type. + /// + internal override DictionaryMeta Meta + { + get { return Keys.Meta; } + } + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/TrimMargins.cs b/PdfSharp/Pdf/TrimMargins.cs new file mode 100644 index 0000000..924e62c --- /dev/null +++ b/PdfSharp/Pdf/TrimMargins.cs @@ -0,0 +1,116 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System.Diagnostics; +using PdfSharp.Drawing; + +namespace PdfSharp.Pdf +{ + /// + /// Represents trim margins added to the page. + /// + [DebuggerDisplay("(Left={_left.Millimeter}mm, Right={_right.Millimeter}mm, Top={_top.Millimeter}mm, Bottom={_bottom.Millimeter}mm)")] + public sealed class TrimMargins + { + ///// + ///// Clones this instance. + ///// + //public TrimMargins Clone() + //{ + // TrimMargins trimMargins = new TrimMargins(); + // trimMargins.left = left; + // trimMargins.top = top; + // trimMargins.right = right; + // trimMargins.bottom = bottom; + // return trimMargins; + //} + + /// + /// Sets all four crop margins simultaneously. + /// + public XUnit All + { + set + { + _left = value; + _right = value; + _top = value; + _bottom = value; + } + } + + /// + /// Gets or sets the left crop margin. + /// + public XUnit Left + { + get { return _left; } + set { _left = value; } + } + XUnit _left; + + /// + /// Gets or sets the right crop margin. + /// + public XUnit Right + { + get { return _right; } + set { _right = value; } + } + XUnit _right; + + /// + /// Gets or sets the top crop margin. + /// + public XUnit Top + { + get { return _top; } + set { _top = value; } + } + XUnit _top; + + /// + /// Gets or sets the bottom crop margin. + /// + public XUnit Bottom + { + get { return _bottom; } + set { _bottom = value; } + } + XUnit _bottom; + + /// + /// Gets a value indicating whether this instance has at least one margin with a value other than zero. + /// + public bool AreSet + { + get { return _left.Value != 0 || _right.Value != 0 || _top.Value != 0 || _bottom.Value != 0; } + } + } +} diff --git a/PdfSharp/Pdf/enums/DocumentState.cs b/PdfSharp/Pdf/enums/DocumentState.cs new file mode 100644 index 0000000..74ab5a1 --- /dev/null +++ b/PdfSharp/Pdf/enums/DocumentState.cs @@ -0,0 +1,55 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf +{ + /// + /// Identifies the state of the document + /// + [Flags] + enum DocumentState + { + /// + /// The document was created from scratch. + /// + Created = 0x0001, + + /// + /// The document was created by opening an existing PDF file. + /// + Imported = 0x0002, + + /// + /// The document is disposed. + /// + Disposed = 0x8000, + } +} diff --git a/PdfSharp/Pdf/enums/PdfColorMode.cs b/PdfSharp/Pdf/enums/PdfColorMode.cs new file mode 100644 index 0000000..62a52fd --- /dev/null +++ b/PdfSharp/Pdf/enums/PdfColorMode.cs @@ -0,0 +1,52 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf +{ + /// + /// Specifies what color model is used in a PDF document. + /// + public enum PdfColorMode + { + /// + /// All color values are written as specified in the XColor objects they come from. + /// + Undefined, + + /// + /// All colors are converted to RGB. + /// + Rgb, + + /// + /// All colors are converted to CMYK. + /// + Cmyk, + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/enums/PdfCustomValueCompression.cs b/PdfSharp/Pdf/enums/PdfCustomValueCompression.cs new file mode 100644 index 0000000..32a02b3 --- /dev/null +++ b/PdfSharp/Pdf/enums/PdfCustomValueCompression.cs @@ -0,0 +1,52 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf +{ + /// + /// This class is undocumented and may change or drop in future releases. + /// + public enum PdfCustomValueCompressionMode + { + /// + /// Use document default to determine compression. + /// + Default, + + /// + /// Leave custom values uncompressed. + /// + Uncompressed, + + /// + /// Compress custom values using FlateDecode. + /// + Compressed, + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/enums/PdfFlateEncodeMode.cs b/PdfSharp/Pdf/enums/PdfFlateEncodeMode.cs new file mode 100644 index 0000000..1553914 --- /dev/null +++ b/PdfSharp/Pdf/enums/PdfFlateEncodeMode.cs @@ -0,0 +1,52 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf +{ + /// + /// Sets the mode for the Deflater (FlateEncoder). + /// + public enum PdfFlateEncodeMode + { + /// + /// The default mode. + /// + Default, + + /// + /// Fast encoding, but larger PDF files. + /// + BestSpeed, + + /// + /// Best compression, but takes more time. + /// + BestCompression, + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/enums/PdfFontEmbedding.cs b/PdfSharp/Pdf/enums/PdfFontEmbedding.cs new file mode 100644 index 0000000..f75ca34 --- /dev/null +++ b/PdfSharp/Pdf/enums/PdfFontEmbedding.cs @@ -0,0 +1,63 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf +{ + /// + /// Specifies the embedding options of an XFont when converted into PDF. + /// Font embedding is not optional anymore. So Always is the only option. + /// + public enum PdfFontEmbedding + { + /// + /// All fonts are embedded. + /// + Always, + + /// + /// Fonts are not embedded. This is not an option anymore. + /// + [Obsolete("Fonts must always be embedded.")] + None, + + /// + /// Unicode fonts are embedded, WinAnsi fonts are not embedded. + /// + [Obsolete("Fonts must always be embedded.")] + Default, + + /// + /// Not yet implemented. + /// + [Obsolete("Fonts must always be embedded.")] + Automatic, + } +} diff --git a/PdfSharp/Pdf/enums/PdfFontEncoding.cs b/PdfSharp/Pdf/enums/PdfFontEncoding.cs new file mode 100644 index 0000000..cc01b42 --- /dev/null +++ b/PdfSharp/Pdf/enums/PdfFontEncoding.cs @@ -0,0 +1,68 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp.Pdf +{ + /// + /// Specifies the encoding schema used for an XFont when converted into PDF. + /// + public enum PdfFontEncoding + { + // TABLE + + /// + /// Cause a font to use Windows-1252 encoding to encode text rendered with this font. + /// Same as Windows1252 encoding. + /// + WinAnsi = 0, + + ///// + ///// Cause a font to use Windows-1252 (aka WinAnsi) encoding to encode text rendered with this font. + ///// + //Windows1252 = 0, + + /// + /// Cause a font to use Unicode encoding to encode text rendered with this font. + /// + Unicode = 1, + + /// + /// Unicode encoding. + /// + [Obsolete("Use WinAnsi or Unicode")] + Automatic = 1, // Force Unicode when used. + + // Implementation note: PdfFontEncoding uses incorrect terms. + // WinAnsi correspond to WinAnsiEncoding, while Unicode uses glyph indices. + // Furthermre the term WinAnsi is an oxymoron. + // Reference: TABLE D.1 Latin-text encodings / Page 996 + } +} diff --git a/PdfSharp/Pdf/enums/PdfOutlineStyle.cs b/PdfSharp/Pdf/enums/PdfOutlineStyle.cs new file mode 100644 index 0000000..38632b7 --- /dev/null +++ b/PdfSharp/Pdf/enums/PdfOutlineStyle.cs @@ -0,0 +1,62 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// Review: OK - StL/14-10-05 + +using System; + +namespace PdfSharp.Pdf +{ + /// + /// Specifies the font style for the outline (bookmark) text. + /// + [Flags] + public enum PdfOutlineStyle // Reference: TABLE 8.5 Ouline Item flags / Page 587 + { + /// + /// Outline text is displayed using a regular font. + /// + Regular = 0, + + /// + /// Outline text is displayed using an italic font. + /// + Italic = 1, + + /// + /// Outline text is displayed using a bold font. + /// + Bold = 2, + + /// + /// Outline text is displayed using a bold and italic font. + /// + BoldItalic = 3, + } +} diff --git a/PdfSharp/Pdf/enums/PdfPageDestinationType.cs b/PdfSharp/Pdf/enums/PdfPageDestinationType.cs new file mode 100644 index 0000000..b9a5289 --- /dev/null +++ b/PdfSharp/Pdf/enums/PdfPageDestinationType.cs @@ -0,0 +1,98 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// ReSharper disable InconsistentNaming because we use PDF names. + +namespace PdfSharp.Pdf +{ + /// + /// Specifies the type of a page destination in outline items, annotations, or actions.. + /// + public enum PdfPageDestinationType // Reference: TABLE 8.2 Destination Syntax / Page 582 + { + // Except for FitR the documentation text is outdated. + + /// + /// Display the page with the coordinates (left, top) positioned at the upper-left corner of + /// the window and the contents of the page magnified by the factor zoom. + /// + Xyz, + + /// + /// Display the page with its contents magnified just enough to fit the + /// entire page within the window both horizontally and vertically. + /// + Fit, + + /// + /// Display the page with the vertical coordinate top positioned at the top edge of + /// the window and the contents of the page magnified just enough to fit the entire + /// width of the page within the window. + /// + FitH, + + /// + /// Display the page with the horizontal coordinate left positioned at the left edge of + /// the window and the contents of the page magnified just enough to fit the entire + /// height of the page within the window. + /// + FitV, + + /// + /// Display the page designated by page, with its contents magnified just enough to + /// fit the rectangle specified by the coordinates left, bottom, right, and topentirely + /// within the window both horizontally and vertically. If the required horizontal and + /// vertical magnification factors are different, use the smaller of the two, centering + /// the rectangle within the window in the other dimension. A null value for any of + /// the parameters may result in unpredictable behavior. + /// + FitR, + + /// + /// Display the page with its contents magnified just enough to fit the rectangle specified + /// by the coordinates left, bottom, right, and topentirely within the window both + /// horizontally and vertically. + /// + FitB, + + /// + /// Display the page with the vertical coordinate top positioned at the top edge of + /// the window and the contents of the page magnified just enough to fit the entire + /// width of its bounding box within the window. + /// + FitBH, + + /// + /// Display the page with the horizontal coordinate left positioned at the left edge of + /// the window and the contents of the page magnified just enough to fit the entire + /// height of its bounding box within the window. + /// + FitBV, + } +} diff --git a/PdfSharp/Pdf/enums/PdfPageLayout.cs b/PdfSharp/Pdf/enums/PdfPageLayout.cs new file mode 100644 index 0000000..d6502e0 --- /dev/null +++ b/PdfSharp/Pdf/enums/PdfPageLayout.cs @@ -0,0 +1,67 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf +{ + /// + /// Specifies the page layout to be used by a viewer when the document is opened. + /// + public enum PdfPageLayout + { + /// + /// Display one page at a time. + /// + SinglePage, + + /// + /// Display the pages in one column. + /// + OneColumn, + + /// + /// Display the pages in two columns, with oddnumbered pages on the left. + /// + TwoColumnLeft, + + /// + /// Display the pages in two columns, with oddnumbered pages on the right. + /// + TwoColumnRight, + + /// + /// (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left. + /// + TwoPageLeft, + + /// + /// (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right. + /// + TwoPageRight, + } +} diff --git a/PdfSharp/Pdf/enums/PdfPageMode.cs b/PdfSharp/Pdf/enums/PdfPageMode.cs new file mode 100644 index 0000000..0fea304 --- /dev/null +++ b/PdfSharp/Pdf/enums/PdfPageMode.cs @@ -0,0 +1,69 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// ReSharper disable InconsistentNaming + +namespace PdfSharp.Pdf +{ + /// + /// Specifies how the document should be displayed by a viewer when opened. + /// + public enum PdfPageMode + { + /// + /// Neither document outline nor thumbnail images visible. + /// + UseNone, + + /// + /// Document outline visible. + /// + UseOutlines, + + /// + /// Thumbnail images visible. + /// + UseThumbs, + + /// + /// Full-screen mode, with no menu bar, windowcontrols, or any other window visible. + /// + FullScreen, + + /// + /// (PDF 1.5) Optional content group panel visible. + /// + UseOC, + + /// + /// (PDF 1.6) Attachments panel visible. + /// + UseAttachments, + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/enums/PdfReadingDirection.cs b/PdfSharp/Pdf/enums/PdfReadingDirection.cs new file mode 100644 index 0000000..d027e3b --- /dev/null +++ b/PdfSharp/Pdf/enums/PdfReadingDirection.cs @@ -0,0 +1,47 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf +{ + /// + /// Specifies how the document should be displayed by a viewer when opened. + /// + public enum PdfReadingDirection + { + /// + /// Left to right. + /// + LeftToRight, + + /// + /// Right to left (including vertical writing systems, such as Chinese, Japanese, and Korean) + /// + RightToLeft, + } +} \ No newline at end of file diff --git a/PdfSharp/Pdf/enums/PdfTextStringEncoding.cs b/PdfSharp/Pdf/enums/PdfTextStringEncoding.cs new file mode 100644 index 0000000..acffdfc --- /dev/null +++ b/PdfSharp/Pdf/enums/PdfTextStringEncoding.cs @@ -0,0 +1,50 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +// ReSharper disable InconsistentNaming + +namespace PdfSharp.Pdf +{ + /// + /// Specifies how text strings are encoded. A text string is any text used outside of a page content + /// stream, e.g. document information, outline text, annotation text etc. + /// + public enum PdfTextStringEncoding + { + /// + /// Specifies that hypertext uses PDF DocEncoding. + /// + PDFDocEncoding = 0, + + /// + /// Specifies that hypertext uses unicode encoding. + /// + Unicode = 1, + } +} diff --git a/PdfSharp/Pdf/enums/PdfUseFlateDecoderForJpegImages.cs b/PdfSharp/Pdf/enums/PdfUseFlateDecoderForJpegImages.cs new file mode 100644 index 0000000..9435636 --- /dev/null +++ b/PdfSharp/Pdf/enums/PdfUseFlateDecoderForJpegImages.cs @@ -0,0 +1,55 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp.Pdf +{ + /// + /// Specifies whether to compress JPEG images with the FlateDecode filter. + /// + public enum PdfUseFlateDecoderForJpegImages + { + /// + /// PDFsharp will try FlateDecode and use it if it leads to a reduction in PDF file size. + /// When FlateEncodeMode is set to BestCompression, this is more likely to reduce the file size, + /// but it takes considerably more time to create the PDF file. + /// + Automatic, + + /// + /// PDFsharp will never use FlateDecode - files may be a few bytes larger, but file creation is faster. + /// + Never, + + /// + /// PDFsharp will always use FlateDecode, even if this leads to larger files; + /// this option is meant for testing purposes only and should not be used for production code. + /// + Always, + } +} \ No newline at end of file diff --git a/PdfSharp/PdfSharp.csproj b/PdfSharp/PdfSharp.csproj new file mode 100644 index 0000000..5d64dd3 --- /dev/null +++ b/PdfSharp/PdfSharp.csproj @@ -0,0 +1,52 @@ + + + + 3.0.0.0 + netstandard2.0 + $(DefineConstants);CORE;CORE_WITH_GDI + PdfSharp + PdfSharp + false + false + false + false + false + false + false + PdfSharp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PdfSharp/Resources/Messages.de.restext b/PdfSharp/Resources/Messages.de.restext new file mode 100644 index 0000000..c463242 --- /dev/null +++ b/PdfSharp/Resources/Messages.de.restext @@ -0,0 +1,20 @@ +; PDFsharp string resources (German) +; +; Must be saved as Unicode (UTF-8 with signature) to force resgen.exe to process German umlauts. + +; ----- General Messages -------------------------------------------------------------------------- + +SampleMessage1 = Das ist Beispielnachricht 1 (de). +SampleMessage2 = Das ist Beispielnachricht 2: {0}. + +; ----- XGraphics Messages ------------------------------------------------------------------------ + +; ----- Pdf Messages ------------------------------------------------------------------------------ + +NameMustStartWithSlash = Ein PDF-Name muss mit einem Schrägstrich ('/') beginnen. +UserOrOwnerPasswordRequired = Zum Verschlüsseln des Dokuments muss ein Kennwort zum Öffnen (UserPassword) oder ein Berechtigungskennwort (OwnerPassword) gesetzt sein. + +; ----- PdfParser Messages ------------------------------------------------------------------------ + +UnexpectedToken = Token '{0}' wird an dieser Stelle nicht erwartet. +UnknownEncryption = Das PDF-Dokument ist mit einer von PDFsharp nicht unterstützten Verschlüsselung geschützt. diff --git a/PdfSharp/Resources/Messages.restext b/PdfSharp/Resources/Messages.restext new file mode 100644 index 0000000..e47d27f --- /dev/null +++ b/PdfSharp/Resources/Messages.restext @@ -0,0 +1,20 @@ +; PDFsharp string resources (English) +; +; + +; ----- General Messages -------------------------------------------------------------------------- + +SampleMessage1 = This is sample message 1 (2.0). +SampleMessage2 = This is sample message 2: {0}. + +; ----- XGraphics Messages ------------------------------------------------------------------------ + +; ----- Pdf Messages ------------------------------------------------------------------------------ + +NameMustStartWithSlash = A PDF name must start with a slash ('/'). +UserOrOwnerPasswordRequired = At least a user or an owner password is required to encrypt the document. + +; ----- PdfParser Messages ------------------------------------------------------------------------ + +UnexpectedToken = Token '{0}' was not expected. +UnknownEncryption = The PDF document is protected with an encryption not supported by PDFsharp. diff --git a/PdfSharp/SharpZipLib/Checksums/Adler32.cs b/PdfSharp/SharpZipLib/Checksums/Adler32.cs new file mode 100644 index 0000000..dd46246 --- /dev/null +++ b/PdfSharp/SharpZipLib/Checksums/Adler32.cs @@ -0,0 +1,245 @@ +// Adler32.cs - Computes Adler32 data checksum of a data stream +// Copyright (C) 2001 Mike Krueger +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; + +namespace PdfSharp.SharpZipLib.Checksums +{ + + /// + /// Computes Adler32 checksum for a stream of data. An Adler32 + /// checksum is not as reliable as a CRC32 checksum, but a lot faster to + /// compute. + /// + /// The specification for Adler32 may be found in RFC 1950. + /// ZLIB Compressed Data Format Specification version 3.3) + /// + /// + /// From that document: + /// + /// "ADLER32 (Adler-32 checksum) + /// This contains a checksum value of the uncompressed data + /// (excluding any dictionary data) computed according to Adler-32 + /// algorithm. This algorithm is a 32-bit extension and improvement + /// of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073 + /// standard. + /// + /// Adler-32 is composed of two sums accumulated per byte: s1 is + /// the sum of all bytes, s2 is the sum of all s1 values. Both sums + /// are done modulo 65521. s1 is initialized to 1, s2 to zero. The + /// Adler-32 checksum is stored as s2*65536 + s1 in most- + /// significant-byte first (network) order." + /// + /// "8.2. The Adler-32 algorithm + /// + /// The Adler-32 algorithm is much faster than the CRC32 algorithm yet + /// still provides an extremely low probability of undetected errors. + /// + /// The modulo on unsigned long accumulators can be delayed for 5552 + /// bytes, so the modulo operation time is negligible. If the bytes + /// are a, b, c, the second sum is 3a + 2b + c + 3, and so is position + /// and order sensitive, unlike the first sum, which is just a + /// checksum. That 65521 is prime is important to avoid a possible + /// large class of two-byte errors that leave the check unchanged. + /// (The Fletcher checksum uses 255, which is not prime and which also + /// makes the Fletcher check insensitive to single byte changes 0 - + /// 255.) + /// + /// The sum s1 is initialized to 1 instead of zero to make the length + /// of the sequence part of s2, so that the length does not have to be + /// checked separately. (Any sequence of zeroes has a Fletcher + /// checksum of zero.)" + /// + /// + /// + internal sealed class Adler32 : IChecksum + { + /// + /// largest prime smaller than 65536 + /// + const uint BASE = 65521; + + /// + /// Returns the Adler32 data checksum computed so far. + /// + public long Value + { + get + { + return checksum; + } + } + + /// + /// Creates a new instance of the Adler32 class. + /// The checksum starts off with a value of 1. + /// + public Adler32() + { + Reset(); + } + + /// + /// Resets the Adler32 checksum to the initial value. + /// + public void Reset() + { + checksum = 1; + } + + /// + /// Updates the checksum with a byte value. + /// + /// + /// The data value to add. The high byte of the int is ignored. + /// + public void Update(int value) + { + // We could make a length 1 byte array and call update again, but I + // would rather not have that overhead + uint s1 = checksum & 0xFFFF; + uint s2 = checksum >> 16; + + s1 = (s1 + ((uint)value & 0xFF)) % BASE; + s2 = (s1 + s2) % BASE; + + checksum = (s2 << 16) + s1; + } + + /// + /// Updates the checksum with an array of bytes. + /// + /// + /// The source of the data to update with. + /// + public void Update(byte[] buffer) + { + if (buffer == null) + { + throw new ArgumentNullException("buffer"); + } + + Update(buffer, 0, buffer.Length); + } + + /// + /// Updates the checksum with the bytes taken from the array. + /// + /// + /// an array of bytes + /// + /// + /// the start of the data used for this update + /// + /// + /// the number of bytes to use for this update + /// + public void Update(byte[] buffer, int offset, int count) + { + if (buffer == null) + { + throw new ArgumentNullException("buffer"); + } + + if (offset < 0) + { +#if NETCF_1_0 + throw new ArgumentOutOfRangeException("offset"); +#else + throw new ArgumentOutOfRangeException("offset", "cannot be negative"); +#endif + } + + if (count < 0) + { +#if NETCF_1_0 + throw new ArgumentOutOfRangeException("count"); +#else + throw new ArgumentOutOfRangeException("count", "cannot be negative"); +#endif + } + + if (offset >= buffer.Length) + { +#if NETCF_1_0 + throw new ArgumentOutOfRangeException("offset"); +#else + throw new ArgumentOutOfRangeException("offset", "not a valid index into buffer"); +#endif + } + + if (offset + count > buffer.Length) + { +#if NETCF_1_0 + throw new ArgumentOutOfRangeException("count"); +#else + throw new ArgumentOutOfRangeException("count", "exceeds buffer size"); +#endif + } + + //(By Per Bothner) + uint s1 = checksum & 0xFFFF; + uint s2 = checksum >> 16; + + while (count > 0) + { + // We can defer the modulo operation: + // s1 maximally grows from 65521 to 65521 + 255 * 3800 + // s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31 + int n = 3800; + if (n > count) + { + n = count; + } + count -= n; + while (--n >= 0) + { + s1 = s1 + (uint)(buffer[offset++] & 0xff); + s2 = s2 + s1; + } + s1 %= BASE; + s2 %= BASE; + } + + checksum = (s2 << 16) | s1; + } + + #region Instance Fields + uint checksum; + #endregion + } +} diff --git a/PdfSharp/SharpZipLib/Checksums/CRC32.cs b/PdfSharp/SharpZipLib/Checksums/CRC32.cs new file mode 100644 index 0000000..584b5c6 --- /dev/null +++ b/PdfSharp/SharpZipLib/Checksums/CRC32.cs @@ -0,0 +1,231 @@ +// CRC32.cs - Computes CRC32 data checksum of a data stream +// Copyright (C) 2001 Mike Krueger +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; + +namespace PdfSharp.SharpZipLib.Checksums +{ + + /// + /// Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: + /// x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. + /// + /// Polynomials over GF(2) are represented in binary, one bit per coefficient, + /// with the lowest powers in the most significant bit. Then adding polynomials + /// is just exclusive-or, and multiplying a polynomial by x is a right shift by + /// one. If we call the above polynomial p, and represent a byte as the + /// polynomial q, also with the lowest power in the most significant bit (so the + /// byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + /// where a mod b means the remainder after dividing a by b. + /// + /// This calculation is done using the shift-register method of multiplying and + /// taking the remainder. The register is initialized to zero, and for each + /// incoming bit, x^32 is added mod p to the register if the bit is a one (where + /// x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by + /// x (which is shifting right by one and adding x^32 mod p if the bit shifted + /// out is a one). We start with the highest power (least significant bit) of + /// q and repeat for all eight bits of q. + /// + /// The table is simply the CRC of all possible eight bit values. This is all + /// the information needed to generate CRC's on data a byte at a time for all + /// combinations of CRC register values and incoming bytes. + /// + internal sealed class Crc32 : IChecksum + { + const uint CrcSeed = 0xFFFFFFFF; + + readonly static uint[] CrcTable = new uint[] { + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, + 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, + 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, + 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, + 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, + 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, + 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, + 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, + 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, + 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, + 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, + 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, + 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, + 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, + 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, + 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, + 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, + 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, + 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, + 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, + 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, + 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, + 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, + 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, + 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, + 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, + 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, + 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, + 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, + 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, + 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, + 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, + 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, + 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, + 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, + 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, + 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, + 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, + 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, + 0x2D02EF8D + }; + + internal static uint ComputeCrc32(uint oldCrc, byte value) + { + return (uint)(Crc32.CrcTable[(oldCrc ^ value) & 0xFF] ^ (oldCrc >> 8)); + } + + /// + /// The crc data checksum so far. + /// + uint crc; + + /// + /// Returns the CRC32 data checksum computed so far. + /// + public long Value + { + get + { + return (long)crc; + } + set + { + crc = (uint)value; + } + } + + /// + /// Resets the CRC32 data checksum as if no update was ever called. + /// + public void Reset() + { + crc = 0; + } + + /// + /// Updates the checksum with the int bval. + /// + /// + /// the byte is taken as the lower 8 bits of value + /// + public void Update(int value) + { + crc ^= CrcSeed; + crc = CrcTable[(crc ^ value) & 0xFF] ^ (crc >> 8); + crc ^= CrcSeed; + } + + /// + /// Updates the checksum with the bytes taken from the array. + /// + /// + /// buffer an array of bytes + /// + public void Update(byte[] buffer) + { + if (buffer == null) + { + throw new ArgumentNullException("buffer"); + } + + Update(buffer, 0, buffer.Length); + } + + /// + /// Adds the byte array to the data checksum. + /// + /// + /// The buffer which contains the data + /// + /// + /// The offset in the buffer where the data starts + /// + /// + /// The number of data bytes to update the CRC with. + /// + public void Update(byte[] buffer, int offset, int count) + { + if (buffer == null) + { + throw new ArgumentNullException("buffer"); + } + + if (count < 0) + { +#if NETCF_1_0 + throw new ArgumentOutOfRangeException("count"); +#else + throw new ArgumentOutOfRangeException("count", "Count cannot be less than zero"); +#endif + } + + if (offset < 0 || offset + count > buffer.Length) + { + throw new ArgumentOutOfRangeException("offset"); + } + + crc ^= CrcSeed; + + while (--count >= 0) + { + crc = CrcTable[(crc ^ buffer[offset++]) & 0xFF] ^ (crc >> 8); + } + + crc ^= CrcSeed; + } + } +} diff --git a/PdfSharp/SharpZipLib/Checksums/IChecksum.cs b/PdfSharp/SharpZipLib/Checksums/IChecksum.cs new file mode 100644 index 0000000..bcf34f8 --- /dev/null +++ b/PdfSharp/SharpZipLib/Checksums/IChecksum.cs @@ -0,0 +1,93 @@ +// IChecksum.cs - Interface to compute a data checksum +// Copyright (C) 2001 Mike Krueger +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +namespace PdfSharp.SharpZipLib.Checksums +{ + + /// + /// Interface to compute a data checksum used by checked input/output streams. + /// A data checksum can be updated by one byte or with a byte array. After each + /// update the value of the current checksum can be returned by calling + /// getValue. The complete checksum object can also be reset + /// so it can be used again with new data. + /// + internal interface IChecksum + { + /// + /// Returns the data checksum computed so far. + /// + long Value + { + get; + } + + /// + /// Resets the data checksum as if no update was ever called. + /// + void Reset(); + + /// + /// Adds one byte to the data checksum. + /// + /// + /// the data value to add. The high byte of the int is ignored. + /// + void Update(int value); + + /// + /// Updates the data checksum with the bytes taken from the array. + /// + /// + /// buffer an array of bytes + /// + void Update(byte[] buffer); + + /// + /// Adds the byte array to the data checksum. + /// + /// + /// The buffer which contains the data + /// + /// + /// The offset in the buffer where the data starts + /// + /// + /// the number of data bytes to add. + /// + void Update(byte[] buffer, int offset, int count); + } +} diff --git a/PdfSharp/SharpZipLib/ReadMe.txt b/PdfSharp/SharpZipLib/ReadMe.txt new file mode 100644 index 0000000..ac076ef --- /dev/null +++ b/PdfSharp/SharpZipLib/ReadMe.txt @@ -0,0 +1,3 @@ + +This code is an excerpt from the SharpZipLib. The code is unmodified except that all classes +are made internal and moved to the namespace PdfSharp.SharpZipLib. diff --git a/PdfSharp/SharpZipLib/SharpZipBaseException.cs b/PdfSharp/SharpZipLib/SharpZipBaseException.cs new file mode 100644 index 0000000..989a73f --- /dev/null +++ b/PdfSharp/SharpZipLib/SharpZipBaseException.cs @@ -0,0 +1,94 @@ +// SharpZipBaseException.cs +// +// Copyright 2004 John Reilly +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; + +#if !NETCF_1_0 && !NETCF_2_0 +using System.Runtime.Serialization; +#endif + +namespace PdfSharp.SharpZipLib +{ + /// + /// SharpZipBaseException is the base exception class for the SharpZipLibrary. + /// All library exceptions are derived from this. + /// + /// NOTE: Not all exceptions thrown will be derived from this class. + /// A variety of other exceptions are possible for example +#if !NETCF_1_0 && !NETCF_2_0 + [Serializable] +#endif + internal class SharpZipBaseException : ApplicationException + { +#if false//!NETCF_1_0 && !NETCF_2_0 + /// + /// Deserialization constructor + /// + /// for this constructor + /// for this constructor + protected SharpZipBaseException(SerializationInfo info, StreamingContext context ) + : base( info, context ) + { + } +#endif + + /// + /// Initializes a new instance of the SharpZipBaseException class. + /// + public SharpZipBaseException() + { + } + + /// + /// Initializes a new instance of the SharpZipBaseException class with a specified error message. + /// + /// A message describing the exception. + public SharpZipBaseException(string message) + : base(message) + { + } + + /// + /// Initializes a new instance of the SharpZipBaseException class with a specified + /// error message and a reference to the inner exception that is the cause of this exception. + /// + /// A message describing the exception. + /// The inner exception + public SharpZipBaseException(string message, Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/PdfSharp/SharpZipLib/Zip/Compression/Deflater.cs b/PdfSharp/SharpZipLib/Zip/Compression/Deflater.cs new file mode 100644 index 0000000..cf6ed8a --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/Compression/Deflater.cs @@ -0,0 +1,595 @@ +// Deflater.cs +// +// Copyright (C) 2001 Mike Krueger +// Copyright (C) 2004 John Reilly +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; + +namespace PdfSharp.SharpZipLib.Zip.Compression +{ + + /// + /// This is the Deflater class. The deflater class compresses input + /// with the deflate algorithm described in RFC 1951. It has several + /// compression levels and three different strategies described below. + /// + /// This class is not thread safe. This is inherent in the API, due + /// to the split of deflate and setInput. + /// + /// Author of the original java version: Jochen Hoenicke + /// + internal class Deflater + { + #region Deflater Documentation + /* + * The Deflater can do the following state transitions: + * + * (1) -> INIT_STATE ----> INIT_FINISHING_STATE ---. + * / | (2) (5) | + * / v (5) | + * (3)| SETDICT_STATE ---> SETDICT_FINISHING_STATE |(3) + * \ | (3) | ,--------' + * | | | (3) / + * v v (5) v v + * (1) -> BUSY_STATE ----> FINISHING_STATE + * | (6) + * v + * FINISHED_STATE + * \_____________________________________/ + * | (7) + * v + * CLOSED_STATE + * + * (1) If we should produce a header we start in INIT_STATE, otherwise + * we start in BUSY_STATE. + * (2) A dictionary may be set only when we are in INIT_STATE, then + * we change the state as indicated. + * (3) Whether a dictionary is set or not, on the first call of deflate + * we change to BUSY_STATE. + * (4) -- intentionally left blank -- :) + * (5) FINISHING_STATE is entered, when flush() is called to indicate that + * there is no more INPUT. There are also states indicating, that + * the header wasn't written yet. + * (6) FINISHED_STATE is entered, when everything has been flushed to the + * internal pending output buffer. + * (7) At any time (7) + * + */ + #endregion + #region Public Constants + /// + /// The best and slowest compression level. This tries to find very + /// long and distant string repetitions. + /// + public const int BEST_COMPRESSION = 9; + + /// + /// The worst but fastest compression level. + /// + public const int BEST_SPEED = 1; + + /// + /// The default compression level. + /// + public const int DEFAULT_COMPRESSION = -1; + + /// + /// This level won't compress at all but output uncompressed blocks. + /// + public const int NO_COMPRESSION = 0; + + /// + /// The compression method. This is the only method supported so far. + /// There is no need to use this constant at all. + /// + public const int DEFLATED = 8; + #endregion + #region Local Constants + private const int IS_SETDICT = 0x01; + private const int IS_FLUSHING = 0x04; + private const int IS_FINISHING = 0x08; + + private const int INIT_STATE = 0x00; + private const int SETDICT_STATE = 0x01; + // private static int INIT_FINISHING_STATE = 0x08; + // private static int SETDICT_FINISHING_STATE = 0x09; + private const int BUSY_STATE = 0x10; + private const int FLUSHING_STATE = 0x14; + private const int FINISHING_STATE = 0x1c; + private const int FINISHED_STATE = 0x1e; + private const int CLOSED_STATE = 0x7f; + #endregion + #region Constructors + /// + /// Creates a new deflater with default compression level. + /// + public Deflater() + : this(DEFAULT_COMPRESSION, false) + { + + } + + /// + /// Creates a new deflater with given compression level. + /// + /// + /// the compression level, a value between NO_COMPRESSION + /// and BEST_COMPRESSION, or DEFAULT_COMPRESSION. + /// + /// if lvl is out of range. + public Deflater(int level) + : this(level, false) + { + + } + + /// + /// Creates a new deflater with given compression level. + /// + /// + /// the compression level, a value between NO_COMPRESSION + /// and BEST_COMPRESSION. + /// + /// + /// true, if we should suppress the Zlib/RFC1950 header at the + /// beginning and the adler checksum at the end of the output. This is + /// useful for the GZIP/PKZIP formats. + /// + /// if lvl is out of range. + public Deflater(int level, bool noZlibHeaderOrFooter) + { + if (level == DEFAULT_COMPRESSION) + { + level = 6; + } + else if (level < NO_COMPRESSION || level > BEST_COMPRESSION) + { + throw new ArgumentOutOfRangeException("level"); + } + + pending = new DeflaterPending(); + engine = new DeflaterEngine(pending); + this.noZlibHeaderOrFooter = noZlibHeaderOrFooter; + SetStrategy(DeflateStrategy.Default); + SetLevel(level); + Reset(); + } + #endregion + + /// + /// Resets the deflater. The deflater acts afterwards as if it was + /// just created with the same compression level and strategy as it + /// had before. + /// + public void Reset() + { + state = (noZlibHeaderOrFooter ? BUSY_STATE : INIT_STATE); + totalOut = 0; + pending.Reset(); + engine.Reset(); + } + + /// + /// Gets the current adler checksum of the data that was processed so far. + /// + public int Adler + { + get + { + return engine.Adler; + } + } + + /// + /// Gets the number of input bytes processed so far. + /// + public long TotalIn + { + get + { + return engine.TotalIn; + } + } + + /// + /// Gets the number of output bytes so far. + /// + public long TotalOut + { + get + { + return totalOut; + } + } + + /// + /// Flushes the current input block. Further calls to deflate() will + /// produce enough output to inflate everything in the current input + /// block. This is not part of Sun's JDK so I have made it package + /// private. It is used by DeflaterOutputStream to implement + /// flush(). + /// + public void Flush() + { + state |= IS_FLUSHING; + } + + /// + /// Finishes the deflater with the current input block. It is an error + /// to give more input after this method was called. This method must + /// be called to force all bytes to be flushed. + /// + public void Finish() + { + state |= (IS_FLUSHING | IS_FINISHING); + } + + /// + /// Returns true if the stream was finished and no more output bytes + /// are available. + /// + public bool IsFinished + { + get + { + return (state == FINISHED_STATE) && pending.IsFlushed; + } + } + + /// + /// Returns true, if the input buffer is empty. + /// You should then call setInput(). + /// NOTE: This method can also return true when the stream + /// was finished. + /// + public bool IsNeedingInput + { + get + { + return engine.NeedsInput(); + } + } + + /// + /// Sets the data which should be compressed next. This should be only + /// called when needsInput indicates that more input is needed. + /// If you call setInput when needsInput() returns false, the + /// previous input that is still pending will be thrown away. + /// The given byte array should not be changed, before needsInput() returns + /// true again. + /// This call is equivalent to setInput(input, 0, input.length). + /// + /// + /// the buffer containing the input data. + /// + /// + /// if the buffer was finished() or ended(). + /// + public void SetInput(byte[] input) + { + SetInput(input, 0, input.Length); + } + + /// + /// Sets the data which should be compressed next. This should be + /// only called when needsInput indicates that more input is needed. + /// The given byte array should not be changed, before needsInput() returns + /// true again. + /// + /// + /// the buffer containing the input data. + /// + /// + /// the start of the data. + /// + /// + /// the number of data bytes of input. + /// + /// + /// if the buffer was Finish()ed or if previous input is still pending. + /// + public void SetInput(byte[] input, int offset, int count) + { + if ((state & IS_FINISHING) != 0) + { + throw new InvalidOperationException("Finish() already called"); + } + engine.SetInput(input, offset, count); + } + + /// + /// Sets the compression level. There is no guarantee of the exact + /// position of the change, but if you call this when needsInput is + /// true the change of compression level will occur somewhere near + /// before the end of the so far given input. + /// + /// + /// the new compression level. + /// + public void SetLevel(int level) + { + if (level == DEFAULT_COMPRESSION) + { + level = 6; + } + else if (level < NO_COMPRESSION || level > BEST_COMPRESSION) + { + throw new ArgumentOutOfRangeException("level"); + } + + if (this.level != level) + { + this.level = level; + engine.SetLevel(level); + } + } + + /// + /// Get current compression level + /// + /// Returns the current compression level + public int GetLevel() + { + return level; + } + + /// + /// Sets the compression strategy. Strategy is one of + /// DEFAULT_STRATEGY, HUFFMAN_ONLY and FILTERED. For the exact + /// position where the strategy is changed, the same as for + /// SetLevel() applies. + /// + /// + /// The new compression strategy. + /// + public void SetStrategy(DeflateStrategy strategy) + { + engine.Strategy = strategy; + } + + /// + /// Deflates the current input block with to the given array. + /// + /// + /// The buffer where compressed data is stored + /// + /// + /// The number of compressed bytes added to the output, or 0 if either + /// IsNeedingInput() or IsFinished returns true or length is zero. + /// + public int Deflate(byte[] output) + { + return Deflate(output, 0, output.Length); + } + + /// + /// Deflates the current input block to the given array. + /// + /// + /// Buffer to store the compressed data. + /// + /// + /// Offset into the output array. + /// + /// + /// The maximum number of bytes that may be stored. + /// + /// + /// The number of compressed bytes added to the output, or 0 if either + /// needsInput() or finished() returns true or length is zero. + /// + /// + /// If Finish() was previously called. + /// + /// + /// If offset or length don't match the array length. + /// + public int Deflate(byte[] output, int offset, int length) + { + int origLength = length; + + if (state == CLOSED_STATE) + { + throw new InvalidOperationException("Deflater closed"); + } + + if (state < BUSY_STATE) + { + // output header + int header = (DEFLATED + + ((DeflaterConstants.MAX_WBITS - 8) << 4)) << 8; + int level_flags = (level - 1) >> 1; + if (level_flags < 0 || level_flags > 3) + { + level_flags = 3; + } + header |= level_flags << 6; + if ((state & IS_SETDICT) != 0) + { + // Dictionary was set + header |= DeflaterConstants.PRESET_DICT; + } + header += 31 - (header % 31); + + pending.WriteShortMSB(header); + if ((state & IS_SETDICT) != 0) + { + int chksum = engine.Adler; + engine.ResetAdler(); + pending.WriteShortMSB(chksum >> 16); + pending.WriteShortMSB(chksum & 0xffff); + } + + state = BUSY_STATE | (state & (IS_FLUSHING | IS_FINISHING)); + } + + for (; ; ) + { + int count = pending.Flush(output, offset, length); + offset += count; + totalOut += count; + length -= count; + + if (length == 0 || state == FINISHED_STATE) + { + break; + } + + if (!engine.Deflate((state & IS_FLUSHING) != 0, (state & IS_FINISHING) != 0)) + { + if (state == BUSY_STATE) + { + // We need more input now + return origLength - length; + } + else if (state == FLUSHING_STATE) + { + if (level != NO_COMPRESSION) + { + /* We have to supply some lookahead. 8 bit lookahead + * is needed by the zlib inflater, and we must fill + * the next byte, so that all bits are flushed. + */ + int neededbits = 8 + ((-pending.BitCount) & 7); + while (neededbits > 0) + { + /* write a static tree block consisting solely of + * an EOF: + */ + pending.WriteBits(2, 10); + neededbits -= 10; + } + } + state = BUSY_STATE; + } + else if (state == FINISHING_STATE) + { + pending.AlignToByte(); + + // Compressed data is complete. Write footer information if required. + if (!noZlibHeaderOrFooter) + { + int adler = engine.Adler; + pending.WriteShortMSB(adler >> 16); + pending.WriteShortMSB(adler & 0xffff); + } + state = FINISHED_STATE; + } + } + } + return origLength - length; + } + + /// + /// Sets the dictionary which should be used in the deflate process. + /// This call is equivalent to setDictionary(dict, 0, dict.Length). + /// + /// + /// the dictionary. + /// + /// + /// if SetInput () or Deflate () were already called or another dictionary was already set. + /// + public void SetDictionary(byte[] dictionary) + { + SetDictionary(dictionary, 0, dictionary.Length); + } + + /// + /// Sets the dictionary which should be used in the deflate process. + /// The dictionary is a byte array containing strings that are + /// likely to occur in the data which should be compressed. The + /// dictionary is not stored in the compressed output, only a + /// checksum. To decompress the output you need to supply the same + /// dictionary again. + /// + /// + /// The dictionary data + /// + /// + /// The index where dictionary information commences. + /// + /// + /// The number of bytes in the dictionary. + /// + /// + /// If SetInput () or Deflate() were already called or another dictionary was already set. + /// + public void SetDictionary(byte[] dictionary, int index, int count) + { + if (state != INIT_STATE) + { + throw new InvalidOperationException(); + } + + state = SETDICT_STATE; + engine.SetDictionary(dictionary, index, count); + } + + #region Instance Fields + /// + /// Compression level. + /// + int level; + + /// + /// If true no Zlib/RFC1950 headers or footers are generated + /// + bool noZlibHeaderOrFooter; + + /// + /// The current state. + /// + int state; + + /// + /// The total bytes of output written. + /// + long totalOut; + + /// + /// The pending output. + /// + DeflaterPending pending; + + /// + /// The deflater engine. + /// + DeflaterEngine engine; + #endregion + } +} diff --git a/PdfSharp/SharpZipLib/Zip/Compression/DeflaterConstants.cs b/PdfSharp/SharpZipLib/Zip/Compression/DeflaterConstants.cs new file mode 100644 index 0000000..f638abc --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/Compression/DeflaterConstants.cs @@ -0,0 +1,191 @@ +// DeflaterConstants.cs +// +// Copyright (C) 2001 Mike Krueger +// Copyright (C) 2004 John Reilly +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; + +namespace PdfSharp.SharpZipLib.Zip.Compression +{ + + /// + /// This class contains constants used for deflation. + /// + internal class DeflaterConstants + { + /// + /// Set to true to enable debugging + /// + public static bool DEBUGGING + { + // Prevent warning 'CS0162: Unreachable code detected' when referencing DEBUGGING + get { return false; } + } + //public const bool DEBUGGING = false; + + /// + /// Written to Zip file to identify a stored block + /// + public const int STORED_BLOCK = 0; + + /// + /// Identifies static tree in Zip file + /// + public const int STATIC_TREES = 1; + + /// + /// Identifies dynamic tree in Zip file + /// + public const int DYN_TREES = 2; + + /// + /// Header flag indicating a preset dictionary for deflation + /// + public const int PRESET_DICT = 0x20; + + /// + /// Sets internal buffer sizes for Huffman encoding + /// + public const int DEFAULT_MEM_LEVEL = 8; + + /// + /// Internal compression engine constant + /// + public const int MAX_MATCH = 258; + + /// + /// Internal compression engine constant + /// + public const int MIN_MATCH = 3; + + /// + /// Internal compression engine constant + /// + public const int MAX_WBITS = 15; + + /// + /// Internal compression engine constant + /// + public const int WSIZE = 1 << MAX_WBITS; + + /// + /// Internal compression engine constant + /// + public const int WMASK = WSIZE - 1; + + /// + /// Internal compression engine constant + /// + public const int HASH_BITS = DEFAULT_MEM_LEVEL + 7; + + /// + /// Internal compression engine constant + /// + public const int HASH_SIZE = 1 << HASH_BITS; + + /// + /// Internal compression engine constant + /// + public const int HASH_MASK = HASH_SIZE - 1; + + /// + /// Internal compression engine constant + /// + public const int HASH_SHIFT = (HASH_BITS + MIN_MATCH - 1) / MIN_MATCH; + + /// + /// Internal compression engine constant + /// + public const int MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; + + /// + /// Internal compression engine constant + /// + public const int MAX_DIST = WSIZE - MIN_LOOKAHEAD; + + /// + /// Internal compression engine constant + /// + public const int PENDING_BUF_SIZE = 1 << (DEFAULT_MEM_LEVEL + 8); + + /// + /// Internal compression engine constant + /// + public static int MAX_BLOCK_SIZE = Math.Min(65535, PENDING_BUF_SIZE - 5); + + /// + /// Internal compression engine constant + /// + public const int DEFLATE_STORED = 0; + + /// + /// Internal compression engine constant + /// + public const int DEFLATE_FAST = 1; + + /// + /// Internal compression engine constant + /// + public const int DEFLATE_SLOW = 2; + + /// + /// Internal compression engine constant + /// + public static int[] GOOD_LENGTH = { 0, 4, 4, 4, 4, 8, 8, 8, 32, 32 }; + + /// + /// Internal compression engine constant + /// + public static int[] MAX_LAZY = { 0, 4, 5, 6, 4, 16, 16, 32, 128, 258 }; + + /// + /// Internal compression engine constant + /// + public static int[] NICE_LENGTH = { 0, 8, 16, 32, 16, 32, 128, 128, 258, 258 }; + + /// + /// Internal compression engine constant + /// + public static int[] MAX_CHAIN = { 0, 4, 8, 32, 16, 32, 128, 256, 1024, 4096 }; + + /// + /// Internal compression engine constant + /// + public static int[] COMPR_FUNC = { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2 }; + + } +} diff --git a/PdfSharp/SharpZipLib/Zip/Compression/DeflaterEngine.cs b/PdfSharp/SharpZipLib/Zip/Compression/DeflaterEngine.cs new file mode 100644 index 0000000..ea03bce --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/Compression/DeflaterEngine.cs @@ -0,0 +1,926 @@ +// DeflaterEngine.cs +// +// Copyright (C) 2001 Mike Krueger +// Copyright (C) 2004 John Reilly +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; +using PdfSharp.SharpZipLib.Checksums; + +// ReSharper disable RedundantThisQualifier + +namespace PdfSharp.SharpZipLib.Zip.Compression +{ + + /// + /// Strategies for deflater + /// + internal enum DeflateStrategy + { + /// + /// The default strategy + /// + Default = 0, + + /// + /// This strategy will only allow longer string repetitions. It is + /// useful for random data with a small character set. + /// + Filtered = 1, + + + /// + /// This strategy will not look for string repetitions at all. It + /// only encodes with Huffman trees (which means, that more common + /// characters get a smaller encoding. + /// + HuffmanOnly = 2 + } + + // DEFLATE ALGORITHM: + // + // The uncompressed stream is inserted into the window array. When + // the window array is full the first half is thrown away and the + // second half is copied to the beginning. + // + // The head array is a hash table. Three characters build a hash value + // and they the value points to the corresponding index in window of + // the last string with this hash. The prev array implements a + // linked list of matches with the same hash: prev[index & WMASK] points + // to the previous index with the same hash. + // + + + /// + /// Low level compression engine for deflate algorithm which uses a 32K sliding window + /// with secondary compression from Huffman/Shannon-Fano codes. + /// + internal class DeflaterEngine : DeflaterConstants + { + #region Constants + const int TooFar = 4096; + #endregion + + #region Constructors + /// + /// Construct instance with pending buffer + /// + /// + /// Pending buffer to use + /// > + public DeflaterEngine(DeflaterPending pending) + { + this.pending = pending; + huffman = new DeflaterHuffman(pending); + adler = new Adler32(); + + window = new byte[2 * WSIZE]; + head = new short[HASH_SIZE]; + prev = new short[WSIZE]; + + // We start at index 1, to avoid an implementation deficiency, that + // we cannot build a repeat pattern at index 0. + blockStart = strstart = 1; + } + + #endregion + + /// + /// Deflate drives actual compression of data + /// + /// True to flush input buffers + /// Finish deflation with the current input. + /// Returns true if progress has been made. + public bool Deflate(bool flush, bool finish) + { + bool progress; + do + { + FillWindow(); + bool canFlush = flush && (inputOff == inputEnd); + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) { + Console.WriteLine("window: [" + blockStart + "," + strstart + "," + + lookahead + "], " + compressionFunction + "," + canFlush); + } +#endif + switch (compressionFunction) + { + case DEFLATE_STORED: + progress = DeflateStored(canFlush, finish); + break; + case DEFLATE_FAST: + progress = DeflateFast(canFlush, finish); + break; + case DEFLATE_SLOW: + progress = DeflateSlow(canFlush, finish); + break; + default: + throw new InvalidOperationException("unknown compressionFunction"); + } + } while (pending.IsFlushed && progress); // repeat while we have no pending output and progress was made + return progress; + } + + /// + /// Sets input data to be deflated. Should only be called when NeedsInput() + /// returns true + /// + /// The buffer containing input data. + /// The offset of the first byte of data. + /// The number of bytes of data to use as input. + public void SetInput(byte[] buffer, int offset, int count) + { + if (buffer == null) + { + throw new ArgumentNullException("buffer"); + } + + if (offset < 0) + { + throw new ArgumentOutOfRangeException("offset"); + } + + if (count < 0) + { + throw new ArgumentOutOfRangeException("count"); + } + + if (inputOff < inputEnd) + { + throw new InvalidOperationException("Old input was not completely processed"); + } + + int end = offset + count; + + /* We want to throw an ArrayIndexOutOfBoundsException early. The + * check is very tricky: it also handles integer wrap around. + */ + if ((offset > end) || (end > buffer.Length)) + { + throw new ArgumentOutOfRangeException("count"); + } + + inputBuf = buffer; + inputOff = offset; + inputEnd = end; + } + + /// + /// Determines if more input is needed. + /// + /// Return true if input is needed via SetInput + public bool NeedsInput() + { + return (inputEnd == inputOff); + } + + /// + /// Set compression dictionary + /// + /// The buffer containing the dictionary data + /// The offset in the buffer for the first byte of data + /// The length of the dictionary data. + public void SetDictionary(byte[] buffer, int offset, int length) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (strstart != 1) ) + { + throw new InvalidOperationException("strstart not 1"); + } +#endif + adler.Update(buffer, offset, length); + if (length < MIN_MATCH) + { + return; + } + + if (length > MAX_DIST) + { + offset += length - MAX_DIST; + length = MAX_DIST; + } + + System.Array.Copy(buffer, offset, window, strstart, length); + + UpdateHash(); + --length; + while (--length > 0) + { + InsertString(); + strstart++; + } + strstart += 2; + blockStart = strstart; + } + + /// + /// Reset internal state + /// + public void Reset() + { + huffman.Reset(); + adler.Reset(); + blockStart = strstart = 1; + lookahead = 0; + totalIn = 0; + prevAvailable = false; + matchLen = MIN_MATCH - 1; + + for (int i = 0; i < HASH_SIZE; i++) + { + head[i] = 0; + } + + for (int i = 0; i < WSIZE; i++) + { + prev[i] = 0; + } + } + + /// + /// Reset Adler checksum + /// + public void ResetAdler() + { + adler.Reset(); + } + + /// + /// Get current value of Adler checksum + /// + public int Adler + { + get + { + return unchecked((int)adler.Value); + } + } + + /// + /// Total data processed + /// + public long TotalIn + { + get + { + return totalIn; + } + } + + /// + /// Get/set the deflate strategy + /// + public DeflateStrategy Strategy + { + get + { + return strategy; + } + set + { + strategy = value; + } + } + + /// + /// Set the deflate level (0-9) + /// + /// The value to set the level to. + public void SetLevel(int level) + { + if ((level < 0) || (level > 9)) + { + throw new ArgumentOutOfRangeException("level"); + } + + goodLength = DeflaterConstants.GOOD_LENGTH[level]; + max_lazy = DeflaterConstants.MAX_LAZY[level]; + niceLength = DeflaterConstants.NICE_LENGTH[level]; + max_chain = DeflaterConstants.MAX_CHAIN[level]; + + if (DeflaterConstants.COMPR_FUNC[level] != compressionFunction) + { + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) { + Console.WriteLine("Change from " + compressionFunction + " to " + + DeflaterConstants.COMPR_FUNC[level]); + } +#endif + switch (compressionFunction) + { + case DEFLATE_STORED: + if (strstart > blockStart) + { + huffman.FlushStoredBlock(window, blockStart, + strstart - blockStart, false); + blockStart = strstart; + } + UpdateHash(); + break; + + case DEFLATE_FAST: + if (strstart > blockStart) + { + huffman.FlushBlock(window, blockStart, strstart - blockStart, + false); + blockStart = strstart; + } + break; + + case DEFLATE_SLOW: + if (prevAvailable) + { + huffman.TallyLit(window[strstart - 1] & 0xff); + } + if (strstart > blockStart) + { + huffman.FlushBlock(window, blockStart, strstart - blockStart, false); + blockStart = strstart; + } + prevAvailable = false; + matchLen = MIN_MATCH - 1; + break; + } + compressionFunction = COMPR_FUNC[level]; + } + } + + /// + /// Fill the window + /// + public void FillWindow() + { + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (strstart >= WSIZE + MAX_DIST) + { + SlideWindow(); + } + + /* If there is not enough lookahead, but still some input left, + * read in the input + */ + while (lookahead < DeflaterConstants.MIN_LOOKAHEAD && inputOff < inputEnd) + { + int more = 2 * WSIZE - lookahead - strstart; + + if (more > inputEnd - inputOff) + { + more = inputEnd - inputOff; + } + + System.Array.Copy(inputBuf, inputOff, window, strstart + lookahead, more); + adler.Update(inputBuf, inputOff, more); + + inputOff += more; + totalIn += more; + lookahead += more; + } + + if (lookahead >= MIN_MATCH) + { + UpdateHash(); + } + } + + void UpdateHash() + { + /* + if (DEBUGGING) { + Console.WriteLine("updateHash: "+strstart); + } + */ + ins_h = (window[strstart] << HASH_SHIFT) ^ window[strstart + 1]; + } + + /// + /// Inserts the current string in the head hash and returns the previous + /// value for this hash. + /// + /// The previous hash value + int InsertString() + { + short match; + int hash = ((ins_h << HASH_SHIFT) ^ window[strstart + (MIN_MATCH - 1)]) & HASH_MASK; + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) + { + if (hash != (((window[strstart] << (2*HASH_SHIFT)) ^ + (window[strstart + 1] << HASH_SHIFT) ^ + (window[strstart + 2])) & HASH_MASK)) { + throw new SharpZipBaseException("hash inconsistent: " + hash + "/" + +window[strstart] + "," + +window[strstart + 1] + "," + +window[strstart + 2] + "," + HASH_SHIFT); + } + } +#endif + prev[strstart & WMASK] = match = head[hash]; + head[hash] = unchecked((short)strstart); + ins_h = hash; + return match & 0xffff; + } + + void SlideWindow() + { + Array.Copy(window, WSIZE, window, 0, WSIZE); + matchStart -= WSIZE; + strstart -= WSIZE; + blockStart -= WSIZE; + + // Slide the hash table (could be avoided with 32 bit values + // at the expense of memory usage). + for (int i = 0; i < HASH_SIZE; ++i) + { + int m = head[i] & 0xffff; + head[i] = (short)(m >= WSIZE ? (m - WSIZE) : 0); + } + + // Slide the prev table. + for (int i = 0; i < WSIZE; i++) + { + int m = prev[i] & 0xffff; + prev[i] = (short)(m >= WSIZE ? (m - WSIZE) : 0); + } + } + + /// + /// Find the best (longest) string in the window matching the + /// string starting at strstart. + /// + /// Preconditions: + /// + /// strstart + MAX_MATCH <= window.length. + /// + /// + /// True if a match greater than the minimum length is found + bool FindLongestMatch(int curMatch) + { + int chainLength = this.max_chain; + int niceLength = this.niceLength; + short[] prev = this.prev; + int scan = this.strstart; + int match; + int best_end = this.strstart + matchLen; + int best_len = Math.Max(matchLen, MIN_MATCH - 1); + + int limit = Math.Max(strstart - MAX_DIST, 0); + + int strend = strstart + MAX_MATCH - 1; + byte scan_end1 = window[best_end - 1]; + byte scan_end = window[best_end]; + + // Do not waste too much time if we already have a good match: + if (best_len >= this.goodLength) + { + chainLength >>= 2; + } + + /* Do not look for matches beyond the end of the input. This is necessary + * to make deflate deterministic. + */ + if (niceLength > lookahead) + { + niceLength = lookahead; + } + +#if DebugDeflation + + if (DeflaterConstants.DEBUGGING && (strstart > 2 * WSIZE - MIN_LOOKAHEAD)) + { + throw new InvalidOperationException("need lookahead"); + } +#endif + + do + { + +#if DebugDeflation + + if (DeflaterConstants.DEBUGGING && (curMatch >= strstart) ) + { + throw new InvalidOperationException("no future"); + } +#endif + if (window[curMatch + best_len] != scan_end || + window[curMatch + best_len - 1] != scan_end1 || + window[curMatch] != window[scan] || + window[curMatch + 1] != window[scan + 1]) + { + continue; + } + + match = curMatch + 2; + scan += 2; + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart + 258. + */ + while ( + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + (scan < strend)) + { + // Do nothing + } + + if (scan > best_end) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (ins_h == 0) ) + Console.Error.WriteLine("Found match: " + curMatch + "-" + (scan - strstart)); +#endif + matchStart = curMatch; + best_end = scan; + best_len = scan - strstart; + + if (best_len >= niceLength) + { + break; + } + + scan_end1 = window[best_end - 1]; + scan_end = window[best_end]; + } + scan = strstart; + } while ((curMatch = (prev[curMatch & WMASK] & 0xffff)) > limit && --chainLength != 0); + + matchLen = Math.Min(best_len, lookahead); + return matchLen >= MIN_MATCH; + } + + bool DeflateStored(bool flush, bool finish) + { + if (!flush && (lookahead == 0)) + { + return false; + } + + strstart += lookahead; + lookahead = 0; + + int storedLength = strstart - blockStart; + + if ((storedLength >= DeflaterConstants.MAX_BLOCK_SIZE) || // Block is full + (blockStart < WSIZE && storedLength >= MAX_DIST) || // Block may move out of window + flush) + { + bool lastBlock = finish; + if (storedLength > DeflaterConstants.MAX_BLOCK_SIZE) + { + storedLength = DeflaterConstants.MAX_BLOCK_SIZE; + lastBlock = false; + } + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) + { + Console.WriteLine("storedBlock[" + storedLength + "," + lastBlock + "]"); + } +#endif + + huffman.FlushStoredBlock(window, blockStart, storedLength, lastBlock); + blockStart += storedLength; + return !lastBlock; + } + return true; + } + + bool DeflateFast(bool flush, bool finish) + { + if (lookahead < MIN_LOOKAHEAD && !flush) + { + return false; + } + + while (lookahead >= MIN_LOOKAHEAD || flush) + { + if (lookahead == 0) + { + // We are flushing everything + huffman.FlushBlock(window, blockStart, strstart - blockStart, finish); + blockStart = strstart; + return false; + } + + if (strstart > 2 * WSIZE - MIN_LOOKAHEAD) + { + /* slide window, as FindLongestMatch needs this. + * This should only happen when flushing and the window + * is almost full. + */ + SlideWindow(); + } + + int hashHead; + if (lookahead >= MIN_MATCH && + (hashHead = InsertString()) != 0 && + strategy != DeflateStrategy.HuffmanOnly && + strstart - hashHead <= MAX_DIST && + FindLongestMatch(hashHead)) + { + // longestMatch sets matchStart and matchLen +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) + { + for (int i = 0 ; i < matchLen; i++) { + if (window[strstart + i] != window[matchStart + i]) { + throw new SharpZipBaseException("Match failure"); + } + } + } +#endif + + bool full = huffman.TallyDist(strstart - matchStart, matchLen); + + lookahead -= matchLen; + if (matchLen <= max_lazy && lookahead >= MIN_MATCH) + { + while (--matchLen > 0) + { + ++strstart; + InsertString(); + } + ++strstart; + } + else + { + strstart += matchLen; + if (lookahead >= MIN_MATCH - 1) + { + UpdateHash(); + } + } + matchLen = MIN_MATCH - 1; + if (!full) + { + continue; + } + } + else + { + // No match found + huffman.TallyLit(window[strstart] & 0xff); + ++strstart; + --lookahead; + } + + if (huffman.IsFull()) + { + bool lastBlock = finish && (lookahead == 0); + huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock); + blockStart = strstart; + return !lastBlock; + } + } + return true; + } + + bool DeflateSlow(bool flush, bool finish) + { + if (lookahead < MIN_LOOKAHEAD && !flush) + { + return false; + } + + while (lookahead >= MIN_LOOKAHEAD || flush) + { + if (lookahead == 0) + { + if (prevAvailable) + { + huffman.TallyLit(window[strstart - 1] & 0xff); + } + prevAvailable = false; + + // We are flushing everything +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && !flush) + { + throw new SharpZipBaseException("Not flushing, but no lookahead"); + } +#endif + huffman.FlushBlock(window, blockStart, strstart - blockStart, + finish); + blockStart = strstart; + return false; + } + + if (strstart >= 2 * WSIZE - MIN_LOOKAHEAD) + { + /* slide window, as FindLongestMatch needs this. + * This should only happen when flushing and the window + * is almost full. + */ + SlideWindow(); + } + + int prevMatch = matchStart; + int prevLen = matchLen; + if (lookahead >= MIN_MATCH) + { + + int hashHead = InsertString(); + + if (strategy != DeflateStrategy.HuffmanOnly && + hashHead != 0 && + strstart - hashHead <= MAX_DIST && + FindLongestMatch(hashHead)) + { + + // longestMatch sets matchStart and matchLen + + // Discard match if too small and too far away + if (matchLen <= 5 && (strategy == DeflateStrategy.Filtered || (matchLen == MIN_MATCH && strstart - matchStart > TooFar))) + { + matchLen = MIN_MATCH - 1; + } + } + } + + // previous match was better + if ((prevLen >= MIN_MATCH) && (matchLen <= prevLen)) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) + { + for (int i = 0 ; i < matchLen; i++) { + if (window[strstart-1+i] != window[prevMatch + i]) + throw new SharpZipBaseException(); + } + } +#endif + huffman.TallyDist(strstart - 1 - prevMatch, prevLen); + prevLen -= 2; + do + { + strstart++; + lookahead--; + if (lookahead >= MIN_MATCH) + { + InsertString(); + } + } while (--prevLen > 0); + + strstart++; + lookahead--; + prevAvailable = false; + matchLen = MIN_MATCH - 1; + } + else + { + if (prevAvailable) + { + huffman.TallyLit(window[strstart - 1] & 0xff); + } + prevAvailable = true; + strstart++; + lookahead--; + } + + if (huffman.IsFull()) + { + int len = strstart - blockStart; + if (prevAvailable) + { + len--; + } + bool lastBlock = (finish && (lookahead == 0) && !prevAvailable); + huffman.FlushBlock(window, blockStart, len, lastBlock); + blockStart += len; + return !lastBlock; + } + } + return true; + } + + #region Instance Fields + + // Hash index of string to be inserted + int ins_h; + + /// + /// Hashtable, hashing three characters to an index for window, so + /// that window[index]..window[index+2] have this hash code. + /// Note that the array should really be unsigned short, so you need + /// to and the values with 0xffff. + /// + short[] head; + + /// + /// prev[index & WMASK] points to the previous index that has the + /// same hash code as the string starting at index. This way + /// entries with the same hash code are in a linked list. + /// Note that the array should really be unsigned short, so you need + /// to and the values with 0xffff. + /// + short[] prev; + + int matchStart; + // Length of best match + int matchLen; + // Set if previous match exists + bool prevAvailable; + int blockStart; + + /// + /// Points to the current character in the window. + /// + int strstart; + + /// + /// lookahead is the number of characters starting at strstart in + /// window that are valid. + /// So window[strstart] until window[strstart+lookahead-1] are valid + /// characters. + /// + int lookahead; + + /// + /// This array contains the part of the uncompressed stream that + /// is of relevance. The current character is indexed by strstart. + /// + byte[] window; + + DeflateStrategy strategy; + int max_chain, max_lazy, niceLength, goodLength; + + /// + /// The current compression function. + /// + int compressionFunction; + + /// + /// The input data for compression. + /// + byte[] inputBuf; + + /// + /// The total bytes of input read. + /// + long totalIn; + + /// + /// The offset into inputBuf, where input data starts. + /// + int inputOff; + + /// + /// The end offset of the input data. + /// + int inputEnd; + + DeflaterPending pending; + DeflaterHuffman huffman; + + /// + /// The adler checksum + /// + Adler32 adler; + #endregion + } +} diff --git a/PdfSharp/SharpZipLib/Zip/Compression/DeflaterHuffman.cs b/PdfSharp/SharpZipLib/Zip/Compression/DeflaterHuffman.cs new file mode 100644 index 0000000..31b4cf6 --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/Compression/DeflaterHuffman.cs @@ -0,0 +1,999 @@ +// DeflaterHuffman.cs +// +// Copyright (C) 2001 Mike Krueger +// Copyright (C) 2004 John Reilly +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; + +// ReSharper disable RedundantThisQualifier + +namespace PdfSharp.SharpZipLib.Zip.Compression +{ + + /// + /// This is the DeflaterHuffman class. + /// + /// This class is not thread safe. This is inherent in the API, due + /// to the split of Deflate and SetInput. + /// + /// author of the original java version : Jochen Hoenicke + /// + internal class DeflaterHuffman + { + const int BUFSIZE = 1 << (DeflaterConstants.DEFAULT_MEM_LEVEL + 6); + const int LITERAL_NUM = 286; + + // Number of distance codes + const int DIST_NUM = 30; + // Number of codes used to transfer bit lengths + const int BITLEN_NUM = 19; + + // repeat previous bit length 3-6 times (2 bits of repeat count) + const int REP_3_6 = 16; + // repeat a zero length 3-10 times (3 bits of repeat count) + const int REP_3_10 = 17; + // repeat a zero length 11-138 times (7 bits of repeat count) + const int REP_11_138 = 18; + + const int EOF_SYMBOL = 256; + + // The lengths of the bit length codes are sent in order of decreasing + // probability, to avoid transmitting the lengths for unused bit length codes. + static readonly int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + + static readonly byte[] bit4Reverse = { + 0, + 8, + 4, + 12, + 2, + 10, + 6, + 14, + 1, + 9, + 5, + 13, + 3, + 11, + 7, + 15 + }; + + static short[] staticLCodes; + static byte[] staticLLength; + static short[] staticDCodes; + static byte[] staticDLength; + + class Tree + { + #region Instance Fields + public short[] freqs; + + public byte[] length; + + public int minNumCodes; + + public int numCodes; + + short[] codes; + int[] bl_counts; + int maxLength; + DeflaterHuffman dh; + #endregion + + #region Constructors + public Tree(DeflaterHuffman dh, int elems, int minCodes, int maxLength) + { + this.dh = dh; + this.minNumCodes = minCodes; + this.maxLength = maxLength; + freqs = new short[elems]; + bl_counts = new int[maxLength]; + } + + #endregion + + /// + /// Resets the internal state of the tree + /// + public void Reset() + { + for (int i = 0; i < freqs.Length; i++) + { + freqs[i] = 0; + } + codes = null; + length = null; + } + + public void WriteSymbol(int code) + { + // if (DeflaterConstants.DEBUGGING) { + // freqs[code]--; + // // Console.Write("writeSymbol("+freqs.length+","+code+"): "); + // } + dh.pending.WriteBits(codes[code] & 0xffff, length[code]); + } + + /// + /// Check that all frequencies are zero + /// + /// + /// At least one frequency is non-zero + /// + public void CheckEmpty() + { + bool empty = true; + for (int i = 0; i < freqs.Length; i++) + { + if (freqs[i] != 0) + { + //Console.WriteLine("freqs[" + i + "] == " + freqs[i]); + empty = false; + } + } + + if (!empty) + { + throw new SharpZipBaseException("!Empty"); + } + } + + /// + /// Set static codes and length + /// + /// new codes + /// length for new codes + public void SetStaticCodes(short[] staticCodes, byte[] staticLengths) + { + codes = staticCodes; + length = staticLengths; + } + + /// + /// Build dynamic codes and lengths + /// + public void BuildCodes() + { + int numSymbols = freqs.Length; + int[] nextCode = new int[maxLength]; + int code = 0; + + codes = new short[freqs.Length]; + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("buildCodes: "+freqs.Length); + // } + + for (int bits = 0; bits < maxLength; bits++) + { + nextCode[bits] = code; + code += bl_counts[bits] << (15 - bits); + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("bits: " + ( bits + 1) + " count: " + bl_counts[bits] + // +" nextCode: "+code); + // } + } + +#if DebugDeflation + if ( DeflaterConstants.DEBUGGING && (code != 65536) ) + { + throw new SharpZipBaseException("Inconsistent bl_counts!"); + } +#endif + for (int i = 0; i < numCodes; i++) + { + int bits = length[i]; + if (bits > 0) + { + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("codes["+i+"] = rev(" + nextCode[bits-1]+"), + // +bits); + // } + + codes[i] = BitReverse(nextCode[bits - 1]); + nextCode[bits - 1] += 1 << (16 - bits); + } + } + } + + public void BuildTree() + { + int numSymbols = freqs.Length; + + /* heap is a priority queue, sorted by frequency, least frequent + * nodes first. The heap is a binary tree, with the property, that + * the parent node is smaller than both child nodes. This assures + * that the smallest node is the first parent. + * + * The binary tree is encoded in an array: 0 is root node and + * the nodes 2*n+1, 2*n+2 are the child nodes of node n. + */ + int[] heap = new int[numSymbols]; + int heapLen = 0; + int maxCode = 0; + for (int n = 0; n < numSymbols; n++) + { + int freq = freqs[n]; + if (freq != 0) + { + // Insert n into heap + int pos = heapLen++; + int ppos; + while (pos > 0 && freqs[heap[ppos = (pos - 1) / 2]] > freq) + { + heap[pos] = heap[ppos]; + pos = ppos; + } + heap[pos] = n; + + maxCode = n; + } + } + + /* We could encode a single literal with 0 bits but then we + * don't see the literals. Therefore we force at least two + * literals to avoid this case. We don't care about order in + * this case, both literals get a 1 bit code. + */ + while (heapLen < 2) + { + int node = maxCode < 2 ? ++maxCode : 0; + heap[heapLen++] = node; + } + + numCodes = Math.Max(maxCode + 1, minNumCodes); + + int numLeafs = heapLen; + int[] childs = new int[4 * heapLen - 2]; + int[] values = new int[2 * heapLen - 1]; + int numNodes = numLeafs; + for (int i = 0; i < heapLen; i++) + { + int node = heap[i]; + childs[2 * i] = node; + childs[2 * i + 1] = -1; + values[i] = freqs[node] << 8; + heap[i] = i; + } + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + do + { + int first = heap[0]; + int last = heap[--heapLen]; + + // Propagate the hole to the leafs of the heap + int ppos = 0; + int path = 1; + + while (path < heapLen) + { + if (path + 1 < heapLen && values[heap[path]] > values[heap[path + 1]]) + { + path++; + } + + heap[ppos] = heap[path]; + ppos = path; + path = path * 2 + 1; + } + + /* Now propagate the last element down along path. Normally + * it shouldn't go too deep. + */ + int lastVal = values[last]; + while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal) + { + heap[path] = heap[ppos]; + } + heap[path] = last; + + + int second = heap[0]; + + // Create a new node father of first and second + last = numNodes++; + childs[2 * last] = first; + childs[2 * last + 1] = second; + int mindepth = Math.Min(values[first] & 0xff, values[second] & 0xff); + values[last] = lastVal = values[first] + values[second] - mindepth + 1; + + // Again, propagate the hole to the leafs + ppos = 0; + path = 1; + + while (path < heapLen) + { + if (path + 1 < heapLen && values[heap[path]] > values[heap[path + 1]]) + { + path++; + } + + heap[ppos] = heap[path]; + ppos = path; + path = ppos * 2 + 1; + } + + // Now propagate the new element down along path + while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal) + { + heap[path] = heap[ppos]; + } + heap[path] = last; + } while (heapLen > 1); + + if (heap[0] != childs.Length / 2 - 1) + { + throw new SharpZipBaseException("Heap invariant violated"); + } + + BuildLength(childs); + } + + /// + /// Get encoded length + /// + /// Encoded length, the sum of frequencies * lengths + public int GetEncodedLength() + { + int len = 0; + for (int i = 0; i < freqs.Length; i++) + { + len += freqs[i] * length[i]; + } + return len; + } + + /// + /// Scan a literal or distance tree to determine the frequencies of the codes + /// in the bit length tree. + /// + public void CalcBLFreq(Tree blTree) + { + int max_count; /* max repeat count */ + int min_count; /* min repeat count */ + int count; /* repeat count of the current code */ + int curlen = -1; /* length of current code */ + + int i = 0; + while (i < numCodes) + { + count = 1; + int nextlen = length[i]; + if (nextlen == 0) + { + max_count = 138; + min_count = 3; + } + else + { + max_count = 6; + min_count = 3; + if (curlen != nextlen) + { + blTree.freqs[nextlen]++; + count = 0; + } + } + curlen = nextlen; + i++; + + while (i < numCodes && curlen == length[i]) + { + i++; + if (++count >= max_count) + { + break; + } + } + + if (count < min_count) + { + blTree.freqs[curlen] += (short)count; + } + else if (curlen != 0) + { + blTree.freqs[REP_3_6]++; + } + else if (count <= 10) + { + blTree.freqs[REP_3_10]++; + } + else + { + blTree.freqs[REP_11_138]++; + } + } + } + + /// + /// Write tree values + /// + /// Tree to write + public void WriteTree(Tree blTree) + { + int max_count; // max repeat count + int min_count; // min repeat count + int count; // repeat count of the current code + int curlen = -1; // length of current code + + int i = 0; + while (i < numCodes) + { + count = 1; + int nextlen = length[i]; + if (nextlen == 0) + { + max_count = 138; + min_count = 3; + } + else + { + max_count = 6; + min_count = 3; + if (curlen != nextlen) + { + blTree.WriteSymbol(nextlen); + count = 0; + } + } + curlen = nextlen; + i++; + + while (i < numCodes && curlen == length[i]) + { + i++; + if (++count >= max_count) + { + break; + } + } + + if (count < min_count) + { + while (count-- > 0) + { + blTree.WriteSymbol(curlen); + } + } + else if (curlen != 0) + { + blTree.WriteSymbol(REP_3_6); + dh.pending.WriteBits(count - 3, 2); + } + else if (count <= 10) + { + blTree.WriteSymbol(REP_3_10); + dh.pending.WriteBits(count - 3, 3); + } + else + { + blTree.WriteSymbol(REP_11_138); + dh.pending.WriteBits(count - 11, 7); + } + } + } + + void BuildLength(int[] childs) + { + this.length = new byte[freqs.Length]; + int numNodes = childs.Length / 2; + int numLeafs = (numNodes + 1) / 2; + int overflow = 0; + + for (int i = 0; i < maxLength; i++) + { + bl_counts[i] = 0; + } + + // First calculate optimal bit lengths + int[] lengths = new int[numNodes]; + lengths[numNodes - 1] = 0; + + for (int i = numNodes - 1; i >= 0; i--) + { + if (childs[2 * i + 1] != -1) + { + int bitLength = lengths[i] + 1; + if (bitLength > maxLength) + { + bitLength = maxLength; + overflow++; + } + lengths[childs[2 * i]] = lengths[childs[2 * i + 1]] = bitLength; + } + else + { + // A leaf node + int bitLength = lengths[i]; + bl_counts[bitLength - 1]++; + this.length[childs[2 * i]] = (byte)lengths[i]; + } + } + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("Tree "+freqs.Length+" lengths:"); + // for (int i=0; i < numLeafs; i++) { + // //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]] + // + " len: "+length[childs[2*i]]); + // } + // } + + if (overflow == 0) + { + return; + } + + int incrBitLen = maxLength - 1; + do + { + // Find the first bit length which could increase: + while (bl_counts[--incrBitLen] == 0) + ; + + // Move this node one down and remove a corresponding + // number of overflow nodes. + do + { + bl_counts[incrBitLen]--; + bl_counts[++incrBitLen]++; + overflow -= 1 << (maxLength - 1 - incrBitLen); + } while (overflow > 0 && incrBitLen < maxLength - 1); + } while (overflow > 0); + + /* We may have overshot above. Move some nodes from maxLength to + * maxLength-1 in that case. + */ + bl_counts[maxLength - 1] += overflow; + bl_counts[maxLength - 2] -= overflow; + + /* Now recompute all bit lengths, scanning in increasing + * frequency. It is simpler to reconstruct all lengths instead of + * fixing only the wrong ones. This idea is taken from 'ar' + * written by Haruhiko Okumura. + * + * The nodes were inserted with decreasing frequency into the childs + * array. + */ + int nodePtr = 2 * numLeafs; + for (int bits = maxLength; bits != 0; bits--) + { + int n = bl_counts[bits - 1]; + while (n > 0) + { + int childPtr = 2 * childs[nodePtr++]; + if (childs[childPtr + 1] == -1) + { + // We found another leaf + length[childs[childPtr]] = (byte)bits; + n--; + } + } + } + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("*** After overflow elimination. ***"); + // for (int i=0; i < numLeafs; i++) { + // //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]] + // + " len: "+length[childs[2*i]]); + // } + // } + } + + } + + #region Instance Fields + /// + /// Pending buffer to use + /// + public DeflaterPending pending; + + Tree literalTree; + Tree distTree; + Tree blTree; + + // Buffer for distances + short[] d_buf; + byte[] l_buf; + int last_lit; + int extra_bits; + #endregion + + static DeflaterHuffman() + { + // See RFC 1951 3.2.6 + // Literal codes + staticLCodes = new short[LITERAL_NUM]; + staticLLength = new byte[LITERAL_NUM]; + + int i = 0; + while (i < 144) + { + staticLCodes[i] = BitReverse((0x030 + i) << 8); + staticLLength[i++] = 8; + } + + while (i < 256) + { + staticLCodes[i] = BitReverse((0x190 - 144 + i) << 7); + staticLLength[i++] = 9; + } + + while (i < 280) + { + staticLCodes[i] = BitReverse((0x000 - 256 + i) << 9); + staticLLength[i++] = 7; + } + + while (i < LITERAL_NUM) + { + staticLCodes[i] = BitReverse((0x0c0 - 280 + i) << 8); + staticLLength[i++] = 8; + } + + // Distance codes + staticDCodes = new short[DIST_NUM]; + staticDLength = new byte[DIST_NUM]; + for (i = 0; i < DIST_NUM; i++) + { + staticDCodes[i] = BitReverse(i << 11); + staticDLength[i] = 5; + } + } + + /// + /// Construct instance with pending buffer + /// + /// Pending buffer to use + public DeflaterHuffman(DeflaterPending pending) + { + this.pending = pending; + + literalTree = new Tree(this, LITERAL_NUM, 257, 15); + distTree = new Tree(this, DIST_NUM, 1, 15); + blTree = new Tree(this, BITLEN_NUM, 4, 7); + + d_buf = new short[BUFSIZE]; + l_buf = new byte[BUFSIZE]; + } + + /// + /// Reset internal state + /// + public void Reset() + { + last_lit = 0; + extra_bits = 0; + literalTree.Reset(); + distTree.Reset(); + blTree.Reset(); + } + + /// + /// Write all trees to pending buffer + /// + /// The number/rank of treecodes to send. + public void SendAllTrees(int blTreeCodes) + { + blTree.BuildCodes(); + literalTree.BuildCodes(); + distTree.BuildCodes(); + pending.WriteBits(literalTree.numCodes - 257, 5); + pending.WriteBits(distTree.numCodes - 1, 5); + pending.WriteBits(blTreeCodes - 4, 4); + for (int rank = 0; rank < blTreeCodes; rank++) + { + pending.WriteBits(blTree.length[BL_ORDER[rank]], 3); + } + literalTree.WriteTree(blTree); + distTree.WriteTree(blTree); + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) { + blTree.CheckEmpty(); + } +#endif + } + + /// + /// Compress current buffer writing data to pending buffer + /// + public void CompressBlock() + { + for (int i = 0; i < last_lit; i++) + { + int litlen = l_buf[i] & 0xff; + int dist = d_buf[i]; + if (dist-- != 0) + { + // if (DeflaterConstants.DEBUGGING) { + // Console.Write("["+(dist+1)+","+(litlen+3)+"]: "); + // } + + int lc = Lcode(litlen); + literalTree.WriteSymbol(lc); + + int bits = (lc - 261) / 4; + if (bits > 0 && bits <= 5) + { + pending.WriteBits(litlen & ((1 << bits) - 1), bits); + } + + int dc = Dcode(dist); + distTree.WriteSymbol(dc); + + bits = dc / 2 - 1; + if (bits > 0) + { + pending.WriteBits(dist & ((1 << bits) - 1), bits); + } + } + else + { + // if (DeflaterConstants.DEBUGGING) { + // if (litlen > 32 && litlen < 127) { + // Console.Write("("+(char)litlen+"): "); + // } else { + // Console.Write("{"+litlen+"}: "); + // } + // } + literalTree.WriteSymbol(litlen); + } + } + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) { + Console.Write("EOF: "); + } +#endif + literalTree.WriteSymbol(EOF_SYMBOL); + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) { + literalTree.CheckEmpty(); + distTree.CheckEmpty(); + } +#endif + } + + /// + /// Flush block to output with no compression + /// + /// Data to write + /// Index of first byte to write + /// Count of bytes to write + /// True if this is the last block + public void FlushStoredBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) + { +#if DebugDeflation + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("Flushing stored block "+ storedLength); + // } +#endif + pending.WriteBits((DeflaterConstants.STORED_BLOCK << 1) + (lastBlock ? 1 : 0), 3); + pending.AlignToByte(); + pending.WriteShort(storedLength); + pending.WriteShort(~storedLength); + pending.WriteBlock(stored, storedOffset, storedLength); + Reset(); + } + + /// + /// Flush block to output with compression + /// + /// Data to flush + /// Index of first byte to flush + /// Count of bytes to flush + /// True if this is the last block + public void FlushBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) + { + literalTree.freqs[EOF_SYMBOL]++; + + // Build trees + literalTree.BuildTree(); + distTree.BuildTree(); + + // Calculate bitlen frequency + literalTree.CalcBLFreq(blTree); + distTree.CalcBLFreq(blTree); + + // Build bitlen tree + blTree.BuildTree(); + + int blTreeCodes = 4; + for (int i = 18; i > blTreeCodes; i--) + { + if (blTree.length[BL_ORDER[i]] > 0) + { + blTreeCodes = i + 1; + } + } + int opt_len = 14 + blTreeCodes * 3 + blTree.GetEncodedLength() + + literalTree.GetEncodedLength() + distTree.GetEncodedLength() + + extra_bits; + + int static_len = extra_bits; + for (int i = 0; i < LITERAL_NUM; i++) + { + static_len += literalTree.freqs[i] * staticLLength[i]; + } + for (int i = 0; i < DIST_NUM; i++) + { + static_len += distTree.freqs[i] * staticDLength[i]; + } + if (opt_len >= static_len) + { + // Force static trees + opt_len = static_len; + } + + if (storedOffset >= 0 && storedLength + 4 < opt_len >> 3) + { + // Store Block + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("Storing, since " + storedLength + " < " + opt_len + // + " <= " + static_len); + // } + FlushStoredBlock(stored, storedOffset, storedLength, lastBlock); + } + else if (opt_len == static_len) + { + // Encode with static tree + pending.WriteBits((DeflaterConstants.STATIC_TREES << 1) + (lastBlock ? 1 : 0), 3); + literalTree.SetStaticCodes(staticLCodes, staticLLength); + distTree.SetStaticCodes(staticDCodes, staticDLength); + CompressBlock(); + Reset(); + } + else + { + // Encode with dynamic tree + pending.WriteBits((DeflaterConstants.DYN_TREES << 1) + (lastBlock ? 1 : 0), 3); + SendAllTrees(blTreeCodes); + CompressBlock(); + Reset(); + } + } + + /// + /// Get value indicating if internal buffer is full + /// + /// true if buffer is full + public bool IsFull() + { + return last_lit >= BUFSIZE; + } + + /// + /// Add literal to buffer + /// + /// Literal value to add to buffer. + /// Value indicating internal buffer is full + public bool TallyLit(int literal) + { + // if (DeflaterConstants.DEBUGGING) { + // if (lit > 32 && lit < 127) { + // //Console.WriteLine("("+(char)lit+")"); + // } else { + // //Console.WriteLine("{"+lit+"}"); + // } + // } + d_buf[last_lit] = 0; + l_buf[last_lit++] = (byte)literal; + literalTree.freqs[literal]++; + return IsFull(); + } + + /// + /// Add distance code and length to literal and distance trees + /// + /// Distance code + /// Length + /// Value indicating if internal buffer is full + public bool TallyDist(int distance, int length) + { + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("[" + distance + "," + length + "]"); + // } + + d_buf[last_lit] = (short)distance; + l_buf[last_lit++] = (byte)(length - 3); + + int lc = Lcode(length - 3); + literalTree.freqs[lc]++; + if (lc >= 265 && lc < 285) + { + extra_bits += (lc - 261) / 4; + } + + int dc = Dcode(distance - 1); + distTree.freqs[dc]++; + if (dc >= 4) + { + extra_bits += dc / 2 - 1; + } + return IsFull(); + } + + + /// + /// Reverse the bits of a 16 bit value. + /// + /// Value to reverse bits + /// Value with bits reversed + public static short BitReverse(int toReverse) + { + return (short)(bit4Reverse[toReverse & 0xF] << 12 | + bit4Reverse[(toReverse >> 4) & 0xF] << 8 | + bit4Reverse[(toReverse >> 8) & 0xF] << 4 | + bit4Reverse[toReverse >> 12]); + } + + static int Lcode(int length) + { + if (length == 255) + { + return 285; + } + + int code = 257; + while (length >= 8) + { + code += 4; + length >>= 1; + } + return code + length; + } + + static int Dcode(int distance) + { + int code = 0; + while (distance >= 4) + { + code += 2; + distance >>= 1; + } + return code + distance; + } + } +} diff --git a/PdfSharp/SharpZipLib/Zip/Compression/DeflaterPending.cs b/PdfSharp/SharpZipLib/Zip/Compression/DeflaterPending.cs new file mode 100644 index 0000000..d3ac50e --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/Compression/DeflaterPending.cs @@ -0,0 +1,58 @@ +// DeflaterPending.cs +// +// Copyright (C) 2001 Mike Krueger +// Copyright (C) 2004 John Reilly +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +namespace PdfSharp.SharpZipLib.Zip.Compression +{ + + /// + /// This class stores the pending output of the Deflater. + /// + /// Author of the original java version: Jochen Hoenicke + /// + internal class DeflaterPending : PendingBuffer + { + /// + /// Construct instance with default buffer size + /// + public DeflaterPending() + : base(DeflaterConstants.PENDING_BUF_SIZE) + { + } + } +} diff --git a/PdfSharp/SharpZipLib/Zip/Compression/Inflater.cs b/PdfSharp/SharpZipLib/Zip/Compression/Inflater.cs new file mode 100644 index 0000000..3d7020d --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/Compression/Inflater.cs @@ -0,0 +1,915 @@ +// Inflater.cs +// +// Copyright (C) 2001 Mike Krueger +// Copyright (C) 2004 John Reilly +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; +using PdfSharp.SharpZipLib.Checksums; +using PdfSharp.SharpZipLib.Zip.Compression.Streams; + +namespace PdfSharp.SharpZipLib.Zip.Compression +{ + /// + /// Inflater is used to decompress data that has been compressed according + /// to the "deflate" standard described in rfc1951. + /// + /// By default Zlib (rfc1950) headers and footers are expected in the input. + /// You can use constructor public Inflater(bool noHeader) passing true + /// if there is no Zlib header information + /// + /// The usage is as following. First you have to set some input with + /// SetInput(), then Inflate() it. If inflate doesn't + /// inflate any bytes there may be three reasons: + ///
    + ///
  • IsNeedingInput() returns true because the input buffer is empty. + /// You have to provide more input with SetInput(). + /// NOTE: IsNeedingInput() also returns true when, the stream is finished. + ///
  • + ///
  • IsNeedingDictionary() returns true, you have to provide a preset + /// dictionary with SetDictionary().
  • + ///
  • IsFinished returns true, the inflater has finished.
  • + ///
+ /// Once the first output byte is produced, a dictionary will not be + /// needed at a later stage. + /// + /// Author of the original java version: John Leuner, Jochen Hoenicke + ///
+ internal class Inflater + { + #region Constants/Readonly + /// + /// Copy lengths for literal codes 257..285 + /// + static readonly int[] CPLENS = { + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 + }; + + /// + /// Extra bits for literal codes 257..285 + /// + static readonly int[] CPLEXT = { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 + }; + + /// + /// Copy offsets for distance codes 0..29 + /// + static readonly int[] CPDIST = { + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577 + }; + + /// + /// Extra bits for distance codes + /// + static readonly int[] CPDEXT = { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13 + }; + + /// + /// These are the possible states for an inflater + /// + const int DECODE_HEADER = 0; + const int DECODE_DICT = 1; + const int DECODE_BLOCKS = 2; + const int DECODE_STORED_LEN1 = 3; + const int DECODE_STORED_LEN2 = 4; + const int DECODE_STORED = 5; + const int DECODE_DYN_HEADER = 6; + const int DECODE_HUFFMAN = 7; + const int DECODE_HUFFMAN_LENBITS = 8; + const int DECODE_HUFFMAN_DIST = 9; + const int DECODE_HUFFMAN_DISTBITS = 10; + const int DECODE_CHKSUM = 11; + const int FINISHED = 12; + #endregion + + #region Instance Fields + /// + /// This variable contains the current state. + /// + int mode; + + /// + /// The adler checksum of the dictionary or of the decompressed + /// stream, as it is written in the header resp. footer of the + /// compressed stream. + /// Only valid if mode is DECODE_DICT or DECODE_CHKSUM. + /// + int readAdler; + + /// + /// The number of bits needed to complete the current state. This + /// is valid, if mode is DECODE_DICT, DECODE_CHKSUM, + /// DECODE_HUFFMAN_LENBITS or DECODE_HUFFMAN_DISTBITS. + /// + int neededBits; + int repLength; + int repDist; + int uncomprLen; + + /// + /// True, if the last block flag was set in the last block of the + /// inflated stream. This means that the stream ends after the + /// current block. + /// + bool isLastBlock; + + /// + /// The total number of inflated bytes. + /// + long totalOut; + + /// + /// The total number of bytes set with setInput(). This is not the + /// value returned by the TotalIn property, since this also includes the + /// unprocessed input. + /// + long totalIn; + + /// + /// This variable stores the noHeader flag that was given to the constructor. + /// True means, that the inflated stream doesn't contain a Zlib header or + /// footer. + /// + bool noHeader; + + StreamManipulator input; + OutputWindow outputWindow; + InflaterDynHeader dynHeader; + InflaterHuffmanTree litlenTree, distTree; + Adler32 adler; + #endregion + + #region Constructors + /// + /// Creates a new inflater or RFC1951 decompressor + /// RFC1950/Zlib headers and footers will be expected in the input data + /// + public Inflater() + : this(false) + { + } + + /// + /// Creates a new inflater. + /// + /// + /// True if no RFC1950/Zlib header and footer fields are expected in the input data + /// + /// This is used for GZIPed/Zipped input. + /// + /// For compatibility with + /// Sun JDK you should provide one byte of input more than needed in + /// this case. + /// + public Inflater(bool noHeader) + { + this.noHeader = noHeader; + this.adler = new Adler32(); + input = new StreamManipulator(); + outputWindow = new OutputWindow(); + mode = noHeader ? DECODE_BLOCKS : DECODE_HEADER; + } + #endregion + + /// + /// Resets the inflater so that a new stream can be decompressed. All + /// pending input and output will be discarded. + /// + public void Reset() + { + mode = noHeader ? DECODE_BLOCKS : DECODE_HEADER; + totalIn = 0; + totalOut = 0; + input.Reset(); + outputWindow.Reset(); + dynHeader = null; + litlenTree = null; + distTree = null; + isLastBlock = false; + adler.Reset(); + } + + /// + /// Decodes a zlib/RFC1950 header. + /// + /// + /// False if more input is needed. + /// + /// + /// The header is invalid. + /// + private bool DecodeHeader() + { + int header = input.PeekBits(16); + if (header < 0) + { + return false; + } + input.DropBits(16); + + // The header is written in "wrong" byte order + header = ((header << 8) | (header >> 8)) & 0xffff; + if (header % 31 != 0) + { + throw new SharpZipBaseException("Header checksum illegal"); + } + + if ((header & 0x0f00) != (Deflater.DEFLATED << 8)) + { + throw new SharpZipBaseException("Compression Method unknown"); + } + + /* Maximum size of the backwards window in bits. + * We currently ignore this, but we could use it to make the + * inflater window more space efficient. On the other hand the + * full window (15 bits) is needed most times, anyway. + int max_wbits = ((header & 0x7000) >> 12) + 8; + */ + + if ((header & 0x0020) == 0) + { // Dictionary flag? + mode = DECODE_BLOCKS; + } + else + { + mode = DECODE_DICT; + neededBits = 32; + } + return true; + } + + /// + /// Decodes the dictionary checksum after the deflate header. + /// + /// + /// False if more input is needed. + /// + private bool DecodeDict() + { + while (neededBits > 0) + { + int dictByte = input.PeekBits(8); + if (dictByte < 0) + { + return false; + } + input.DropBits(8); + readAdler = (readAdler << 8) | dictByte; + neededBits -= 8; + } + return false; + } + + /// + /// Decodes the huffman encoded symbols in the input stream. + /// + /// + /// false if more input is needed, true if output window is + /// full or the current block ends. + /// + /// + /// if deflated stream is invalid. + /// + private bool DecodeHuffman() + { + int free = outputWindow.GetFreeSpace(); + while (free >= 258) + { + int symbol; + switch (mode) + { + case DECODE_HUFFMAN: + // This is the inner loop so it is optimized a bit + while (((symbol = litlenTree.GetSymbol(input)) & ~0xff) == 0) + { + outputWindow.Write(symbol); + if (--free < 258) + { + return true; + } + } + + if (symbol < 257) + { + if (symbol < 0) + { + return false; + } + else + { + // symbol == 256: end of block + distTree = null; + litlenTree = null; + mode = DECODE_BLOCKS; + return true; + } + } + + try + { + repLength = CPLENS[symbol - 257]; + neededBits = CPLEXT[symbol - 257]; + } + catch (Exception) + { + throw new SharpZipBaseException("Illegal rep length code"); + } + goto case DECODE_HUFFMAN_LENBITS; // fall through + + case DECODE_HUFFMAN_LENBITS: + if (neededBits > 0) + { + mode = DECODE_HUFFMAN_LENBITS; + int i = input.PeekBits(neededBits); + if (i < 0) + { + return false; + } + input.DropBits(neededBits); + repLength += i; + } + mode = DECODE_HUFFMAN_DIST; + goto case DECODE_HUFFMAN_DIST; // fall through + + case DECODE_HUFFMAN_DIST: + symbol = distTree.GetSymbol(input); + if (symbol < 0) + { + return false; + } + + try + { + repDist = CPDIST[symbol]; + neededBits = CPDEXT[symbol]; + } + catch (Exception) + { + throw new SharpZipBaseException("Illegal rep dist code"); + } + + goto case DECODE_HUFFMAN_DISTBITS; // fall through + + case DECODE_HUFFMAN_DISTBITS: + if (neededBits > 0) + { + mode = DECODE_HUFFMAN_DISTBITS; + int i = input.PeekBits(neededBits); + if (i < 0) + { + return false; + } + input.DropBits(neededBits); + repDist += i; + } + + outputWindow.Repeat(repLength, repDist); + free -= repLength; + mode = DECODE_HUFFMAN; + break; + + default: + throw new SharpZipBaseException("Inflater unknown mode"); + } + } + return true; + } + + /// + /// Decodes the adler checksum after the deflate stream. + /// + /// + /// false if more input is needed. + /// + /// + /// If checksum doesn't match. + /// + private bool DecodeChksum() + { + while (neededBits > 0) + { + int chkByte = input.PeekBits(8); + if (chkByte < 0) + { + return false; + } + input.DropBits(8); + readAdler = (readAdler << 8) | chkByte; + neededBits -= 8; + } + + if ((int)adler.Value != readAdler) + { + throw new SharpZipBaseException("Adler chksum doesn't match: " + (int)adler.Value + " vs. " + readAdler); + } + + mode = FINISHED; + return false; + } + + /// + /// Decodes the deflated stream. + /// + /// + /// false if more input is needed, or if finished. + /// + /// + /// if deflated stream is invalid. + /// + private bool Decode() + { + switch (mode) + { + case DECODE_HEADER: + return DecodeHeader(); + + case DECODE_DICT: + return DecodeDict(); + + case DECODE_CHKSUM: + return DecodeChksum(); + + case DECODE_BLOCKS: + if (isLastBlock) + { + if (noHeader) + { + mode = FINISHED; + return false; + } + else + { + input.SkipToByteBoundary(); + neededBits = 32; + mode = DECODE_CHKSUM; + return true; + } + } + + int type = input.PeekBits(3); + if (type < 0) + { + return false; + } + input.DropBits(3); + + if ((type & 1) != 0) + { + isLastBlock = true; + } + switch (type >> 1) + { + case DeflaterConstants.STORED_BLOCK: + input.SkipToByteBoundary(); + mode = DECODE_STORED_LEN1; + break; + case DeflaterConstants.STATIC_TREES: + litlenTree = InflaterHuffmanTree.defLitLenTree; + distTree = InflaterHuffmanTree.defDistTree; + mode = DECODE_HUFFMAN; + break; + case DeflaterConstants.DYN_TREES: + dynHeader = new InflaterDynHeader(); + mode = DECODE_DYN_HEADER; + break; + default: + throw new SharpZipBaseException("Unknown block type " + type); + } + return true; + + case DECODE_STORED_LEN1: + { + if ((uncomprLen = input.PeekBits(16)) < 0) + { + return false; + } + input.DropBits(16); + mode = DECODE_STORED_LEN2; + } + goto case DECODE_STORED_LEN2; // fall through + + case DECODE_STORED_LEN2: + { + int nlen = input.PeekBits(16); + if (nlen < 0) + { + return false; + } + input.DropBits(16); + if (nlen != (uncomprLen ^ 0xffff)) + { + throw new SharpZipBaseException("broken uncompressed block"); + } + mode = DECODE_STORED; + } + goto case DECODE_STORED; // fall through + + case DECODE_STORED: + { + int more = outputWindow.CopyStored(input, uncomprLen); + uncomprLen -= more; + if (uncomprLen == 0) + { + mode = DECODE_BLOCKS; + return true; + } + return !input.IsNeedingInput; + } + + case DECODE_DYN_HEADER: + if (!dynHeader.Decode(input)) + { + return false; + } + + litlenTree = dynHeader.BuildLitLenTree(); + distTree = dynHeader.BuildDistTree(); + mode = DECODE_HUFFMAN; + goto case DECODE_HUFFMAN; // fall through + + case DECODE_HUFFMAN: + case DECODE_HUFFMAN_LENBITS: + case DECODE_HUFFMAN_DIST: + case DECODE_HUFFMAN_DISTBITS: + return DecodeHuffman(); + + case FINISHED: + return false; + + default: + throw new SharpZipBaseException("Inflater.Decode unknown mode"); + } + } + + /// + /// Sets the preset dictionary. This should only be called, if + /// needsDictionary() returns true and it should set the same + /// dictionary, that was used for deflating. The getAdler() + /// function returns the checksum of the dictionary needed. + /// + /// + /// The dictionary. + /// + public void SetDictionary(byte[] buffer) + { + SetDictionary(buffer, 0, buffer.Length); + } + + /// + /// Sets the preset dictionary. This should only be called, if + /// needsDictionary() returns true and it should set the same + /// dictionary, that was used for deflating. The getAdler() + /// function returns the checksum of the dictionary needed. + /// + /// + /// The dictionary. + /// + /// + /// The index into buffer where the dictionary starts. + /// + /// + /// The number of bytes in the dictionary. + /// + /// + /// No dictionary is needed. + /// + /// + /// The adler checksum for the buffer is invalid + /// + public void SetDictionary(byte[] buffer, int index, int count) + { + if (buffer == null) + { + throw new ArgumentNullException("buffer"); + } + + if (index < 0) + { + throw new ArgumentOutOfRangeException("index"); + } + + if (count < 0) + { + throw new ArgumentOutOfRangeException("count"); + } + + if (!IsNeedingDictionary) + { + throw new InvalidOperationException("Dictionary is not needed"); + } + + adler.Update(buffer, index, count); + + if ((int)adler.Value != readAdler) + { + throw new SharpZipBaseException("Wrong adler checksum"); + } + adler.Reset(); + outputWindow.CopyDict(buffer, index, count); + mode = DECODE_BLOCKS; + } + + /// + /// Sets the input. This should only be called, if needsInput() + /// returns true. + /// + /// + /// the input. + /// + public void SetInput(byte[] buffer) + { + SetInput(buffer, 0, buffer.Length); + } + + /// + /// Sets the input. This should only be called, if needsInput() + /// returns true. + /// + /// + /// The source of input data + /// + /// + /// The index into buffer where the input starts. + /// + /// + /// The number of bytes of input to use. + /// + /// + /// No input is needed. + /// + /// + /// The index and/or count are wrong. + /// + public void SetInput(byte[] buffer, int index, int count) + { + input.SetInput(buffer, index, count); + totalIn += (long)count; + } + + /// + /// Inflates the compressed stream to the output buffer. If this + /// returns 0, you should check, whether IsNeedingDictionary(), + /// IsNeedingInput() or IsFinished() returns true, to determine why no + /// further output is produced. + /// + /// + /// the output buffer. + /// + /// + /// The number of bytes written to the buffer, 0 if no further + /// output can be produced. + /// + /// + /// if buffer has length 0. + /// + /// + /// if deflated stream is invalid. + /// + public int Inflate(byte[] buffer) + { + if (buffer == null) + { + throw new ArgumentNullException("buffer"); + } + + return Inflate(buffer, 0, buffer.Length); + } + + /// + /// Inflates the compressed stream to the output buffer. If this + /// returns 0, you should check, whether needsDictionary(), + /// needsInput() or finished() returns true, to determine why no + /// further output is produced. + /// + /// + /// the output buffer. + /// + /// + /// the offset in buffer where storing starts. + /// + /// + /// the maximum number of bytes to output. + /// + /// + /// the number of bytes written to the buffer, 0 if no further output can be produced. + /// + /// + /// if count is less than 0. + /// + /// + /// if the index and / or count are wrong. + /// + /// + /// if deflated stream is invalid. + /// + public int Inflate(byte[] buffer, int offset, int count) + { + if (buffer == null) + { + throw new ArgumentNullException("buffer"); + } + + if (count < 0) + { +#if NETCF_1_0 + throw new ArgumentOutOfRangeException("count"); +#else + throw new ArgumentOutOfRangeException("count", "count cannot be negative"); +#endif + } + + if (offset < 0) + { +#if NETCF_1_0 + throw new ArgumentOutOfRangeException("offset"); +#else + throw new ArgumentOutOfRangeException("offset", "offset cannot be negative"); +#endif + } + + if (offset + count > buffer.Length) + { + throw new ArgumentException("count exceeds buffer bounds"); + } + + // Special case: count may be zero + if (count == 0) + { + if (!IsFinished) + { // -jr- 08-Nov-2003 INFLATE_BUG fix.. + Decode(); + } + return 0; + } + + int bytesCopied = 0; + + do + { + if (mode != DECODE_CHKSUM) + { + /* Don't give away any output, if we are waiting for the + * checksum in the input stream. + * + * With this trick we have always: + * IsNeedingInput() and not IsFinished() + * implies more output can be produced. + */ + int more = outputWindow.CopyOutput(buffer, offset, count); + if (more > 0) + { + adler.Update(buffer, offset, more); + offset += more; + bytesCopied += more; + totalOut += (long)more; + count -= more; + if (count == 0) + { + return bytesCopied; + } + } + } + } while (Decode() || ((outputWindow.GetAvailable() > 0) && (mode != DECODE_CHKSUM))); + return bytesCopied; + } + + /// + /// Returns true, if the input buffer is empty. + /// You should then call setInput(). + /// NOTE: This method also returns true when the stream is finished. + /// + public bool IsNeedingInput + { + get + { + return input.IsNeedingInput; + } + } + + /// + /// Returns true, if a preset dictionary is needed to inflate the input. + /// + public bool IsNeedingDictionary + { + get + { + return mode == DECODE_DICT && neededBits == 0; + } + } + + /// + /// Returns true, if the inflater has finished. This means, that no + /// input is needed and no output can be produced. + /// + public bool IsFinished + { + get + { + return mode == FINISHED && outputWindow.GetAvailable() == 0; + } + } + + /// + /// Gets the adler checksum. This is either the checksum of all + /// uncompressed bytes returned by inflate(), or if needsDictionary() + /// returns true (and thus no output was yet produced) this is the + /// adler checksum of the expected dictionary. + /// + /// + /// the adler checksum. + /// + public int Adler + { + get + { + return IsNeedingDictionary ? readAdler : (int)adler.Value; + } + } + + /// + /// Gets the total number of output bytes returned by Inflate(). + /// + /// + /// the total number of output bytes. + /// + public long TotalOut + { + get + { + return totalOut; + } + } + + /// + /// Gets the total number of processed compressed input bytes. + /// + /// + /// The total number of bytes of processed input bytes. + /// + public long TotalIn + { + get + { + return totalIn - (long)RemainingInput; + } + } + + /// + /// Gets the number of unprocessed input bytes. Useful, if the end of the + /// stream is reached and you want to further process the bytes after + /// the deflate stream. + /// + /// + /// The number of bytes of the input which have not been processed. + /// + public int RemainingInput + { + // TODO: This should be a long? + get + { + return input.AvailableBytes; + } + } + } +} diff --git a/PdfSharp/SharpZipLib/Zip/Compression/InflaterDynHeader.cs b/PdfSharp/SharpZipLib/Zip/Compression/InflaterDynHeader.cs new file mode 100644 index 0000000..d1056a3 --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/Compression/InflaterDynHeader.cs @@ -0,0 +1,224 @@ +// InflaterDynHeader.cs +// Copyright (C) 2001 Mike Krueger +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; + +using PdfSharp.SharpZipLib.Zip.Compression.Streams; + +namespace PdfSharp.SharpZipLib.Zip.Compression +{ + + class InflaterDynHeader + { + const int LNUM = 0; + const int DNUM = 1; + const int BLNUM = 2; + const int BLLENS = 3; + const int LENS = 4; + const int REPS = 5; + + static readonly int[] repMin = { 3, 3, 11 }; + static readonly int[] repBits = { 2, 3, 7 }; + + byte[] blLens; + byte[] litdistLens; + + InflaterHuffmanTree blTree; + + int mode; + int lnum, dnum, blnum, num; + int repSymbol; + byte lastLen; + int ptr; + + static readonly int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + + public InflaterDynHeader() + { + } + + public bool Decode(StreamManipulator input) + { + decode_loop: + for (; ; ) + { + switch (mode) + { + case LNUM: + lnum = input.PeekBits(5); + if (lnum < 0) + { + return false; + } + lnum += 257; + input.DropBits(5); + // System.err.println("LNUM: "+lnum); + mode = DNUM; + goto case DNUM; // fall through + case DNUM: + dnum = input.PeekBits(5); + if (dnum < 0) + { + return false; + } + dnum++; + input.DropBits(5); + // System.err.println("DNUM: "+dnum); + num = lnum + dnum; + litdistLens = new byte[num]; + mode = BLNUM; + goto case BLNUM; // fall through + case BLNUM: + blnum = input.PeekBits(4); + if (blnum < 0) + { + return false; + } + blnum += 4; + input.DropBits(4); + blLens = new byte[19]; + ptr = 0; + // System.err.println("BLNUM: "+blnum); + mode = BLLENS; + goto case BLLENS; // fall through + case BLLENS: + while (ptr < blnum) + { + int len = input.PeekBits(3); + if (len < 0) + { + return false; + } + input.DropBits(3); + // System.err.println("blLens["+BL_ORDER[ptr]+"]: "+len); + blLens[BL_ORDER[ptr]] = (byte)len; + ptr++; + } + blTree = new InflaterHuffmanTree(blLens); + blLens = null; + ptr = 0; + mode = LENS; + goto case LENS; // fall through + case LENS: + { + int symbol; + while (((symbol = blTree.GetSymbol(input)) & ~15) == 0) + { + /* Normal case: symbol in [0..15] */ + + // System.err.println("litdistLens["+ptr+"]: "+symbol); + litdistLens[ptr++] = lastLen = (byte)symbol; + + if (ptr == num) + { + /* Finished */ + return true; + } + } + + /* need more input ? */ + if (symbol < 0) + { + return false; + } + + /* otherwise repeat code */ + if (symbol >= 17) + { + /* repeat zero */ + // System.err.println("repeating zero"); + lastLen = 0; + } + else + { + if (ptr == 0) + { + throw new SharpZipBaseException(); + } + } + repSymbol = symbol - 16; + } + mode = REPS; + goto case REPS; // fall through + case REPS: + { + int bits = repBits[repSymbol]; + int count = input.PeekBits(bits); + if (count < 0) + { + return false; + } + input.DropBits(bits); + count += repMin[repSymbol]; + // System.err.println("litdistLens repeated: "+count); + + if (ptr + count > num) + { + throw new SharpZipBaseException(); + } + while (count-- > 0) + { + litdistLens[ptr++] = lastLen; + } + + if (ptr == num) + { + /* Finished */ + return true; + } + } + mode = LENS; + goto decode_loop; + } + } + } + + public InflaterHuffmanTree BuildLitLenTree() + { + byte[] litlenLens = new byte[lnum]; + Array.Copy(litdistLens, 0, litlenLens, 0, lnum); + return new InflaterHuffmanTree(litlenLens); + } + + public InflaterHuffmanTree BuildDistTree() + { + byte[] distLens = new byte[dnum]; + Array.Copy(litdistLens, lnum, distLens, 0, dnum); + return new InflaterHuffmanTree(distLens); + } + } +} diff --git a/PdfSharp/SharpZipLib/Zip/Compression/InflaterHuffmanTree.cs b/PdfSharp/SharpZipLib/Zip/Compression/InflaterHuffmanTree.cs new file mode 100644 index 0000000..e6c9da5 --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/Compression/InflaterHuffmanTree.cs @@ -0,0 +1,258 @@ +// InflaterHuffmanTree.cs +// Copyright (C) 2001 Mike Krueger +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; + +using PdfSharp.SharpZipLib.Zip.Compression.Streams; + +namespace PdfSharp.SharpZipLib.Zip.Compression +{ + /// + /// Huffman tree used for inflation + /// + internal class InflaterHuffmanTree + { + static int MAX_BITLEN = 15; + short[] tree; + + /// + /// Literal length tree + /// + public static InflaterHuffmanTree defLitLenTree; + + /// + /// Distance tree + /// + public static InflaterHuffmanTree defDistTree; + + static InflaterHuffmanTree() + { + try + { + byte[] codeLengths = new byte[288]; + int i = 0; + while (i < 144) + { + codeLengths[i++] = 8; + } + while (i < 256) + { + codeLengths[i++] = 9; + } + while (i < 280) + { + codeLengths[i++] = 7; + } + while (i < 288) + { + codeLengths[i++] = 8; + } + defLitLenTree = new InflaterHuffmanTree(codeLengths); + + codeLengths = new byte[32]; + i = 0; + while (i < 32) + { + codeLengths[i++] = 5; + } + defDistTree = new InflaterHuffmanTree(codeLengths); + } + catch (Exception) + { + throw new SharpZipBaseException("InflaterHuffmanTree: static tree length illegal"); + } + } + + /// + /// Constructs a Huffman tree from the array of code lengths. + /// + /// + /// the array of code lengths + /// + public InflaterHuffmanTree(byte[] codeLengths) + { + BuildTree(codeLengths); + } + + void BuildTree(byte[] codeLengths) + { + int[] blCount = new int[MAX_BITLEN + 1]; + int[] nextCode = new int[MAX_BITLEN + 1]; + + for (int i = 0; i < codeLengths.Length; i++) + { + int bits = codeLengths[i]; + if (bits > 0) + { + blCount[bits]++; + } + } + + int code = 0; + int treeSize = 512; + for (int bits = 1; bits <= MAX_BITLEN; bits++) + { + nextCode[bits] = code; + code += blCount[bits] << (16 - bits); + if (bits >= 10) + { + /* We need an extra table for bit lengths >= 10. */ + int start = nextCode[bits] & 0x1ff80; + int end = code & 0x1ff80; + treeSize += (end - start) >> (16 - bits); + } + } + + /* -jr comment this out! doesn't work for dynamic trees and pkzip 2.04g + if (code != 65536) + { + throw new SharpZipBaseException("Code lengths don't add up properly."); + } + */ + /* Now create and fill the extra tables from longest to shortest + * bit len. This way the sub trees will be aligned. + */ + tree = new short[treeSize]; + int treePtr = 512; + for (int bits = MAX_BITLEN; bits >= 10; bits--) + { + int end = code & 0x1ff80; + code -= blCount[bits] << (16 - bits); + int start = code & 0x1ff80; + for (int i = start; i < end; i += 1 << 7) + { + tree[DeflaterHuffman.BitReverse(i)] = (short)((-treePtr << 4) | bits); + treePtr += 1 << (bits - 9); + } + } + + for (int i = 0; i < codeLengths.Length; i++) + { + int bits = codeLengths[i]; + if (bits == 0) + { + continue; + } + code = nextCode[bits]; + int revcode = DeflaterHuffman.BitReverse(code); + if (bits <= 9) + { + do + { + tree[revcode] = (short)((i << 4) | bits); + revcode += 1 << bits; + } while (revcode < 512); + } + else + { + int subTree = tree[revcode & 511]; + int treeLen = 1 << (subTree & 15); + subTree = -(subTree >> 4); + do + { + tree[subTree | (revcode >> 9)] = (short)((i << 4) | bits); + revcode += 1 << bits; + } while (revcode < treeLen); + } + nextCode[bits] = code + (1 << (16 - bits)); + } + + } + + /// + /// Reads the next symbol from input. The symbol is encoded using the + /// huffman tree. + /// + /// + /// input the input source. + /// + /// + /// the next symbol, or -1 if not enough input is available. + /// + public int GetSymbol(StreamManipulator input) + { + int lookahead, symbol; + if ((lookahead = input.PeekBits(9)) >= 0) + { + if ((symbol = tree[lookahead]) >= 0) + { + input.DropBits(symbol & 15); + return symbol >> 4; + } + int subtree = -(symbol >> 4); + int bitlen = symbol & 15; + if ((lookahead = input.PeekBits(bitlen)) >= 0) + { + symbol = tree[subtree | (lookahead >> 9)]; + input.DropBits(symbol & 15); + return symbol >> 4; + } + else + { + int bits = input.AvailableBits; + lookahead = input.PeekBits(bits); + symbol = tree[subtree | (lookahead >> 9)]; + if ((symbol & 15) <= bits) + { + input.DropBits(symbol & 15); + return symbol >> 4; + } + else + { + return -1; + } + } + } + else + { + int bits = input.AvailableBits; + lookahead = input.PeekBits(bits); + symbol = tree[lookahead]; + if (symbol >= 0 && (symbol & 15) <= bits) + { + input.DropBits(symbol & 15); + return symbol >> 4; + } + else + { + return -1; + } + } + } + } +} + diff --git a/PdfSharp/SharpZipLib/Zip/Compression/PendingBuffer.cs b/PdfSharp/SharpZipLib/Zip/Compression/PendingBuffer.cs new file mode 100644 index 0000000..72328c0 --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/Compression/PendingBuffer.cs @@ -0,0 +1,306 @@ +// PendingBuffer.cs +// +// Copyright (C) 2001 Mike Krueger +// Copyright (C) 2004 John Reilly +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; + +namespace PdfSharp.SharpZipLib.Zip.Compression +{ + + /// + /// This class is general purpose class for writing data to a buffer. + /// + /// It allows you to write bits as well as bytes + /// Based on DeflaterPending.java + /// + /// Author of the original java version: Jochen Hoenicke + /// + internal class PendingBuffer + { + #region Instance Fields + /// + /// Internal work buffer + /// + byte[] buffer_; + + int start; + int end; + + uint bits; + int bitCount; + #endregion + + #region Constructors + /// + /// construct instance using default buffer size of 4096 + /// + public PendingBuffer() + : this(4096) + { + } + + /// + /// construct instance using specified buffer size + /// + /// + /// size to use for internal buffer + /// + public PendingBuffer(int bufferSize) + { + buffer_ = new byte[bufferSize]; + } + + #endregion + + /// + /// Clear internal state/buffers + /// + public void Reset() + { + start = end = bitCount = 0; + } + + /// + /// Write a byte to buffer + /// + /// + /// The value to write + /// + public void WriteByte(int value) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } +#endif + buffer_[end++] = unchecked((byte)value); + } + + /// + /// Write a short value to buffer LSB first + /// + /// + /// The value to write. + /// + public void WriteShort(int value) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } +#endif + buffer_[end++] = unchecked((byte)value); + buffer_[end++] = unchecked((byte)(value >> 8)); + } + + /// + /// write an integer LSB first + /// + /// The value to write. + public void WriteInt(int value) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } +#endif + buffer_[end++] = unchecked((byte)value); + buffer_[end++] = unchecked((byte)(value >> 8)); + buffer_[end++] = unchecked((byte)(value >> 16)); + buffer_[end++] = unchecked((byte)(value >> 24)); + } + + /// + /// Write a block of data to buffer + /// + /// data to write + /// offset of first byte to write + /// number of bytes to write + public void WriteBlock(byte[] block, int offset, int length) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } +#endif + System.Array.Copy(block, offset, buffer_, end, length); + end += length; + } + + /// + /// The number of bits written to the buffer + /// + public int BitCount + { + get + { + return bitCount; + } + } + + /// + /// Align internal buffer on a byte boundary + /// + public void AlignToByte() + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } +#endif + if (bitCount > 0) + { + buffer_[end++] = unchecked((byte)bits); + if (bitCount > 8) + { + buffer_[end++] = unchecked((byte)(bits >> 8)); + } + } + bits = 0; + bitCount = 0; + } + + /// + /// Write bits to internal buffer + /// + /// source of bits + /// number of bits to write + public void WriteBits(int b, int count) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("writeBits("+b+","+count+")"); + // } +#endif + bits |= (uint)(b << bitCount); + bitCount += count; + if (bitCount >= 16) + { + buffer_[end++] = unchecked((byte)bits); + buffer_[end++] = unchecked((byte)(bits >> 8)); + bits >>= 16; + bitCount -= 16; + } + } + + /// + /// Write a short value to internal buffer most significant byte first + /// + /// value to write + public void WriteShortMSB(int s) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } +#endif + buffer_[end++] = unchecked((byte)(s >> 8)); + buffer_[end++] = unchecked((byte)s); + } + + /// + /// Indicates if buffer has been flushed + /// + public bool IsFlushed + { + get + { + return end == 0; + } + } + + /// + /// Flushes the pending buffer into the given output array. If the + /// output array is to small, only a partial flush is done. + /// + /// The output array. + /// The offset into output array. + /// The maximum number of bytes to store. + /// The number of bytes flushed. + public int Flush(byte[] output, int offset, int length) + { + if (bitCount >= 8) + { + buffer_[end++] = unchecked((byte)bits); + bits >>= 8; + bitCount -= 8; + } + + if (length > end - start) + { + length = end - start; + System.Array.Copy(buffer_, start, output, offset, length); + start = 0; + end = 0; + } + else + { + System.Array.Copy(buffer_, start, output, offset, length); + start += length; + } + return length; + } + + /// + /// Convert internal buffer to byte array. + /// Buffer is empty on completion + /// + /// + /// The internal buffer contents converted to a byte array. + /// + public byte[] ToByteArray() + { + byte[] result = new byte[end - start]; + System.Array.Copy(buffer_, start, result, 0, result.Length); + start = 0; + end = 0; + return result; + } + } +} diff --git a/PdfSharp/SharpZipLib/Zip/Compression/Streams/DeflaterOutputStream.cs b/PdfSharp/SharpZipLib/Zip/Compression/Streams/DeflaterOutputStream.cs new file mode 100644 index 0000000..143a386 --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/Compression/Streams/DeflaterOutputStream.cs @@ -0,0 +1,676 @@ +// DeflaterOutputStream.cs +// +// Copyright (C) 2001 Mike Krueger +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +// HISTORY +// 22-12-2009 DavidPierson Added AES support + +using System; +using System.IO; +using PdfSharp.SharpZipLib.Checksums; + +// ReSharper disable RedundantThisQualifier + +//#if !NETCF_1_0 +//using System.Security.Cryptography; +//using PdfSharp.SharpZipLib.Encryption; +//#endif + +namespace PdfSharp.SharpZipLib.Zip.Compression.Streams +{ + /// + /// A special stream deflating or compressing the bytes that are + /// written to it. It uses a Deflater to perform actual deflating.
+ /// Authors of the original java version: Tom Tromey, Jochen Hoenicke + ///
+ internal class DeflaterOutputStream : Stream + { + #region Constructors + /// + /// Creates a new DeflaterOutputStream with a default Deflater and default buffer size. + /// + /// + /// the output stream where deflated output should be written. + /// + public DeflaterOutputStream(Stream baseOutputStream) + : this(baseOutputStream, new Deflater(), 512) + { + } + + /// + /// Creates a new DeflaterOutputStream with the given Deflater and + /// default buffer size. + /// + /// + /// the output stream where deflated output should be written. + /// + /// + /// the underlying deflater. + /// + public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater) + : this(baseOutputStream, deflater, 512) + { + } + + /// + /// Creates a new DeflaterOutputStream with the given Deflater and + /// buffer size. + /// + /// + /// The output stream where deflated output is written. + /// + /// + /// The underlying deflater to use + /// + /// + /// The buffer size in bytes to use when deflating (minimum value 512) + /// + /// + /// bufsize is less than or equal to zero. + /// + /// + /// baseOutputStream does not support writing + /// + /// + /// deflater instance is null + /// + public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater, int bufferSize) + { + if (baseOutputStream == null) + { + throw new ArgumentNullException("baseOutputStream"); + } + + if (baseOutputStream.CanWrite == false) + { + throw new ArgumentException("Must support writing", "baseOutputStream"); + } + + if (deflater == null) + { + throw new ArgumentNullException("deflater"); + } + + if (bufferSize < 512) + { + throw new ArgumentOutOfRangeException("bufferSize"); + } + + baseOutputStream_ = baseOutputStream; + buffer_ = new byte[bufferSize]; + deflater_ = deflater; + } + #endregion + + #region Public API + /// + /// Finishes the stream by calling finish() on the deflater. + /// + /// + /// Not all input is deflated + /// + public virtual void Finish() + { + deflater_.Finish(); + while (!deflater_.IsFinished) + { + int len = deflater_.Deflate(buffer_, 0, buffer_.Length); + if (len <= 0) + { + break; + } + +#if true//NETCF_1_0 + if (keys != null) + { +#else + if (cryptoTransform_ != null) { +#endif + EncryptBlock(buffer_, 0, len); + } + + baseOutputStream_.Write(buffer_, 0, len); + } + + if (!deflater_.IsFinished) + { + throw new SharpZipBaseException("Can't deflate all input?"); + } + + baseOutputStream_.Flush(); + +#if true//NETCF_1_0 + if (keys != null) + { + keys = null; + } +#else + if (cryptoTransform_ != null) { +#if !NET_1_1 && !NETCF_2_0 + if (cryptoTransform_ is ZipAESTransform) { + AESAuthCode = ((ZipAESTransform)cryptoTransform_).GetAuthCode(); + } +#endif + cryptoTransform_.Dispose(); + cryptoTransform_ = null; + } +#endif + } + + /// + /// Get/set flag indicating ownership of the underlying stream. + /// When the flag is true will close the underlying stream also. + /// + public bool IsStreamOwner + { + get { return isStreamOwner_; } + set { isStreamOwner_ = value; } + } + + /// + /// Allows client to determine if an entry can be patched after its added + /// + public bool CanPatchEntries + { + get + { + return baseOutputStream_.CanSeek; + } + } + + #endregion + + #region Encryption + + string password; + +#if true//NETCF_1_0 + uint[] keys; +#else + ICryptoTransform cryptoTransform_; + + /// + /// Returns the 10 byte AUTH CODE to be appended immediately following the AES data stream. + /// + protected byte[] AESAuthCode; +#endif + + /// + /// Get/set the password used for encryption. + /// + /// When set to null or if the password is empty no encryption is performed + public string Password + { + get + { + return password; + } + set + { + if ((value != null) && (value.Length == 0)) + { + password = null; + } + else + { + password = value; + } + } + } + + /// + /// Encrypt a block of data + /// + /// + /// Data to encrypt. NOTE the original contents of the buffer are lost + /// + /// + /// Offset of first byte in buffer to encrypt + /// + /// + /// Number of bytes in buffer to encrypt + /// + protected void EncryptBlock(byte[] buffer, int offset, int length) + { +#if true//NETCF_1_0 + for (int i = offset; i < offset + length; ++i) + { + byte oldbyte = buffer[i]; + buffer[i] ^= EncryptByte(); + UpdateKeys(oldbyte); + } +#else + cryptoTransform_.TransformBlock(buffer, 0, length, buffer, 0); +#endif + } + + /// + /// Initializes encryption keys based on given . + /// + /// The password. + protected void InitializePassword(string password) + { +#if true//NETCF_1_0 + keys = new uint[] { + 0x12345678, + 0x23456789, + 0x34567890 + }; + + byte[] rawPassword = ZipConstants.ConvertToArray(password); + + for (int i = 0; i < rawPassword.Length; ++i) + { + UpdateKeys((byte)rawPassword[i]); + } + +#else + PkzipClassicManaged pkManaged = new PkzipClassicManaged(); + byte[] key = PkzipClassic.GenerateKeys(ZipConstants.ConvertToArray(password)); + cryptoTransform_ = pkManaged.CreateEncryptor(key, null); +#endif + } + +#if false//!NET_1_1 && !NETCF_2_0 + /// + /// Initializes encryption keys based on given password. + /// + protected void InitializeAESPassword(ZipEntry entry, string rawPassword, + out byte[] salt, out byte[] pwdVerifier) { + salt = new byte[entry.AESSaltLen]; + // Salt needs to be cryptographically random, and unique per file + if (_aesRnd == null) + _aesRnd = new RNGCryptoServiceProvider(); + _aesRnd.GetBytes(salt); + int blockSize = entry.AESKeySize / 8; // bits to bytes + + cryptoTransform_ = new ZipAESTransform(rawPassword, salt, blockSize, true); + pwdVerifier = ((ZipAESTransform)cryptoTransform_).PwdVerifier; + } +#endif + +#if true//NETCF_1_0 + + /// + /// Encrypt a single byte + /// + /// + /// The encrypted value + /// + protected byte EncryptByte() + { + uint temp = ((keys[2] & 0xFFFF) | 2); + return (byte)((temp * (temp ^ 1)) >> 8); + } + + /// + /// Update encryption keys + /// + protected void UpdateKeys(byte ch) + { + keys[0] = Crc32.ComputeCrc32(keys[0], ch); + keys[1] = keys[1] + (byte)keys[0]; + keys[1] = keys[1] * 134775813 + 1; + keys[2] = Crc32.ComputeCrc32(keys[2], (byte)(keys[1] >> 24)); + } +#endif + + #endregion + + #region Deflation Support + /// + /// Deflates everything in the input buffers. This will call + /// def.deflate() until all bytes from the input buffers + /// are processed. + /// + protected void Deflate() + { + while (!deflater_.IsNeedingInput) + { + int deflateCount = deflater_.Deflate(buffer_, 0, buffer_.Length); + + if (deflateCount <= 0) + { + break; + } +#if true//NETCF_1_0 + if (keys != null) +#else + if (cryptoTransform_ != null) +#endif + { + EncryptBlock(buffer_, 0, deflateCount); + } + + baseOutputStream_.Write(buffer_, 0, deflateCount); + } + + if (!deflater_.IsNeedingInput) + { + throw new SharpZipBaseException("DeflaterOutputStream can't deflate all input?"); + } + } + #endregion + + #region Stream Overrides + /// + /// Gets value indicating stream can be read from + /// + public override bool CanRead + { + get + { + return false; + } + } + + /// + /// Gets a value indicating if seeking is supported for this stream + /// This property always returns false + /// + public override bool CanSeek + { + get + { + return false; + } + } + + /// + /// Get value indicating if this stream supports writing + /// + public override bool CanWrite + { + get + { + return baseOutputStream_.CanWrite; + } + } + + /// + /// Get current length of stream + /// + public override long Length + { + get + { + return baseOutputStream_.Length; + } + } + + /// + /// Gets the current position within the stream. + /// + /// Any attempt to set position + public override long Position + { + get + { + return baseOutputStream_.Position; + } + set + { + throw new NotSupportedException("Position property not supported"); + } + } + + /// + /// Sets the current position of this stream to the given value. Not supported by this class! + /// + /// The offset relative to the to seek. + /// The to seek from. + /// The new position in the stream. + /// Any access + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotSupportedException("DeflaterOutputStream Seek not supported"); + } + + /// + /// Sets the length of this stream to the given value. Not supported by this class! + /// + /// The new stream length. + /// Any access + public override void SetLength(long value) + { + throw new NotSupportedException("DeflaterOutputStream SetLength not supported"); + } + + /// + /// Read a byte from stream advancing position by one + /// + /// The byte read cast to an int. THe value is -1 if at the end of the stream. + /// Any access + public override int ReadByte() + { + throw new NotSupportedException("DeflaterOutputStream ReadByte not supported"); + } + + /// + /// Read a block of bytes from stream + /// + /// The buffer to store read data in. + /// The offset to start storing at. + /// The maximum number of bytes to read. + /// The actual number of bytes read. Zero if end of stream is detected. + /// Any access + public override int Read(byte[] buffer, int offset, int count) + { + throw new NotSupportedException("DeflaterOutputStream Read not supported"); + } + +#if !NETFX_CORE && !UWP + /// + /// Asynchronous reads are not supported a NotSupportedException is always thrown + /// + /// The buffer to read into. + /// The offset to start storing data at. + /// The number of bytes to read + /// The async callback to use. + /// The state to use. + /// Returns an + /// Any access + public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) + { + throw new NotSupportedException("DeflaterOutputStream BeginRead not currently supported"); + } +#endif + +#if !NETFX_CORE && !UWP + /// + /// Asynchronous writes arent supported, a NotSupportedException is always thrown + /// + /// The buffer to write. + /// The offset to begin writing at. + /// The number of bytes to write. + /// The to use. + /// The state object. + /// Returns an IAsyncResult. + /// Any access + public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) + { + throw new NotSupportedException("BeginWrite is not supported"); + } +#endif + + /// + /// Flushes the stream by calling Flush on the deflater and then + /// on the underlying stream. This ensures that all bytes are flushed. + /// + public override void Flush() + { + deflater_.Flush(); + Deflate(); + baseOutputStream_.Flush(); + } + +#if !NETFX_CORE && !UWP + /// + /// Calls and closes the underlying + /// stream when is true. + /// + public override void Close() + { + if ( !isClosed_ ) { + isClosed_ = true; + + try { + Finish(); +#if true//NETCF_1_0 + keys =null; +#else + if ( cryptoTransform_ != null ) { + GetAuthCodeIfAES(); + cryptoTransform_.Dispose(); + cryptoTransform_ = null; + } +#endif + } + finally { + if( isStreamOwner_ ) { + baseOutputStream_.Close(); + } + } + } + } +#else + public void Close() + { + if (!isClosed_) + { + isClosed_ = true; + + try + { + Finish(); +#if true//NETCF_1_0 + keys = null; +#else + if ( cryptoTransform_ != null ) { + GetAuthCodeIfAES(); + cryptoTransform_.Dispose(); + cryptoTransform_ = null; + } +#endif + } + finally + { + if (isStreamOwner_) + { + //baseOutputStream_.Close(); + baseOutputStream_.Dispose(); + } + } + } + } +#endif + + + private void GetAuthCodeIfAES() + { +#if false//!NET_1_1 && !NETCF_2_0 + if (cryptoTransform_ is ZipAESTransform) { + AESAuthCode = ((ZipAESTransform)cryptoTransform_).GetAuthCode(); + } +#endif + } + + /// + /// Writes a single byte to the compressed output stream. + /// + /// + /// The byte value. + /// + public override void WriteByte(byte value) + { + byte[] b = new byte[1]; + b[0] = value; + Write(b, 0, 1); + } + + /// + /// Writes bytes from an array to the compressed stream. + /// + /// + /// The byte array + /// + /// + /// The offset into the byte array where to start. + /// + /// + /// The number of bytes to write. + /// + public override void Write(byte[] buffer, int offset, int count) + { + deflater_.SetInput(buffer, offset, count); + Deflate(); + } + #endregion + + #region Instance Fields + /// + /// This buffer is used temporarily to retrieve the bytes from the + /// deflater and write them to the underlying output stream. + /// + byte[] buffer_; + + /// + /// The deflater which is used to deflate the stream. + /// + protected Deflater deflater_; + + /// + /// Base stream the deflater depends on. + /// + protected Stream baseOutputStream_; + +#if true || !NETFX_CORE && !UWP + bool isClosed_; +#endif + + bool isStreamOwner_ = true; + #endregion + + #region Static Fields + +#if false//!NET_1_1 && !NETCF_2_0 + // Static to help ensure that multiple files within a zip will get different random salt + private static RNGCryptoServiceProvider _aesRnd; +#endif + #endregion + } +} diff --git a/PdfSharp/SharpZipLib/Zip/Compression/Streams/InflaterInputStream.cs b/PdfSharp/SharpZipLib/Zip/Compression/Streams/InflaterInputStream.cs new file mode 100644 index 0000000..7086fc8 --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/Compression/Streams/InflaterInputStream.cs @@ -0,0 +1,811 @@ +// InflaterInputStream.cs +// +// Copyright (C) 2001 Mike Krueger +// Copyright (C) 2004 John Reilly +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +// HISTORY +// 11-08-2009 GeoffHart T9121 Added Multi-member gzip support + +using System; +using System.IO; + +// ReSharper disable RedundantThisQualifier + +#if false//!NETCF_1_0 +using System.Security.Cryptography; +#endif + +namespace PdfSharp.SharpZipLib.Zip.Compression.Streams +{ + + /// + /// An input buffer customised for use by + /// + /// + /// The buffer supports decryption of incoming data. + /// + internal class InflaterInputBuffer + { + #region Constructors + /// + /// Initialise a new instance of with a default buffer size + /// + /// The stream to buffer. + public InflaterInputBuffer(Stream stream) + : this(stream, 4096) + { + } + + /// + /// Initialise a new instance of + /// + /// The stream to buffer. + /// The size to use for the buffer + /// A minimum buffer size of 1KB is permitted. Lower sizes are treated as 1KB. + public InflaterInputBuffer(Stream stream, int bufferSize) + { + inputStream = stream; + if (bufferSize < 1024) + { + bufferSize = 1024; + } + rawData = new byte[bufferSize]; + clearText = rawData; + } + #endregion + + /// + /// Get the length of bytes bytes in the + /// + public int RawLength + { + get + { + return rawLength; + } + } + + /// + /// Get the contents of the raw data buffer. + /// + /// This may contain encrypted data. + public byte[] RawData + { + get + { + return rawData; + } + } + + /// + /// Get the number of useable bytes in + /// + public int ClearTextLength + { + get + { + return clearTextLength; + } + } + + /// + /// Get the contents of the clear text buffer. + /// + public byte[] ClearText + { + get + { + return clearText; + } + } + + /// + /// Get/set the number of bytes available + /// + public int Available + { + get { return available; } + set { available = value; } + } + + /// + /// Call passing the current clear text buffer contents. + /// + /// The inflater to set input for. + public void SetInflaterInput(Inflater inflater) + { + if (available > 0) + { + inflater.SetInput(clearText, clearTextLength - available, available); + available = 0; + } + } + + /// + /// Fill the buffer from the underlying input stream. + /// + public void Fill() + { + rawLength = 0; + int toRead = rawData.Length; + + while (toRead > 0) + { + int count = inputStream.Read(rawData, rawLength, toRead); + if (count <= 0) + { + break; + } + rawLength += count; + toRead -= count; + } + +#if false//!NETCF_1_0 + if ( cryptoTransform != null ) { + clearTextLength = cryptoTransform.TransformBlock(rawData, 0, rawLength, clearText, 0); + } + else +#endif + { + clearTextLength = rawLength; + } + + available = clearTextLength; + } + + /// + /// Read a buffer directly from the input stream + /// + /// The buffer to fill + /// Returns the number of bytes read. + public int ReadRawBuffer(byte[] buffer) + { + return ReadRawBuffer(buffer, 0, buffer.Length); + } + + /// + /// Read a buffer directly from the input stream + /// + /// The buffer to read into + /// The offset to start reading data into. + /// The number of bytes to read. + /// Returns the number of bytes read. + public int ReadRawBuffer(byte[] outBuffer, int offset, int length) + { + if (length < 0) + { + throw new ArgumentOutOfRangeException("length"); + } + + int currentOffset = offset; + int currentLength = length; + + while (currentLength > 0) + { + if (available <= 0) + { + Fill(); + if (available <= 0) + { + return 0; + } + } + int toCopy = Math.Min(currentLength, available); + System.Array.Copy(rawData, rawLength - (int)available, outBuffer, currentOffset, toCopy); + currentOffset += toCopy; + currentLength -= toCopy; + available -= toCopy; + } + return length; + } + + /// + /// Read clear text data from the input stream. + /// + /// The buffer to add data to. + /// The offset to start adding data at. + /// The number of bytes to read. + /// Returns the number of bytes actually read. + public int ReadClearTextBuffer(byte[] outBuffer, int offset, int length) + { + if (length < 0) + { + throw new ArgumentOutOfRangeException("length"); + } + + int currentOffset = offset; + int currentLength = length; + + while (currentLength > 0) + { + if (available <= 0) + { + Fill(); + if (available <= 0) + { + return 0; + } + } + + int toCopy = Math.Min(currentLength, available); + Array.Copy(clearText, clearTextLength - (int)available, outBuffer, currentOffset, toCopy); + currentOffset += toCopy; + currentLength -= toCopy; + available -= toCopy; + } + return length; + } + + /// + /// Read a from the input stream. + /// + /// Returns the byte read. + public int ReadLeByte() + { + if (available <= 0) + { + Fill(); + if (available <= 0) + { + throw new ZipException("EOF in header"); + } + } + byte result = rawData[rawLength - available]; + available -= 1; + return result; + } + + /// + /// Read an in little endian byte order. + /// + /// The short value read case to an int. + public int ReadLeShort() + { + return ReadLeByte() | (ReadLeByte() << 8); + } + + /// + /// Read an in little endian byte order. + /// + /// The int value read. + public int ReadLeInt() + { + return ReadLeShort() | (ReadLeShort() << 16); + } + + /// + /// Read a in little endian byte order. + /// + /// The long value read. + public long ReadLeLong() + { + return (uint)ReadLeInt() | ((long)ReadLeInt() << 32); + } + +#if false//!NETCF_1_0 + /// + /// Get/set the to apply to any data. + /// + /// Set this value to null to have no transform applied. + public ICryptoTransform CryptoTransform + { + set { + cryptoTransform = value; + if ( cryptoTransform != null ) { + if ( rawData == clearText ) { + if ( internalClearText == null ) { + internalClearText = new byte[rawData.Length]; + } + clearText = internalClearText; + } + clearTextLength = rawLength; + if ( available > 0 ) { + cryptoTransform.TransformBlock(rawData, rawLength - available, available, clearText, rawLength - available); + } + } else { + clearText = rawData; + clearTextLength = rawLength; + } + } + } +#endif + + #region Instance Fields + int rawLength; + byte[] rawData; + + int clearTextLength; + byte[] clearText; +#if false//!NETCF_1_0 + byte[] internalClearText; +#endif + + int available; + +#if false//!NETCF_1_0 + ICryptoTransform cryptoTransform; +#endif + Stream inputStream; + #endregion + } + + /// + /// This filter stream is used to decompress data compressed using the "deflate" + /// format. The "deflate" format is described in RFC 1951. + /// + /// This stream may form the basis for other decompression filters, such + /// as the GZipInputStream. + /// + /// Author of the original java version: John Leuner. + /// + internal class InflaterInputStream : Stream + { + #region Constructors + /// + /// Create an InflaterInputStream with the default decompressor + /// and a default buffer size of 4KB. + /// + /// + /// The InputStream to read bytes from + /// + public InflaterInputStream(Stream baseInputStream) + : this(baseInputStream, new Inflater(), 4096) + { + } + + /// + /// Create an InflaterInputStream with the specified decompressor + /// and a default buffer size of 4KB. + /// + /// + /// The source of input data + /// + /// + /// The decompressor used to decompress data read from baseInputStream + /// + public InflaterInputStream(Stream baseInputStream, Inflater inf) + : this(baseInputStream, inf, 4096) + { + } + + /// + /// Create an InflaterInputStream with the specified decompressor + /// and the specified buffer size. + /// + /// + /// The InputStream to read bytes from + /// + /// + /// The decompressor to use + /// + /// + /// Size of the buffer to use + /// + public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize) + { + if (baseInputStream == null) + { + throw new ArgumentNullException("baseInputStream"); + } + + if (inflater == null) + { + throw new ArgumentNullException("inflater"); + } + + if (bufferSize <= 0) + { + throw new ArgumentOutOfRangeException("bufferSize"); + } + + this.baseInputStream = baseInputStream; + this.inf = inflater; + + inputBuffer = new InflaterInputBuffer(baseInputStream, bufferSize); + } + + #endregion + + /// + /// Get/set flag indicating ownership of underlying stream. + /// When the flag is true will close the underlying stream also. + /// + /// + /// The default value is true. + /// + public bool IsStreamOwner + { + get { return isStreamOwner; } + set { isStreamOwner = value; } + } + + /// + /// Skip specified number of bytes of uncompressed data + /// + /// + /// Number of bytes to skip + /// + /// + /// The number of bytes skipped, zero if the end of + /// stream has been reached + /// + /// + /// The number of bytes to skip is less than or equal to zero. + /// + public long Skip(long count) + { + if (count <= 0) + { + throw new ArgumentOutOfRangeException("count"); + } + + // v0.80 Skip by seeking if underlying stream supports it... + if (baseInputStream.CanSeek) + { + baseInputStream.Seek(count, SeekOrigin.Current); + return count; + } + else + { + int length = 2048; + if (count < length) + { + length = (int)count; + } + + byte[] tmp = new byte[length]; + int readCount = 1; + long toSkip = count; + + while ((toSkip > 0) && (readCount > 0)) + { + if (toSkip < length) + { + length = (int)toSkip; + } + + readCount = baseInputStream.Read(tmp, 0, length); + toSkip -= readCount; + } + + return count - toSkip; + } + } + + /// + /// Clear any cryptographic state. + /// + protected void StopDecrypting() + { +#if false//!NETCF_1_0 + inputBuffer.CryptoTransform = null; +#endif + } + + /// + /// Returns 0 once the end of the stream (EOF) has been reached. + /// Otherwise returns 1. + /// + public virtual int Available + { + get + { + return inf.IsFinished ? 0 : 1; + } + } + + /// + /// Fills the buffer with more data to decompress. + /// + /// + /// Stream ends early + /// + protected void Fill() + { + // Protect against redundant calls + if (inputBuffer.Available <= 0) + { + inputBuffer.Fill(); + if (inputBuffer.Available <= 0) + { + throw new SharpZipBaseException("Unexpected EOF"); + } + } + inputBuffer.SetInflaterInput(inf); + } + + #region Stream Overrides + /// + /// Gets a value indicating whether the current stream supports reading + /// + public override bool CanRead + { + get + { + return baseInputStream.CanRead; + } + } + + /// + /// Gets a value of false indicating seeking is not supported for this stream. + /// + public override bool CanSeek + { + get + { + return false; + } + } + + /// + /// Gets a value of false indicating that this stream is not writeable. + /// + public override bool CanWrite + { + get + { + return false; + } + } + + /// + /// A value representing the length of the stream in bytes. + /// + public override long Length + { + get + { + return inputBuffer.RawLength; + } + } + + /// + /// The current position within the stream. + /// Throws a NotSupportedException when attempting to set the position + /// + /// Attempting to set the position + public override long Position + { + get + { + return baseInputStream.Position; + } + set + { + throw new NotSupportedException("InflaterInputStream Position not supported"); + } + } + + /// + /// Flushes the baseInputStream + /// + public override void Flush() + { + baseInputStream.Flush(); + } + + /// + /// Sets the position within the current stream + /// Always throws a NotSupportedException + /// + /// The relative offset to seek to. + /// The defining where to seek from. + /// The new position in the stream. + /// Any access + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotSupportedException("Seek not supported"); + } + + /// + /// Set the length of the current stream + /// Always throws a NotSupportedException + /// + /// The new length value for the stream. + /// Any access + public override void SetLength(long value) + { + throw new NotSupportedException("InflaterInputStream SetLength not supported"); + } + + /// + /// Writes a sequence of bytes to stream and advances the current position + /// This method always throws a NotSupportedException + /// + /// Thew buffer containing data to write. + /// The offset of the first byte to write. + /// The number of bytes to write. + /// Any access + public override void Write(byte[] buffer, int offset, int count) + { + throw new NotSupportedException("InflaterInputStream Write not supported"); + } + + /// + /// Writes one byte to the current stream and advances the current position + /// Always throws a NotSupportedException + /// + /// The byte to write. + /// Any access + public override void WriteByte(byte value) + { + throw new NotSupportedException("InflaterInputStream WriteByte not supported"); + } + +#if !NETFX_CORE && !UWP + /// + /// Entry point to begin an asynchronous write. Always throws a NotSupportedException. + /// + /// The buffer to write data from + /// Offset of first byte to write + /// The maximum number of bytes to write + /// The method to be called when the asynchronous write operation is completed + /// A user-provided object that distinguishes this particular asynchronous write request from other requests + /// An IAsyncResult that references the asynchronous write + /// Any access + public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) + { + throw new NotSupportedException("InflaterInputStream BeginWrite not supported"); + } +#endif + +#if !NETFX_CORE && !UWP + /// + /// Closes the input stream. When + /// is true the underlying stream is also closed. + /// + public override void Close() + { + if (!isClosed) + { + isClosed = true; + if (isStreamOwner) + { + baseInputStream.Close(); + } + } + } +#else + public void Close() + { + if (!isClosed) + { + isClosed = true; + if (isStreamOwner) + { + //baseInputStream.Close(); + baseInputStream.Dispose(); + } + } + } +#endif + + /// + /// Reads decompressed data into the provided buffer byte array + /// + /// + /// The array to read and decompress data into + /// + /// + /// The offset indicating where the data should be placed + /// + /// + /// The number of bytes to decompress + /// + /// The number of bytes read. Zero signals the end of stream + /// + /// Inflater needs a dictionary + /// + public override int Read(byte[] buffer, int offset, int count) + { + if (inf.IsNeedingDictionary) + { + throw new SharpZipBaseException("Need a dictionary"); + } + + int remainingBytes = count; + while (true) + { + int bytesRead = inf.Inflate(buffer, offset, remainingBytes); + offset += bytesRead; + remainingBytes -= bytesRead; + + if (remainingBytes == 0 || inf.IsFinished) + { + break; + } + + if (inf.IsNeedingInput) + { + try + { + Fill(); + } + catch (SharpZipBaseException ex) + { + // Hack 16-05-25: Some PDF files lead to an "Unexpected EOF" exception. Is it safe to ignore this exception? + if (ex.Message != "Unexpected EOF") + throw; + // WB! early EOF: apparently not a big deal for some PDF pages: break out of the loop. + break; + } + } + else if (bytesRead == 0) + { + throw new ZipException("Don't know what to do"); + } + } + return count - remainingBytes; + } + #endregion + + #region Instance Fields + /// + /// Decompressor for this stream + /// + protected Inflater inf; + + /// + /// Input buffer for this stream. + /// + protected InflaterInputBuffer inputBuffer; + + /// + /// Base stream the inflater reads from. + /// + private Stream baseInputStream; + + ///// + ///// The compressed size + ///// + ////protected long csize; + +#if true || !NETFX_CORE + /// + /// Flag indicating wether this instance has been closed or not. + /// + bool isClosed; +#endif + + /// + /// Flag indicating wether this instance is designated the stream owner. + /// When closing if this flag is true the underlying stream is closed. + /// + bool isStreamOwner = true; + #endregion + } +} diff --git a/PdfSharp/SharpZipLib/Zip/Compression/Streams/OutputWindow.cs b/PdfSharp/SharpZipLib/Zip/Compression/Streams/OutputWindow.cs new file mode 100644 index 0000000..697ad66 --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/Compression/Streams/OutputWindow.cs @@ -0,0 +1,256 @@ +// OutputWindow.cs +// +// Copyright (C) 2001 Mike Krueger +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; + +namespace PdfSharp.SharpZipLib.Zip.Compression.Streams +{ + + /// + /// Contains the output from the Inflation process. + /// We need to have a window so that we can refer backwards into the output stream + /// to repeat stuff.
+ /// Author of the original java version: John Leuner + ///
+ internal class OutputWindow + { + #region Constants + const int WindowSize = 1 << 15; + const int WindowMask = WindowSize - 1; + #endregion + + #region Instance Fields + byte[] window = new byte[WindowSize]; //The window is 2^15 bytes + int windowEnd; + int windowFilled; + #endregion + + /// + /// Write a byte to this output window + /// + /// value to write + /// + /// if window is full + /// + public void Write(int value) + { + if (windowFilled++ == WindowSize) + { + throw new InvalidOperationException("Window full"); + } + window[windowEnd++] = (byte)value; + windowEnd &= WindowMask; + } + + + private void SlowRepeat(int repStart, int length, int distance) + { + while (length-- > 0) + { + window[windowEnd++] = window[repStart++]; + windowEnd &= WindowMask; + repStart &= WindowMask; + } + } + + /// + /// Append a byte pattern already in the window itself + /// + /// length of pattern to copy + /// distance from end of window pattern occurs + /// + /// If the repeated data overflows the window + /// + public void Repeat(int length, int distance) + { + if ((windowFilled += length) > WindowSize) + { + throw new InvalidOperationException("Window full"); + } + + int repStart = (windowEnd - distance) & WindowMask; + int border = WindowSize - length; + if ((repStart <= border) && (windowEnd < border)) + { + if (length <= distance) + { + System.Array.Copy(window, repStart, window, windowEnd, length); + windowEnd += length; + } + else + { + // We have to copy manually, since the repeat pattern overlaps. + while (length-- > 0) + { + window[windowEnd++] = window[repStart++]; + } + } + } + else + { + SlowRepeat(repStart, length, distance); + } + } + + /// + /// Copy from input manipulator to internal window + /// + /// source of data + /// length of data to copy + /// the number of bytes copied + public int CopyStored(StreamManipulator input, int length) + { + length = Math.Min(Math.Min(length, WindowSize - windowFilled), input.AvailableBytes); + int copied; + + int tailLen = WindowSize - windowEnd; + if (length > tailLen) + { + copied = input.CopyBytes(window, windowEnd, tailLen); + if (copied == tailLen) + { + copied += input.CopyBytes(window, 0, length - tailLen); + } + } + else + { + copied = input.CopyBytes(window, windowEnd, length); + } + + windowEnd = (windowEnd + copied) & WindowMask; + windowFilled += copied; + return copied; + } + + /// + /// Copy dictionary to window + /// + /// source dictionary + /// offset of start in source dictionary + /// length of dictionary + /// + /// If window isnt empty + /// + public void CopyDict(byte[] dictionary, int offset, int length) + { + if (dictionary == null) + { + throw new ArgumentNullException("dictionary"); + } + + if (windowFilled > 0) + { + throw new InvalidOperationException(); + } + + if (length > WindowSize) + { + offset += length - WindowSize; + length = WindowSize; + } + System.Array.Copy(dictionary, offset, window, 0, length); + windowEnd = length & WindowMask; + } + + /// + /// Get remaining unfilled space in window + /// + /// Number of bytes left in window + public int GetFreeSpace() + { + return WindowSize - windowFilled; + } + + /// + /// Get bytes available for output in window + /// + /// Number of bytes filled + public int GetAvailable() + { + return windowFilled; + } + + /// + /// Copy contents of window to output + /// + /// buffer to copy to + /// offset to start at + /// number of bytes to count + /// The number of bytes copied + /// + /// If a window underflow occurs + /// + public int CopyOutput(byte[] output, int offset, int len) + { + int copyEnd = windowEnd; + if (len > windowFilled) + { + len = windowFilled; + } + else + { + copyEnd = (windowEnd - windowFilled + len) & WindowMask; + } + + int copied = len; + int tailLen = len - copyEnd; + + if (tailLen > 0) + { + System.Array.Copy(window, WindowSize - tailLen, output, offset, tailLen); + offset += tailLen; + len = copyEnd; + } + System.Array.Copy(window, copyEnd - len, output, offset, len); + windowFilled -= copied; + if (windowFilled < 0) + { + throw new InvalidOperationException(); + } + return copied; + } + + /// + /// Reset by clearing window so GetAvailable returns 0 + /// + public void Reset() + { + windowFilled = windowEnd = 0; + } + } +} diff --git a/PdfSharp/SharpZipLib/Zip/Compression/Streams/StreamManipulator.cs b/PdfSharp/SharpZipLib/Zip/Compression/Streams/StreamManipulator.cs new file mode 100644 index 0000000..302e23d --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/Compression/Streams/StreamManipulator.cs @@ -0,0 +1,318 @@ +// StreamManipulator.cs +// +// Copyright (C) 2001 Mike Krueger +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; + +namespace PdfSharp.SharpZipLib.Zip.Compression.Streams +{ + + /// + /// This class allows us to retrieve a specified number of bits from + /// the input buffer, as well as copy big byte blocks. + /// + /// It uses an int buffer to store up to 31 bits for direct + /// manipulation. This guarantees that we can get at least 16 bits, + /// but we only need at most 15, so this is all safe. + /// + /// There are some optimizations in this class, for example, you must + /// never peek more than 8 bits more than needed, and you must first + /// peek bits before you may drop them. This is not a general purpose + /// class but optimized for the behaviour of the Inflater. + /// + /// Authors of the original java version: John Leuner, Jochen Hoenicke + /// + internal class StreamManipulator + { + #region Constructors + /// + /// Constructs a default StreamManipulator with all buffers empty + /// + public StreamManipulator() + { + } + #endregion + + /// + /// Get the next sequence of bits but don't increase input pointer. bitCount must be + /// less or equal 16 and if this call succeeds, you must drop + /// at least n - 8 bits in the next call. + /// + /// The number of bits to peek. + /// + /// the value of the bits, or -1 if not enough bits available. */ + /// + public int PeekBits(int bitCount) + { + if (bitsInBuffer_ < bitCount) + { + if (windowStart_ == windowEnd_) + { + return -1; // ok + } + buffer_ |= (uint)((window_[windowStart_++] & 0xff | + (window_[windowStart_++] & 0xff) << 8) << bitsInBuffer_); + bitsInBuffer_ += 16; + } + return (int)(buffer_ & ((1 << bitCount) - 1)); + } + + /// + /// Drops the next n bits from the input. You should have called PeekBits + /// with a bigger or equal n before, to make sure that enough bits are in + /// the bit buffer. + /// + /// The number of bits to drop. + public void DropBits(int bitCount) + { + buffer_ >>= bitCount; + bitsInBuffer_ -= bitCount; + } + + /// + /// Gets the next n bits and increases input pointer. This is equivalent + /// to followed by , except for correct error handling. + /// + /// The number of bits to retrieve. + /// + /// the value of the bits, or -1 if not enough bits available. + /// + public int GetBits(int bitCount) + { + int bits = PeekBits(bitCount); + if (bits >= 0) + { + DropBits(bitCount); + } + return bits; + } + + /// + /// Gets the number of bits available in the bit buffer. This must be + /// only called when a previous PeekBits() returned -1. + /// + /// + /// the number of bits available. + /// + public int AvailableBits + { + get + { + return bitsInBuffer_; + } + } + + /// + /// Gets the number of bytes available. + /// + /// + /// The number of bytes available. + /// + public int AvailableBytes + { + get + { + return windowEnd_ - windowStart_ + (bitsInBuffer_ >> 3); + } + } + + /// + /// Skips to the next byte boundary. + /// + public void SkipToByteBoundary() + { + buffer_ >>= (bitsInBuffer_ & 7); + bitsInBuffer_ &= ~7; + } + + /// + /// Returns true when SetInput can be called + /// + public bool IsNeedingInput + { + get + { + return windowStart_ == windowEnd_; + } + } + + /// + /// Copies bytes from input buffer to output buffer starting + /// at output[offset]. You have to make sure, that the buffer is + /// byte aligned. If not enough bytes are available, copies fewer + /// bytes. + /// + /// + /// The buffer to copy bytes to. + /// + /// + /// The offset in the buffer at which copying starts + /// + /// + /// The length to copy, 0 is allowed. + /// + /// + /// The number of bytes copied, 0 if no bytes were available. + /// + /// + /// Length is less than zero + /// + /// + /// Bit buffer isnt byte aligned + /// + public int CopyBytes(byte[] output, int offset, int length) + { + if (length < 0) + { + throw new ArgumentOutOfRangeException("length"); + } + + if ((bitsInBuffer_ & 7) != 0) + { + // bits_in_buffer may only be 0 or a multiple of 8 + throw new InvalidOperationException("Bit buffer is not byte aligned!"); + } + + int count = 0; + while ((bitsInBuffer_ > 0) && (length > 0)) + { + output[offset++] = (byte)buffer_; + buffer_ >>= 8; + bitsInBuffer_ -= 8; + length--; + count++; + } + + if (length == 0) + { + return count; + } + + int avail = windowEnd_ - windowStart_; + if (length > avail) + { + length = avail; + } + System.Array.Copy(window_, windowStart_, output, offset, length); + windowStart_ += length; + + if (((windowStart_ - windowEnd_) & 1) != 0) + { + // We always want an even number of bytes in input, see peekBits + buffer_ = (uint)(window_[windowStart_++] & 0xff); + bitsInBuffer_ = 8; + } + return count + length; + } + + /// + /// Resets state and empties internal buffers + /// + public void Reset() + { + buffer_ = 0; + windowStart_ = windowEnd_ = bitsInBuffer_ = 0; + } + + /// + /// Add more input for consumption. + /// Only call when IsNeedingInput returns true + /// + /// data to be input + /// offset of first byte of input + /// number of bytes of input to add. + public void SetInput(byte[] buffer, int offset, int count) + { + if (buffer == null) + { + throw new ArgumentNullException("buffer"); + } + + if (offset < 0) + { +#if NETCF_1_0 + throw new ArgumentOutOfRangeException("offset"); +#else + throw new ArgumentOutOfRangeException("offset", "Cannot be negative"); +#endif + } + + if (count < 0) + { +#if NETCF_1_0 + throw new ArgumentOutOfRangeException("count"); +#else + throw new ArgumentOutOfRangeException("count", "Cannot be negative"); +#endif + } + + if (windowStart_ < windowEnd_) + { + throw new InvalidOperationException("Old input was not completely processed"); + } + + int end = offset + count; + + // We want to throw an ArrayIndexOutOfBoundsException early. + // Note the check also handles integer wrap around. + if ((offset > end) || (end > buffer.Length)) + { + throw new ArgumentOutOfRangeException("count"); + } + + if ((count & 1) != 0) + { + // We always want an even number of bytes in input, see PeekBits + buffer_ |= (uint)((buffer[offset++] & 0xff) << bitsInBuffer_); + bitsInBuffer_ += 8; + } + + window_ = buffer; + windowStart_ = offset; + windowEnd_ = end; + } + + #region Instance Fields + private byte[] window_; + private int windowStart_; + private int windowEnd_; + + private uint buffer_; + private int bitsInBuffer_; + #endregion + } +} diff --git a/PdfSharp/SharpZipLib/Zip/ZipConstants.cs b/PdfSharp/SharpZipLib/Zip/ZipConstants.cs new file mode 100644 index 0000000..06e3b2d --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/ZipConstants.cs @@ -0,0 +1,678 @@ +// ZipConstants.cs +// +// Copyright (C) 2001 Mike Krueger +// Copyright (C) 2004 John Reilly +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +// HISTORY +// 22-12-2009 DavidPierson Added AES support + +using System; +using System.Globalization; +using System.Text; +using System.Threading; + +#if NETCF_1_0 || NETCF_2_0 +using System.Globalization; +#endif + +namespace PdfSharp.SharpZipLib.Zip +{ + + #region Enumerations + + /// + /// Determines how entries are tested to see if they should use Zip64 extensions or not. + /// + public enum UseZip64 + { + /// + /// Zip64 will not be forced on entries during processing. + /// + /// An entry can have this overridden if required ZipEntry.ForceZip64" + Off, + /// + /// Zip64 should always be used. + /// + On, + /// + /// #ZipLib will determine use based on entry values when added to archive. + /// + Dynamic, + } + + /// + /// The kind of compression used for an entry in an archive + /// + public enum CompressionMethod + { + /// + /// A direct copy of the file contents is held in the archive + /// + Stored = 0, + + /// + /// Common Zip compression method using a sliding dictionary + /// of up to 32KB and secondary compression from Huffman/Shannon-Fano trees + /// + Deflated = 8, + + /// + /// An extension to deflate with a 64KB window. Not supported by #Zip currently + /// + Deflate64 = 9, + + /// + /// BZip2 compression. Not supported by #Zip. + /// + BZip2 = 11, + + /// + /// WinZip special for AES encryption, Now supported by #Zip. + /// + WinZipAES = 99, + + } + + /// + /// Identifies the encryption algorithm used for an entry + /// + public enum EncryptionAlgorithm + { + /// + /// No encryption has been used. + /// + None = 0, + /// + /// Encrypted using PKZIP 2.0 or 'classic' encryption. + /// + PkzipClassic = 1, + /// + /// DES encryption has been used. + /// + Des = 0x6601, + /// + /// RC2 encryption has been used for encryption. + /// + RC2 = 0x6602, + /// + /// Triple DES encryption with 168 bit keys has been used for this entry. + /// + TripleDes168 = 0x6603, + /// + /// Triple DES with 112 bit keys has been used for this entry. + /// + TripleDes112 = 0x6609, + /// + /// AES 128 has been used for encryption. + /// + Aes128 = 0x660e, + /// + /// AES 192 has been used for encryption. + /// + Aes192 = 0x660f, + /// + /// AES 256 has been used for encryption. + /// + Aes256 = 0x6610, + /// + /// RC2 corrected has been used for encryption. + /// + RC2Corrected = 0x6702, + /// + /// Blowfish has been used for encryption. + /// + Blowfish = 0x6720, + /// + /// Twofish has been used for encryption. + /// + Twofish = 0x6721, + /// + /// RC4 has been used for encryption. + /// + RC4 = 0x6801, + /// + /// An unknown algorithm has been used for encryption. + /// + Unknown = 0xffff + } + + /// + /// Defines the contents of the general bit flags field for an archive entry. + /// + [Flags] + public enum GeneralBitFlags : int + { + /// + /// Bit 0 if set indicates that the file is encrypted + /// + Encrypted = 0x0001, + /// + /// Bits 1 and 2 - Two bits defining the compression method (only for Method 6 Imploding and 8,9 Deflating) + /// + Method = 0x0006, + /// + /// Bit 3 if set indicates a trailing data desciptor is appended to the entry data + /// + Descriptor = 0x0008, + /// + /// Bit 4 is reserved for use with method 8 for enhanced deflation + /// + ReservedPKware4 = 0x0010, + /// + /// Bit 5 if set indicates the file contains Pkzip compressed patched data. + /// Requires version 2.7 or greater. + /// + Patched = 0x0020, + /// + /// Bit 6 if set indicates strong encryption has been used for this entry. + /// + StrongEncryption = 0x0040, + /// + /// Bit 7 is currently unused + /// + Unused7 = 0x0080, + /// + /// Bit 8 is currently unused + /// + Unused8 = 0x0100, + /// + /// Bit 9 is currently unused + /// + Unused9 = 0x0200, + /// + /// Bit 10 is currently unused + /// + Unused10 = 0x0400, + /// + /// Bit 11 if set indicates the filename and + /// comment fields for this file must be encoded using UTF-8. + /// + UnicodeText = 0x0800, + /// + /// Bit 12 is documented as being reserved by PKware for enhanced compression. + /// + EnhancedCompress = 0x1000, + /// + /// Bit 13 if set indicates that values in the local header are masked to hide + /// their actual values, and the central directory is encrypted. + /// + /// + /// Used when encrypting the central directory contents. + /// + HeaderMasked = 0x2000, + /// + /// Bit 14 is documented as being reserved for use by PKware + /// + ReservedPkware14 = 0x4000, + /// + /// Bit 15 is documented as being reserved for use by PKware + /// + ReservedPkware15 = 0x8000 + } + + #endregion + + /// + /// This class contains constants used for Zip format files + /// + internal sealed class ZipConstants + { + #region Versions + /// + /// The version made by field for entries in the central header when created by this library + /// + /// + /// This is also the Zip version for the library when comparing against the version required to extract + /// for an entry. See ZipEntry.CanDecompress. + /// + public const int VersionMadeBy = 51; // was 45 before AES + + /// + /// The version made by field for entries in the central header when created by this library + /// + /// + /// This is also the Zip version for the library when comparing against the version required to extract + /// for an entry. See ZipInputStream.CanDecompressEntry. + /// + [Obsolete("Use VersionMadeBy instead")] + public const int VERSION_MADE_BY = 51; + + /// + /// The minimum version required to support strong encryption + /// + public const int VersionStrongEncryption = 50; + + /// + /// The minimum version required to support strong encryption + /// + [Obsolete("Use VersionStrongEncryption instead")] + public const int VERSION_STRONG_ENCRYPTION = 50; + + /// + /// Version indicating AES encryption + /// + public const int VERSION_AES = 51; + + /// + /// The version required for Zip64 extensions (4.5 or higher) + /// + public const int VersionZip64 = 45; + #endregion + + #region Header Sizes + /// + /// Size of local entry header (excluding variable length fields at end) + /// + public const int LocalHeaderBaseSize = 30; + + /// + /// Size of local entry header (excluding variable length fields at end) + /// + [Obsolete("Use LocalHeaderBaseSize instead")] + public const int LOCHDR = 30; + + /// + /// Size of Zip64 data descriptor + /// + public const int Zip64DataDescriptorSize = 24; + + /// + /// Size of data descriptor + /// + public const int DataDescriptorSize = 16; + + /// + /// Size of data descriptor + /// + [Obsolete("Use DataDescriptorSize instead")] + public const int EXTHDR = 16; + + /// + /// Size of central header entry (excluding variable fields) + /// + public const int CentralHeaderBaseSize = 46; + + /// + /// Size of central header entry + /// + [Obsolete("Use CentralHeaderBaseSize instead")] + public const int CENHDR = 46; + + /// + /// Size of end of central record (excluding variable fields) + /// + public const int EndOfCentralRecordBaseSize = 22; + + /// + /// Size of end of central record (excluding variable fields) + /// + [Obsolete("Use EndOfCentralRecordBaseSize instead")] + public const int ENDHDR = 22; + + /// + /// Size of 'classic' cryptographic header stored before any entry data + /// + public const int CryptoHeaderSize = 12; + + /// + /// Size of cryptographic header stored before entry data + /// + [Obsolete("Use CryptoHeaderSize instead")] + public const int CRYPTO_HEADER_SIZE = 12; + #endregion + + #region Header Signatures + + /// + /// Signature for local entry header + /// + public const int LocalHeaderSignature = 'P' | ('K' << 8) | (3 << 16) | (4 << 24); + + /// + /// Signature for local entry header + /// + [Obsolete("Use LocalHeaderSignature instead")] + public const int LOCSIG = 'P' | ('K' << 8) | (3 << 16) | (4 << 24); + + /// + /// Signature for spanning entry + /// + public const int SpanningSignature = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); + + /// + /// Signature for spanning entry + /// + [Obsolete("Use SpanningSignature instead")] + public const int SPANNINGSIG = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); + + /// + /// Signature for temporary spanning entry + /// + public const int SpanningTempSignature = 'P' | ('K' << 8) | ('0' << 16) | ('0' << 24); + + /// + /// Signature for temporary spanning entry + /// + [Obsolete("Use SpanningTempSignature instead")] + public const int SPANTEMPSIG = 'P' | ('K' << 8) | ('0' << 16) | ('0' << 24); + + /// + /// Signature for data descriptor + /// + /// + /// This is only used where the length, Crc, or compressed size isnt known when the + /// entry is created and the output stream doesnt support seeking. + /// The local entry cannot be 'patched' with the correct values in this case + /// so the values are recorded after the data prefixed by this header, as well as in the central directory. + /// + public const int DataDescriptorSignature = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); + + /// + /// Signature for data descriptor + /// + /// + /// This is only used where the length, Crc, or compressed size isnt known when the + /// entry is created and the output stream doesnt support seeking. + /// The local entry cannot be 'patched' with the correct values in this case + /// so the values are recorded after the data prefixed by this header, as well as in the central directory. + /// + [Obsolete("Use DataDescriptorSignature instead")] + public const int EXTSIG = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); + + /// + /// Signature for central header + /// + [Obsolete("Use CentralHeaderSignature instead")] + public const int CENSIG = 'P' | ('K' << 8) | (1 << 16) | (2 << 24); + + /// + /// Signature for central header + /// + public const int CentralHeaderSignature = 'P' | ('K' << 8) | (1 << 16) | (2 << 24); + + /// + /// Signature for Zip64 central file header + /// + public const int Zip64CentralFileHeaderSignature = 'P' | ('K' << 8) | (6 << 16) | (6 << 24); + + /// + /// Signature for Zip64 central file header + /// + [Obsolete("Use Zip64CentralFileHeaderSignature instead")] + public const int CENSIG64 = 'P' | ('K' << 8) | (6 << 16) | (6 << 24); + + /// + /// Signature for Zip64 central directory locator + /// + public const int Zip64CentralDirLocatorSignature = 'P' | ('K' << 8) | (6 << 16) | (7 << 24); + + /// + /// Signature for archive extra data signature (were headers are encrypted). + /// + public const int ArchiveExtraDataSignature = 'P' | ('K' << 8) | (6 << 16) | (7 << 24); + + /// + /// Central header digitial signature + /// + public const int CentralHeaderDigitalSignature = 'P' | ('K' << 8) | (5 << 16) | (5 << 24); + + /// + /// Central header digitial signature + /// + [Obsolete("Use CentralHeaderDigitalSignaure instead")] + public const int CENDIGITALSIG = 'P' | ('K' << 8) | (5 << 16) | (5 << 24); + + /// + /// End of central directory record signature + /// + public const int EndOfCentralDirectorySignature = 'P' | ('K' << 8) | (5 << 16) | (6 << 24); + + /// + /// End of central directory record signature + /// + [Obsolete("Use EndOfCentralDirectorySignature instead")] + public const int ENDSIG = 'P' | ('K' << 8) | (5 << 16) | (6 << 24); + #endregion + +#if true//NETCF_1_0 || NETCF_2_0 + // This isn't so great but is better than nothing. + // Trying to work out an appropriate OEM code page would be good. + // 850 is a good default for English speakers particularly in Europe. +#if SILVERLIGHT || NETFX_CORE || UWP + // TODO Do we need this for PDFsharp? If so, make it work. + static int defaultCodePage = 65001; +#else + static int defaultCodePage = CultureInfo.CurrentCulture.TextInfo.ANSICodePage; +#endif +#else + /// + /// Get OEM codepage from NetFX, which parses the NLP file with culture info table etc etc. + /// But sometimes it yields the special value of 1 which is nicknamed CodePageNoOEM in sources (might also mean CP_OEMCP, but Encoding puts it so). + /// This was observed on Ukranian and Hindu systems. + /// Given this value, throws an . + /// So replace it with some fallback, e.g. 437 which is the default codepage in a console in a default Windows installation. + /// + static int defaultCodePage = + // these values cause ArgumentException in subsequent calls to Encoding::GetEncoding() + ((Thread.CurrentThread.CurrentCulture.TextInfo.OEMCodePage == 1) || (Thread.CurrentThread.CurrentCulture.TextInfo.OEMCodePage == 2) || (Thread.CurrentThread.CurrentCulture.TextInfo.OEMCodePage == 3) || (Thread.CurrentThread.CurrentCulture.TextInfo.OEMCodePage == 42)) + ? 437 // The default OEM encoding in a console in a default Windows installation, as a fallback. + : Thread.CurrentThread.CurrentCulture.TextInfo.OEMCodePage; +#endif + + /// + /// Default encoding used for string conversion. 0 gives the default system OEM code page. + /// Dont use unicode encodings if you want to be Zip compatible! + /// Using the default code page isnt the full solution necessarily + /// there are many variable factors, codepage 850 is often a good choice for + /// European users, however be careful about compatibility. + /// + public static int DefaultCodePage + { + get + { + return defaultCodePage; + } + set + { + if ((value < 0) || (value > 65535) || + (value == 1) || (value == 2) || (value == 3) || (value == 42)) + { + throw new ArgumentOutOfRangeException("value"); + } + + defaultCodePage = value; + } + } + + /// + /// Convert a portion of a byte array to a string. + /// + /// + /// Data to convert to string + /// + /// + /// Number of bytes to convert starting from index 0 + /// + /// + /// data[0]..data[count - 1] converted to a string + /// + public static string ConvertToString(byte[] data, int count) + { + if (data == null) + { + return string.Empty; + } + +#if SILVERLIGHT || NETFX_CORE + return Encoding.GetEncoding("utf-8").GetString(data, 0, count); +#else + return Encoding.GetEncoding(DefaultCodePage).GetString(data, 0, count); +#endif + } + + /// + /// Convert a byte array to string + /// + /// + /// Byte array to convert + /// + /// + /// dataconverted to a string + /// + public static string ConvertToString(byte[] data) + { + if (data == null) + { + return string.Empty; + } + return ConvertToString(data, data.Length); + } + + /// + /// Convert a byte array to string + /// + /// The applicable general purpose bits flags + /// + /// Byte array to convert + /// + /// The number of bytes to convert. + /// + /// dataconverted to a string + /// + public static string ConvertToStringExt(int flags, byte[] data, int count) + { + if (data == null) + { + return string.Empty; + } + + if ((flags & (int)GeneralBitFlags.UnicodeText) != 0) + { + return Encoding.UTF8.GetString(data, 0, count); + } + else + { + return ConvertToString(data, count); + } + } + + /// + /// Convert a byte array to string + /// + /// + /// Byte array to convert + /// + /// The applicable general purpose bits flags + /// + /// dataconverted to a string + /// + public static string ConvertToStringExt(int flags, byte[] data) + { + if (data == null) + { + return string.Empty; + } + + if ((flags & (int)GeneralBitFlags.UnicodeText) != 0) + { + return Encoding.UTF8.GetString(data, 0, data.Length); + } + else + { + return ConvertToString(data, data.Length); + } + } + + /// + /// Convert a string to a byte array + /// + /// + /// String to convert to an array + /// + /// Converted array + public static byte[] ConvertToArray(string str) + { + if (str == null) + { + return new byte[0]; + } + +#if SILVERLIGHT || NETFX_CORE + return Encoding.GetEncoding("utf-8").GetBytes(str); +#else + return Encoding.GetEncoding(DefaultCodePage).GetBytes(str); +#endif + } + + /// + /// Convert a string to a byte array + /// + /// The applicable general purpose bits flags + /// + /// String to convert to an array + /// + /// Converted array + public static byte[] ConvertToArray(int flags, string str) + { + if (str == null) + { + return new byte[0]; + } + + if ((flags & (int)GeneralBitFlags.UnicodeText) != 0) + { + return Encoding.UTF8.GetBytes(str); + } + else + { + return ConvertToArray(str); + } + } + + + /// + /// Initialise default instance of ZipConstants + /// + /// + /// Private to prevent instances being created. + /// + ZipConstants() + { + // Do nothing + } + } +} diff --git a/PdfSharp/SharpZipLib/Zip/ZipException.cs b/PdfSharp/SharpZipLib/Zip/ZipException.cs new file mode 100644 index 0000000..de2f0e9 --- /dev/null +++ b/PdfSharp/SharpZipLib/Zip/ZipException.cs @@ -0,0 +1,93 @@ +// ZipException.cs +// +// Copyright (C) 2001 Mike Krueger +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; + +#if false//!NETCF_1_0 && !NETCF_2_0 +using System.Runtime.Serialization; +#endif + +namespace PdfSharp.SharpZipLib.Zip +{ + /// + /// Represents exception conditions specific to Zip archive handling + /// +#if false//!NETCF_1_0 && !NETCF_2_0 + [Serializable] +#endif + internal class ZipException : SharpZipBaseException + { +#if false//!NETCF_1_0 && !NETCF_2_0 + /// + /// Deserialization constructor + /// + /// for this constructor + /// for this constructor + protected ZipException(SerializationInfo info, StreamingContext context ) + : base( info, context ) + { + } +#endif + + /// + /// Initializes a new instance of the ZipException class. + /// + public ZipException() + { + } + + /// + /// Initializes a new instance of the ZipException class with a specified error message. + /// + /// The error message that explains the reason for the exception. + public ZipException(string message) + : base(message) + { + } + + /// + /// Initialise a new instance of ZipException. + /// + /// A message describing the error. + /// The exception that is the cause of the current exception. + public ZipException(string message, Exception exception) + : base(message, exception) + { + } + } +} diff --git a/PdfSharp/Silverlight/SilverlightHelper.cs b/PdfSharp/Silverlight/SilverlightHelper.cs new file mode 100644 index 0000000..e3082d7 --- /dev/null +++ b/PdfSharp/Silverlight/SilverlightHelper.cs @@ -0,0 +1,83 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.IsolatedStorage; +using System.Runtime.InteropServices; + +namespace PdfSharp.Silverlight +{ + /// + /// Useful stuff to show PDF files in Silverlight applications for + /// testing and debugging purposes. + /// Some functions require elevated trust. + /// + public class SilverlightHelper + { + /// + /// Gets the full path of UserStore for application. + /// + public static string FullPathOfUserStoreForApplication + { + get + { + if (_fullPathOfUserStoreForApplication != null) + return _fullPathOfUserStoreForApplication; + + // More simple than I expected... + string root = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"Low\Microsoft\Silverlight\is"; + IsolatedStorageFile userStore = IsolatedStorageFile.GetUserStoreForApplication(); + string markerFile = Guid.NewGuid().ToString(); + userStore.CreateFile(markerFile).Close(); + // Won't use Linq here (FirstOrDefault). + IEnumerator enumerator = Directory.EnumerateFileSystemEntries(root, markerFile, SearchOption.AllDirectories).GetEnumerator(); + enumerator.MoveNext(); + _fullPathOfUserStoreForApplication = Path.GetDirectoryName(enumerator.Current); + userStore.DeleteFile(markerFile); + return _fullPathOfUserStoreForApplication; + } + } + static string _fullPathOfUserStoreForApplication; + + /// + /// Uses ShellExecute to open a PDF file in UserStore. + /// + public static void ShowPdfFileFromUserStore(string path) + { + string fullPath = Path.Combine(FullPathOfUserStoreForApplication, path); + ShellExecute(IntPtr.Zero, "open", fullPath, IntPtr.Zero, null, 5); + } + + [DllImport("Shell32.dll")] + static extern UInt32 ShellExecute(IntPtr hwnd, string pOperation, string pFile, + IntPtr pParameters, string pDirectory, UInt32 nShowCmd); + } +} diff --git a/PdfSharp/SilverlightInternals/AgDrawingContext.cs b/PdfSharp/SilverlightInternals/AgDrawingContext.cs new file mode 100644 index 0000000..854c4bf --- /dev/null +++ b/PdfSharp/SilverlightInternals/AgDrawingContext.cs @@ -0,0 +1,392 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if SILVERLIGHT +using System.Collections.Generic; +using System.Diagnostics; +using System.Windows.Controls; +using System.Windows.Shapes; +using PdfSharp.Drawing; +using PdfSharp.Internal; + +// ReSharper disable ConvertPropertyToExpressionBody + +namespace System.Windows.Media +{ + /// + /// The WPF graphic system has the DrawingContext class that implements the low-level + /// primitives for retained drawing. The lowest level in Silverlight a some non-aggregated + /// UI elements like several Shape objects, TextBlock and Glyphs. + /// This Silverlight version of DrawingContext simplyfies the implementation of XGraphics. + /// It converts function calls to DrawingContext into UI elements layered on Canvas + /// objects. + /// + internal class AgDrawingContext + { + /// + /// Initializes a new instance of the class. + /// Drawing creates objects that are placed on the specified canvas. + /// + internal AgDrawingContext(Canvas canvas) + { + if (canvas == null) + throw new ArgumentNullException("canvas"); + + // The size of the canvas is not used and does not matter. + // The properties of the canvas are not modified. Instead a new + // canvas is added to its Children list. + _canvasStack.Push(canvas); + PushCanvas(); + } + + public void Close() + { + // There is nothing to close in Silverlight. + } + + // There are no drawing objects in Silverlight. + //public void DrawDrawing(Drawing drawing); + + public void DrawEllipse(Brush brush, Pen pen, Point center, double radiusX, double radiusY) + { + Ellipse ellipse = new Ellipse(); + SetupShape(ellipse, center.X - radiusX, center.Y - radiusY, radiusX * 2, radiusY * 2, brush, pen); + ellipse.Fill = brush; + ActiveCanvas.Children.Add(ellipse); + } + + //public void DrawEllipse(Brush brush, Pen pen, Point center, AnimationClock centerAnimations, double radiusX, AnimationClock radiusXAnimations, double radiusY, AnimationClock radiusYAnimations); + + public void DrawGeometry(Brush brush, Pen pen, Geometry geometry) + { + Path path = new Path(); + SetupShape(path, 0, 0, Double.NaN, Double.NaN, brush, pen); + path.Data = geometry; + ActiveCanvas.Children.Add(path); + } + + public void DrawPath(Brush brush, Pen pen, Path path) + { + SetupShape(path, brush, pen); + ActiveCanvas.Children.Add(path); + } + + //public void DrawGlyphRun(Brush foregroundBrush, GlyphRun glyphRun); + + public void DrawImage(ImageSource imageSource, Rect rectangle) + { + // TODO + Image image = new Image(); + image.Source = imageSource; + Canvas.SetLeft(image, rectangle.X); + Canvas.SetTop(image, rectangle.Y); + image.Width = rectangle.Width; + image.Height = rectangle.Height; + + ActiveCanvas.Children.Add(image); + } + + public void DrawLine(Pen pen, Point point0, Point point1) + { +#if true + Line line = new Line(); + SetupShape(line, 0, 0, Double.NaN, Double.NaN, null, pen); + line.X1 = point0.X; + line.Y1 = point0.Y; + line.X2 = point1.X; + line.Y2 = point1.Y; + ActiveCanvas.Children.Add(line); +#else + Line line = new Line(); + double x = Math.Min(point0.X, point1.X); + double y = Math.Min(point0.Y, point1.Y); + + // Prevent clipping thick lines parallel to shape boundaries. + double delta = 0; // 2 * pen.Thickness; + //SetupShape(line, x - delta, y - delta, width + 2 * delta, height + 2 * delta, null, pen); + SetupShape(line, x - delta, y - delta, Double.NaN, Double.NaN, null, pen); + line.X1 = point0.X - x + delta; + line.Y1 = point0.Y - y + delta; + line.X2 = point1.X - x + delta; + line.Y2 = point1.Y - y + delta; + ActiveCanvas.Children.Add(line); +#endif + } + + public void DrawRectangle(Brush brush, Pen pen, Rect rect) + { + Rectangle rectangle = new Rectangle(); + SetupShape(rectangle, rect.X, rect.Y, rect.Width, rect.Height, brush, pen); + ActiveCanvas.Children.Add(rectangle); + } + + public void DrawRoundedRectangle(Brush brush, Pen pen, Rect rect, double radiusX, double radiusY) + { + Rectangle rectangle = new Rectangle(); + SetupShape(rectangle, rect.X, rect.Y, rect.Width, rect.Height, brush, pen); + rectangle.RadiusX = radiusX; + rectangle.RadiusY = radiusY; + ActiveCanvas.Children.Add(rectangle); + } + + static void SetupShape(Shape shape, double x, double y, double width, double height, Brush brush, Pen pen) + { + if (width < 0) // nan < 0 is false + { + x += width; + width = -width; + } + if (height < 0) + { + y += height; + height = -height; + } + Canvas.SetLeft(shape, x); + Canvas.SetTop(shape, y); + + // Setting a double dependency property to Double.NaN is not the same + // as simply not setting it. I consider this is a bug in the Silverlight run-time. + if (!DoubleUtil.IsNaN(width)) + shape.Width = width; + if (!DoubleUtil.IsNaN(height)) + shape.Height = height; + SetupShape(shape, brush, pen); + } + + static void SetupShape(Shape shape, Brush brush, Pen pen) + { + shape.Fill = brush; + if (pen != null) + { + DoubleCollection dashArray = new DoubleCollection(); + foreach (double value in pen.DashArray) + dashArray.Add(value); + + shape.Stroke = pen.Brush; + shape.StrokeThickness = pen.Thickness; + shape.StrokeDashArray = dashArray; + shape.StrokeDashOffset = pen.DashOffset; + shape.StrokeStartLineCap = pen.StartLineCap; + shape.StrokeEndLineCap = pen.EndLineCap; + shape.StrokeDashCap = pen.DashCap; + shape.StrokeLineJoin = pen.LineJoin; + shape.StrokeMiterLimit = pen.MiterLimit; + } + } + + //public void DrawRoundedRectangle(Brush brush, Pen pen, Rect rectangle, AnimationClock rectangleAnimations, double radiusX, AnimationClock radiusXAnimations, double radiusY, AnimationClock radiusYAnimations); + //public void DrawText(FormattedText formattedText, Point origin); + //public void DrawVideo(MediaPlayer player, Rect rectangle); + //public void DrawVideo(MediaPlayer player, Rect rectangle, AnimationClock rectangleAnimations); + + public void Pop(int count) + { + Debug.Assert(_canvasStack.Count - 1 > count); + for (int idx = 0; idx < count; idx++) + _canvasStack.Pop(); + } + + public void PushClip(Geometry clipGeometry) + { + Canvas canvas = ActiveCanvas; + if (canvas.Children.Count > 0 || canvas.Clip != null) + canvas = PushCanvas(); + canvas.Clip = clipGeometry; + } + + //public void PushEffect(BitmapEffect effect, BitmapEffectInput effectInput); + //public void PushGuidelineSet(GuidelineSet guidelines); + + public void PushOpacity(double opacity) + { + Canvas canvas = ActiveCanvas; + if (canvas.Children.Count > 0 || !DoubleUtil.IsNaN(canvas.Opacity)) + canvas = PushCanvas(); + canvas.Opacity = opacity; + } + + //public void PushOpacity(double opacity, AnimationClock opacityAnimations); + + public void PushOpacityMask(Brush opacityMask) + { + Canvas canvas = ActiveCanvas; + if (canvas.Children.Count > 0 || canvas.OpacityMask != null) + canvas = PushCanvas(); + canvas.OpacityMask = opacityMask; + } + + public void PushTransform(MatrixTransform transform) + { + Canvas canvas = ActiveCanvas; + if (canvas.Children.Count > 0 || canvas.RenderTransform != null) + canvas = PushCanvas(); + canvas.RenderTransform = transform; + } + + /// + /// Resembles the DrawString function of GDI+. + /// + [Obsolete("Text may be drawn at the wrong position. Requires update!")] + public void DrawString(XGraphics gfx, string text, XFont font, XBrush brush, XRect layoutRectangle, XStringFormat format) + { + double x = layoutRectangle.X; + double y = layoutRectangle.Y; + + double lineSpace = font.GetHeight(); //old: font.GetHeight(gfx); + double cyAscent = lineSpace * font.CellAscent / font.CellSpace; + double cyDescent = lineSpace * font.CellDescent / font.CellSpace; + + bool bold = (font.Style & XFontStyle.Bold) != 0; + bool italic = (font.Style & XFontStyle.Italic) != 0; + bool strikeout = (font.Style & XFontStyle.Strikeout) != 0; + bool underline = (font.Style & XFontStyle.Underline) != 0; + + //Debug.Assert(font.GlyphTypeface != null); + TextBlock textBlock = new TextBlock(); //FontHelper.CreateTextBlock(text, font.GlyphTypeface, font.Size, brush.RealizeWpfBrush()); + if (layoutRectangle.Width > 0) + textBlock.Width = layoutRectangle.Width; + + switch (format.Alignment) + { + case XStringAlignment.Near: + textBlock.TextAlignment = TextAlignment.Left; + break; + + case XStringAlignment.Center: + textBlock.TextAlignment = TextAlignment.Center; + break; + + case XStringAlignment.Far: + textBlock.TextAlignment = TextAlignment.Right; + break; + } + + if (gfx.PageDirection == XPageDirection.Downwards) + { + switch (format.LineAlignment) + { + case XLineAlignment.Near: + //y += cyAscent; + break; + + case XLineAlignment.Center: + // TODO use CapHeight. PDFlib also uses 3/4 of ascent + y += (layoutRectangle.Height - textBlock.ActualHeight) / 2; + //y += -formattedText.Baseline + (font.Size * font.Metrics.CapHeight / font.unitsPerEm / 2) + layoutRectangle.Height / 2; + break; + + case XLineAlignment.Far: + y += layoutRectangle.Height - textBlock.ActualHeight; + //y -= textBlock.ActualHeight; //-formattedText.Baseline - cyDescent + layoutRectangle.Height; + break; + + case XLineAlignment.BaseLine: +//#if !WINDOWS_PHONE + y -= textBlock.BaselineOffset; +//#else +// // No BaselineOffset in Silverlight WP yet. +// //y -= textBlock.BaselineOffset; +//#endif + break; + } + } + else + { + throw new NotImplementedException("XPageDirection.Downwards"); + } + + //if (bold && !descriptor.IsBoldFace) + //{ + // // TODO: emulate bold by thicker outline + //} + + //if (italic && !descriptor.IsBoldFace) + //{ + // // TODO: emulate italic by shearing transformation + //} + + if (underline) + textBlock.TextDecorations = TextDecorations.Underline; + + // No strikethrough in Silverlight + //if (strikeout) + //{ + // formattedText.SetTextDecorations(TextDecorations.Strikethrough); + // //double strikeoutPosition = lineSpace * realizedFont.FontDescriptor.descriptor.StrikeoutPosition / font.cellSpace; + // //double strikeoutSize = lineSpace * realizedFont.FontDescriptor.descriptor.StrikeoutSize / font.cellSpace; + // //DrawRectangle(null, brush, x, y - strikeoutPosition - strikeoutSize, width, strikeoutSize); + //} + + Canvas.SetLeft(textBlock, x); + Canvas.SetTop(textBlock, y); + ActiveCanvas.Children.Add(textBlock); + } + + ///// + ///// Resembles the MeasureString function of GDI+. + ///// + //[Obsolete("Use XGraphics.MeasureString()")] + //public XSize MeasureString(XGraphics gfx, string text, XFont font, XStringFormat stringFormat) + //{ + // //Debug.Assert(font.GlyphTypeface != null); + // TextBlock textBlock = new TextBlock(); //FontHelper.CreateTextBlock(text, font.GlyphTypeface, font.Size, null); + // // Looks very much like a hack, but is the recommended way documented by Microsoft. + // return new XSize(textBlock.ActualWidth, textBlock.ActualHeight); + //} + + /// + /// Create new canvas and add it to the children of the current canvas. + /// + internal Canvas PushCanvas() + { + Canvas canvas = new Canvas(); + ActiveCanvas.Children.Add(canvas); + _canvasStack.Push(canvas); + return canvas; + } + + /// + /// Gets the currently active canvas. + /// + Canvas ActiveCanvas + { + get { return _canvasStack.Peek(); } + } + + /// + /// Gets the nesting level of Canvas objects. + /// + internal int Level + { + get { return _canvasStack.Count; } + } + readonly Stack _canvasStack = new Stack(); + } +} +#endif diff --git a/PdfSharp/SilverlightInternals/AgExtensions.cs b/PdfSharp/SilverlightInternals/AgExtensions.cs new file mode 100644 index 0000000..60908fb --- /dev/null +++ b/PdfSharp/SilverlightInternals/AgExtensions.cs @@ -0,0 +1,55 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if SILVERLIGHT +using System.Windows.Media; +using System.Windows.Shapes; + +namespace PdfSharp +{ + static class AgExtensions + { + public static Pen PenFromShape(Shape shape) + { + Pen pen = new Pen(); + pen.Brush = shape.Stroke; + pen.Thickness = shape.StrokeThickness; + // Todo + pen.DashArray = new DoubleCollection(); + pen.StartLineCap = PenLineCap.Flat; + pen.EndLineCap = PenLineCap.Flat; + pen.DashCap = PenLineCap.Flat; + pen.LineJoin = PenLineJoin.Miter; // TODO: check default values + pen.MiterLimit = 10; // TODO: check default values + + return pen; + } + } +} +#endif diff --git a/PdfSharp/SilverlightInternals/AgHacks.cs b/PdfSharp/SilverlightInternals/AgHacks.cs new file mode 100644 index 0000000..9b34b37 --- /dev/null +++ b/PdfSharp/SilverlightInternals/AgHacks.cs @@ -0,0 +1,193 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if SILVERLIGHT || UWP +using System; + +#if SILVERLIGHT +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; +#endif + +/// +/// SerializableAttribute for compatibility with Silverlight. +/// +public class SerializableAttribute : Attribute +{ } + +/// +/// ICloneable for compatibility with Silverlight. +/// +public interface ICloneable +{ + /// + /// Creates a new object that is a copy of the current instance + /// + Object Clone(); +} + +namespace PdfSharp +{ + /// + /// The exception that is thrown when a non-fatal application error occurs. + /// + public class ApplicationException : Exception + { + /// + /// Initializes a new instance of the class. + /// + public ApplicationException() + { } + + /// + /// Initializes a new instance of the class. + /// + public ApplicationException(string message) + : base(message) + { } + + /// + /// Initializes a new instance of the class. + /// + /// The error message that explains the reason for the exception. + /// The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + public ApplicationException(string message, Exception innerException) + : base(message, innerException) + { } + } + +#if SILVERLIGHT + /// + /// The exception that is thrown when the value of an argument is outside + /// the allowable range of values as defined by the invoked method. + /// + public class ArgumentOutOfRangeException : ArgumentException + { + /// + /// Initializes a new instance of the class. + /// + public ArgumentOutOfRangeException() + { } + + /// + /// Initializes a new instance of the class. + /// + public ArgumentOutOfRangeException(string message) + : base(message) + { } + + /// + /// Initializes a new instance of the class. + /// + public ArgumentOutOfRangeException(string message, string message2) + : base(message, message2) + { } + + /// + /// Initializes a new instance of the class. + /// + public ArgumentOutOfRangeException(string message, object value, string message2) + : base(message, message2) + { } + + /// + /// Initializes a new instance of the class. + /// + public ArgumentOutOfRangeException(string message, Exception innerException) + : base(message, innerException) + { } + } +#endif + + /// + /// The exception thrown when using invalid arguments that are enumerators. + /// + public class InvalidEnumArgumentException : ArgumentException + { + /// + /// Initializes a new instance of the class. + /// + public InvalidEnumArgumentException() + { } + + /// + /// Initializes a new instance of the class. + /// + public InvalidEnumArgumentException(string message) + : base(message) + { } + + /// + /// Initializes a new instance of the class. + /// + public InvalidEnumArgumentException(string message, string message2) + : base(message, message2) + { } + + /// + /// Initializes a new instance of the class. + /// + public InvalidEnumArgumentException(string message, int n, Type type) + : base(message) + { } + + /// + /// Initializes a new instance of the class. + /// + public InvalidEnumArgumentException(string message, Exception innerException) + : base(message, innerException) + { } + } + + //public class FileNotFoundException : Exception + //{ + // public FileNotFoundException() + // { } + + // public FileNotFoundException(string message) + // : base(message) + // { } + + // public FileNotFoundException(string message, string path) + // : base(message + "/" + path) + // { } + + // public FileNotFoundException(string message, Exception innerException) + // : base(message, innerException) + // { } + //} +} +#endif diff --git a/PdfSharp/SilverlightInternals/Pen.cs b/PdfSharp/SilverlightInternals/Pen.cs new file mode 100644 index 0000000..22ca6d9 --- /dev/null +++ b/PdfSharp/SilverlightInternals/Pen.cs @@ -0,0 +1,100 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if SILVERLIGHT +using System; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace System.Windows.Media +{ + /// + /// Imitates the WPF Pen object. + /// + internal sealed class Pen + { + public Pen() + { + Thickness = 1; + DashArray = new DoubleCollection(); + StartLineCap = PenLineCap.Flat; + EndLineCap = PenLineCap.Flat; + DashCap = PenLineCap.Flat; + LineJoin = PenLineJoin.Miter; // TODO: check default values + MiterLimit = 10; // TODO: check default values + } + + //public static Pen FromShape(Shape shape) + //{ + // Pen pen = new Pen(); + // pen.Brush = shape.Stroke; + // pen.Thickness = shape.StrokeThickness; + // // Todo + // pen.DashArray = new DoubleCollection(); + // pen.StartLineCap = PenLineCap.Flat; + // pen.EndLineCap = PenLineCap.Flat; + // pen.DashCap = PenLineCap.Flat; + // pen.LineJoin = PenLineJoin.Miter; // TODO: check default values + // pen.MiterLimit = 10; // TODO: check default values + + // return pen; + //} + + public Brush Brush { get; set; } + + public double Thickness { get; set; } + + //public DashStyle DashStyle { get; set; } + + public DoubleCollection DashArray { get; set; } + + public double DashOffset { get; set; } + + public PenLineCap StartLineCap { get; set; } + + public PenLineCap EndLineCap { get; set; } + + public PenLineCap DashCap { get; set; } + + public PenLineJoin LineJoin { get; set; } + + public double MiterLimit { get; set; } + + //public Pen Clone(); + //public Pen CloneCurrentValue(); + } +} +#endif diff --git a/PdfSharp/StrongnameKey.snk b/PdfSharp/StrongnameKey.snk new file mode 100644 index 0000000..ce2edba Binary files /dev/null and b/PdfSharp/StrongnameKey.snk differ diff --git a/PdfSharp/Windows/PagePreview-ag.xaml b/PdfSharp/Windows/PagePreview-ag.xaml new file mode 100644 index 0000000..9a6bc93 --- /dev/null +++ b/PdfSharp/Windows/PagePreview-ag.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PdfSharp/Windows/PagePreview-ag.xaml.cs b/PdfSharp/Windows/PagePreview-ag.xaml.cs new file mode 100644 index 0000000..9d01805 --- /dev/null +++ b/PdfSharp/Windows/PagePreview-ag.xaml.cs @@ -0,0 +1,163 @@ +#if !NETSTANDARD2_0 + +using System; +using System.Collections.Generic; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace PdfSharp.Windows +{ + /// + /// A simple page viewer for WPF and Silverlight. + /// Not based on empira application framework. + /// + public partial class PagePreview : UserControl + { + /// + /// Initializes a new instance of the class. + /// + public PagePreview() + { + InitializeComponent(); + + //TextBlock tb = new TextBlock(); + //Binding b = new Binding("FontSize"); + //b.Source = this; + //tb.SetBinding(TextBlock.FontSizeProperty, b); + + //canvasGrid.SetBinding(WidthProperty, new Binding("CanvasWidth")); + //canvasGrid.SetBinding(HeightProperty, new Binding("CanvasHeight")); + //canvas.SetBinding(WidthProperty, new Binding("CanvasWidth")); + //canvas.SetBinding(HeightProperty, new Binding("CanvasHeight")); + + LayoutRoot.DataContext = this; + Zoom = (Zoom)100; + } + + void Test() + { + double factor = 1; + int zoom = (int)Zoom; + if (zoom > 0) + factor = Math.Max(Math.Min(zoom, 800), 10) / 100.0; + else + factor = 1; + + canvasGrid.Width = 480 * factor; + canvasGrid.Height = 640 * factor; + scaleTransform.ScaleX = factor; + scaleTransform.ScaleY = factor; + + //CanvasWidth = 480 * factor; + //CanvasHeight = 640 * factor; + //CanvasScaleX = 1 * factor; + //CanvasScaleY = 1 * factor; + } + + /// + /// Gets the canvas. + /// + public Canvas Canvas + { + get { return canvas; } + } + + /// + /// Gets or sets the size of the page 1/96 inch. + /// + public Size PageSize + { + get { return (Size)GetValue(PageSizeProperty); } + set { SetValue(PageSizeProperty, value); } + } + + /// + /// DependencyProperty of PageSize. + /// + public readonly DependencyProperty PageSizeProperty = + DependencyProperty.Register("PageSize", typeof(Size), typeof(PagePreview), new PropertyMetadata(new Size(480, 640), PageSizeChanged)); + + private static void PageSizeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ((PagePreview)d).Test(); + } + + /// + /// Gets or sets the zoom. + /// + public Zoom Zoom + { + get { return (Zoom)GetValue(ZoomProperty); } + set { SetValue(ZoomProperty, value); } + } + + /// + /// DependencyProperty of Zoom. + /// + public readonly DependencyProperty ZoomProperty = + DependencyProperty.Register("Zoom", typeof(Zoom), typeof(PagePreview), new PropertyMetadata(Zoom.FullPage, ZoomChanged)); + + private static void ZoomChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ((PagePreview)d).Test(); + } + +#if _ + public double CanvasWidth + { + get { return (double)GetValue(CanvasWidthProperty); } + set { SetValue(CanvasWidthProperty, value); } + } + public readonly DependencyProperty CanvasWidthProperty = + DependencyProperty.Register("CanvasWidth", typeof(double), typeof(PagePreview), new PropertyMetadata(210.0)); + + public double CanvasHeight + { + get { return (double)GetValue(CanvasHeightProperty); } + set { SetValue(CanvasHeightProperty, value); } + } + public readonly DependencyProperty CanvasHeightProperty = + DependencyProperty.Register("CanvasHeight", typeof(double), typeof(PagePreview), new PropertyMetadata(297.0)); + + public double CanvasScaleX + { + get { return (double)GetValue(CanvasScaleXProperty); } + set { SetValue(CanvasScaleXProperty, value); } + } + public readonly DependencyProperty CanvasScaleXProperty = + DependencyProperty.Register("CanvasScaleX", typeof(double), typeof(PagePreview), new PropertyMetadata(1.0)); + + public double CanvasScaleY + { + get { return (double)GetValue(CanvasScaleYProperty); } + set { SetValue(CanvasScaleYProperty, value); } + } + public readonly DependencyProperty CanvasScaleYProperty = + DependencyProperty.Register("CanvasScaleY", typeof(double), typeof(PagePreview), new PropertyMetadata(1.0)); +#endif + + /// + /// Gets or sets the page visibility. + /// + public Visibility PageVisibility + { + get { return (Visibility)GetValue(PageVisibilityProperty); } + set { SetValue(PageVisibilityProperty, value); } + } + + /// + /// DependencyProperty of PageVisibility. + /// + public readonly DependencyProperty PageVisibilityProperty = + DependencyProperty.Register("PageVisibility", typeof(Visibility), typeof(PagePreview), null); + } +} + +#endif \ No newline at end of file diff --git a/PdfSharp/Windows/PagePreview-wpf.xaml b/PdfSharp/Windows/PagePreview-wpf.xaml new file mode 100644 index 0000000..9a6bc93 --- /dev/null +++ b/PdfSharp/Windows/PagePreview-wpf.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PdfSharp/Windows/PagePreview-wpf.xaml.cs b/PdfSharp/Windows/PagePreview-wpf.xaml.cs new file mode 100644 index 0000000..9d01805 --- /dev/null +++ b/PdfSharp/Windows/PagePreview-wpf.xaml.cs @@ -0,0 +1,163 @@ +#if !NETSTANDARD2_0 + +using System; +using System.Collections.Generic; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace PdfSharp.Windows +{ + /// + /// A simple page viewer for WPF and Silverlight. + /// Not based on empira application framework. + /// + public partial class PagePreview : UserControl + { + /// + /// Initializes a new instance of the class. + /// + public PagePreview() + { + InitializeComponent(); + + //TextBlock tb = new TextBlock(); + //Binding b = new Binding("FontSize"); + //b.Source = this; + //tb.SetBinding(TextBlock.FontSizeProperty, b); + + //canvasGrid.SetBinding(WidthProperty, new Binding("CanvasWidth")); + //canvasGrid.SetBinding(HeightProperty, new Binding("CanvasHeight")); + //canvas.SetBinding(WidthProperty, new Binding("CanvasWidth")); + //canvas.SetBinding(HeightProperty, new Binding("CanvasHeight")); + + LayoutRoot.DataContext = this; + Zoom = (Zoom)100; + } + + void Test() + { + double factor = 1; + int zoom = (int)Zoom; + if (zoom > 0) + factor = Math.Max(Math.Min(zoom, 800), 10) / 100.0; + else + factor = 1; + + canvasGrid.Width = 480 * factor; + canvasGrid.Height = 640 * factor; + scaleTransform.ScaleX = factor; + scaleTransform.ScaleY = factor; + + //CanvasWidth = 480 * factor; + //CanvasHeight = 640 * factor; + //CanvasScaleX = 1 * factor; + //CanvasScaleY = 1 * factor; + } + + /// + /// Gets the canvas. + /// + public Canvas Canvas + { + get { return canvas; } + } + + /// + /// Gets or sets the size of the page 1/96 inch. + /// + public Size PageSize + { + get { return (Size)GetValue(PageSizeProperty); } + set { SetValue(PageSizeProperty, value); } + } + + /// + /// DependencyProperty of PageSize. + /// + public readonly DependencyProperty PageSizeProperty = + DependencyProperty.Register("PageSize", typeof(Size), typeof(PagePreview), new PropertyMetadata(new Size(480, 640), PageSizeChanged)); + + private static void PageSizeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ((PagePreview)d).Test(); + } + + /// + /// Gets or sets the zoom. + /// + public Zoom Zoom + { + get { return (Zoom)GetValue(ZoomProperty); } + set { SetValue(ZoomProperty, value); } + } + + /// + /// DependencyProperty of Zoom. + /// + public readonly DependencyProperty ZoomProperty = + DependencyProperty.Register("Zoom", typeof(Zoom), typeof(PagePreview), new PropertyMetadata(Zoom.FullPage, ZoomChanged)); + + private static void ZoomChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ((PagePreview)d).Test(); + } + +#if _ + public double CanvasWidth + { + get { return (double)GetValue(CanvasWidthProperty); } + set { SetValue(CanvasWidthProperty, value); } + } + public readonly DependencyProperty CanvasWidthProperty = + DependencyProperty.Register("CanvasWidth", typeof(double), typeof(PagePreview), new PropertyMetadata(210.0)); + + public double CanvasHeight + { + get { return (double)GetValue(CanvasHeightProperty); } + set { SetValue(CanvasHeightProperty, value); } + } + public readonly DependencyProperty CanvasHeightProperty = + DependencyProperty.Register("CanvasHeight", typeof(double), typeof(PagePreview), new PropertyMetadata(297.0)); + + public double CanvasScaleX + { + get { return (double)GetValue(CanvasScaleXProperty); } + set { SetValue(CanvasScaleXProperty, value); } + } + public readonly DependencyProperty CanvasScaleXProperty = + DependencyProperty.Register("CanvasScaleX", typeof(double), typeof(PagePreview), new PropertyMetadata(1.0)); + + public double CanvasScaleY + { + get { return (double)GetValue(CanvasScaleYProperty); } + set { SetValue(CanvasScaleYProperty, value); } + } + public readonly DependencyProperty CanvasScaleYProperty = + DependencyProperty.Register("CanvasScaleY", typeof(double), typeof(PagePreview), new PropertyMetadata(1.0)); +#endif + + /// + /// Gets or sets the page visibility. + /// + public Visibility PageVisibility + { + get { return (Visibility)GetValue(PageVisibilityProperty); } + set { SetValue(PageVisibilityProperty, value); } + } + + /// + /// DependencyProperty of PageVisibility. + /// + public readonly DependencyProperty PageVisibilityProperty = + DependencyProperty.Register("PageVisibility", typeof(Visibility), typeof(PagePreview), null); + } +} + +#endif \ No newline at end of file diff --git a/PdfSharp/Windows/PagePreviewDesignTimeData.cs b/PdfSharp/Windows/PagePreviewDesignTimeData.cs new file mode 100644 index 0000000..0789a97 --- /dev/null +++ b/PdfSharp/Windows/PagePreviewDesignTimeData.cs @@ -0,0 +1,32 @@ +#if !NETSTANDARD2_0 + +using System; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace PdfSharp.Windows +{ + public class PagePreviewDesignTimeData + { + public double CanvasWidth + { + get { return 210; } + set { } + } + + public double CanvasHeight + { + get { return 297; } + set { } + } + } +} + +#endif \ No newline at end of file diff --git a/PdfSharp/Windows/VisualPresenter.cs b/PdfSharp/Windows/VisualPresenter.cs new file mode 100644 index 0000000..7f2c5bd --- /dev/null +++ b/PdfSharp/Windows/VisualPresenter.cs @@ -0,0 +1,56 @@ +#if !NETSTANDARD2_0 + + +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows; +using System.Windows.Media; + +namespace PdfSharp.Windows +{ + // Create a host visual derived from the FrameworkElement class.// This class provides layout, event handling, and container support for// the child visual objects. + /// + /// Used to present Visuals in the PagePreview. + /// + public class VisualPresenter : FrameworkElement + { + /// + /// Initializes a new instance of the class. + /// + public VisualPresenter() + { + _children = new VisualCollection(this); + } + + /// + /// Gets the number of visual child elements within this element. + /// + protected override int VisualChildrenCount + { + get { return _children.Count; } + } + + /// + /// Overrides , and returns a child at the specified index from a collection of child elements. + /// + protected override Visual GetVisualChild(int index) + { + if (index < 0 || index >= _children.Count) + throw new ArgumentOutOfRangeException("index"); + + return _children[index]; + } + + /// + /// Gets the children collection. + /// + public VisualCollection Children + { + get { return _children; } + } + readonly VisualCollection _children; + } +} + +#endif \ No newline at end of file diff --git a/PdfSharp/Windows/enums/RenderMode.cs b/PdfSharp/Windows/enums/RenderMode.cs new file mode 100644 index 0000000..7cc485f --- /dev/null +++ b/PdfSharp/Windows/enums/RenderMode.cs @@ -0,0 +1,56 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if !NETSTANDARD2_0 + +namespace PdfSharp.Windows +{ + /// + /// Specifies how to render the preview. + /// + public enum RenderMode + { + /// + /// Draw retained + /// + Default = 0, + + ///// + ///// Draw using a metafile + ///// + //Metafile = 1, + + ///// + ///// Draw using a bitmap image. + ///// + //Bitmap = 2 + } +} + +#endif diff --git a/PdfSharp/Windows/enums/Zoom.cs b/PdfSharp/Windows/enums/Zoom.cs new file mode 100644 index 0000000..0c58889 --- /dev/null +++ b/PdfSharp/Windows/enums/Zoom.cs @@ -0,0 +1,122 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +#if !NETSTANDARD2_0 + +namespace PdfSharp.Windows +{ + /// + /// Defines a zoom factor used in the preview control. + /// + public enum Zoom + { + /// + /// The smallest possible zoom factor. + /// + Mininum = 10, + + /// + /// The largest possible zoom factor. + /// + Maximum = 800, + + /// + /// A pre-defined zoom factor. + /// + Percent800 = 800, + + /// + /// A pre-defined zoom factor. + /// + Percent600 = 600, + + /// + /// A pre-defined zoom factor. + /// + Percent400 = 400, + + /// + /// A pre-defined zoom factor. + /// + Percent200 = 200, + + /// + /// A pre-defined zoom factor. + /// + Percent150 = 150, + + /// + /// A pre-defined zoom factor. + /// + Percent100 = 100, + + /// + /// A pre-defined zoom factor. + /// + Percent75 = 75, + + /// + /// A pre-defined zoom factor. + /// + Percent50 = 50, + + /// + /// A pre-defined zoom factor. + /// + Percent25 = 25, + + /// + /// A pre-defined zoom factor. + /// + Percent10 = 10, + + /// + /// Sets the percent value such that the document fits horizontally into the window. + /// + BestFit = -1, + + /// + /// Sets the percent value such that the printable area of the document fits horizontally into the window. + /// Currently not yet implemented and the same as ZoomBestFit. + /// + TextFit = -2, + + /// + /// Sets the percent value such that the whole document fits completely into the window. + /// + FullPage = -3, + + /// + /// Sets the percent value such that the document is displayed in its real physical size. + /// + OriginalSize = -4, + } +} + +#endif \ No newline at end of file diff --git a/PdfSharp/bin/Debug/netstandard2.0/PdfSharp.deps.json b/PdfSharp/bin/Debug/netstandard2.0/PdfSharp.deps.json new file mode 100644 index 0000000..6bbac72 --- /dev/null +++ b/PdfSharp/bin/Debug/netstandard2.0/PdfSharp.deps.json @@ -0,0 +1,63 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "PdfSharp/3.0.0.0": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "PdfSharp.dll": {} + } + }, + "Microsoft.NETCore.Platforms/1.1.0": {}, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "System.Drawing.Common/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Drawing.Common.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + } + } + } + } + }, + "libraries": { + "PdfSharp/3.0.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "path": "microsoft.netcore.platforms/1.1.0", + "hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "System.Drawing.Common/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AiJFxxVPdeITstiRS5aAu8+8Dpf5NawTMoapZ53Gfirml24p7HIfhjmCRxdXnmmf3IUA3AX3CcW7G73CjWxW/Q==", + "path": "system.drawing.common/4.5.0", + "hashPath": "system.drawing.common.4.5.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/PdfSharp/bin/Debug/netstandard2.0/PdfSharp.dll b/PdfSharp/bin/Debug/netstandard2.0/PdfSharp.dll new file mode 100644 index 0000000..4050264 Binary files /dev/null and b/PdfSharp/bin/Debug/netstandard2.0/PdfSharp.dll differ diff --git a/PdfSharp/bin/Debug/netstandard2.0/PdfSharp.pdb b/PdfSharp/bin/Debug/netstandard2.0/PdfSharp.pdb new file mode 100644 index 0000000..f3c0d1d Binary files /dev/null and b/PdfSharp/bin/Debug/netstandard2.0/PdfSharp.pdb differ diff --git a/PdfSharp/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs b/PdfSharp/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs new file mode 100644 index 0000000..45b1ca0 --- /dev/null +++ b/PdfSharp/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] diff --git a/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.AssemblyInfo.cs b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.AssemblyInfo.cs new file mode 100644 index 0000000..338aef5 --- /dev/null +++ b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.AssemblyInfo.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("3.0.0.0")] + +// Создано классом WriteCodeFragment MSBuild. + diff --git a/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.AssemblyInfoInputs.cache b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.AssemblyInfoInputs.cache new file mode 100644 index 0000000..b902023 --- /dev/null +++ b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +c9bbb4259b11bff14843734a92523ce79fd4d971 diff --git a/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.Forms.PagePreview.resources b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.Forms.PagePreview.resources new file mode 100644 index 0000000..aa9fc1e Binary files /dev/null and b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.Forms.PagePreview.resources differ diff --git a/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.assets.cache b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.assets.cache new file mode 100644 index 0000000..e56d2c1 Binary files /dev/null and b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.assets.cache differ diff --git a/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.csproj.CoreCompileInputs.cache b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..afbc344 --- /dev/null +++ b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +c433e4af372809ea6a1ebd23edd5491b1791d39d diff --git a/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.csproj.FileListAbsolute.txt b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..85ef6f1 --- /dev/null +++ b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.csproj.FileListAbsolute.txt @@ -0,0 +1,11 @@ +F:\Projects1\PdfSharp\bin\Debug\netstandard2.0\PdfSharp.deps.json +F:\Projects1\PdfSharp\bin\Debug\netstandard2.0\PdfSharp.dll +F:\Projects1\PdfSharp\bin\Debug\netstandard2.0\PdfSharp.pdb +F:\Projects1\PdfSharp\obj\Debug\netstandard2.0\PdfSharp.Forms.PagePreview.resources +F:\Projects1\PdfSharp\obj\Debug\netstandard2.0\PdfSharp.csproj.GenerateResource.cache +F:\Projects1\PdfSharp\obj\Debug\netstandard2.0\PdfSharp.AssemblyInfoInputs.cache +F:\Projects1\PdfSharp\obj\Debug\netstandard2.0\PdfSharp.AssemblyInfo.cs +F:\Projects1\PdfSharp\obj\Debug\netstandard2.0\PdfSharp.csproj.CoreCompileInputs.cache +F:\Projects1\PdfSharp\obj\Debug\netstandard2.0\PdfSharp.dll +F:\Projects1\PdfSharp\obj\Debug\netstandard2.0\PdfSharp.pdb +F:\Projects1\PdfSharp\obj\Debug\netstandard2.0\PdfSharp.csprojAssemblyReference.cache diff --git a/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.csproj.GenerateResource.cache b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.csproj.GenerateResource.cache new file mode 100644 index 0000000..ca11108 Binary files /dev/null and b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.csproj.GenerateResource.cache differ diff --git a/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.csprojAssemblyReference.cache b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.csprojAssemblyReference.cache new file mode 100644 index 0000000..e7c2576 Binary files /dev/null and b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.csprojAssemblyReference.cache differ diff --git a/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.dll b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.dll new file mode 100644 index 0000000..4050264 Binary files /dev/null and b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.dll differ diff --git a/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.pdb b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.pdb new file mode 100644 index 0000000..f3c0d1d Binary files /dev/null and b/PdfSharp/obj/Debug/netstandard2.0/PdfSharp.pdb differ diff --git a/PdfSharp/obj/PdfSharp.csproj.nuget.dgspec.json b/PdfSharp/obj/PdfSharp.csproj.nuget.dgspec.json new file mode 100644 index 0000000..25f71a2 --- /dev/null +++ b/PdfSharp/obj/PdfSharp.csproj.nuget.dgspec.json @@ -0,0 +1,72 @@ +{ + "format": 1, + "restore": { + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": {} + }, + "projects": { + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj", + "projectName": "PdfSharp", + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\PdfSharp\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/PdfSharp/obj/PdfSharp.csproj.nuget.g.props b/PdfSharp/obj/PdfSharp.csproj.nuget.g.props new file mode 100644 index 0000000..1771934 --- /dev/null +++ b/PdfSharp/obj/PdfSharp.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\google\.nuget\packages\;C:\Microsoft\Xamarin\NuGet\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder + PackageReference + 5.6.0 + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/PdfSharp/obj/PdfSharp.csproj.nuget.g.targets b/PdfSharp/obj/PdfSharp.csproj.nuget.g.targets new file mode 100644 index 0000000..f09823b --- /dev/null +++ b/PdfSharp/obj/PdfSharp.csproj.nuget.g.targets @@ -0,0 +1,9 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + \ No newline at end of file diff --git a/PdfSharp/obj/project.assets.json b/PdfSharp/obj/project.assets.json new file mode 100644 index 0000000..8d164e1 --- /dev/null +++ b/PdfSharp/obj/project.assets.json @@ -0,0 +1,293 @@ +{ + "version": 3, + "targets": { + ".NETStandard,Version=v2.0": { + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + }, + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + }, + "build": { + "build/netstandard2.0/NETStandard.Library.targets": {} + } + }, + "System.Drawing.Common/4.5.0": { + "type": "package", + "compile": { + "ref/netstandard2.0/System.Drawing.Common.dll": {} + }, + "runtime": { + "lib/netstandard2.0/System.Drawing.Common.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.NETCore.Platforms/1.1.0": { + "sha512": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "type": "package", + "path": "microsoft.netcore.platforms/1.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "ThirdPartyNotices.txt", + "dotnet_library_license.txt", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.1.1.0.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json" + ] + }, + "NETStandard.Library/2.0.3": { + "sha512": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "type": "package", + "path": "netstandard.library/2.0.3", + "files": [ + ".nupkg.metadata", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "build/netstandard2.0/NETStandard.Library.targets", + "build/netstandard2.0/ref/Microsoft.Win32.Primitives.dll", + "build/netstandard2.0/ref/System.AppContext.dll", + "build/netstandard2.0/ref/System.Collections.Concurrent.dll", + "build/netstandard2.0/ref/System.Collections.NonGeneric.dll", + "build/netstandard2.0/ref/System.Collections.Specialized.dll", + "build/netstandard2.0/ref/System.Collections.dll", + "build/netstandard2.0/ref/System.ComponentModel.Composition.dll", + "build/netstandard2.0/ref/System.ComponentModel.EventBasedAsync.dll", + "build/netstandard2.0/ref/System.ComponentModel.Primitives.dll", + "build/netstandard2.0/ref/System.ComponentModel.TypeConverter.dll", + "build/netstandard2.0/ref/System.ComponentModel.dll", + "build/netstandard2.0/ref/System.Console.dll", + "build/netstandard2.0/ref/System.Core.dll", + "build/netstandard2.0/ref/System.Data.Common.dll", + "build/netstandard2.0/ref/System.Data.dll", + "build/netstandard2.0/ref/System.Diagnostics.Contracts.dll", + "build/netstandard2.0/ref/System.Diagnostics.Debug.dll", + "build/netstandard2.0/ref/System.Diagnostics.FileVersionInfo.dll", + "build/netstandard2.0/ref/System.Diagnostics.Process.dll", + "build/netstandard2.0/ref/System.Diagnostics.StackTrace.dll", + "build/netstandard2.0/ref/System.Diagnostics.TextWriterTraceListener.dll", + "build/netstandard2.0/ref/System.Diagnostics.Tools.dll", + "build/netstandard2.0/ref/System.Diagnostics.TraceSource.dll", + "build/netstandard2.0/ref/System.Diagnostics.Tracing.dll", + "build/netstandard2.0/ref/System.Drawing.Primitives.dll", + "build/netstandard2.0/ref/System.Drawing.dll", + "build/netstandard2.0/ref/System.Dynamic.Runtime.dll", + "build/netstandard2.0/ref/System.Globalization.Calendars.dll", + "build/netstandard2.0/ref/System.Globalization.Extensions.dll", + "build/netstandard2.0/ref/System.Globalization.dll", + "build/netstandard2.0/ref/System.IO.Compression.FileSystem.dll", + "build/netstandard2.0/ref/System.IO.Compression.ZipFile.dll", + "build/netstandard2.0/ref/System.IO.Compression.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.DriveInfo.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.Primitives.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.Watcher.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.dll", + "build/netstandard2.0/ref/System.IO.IsolatedStorage.dll", + "build/netstandard2.0/ref/System.IO.MemoryMappedFiles.dll", + "build/netstandard2.0/ref/System.IO.Pipes.dll", + "build/netstandard2.0/ref/System.IO.UnmanagedMemoryStream.dll", + "build/netstandard2.0/ref/System.IO.dll", + "build/netstandard2.0/ref/System.Linq.Expressions.dll", + "build/netstandard2.0/ref/System.Linq.Parallel.dll", + "build/netstandard2.0/ref/System.Linq.Queryable.dll", + "build/netstandard2.0/ref/System.Linq.dll", + "build/netstandard2.0/ref/System.Net.Http.dll", + "build/netstandard2.0/ref/System.Net.NameResolution.dll", + "build/netstandard2.0/ref/System.Net.NetworkInformation.dll", + "build/netstandard2.0/ref/System.Net.Ping.dll", + "build/netstandard2.0/ref/System.Net.Primitives.dll", + "build/netstandard2.0/ref/System.Net.Requests.dll", + "build/netstandard2.0/ref/System.Net.Security.dll", + "build/netstandard2.0/ref/System.Net.Sockets.dll", + "build/netstandard2.0/ref/System.Net.WebHeaderCollection.dll", + "build/netstandard2.0/ref/System.Net.WebSockets.Client.dll", + "build/netstandard2.0/ref/System.Net.WebSockets.dll", + "build/netstandard2.0/ref/System.Net.dll", + "build/netstandard2.0/ref/System.Numerics.dll", + "build/netstandard2.0/ref/System.ObjectModel.dll", + "build/netstandard2.0/ref/System.Reflection.Extensions.dll", + "build/netstandard2.0/ref/System.Reflection.Primitives.dll", + "build/netstandard2.0/ref/System.Reflection.dll", + "build/netstandard2.0/ref/System.Resources.Reader.dll", + "build/netstandard2.0/ref/System.Resources.ResourceManager.dll", + "build/netstandard2.0/ref/System.Resources.Writer.dll", + "build/netstandard2.0/ref/System.Runtime.CompilerServices.VisualC.dll", + "build/netstandard2.0/ref/System.Runtime.Extensions.dll", + "build/netstandard2.0/ref/System.Runtime.Handles.dll", + "build/netstandard2.0/ref/System.Runtime.InteropServices.RuntimeInformation.dll", + "build/netstandard2.0/ref/System.Runtime.InteropServices.dll", + "build/netstandard2.0/ref/System.Runtime.Numerics.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Formatters.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Json.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Primitives.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Xml.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.dll", + "build/netstandard2.0/ref/System.Runtime.dll", + "build/netstandard2.0/ref/System.Security.Claims.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Algorithms.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Csp.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Encoding.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Primitives.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.X509Certificates.dll", + "build/netstandard2.0/ref/System.Security.Principal.dll", + "build/netstandard2.0/ref/System.Security.SecureString.dll", + "build/netstandard2.0/ref/System.ServiceModel.Web.dll", + "build/netstandard2.0/ref/System.Text.Encoding.Extensions.dll", + "build/netstandard2.0/ref/System.Text.Encoding.dll", + "build/netstandard2.0/ref/System.Text.RegularExpressions.dll", + "build/netstandard2.0/ref/System.Threading.Overlapped.dll", + "build/netstandard2.0/ref/System.Threading.Tasks.Parallel.dll", + "build/netstandard2.0/ref/System.Threading.Tasks.dll", + "build/netstandard2.0/ref/System.Threading.Thread.dll", + "build/netstandard2.0/ref/System.Threading.ThreadPool.dll", + "build/netstandard2.0/ref/System.Threading.Timer.dll", + "build/netstandard2.0/ref/System.Threading.dll", + "build/netstandard2.0/ref/System.Transactions.dll", + "build/netstandard2.0/ref/System.ValueTuple.dll", + "build/netstandard2.0/ref/System.Web.dll", + "build/netstandard2.0/ref/System.Windows.dll", + "build/netstandard2.0/ref/System.Xml.Linq.dll", + "build/netstandard2.0/ref/System.Xml.ReaderWriter.dll", + "build/netstandard2.0/ref/System.Xml.Serialization.dll", + "build/netstandard2.0/ref/System.Xml.XDocument.dll", + "build/netstandard2.0/ref/System.Xml.XPath.XDocument.dll", + "build/netstandard2.0/ref/System.Xml.XPath.dll", + "build/netstandard2.0/ref/System.Xml.XmlDocument.dll", + "build/netstandard2.0/ref/System.Xml.XmlSerializer.dll", + "build/netstandard2.0/ref/System.Xml.dll", + "build/netstandard2.0/ref/System.dll", + "build/netstandard2.0/ref/mscorlib.dll", + "build/netstandard2.0/ref/netstandard.dll", + "build/netstandard2.0/ref/netstandard.xml", + "lib/netstandard1.0/_._", + "netstandard.library.2.0.3.nupkg.sha512", + "netstandard.library.nuspec" + ] + }, + "System.Drawing.Common/4.5.0": { + "sha512": "AiJFxxVPdeITstiRS5aAu8+8Dpf5NawTMoapZ53Gfirml24p7HIfhjmCRxdXnmmf3IUA3AX3CcW7G73CjWxW/Q==", + "type": "package", + "path": "system.drawing.common/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net461/System.Drawing.Common.dll", + "lib/netstandard2.0/System.Drawing.Common.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net461/System.Drawing.Common.dll", + "ref/netstandard2.0/System.Drawing.Common.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll", + "runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll", + "system.drawing.common.4.5.0.nupkg.sha512", + "system.drawing.common.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + } + }, + "projectFileDependencyGroups": { + ".NETStandard,Version=v2.0": [ + "NETStandard.Library >= 2.0.3", + "System.Drawing.Common >= 4.5.0" + ] + }, + "packageFolders": { + "C:\\Users\\google\\.nuget\\packages\\": {}, + "C:\\Microsoft\\Xamarin\\NuGet\\": {}, + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {} + }, + "project": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj", + "projectName": "PdfSharp", + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\PdfSharp\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/PdfSharp/obj/project.nuget.cache b/PdfSharp/obj/project.nuget.cache new file mode 100644 index 0000000..95f0608 --- /dev/null +++ b/PdfSharp/obj/project.nuget.cache @@ -0,0 +1,12 @@ +{ + "version": 2, + "dgSpecHash": "ZOxRjNMngg0k2cfkW5D1TuIuuSeLCz/bsfBkPlQuedaAT8JqhwNC8ypzDhaVKoHUf17afAaFAHCxayOryIfQlw==", + "success": true, + "projectFilePath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj", + "expectedPackageFiles": [ + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\netstandard.library\\2.0.3\\netstandard.library.2.0.3.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\system.drawing.common\\4.5.0\\system.drawing.common.4.5.0.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/PdfSharp/root/PSSR.cs b/PdfSharp/root/PSSR.cs new file mode 100644 index 0000000..5ea520d --- /dev/null +++ b/PdfSharp/root/PSSR.cs @@ -0,0 +1,400 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +using System.Diagnostics; +using System.Resources; +using System.Reflection; +using PdfSharp.Drawing; +using PdfSharp.Internal; +using PdfSharp.Pdf; + +#pragma warning disable 1591 + +namespace PdfSharp +{ + /// + /// The Pdf-Sharp-String-Resources. + /// + // ReSharper disable once InconsistentNaming + static class PSSR + { + // How to use: + // Create a function or property for each message text, depending on how many parameters are + // part of the message. For the beginning, type plain English text in the function or property. + // The use of functions is safe when a parameter must be changed. The compiler tells you all + // places in your code that must be modified. + // For localization, create an enum value for each function or property with the same name. Then + // create localized message files with the enum values as messages identifiers. In the properties + // and functions all text is replaced by Format or GetString functions with the corresponding enum value + // as first parameter. The use of enums ensures that typing errors in message resource names are + // simply impossible. Use the TestResourceMessages function to ensure that each enum value has an + // appropriate message text. + + #region Helper functions + /// + /// Loads the message from the resource associated with the enum type and formats it + /// using 'String.Format'. Because this function is intended to be used during error + /// handling it never raises an exception. + /// + /// The type of the parameter identifies the resource + /// and the name of the enum identifies the message in the resource. + /// Parameters passed through 'String.Format'. + /// The formatted message. + public static string Format(PSMsgID id, params object[] args) + { + string message; + try + { + message = GetString(id); + message = message != null ? Format(message, args) : "INTERNAL ERROR: Message not found in resources."; + return message; + } + catch (Exception ex) + { + message = String.Format("UNEXPECTED ERROR while formatting message with ID {0}: {1}", id.ToString(), ex.ToString()); + } + return message; + } + + public static string Format(string format, params object[] args) + { + if (format == null) + throw new ArgumentNullException("format"); + + string message; + try + { + message = String.Format(format, args); + } + catch (Exception ex) + { + message = String.Format("UNEXPECTED ERROR while formatting message '{0}': {1}", format, ex); + } + return message; + } + + /// + /// Gets the localized message identified by the specified DomMsgID. + /// + public static string GetString(PSMsgID id) + { + return ResMngr.GetString(id.ToString()); + } + + #endregion + + #region General messages + + public static string IndexOutOfRange + { + get { return "The index is out of range."; } + } + + public static string ListEnumCurrentOutOfRange + { + get { return "Enumeration out of range."; } + } + + public static string PageIndexOutOfRange + { + get { return "The index of a page is out of range."; } + } + + public static string OutlineIndexOutOfRange + { + get { return "The index of an outline is out of range."; } + } + + public static string SetValueMustNotBeNull + { + get { return "The set value property must not be null."; } + } + + public static string InvalidValue(int val, string name, int min, int max) + { + return Format("{0} is not a valid value for {1}. {1} should be greater than or equal to {2} and less than or equal to {3}.", + val, name, min, max); + } + + public static string ObsoleteFunktionCalled + { + get { return "The function is obsolete and must not be called."; } + } + + public static string OwningDocumentRequired + { + get { return "The PDF object must belong to a PdfDocument, but property Document is null."; } + } + + public static string FileNotFound(string path) + { + return Format("The file '{0}' does not exist.", path); + } + + public static string FontDataReadOnly + { + get { return "Font data is read-only."; } + } + + public static string ErrorReadingFontData + { + get { return "Error while parsing an OpenType font."; } + } + + #endregion + + #region XGraphics specific messages + + // ----- XGraphics ---------------------------------------------------------------------------- + + public static string PointArrayEmpty + { + get { return "The PointF array must not be empty."; } + } + + public static string PointArrayAtLeast(int count) + { + return Format("The point array must contain {0} or more points.", count); + } + + public static string NeedPenOrBrush + { + get { return "XPen or XBrush or both must not be null."; } + } + + public static string CannotChangeImmutableObject(string typename) + { + return String.Format("You cannot change this immutable {0} object.", typename); + } + + public static string FontAlreadyAdded(string fontname) + { + return String.Format("Fontface with the name '{0}' already added to font collection.", fontname); + } + + public static string NotImplementedForFontsRetrievedWithFontResolver(string name) + { + return String.Format("Not implemented for font '{0}', because it was retrieved with font resolver.", name); + } + + #endregion + + #region PDF specific messages + + // ----- PDF ---------------------------------------------------------------------------------- + + public static string InvalidPdf + { + get { return "The file is not a valid PDF document."; } + } + + public static string InvalidVersionNumber + { + get { return "Invalid version number. Valid values are 12, 13, and 14."; } + } + + public static string CannotHandleXRefStreams + { + get { return "Cannot handle cross-reference streams. The current implementation of PDFsharp cannot handle this PDF feature introduced with Acrobat 6."; } + } + + public static string PasswordRequired + { + get { return "A password is required to open the PDF document."; } + } + + public static string InvalidPassword + { + get { return "The specified password is invalid."; } + } + + public static string OwnerPasswordRequired + { + get { return "To modify the document the owner password is required"; } + } + + public static string UserOrOwnerPasswordRequired + { + get { return GetString(PSMsgID.UserOrOwnerPasswordRequired); } + //get { return "At least a user or an owner password is required to encrypt the document."; } + } + + public static string CannotModify + { + get { return "The document cannot be modified."; } + } + + public static string NameMustStartWithSlash + { + //get { return GetString(PSMsgID.NameMustStartWithSlash); } + get { return "A PDF name must start with a slash (/)."; } + } + + public static string ImportPageNumberOutOfRange(int pageNumber, int maxPage, string path) + { + return String.Format("The page cannot be imported from document '{2}', because the page number is out of range. " + + "The specified page number is {0}, but it must be in the range from 1 to {1}.", pageNumber, maxPage, path); + } + + public static string MultiplePageInsert + { + get { return "The page cannot be added to this document because the document already owned this page."; } + } + + public static string UnexpectedTokenInPdfFile + { + get { return "Unexpected token in PDF file. The PDF file may be corrupt. If it is not, please send us the file for service."; } + } + + public static string InappropriateColorSpace(PdfColorMode colorMode, XColorSpace colorSpace) + { + string mode; + switch (colorMode) + { + case PdfColorMode.Rgb: + mode = "RGB"; + break; + + case PdfColorMode.Cmyk: + mode = "CMYK"; + break; + + default: + mode = "(undefined)"; + break; + } + + string space; + switch (colorSpace) + { + case XColorSpace.Rgb: + space = "RGB"; + break; + + case XColorSpace.Cmyk: + space = "CMYK"; + break; + + case XColorSpace.GrayScale: + space = "grayscale"; + break; + + default: + space = "(undefined)"; + break; + } + return String.Format("The document requires color mode {0}, but a color is defined using {1}. " + + "Use only colors that match the color mode of the PDF document", mode, space); + } + + public static string CannotGetGlyphTypeface(string fontName) + { + return Format("Cannot get a matching glyph typeface for font '{0}'.", fontName); + } + + + // ----- PdfParser ---------------------------------------------------------------------------- + + public static string UnexpectedToken(string token) + { + return Format(PSMsgID.UnexpectedToken, token); + //return Format("Token '{0}' was not expected.", token); + } + + public static string UnknownEncryption + { + get { return GetString(PSMsgID.UnknownEncryption); } + //get { return "The PDF document is protected with an encryption not supported by PDFsharp."; } + } + + #endregion + + #region Resource manager + + /// + /// Gets the resource manager for this module. + /// + public static ResourceManager ResMngr + { + get + { + if (_resmngr == null) + { + try + { + Lock.EnterFontFactory(); + if (_resmngr == null) + { +#if true_ + // Force the English language. + System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.InvariantCulture; +#endif +#if !NETFX_CORE && !UWP + _resmngr = new ResourceManager("PdfSharp.Resources.Messages", + Assembly.GetExecutingAssembly()); +#else + _resmngr = new ResourceManager("PdfSharp.Resources.Messages", + typeof(PSSR).GetTypeInfo().Assembly); +#endif + } + } + finally { Lock.ExitFontFactory(); } + } + return _resmngr; + } + } + static ResourceManager _resmngr; + + /// + /// Writes all messages defined by PSMsgID. + /// + [Conditional("DEBUG")] + public static void TestResourceMessages() + { +#if !SILVERLIGHT + string[] names = Enum.GetNames(typeof(PSMsgID)); + foreach (string name in names) + { + string message = String.Format("{0}: '{1}'", name, ResMngr.GetString(name)); + Debug.Assert(message != null); + Debug.WriteLine(message); + } +#else +#endif + } + + static PSSR() + { + TestResourceMessages(); + } + + #endregion + } +} \ No newline at end of file diff --git a/PdfSharp/root/PageSizeConverter.cs b/PdfSharp/root/PageSizeConverter.cs new file mode 100644 index 0000000..245b620 --- /dev/null +++ b/PdfSharp/root/PageSizeConverter.cs @@ -0,0 +1,181 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; +#if GDI +using System.Drawing; +#endif +#if WPF +using System.Windows; +#endif +using PdfSharp.Drawing; + +namespace PdfSharp +{ + /// + /// Converter from to . + /// + public static class PageSizeConverter + { + /// + /// Converts the specified page size enumeration to a pair of values in point. + /// + public static XSize ToSize(PageSize value) + { + // The international definitions are: + // 1 inch == 25.4 mm + // 1 inch == 72 point + switch (value) + { + // Source http://www.din-formate.de/reihe-a-din-groessen-mm-pixel-dpi.html + case PageSize.A0: + return new XSize(2384, 3370); + + case PageSize.A1: + return new XSize(1684, 2384); + + case PageSize.A2: + return new XSize(1191, 1684); + + case PageSize.A3: + return new XSize(842, 1191); + + case PageSize.A4: + return new XSize(595, 842); + + case PageSize.A5: + return new XSize(420, 595); + + + case PageSize.RA0: + return new XSize(2438, 3458); + + case PageSize.RA1: + return new XSize(1729, 2438); + + case PageSize.RA2: + return new XSize(1219, 1729); + + case PageSize.RA3: + return new XSize(865, 1219); + + case PageSize.RA4: + return new XSize(609, 865); + + case PageSize.RA5: + return new XSize(433, 609); + + + case PageSize.B0: + return new XSize(2835, 4008); + + case PageSize.B1: + return new XSize(2004, 2835); + + case PageSize.B2: + return new XSize(1417, 2004); + + case PageSize.B3: + return new XSize(1001, 1417); + + case PageSize.B4: + return new XSize(709, 1001); + + case PageSize.B5: + return new XSize(499, 709); + + // The non-ISO sizes ... + + case PageSize.Quarto: // 8 x 10 inch + return new XSize(576, 720); + + case PageSize.Foolscap: // 8 x 13 inch + return new XSize(576, 936); + + case PageSize.Executive: // 7.5 x 10 inch + return new XSize(540, 720); + + case PageSize.GovernmentLetter: // 8 x 10.5 inch + return new XSize(576, 756); + + case PageSize.Letter: // 8.5 x 11 inch + return new XSize(612, 792); + + case PageSize.Legal: // 8.5 x 14 inch + return new XSize(612, 1008); + + case PageSize.Ledger: // 17 x 11 inch + return new XSize(1224, 792); + + case PageSize.Tabloid: // 11 x 17 inch + return new XSize(792, 1224); + + case PageSize.Post: // 15.5 x 19.25 inch + return new XSize(1126, 1386); + + case PageSize.Crown: // 20 x 15 inch + return new XSize(1440, 1080); + + case PageSize.LargePost: // 16.5 x 21 inch + return new XSize(1188, 1512); + + case PageSize.Demy: // 17.5 x 22 inch + return new XSize(1260, 1584); + + case PageSize.Medium: // 18 x 23 inch + return new XSize(1296, 1656); + + case PageSize.Royal: // 20 x 25 inch + return new XSize(1440, 1800); + + case PageSize.Elephant: // 23 x 28 inch + return new XSize(1565, 2016); + + case PageSize.DoubleDemy: // 23.5 x 35 inch + return new XSize(1692, 2520); + + case PageSize.QuadDemy: // 35 x 45 inch + return new XSize(2520, 3240); + + case PageSize.STMT: // 5.5 x 8.5 inch + return new XSize(396, 612); + + case PageSize.Folio: // 8.5 x 13 inch + return new XSize(612, 936); + + case PageSize.Statement: // 5.5 x 8.5 inch + return new XSize(396, 612); + + case PageSize.Size10x14: // 10 x 14 inch + return new XSize(720, 1008); + } + throw new ArgumentException("Invalid PageSize.", "value"); + } + } +} \ No newline at end of file diff --git a/PdfSharp/root/PdfSharpException.cs b/PdfSharp/root/PdfSharpException.cs new file mode 100644 index 0000000..2235241 --- /dev/null +++ b/PdfSharp/root/PdfSharpException.cs @@ -0,0 +1,64 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp +{ + /// + /// Base class of all exceptions in the PDFsharp frame work. + /// + public class PdfSharpException : Exception + { + // The class is not yet used + + /// + /// Initializes a new instance of the class. + /// + public PdfSharpException() + { } + + /// + /// Initializes a new instance of the class. + /// + /// The exception message. + public PdfSharpException(string message) + : base(message) + { } + + /// + /// Initializes a new instance of the class. + /// + /// The exception message. + /// The inner exception. + public PdfSharpException(string message, Exception innerException) : + base(message, innerException) + { } + } +} diff --git a/PdfSharp/root/ProductVersionInfo.cs b/PdfSharp/root/ProductVersionInfo.cs new file mode 100644 index 0000000..066a079 --- /dev/null +++ b/PdfSharp/root/ProductVersionInfo.cs @@ -0,0 +1,270 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +using System; + +namespace PdfSharp +{ + /// + /// Version info base for all PDFsharp related assemblies. + /// + public static class ProductVersionInfo + { + /// + /// The title of the product. + /// + public const string Title = "PDFsharp"; + + /// + /// A characteristic description of the product. + /// + public const string Description = "A .NET library for processing PDF."; + + /// + /// The PDF producer information string. + /// TODO: Called Creator in MigraDoc??? + /// + public const string Producer = Title + " " + VersionMajor + "." + VersionMinor + "." + VersionBuild + Technology + " (" + Url + ")"; + + /// + /// The PDF producer information string including VersionPatch. + /// + public const string Producer2 = Title + " " + VersionMajor + "." + VersionMinor + "." + VersionBuild + "." + VersionPatch + Technology + " (" + Url + ")"; + + /// + /// The full version number. + /// + public const string Version = VersionMajor + "." + VersionMinor + "." + VersionBuild + "." + VersionPatch; + + /// + /// The full version string. + /// + public const string Version2 = VersionMajor + "." + VersionMinor + "." + VersionBuild + "." + VersionPatch + Technology; + + /// + /// The home page of this product. + /// + public const string Url = "www.pdfsharp.com"; + + /// + /// Unused. + /// + public const string Configuration = ""; + + /// + /// The company that created/owned the product. + /// + public const string Company = "empira Software GmbH, Cologne Area (Germany)"; + + /// + /// The name the product. + /// + public const string Product = "PDFsharp"; + + /// + /// The copyright information. + /// + public const string Copyright = "Copyright 2005-2017 empira Software GmbH."; + + /// + /// The trademark the product. + /// + public const string Trademark = "PDFsharp"; + + /// + /// Unused. + /// + public const string Culture = ""; + + /// + /// The major version number of the product. + /// + public const string VersionMajor = "1"; + + /// + /// The minor version number of the product. + /// + public const string VersionMinor = "50"; + + /// + /// The build number of the product. + /// + public const string VersionBuild = "4740"; // V16G // Build = days since 2005-01-01 - change this values ONLY HERE + + /// + /// The patch number of the product. + /// + public const string VersionPatch = "0"; + + /// + /// The Version Prerelease String for NuGet. + /// + public const string VersionPrerelease = "beta5"; // "" for stable Release, e.g. "beta" or "rc.1.2" for Prerelease. // Also used for NuGet Version. + +#if DEBUG + /// + /// The calculated build number. + /// +// ReSharper disable RedundantNameQualifier + public static int BuildNumber = (System.DateTime.Now - new System.DateTime(2005, 1, 1)).Days; +// ReSharper restore RedundantNameQualifier +#endif + + /// + /// E.g. "2005-01-01", for use in NuGet Script. + /// + public const string VersionReferenceDate = "2005-01-01"; + + /// + /// Use _ instead of blanks and special characters. Can be complemented with a suffix in the NuGet Script. + /// Nuspec Doc: The unique identifier for the package. This is the package name that is shown when packages + /// are listed using the Package Manager Console. These are also used when installing a package using the + /// Install-Package command within the Package Manager Console. Package IDs may not contain any spaces + /// or characters that are invalid in an URL. In general, they follow the same rules as .NET namespaces do. + /// So Foo.Bar is a valid ID, Foo! and Foo Bar are not. + /// + public const string NuGetID = "PDFsharp"; + + /// + /// Nuspec Doc: The human-friendly title of the package displayed in the Manage NuGet Packages dialog. + /// If none is specified, the ID is used instead. + /// + public const string NuGetTitle = "PDFsharp"; + + /// + /// Nuspec Doc: A comma-separated list of authors of the package code. + /// + public const string NuGetAuthors = "empira Software GmbH"; + + /// + /// Nuspec Doc: A comma-separated list of the package creators. This is often the same list as in authors. + /// This is ignored when uploading the package to the NuGet.org Gallery. + /// + public const string NuGetOwners = "empira Software GmbH"; + + /// + /// Nuspec Doc: A long description of the package. This shows up in the right pane of the Add Package Dialog + /// as well as in the Package Manager Console when listing packages using the Get-Package command. + /// + // This assignment must be written in one line because it will be parsed from a PS1 file. + public const string NuGetDescription = "PDFsharp is the Open Source .NET library that easily creates and processes PDF documents on the fly from any .NET language. The same drawing routines can be used to create PDF documents, draw on the screen, or send output to any printer."; + + /// + /// Nuspec Doc: A description of the changes made in each release of the package. This field only shows up + /// when the _Updates_ tab is selected and the package is an update to a previously installed package. + /// It is displayed where the Description would normally be displayed. + /// + public const string NuGetReleaseNotes = ""; + + /// + /// Nuspec Doc: A short description of the package. If specified, this shows up in the middle pane of the + /// Add Package Dialog. If not specified, a truncated version of the description is used instead. + /// + public const string NuGetSummary = "A .NET library for processing PDF."; + + /// + /// Nuspec Doc: The locale ID for the package, such as en-us. + /// + public const string NuGetLanguage = ""; + + /// + /// Nuspec Doc: A URL for the home page of the package. + /// + /// + /// http://www.pdfsharp.net/NuGetPackage_PDFsharp-GDI.ashx + /// http://www.pdfsharp.net/NuGetPackage_PDFsharp-WPF.ashx + /// + public const string NuGetProjectUrl = "www.pdfsharp.net"; + + /// + /// Nuspec Doc: A URL for the image to use as the icon for the package in the Manage NuGet Packages + /// dialog box. This should be a 32x32-pixel .png file that has a transparent background. + /// + public const string NuGetIconUrl = "http://www.pdfsharp.net/resources/PDFsharp-Logo-32x32.png"; + + /// + /// Nuspec Doc: A link to the license that the package is under. + /// + public const string NuGetLicenseUrl = "http://www.pdfsharp.net/PDFsharp_License.ashx"; + + /// + /// Nuspec Doc: A Boolean value that specifies whether the client needs to ensure that the package license (described by licenseUrl) is accepted before the package is installed. + /// + public const bool NuGetRequireLicenseAcceptance = false; + + /// + /// Nuspec Doc: A space-delimited list of tags and keywords that describe the package. This information is used to help make sure users can find the package using + /// searches in the Add Package Reference dialog box or filtering in the Package Manager Console window. + /// + public const string NuGetTags = "PDFsharp PDF creation"; + + /// + /// The technology tag of the product: + /// (none) Pure .NET + /// -gdi : GDI+, + /// -wpf : WPF, + /// -hybrid : Both GDI+ and WPF (hybrid). + /// -sl : Silverlight + /// -wp : Windows Phone + /// -wrt : Windows RunTime + /// +#if GDI && !WPF + // GDI+ (System.Drawing) + public const string Technology = "-gdi"; +#endif +#if WPF && !GDI && !SILVERLIGHT + // Windows Presentation Foundation + public const string Technology = "-wpf"; +#endif +#if WPF && GDI + // Hybrid - for testing only + public const string Technology = "-h"; +#endif +#if SILVERLIGHT && !WINDOWS_PHONE + // Silverlight 5 + public const string Technology = "-sl"; +#endif +#if WINDOWS_PHONE + // Windows Phone + public const string Technology = "-wp"; +#endif +#if NETFX_CORE + // WinRT + public const string Technology = "-wrt"; +#endif +#if UWP + // Windows Universal App + public const string Technology = "-uwp"; +#endif +#if CORE + // .net without GDI+ and WPF + public const string Technology = ""; // no extension +#endif + } +} diff --git a/PdfSharp/root/VersionInfo.cs b/PdfSharp/root/VersionInfo.cs new file mode 100644 index 0000000..708cd53 --- /dev/null +++ b/PdfSharp/root/VersionInfo.cs @@ -0,0 +1,49 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp +{ + /// + /// Version info of this assembly. + /// + static class VersionInfo + { + public const string Title = ProductVersionInfo.Title; + public const string Description = ProductVersionInfo.Description; + public const string Producer = ProductVersionInfo.Producer; + public const string Version = ProductVersionInfo.Version; + public const string Url = ProductVersionInfo.Url; + public const string Configuration = ""; + public const string Company = ProductVersionInfo.Company; + public const string Product = ProductVersionInfo.Product; + public const string Copyright = ProductVersionInfo.Copyright; + public const string Trademark = ProductVersionInfo.Trademark; + public const string Culture = ""; + } +} diff --git a/PdfSharp/root/enums/PSMsgID.cs b/PdfSharp/root/enums/PSMsgID.cs new file mode 100644 index 0000000..c4f8df6 --- /dev/null +++ b/PdfSharp/root/enums/PSMsgID.cs @@ -0,0 +1,76 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp +{ + /// + /// Represents IDs for error and diagnostic messages generated by PDFsharp. + /// + // ReSharper disable once InconsistentNaming + enum PSMsgID + { + // ----- General Messages --------------------------------------------------------------------- + + /// + /// PSMsgID. + /// + SampleMessage1, + + /// + /// PSMsgID. + /// + SampleMessage2, + + // ----- XGraphics Messages --------------------------------------------------------------- + + // ----- PDF Messages ---------------------------------------------------------------------- + + /// + /// PSMsgID. + /// + NameMustStartWithSlash, + + /// + /// PSMsgID. + /// + UserOrOwnerPasswordRequired, + + // ----- PdfParser Messages ------------------------------------------------------------------- + + /// + /// PSMsgID. + /// + UnexpectedToken, + + /// + /// PSMsgID. + /// + UnknownEncryption, + } +} \ No newline at end of file diff --git a/PdfSharp/root/enums/PageOrientation.cs b/PdfSharp/root/enums/PageOrientation.cs new file mode 100644 index 0000000..b3de710 --- /dev/null +++ b/PdfSharp/root/enums/PageOrientation.cs @@ -0,0 +1,54 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp +{ + /// + /// Base namespace of PDFsharp. Most classes are implemented in nested namespaces like e. g. PdfSharp.Pdf. + /// + /// + [System.Runtime.CompilerServices.CompilerGenerated] + internal class NamespaceDoc { } + + /// + /// Specifies the orientation of a page. + /// + public enum PageOrientation + { + /// + /// The default page orientation. + /// + Portrait, + + /// + /// The width and height of the page are reversed. + /// + Landscape, + } +} diff --git a/PdfSharp/root/enums/PageSize.cs b/PdfSharp/root/enums/PageSize.cs new file mode 100644 index 0000000..d57bc86 --- /dev/null +++ b/PdfSharp/root/enums/PageSize.cs @@ -0,0 +1,281 @@ +#region PDFsharp - A .NET library for processing PDF +// +// Authors: +// Stefan Lange +// +// Copyright (c) 2005-2017 empira Software GmbH, Cologne Area (Germany) +// +// http://www.pdfsharp.com +// http://sourceforge.net/projects/pdfsharp +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +#endregion + +namespace PdfSharp +{ + /// + /// Identifies the most popular predefined page sizes. + /// + public enum PageSize + { + /// + /// The width or height of the page are set manually and override the PageSize property. + /// + Undefined = 0, + + // ISO formats (link is dead in the meantime) + // see http://www.engineeringtoolbox.com/drawings-paper-sheets-sizes-25_349.html + + /// + /// Identifies a paper sheet size of 841 mm times 1189 mm or 33.11 inch times 46.81 inch. + /// + A0 = 1, + + /// + /// Identifies a paper sheet size of 594 mm times 841 mm or 23.39 inch times 33.1 inch. + /// + A1 = 2, + + /// + /// Identifies a paper sheet size of 420 mm times 594 mm or 16.54 inch times 23.29 inch. + /// + A2 = 3, + + /// + /// Identifies a paper sheet size of 297 mm times 420 mm or 11.69 inch times 16.54 inch. + /// + A3 = 4, + + /// + /// Identifies a paper sheet size of 210 mm times 297 mm or 8.27 inch times 11.69 inch. + /// + A4 = 5, + + /// + /// Identifies a paper sheet size of 148 mm times 210 mm or 5.83 inch times 8.27 inch. + /// + A5 = 6, + + /// + /// Identifies a paper sheet size of 860 mm times 1220 mm. + /// + RA0 = 7, + + /// + /// Identifies a paper sheet size of 610 mm times 860 mm. + /// + RA1 = 8, + + /// + /// Identifies a paper sheet size of 430 mm times 610 mm. + /// + RA2 = 9, + + /// + /// Identifies a paper sheet size of 305 mm times 430 mm. + /// + RA3 = 10, + + /// + /// Identifies a paper sheet size of 215 mm times 305 mm. + /// + RA4 = 11, + + /// + /// Identifies a paper sheet size of 153 mm times 215 mm. + /// + RA5 = 12, + + /// + /// Identifies a paper sheet size of 1000 mm times 1414 mm or 39.37 inch times 55.67 inch. + /// + B0 = 13, + + /// + /// Identifies a paper sheet size of 707 mm times 1000 mm or 27.83 inch times 39.37 inch. + /// + B1 = 14, + + /// + /// Identifies a paper sheet size of 500 mm times 707 mm or 19.68 inch times 27.83 inch. + /// + B2 = 15, + + /// + /// Identifies a paper sheet size of 353 mm times 500 mm or 13.90 inch times 19.68 inch. + /// + B3 = 16, + + /// + /// Identifies a paper sheet size of 250 mm times 353 mm or 9.84 inch times 13.90 inch. + /// + B4 = 17, + + /// + /// Identifies a paper sheet size of 176 mm times 250 mm or 6.93 inch times 9.84 inch. + /// + B5 = 18, + +#if true_ + /// + /// Identifies a paper sheet size of 917 mm times 1297 mm or 36.00 inch times 51.20 inch. + /// + C0 = 19, + + /// + /// Identifies a paper sheet size of 648 mm times 917 mm or 25.60 inch times 36.00 inch. + /// + C1 = 20, + + /// + /// Identifies a paper sheet size of 458 mm times 648 mm or 18.00 inch times 25.60 inch. + /// + C2 = 21, + + /// + /// Identifies a paper sheet size of 324 mm times 458 mm or 12.80 inch times 18.00 inch. + /// + C3 = 22, + + /// + /// Identifies a paper sheet size of 229 mm times 324 mm or 9.00 inch times 12.80 inch. + /// + C4 = 23, + + /// + /// Identifies a paper sheet size of 162 mm times 229 mm or 6.40 inch times 9.0 inch. + /// + C5 = 24, +#endif + + // Current U.S. loose paper sizes + // see http://www.reference.com/browse/wiki/Paper_size + + /// + /// Identifies a paper sheet size of 10 inch times 8 inch or 254 mm times 203 mm. + /// + Quarto = 100, + + /// + /// Identifies a paper sheet size of 13 inch times 8 inch or 330 mm times 203 mm. + /// + Foolscap = 101, + + /// + /// Identifies a paper sheet size of 10.5 inch times 7.25 inch or 267 mm times 184 mm. + /// + Executive = 102, + + /// + /// Identifies a paper sheet size of 10.5 inch times 8 inch 267 mm times 203 mm. + /// + GovernmentLetter = 103, + + /// + /// Identifies a paper sheet size of 11 inch times 8.5 inch 279 mm times 216 mm. + /// + Letter = 104, + + /// + /// Identifies a paper sheet size of 14 inch times 8.5 inch 356 mm times 216 mm. + /// + Legal = 105, + + /// + /// Identifies a paper sheet size of 17 inch times 11 inch or 432 mm times 279 mm. + /// + Ledger = 106, + + /// + /// Identifies a paper sheet size of 17 inch times 11 inch or 432 mm times 279 mm. + /// + Tabloid = 107, + + /// + /// Identifies a paper sheet size of 19.25 inch times 15.5 inch 489 mm times 394 mm. + /// + Post = 108, + + /// + /// 20 Identifies a paper sheet size of 20 inch times 15 inch or 508 mm times 381 mm. + /// + Crown = 109, + + /// + /// Identifies a paper sheet size of 21 inch times 16.5 inch 533 mm times 419 mm. + /// + LargePost = 110, + + /// + /// Identifies a paper sheet size of 22.5 inch times 17.5 inch 572 mm times 445 mm. + /// + Demy = 111, + + /// + /// Identifies a paper sheet size of 23 inch times 18 inch or 584 mm times 457 mm. + /// + Medium = 112, + + /// + /// Identifies a paper sheet size of 25 inch times 20 inch or 635 mm times 508 mm. + /// + Royal = 113, + + /// + /// Identifies a paper sheet size of 28 inch times 23 inch or 711 mm times 584 mm. + /// + Elephant = 114, + + /// + /// Identifies a paper sheet size of 35 inch times 23.5 inch or 889 mm times 597 mm. + /// + DoubleDemy = 115, + + /// + /// Identifies a paper sheet size of 45 inch times 35 inch 1143 times 889 mm. + /// + QuadDemy = 116, + + /// + /// Identifies a paper sheet size of 8.5 inch times 5.5 inch or 216 mm times 396 mm. + /// + STMT = 117, + + /// + /// Identifies a paper sheet size of 8.5 inch times 13 inch or 216 mm times 330 mm. + /// + Folio = 120, + + /// + /// Identifies a paper sheet size of 5.5 inch times 8.5 inch or 396 mm times 216 mm. + /// + Statement = 121, + + /// + /// Identifies a paper sheet size of 10 inch times 14 inch. + /// + Size10x14 = 122, + + //A 11 8.5 279 216 + //B 17 11 432 279 + //C 22 17 559 432 + //D 34 22 864 559 + //E 44 34 1118 864 + } +} \ No newline at end of file diff --git a/Projects.sln b/Projects.sln new file mode 100644 index 0000000..d2c3197 --- /dev/null +++ b/Projects.sln @@ -0,0 +1,67 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30225.117 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mailing", "Mailing\Mailing.csproj", "{EBFBCB65-A591-4444-8557-BFC084566FF7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "Tests\Tests.csproj", "{E420055E-687E-4BD5-BBD0-EC1DA643C011}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataClients", "DataClients\DataClients.csproj", "{50970C14-5670-4893-A58F-EA7E03360647}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfSharp", "PdfSharp\PdfSharp.csproj", "{5BC9149F-4717-4BD1-8FC1-1D29744DA643}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfSharp.Charting", "PdfSharp.Charting\PdfSharp.Charting.csproj", "{6D63CEBF-20D8-41CA-BE57-5701F95EDC47}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MigraDoc.Rendering", "MigraDoc.Rendering\MigraDoc.Rendering.csproj", "{8BCEABEB-E345-45F6-880D-59B5920691F8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MigraDoc.DocumentObjectModel", "MigraDoc.DocumentObjectModel\MigraDoc.DocumentObjectModel.csproj", "{C873319A-89FB-4F7E-BD72-F9BCC147E08A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SupportClasses", "SupportClasses\SupportClasses.csproj", "{4494877D-DAA5-4498-BA09-6001E9371D4B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EBFBCB65-A591-4444-8557-BFC084566FF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EBFBCB65-A591-4444-8557-BFC084566FF7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EBFBCB65-A591-4444-8557-BFC084566FF7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EBFBCB65-A591-4444-8557-BFC084566FF7}.Release|Any CPU.Build.0 = Release|Any CPU + {E420055E-687E-4BD5-BBD0-EC1DA643C011}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E420055E-687E-4BD5-BBD0-EC1DA643C011}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E420055E-687E-4BD5-BBD0-EC1DA643C011}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E420055E-687E-4BD5-BBD0-EC1DA643C011}.Release|Any CPU.Build.0 = Release|Any CPU + {50970C14-5670-4893-A58F-EA7E03360647}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {50970C14-5670-4893-A58F-EA7E03360647}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50970C14-5670-4893-A58F-EA7E03360647}.Release|Any CPU.ActiveCfg = Release|Any CPU + {50970C14-5670-4893-A58F-EA7E03360647}.Release|Any CPU.Build.0 = Release|Any CPU + {5BC9149F-4717-4BD1-8FC1-1D29744DA643}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5BC9149F-4717-4BD1-8FC1-1D29744DA643}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5BC9149F-4717-4BD1-8FC1-1D29744DA643}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5BC9149F-4717-4BD1-8FC1-1D29744DA643}.Release|Any CPU.Build.0 = Release|Any CPU + {6D63CEBF-20D8-41CA-BE57-5701F95EDC47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6D63CEBF-20D8-41CA-BE57-5701F95EDC47}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6D63CEBF-20D8-41CA-BE57-5701F95EDC47}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6D63CEBF-20D8-41CA-BE57-5701F95EDC47}.Release|Any CPU.Build.0 = Release|Any CPU + {8BCEABEB-E345-45F6-880D-59B5920691F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8BCEABEB-E345-45F6-880D-59B5920691F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8BCEABEB-E345-45F6-880D-59B5920691F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8BCEABEB-E345-45F6-880D-59B5920691F8}.Release|Any CPU.Build.0 = Release|Any CPU + {C873319A-89FB-4F7E-BD72-F9BCC147E08A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C873319A-89FB-4F7E-BD72-F9BCC147E08A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C873319A-89FB-4F7E-BD72-F9BCC147E08A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C873319A-89FB-4F7E-BD72-F9BCC147E08A}.Release|Any CPU.Build.0 = Release|Any CPU + {4494877D-DAA5-4498-BA09-6001E9371D4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4494877D-DAA5-4498-BA09-6001E9371D4B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4494877D-DAA5-4498-BA09-6001E9371D4B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4494877D-DAA5-4498-BA09-6001E9371D4B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BF1FA8A3-24D1-45B8-988A-0CD187CD1A14} + EndGlobalSection +EndGlobal diff --git a/SupportClasses/Directory.cs b/SupportClasses/Directory.cs new file mode 100644 index 0000000..7fc6300 --- /dev/null +++ b/SupportClasses/Directory.cs @@ -0,0 +1,43 @@ +using System; +using System.IO; + +namespace SupportClasses +{ + public static class Direct + { + public static char Slash + { + get + { + if (Environment.OSVersion.Platform == PlatformID.Unix) + return '/'; + else + return '\\'; + } + } + + private static string tempDir = null; + public static string TempDir + { + get + { + if (String.IsNullOrEmpty(tempDir)) + { + tempDir = Directory.GetCurrentDirectory() + Direct.Slash + "temp"; + Directory.CreateDirectory(tempDir); + } + return tempDir; + } + set + { + + } + } + + public static bool ClearTempDir(DateTime dtCreation) + { + + return true; + } + } +} diff --git a/SupportClasses/SupportClasses.csproj b/SupportClasses/SupportClasses.csproj new file mode 100644 index 0000000..9f5c4f4 --- /dev/null +++ b/SupportClasses/SupportClasses.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/SupportClasses/bin/Debug/netstandard2.0/SupportClasses.deps.json b/SupportClasses/bin/Debug/netstandard2.0/SupportClasses.deps.json new file mode 100644 index 0000000..9bcb2a6 --- /dev/null +++ b/SupportClasses/bin/Debug/netstandard2.0/SupportClasses.deps.json @@ -0,0 +1,47 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "SupportClasses/1.0.0": { + "dependencies": { + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "SupportClasses.dll": {} + } + }, + "Microsoft.NETCore.Platforms/1.1.0": {}, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + } + } + }, + "libraries": { + "SupportClasses/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "path": "microsoft.netcore.platforms/1.1.0", + "hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/SupportClasses/bin/Debug/netstandard2.0/SupportClasses.dll b/SupportClasses/bin/Debug/netstandard2.0/SupportClasses.dll new file mode 100644 index 0000000..c4e8022 Binary files /dev/null and b/SupportClasses/bin/Debug/netstandard2.0/SupportClasses.dll differ diff --git a/SupportClasses/bin/Debug/netstandard2.0/SupportClasses.pdb b/SupportClasses/bin/Debug/netstandard2.0/SupportClasses.pdb new file mode 100644 index 0000000..0af45a3 Binary files /dev/null and b/SupportClasses/bin/Debug/netstandard2.0/SupportClasses.pdb differ diff --git a/SupportClasses/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs b/SupportClasses/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs new file mode 100644 index 0000000..45b1ca0 --- /dev/null +++ b/SupportClasses/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] diff --git a/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.AssemblyInfo.cs b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.AssemblyInfo.cs new file mode 100644 index 0000000..6d020d4 --- /dev/null +++ b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("SupportClasses")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("SupportClasses")] +[assembly: System.Reflection.AssemblyTitleAttribute("SupportClasses")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Создано классом WriteCodeFragment MSBuild. + diff --git a/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.AssemblyInfoInputs.cache b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.AssemblyInfoInputs.cache new file mode 100644 index 0000000..ab7fc96 --- /dev/null +++ b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +d38a87dfa5da120d82b890c15c7a67bcf2495906 diff --git a/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.assets.cache b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.assets.cache new file mode 100644 index 0000000..4d5d824 Binary files /dev/null and b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.assets.cache differ diff --git a/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.csproj.CoreCompileInputs.cache b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..6bc1899 --- /dev/null +++ b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +9b978f056e180bf534f3fe8a1b2eb2e6ab47b238 diff --git a/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.csproj.FileListAbsolute.txt b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..76d87c3 --- /dev/null +++ b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.csproj.FileListAbsolute.txt @@ -0,0 +1,9 @@ +F:\Projects1\SupportClasses\bin\Debug\netstandard2.0\SupportClasses.deps.json +F:\Projects1\SupportClasses\bin\Debug\netstandard2.0\SupportClasses.dll +F:\Projects1\SupportClasses\bin\Debug\netstandard2.0\SupportClasses.pdb +F:\Projects1\SupportClasses\obj\Debug\netstandard2.0\SupportClasses.csprojAssemblyReference.cache +F:\Projects1\SupportClasses\obj\Debug\netstandard2.0\SupportClasses.AssemblyInfoInputs.cache +F:\Projects1\SupportClasses\obj\Debug\netstandard2.0\SupportClasses.AssemblyInfo.cs +F:\Projects1\SupportClasses\obj\Debug\netstandard2.0\SupportClasses.csproj.CoreCompileInputs.cache +F:\Projects1\SupportClasses\obj\Debug\netstandard2.0\SupportClasses.dll +F:\Projects1\SupportClasses\obj\Debug\netstandard2.0\SupportClasses.pdb diff --git a/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.csprojAssemblyReference.cache b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.csprojAssemblyReference.cache new file mode 100644 index 0000000..dffb5bb Binary files /dev/null and b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.csprojAssemblyReference.cache differ diff --git a/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.dll b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.dll new file mode 100644 index 0000000..c4e8022 Binary files /dev/null and b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.dll differ diff --git a/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.pdb b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.pdb new file mode 100644 index 0000000..0af45a3 Binary files /dev/null and b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.pdb differ diff --git a/SupportClasses/obj/SupportClasses.csproj.nuget.dgspec.json b/SupportClasses/obj/SupportClasses.csproj.nuget.dgspec.json new file mode 100644 index 0000000..226ef38 --- /dev/null +++ b/SupportClasses/obj/SupportClasses.csproj.nuget.dgspec.json @@ -0,0 +1,68 @@ +{ + "format": 1, + "restore": { + "F:\\Projects1\\SupportClasses\\SupportClasses.csproj": {} + }, + "projects": { + "F:\\Projects1\\SupportClasses\\SupportClasses.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\SupportClasses\\SupportClasses.csproj", + "projectName": "SupportClasses", + "projectPath": "F:\\Projects1\\SupportClasses\\SupportClasses.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\SupportClasses\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/SupportClasses/obj/SupportClasses.csproj.nuget.g.props b/SupportClasses/obj/SupportClasses.csproj.nuget.g.props new file mode 100644 index 0000000..1771934 --- /dev/null +++ b/SupportClasses/obj/SupportClasses.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\google\.nuget\packages\;C:\Microsoft\Xamarin\NuGet\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder + PackageReference + 5.6.0 + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/SupportClasses/obj/SupportClasses.csproj.nuget.g.targets b/SupportClasses/obj/SupportClasses.csproj.nuget.g.targets new file mode 100644 index 0000000..f09823b --- /dev/null +++ b/SupportClasses/obj/SupportClasses.csproj.nuget.g.targets @@ -0,0 +1,9 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + \ No newline at end of file diff --git a/SupportClasses/obj/project.assets.json b/SupportClasses/obj/project.assets.json new file mode 100644 index 0000000..febb11b --- /dev/null +++ b/SupportClasses/obj/project.assets.json @@ -0,0 +1,246 @@ +{ + "version": 3, + "targets": { + ".NETStandard,Version=v2.0": { + "Microsoft.NETCore.Platforms/1.1.0": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + }, + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + }, + "build": { + "build/netstandard2.0/NETStandard.Library.targets": {} + } + } + } + }, + "libraries": { + "Microsoft.NETCore.Platforms/1.1.0": { + "sha512": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", + "type": "package", + "path": "microsoft.netcore.platforms/1.1.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "ThirdPartyNotices.txt", + "dotnet_library_license.txt", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.1.1.0.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json" + ] + }, + "NETStandard.Library/2.0.3": { + "sha512": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "type": "package", + "path": "netstandard.library/2.0.3", + "files": [ + ".nupkg.metadata", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "build/netstandard2.0/NETStandard.Library.targets", + "build/netstandard2.0/ref/Microsoft.Win32.Primitives.dll", + "build/netstandard2.0/ref/System.AppContext.dll", + "build/netstandard2.0/ref/System.Collections.Concurrent.dll", + "build/netstandard2.0/ref/System.Collections.NonGeneric.dll", + "build/netstandard2.0/ref/System.Collections.Specialized.dll", + "build/netstandard2.0/ref/System.Collections.dll", + "build/netstandard2.0/ref/System.ComponentModel.Composition.dll", + "build/netstandard2.0/ref/System.ComponentModel.EventBasedAsync.dll", + "build/netstandard2.0/ref/System.ComponentModel.Primitives.dll", + "build/netstandard2.0/ref/System.ComponentModel.TypeConverter.dll", + "build/netstandard2.0/ref/System.ComponentModel.dll", + "build/netstandard2.0/ref/System.Console.dll", + "build/netstandard2.0/ref/System.Core.dll", + "build/netstandard2.0/ref/System.Data.Common.dll", + "build/netstandard2.0/ref/System.Data.dll", + "build/netstandard2.0/ref/System.Diagnostics.Contracts.dll", + "build/netstandard2.0/ref/System.Diagnostics.Debug.dll", + "build/netstandard2.0/ref/System.Diagnostics.FileVersionInfo.dll", + "build/netstandard2.0/ref/System.Diagnostics.Process.dll", + "build/netstandard2.0/ref/System.Diagnostics.StackTrace.dll", + "build/netstandard2.0/ref/System.Diagnostics.TextWriterTraceListener.dll", + "build/netstandard2.0/ref/System.Diagnostics.Tools.dll", + "build/netstandard2.0/ref/System.Diagnostics.TraceSource.dll", + "build/netstandard2.0/ref/System.Diagnostics.Tracing.dll", + "build/netstandard2.0/ref/System.Drawing.Primitives.dll", + "build/netstandard2.0/ref/System.Drawing.dll", + "build/netstandard2.0/ref/System.Dynamic.Runtime.dll", + "build/netstandard2.0/ref/System.Globalization.Calendars.dll", + "build/netstandard2.0/ref/System.Globalization.Extensions.dll", + "build/netstandard2.0/ref/System.Globalization.dll", + "build/netstandard2.0/ref/System.IO.Compression.FileSystem.dll", + "build/netstandard2.0/ref/System.IO.Compression.ZipFile.dll", + "build/netstandard2.0/ref/System.IO.Compression.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.DriveInfo.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.Primitives.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.Watcher.dll", + "build/netstandard2.0/ref/System.IO.FileSystem.dll", + "build/netstandard2.0/ref/System.IO.IsolatedStorage.dll", + "build/netstandard2.0/ref/System.IO.MemoryMappedFiles.dll", + "build/netstandard2.0/ref/System.IO.Pipes.dll", + "build/netstandard2.0/ref/System.IO.UnmanagedMemoryStream.dll", + "build/netstandard2.0/ref/System.IO.dll", + "build/netstandard2.0/ref/System.Linq.Expressions.dll", + "build/netstandard2.0/ref/System.Linq.Parallel.dll", + "build/netstandard2.0/ref/System.Linq.Queryable.dll", + "build/netstandard2.0/ref/System.Linq.dll", + "build/netstandard2.0/ref/System.Net.Http.dll", + "build/netstandard2.0/ref/System.Net.NameResolution.dll", + "build/netstandard2.0/ref/System.Net.NetworkInformation.dll", + "build/netstandard2.0/ref/System.Net.Ping.dll", + "build/netstandard2.0/ref/System.Net.Primitives.dll", + "build/netstandard2.0/ref/System.Net.Requests.dll", + "build/netstandard2.0/ref/System.Net.Security.dll", + "build/netstandard2.0/ref/System.Net.Sockets.dll", + "build/netstandard2.0/ref/System.Net.WebHeaderCollection.dll", + "build/netstandard2.0/ref/System.Net.WebSockets.Client.dll", + "build/netstandard2.0/ref/System.Net.WebSockets.dll", + "build/netstandard2.0/ref/System.Net.dll", + "build/netstandard2.0/ref/System.Numerics.dll", + "build/netstandard2.0/ref/System.ObjectModel.dll", + "build/netstandard2.0/ref/System.Reflection.Extensions.dll", + "build/netstandard2.0/ref/System.Reflection.Primitives.dll", + "build/netstandard2.0/ref/System.Reflection.dll", + "build/netstandard2.0/ref/System.Resources.Reader.dll", + "build/netstandard2.0/ref/System.Resources.ResourceManager.dll", + "build/netstandard2.0/ref/System.Resources.Writer.dll", + "build/netstandard2.0/ref/System.Runtime.CompilerServices.VisualC.dll", + "build/netstandard2.0/ref/System.Runtime.Extensions.dll", + "build/netstandard2.0/ref/System.Runtime.Handles.dll", + "build/netstandard2.0/ref/System.Runtime.InteropServices.RuntimeInformation.dll", + "build/netstandard2.0/ref/System.Runtime.InteropServices.dll", + "build/netstandard2.0/ref/System.Runtime.Numerics.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Formatters.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Json.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Primitives.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.Xml.dll", + "build/netstandard2.0/ref/System.Runtime.Serialization.dll", + "build/netstandard2.0/ref/System.Runtime.dll", + "build/netstandard2.0/ref/System.Security.Claims.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Algorithms.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Csp.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Encoding.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.Primitives.dll", + "build/netstandard2.0/ref/System.Security.Cryptography.X509Certificates.dll", + "build/netstandard2.0/ref/System.Security.Principal.dll", + "build/netstandard2.0/ref/System.Security.SecureString.dll", + "build/netstandard2.0/ref/System.ServiceModel.Web.dll", + "build/netstandard2.0/ref/System.Text.Encoding.Extensions.dll", + "build/netstandard2.0/ref/System.Text.Encoding.dll", + "build/netstandard2.0/ref/System.Text.RegularExpressions.dll", + "build/netstandard2.0/ref/System.Threading.Overlapped.dll", + "build/netstandard2.0/ref/System.Threading.Tasks.Parallel.dll", + "build/netstandard2.0/ref/System.Threading.Tasks.dll", + "build/netstandard2.0/ref/System.Threading.Thread.dll", + "build/netstandard2.0/ref/System.Threading.ThreadPool.dll", + "build/netstandard2.0/ref/System.Threading.Timer.dll", + "build/netstandard2.0/ref/System.Threading.dll", + "build/netstandard2.0/ref/System.Transactions.dll", + "build/netstandard2.0/ref/System.ValueTuple.dll", + "build/netstandard2.0/ref/System.Web.dll", + "build/netstandard2.0/ref/System.Windows.dll", + "build/netstandard2.0/ref/System.Xml.Linq.dll", + "build/netstandard2.0/ref/System.Xml.ReaderWriter.dll", + "build/netstandard2.0/ref/System.Xml.Serialization.dll", + "build/netstandard2.0/ref/System.Xml.XDocument.dll", + "build/netstandard2.0/ref/System.Xml.XPath.XDocument.dll", + "build/netstandard2.0/ref/System.Xml.XPath.dll", + "build/netstandard2.0/ref/System.Xml.XmlDocument.dll", + "build/netstandard2.0/ref/System.Xml.XmlSerializer.dll", + "build/netstandard2.0/ref/System.Xml.dll", + "build/netstandard2.0/ref/System.dll", + "build/netstandard2.0/ref/mscorlib.dll", + "build/netstandard2.0/ref/netstandard.dll", + "build/netstandard2.0/ref/netstandard.xml", + "lib/netstandard1.0/_._", + "netstandard.library.2.0.3.nupkg.sha512", + "netstandard.library.nuspec" + ] + } + }, + "projectFileDependencyGroups": { + ".NETStandard,Version=v2.0": [ + "NETStandard.Library >= 2.0.3" + ] + }, + "packageFolders": { + "C:\\Users\\google\\.nuget\\packages\\": {}, + "C:\\Microsoft\\Xamarin\\NuGet\\": {}, + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\SupportClasses\\SupportClasses.csproj", + "projectName": "SupportClasses", + "projectPath": "F:\\Projects1\\SupportClasses\\SupportClasses.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\SupportClasses\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/SupportClasses/obj/project.nuget.cache b/SupportClasses/obj/project.nuget.cache new file mode 100644 index 0000000..2dc4281 --- /dev/null +++ b/SupportClasses/obj/project.nuget.cache @@ -0,0 +1,11 @@ +{ + "version": 2, + "dgSpecHash": "7ZiaxFayORMJaNAbkWBfW1syqX+dFo8XWqo5JgDzkZfLPuPSm8e/8j0GbzoqMmv9q3j7bVyRsJdJQvZlpEU3nQ==", + "success": true, + "projectFilePath": "F:\\Projects1\\SupportClasses\\SupportClasses.csproj", + "expectedPackageFiles": [ + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\netstandard.library\\2.0.3\\netstandard.library.2.0.3.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/Tests/Program.cs b/Tests/Program.cs new file mode 100644 index 0000000..c644317 --- /dev/null +++ b/Tests/Program.cs @@ -0,0 +1,233 @@ +using ICSharpCode.SharpZipLib.GZip; +using ICSharpCode.SharpZipLib.Tar; +using System; +using System.IO; +using System.Text; +using DataClients; +using System.Threading.Tasks; +using System.Threading; +using System.Linq; +using Mailing; +using System.Text.RegularExpressions; +using System.Collections.Generic; + +namespace Tests +{ + class Program + { + static void Main(string[] args) + { + test7(); + } + static void test1() + { + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); + var enc = Encoding.GetEncoding(866); + var filec = new FileClient(); + var test = filec.GetFile(DateTime.Now.AddDays(-46), 34, 0); + //var netc = new NetClient(); + //var test = netc.SocketWork(NetClient.Cmd.download_nh, "20200707.230"); + //var netc = new NetClient(); + //var test = netc.SocketWork(NetClient.Cmd.user_flags); + Console.WriteLine(BitConverter.ToString(test).Replace("-", " ")); + Console.WriteLine(enc.GetString(test)); + Console.ReadKey(); + } + static void test2() + { + var a = new STPClient(); + var b = a.GetTechCycle( + new DateTime(2020, 07, 1), + new DateTime(2020, 07, 10), + 16); + foreach (var e in b) + Console.WriteLine(e.start.ToString(@"yyyy.MM.dd HH:mm:ss") + '\t' + Names.techCycle[(ushort)e.index]); + + } + static void test3() + { + var a = new STPClient(); + var b = a.GetAnalogDiscret( + new DateTime(2020, 07, 14, 0, 0, 0), + new DateTime(2020, 07, 14, 23, 59, 59), + 37); + foreach (var c in b.di) + { + Console.WriteLine(Names.discretFull[c.Key]); + foreach (var d in c.Value) + Console.WriteLine(d.Item1.ToString(@"yyyy.MM.dd HH:mm:ss.ff") + '\t' + d.Item2.ToString()); + } + foreach (var c in b.an) + { + Console.WriteLine(Names.discretFull[c.Key]); + foreach (var d in c.Value) + Console.WriteLine(d.Item1.ToString(@"yyyy.MM.dd HH:mm:ss.ff") + '\t' + d.Item2.ToString()); + } + + Console.ReadKey(); + + } + static void test4() + { + var a = new STPClient(); + var ts = new DateTime(2020, 07, 13, 0, 0, 0); + var te = new DateTime(2020, 07, 13, 23, 59, 59); + var totTime = new TimeSpan(); + for (ushort i = 1; i <= 50; i++) + { + var tc = a.GetTechCycle(ts, te, i); + var ad = a.GetAnalogDiscret(ts, te, i); + + Console.WriteLine("VDP " + i.ToString("D2")); + + var totalVdpTime = new TimeSpan(); + foreach (var e in tc) + { + int[] chk1 = { + (int)TechCycle.Operation.cooling_ingot, + (int)TechCycle.Operation.cooling_reflow, + (int)TechCycle.Operation.cooling_welding }; + int[] chk2 = + { + (int)TechCycle.Operation.end_tech_cycle, + (int)TechCycle.Operation.unloading_loading, + (int)TechCycle.Operation.looking_welding, + (int)TechCycle.Operation.unloading_kit + }; + if (!chk1.Contains((int)e.index) && !chk2.Contains((int)e.index)) + continue; + if (chk1.Contains((int)e.index)) + { + var test = + (from l in ad.an[13] + where l.Item1 >= e.start && + l.Item1 <= e.end && + l.Item2 >= 30 + select l).ToArray(); + if (test.Length == 0) + continue; + } + + Tuple currstat = new Tuple(e.start, null); + foreach (var d in ad.di[22]) + { + if ( + currstat.Item1 <= e.end && + d.Item1 >= e.start && + currstat.Item2.HasValue && + currstat.Item2.Value + ) + { + var t1 = currstat.Item1 > e.start ? currstat.Item1 : e.start; + var t2 = d.Item1 > e.end ? e.end : d.Item1; + var res = t2 - t1; + Console.Write(e.start.ToString(@"yyyy.MM.dd HH:mm:ss.ff") + '\t'); + Console.Write(Names.techCycle[(int)e.index] + '\t'); + Console.WriteLine(res.ToString(@"hh\:mm\:ss")); + totalVdpTime = totalVdpTime.Add(res); + } + currstat = d; + } + } + Console.WriteLine("Total VDP Time: " + totalVdpTime.ToString(@"hh\:mm\:ss")); + totTime = totTime.Add(totalVdpTime); + } + Console.WriteLine("Total Time: " + totTime.ToString(@"hh\:mm\:ss")); + Console.ReadKey(); + } + static void test5() + { + var a = new STPClient(); + var i = DateTime.Now.AddDays(-1 * new Random().Next(10)); + Console.WriteLine(i.ToString()); + + var b = a.GetListPasport(i); + foreach (var e in b) + Console.WriteLine(e.Item1 + '\t' + e.Item2); + Console.WriteLine(); + + var r = new Random().Next(b.Length); + Console.WriteLine(b[r].Item1 + '\t' + b[r].Item2); + + var p = a.GetPasport(b[r].Item2); + Console.WriteLine(p.ToString()); + + } + static void test6() + { + var a = new STPClient(); + var s = DateTime.Now.AddDays(-30); + var e = DateTime.Now.AddDays(-20); + var b = a.GetIshData(s, e, 37); + Console.WriteLine(s.ToString(@"yyyy.MM.dd HH:mm:ss.ff") + '\t' + e.ToString(@"yyyy.MM.dd HH:mm:ss.ff")); + foreach(var t in b) + { + Console.WriteLine(t.time.ToString(@"yyyy.MM.dd HH:mm:ss.ff") + '\t' + t.id.ToString("D2") + '\t' + t.value); + } + } + + static void test7() + { + var w = new STPClient(); + var s = new DateTime(2020, 06, 1); + var e = new DateTime(2020, 07, 22); + var r1 = new List>(); + var r2 = new List(); + for (var i = s; i < e; i = i.AddDays(1)) + { + var a = w.GetListPasport(i); + foreach(var b in a) + { + var c = w.GetPasport(b.Item2); + var d = w.GetIshData(c.time_start, c.time_end, c.numVDP); + var flag = false; + foreach(var f in d) + { + if (f.id != 0) continue; + //Console.Write(f.time.ToString(@"yyyy.MM.dd HH:mm:ss.ff") + '\t' + b.Item1 + '\t' + f.value); + Regex r = new Regex(@"(\w*)-(\w{3})-32-031(\w*)", RegexOptions.Compiled | RegexOptions.IgnoreCase); + //Console.WriteLine('\t' + r.IsMatch(f.value).ToString()); + flag = flag || r.IsMatch(f.value); + } + if (flag) + { + r1.Add(b); r2.Add(c); + Console.WriteLine(b.Item1 + '\t' + + c.time_start.ToString(@"yyyy.MM.dd HH:mm:ss.ff") + '\t' + + c.time_end.ToString(@"yyyy.MM.dd HH:mm:ss.ff")); + foreach (var f in d) + { + if (f.id != 0) continue; + Console.WriteLine(f.time.ToString(@"yyyy.MM.dd HH:mm:ss.ff") + '\t' + f.value); + } + } + } + } + + Console.WriteLine(); + var fs = new StreamWriter(Directory.GetCurrentDirectory() + '\\' + "result.txt"); + for(var i = 0; i < r1.Count; i++) + { + var a = w.GetProtectData(r2[i].time_start, r2[i].time_end, r2[i].numVDP); + var b = new List(); + foreach(var c in a) + if (c.id == 72) b.Add(c); + if (b.Count > 0) + { + Console.WriteLine(r1[i].Item1 + '\t' + + r2[i].time_start.ToString(@"yyyy.MM.dd HH:mm:ss.ff") + '\t' + + r2[i].time_end.ToString(@"yyyy.MM.dd HH:mm:ss.ff")); + fs.WriteLine(r1[i].Item1 + '\t' + + r2[i].time_start.ToString(@"yyyy.MM.dd HH:mm:ss.ff") + '\t' + + r2[i].time_end.ToString(@"yyyy.MM.dd HH:mm:ss.ff")); + foreach (var d in b) + { + Console.WriteLine(d.time.ToString(@"yyyy.MM.dd HH:mm:ss.ff") + '\t' + d.id.ToString("D2") + '\t' + d.value); + fs.WriteLine(d.time.ToString(@"yyyy.MM.dd HH:mm:ss.ff") + '\t' + d.value); + } + } + } + fs.Close(); + } + } +} diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj new file mode 100644 index 0000000..34f43f9 --- /dev/null +++ b/Tests/Tests.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp3.1 + + + + + + + + + + + + + diff --git a/Tests/bin/Debug/netcoreapp3.1/DataClients.dll b/Tests/bin/Debug/netcoreapp3.1/DataClients.dll new file mode 100644 index 0000000..5c663b8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/DataClients.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/DataClients.pdb b/Tests/bin/Debug/netcoreapp3.1/DataClients.pdb new file mode 100644 index 0000000..74fb79f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/DataClients.pdb differ diff --git a/Tests/bin/Debug/netcoreapp3.1/ICSharpCode.SharpZipLib.dll b/Tests/bin/Debug/netcoreapp3.1/ICSharpCode.SharpZipLib.dll new file mode 100644 index 0000000..58893ba Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/ICSharpCode.SharpZipLib.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/Mailing.dll b/Tests/bin/Debug/netcoreapp3.1/Mailing.dll new file mode 100644 index 0000000..d232fb0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/Mailing.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/Mailing.exe b/Tests/bin/Debug/netcoreapp3.1/Mailing.exe new file mode 100644 index 0000000..c22b907 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/Mailing.exe differ diff --git a/Tests/bin/Debug/netcoreapp3.1/Mailing.pdb b/Tests/bin/Debug/netcoreapp3.1/Mailing.pdb new file mode 100644 index 0000000..4c29921 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/Mailing.pdb differ diff --git a/Tests/bin/Debug/netcoreapp3.1/Microsoft.Win32.SystemEvents.dll b/Tests/bin/Debug/netcoreapp3.1/Microsoft.Win32.SystemEvents.dll new file mode 100644 index 0000000..d271945 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/Microsoft.Win32.SystemEvents.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/MigraDoc.DocumentObjectModel.dll b/Tests/bin/Debug/netcoreapp3.1/MigraDoc.DocumentObjectModel.dll new file mode 100644 index 0000000..5ed2823 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/MigraDoc.DocumentObjectModel.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/MigraDoc.DocumentObjectModel.pdb b/Tests/bin/Debug/netcoreapp3.1/MigraDoc.DocumentObjectModel.pdb new file mode 100644 index 0000000..e9915bc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/MigraDoc.DocumentObjectModel.pdb differ diff --git a/Tests/bin/Debug/netcoreapp3.1/MigraDoc.Rendering.dll b/Tests/bin/Debug/netcoreapp3.1/MigraDoc.Rendering.dll new file mode 100644 index 0000000..48c51a1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/MigraDoc.Rendering.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/MigraDoc.Rendering.pdb b/Tests/bin/Debug/netcoreapp3.1/MigraDoc.Rendering.pdb new file mode 100644 index 0000000..9d9973e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/MigraDoc.Rendering.pdb differ diff --git a/Tests/bin/Debug/netcoreapp3.1/PdfSharp.Charting.dll b/Tests/bin/Debug/netcoreapp3.1/PdfSharp.Charting.dll new file mode 100644 index 0000000..af1412c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/PdfSharp.Charting.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/PdfSharp.Charting.pdb b/Tests/bin/Debug/netcoreapp3.1/PdfSharp.Charting.pdb new file mode 100644 index 0000000..f6365b7 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/PdfSharp.Charting.pdb differ diff --git a/Tests/bin/Debug/netcoreapp3.1/PdfSharp.dll b/Tests/bin/Debug/netcoreapp3.1/PdfSharp.dll new file mode 100644 index 0000000..4050264 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/PdfSharp.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/PdfSharp.pdb b/Tests/bin/Debug/netcoreapp3.1/PdfSharp.pdb new file mode 100644 index 0000000..f3c0d1d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/PdfSharp.pdb differ diff --git a/Tests/bin/Debug/netcoreapp3.1/STPClient.dll b/Tests/bin/Debug/netcoreapp3.1/STPClient.dll new file mode 100644 index 0000000..1845bf4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/STPClient.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/STPClient.pdb b/Tests/bin/Debug/netcoreapp3.1/STPClient.pdb new file mode 100644 index 0000000..7fb6b9a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/STPClient.pdb differ diff --git a/Tests/bin/Debug/netcoreapp3.1/System.Drawing.Common.dll b/Tests/bin/Debug/netcoreapp3.1/System.Drawing.Common.dll new file mode 100644 index 0000000..3011aaf Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/System.Drawing.Common.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/System.Text.Encoding.CodePages.dll b/Tests/bin/Debug/netcoreapp3.1/System.Text.Encoding.CodePages.dll new file mode 100644 index 0000000..2f0a76d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/System.Text.Encoding.CodePages.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/Tests.deps.json b/Tests/bin/Debug/netcoreapp3.1/Tests.deps.json new file mode 100644 index 0000000..36d1923 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/Tests.deps.json @@ -0,0 +1,229 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v3.1", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v3.1": { + "Tests/1.0.0": { + "dependencies": { + "DataClients": "1.0.0", + "Mailing": "1.0.0", + "SharpZipLib": "1.2.0", + "System.Text.Encoding.CodePages": "4.7.1" + }, + "runtime": { + "Tests.dll": {} + } + }, + "Microsoft.NETCore.Platforms/3.1.1": {}, + "Microsoft.Win32.SystemEvents/4.5.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "3.1.1" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Win32.SystemEvents.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "SharpZipLib/1.2.0": { + "runtime": { + "lib/netstandard2.0/ICSharpCode.SharpZipLib.dll": { + "assemblyVersion": "1.2.0.246", + "fileVersion": "1.2.0.246" + } + } + }, + "System.Drawing.Common/4.5.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "3.1.1", + "Microsoft.Win32.SystemEvents": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/System.Drawing.Common.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + } + }, + "runtimeTargets": { + "runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll": { + "rid": "unix", + "assetType": "runtime", + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + }, + "runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "4.0.0.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Text.Encoding.CodePages/4.7.1": { + "dependencies": { + "Microsoft.NETCore.Platforms": "3.1.1" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encoding.CodePages.dll": { + "assemblyVersion": "4.1.3.0", + "fileVersion": "4.700.20.21406" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "4.1.3.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "DataClients/1.0.0": { + "dependencies": { + "SharpZipLib": "1.2.0", + "System.Text.Encoding.CodePages": "4.7.1" + }, + "runtime": { + "DataClients.dll": {} + } + }, + "Mailing/1.0.0": { + "dependencies": { + "DataClients": "1.0.0", + "MigraDoc.DocumentObjectModel": "3.0.0", + "MigraDoc.Rendering": "3.0.0", + "PdfSharp": "3.0.0", + "SharpZipLib": "1.2.0" + }, + "runtime": { + "Mailing.dll": {} + } + }, + "MigraDoc.DocumentObjectModel/3.0.0": { + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "MigraDoc.DocumentObjectModel.dll": {} + } + }, + "MigraDoc.Rendering/3.0.0": { + "dependencies": { + "MigraDoc.DocumentObjectModel": "3.0.0", + "PdfSharp": "3.0.0", + "PdfSharp.Charting": "3.0.0", + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "MigraDoc.Rendering.dll": {} + }, + "resources": { + "de/MigraDoc.Rendering.resources.dll": { + "locale": "de" + } + } + }, + "PdfSharp/3.0.0": { + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "PdfSharp.dll": {} + } + }, + "PdfSharp.Charting/3.0.0": { + "dependencies": { + "PdfSharp": "3.0.0", + "System.Drawing.Common": "4.5.0" + }, + "runtime": { + "PdfSharp.Charting.dll": {} + } + } + } + }, + "libraries": { + "Tests/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.NETCore.Platforms/3.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RmINcaqiEkawM9C8oxFMN/CZmn1fGKWVsosbSY/8ARUNdHqV47hqhPVbrG3qUqLaRQI5w4HuqFOqrbhoSWcH6w==", + "path": "microsoft.netcore.platforms/3.1.1", + "hashPath": "microsoft.netcore.platforms.3.1.1.nupkg.sha512" + }, + "Microsoft.Win32.SystemEvents/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LuI1oG+24TUj1ZRQQjM5Ew73BKnZE5NZ/7eAdh1o8ST5dPhUnJvIkiIn2re3MwnkRy6ELRnvEbBxHP8uALKhJw==", + "path": "microsoft.win32.systemevents/4.5.0", + "hashPath": "microsoft.win32.systemevents.4.5.0.nupkg.sha512" + }, + "SharpZipLib/1.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zvWa/L02JHNatdtjya6Swpudb2YEHaOLHL1eRrqpjm71iGRNUNONO5adUF/9CHbSJbzhELW1UoH4NGy7n7+3bQ==", + "path": "sharpziplib/1.2.0", + "hashPath": "sharpziplib.1.2.0.nupkg.sha512" + }, + "System.Drawing.Common/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AiJFxxVPdeITstiRS5aAu8+8Dpf5NawTMoapZ53Gfirml24p7HIfhjmCRxdXnmmf3IUA3AX3CcW7G73CjWxW/Q==", + "path": "system.drawing.common/4.5.0", + "hashPath": "system.drawing.common.4.5.0.nupkg.sha512" + }, + "System.Text.Encoding.CodePages/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-i2fOvznVVgOOTLUz8FgSap/MsR98I4Iaoz99VXcOW/e7Y2OdY42zhYpBYpZyivk5alYY/UsOWAVswhtjxceodA==", + "path": "system.text.encoding.codepages/4.7.1", + "hashPath": "system.text.encoding.codepages.4.7.1.nupkg.sha512" + }, + "DataClients/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Mailing/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "MigraDoc.DocumentObjectModel/3.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "MigraDoc.Rendering/3.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "PdfSharp/3.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "PdfSharp.Charting/3.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Tests/bin/Debug/netcoreapp3.1/Tests.dll b/Tests/bin/Debug/netcoreapp3.1/Tests.dll new file mode 100644 index 0000000..0826cba Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/Tests.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/Tests.exe b/Tests/bin/Debug/netcoreapp3.1/Tests.exe new file mode 100644 index 0000000..c6b6f06 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/Tests.exe differ diff --git a/Tests/bin/Debug/netcoreapp3.1/Tests.pdb b/Tests/bin/Debug/netcoreapp3.1/Tests.pdb new file mode 100644 index 0000000..d0f64d3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/Tests.pdb differ diff --git a/Tests/bin/Debug/netcoreapp3.1/Tests.runtimeconfig.dev.json b/Tests/bin/Debug/netcoreapp3.1/Tests.runtimeconfig.dev.json new file mode 100644 index 0000000..7b6758a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/Tests.runtimeconfig.dev.json @@ -0,0 +1,10 @@ +{ + "runtimeOptions": { + "additionalProbingPaths": [ + "C:\\Users\\google\\.dotnet\\store\\|arch|\\|tfm|", + "C:\\Users\\google\\.nuget\\packages", + "C:\\Microsoft\\Xamarin\\NuGet", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ] + } +} \ No newline at end of file diff --git a/Tests/bin/Debug/netcoreapp3.1/Tests.runtimeconfig.json b/Tests/bin/Debug/netcoreapp3.1/Tests.runtimeconfig.json new file mode 100644 index 0000000..bc456d7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/Tests.runtimeconfig.json @@ -0,0 +1,9 @@ +{ + "runtimeOptions": { + "tfm": "netcoreapp3.1", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "3.1.0" + } + } +} \ No newline at end of file diff --git a/Tests/bin/Debug/netcoreapp3.1/de/MigraDoc.Rendering.resources.dll b/Tests/bin/Debug/netcoreapp3.1/de/MigraDoc.Rendering.resources.dll new file mode 100644 index 0000000..08b0229 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/de/MigraDoc.Rendering.resources.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/result.txt b/Tests/bin/Debug/netcoreapp3.1/result.txt new file mode 100644 index 0000000..e630fcf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/result.txt @@ -0,0 +1,24 @@ +9-33-11158 2020.06.04 18:21:46.00 2020.06.05 08:05:39.00 +2020.06.05 00:44:30.17 1 +2020.06.05 06:07:09.22 0 +9-48-02541 2020.06.16 13:44:56.00 2020.06.17 08:20:09.00 +2020.06.17 01:27:45.10 1 +2020.06.17 06:33:08.82 0 +9-48-02547 2020.06.21 03:17:40.00 2020.06.21 23:08:03.00 +2020.06.21 15:50:48.05 1 +2020.06.21 21:18:40.68 0 +9-48-02548 2020.06.21 23:08:03.00 2020.06.22 15:42:58.00 +2020.06.22 07:51:49.09 1 +2020.06.22 13:53:29.29 0 +9-34-09615 2020.06.25 10:22:42.00 2020.06.26 02:52:30.00 +2020.06.25 19:11:23.10 1 +2020.06.26 01:07:08.89 0 +9-08-05921 2020.06.25 09:21:50.00 2020.06.26 07:32:28.00 +2020.06.25 23:57:45.17 1 +2020.06.26 05:44:25.04 0 +9-37-06593 2020.07.13 14:27:42.00 2020.07.14 06:47:49.00 +2020.07.13 22:55:30.14 1 +2020.07.14 05:02:20.52 0 +9-37-06598 2020.07.16 06:35:27.00 2020.07.17 07:23:00.00 +2020.07.16 23:09:33.09 1 +2020.07.17 05:32:21.74 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll b/Tests/bin/Debug/netcoreapp3.1/runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll new file mode 100644 index 0000000..311c7f3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll b/Tests/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll new file mode 100644 index 0000000..bb47b68 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll b/Tests/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll new file mode 100644 index 0000000..dcf5a77 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll b/Tests/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll new file mode 100644 index 0000000..5b0542c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200527.360 b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.360 new file mode 100644 index 0000000..eb18aa9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.360 @@ -0,0 +1,4 @@ +00:47:01 1590522421 3 14 +03:22:52 1590531772 1 10789 3 10 7 770 10 705 +06:54:23 1590544463 1 10789 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 10 4 2 5 Ti 6 7 770 8 3090 9 3860 10 705 11 12 320801 +07:51:44 1590547904 0 A--32-171-2018 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200527.361 b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.361 new file mode 100644 index 0000000..6165985 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.361 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200527.362 b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.362 new file mode 100644 index 0000000..4468068 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.362 @@ -0,0 +1,69 @@ +21 00:47:15 00:47:18 +Rsk= 15.7 Rkk= 12.1 + +22 01:04:51 01:20:23 +P1= 88.0 T1=01:15:23 P2=110.8 T2=01:20:23 Vs= 4.55 + +21 03:23:08 03:23:11 +Rsk= 15.5 Rkk= 12.4 + +22 03:55:24 04:10:57 +P1= 56.5 T1=04:05:57 P2= 73.5 T2=04:10:57 Vs= 3.40 + +22 04:24:54 04:40:27 +P1= 45.9 T1=04:35:27 P2= 59.3 T2=04:40:27 Vs= 2.68 + +20 05:49:53 05:50:01 +Riz_sol= 4848.1 + +21 05:50:08 05:50:11 +Rsk= 15.5 Rkk= 11.9 + +22 06:30:14 06:45:46 +P1= 46.9 T1=06:40:46 P2= 60.1 T2=06:45:46 Vs= 2.64 + +23 06:46:01 06:46:06 + + +24 06:46:13 06:46:50 + + +30 06:47:06 06:47:35 +Vst= 29.0 + +31 06:47:38 06:48:13 +Rom_sol= 7.5 + +41 06:48:45 06:48:50 +Ukz= 1.26 + +41 06:49:01 06:49:06 +Ukz= 1.14 + +32 06:49:10 06:49:46 +Imax=11.1 Umax=50.0 T= 9.0 + +33 06:49:53 06:50:17 +Imin= 8.0 Umin=17.9 T= 3.0 + +34 06:50:21 06:50:43 +V=300.2 T= 9.5 + +35 06:50:46 06:52:05 +Q= 54.4 T= 9.5 + +36 06:52:11 06:52:44 +P1=0.30 T= 3.0 + +37 06:52:49 06:53:06 +T= 1.0 + +38 06:53:11 06:53:18 +t= 53.6 T= 0.6 + +39 06:53:22 06:53:29 +t= 53.5 T= 0.6 + +40 06:53:37 06:53:44 +t= 53.5 T= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200527.363 b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.363 new file mode 100644 index 0000000..91b291a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.363 @@ -0,0 +1,16 @@ +14 00:45:46 1590522346 +15 01:21:34 1590524494 +16 01:40:51 1590525651 +1 02:19:56 1590527996 +2 03:18:01 1590531481 +5 04:41:27 1590536487 +6 04:51:50 1590537110 +7 05:24:13 1590539053 +8 05:48:00 1590540480 +25 06:47:02 1590544022 +9 06:54:23 1590544463 +10 07:41:44 1590547304 +11 19:38:41 1590590321 +12 22:09:54 1590599394 +13 23:58:30 1590605910 +0 23:58:30 1590605910 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200527.364 b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.364 new file mode 100644 index 0000000..00d3e7c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.364 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200527.366 b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.366 new file mode 100644 index 0000000..590f19b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.366 @@ -0,0 +1,93 @@ +[63] +oper = 14 +begin = 27.05.2020 00:45:46 +norma = 40 +vac_time = 7 +real = 35 + +[64] +oper = 15 +begin = 27.05.2020 01:21:34 +norma = 30 +real = 19 + +[65] +oper = 16 +begin = 27.05.2020 01:40:51 +norma = 40 +real = 39 + +[66] +oper = 1 +begin = 27.05.2020 02:19:56 +norma = 85 +real = 58 + +[67] +oper = 2 +begin = 27.05.2020 03:18:01 +norma = 110 +vac_time = 7 +real = 83 + +[68] +oper = 5 +begin = 27.05.2020 04:41:27 +norma = 25 +real = 10 + +[69] +oper = 6 +begin = 27.05.2020 04:51:50 +norma = 35 +real = 32 + +[70] +oper = 7 +begin = 27.05.2020 05:24:13 +norma = 30 +real = 23 + +[71] +oper = 8 +begin = 27.05.2020 05:48:00 +norma = 40 +vac_time = 7 +real = 59 + +[72] +oper = 25 +begin = 27.05.2020 06:47:02 +norma = 30 +real = 7 + +[73] +oper = 9 +begin = 27.05.2020 06:54:23 +norma = 0 +real = 47 + +[74] +oper = 10 +begin = 27.05.2020 07:41:44 +norma = 0 +real = 716 + +[75] +oper = 11 +begin = 27.05.2020 19:38:41 +norma = 0 +real = 151 + +[76] +oper = 12 +begin = 27.05.2020 22:09:54 +norma = 105 +real = 108 + +[77] +oper = 13 +begin = 27.05.2020 23:58:30 +norma = 45 +real = 90 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200527.367 b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.367 new file mode 100644 index 0000000..d9d0b34 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.367 @@ -0,0 +1,26 @@ +01:21:01 1590524461 祭 ० ࠧ +01:21:03 1590524463 祭 ० ' ⮪ 㣨' +01:22:21 1590524541 祭 ॣ '-2'(A) +01:39:26 1590525566 ⪫祭 ० ' ⮪ 㣨' +01:40:54 1590525654 ⪫祭 ॣ '-2'(A) +01:41:39 1590525699 祭 ० ᪠ +01:41:39 1590525699 祭 ० ᪠ +01:44:00 1590525840 ⪫祭 ० ᪠ (A) +04:52:44 1590537164 祭 ० ᪠ +04:55:22 1590537322 ⪫祭 ० ᪠ (A) +06:46:15 1590543975 祭 ॣ '-2'(A) +06:46:51 1590544011 ⪫祭 ॣ '-2'(A) +06:53:57 1590544437 祭 ० ࠧ +06:53:58 1590544438 祭 ० ' ⮪ 㣨' +07:10:45 1590545445 祭 ॣ '-2'(A) +07:41:44 1590547304 ⪫祭 ० ࠧ (A) +07:41:44 1590547304 祭 ⠭ ॣ +07:51:44 1590547904 祭 ॣ ।. 60 ᥪ. 殮 㣨 +19:38:40 1590590320 祭 ० +19:38:40 1590590320 ⪫祭 ॣ '-2'(A) +22:09:47 1590599387 ⪫祭 ० (A) +22:09:56 1590599396 ⪫祭 ० ' ⮪ 㣨' +22:11:24 1590599484 祭 ० ᪠ +22:11:25 1590599485 祭 ० ᪠ +22:11:26 1590599486 祭 ० ᪠ +22:14:55 1590599695 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200527.369 b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.369 new file mode 100644 index 0000000..776764c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200527.369 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.210 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.210 new file mode 100644 index 0000000..f3c3b9b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.210 @@ -0,0 +1,4 @@ +06:43:16 1590630196 3 14 +07:34:18 1590633258 0 A--32-067-2014 ॢ 0 +13:17:09 1590653829 7 920 10 870 +14:43:19 1590658999 0 A--32-120-2016 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.211 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.211 new file mode 100644 index 0000000..83ca9cb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.211 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.212 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.212 new file mode 100644 index 0000000..44a3984 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.212 @@ -0,0 +1,39 @@ +21 06:43:03 06:43:06 +Rsk= 11.6 Rkk= 5.5 + +22 07:05:12 07:15:17 +P1= 33.3 T1=07:10:17 P2= 56.5 T2=07:15:17 Vs= 4.63 + +21 10:29:11 10:29:14 +Rsk= 11.7 Rkk= 5.6 + +22 10:46:28 11:01:33 +P1= 74.6 T1=10:56:33 P2= 97.1 T2=11:01:33 Vs= 4.50 + +21 13:16:42 13:16:45 +Rsk= 11.4 Rkk= 5.4 + +22 13:35:58 13:51:02 +P1= 61.0 T1=13:46:02 P2= 80.6 T2=13:51:02 Vs= 3.91 + +21 16:27:26 16:27:29 +Rsk= 11.3 Rkk= 5.3 + +21 17:09:56 17:09:59 +Rsk= 11.3 Rkk= 5.2 + +22 17:30:40 17:45:45 +P1= 64.7 T1=17:40:45 P2= 92.9 T2=17:45:45 Vs= 5.63 + +22 17:59:52 18:09:56 +P1= 25.8 T1=18:04:56 P2= 47.5 T2=18:09:56 Vs= 4.34 + +21 20:28:54 20:28:57 +Rsk= 11.4 Rkk= 5.3 + +22 21:07:32 21:22:37 +P1= 75.1 T1=21:17:37 P2=101.7 T2=21:22:37 Vs= 5.32 + +22 21:34:50 21:44:54 +P1= 31.1 T1=21:39:54 P2= 52.7 T2=21:44:54 Vs= 4.33 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.213 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.213 new file mode 100644 index 0000000..dc298de --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.213 @@ -0,0 +1,28 @@ +10 00:07:11 1590606431 +12 02:17:53 1590614273 +13 06:09:30 1590628170 +0 06:09:30 1590628170 +14 06:39:57 1590629997 +15 07:16:51 1590632211 +16 07:39:10 1590633550 +1 08:25:47 1590636347 +14 10:25:59 1590643559 +15 11:06:34 1590645994 +16 11:17:35 1590646655 +15 11:25:50 1590647150 +16 12:10:02 1590649802 +1 12:53:03 1590652383 +14 13:14:57 1590653697 +15 13:52:14 1590655934 +16 15:05:04 1590660304 +1 15:48:43 1590662923 +14 16:25:28 1590665128 +1 17:03:01 1590667381 +14 17:09:47 1590667787 +15 18:11:25 1590671485 +16 18:41:33 1590673293 +1 19:27:12 1590676032 +14 20:26:44 1590679604 +15 21:46:40 1590684400 +16 22:19:25 1590686365 +1 22:59:25 1590688765 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.214 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.214 new file mode 100644 index 0000000..62e1dd2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.214 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.216 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.216 new file mode 100644 index 0000000..2deebbd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.216 @@ -0,0 +1,169 @@ +[94] +oper = 10 +begin = 28.05.2020 00:07:11 +norma = 0 +real = 130 + +[95] +oper = 12 +begin = 28.05.2020 02:17:53 +norma = 180 +real = 231 + +[96] +oper = 13 +begin = 28.05.2020 06:09:30 +norma = 45 +real = 30 + +[97] +oper = 14 +begin = 28.05.2020 06:39:57 +norma = 40 +vac_time = 7 +real = 36 + +[98] +oper = 15 +begin = 28.05.2020 07:16:51 +norma = 30 +real = 22 + +[99] +oper = 16 +begin = 28.05.2020 07:39:10 +norma = 40 +real = 46 + +[00] +oper = 1 +begin = 28.05.2020 08:25:47 +norma = 85 +real = 120 + +[01] +oper = 14 +begin = 28.05.2020 10:25:59 +norma = 40 +vac_time = 7 +real = 40 + +[02] +oper = 15 +begin = 28.05.2020 11:06:34 +norma = 30 +real = 11 + +[03] +oper = 16 +begin = 28.05.2020 11:17:35 +norma = 40 +real = 8 + +[04] +oper = 15 +begin = 28.05.2020 11:25:50 +norma = 30 +real = 44 + +[05] +oper = 16 +begin = 28.05.2020 12:10:02 +norma = 40 +real = 43 + +[06] +oper = 1 +begin = 28.05.2020 12:53:03 +norma = 85 +real = 21 + +[07] +oper = 14 +begin = 28.05.2020 13:14:57 +norma = 40 +vac_time = 6 +vac_avg10 = 7.4 +real = 37 + +[08] +oper = 15 +begin = 28.05.2020 13:52:14 +norma = 30 +real = 72 + +[09] +oper = 16 +begin = 28.05.2020 15:05:04 +norma = 40 +real = 43 + +[10] +oper = 1 +begin = 28.05.2020 15:48:43 +norma = 85 +real = 36 + +[11] +oper = 14 +begin = 28.05.2020 16:25:28 +norma = 40 +vac_time = 6 +real = 37 + +[12] +oper = 1 +begin = 28.05.2020 17:03:01 +norma = 85 +real = 6 + +[13] +oper = 14 +begin = 28.05.2020 17:09:47 +norma = 40 +vac_time = 6 +real = 61 + +[14] +oper = 15 +begin = 28.05.2020 18:11:25 +norma = 30 +real = 30 + +[15] +oper = 16 +begin = 28.05.2020 18:41:33 +norma = 40 +real = 45 + +[16] +oper = 1 +begin = 28.05.2020 19:27:12 +norma = 85 +real = 59 + +[17] +oper = 14 +begin = 28.05.2020 20:26:44 +norma = 40 +vac_time = 7 +real = 79 + +[18] +oper = 15 +begin = 28.05.2020 21:46:40 +norma = 30 +real = 32 + +[19] +oper = 16 +begin = 28.05.2020 22:19:25 +norma = 40 +real = 40 + +[20] +oper = 1 +begin = 28.05.2020 22:59:25 +norma = 85 +real = 185 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.217 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.217 new file mode 100644 index 0000000..e18ebaa --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.217 @@ -0,0 +1,29 @@ +00:07:11 1590606431 祭 ⠭ ॣ +02:17:58 1590614278 ⪫祭 ॣ '-2'(A) +07:16:52 1590632212 祭 ० ࠧ +07:16:54 1590632214 祭 ० ' ⮪ 㣨' +07:16:55 1590632215 祭 ॣ '-2'(A) +07:34:18 1590633258 ⪫祭 ० ࠧ (A) +07:39:11 1590633551 ⪫祭 ० ' ⮪ 㣨' +07:39:14 1590633554 ⪫祭 ॣ '-2'(A) +11:23:45 1590647025 祭 ० ࠧ +11:23:47 1590647027 祭 ० ' ⮪ 㣨' +11:25:22 1590647122 祭 ॣ '-2'(A) +12:10:03 1590649803 ⪫祭 ० ' ⮪ 㣨' +12:10:06 1590649806 ⪫祭 ॣ '-2'(A) +13:51:34 1590655894 祭 ० ࠧ +13:51:35 1590655895 祭 ० ' ⮪ 㣨' +13:53:31 1590656011 祭 ॣ '-2'(A) +14:43:19 1590658999 ⪫祭 ० ࠧ (A) +14:43:46 1590659026 ⪫祭 ० ' ⮪ 㣨' +15:05:09 1590660309 ⪫祭 ॣ '-2'(A) +18:10:45 1590671445 祭 ० ࠧ +18:10:46 1590671446 祭 ० ' ⮪ 㣨' +18:12:42 1590671562 祭 ॣ '-2'(A) +18:41:34 1590673294 ⪫祭 ० ' ⮪ 㣨' +18:41:37 1590673297 ⪫祭 ॣ '-2'(A) +21:46:01 1590684361 祭 ० ࠧ +21:46:02 1590684362 祭 ० ' ⮪ 㣨' +21:47:57 1590684477 祭 ॣ '-2'(A) +22:19:27 1590686367 ⪫祭 ० ' ⮪ 㣨' +22:19:29 1590686369 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.219 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.219 new file mode 100644 index 0000000..3d27ac3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.219 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.360 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.360 new file mode 100644 index 0000000..6cbb12d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.360 @@ -0,0 +1,2 @@ +01:31:35 1590611495 3 14 +03:58:40 1590620320 0 A--32-067-2014 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.361 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.361 new file mode 100644 index 0000000..042fd38 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.361 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.362 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.362 new file mode 100644 index 0000000..5511f61 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.362 @@ -0,0 +1,12 @@ +21 01:31:21 01:31:24 +Rsk= 14.6 Rkk= 10.8 + +22 02:09:38 02:25:10 +P1= 79.9 T1=02:20:10 P2=108.8 T2=02:25:10 Vs= 5.79 + +22 02:39:40 02:55:13 +P1= 70.8 T1=02:50:13 P2= 96.9 T2=02:55:13 Vs= 5.22 + +22 03:09:58 03:25:30 +P1= 66.8 T1=03:20:30 P2= 91.3 T2=03:25:30 Vs= 4.90 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.363 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.363 new file mode 100644 index 0000000..f2f24d6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.363 @@ -0,0 +1,4 @@ +14 01:29:15 1590611355 +15 03:28:42 1590618522 +16 04:00:49 1590620449 +1 05:16:28 1590624988 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.364 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.364 new file mode 100644 index 0000000..71df7bd Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.364 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.366 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.366 new file mode 100644 index 0000000..a51cee4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.366 @@ -0,0 +1,2 @@ +real = -7546 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200528.367 b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.367 new file mode 100644 index 0000000..511cd39 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200528.367 @@ -0,0 +1,9 @@ +03:26:58 1590618418 祭 ० ࠧ +03:27:01 1590618421 祭 ० ' ⮪ 㣨' +03:29:29 1590618569 祭 ॣ '-2'(A) +03:58:40 1590620320 ⪫祭 ० ࠧ (A) +04:00:51 1590620451 ⪫祭 ० ' ⮪ 㣨' +04:00:54 1590620454 ⪫祭 ॣ '-2'(A) +04:01:16 1590620476 祭 ० ᪠ +04:01:17 1590620477 祭 ० ᪠ +04:04:45 1590620685 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200529.211 b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.211 new file mode 100644 index 0000000..a123d67 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.211 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200529.212 b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.212 new file mode 100644 index 0000000..cf8bdd5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.212 @@ -0,0 +1,42 @@ +21 02:07:51 02:07:54 +Rsk= 11.6 Rkk= 5.6 + +22 03:05:28 03:15:32 +P1= 20.2 T1=03:10:32 P2= 28.6 T2=03:15:32 Vs= 1.68 + +21 05:35:28 05:35:31 +Rsk= 11.8 Rkk= 5.7 + +22 06:08:11 06:18:15 +P1= 19.6 T1=06:13:15 P2= 29.0 T2=06:18:15 Vs= 1.89 + +21 09:21:39 09:21:42 +Rsk= 11.9 Rkk= 5.8 + +22 09:39:58 09:50:02 +P1= 33.9 T1=09:45:02 P2= 55.5 T2=09:50:02 Vs= 4.32 + +21 12:49:43 12:49:46 +Rsk= 12.0 Rkk= 5.8 + +22 13:20:23 13:30:27 +P1= 21.3 T1=13:25:27 P2= 32.2 T2=13:30:27 Vs= 2.19 + +21 16:22:45 16:22:48 +Rsk= 12.0 Rkk= 5.8 + +22 16:51:48 17:01:52 +P1= 18.7 T1=16:56:52 P2= 27.3 T2=17:01:52 Vs= 1.71 + +21 19:46:30 19:46:33 +Rsk= 12.0 Rkk= 5.9 + +22 20:04:42 20:14:46 +P1= 22.1 T1=20:09:46 P2= 33.3 T2=20:14:46 Vs= 2.25 + +21 22:43:38 22:43:42 +Rsk= 12.0 Rkk= 5.9 + +22 23:11:56 23:22:01 +P1= 18.3 T1=23:17:01 P2= 26.8 T2=23:22:01 Vs= 1.71 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200529.213 b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.213 new file mode 100644 index 0000000..0bd5751 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.213 @@ -0,0 +1,26 @@ +14 02:05:13 1590699913 +15 03:16:18 1590704178 +16 04:18:29 1590707909 +1 04:54:20 1590710060 +14 05:32:42 1590712362 +15 06:19:31 1590715171 +16 07:38:02 1590719882 +1 08:28:42 1590722922 +14 09:19:04 1590725944 +15 09:52:19 1590727939 +16 11:06:06 1590732366 +1 11:51:25 1590735085 +14 12:46:23 1590738383 +15 13:32:30 1590741150 +16 14:46:30 1590745590 +1 15:32:49 1590748369 +14 16:19:05 1590751145 +15 17:03:40 1590753820 +16 18:16:58 1590758218 +1 19:05:50 1590761150 +14 19:41:15 1590763275 +15 20:16:33 1590765393 +16 21:30:08 1590769808 +1 22:14:52 1590772492 +14 22:40:57 1590774057 +15 23:23:37 1590776617 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200529.214 b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.214 new file mode 100644 index 0000000..04134e6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.214 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200529.215 b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.215 new file mode 100644 index 0000000..57b2689 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.215 @@ -0,0 +1 @@ +109 02:59:01 1590703141 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200529.216 b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.216 new file mode 100644 index 0000000..b08d487 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.216 @@ -0,0 +1,164 @@ +[21] +oper = 14 +begin = 29.05.2020 02:05:13 +norma = 40 +vac_time = 6 +real = 71 + +[22] +oper = 15 +begin = 29.05.2020 03:16:18 +norma = 30 +real = 62 + +[23] +oper = 16 +begin = 29.05.2020 04:18:29 +norma = 40 +real = 35 + +[24] +oper = 1 +begin = 29.05.2020 04:54:20 +norma = 85 +real = 38 + +[25] +oper = 14 +begin = 29.05.2020 05:32:42 +norma = 40 +vac_time = 6 +real = 46 + +[26] +oper = 15 +begin = 29.05.2020 06:19:31 +norma = 30 +real = 78 + +[27] +oper = 16 +begin = 29.05.2020 07:38:02 +norma = 40 +real = 50 + +[28] +oper = 1 +begin = 29.05.2020 08:28:42 +norma = 85 +real = 50 + +[29] +oper = 14 +begin = 29.05.2020 09:19:04 +norma = 40 +vac_time = 6 +real = 33 + +[30] +oper = 15 +begin = 29.05.2020 09:52:19 +norma = 30 +real = 73 + +[31] +oper = 16 +begin = 29.05.2020 11:06:06 +norma = 40 +real = 45 + +[32] +oper = 1 +begin = 29.05.2020 11:51:25 +norma = 85 +real = 54 + +[33] +oper = 14 +begin = 29.05.2020 12:46:23 +norma = 40 +vac_time = 6 +real = 46 + +[34] +oper = 15 +begin = 29.05.2020 13:32:30 +norma = 30 +real = 74 + +[35] +oper = 16 +begin = 29.05.2020 14:46:30 +norma = 40 +real = 46 + +[36] +oper = 1 +begin = 29.05.2020 15:32:49 +norma = 85 +real = 46 + +[37] +oper = 14 +begin = 29.05.2020 16:19:05 +norma = 40 +vac_time = 6 +real = 44 + +[38] +oper = 15 +begin = 29.05.2020 17:03:40 +norma = 30 +real = 73 + +[39] +oper = 16 +begin = 29.05.2020 18:16:58 +norma = 40 +real = 48 + +[40] +oper = 1 +begin = 29.05.2020 19:05:50 +norma = 85 +real = 35 + +[41] +oper = 14 +begin = 29.05.2020 19:41:15 +norma = 40 +vac_time = 6 +real = 35 + +[42] +oper = 15 +begin = 29.05.2020 20:16:33 +norma = 30 +real = 73 + +[43] +oper = 16 +begin = 29.05.2020 21:30:08 +norma = 40 +real = 44 + +[44] +oper = 1 +begin = 29.05.2020 22:14:52 +norma = 85 +real = 26 + +[45] +oper = 14 +begin = 29.05.2020 22:40:57 +norma = 40 +vac_time = 6 +vac_avg10 = 6.1 +real = 42 + +[46] +oper = 15 +begin = 29.05.2020 23:23:37 +norma = 30 +real = 79 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200529.217 b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.217 new file mode 100644 index 0000000..7350c32 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200529.217 @@ -0,0 +1,33 @@ +03:16:19 1590704179 祭 ० ࠧ +03:16:20 1590704180 祭 ० ' ⮪ 㣨' +03:16:21 1590704181 祭 ॣ '-2'(A) +04:18:24 1590707904 ⪫祭 ० ' ⮪ 㣨' +04:18:34 1590707914 ⪫祭 ॣ '-2'(A) +06:18:49 1590715129 祭 ० ࠧ +06:18:51 1590715131 祭 ० ' ⮪ 㣨' +06:20:49 1590715249 祭 ॣ '-2'(A) +07:38:01 1590719881 ⪫祭 ० ' ⮪ 㣨' +07:38:06 1590719886 ⪫祭 ॣ '-2'(A) +09:52:17 1590727937 祭 ० ࠧ +09:52:19 1590727939 祭 ० ' ⮪ 㣨' +09:52:21 1590727941 祭 ॣ '-2'(A) +11:06:08 1590732368 ⪫祭 ० ' ⮪ 㣨' +11:06:10 1590732370 ⪫祭 ॣ '-2'(A) +11:06:18 1590732378 ⪫祭 ० ࠧ +13:32:25 1590741145 祭 ० ࠧ +13:32:27 1590741147 祭 ० ' ⮪ 㣨' +13:32:28 1590741148 祭 ॣ '-2'(A) +14:46:32 1590745592 ⪫祭 ० ' ⮪ 㣨' +14:46:34 1590745594 ⪫祭 ॣ '-2'(A) +14:46:36 1590745596 ⪫祭 ० ࠧ +17:04:01 1590753841 祭 ० ࠧ +17:04:03 1590753843 祭 ० ' ⮪ 㣨' +18:16:59 1590758219 ⪫祭 ० ' ⮪ 㣨' +18:17:13 1590758233 ⪫祭 ० ࠧ +20:16:35 1590765395 祭 ० ' ⮪ 㣨' +20:16:48 1590765408 ⪫祭 ० ' ⮪ 㣨' +20:17:15 1590765435 祭 ० ࠧ +20:17:18 1590765438 祭 ० ' ⮪ 㣨' +21:30:10 1590769810 ⪫祭 ० ' ⮪ 㣨' +23:23:23 1590776603 祭 ० ࠧ +23:23:51 1590776631 祭 ० ' ⮪ 㣨' diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200530.210 b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.210 new file mode 100644 index 0000000..8327851 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.210 @@ -0,0 +1,3 @@ +03:35:18 1590791718 0 A--32-120-2016 ॢ 0 +07:03:38 1590804218 0 A--32-120-2016 ॢ 0 +10:05:25 1590815125 10 840 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200530.211 b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.211 new file mode 100644 index 0000000..b74724c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.211 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200530.212 b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.212 new file mode 100644 index 0000000..043dd73 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.212 @@ -0,0 +1,42 @@ +21 02:23:25 02:23:28 +Rsk= 12.2 Rkk= 6.0 + +22 03:05:40 03:15:44 +P1= 15.4 T1=03:10:44 P2= 23.1 T2=03:15:44 Vs= 1.54 + +21 05:25:12 05:25:15 +Rsk= 12.2 Rkk= 6.0 + +22 06:21:16 06:31:20 +P1= 14.8 T1=06:26:20 P2= 20.7 T2=06:31:20 Vs= 1.18 + +21 10:04:57 10:05:00 +Rsk= 12.2 Rkk= 6.0 + +22 10:25:32 10:35:37 +P1= 30.7 T1=10:30:37 P2= 49.9 T2=10:35:37 Vs= 3.84 + +21 13:32:43 13:32:46 +Rsk= 12.2 Rkk= 6.1 + +22 13:55:06 14:05:10 +P1= 29.6 T1=14:00:10 P2= 48.7 T2=14:05:10 Vs= 3.81 + +21 16:38:44 16:38:47 +Rsk= 12.2 Rkk= 6.1 + +22 17:05:09 17:15:14 +P1= 22.3 T1=17:10:14 P2= 35.4 T2=17:15:14 Vs= 2.63 + +21 19:43:26 19:43:29 +Rsk= 12.3 Rkk= 6.2 + +22 20:04:59 20:15:03 +P1= 30.4 T1=20:10:03 P2= 51.4 T2=20:15:03 Vs= 4.21 + +21 22:28:05 22:28:08 +Rsk= 12.4 Rkk= 6.2 + +22 22:50:07 23:00:11 +P1= 21.9 T1=22:55:11 P2= 34.8 T2=23:00:11 Vs= 2.59 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200530.213 b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.213 new file mode 100644 index 0000000..eb1e542 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.213 @@ -0,0 +1,28 @@ +16 00:42:55 1590781375 +1 01:35:47 1590784547 +14 02:19:53 1590787193 +15 03:17:30 1590790650 +16 03:55:35 1590792935 +1 04:40:30 1590795630 +14 05:22:45 1590798165 +15 06:32:57 1590802377 +16 07:07:01 1590804421 +1 08:06:17 1590807977 +14 09:59:59 1590814799 +15 10:36:59 1590817019 +16 12:00:04 1590822004 +1 12:42:59 1590824579 +14 13:31:19 1590827479 +15 14:06:10 1590829570 +16 15:35:02 1590834902 +1 16:13:08 1590837188 +14 16:38:23 1590838703 +15 17:17:03 1590841023 +16 18:39:38 1590845978 +1 19:25:01 1590848701 +14 19:42:05 1590849725 +15 20:17:11 1590851831 +16 21:35:37 1590856537 +1 22:08:06 1590858486 +14 22:26:04 1590859564 +15 23:01:51 1590861711 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200530.214 b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.214 new file mode 100644 index 0000000..097eada Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.214 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200530.216 b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.216 new file mode 100644 index 0000000..e0a203a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.216 @@ -0,0 +1,175 @@ +[47] +oper = 16 +begin = 30.05.2020 00:42:55 +norma = 40 +real = 52 + +[48] +oper = 1 +begin = 30.05.2020 01:35:47 +norma = 85 +real = 44 + +[49] +oper = 14 +begin = 30.05.2020 02:19:53 +norma = 40 +vac_time = 7 +real = 57 + +[50] +oper = 15 +begin = 30.05.2020 03:17:30 +norma = 30 +real = 38 + +[51] +oper = 16 +begin = 30.05.2020 03:55:35 +norma = 40 +real = 44 + +[52] +oper = 1 +begin = 30.05.2020 04:40:30 +norma = 85 +real = 42 + +[53] +oper = 14 +begin = 30.05.2020 05:22:45 +norma = 40 +vac_time = 7 +real = 70 + +[54] +oper = 15 +begin = 30.05.2020 06:32:57 +norma = 30 +real = 34 + +[55] +oper = 16 +begin = 30.05.2020 07:07:01 +norma = 40 +real = 59 + +[56] +oper = 1 +begin = 30.05.2020 08:06:17 +norma = 85 +real = 113 + +[57] +oper = 14 +begin = 30.05.2020 09:59:59 +norma = 40 +vac_time = 7 +real = 37 + +[58] +oper = 15 +begin = 30.05.2020 10:36:59 +norma = 30 +real = 83 + +[59] +oper = 16 +begin = 30.05.2020 12:00:04 +norma = 40 +real = 42 + +[60] +oper = 1 +begin = 30.05.2020 12:42:59 +norma = 85 +real = 48 + +[61] +oper = 14 +begin = 30.05.2020 13:31:19 +norma = 40 +vac_time = 6 +real = 34 + +[62] +oper = 15 +begin = 30.05.2020 14:06:10 +norma = 30 +real = 88 + +[63] +oper = 16 +begin = 30.05.2020 15:35:02 +norma = 40 +real = 38 + +[64] +oper = 1 +begin = 30.05.2020 16:13:08 +norma = 85 +real = 25 + +[65] +oper = 14 +begin = 30.05.2020 16:38:23 +norma = 40 +vac_time = 6 +real = 38 + +[66] +oper = 15 +begin = 30.05.2020 17:17:03 +norma = 30 +real = 82 + +[67] +oper = 16 +begin = 30.05.2020 18:39:38 +norma = 40 +real = 45 + +[68] +oper = 1 +begin = 30.05.2020 19:25:01 +norma = 85 +real = 17 + +[69] +oper = 14 +begin = 30.05.2020 19:42:05 +norma = 40 +vac_time = 6 +real = 35 + +[70] +oper = 15 +begin = 30.05.2020 20:17:11 +norma = 30 +real = 78 + +[71] +oper = 16 +begin = 30.05.2020 21:35:37 +norma = 40 +real = 32 + +[72] +oper = 1 +begin = 30.05.2020 22:08:06 +norma = 85 +real = 17 + +[73] +oper = 14 +begin = 30.05.2020 22:26:04 +norma = 40 +vac_time = 6 +real = 35 + +[74] +oper = 15 +begin = 30.05.2020 23:01:51 +norma = 30 +real = 78 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200530.217 b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.217 new file mode 100644 index 0000000..8a1c1ae --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200530.217 @@ -0,0 +1,34 @@ +00:42:54 1590781374 ⪫祭 ० ' ⮪ 㣨' +03:16:53 1590790613 祭 ० ࠧ +03:16:55 1590790615 祭 ० ' ⮪ 㣨' +03:18:47 1590790727 祭 ॣ '-2'(A) +03:35:18 1590791718 ⪫祭 ० ࠧ (A) +03:35:39 1590791739 ⪫祭 ० ' ⮪ 㣨' +03:55:39 1590792939 ⪫祭 ॣ '-2'(A) +06:32:01 1590802321 祭 ० ࠧ +06:32:03 1590802323 祭 ० ' ⮪ 㣨' +06:34:16 1590802456 祭 ॣ '-2'(A) +07:03:38 1590804218 ⪫祭 ० ࠧ (A) +07:07:00 1590804420 ⪫祭 ० ' ⮪ 㣨' +07:07:05 1590804425 ⪫祭 ॣ '-2'(A) +12:00:20 1590822020 祭 ० ᪠ +12:02:41 1590822161 ⪫祭 ० ᪠ +15:35:11 1590834911 祭 ० ᪠ +15:37:42 1590835062 ⪫祭 ० ᪠ (A) +17:16:20 1590840980 祭 ० ࠧ +17:16:21 1590840981 祭 ० ' ⮪ 㣨' +17:18:18 1590841098 祭 ॣ '-2'(A) +18:39:31 1590845971 ⪫祭 ० ' ⮪ 㣨' +18:39:41 1590845981 ⪫祭 ॣ '-2'(A) +18:40:04 1590846004 祭 ० ᪠ +18:42:36 1590846156 ⪫祭 ० ᪠ (A) +20:16:28 1590851788 祭 ० ࠧ +20:16:29 1590851789 祭 ० ' ⮪ 㣨' +20:18:27 1590851907 祭 ॣ '-2'(A) +21:35:30 1590856530 ⪫祭 ० ' ⮪ 㣨' +21:35:40 1590856540 ⪫祭 ॣ '-2'(A) +21:35:44 1590856544 祭 ० ᪠ +21:38:18 1590856698 ⪫祭 ० ᪠ (A) +23:00:50 1590861650 祭 ० ࠧ +23:00:50 1590861650 祭 ० ' ⮪ 㣨' +23:02:54 1590861774 祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.211 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.211 new file mode 100644 index 0000000..e5d638f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.211 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.212 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.212 new file mode 100644 index 0000000..a8625ff --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.212 @@ -0,0 +1,30 @@ +21 01:35:49 01:35:52 +Rsk= 12.3 Rkk= 6.2 + +22 01:54:55 02:05:00 +P1= 24.9 T1=02:00:00 P2= 39.8 T2=02:05:00 Vs= 2.98 + +21 05:02:41 05:02:44 +Rsk= 11.7 Rkk= 5.7 + +22 05:35:04 05:45:09 +P1= 19.8 T1=05:40:09 P2= 32.0 T2=05:45:09 Vs= 2.44 + +21 08:27:11 08:27:14 +Rsk= 11.9 Rkk= 5.8 + +22 08:51:57 09:02:02 +P1= 18.6 T1=08:57:02 P2= 29.1 T2=09:02:02 Vs= 2.10 + +21 11:11:07 11:11:10 +Rsk= 11.6 Rkk= 5.5 + +22 11:24:57 11:35:02 +P1= 23.3 T1=11:30:02 P2= 36.7 T2=11:35:02 Vs= 2.68 + +21 13:16:51 13:16:54 +Rsk= 11.8 Rkk= 5.7 + +22 13:38:16 13:48:20 +P1= 21.6 T1=13:43:20 P2= 33.7 T2=13:48:20 Vs= 2.42 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.213 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.213 new file mode 100644 index 0000000..7267305 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.213 @@ -0,0 +1,22 @@ +16 00:20:08 1590866408 +1 01:07:05 1590869225 +14 01:33:05 1590870785 +15 02:06:46 1590872806 +16 03:20:27 1590877227 +1 04:07:50 1590880070 +14 05:01:50 1590883310 +15 05:47:30 1590886050 +16 07:01:14 1590890474 +1 08:01:09 1590894069 +14 08:22:02 1590895322 +15 09:03:08 1590897788 +16 10:04:30 1590901470 +1 10:46:34 1590903994 +14 11:03:06 1590904986 +15 11:35:58 1590906958 +16 12:12:31 1590909151 +1 12:51:16 1590911476 +14 13:11:24 1590912684 +15 13:49:40 1590914980 +16 14:04:41 1590915881 +1 14:27:08 1590917228 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.214 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.214 new file mode 100644 index 0000000..7b62126 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.214 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.216 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.216 new file mode 100644 index 0000000..ca2ecf5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.216 @@ -0,0 +1,2 @@ +real = -12377 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.217 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.217 new file mode 100644 index 0000000..4160822 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.217 @@ -0,0 +1,28 @@ +00:20:10 1590866410 ⪫祭 ० ' ⮪ 㣨' +00:20:12 1590866412 ⪫祭 ॣ '-2'(A) +00:21:39 1590866499 祭 ० ᪠ +00:24:05 1590866645 ⪫祭 ० ᪠ (A) +02:06:44 1590872804 祭 ० ࠧ +02:06:46 1590872806 祭 ० ' ⮪ 㣨' +02:06:47 1590872807 祭 ॣ '-2'(A) +03:20:28 1590877228 ⪫祭 ० ' ⮪ 㣨' +03:20:31 1590877231 ⪫祭 ॣ '-2'(A) +03:22:11 1590877331 祭 ० ᪠ +03:25:31 1590877531 ⪫祭 ० ᪠ (A) +05:47:26 1590886046 祭 ० ࠧ +05:47:28 1590886048 祭 ० ' ⮪ 㣨' +05:47:29 1590886049 祭 ॣ '-2'(A) +07:01:15 1590890475 ⪫祭 ० ' ⮪ 㣨' +07:01:18 1590890478 ⪫祭 ॣ '-2'(A) +07:03:16 1590890596 祭 ० ᪠ +07:03:18 1590890598 . ⪫祭 ० ᪠ (A) +07:14:12 1590891252 祭 ० ᪠ +07:14:12 1590891252 祭 ० ᪠ +07:16:44 1590891404 ⪫祭 ० ᪠ (A) +10:04:41 1590901481 祭 ० ᪠ +10:07:13 1590901633 ⪫祭 ० ᪠ (A) +12:12:42 1590909162 祭 ० ᪠ +12:12:43 1590909163 祭 ० ᪠ +12:15:09 1590909309 ⪫祭 ० ᪠ (A) +14:04:52 1590915892 祭 ० ᪠ +14:07:28 1590916048 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.310 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.310 new file mode 100644 index 0000000..8edafcc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.310 @@ -0,0 +1,5 @@ +04:18:02 1590880682 3 14 +05:18:40 1590884320 0 A--32-067-2014 ॢ 0 +06:55:14 1590890114 1 07394 2 BT 18, 20, 22, 23, 25 3 25 7 870 10 770 12 321143 +07:53:11 1590893591 1 07394 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 870 8 3320 9 4780 10 770 11 12 321143 +08:24:02 1590895442 0 A--32-078-2017 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.311 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.311 new file mode 100644 index 0000000..0954b20 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.311 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.312 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.312 new file mode 100644 index 0000000..787cb18 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.312 @@ -0,0 +1,75 @@ +21 04:17:40 04:17:43 +Rsk= 24.4 Rkk= 21.7 + +22 04:36:00 04:46:35 +P1= 27.9 T1=04:41:35 P2= 50.3 T2=04:46:35 Vs= 4.47 + +20 06:56:03 06:56:12 +Riz_sol= 1330.0 + +21 06:56:23 06:56:26 +Rsk=1567.0 Rkk= 22.2 + +21 06:56:36 06:56:39 +Rsk=1569.0 Rkk= 22.2 + +21 06:56:52 06:56:55 +Rsk=1586.0 Rkk= 22.2 + +21 06:57:05 06:57:08 +Rsk= 24.9 Rkk= 22.1 + +22 07:26:26 07:42:02 +P1= 46.3 T1=07:37:02 P2= 60.7 T2=07:42:02 Vs= 2.87 + +23 07:42:21 07:42:26 + + +24 07:42:45 07:43:20 + + +30 07:43:57 07:44:21 +Vst= 29.2 + +31 07:44:36 07:44:41 +Rom_sol= -1.0 + +31 07:44:46 07:44:52 +Rom_sol= -1.0 + +31 07:45:02 07:45:07 +Rom_sol= -1.0 + +31 07:45:30 07:46:25 +Rom_sol= 13.2 + +41 07:47:16 07:47:21 +Ukz= 0.86 + +32 07:47:27 07:48:03 +Imax=11.0 Umax=50.0 T= 9.0 + +33 07:48:12 07:48:39 +Imin=16.0 Umin=25.0 T= 0.5 + +34 07:48:44 07:49:07 +V=300.0 T= 9.6 + +35 07:49:14 07:50:15 +Q= 54.3 T= 9.6 + +36 07:50:25 07:51:00 +P1=0.29 T= 3.1 + +37 07:51:07 07:51:45 +T= 1.1 + +38 07:51:50 07:51:57 +t= 52.0 T= 0.7 + +39 07:52:02 07:52:09 +t= 52.3 T= 0.7 + +40 07:52:14 07:52:21 +t= 52.3 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.313 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.313 new file mode 100644 index 0000000..5b2665b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.313 @@ -0,0 +1,15 @@ +12 01:58:45 1590872325 +13 03:46:57 1590878817 +0 03:46:57 1590878817 +14 04:15:03 1590880503 +15 04:49:43 1590882583 +16 05:22:02 1590884522 +1 05:55:09 1590886509 +8 06:49:56 1590889796 +25 07:43:52 1590893032 +9 07:53:11 1590893591 +10 08:24:02 1590895442 +11 14:20:01 1590916801 +12 17:51:04 1590929464 +13 19:55:32 1590936932 +0 19:55:32 1590936932 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.314 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.314 new file mode 100644 index 0000000..b3e59d3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.314 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.315 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.315 new file mode 100644 index 0000000..405459c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.315 @@ -0,0 +1,3 @@ +92 07:44:42 1590893082 +92 07:44:52 1590893092 +92 07:45:08 1590893108 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.316 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.316 new file mode 100644 index 0000000..afedefe --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.316 @@ -0,0 +1,80 @@ +[01] +oper = 12 +begin = 31.05.2020 01:58:45 +norma = 105 +real = 108 + +[02] +oper = 13 +begin = 31.05.2020 03:46:57 +norma = 45 +real = 28 + +[03] +oper = 14 +begin = 31.05.2020 04:15:03 +norma = 40 +vac_time = 7 +real = 34 + +[04] +oper = 15 +begin = 31.05.2020 04:49:43 +norma = 30 +real = 32 + +[05] +oper = 16 +begin = 31.05.2020 05:22:02 +norma = 40 +real = 33 + +[06] +oper = 1 +begin = 31.05.2020 05:55:09 +norma = 85 +real = 54 + +[07] +oper = 8 +begin = 31.05.2020 06:49:56 +norma = 40 +vac_time = 8 +real = 53 + +[08] +oper = 25 +begin = 31.05.2020 07:43:52 +norma = 30 +real = 9 + +[09] +oper = 9 +begin = 31.05.2020 07:53:11 +norma = 0 +real = 30 + +[10] +oper = 10 +begin = 31.05.2020 08:24:02 +norma = 0 +real = 355 + +[11] +oper = 11 +begin = 31.05.2020 14:20:01 +norma = 0 +real = 211 + +[12] +oper = 12 +begin = 31.05.2020 17:51:04 +norma = 105 +real = 124 + +[13] +oper = 13 +begin = 31.05.2020 19:55:32 +norma = 45 +real = 1601 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.317 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.317 new file mode 100644 index 0000000..059ac80 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.317 @@ -0,0 +1,67 @@ +00:05:02 1590865502 ⪫祭 ॣ '-2'(A) +01:58:43 1590872323 ⪫祭 ० (A) +01:58:45 1590872325 ⪫祭 +01:58:45 1590872325 : +01:58:47 1590872327 ⪫祭 ० ' ⮪ 㣨' +01:59:32 1590872372 祭 ० ᪠ +01:59:32 1590872372 祭 ० ᪠ +01:59:32 1590872372 祭 ० ᪠ +01:59:33 1590872373 祭 ० ᪠ +01:59:33 1590872373 祭 ० ᪠ +01:59:34 1590872374 祭 ० ᪠ +02:02:25 1590872545 ⪫祭 ० ᪠ (A) +02:28:45 1590874125 : 믮 +04:48:37 1590882517 祭 ० ࠧ +04:48:40 1590882520 祭 ० ' ⮪ 㣨' +04:48:47 1590882527 ⪫祭 ० ' ⮪ 㣨' +04:48:48 1590882528 ⪫祭 ० ࠧ +04:48:51 1590882531 祭 ० ࠧ +04:48:54 1590882534 祭 ० ' ⮪ 㣨' +04:49:07 1590882547 ⪫祭 ० ࠧ +04:49:11 1590882551 ⪫祭 ० ' ⮪ 㣨' +04:49:24 1590882564 祭 ० ࠧ +04:49:27 1590882567 祭 ० ' ⮪ 㣨' +04:50:30 1590882630 祭 ॣ '-2'(A) +05:18:40 1590884320 ⪫祭 ० ࠧ (A) +05:20:06 1590884406 ⪫祭 ० ' ⮪ 㣨' +05:22:05 1590884525 ⪫祭 ॣ '-2'(A) +05:22:28 1590884548 祭 ० ᪠ +05:22:28 1590884548 祭 ० ᪠ +05:22:28 1590884548 祭 ० ᪠ +05:22:29 1590884549 祭 ० ᪠ +05:22:29 1590884549 祭 ० ᪠ +05:22:29 1590884549 祭 ० ᪠ +05:22:29 1590884549 祭 ० ᪠ +05:22:30 1590884550 祭 ० ᪠ +05:22:30 1590884550 祭 ० ᪠ +05:22:30 1590884550 祭 ० ᪠ +05:22:31 1590884551 祭 ० ᪠ +05:22:31 1590884551 祭 ० ᪠ +05:22:31 1590884551 祭 ० ᪠ +05:22:32 1590884552 祭 ० ᪠ +05:22:32 1590884552 祭 ० ᪠ +05:22:32 1590884552 祭 ० ᪠ +05:25:22 1590884722 ⪫祭 ० ᪠ (A) +06:55:20 1590890120 : 㦥 +07:42:46 1590892966 祭 ॣ '-2'(A) +07:43:21 1590893001 ⪫祭 ॣ '-2'(A) +07:45:26 1590893126 祭 +07:45:26 1590893126 祭 +07:46:26 1590893186 ⪫祭 +07:52:37 1590893557 祭 ० ࠧ +07:52:39 1590893559 祭 ० ' ⮪ 㣨' +07:53:12 1590893592 : 믮 +08:09:32 1590894572 祭 ॣ '-2'(A) +08:24:02 1590895442 ⪫祭 ० ࠧ (A) +08:24:02 1590895442 祭 ॣ . 殮 㣨 +14:20:00 1590916800 祭 ० +14:20:01 1590916801 ⪫祭 ॣ '-2'(A) +14:20:02 1590916802 祭 ॣ '-2'(A) +15:16:02 1590920162 ⪫祭 ॣ '-2'(A) +17:51:01 1590929461 ⪫祭 ० (A) +17:51:02 1590929462 ⪫祭 +17:51:02 1590929462 : +17:51:05 1590929465 ⪫祭 ० ' ⮪ 㣨' +17:51:51 1590929511 祭 ० ᪠ +17:54:13 1590929653 ⪫祭 ० ᪠ (A) +18:21:02 1590931262 : 믮 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.319 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.319 new file mode 100644 index 0000000..f428a34 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.319 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.450 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.450 new file mode 100644 index 0000000..b70123b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.450 @@ -0,0 +1,7 @@ +05:25:05 1590884705 1 11412 2 BT 3-1, 6, 8, 9, 14, 15, 16 4 3 7 770 9 4750 10 690 +06:08:19 1590887299 1 11412 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 3 5 Ti 6 7 770 8 5240 9 4750 10 690 11 12 320252 +06:50:58 1590889858 0 A--32-031-2016 ॢ 5 +09:26:14 1590899174 1 11413 +09:47:39 1590900459 12 321692 +10:18:49 1590902329 1 11413 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 3 5 Ti 6 7 770 8 5240 9 4750 10 690 11 12 321692 +11:01:29 1590904889 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.451 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.451 new file mode 100644 index 0000000..442f9cf Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.451 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.452 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.452 new file mode 100644 index 0000000..6ae8669 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.452 @@ -0,0 +1,102 @@ +20 05:23:03 05:23:11 +Riz_sol= 4855.9 + +21 05:23:19 05:23:22 +Rsk= 17.5 Rkk= 13.9 + +22 05:45:37 06:00:42 +P1= 48.8 T1=05:55:42 P2= 62.2 T2=06:00:42 Vs= 2.69 + +23 06:00:51 06:00:56 + + +24 06:01:04 06:01:40 + + +30 06:01:52 06:02:15 +Vst= 29.0 + +31 06:02:27 06:03:00 +Rom_sol= 12.6 + +32 06:03:34 06:04:09 +Imax=10.9 Umax=50.0 T= 9.0 + +33 06:04:14 06:04:32 +Imin=15.8 Umin=25.0 T= 0.5 + +34 06:04:36 06:04:59 +V=300.2 T= 9.4 + +35 06:05:03 06:05:56 +Q= 54.2 T= 9.4 + +36 06:06:01 06:06:33 +P1=0.29 T= 2.9 + +37 06:06:37 06:07:08 +T= 0.9 + +38 06:07:11 06:07:18 +t= 51.6 T= 0.5 + +39 06:07:23 06:07:38 +tcam= 52.5 Tcam= 0.5 tfl= 54.6 Tfl= 0.5 + +40 06:07:41 06:07:48 +t= 51.7 T= 0.5 + +20 09:26:42 09:26:51 +Riz_sol= 4855.5 + +21 09:27:00 09:27:03 +Rsk= 17.5 Rkk= 13.7 + +31 09:27:54 09:28:31 +Rom_sol= 13.2 + +20 09:46:33 09:46:41 +Riz_sol= 4856.3 + +22 09:54:56 10:10:00 +P1= 50.4 T1=10:05:00 P2= 65.0 T2=10:10:00 Vs= 2.92 + +23 10:10:23 10:10:28 + + +24 10:10:37 10:11:26 + + +30 10:11:44 10:12:07 +Vst= 28.9 + +31 10:12:12 10:12:50 +Rom_sol= 12.9 + +32 10:13:26 10:14:03 +Imax=10.9 Umax=50.0 T= 9.0 + +33 10:14:10 10:14:30 +Imin=15.8 Umin=25.0 T= 0.5 + +34 10:14:35 10:14:59 +V=300.0 T= 9.4 + +35 10:15:06 10:16:01 +Q= 53.2 T= 9.4 + +36 10:16:07 05:00:00 +P1=0.29 T= 2.9 + +37 10:16:45 10:17:17 +T= 0.9 + +38 10:17:21 10:17:29 +t= 51.7 T= 0.5 + +39 10:17:33 10:17:50 +tcam= 52.4 Tcam= 0.5 tfl= 55.2 Tfl= 0.5 + +40 10:17:54 10:18:02 +t= 51.7 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.453 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.453 new file mode 100644 index 0000000..ca5d9cc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.453 @@ -0,0 +1,18 @@ +12 01:13:13 1590869593 +13 04:15:32 1590880532 +0 04:15:32 1590880532 +8 05:16:01 1590884161 +25 06:01:49 1590886909 +9 06:08:19 1590887299 +10 06:50:58 1590889858 +8 06:53:38 1590890018 +13 08:20:46 1590895246 +00 08:43:07 1590896587 +8 09:23:01 1590898981 +25 10:11:41 1590901901 +9 10:18:49 1590902329 +10 11:01:29 1590904889 +11 14:34:13 1590917653 +12 17:21:14 1590927674 +13 19:06:19 1590933979 +0 19:06:19 1590933979 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.454 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.454 new file mode 100644 index 0000000..5b6adf2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.454 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.456 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.456 new file mode 100644 index 0000000..5514087 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.456 @@ -0,0 +1,92 @@ +[48] +oper = 12 +begin = 31.05.2020 01:13:13 +norma = 180 +real = 182 + +[49] +oper = 13 +begin = 31.05.2020 04:15:32 +norma = 45 +real = 60 + +[50] +oper = 8 +begin = 31.05.2020 05:16:01 +norma = 40 +vac_time = 9 +real = 45 + +[51] +oper = 25 +begin = 31.05.2020 06:01:49 +norma = 30 +real = 6 + +[52] +oper = 9 +begin = 31.05.2020 06:08:19 +norma = 0 +real = 42 + +[53] +oper = 10 +begin = 31.05.2020 06:50:58 +norma = 0 +real = 2 + +[54] +oper = 8 +begin = 31.05.2020 06:53:38 +norma = 40 +real = 87 + +[55] +oper = 13 +begin = 31.05.2020 08:20:46 +norma = 45 +real = 62 + +[56] +oper = 8 +begin = 31.05.2020 09:23:01 +norma = 40 +vac_time = 13 +real = 48 + +[57] +oper = 25 +begin = 31.05.2020 10:11:41 +norma = 30 +real = 7 + +[58] +oper = 9 +begin = 31.05.2020 10:18:49 +norma = 0 +real = 42 + +[59] +oper = 10 +begin = 31.05.2020 11:01:29 +norma = 0 +real = 212 + +[60] +oper = 11 +begin = 31.05.2020 14:34:13 +norma = 0 +real = 167 + +[61] +oper = 12 +begin = 31.05.2020 17:21:14 +norma = 105 +real = 105 + +[62] +oper = 13 +begin = 31.05.2020 19:06:19 +norma = 45 +real = 2775 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.457 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.457 new file mode 100644 index 0000000..06649a2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.457 @@ -0,0 +1,32 @@ +01:13:21 1590869601 ⪫祭 ॣ '-2'(A) +01:13:37 1590869617 祭 ० ᪠ +01:13:38 1590869618 祭 ० ᪠ +01:15:54 1590869754 ⪫祭 ० ᪠ (A) +06:01:06 1590886866 祭 ॣ '-2'(A) +06:01:41 1590886901 ⪫祭 ॣ '-2'(A) +06:08:00 1590887280 祭 ० ࠧ +06:08:03 1590887283 祭 ० ' ⮪ 㣨' +06:33:54 1590888834 祭 ॣ '-2'(A) +06:50:58 1590889858 ⪫祭 ० ࠧ (A) +06:50:59 1590889859 祭 ⠭ ॣ +06:52:22 1590889942 ⪫祭 ० ' ⮪ 㣨' +06:52:42 1590889962 ⪫祭 ॣ '-2'(A) +06:56:02 1590890162 祭 ० ᪠ +06:58:15 1590890295 ⪫祭 ० ᪠ (A) +09:34:55 1590899695 祭 ॣ '-2'(A) +09:34:55 1590899695 ⪫祭 ॣ '-2'(A) +10:10:50 1590901850 祭 ॣ '-2'(A) +10:11:27 1590901887 ⪫祭 ॣ '-2'(A) +10:18:16 1590902296 祭 ० ࠧ +10:18:19 1590902299 祭 ० ' ⮪ 㣨' +10:44:25 1590903865 祭 ॣ '-2'(A) +11:01:29 1590904889 ⪫祭 ० ࠧ (A) +11:01:29 1590904889 祭 ⠭ ॣ +14:34:12 1590917652 祭 ० +14:34:13 1590917653 ⪫祭 ॣ '-2'(A) +14:34:14 1590917654 祭 ॣ '-2'(A) +16:26:13 1590924373 ⪫祭 ॣ '-2'(A) +17:21:09 1590927669 ⪫祭 ० (A) +17:21:16 1590927676 ⪫祭 ० ' ⮪ 㣨' +17:21:34 1590927694 祭 ० ᪠ +17:23:54 1590927834 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200531.459 b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.459 new file mode 100644 index 0000000..ced3591 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200531.459 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.211 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.211 new file mode 100644 index 0000000..90aeb48 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.211 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.212 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.212 new file mode 100644 index 0000000..da4ff81 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.212 @@ -0,0 +1,3 @@ +21 22:21:10 22:21:13 +Rsk= 13.3 Rkk= 7.1 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.214 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.214 new file mode 100644 index 0000000..995e201 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.214 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.310 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.310 new file mode 100644 index 0000000..657b842 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.310 @@ -0,0 +1,2 @@ +22:45:08 1591033508 1 07395 7 770 9 4600 11 12 321547 +22:45:24 1591033524 10 690 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.311 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.311 new file mode 100644 index 0000000..111778a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.311 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.312 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.312 new file mode 100644 index 0000000..b3513b7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.312 @@ -0,0 +1,9 @@ +21 22:44:06 22:44:09 +Rsk= 29.1 Rkk= 26.6 + +20 22:54:12 22:54:22 +Riz_sol= 1283.0 + +22 23:39:52 23:55:28 +P1= 76.4 T1=23:50:28 P2=106.6 T2=23:55:28 Vs= 6.04 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.313 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.313 new file mode 100644 index 0000000..1183ccf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.313 @@ -0,0 +1 @@ +8 22:36:54 1591033014 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.314 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.314 new file mode 100644 index 0000000..892feec Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.314 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.315 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.315 new file mode 100644 index 0000000..62f9372 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.315 @@ -0,0 +1,3 @@ +17 22:37:36 1591033056 +17 22:37:48 1591033068 +17 22:38:04 1591033084 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.316 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.316 new file mode 100644 index 0000000..1b09b97 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.316 @@ -0,0 +1,7 @@ +[14] +oper = 8 +begin = 01.06.2020 22:36:54 +norma = 40 +vac_time = 18 +real = 209 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.317 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.317 new file mode 100644 index 0000000..16bb1ba --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.317 @@ -0,0 +1,4 @@ +10:22:15 1590988935 祭 ॣ '-2'(A) +10:22:16 1590988936 ⪫祭 ॣ '-2'(A) +22:37:25 1591033045 : 㦥 +22:45:34 1591033534 : diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.451 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.451 new file mode 100644 index 0000000..a5d5e6f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.451 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.454 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.454 new file mode 100644 index 0000000..5956f97 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.454 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.460 new file mode 100644 index 0000000..21b09ea --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.460 @@ -0,0 +1,5 @@ +03:17:59 1590963479 3 14 +04:06:26 1590966386 0 A--32-067-2014 ॢ 0 +22:09:14 1591031354 1 11475 2 BT 18, 20, 22, 23, 25 3 25 9 4600 10 690 +23:13:54 1591035234 1 11475 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 3000 9 4600 10 690 11 12 321731 +23:57:02 1591037822 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.461 new file mode 100644 index 0000000..1dca275 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.462 new file mode 100644 index 0000000..60e6e27 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.462 @@ -0,0 +1,57 @@ +21 03:18:10 03:18:13 +Rsk= 19.4 Rkk= 17.3 + +22 03:30:31 03:40:38 +P1= 18.7 T1=03:35:38 P2= 43.3 T2=03:40:38 Vs= 4.91 + +20 22:09:34 22:09:43 +Riz_sol= 1156.4 + +21 22:09:48 22:09:52 +Rsk= 22.0 Rkk= 19.7 + +22 22:49:57 23:05:04 +P1= 32.9 T1=23:00:04 P2= 44.4 T2=23:05:04 Vs= 2.30 + +23 23:05:12 23:05:17 + + +24 23:05:23 23:05:59 + + +30 23:06:09 23:06:35 +Vst= 27.9 + +31 23:06:42 23:07:22 +Rom_sol= 10.4 + +32 23:08:24 23:08:59 +Imax=11.1 Umax=50.1 T= 9.0 + +33 23:09:03 23:09:22 +Imin=16.1 Umin=25.0 T= 1.6 + +33 23:09:25 23:09:59 +Imin=16.1 Umin=25.0 T= 0.5 + +34 23:10:04 23:10:28 +V=300.5 T= 9.4 + +35 23:10:31 23:11:36 +Q= 54.3 T= 9.4 + +36 23:11:41 23:12:10 +P1=0.29 T= 2.9 + +37 23:12:14 23:12:39 +T= 0.9 + +38 23:12:42 23:12:49 +t= 54.0 T= 0.5 + +39 23:12:53 23:13:09 +tcam= 53.6 Tcam= 0.5 tfl= 59.3 Tfl= 0.5 + +40 23:13:13 23:13:19 +t= 57.9 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.463 new file mode 100644 index 0000000..82e54a0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.463 @@ -0,0 +1,11 @@ +12 00:57:59 1590955079 +13 02:46:41 1590961601 +0 02:46:42 1590961602 +14 03:11:54 1590963114 +15 03:42:49 1590964969 +16 04:09:16 1590966556 +1 04:48:19 1590968899 +8 22:02:05 1591030925 +25 23:06:06 1591034766 +9 23:13:54 1591035234 +10 23:57:02 1591037822 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.464 new file mode 100644 index 0000000..7a36607 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.465 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.465 new file mode 100644 index 0000000..e4778e2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.465 @@ -0,0 +1 @@ +55 23:09:22 1591034962 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.466 new file mode 100644 index 0000000..daef1c9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.466 @@ -0,0 +1,62 @@ +[90] +oper = 12 +begin = 01.06.2020 00:57:59 +norma = 105 +real = 108 + +[91] +oper = 13 +begin = 01.06.2020 02:46:41 +norma = 45 +real = 25 + +[92] +oper = 14 +begin = 01.06.2020 03:11:54 +norma = 40 +vac_time = 9 +real = 30 + +[93] +oper = 15 +begin = 01.06.2020 03:42:49 +norma = 30 +real = 26 + +[94] +oper = 16 +begin = 01.06.2020 04:09:16 +norma = 40 +real = 39 + +[95] +oper = 1 +begin = 01.06.2020 04:48:19 +norma = 85 +real = 1033 + +[96] +oper = 8 +begin = 01.06.2020 22:02:05 +norma = 40 +vac_time = 9 +real = 64 + +[97] +oper = 25 +begin = 01.06.2020 23:06:06 +norma = 30 +real = 7 + +[98] +oper = 9 +begin = 01.06.2020 23:13:54 +norma = 0 +real = 43 + +[99] +oper = 10 +begin = 01.06.2020 23:57:02 +norma = 0 +real = 225 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.467 new file mode 100644 index 0000000..964ed93 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.467 @@ -0,0 +1,21 @@ +00:57:53 1590955073 ⪫祭 ० (A) +00:57:56 1590955076 ⪫祭 ० ' ⮪ 㣨' +00:58:25 1590955105 祭 ० ᪠ +01:00:31 1590955231 ⪫祭 ० ᪠ (A) +03:42:36 1590964956 祭 ० ࠧ +03:42:37 1590964957 祭 ० ' ⮪ 㣨' +03:43:36 1590965016 祭 ॣ '-2'(A) +04:06:26 1590966386 ⪫祭 ० ࠧ (A) +04:09:08 1590966548 ⪫祭 ० ' ⮪ 㣨' +04:09:20 1590966560 ⪫祭 ॣ '-2'(A) +04:09:42 1590966582 祭 ० ᪠ +04:09:42 1590966582 祭 ० ᪠ +04:09:42 1590966582 祭 ० ᪠ +04:11:43 1590966703 ⪫祭 ० ᪠ (A) +23:05:24 1591034724 祭 ॣ '-2'(A) +23:06:00 1591034760 ⪫祭 ॣ '-2'(A) +23:13:27 1591035207 祭 ० ࠧ +23:13:29 1591035209 祭 ० ' ⮪ 㣨' +23:39:58 1591036798 祭 ॣ '-2'(A) +23:57:02 1591037822 祭 ⠭ ॣ +23:57:02 1591037822 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200601.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.469 new file mode 100644 index 0000000..8ea78ab Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200601.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.211 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.211 new file mode 100644 index 0000000..16cc779 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.211 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.310 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.310 new file mode 100644 index 0000000..db01f00 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.310 @@ -0,0 +1,5 @@ +04:07:47 1591052867 1 07395 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 3320 9 4600 10 690 11 12 321547 +04:50:28 1591055428 0 A--32-031-2016 ॢ 5 +15:24:37 1591093477 1 07396 2 BT 3-1, 6, 8, 9, 14, 15, 16 9 4220 +16:24:14 1591097054 1 07396 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3320 9 4220 10 690 11 12 321547 +17:06:54 1591099614 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.311 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.311 new file mode 100644 index 0000000..7cfa8a3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.311 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.312 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.312 new file mode 100644 index 0000000..abb0b7d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.312 @@ -0,0 +1,117 @@ +22 00:10:35 00:26:12 +P1= 65.8 T1=00:21:12 P2= 91.4 T2=00:26:12 Vs= 5.11 + +22 00:54:29 01:10:05 +P1= 55.0 T1=01:05:05 P2= 76.7 T2=01:10:05 Vs= 4.34 + +22 01:29:14 01:44:50 +P1= 49.9 T1=01:39:50 P2= 69.4 T2=01:44:50 Vs= 3.91 + +20 02:35:49 02:35:59 +Riz_sol= 1285.1 + +21 02:36:09 02:36:12 +Rsk=1733.3 Rkk= 25.9 + +21 02:36:27 02:36:30 +Rsk= 160.4 Rkk= 25.9 + +22 03:09:36 03:25:11 +P1= 51.2 T1=03:20:11 P2= 69.3 T2=03:25:11 Vs= 3.63 + +22 03:44:32 04:00:08 +P1= 42.4 T1=03:55:08 P2= 57.7 T2=04:00:08 Vs= 3.05 + +23 04:00:20 04:00:25 + + +24 04:00:31 04:01:10 + + +30 04:01:20 04:01:43 +Vst= 29.1 + +31 04:01:46 04:02:21 +Rom_sol= 8.9 + +32 04:02:58 04:03:34 +Imax=11.0 Umax=50.0 T= 9.0 + +33 04:03:36 04:03:54 +Imin=16.0 Umin=25.0 T= 0.5 + +34 04:03:57 04:04:20 +V=300.4 T= 9.5 + +35 04:04:22 04:05:40 +Q= 3.6 T= 9.6 + +36 04:05:42 04:06:20 +P1=0.29 T= 3.1 + +37 04:06:22 04:07:00 +T= 1.1 + +38 04:07:02 04:07:09 +t= 52.0 T= 0.7 + +39 04:07:12 04:07:19 +t= 52.4 T= 0.7 + +40 04:07:22 04:07:29 +t= 52.1 T= 0.7 + +20 15:23:16 15:23:26 +Riz_sol= 1268.7 + +21 15:23:37 15:23:40 +Rsk=1530.2 Rkk= 26.1 + +21 15:23:48 15:23:51 +Rsk=1710.4 Rkk= 26.1 + +21 15:23:57 15:24:00 +Rsk= 28.6 Rkk= 26.0 + +22 15:59:34 16:15:10 +P1= 39.6 T1=16:10:10 P2= 52.0 T2=16:15:10 Vs= 2.47 + +23 16:15:19 16:15:24 + + +24 16:15:38 16:16:13 + + +30 16:16:33 16:16:58 +Vst= 29.1 + +31 16:17:08 16:17:49 +Rom_sol= 9.0 + +32 16:18:36 16:19:14 +Imax=11.0 Umax=50.0 T= 9.0 + +33 16:19:17 16:19:39 +Imin=16.0 Umin=25.0 T= 0.5 + +34 16:19:42 16:20:05 +V=300.2 T= 9.6 + +35 16:20:08 16:21:26 +Q= 3.6 T= 9.6 + +36 16:21:29 16:22:04 +P1=0.29 T= 3.1 + +37 16:22:07 16:22:48 +T= 1.1 + +38 16:22:52 16:23:03 +t= 52.0 T= 0.7 + +39 16:23:07 16:23:17 +t= 52.3 T= 0.7 + +40 16:23:20 16:23:30 +t= 52.3 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.313 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.313 new file mode 100644 index 0000000..908cd04 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.313 @@ -0,0 +1,15 @@ +13 02:06:51 1591045611 +8 02:32:28 1591047148 +25 04:01:17 1591052477 +9 04:07:47 1591052867 +10 04:50:28 1591055428 +11 08:34:37 1591068877 +12 11:21:40 1591078900 +13 13:16:00 1591085760 +0 13:16:00 1591085760 +8 15:21:06 1591093266 +25 16:16:27 1591096587 +9 16:24:14 1591097054 +10 17:06:54 1591099614 +11 20:31:46 1591111906 +12 23:18:47 1591121927 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.314 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.314 new file mode 100644 index 0000000..2281650 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.314 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.316 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.316 new file mode 100644 index 0000000..a667042 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.316 @@ -0,0 +1,86 @@ +[15] +oper = 13 +begin = 02.06.2020 02:06:51 +norma = 45 +real = 25 + +[16] +oper = 8 +begin = 02.06.2020 02:32:28 +norma = 40 +vac_time = 8 +real = 88 + +[17] +oper = 25 +begin = 02.06.2020 04:01:17 +norma = 30 +real = 6 + +[18] +oper = 9 +begin = 02.06.2020 04:07:47 +norma = 0 +real = 42 + +[19] +oper = 10 +begin = 02.06.2020 04:50:28 +norma = 0 +real = 224 + +[20] +oper = 11 +begin = 02.06.2020 08:34:37 +norma = 0 +real = 167 + +[21] +oper = 12 +begin = 02.06.2020 11:21:40 +norma = 105 +real = 114 + +[22] +oper = 13 +begin = 02.06.2020 13:16:00 +norma = 45 +real = 125 + +[23] +oper = 8 +begin = 02.06.2020 15:21:06 +norma = 40 +vac_time = 8 +real = 55 + +[24] +oper = 25 +begin = 02.06.2020 16:16:27 +norma = 30 +real = 7 + +[25] +oper = 9 +begin = 02.06.2020 16:24:14 +norma = 0 +real = 42 + +[26] +oper = 10 +begin = 02.06.2020 17:06:54 +norma = 0 +real = 204 + +[27] +oper = 11 +begin = 02.06.2020 20:31:46 +norma = 0 +real = 167 + +[28] +oper = 12 +begin = 02.06.2020 23:18:47 +norma = 105 +real = 112 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.317 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.317 new file mode 100644 index 0000000..91c71b1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.317 @@ -0,0 +1,34 @@ +04:00:33 1591052433 祭 ॣ '-2'(A) +04:01:11 1591052471 ⪫祭 ॣ '-2'(A) +04:07:34 1591052854 祭 ० ࠧ +04:07:36 1591052856 祭 ० ' ⮪ 㣨' +04:33:23 1591054403 祭 ॣ '-2'(A) +04:50:28 1591055428 ⪫祭 ० ࠧ (A) +04:50:28 1591055428 祭 ⠭ ॣ +08:34:36 1591068876 祭 ० +08:34:37 1591068877 ⪫祭 ॣ '-2'(A) +08:34:38 1591068878 祭 ॣ '-2'(A) +10:26:37 1591075597 ⪫祭 ॣ '-2'(A) +11:21:33 1591078893 ⪫祭 ० (A) +11:21:41 1591078901 ⪫祭 ० ' ⮪ 㣨' +11:22:22 1591078942 祭 ० ᪠ +11:22:22 1591078942 祭 ० ᪠ +11:22:22 1591078942 祭 ० ᪠ +11:22:22 1591078942 祭 ० ᪠ +11:22:24 1591078944 祭 ० ᪠ +11:25:04 1591079104 ⪫祭 ० ᪠ (A) +16:15:39 1591096539 祭 ॣ '-2'(A) +16:16:13 1591096573 ⪫祭 ॣ '-2'(A) +16:23:48 1591097028 祭 ० ࠧ +16:23:51 1591097031 祭 ० ' ⮪ 㣨' +16:49:49 1591098589 祭 ॣ '-2'(A) +17:06:54 1591099614 ⪫祭 ० ࠧ (A) +17:06:54 1591099614 祭 ⠭ ॣ +20:31:46 1591111906 祭 ० +20:31:46 1591111906 ⪫祭 ॣ '-2'(A) +20:31:47 1591111907 祭 ॣ '-2'(A) +22:23:47 1591118627 ⪫祭 ॣ '-2'(A) +23:18:44 1591121924 ⪫祭 ० (A) +23:18:49 1591121929 ⪫祭 ० ' ⮪ 㣨' +23:20:07 1591122007 祭 ० ᪠ +23:22:46 1591122166 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.319 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.319 new file mode 100644 index 0000000..1373582 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.319 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.450 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.450 new file mode 100644 index 0000000..2e1a1b7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.450 @@ -0,0 +1,3 @@ +17:34:50 1591101290 1 11414 4 2 9 4070 +18:48:36 1591105716 1 11414 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 5240 9 4070 10 690 11 12 321692 +19:31:16 1591108276 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.451 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.451 new file mode 100644 index 0000000..e4bdf0a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.451 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.452 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.452 new file mode 100644 index 0000000..a907427 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.452 @@ -0,0 +1,54 @@ +21 17:26:09 17:26:12 +Rsk= 18.9 Rkk= 15.1 + +20 17:26:55 17:27:05 +Riz_sol= 393.7 + +22 18:04:56 18:20:01 +P1= 44.1 T1=18:15:01 P2= 59.4 T2=18:20:01 Vs= 3.07 + +22 18:25:21 18:40:25 +P1= 38.5 T1=18:35:25 P2= 51.0 T2=18:40:25 Vs= 2.50 + +23 18:40:36 18:40:41 + + +24 18:40:48 18:41:21 + + +24 18:41:36 18:42:14 + + +30 18:42:26 18:42:53 +Vst= 28.7 + +31 18:42:58 18:43:31 +Rom_sol= 9.1 + +32 18:43:53 18:44:28 +Imax=10.9 Umax=50.0 T= 9.0 + +33 18:44:32 18:44:50 +Imin=15.8 Umin=25.0 T= 0.5 + +34 18:44:54 18:45:17 +V=300.1 T= 9.5 + +35 18:45:22 18:46:17 +Q= 54.6 T= 9.4 + +36 18:46:19 18:46:49 +P1=0.29 T= 2.9 + +37 18:46:52 18:47:24 +T= 0.9 + +38 18:47:27 18:47:34 +t= 51.6 T= 0.5 + +39 18:47:37 18:47:52 +tcam= 52.5 Tcam= 0.5 tfl= 56.4 Tfl= 0.5 + +40 18:47:56 18:48:03 +t= 51.7 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.453 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.453 new file mode 100644 index 0000000..85b4383 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.453 @@ -0,0 +1,5 @@ +8 17:22:11 1591100531 +25 18:42:24 1591105344 +9 18:48:36 1591105716 +10 19:31:16 1591108276 +11 22:47:19 1591120039 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.454 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.454 new file mode 100644 index 0000000..982f7a3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.454 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.455 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.455 new file mode 100644 index 0000000..684be44 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.455 @@ -0,0 +1 @@ +29 18:41:21 1591105281 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.456 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.456 new file mode 100644 index 0000000..82624bd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.456 @@ -0,0 +1,31 @@ +[63] +oper = 8 +begin = 02.06.2020 17:22:11 +norma = 40 +vac_time = 10 +real = 80 + +[64] +oper = 25 +begin = 02.06.2020 18:42:24 +norma = 30 +real = 6 + +[65] +oper = 9 +begin = 02.06.2020 18:48:36 +norma = 0 +real = 42 + +[66] +oper = 10 +begin = 02.06.2020 19:31:16 +norma = 0 +real = 196 + +[67] +oper = 11 +begin = 02.06.2020 22:47:19 +norma = 0 +real = 167 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.457 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.457 new file mode 100644 index 0000000..3daa770 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.457 @@ -0,0 +1,12 @@ +18:40:49 1591105249 祭 ॣ '-2'(A) +18:41:21 1591105281 ⪫祭 ॣ '-2'(A) +18:41:37 1591105297 祭 ॣ '-2'(A) +18:42:15 1591105335 ⪫祭 ॣ '-2'(A) +18:48:12 1591105692 祭 ० ࠧ +18:48:14 1591105694 祭 ० ' ⮪ 㣨' +19:14:11 1591107251 祭 ॣ '-2'(A) +19:31:16 1591108276 祭 ⠭ ॣ +19:31:16 1591108276 ⪫祭 ० ࠧ (A) +22:47:18 1591120038 祭 ० +22:47:19 1591120039 ⪫祭 ॣ '-2'(A) +22:47:20 1591120040 祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.459 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.459 new file mode 100644 index 0000000..05c69be Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.459 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.460 new file mode 100644 index 0000000..4f87baf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.460 @@ -0,0 +1,4 @@ +09:46:54 1591073214 1 11476 2 BT 3-1, 6, 8, 9, 14, 15, 16 9 4460 +10:29:48 1591075788 1 11476 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3000 9 4460 10 690 11 12 321731 +11:12:31 1591078351 0 A--32-031-2016 ॢ 5 +21:15:47 1591114547 1 11477 4 3 9 3820 10 705 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.461 new file mode 100644 index 0000000..4b6d10e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.462 new file mode 100644 index 0000000..6c7fb6e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.462 @@ -0,0 +1,60 @@ +20 09:47:32 09:47:41 +Riz_sol= 1147.4 + +21 09:47:49 09:47:52 +Rsk= 21.1 Rkk= 19.1 + +22 10:05:57 10:21:04 +P1= 46.1 T1=10:16:04 P2= 60.7 T2=10:21:04 Vs= 2.92 + +23 10:21:17 10:21:22 + + +24 10:21:29 10:22:08 + + +30 10:22:25 10:22:49 +Vst= 27.8 + +31 10:23:05 10:23:46 +Rom_sol= 11.0 + +32 10:24:32 10:25:08 +Imax=11.1 Umax=50.1 T= 9.0 + +33 10:25:13 10:25:33 +Imin=16.1 Umin=24.9 T= 0.5 + +34 10:25:38 10:26:00 +V=300.6 T= 9.4 + +35 10:26:04 10:27:00 +Q= 52.9 T= 9.4 + +36 10:27:08 10:27:37 +P1=0.29 T= 2.9 + +37 10:27:42 10:28:10 +T= 0.9 + +38 10:28:15 10:28:23 +t= 54.0 T= 0.5 + +39 10:28:27 10:28:44 +tcam= 53.6 Tcam= 0.5 tfl= 59.6 Tfl= 0.5 + +40 10:28:48 10:28:55 +t= 54.1 T= 0.5 + +21 21:14:45 21:14:48 +Rsk= 20.6 Rkk= 18.8 + +22 21:40:30 21:55:37 +P1= 40.1 T1=21:50:37 P2= 51.6 T2=21:55:37 Vs= 2.30 + +21 23:19:07 23:19:10 +Rsk= 20.4 Rkk= 17.9 + +20 23:19:16 23:19:25 +Riz_sol= 3703.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.463 new file mode 100644 index 0000000..2faf08d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.463 @@ -0,0 +1,17 @@ +11 03:42:55 1591051375 +12 06:29:53 1591061393 +13 08:20:12 1591068012 +0 08:20:12 1591068012 +8 09:41:21 1591072881 +25 10:22:21 1591075341 +9 10:29:48 1591075788 +10 11:12:31 1591078351 +11 14:44:46 1591091086 +12 17:31:44 1591101104 +13 19:21:31 1591107691 +0 19:21:31 1591107691 +2 21:12:57 1591114377 +5 21:56:56 1591117016 +6 22:08:34 1591117714 +7 22:47:37 1591120057 +8 23:18:24 1591121904 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.464 new file mode 100644 index 0000000..8cdd6a7 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.465 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.465 new file mode 100644 index 0000000..7d9e707 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.465 @@ -0,0 +1,2 @@ +46 10:23:56 1591075436 +46 10:23:57 1591075437 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.466 new file mode 100644 index 0000000..2ca3117 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.466 @@ -0,0 +1,94 @@ +[00] +oper = 11 +begin = 02.06.2020 03:42:55 +norma = 0 +real = 166 + +[01] +oper = 12 +begin = 02.06.2020 06:29:53 +norma = 105 +real = 110 + +[02] +oper = 13 +begin = 02.06.2020 08:20:12 +norma = 45 +real = 81 + +[03] +oper = 8 +begin = 02.06.2020 09:41:21 +norma = 40 +vac_time = 9 +real = 41 + +[04] +oper = 25 +begin = 02.06.2020 10:22:21 +norma = 30 +real = 7 + +[05] +oper = 9 +begin = 02.06.2020 10:29:48 +norma = 0 +real = 42 + +[06] +oper = 10 +begin = 02.06.2020 11:12:31 +norma = 0 +real = 212 + +[07] +oper = 11 +begin = 02.06.2020 14:44:46 +norma = 0 +real = 166 + +[08] +oper = 12 +begin = 02.06.2020 17:31:44 +norma = 105 +real = 109 + +[09] +oper = 13 +begin = 02.06.2020 19:21:31 +norma = 45 +real = 111 + +[10] +oper = 2 +begin = 02.06.2020 21:12:57 +norma = 110 +vac_time = 9 +real = 43 + +[11] +oper = 5 +begin = 02.06.2020 21:56:56 +norma = 25 +real = 11 + +[12] +oper = 6 +begin = 02.06.2020 22:08:34 +norma = 35 +real = 39 + +[13] +oper = 7 +begin = 02.06.2020 22:47:37 +norma = 30 +real = 30 + +[14] +oper = 8 +begin = 02.06.2020 23:18:24 +norma = 40 +vac_time = 9 +vac_avg10 = 10.2 +real = 45 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.467 new file mode 100644 index 0000000..9147252 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.467 @@ -0,0 +1,26 @@ +03:42:54 1591051374 祭 ० +03:42:55 1591051375 ⪫祭 ॣ '-2'(A) +03:42:56 1591051376 祭 ॣ '-2'(A) +05:34:52 1591058092 ⪫祭 ॣ '-2'(A) +06:29:50 1591061390 ⪫祭 ० (A) +06:29:55 1591061395 ⪫祭 ० ' ⮪ 㣨' +06:30:15 1591061415 祭 ० ᪠ +06:30:15 1591061415 祭 ० ᪠ +06:32:21 1591061541 ⪫祭 ० ᪠ (A) +10:21:31 1591075291 祭 ॣ '-2'(A) +10:22:08 1591075328 ⪫祭 ॣ '-2'(A) +10:29:03 1591075743 祭 ० ࠧ +10:29:05 1591075745 祭 ० ' ⮪ 㣨' +10:55:28 1591077328 祭 ॣ '-2'(A) +11:12:31 1591078351 ⪫祭 ० ࠧ (A) +11:12:32 1591078352 祭 ⠭ ॣ +14:44:45 1591091085 祭 ० +14:44:46 1591091086 ⪫祭 ॣ '-2'(A) +14:44:47 1591091087 祭 ॣ '-2'(A) +16:36:44 1591097804 ⪫祭 ॣ '-2'(A) +17:31:41 1591101101 ⪫祭 ० (A) +17:31:45 1591101105 ⪫祭 ० ' ⮪ 㣨' +17:32:38 1591101158 祭 ० ᪠ +17:34:44 1591101284 ⪫祭 ० ᪠ (A) +22:09:14 1591117754 祭 ० ᪠ +22:11:52 1591117912 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200602.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.469 new file mode 100644 index 0000000..3db76ae Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200602.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.230 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.230 new file mode 100644 index 0000000..8ff33bf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.230 @@ -0,0 +1,3 @@ +20:17:55 1591197475 1 06851 3 25 9 4870 +21:08:16 1591200496 1 06851 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3500 9 4870 10 690 11 12 321173 +21:50:55 1591203055 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.231 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.231 new file mode 100644 index 0000000..fd69e1d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.231 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.232 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.232 new file mode 100644 index 0000000..7931098 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.232 @@ -0,0 +1,48 @@ +20 20:17:03 20:17:11 +Riz_sol= 2846.8 + +21 20:17:17 20:17:20 +Rsk= 22.7 Rkk= 20.4 + +22 20:44:45 21:00:16 +P1= 33.5 T1=20:55:16 P2= 43.1 T2=21:00:16 Vs= 1.91 + +23 21:00:20 21:00:26 + + +24 21:00:31 21:01:09 + + +30 21:01:18 21:01:44 +Vst= 28.3 + +31 21:01:46 21:02:20 +Rom_sol= 11.3 + +32 21:02:45 21:03:20 +Imax=10.9 Umax=50.0 T= 9.0 + +33 05:00:00 21:03:46 +Imin=15.9 Umin=25.0 T= 0.5 + +34 21:03:50 21:04:13 +V=300.2 T= 9.4 + +35 21:04:15 21:05:44 +Q= 53.1 T= 9.4 + +36 21:05:46 21:06:19 +P1=0.29 T= 2.9 + +37 21:06:21 21:06:52 +T= 0.9 + +38 21:06:54 21:07:01 +t= 51.9 T= 0.5 + +39 21:07:03 21:07:10 +t= 51.9 T= 0.5 + +40 21:07:12 21:07:19 +t= 52.1 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.233 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.233 new file mode 100644 index 0000000..d6b761b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.233 @@ -0,0 +1,8 @@ +11 14:43:42 1591177422 +12 17:14:58 1591186498 +13 19:00:51 1591192851 +0 19:00:51 1591192851 +8 20:11:35 1591197095 +25 21:01:15 1591200075 +9 21:08:16 1591200496 +10 21:50:55 1591203055 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.234 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.234 new file mode 100644 index 0000000..912f282 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.234 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.236 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.236 new file mode 100644 index 0000000..241fdb6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.236 @@ -0,0 +1,43 @@ +[96] +oper = 11 +begin = 03.06.2020 14:43:42 +norma = 0 +real = 151 + +[97] +oper = 12 +begin = 03.06.2020 17:14:58 +norma = 105 +real = 105 + +[98] +oper = 13 +begin = 03.06.2020 19:00:51 +norma = 45 +real = 70 + +[99] +oper = 8 +begin = 03.06.2020 20:11:35 +norma = 40 +vac_time = 7 +real = 49 + +[00] +oper = 25 +begin = 03.06.2020 21:01:15 +norma = 30 +real = 7 + +[01] +oper = 9 +begin = 03.06.2020 21:08:16 +norma = 0 +real = 42 + +[02] +oper = 10 +begin = 03.06.2020 21:50:55 +norma = 0 +real = 234 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.237 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.237 new file mode 100644 index 0000000..6c81bca --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.237 @@ -0,0 +1,13 @@ +14:43:42 1591177422 祭 ० +14:43:42 1591177422 ⪫祭 ॣ '-2'(A) +17:14:51 1591186491 ⪫祭 ० (A) +17:15:00 1591186500 ⪫祭 ० ' ⮪ 㣨' +17:15:22 1591186522 祭 ० ᪠ +17:18:19 1591186699 ⪫祭 ० ᪠ (A) +21:00:32 1591200032 祭 ॣ '-2'(A) +21:01:09 1591200069 ⪫祭 ॣ '-2'(A) +21:07:40 1591200460 祭 ० ࠧ +21:07:42 1591200462 祭 ० ' ⮪ 㣨' +21:33:51 1591202031 祭 ॣ '-2'(A) +21:50:55 1591203055 ⪫祭 ० ࠧ (A) +21:50:55 1591203055 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.239 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.239 new file mode 100644 index 0000000..6cc0c0c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.239 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.310 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.310 new file mode 100644 index 0000000..ab26247 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.310 @@ -0,0 +1 @@ +21:24:59 1591201499 1 07397 4 1 8 5400 9 5250 10 650 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.311 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.311 new file mode 100644 index 0000000..27cb75d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.311 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.312 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.312 new file mode 100644 index 0000000..95461fe --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.312 @@ -0,0 +1,9 @@ +21 21:25:12 21:25:16 +Rsk= 27.5 Rkk= 24.9 + +22 22:00:12 22:15:48 +P1= 52.1 T1=22:10:48 P2= 68.3 T2=22:15:48 Vs= 3.24 + +22 22:44:18 22:54:54 +P1= 19.7 T1=22:49:54 P2= 30.2 T2=22:54:54 Vs= 2.10 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.313 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.313 new file mode 100644 index 0000000..37d20fa --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.313 @@ -0,0 +1,5 @@ +13 01:11:22 1591128682 +0 01:11:22 1591128682 +2 21:21:57 1591201317 +5 22:56:36 1591206996 +6 23:10:43 1591207843 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.314 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.314 new file mode 100644 index 0000000..1684495 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.314 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.316 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.316 new file mode 100644 index 0000000..649adbc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.316 @@ -0,0 +1,25 @@ +[29] +oper = 13 +begin = 03.06.2020 01:11:22 +norma = 45 +real = 1210 + +[30] +oper = 2 +begin = 03.06.2020 21:21:57 +norma = 110 +vac_time = 10 +real = 94 + +[31] +oper = 5 +begin = 03.06.2020 22:56:36 +norma = 25 +real = 14 + +[32] +oper = 6 +begin = 03.06.2020 23:10:43 +norma = 35 +real = 67 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.317 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.317 new file mode 100644 index 0000000..73a6858 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.317 @@ -0,0 +1,5 @@ +23:11:35 1591207895 祭 ० ᪠ +23:11:51 1591207911 祭 ० ᪠ +23:11:51 1591207911 祭 ० ᪠ +23:11:52 1591207912 祭 ० ᪠ +23:14:37 1591208077 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.350 new file mode 100644 index 0000000..0b9bd62 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.350 @@ -0,0 +1,9 @@ +00:45:31 1591127131 1 02524 3 25 9 3900 12 321692 +00:45:51 1591127151 1 09524 +04:28:56 1591140536 1 09524 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 3 5 Ti 6 7 770 8 4910 9 3900 10 705 11 12 321692 +04:57:47 1591142267 0 A--32-029-2014 ॢ 2 +13:18:42 1591172322 3 14 +14:37:06 1591177026 0 A--32-067-2014 ॢ 0 +18:32:21 1591191141 1 09525 3 25 9 4800 10 690 +19:18:55 1591193935 1 09525 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 3 5 Ti 6 7 770 8 4910 9 4800 10 690 11 12 321692 +20:01:36 1591196496 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.351 new file mode 100644 index 0000000..ed53350 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.352 new file mode 100644 index 0000000..dbf53e5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.352 @@ -0,0 +1,129 @@ +21 00:46:15 00:46:18 +Rsk= 17.4 Rkk= 14.6 + +22 01:16:15 01:31:45 +P1= 31.5 T1=01:26:45 P2= 42.4 T2=01:31:45 Vs= 2.18 + +20 03:22:13 03:22:22 +Riz_sol= 6219.6 + +21 03:22:37 03:22:40 +Rsk= 17.2 Rkk= 14.7 + +22 03:40:16 03:55:47 +P1= 56.5 T1=03:50:47 P2= 74.9 T2=03:55:47 Vs= 3.67 + +22 04:04:28 04:19:58 +P1= 35.9 T1=04:14:58 P2= 47.6 T2=04:19:58 Vs= 2.33 + +23 04:20:16 04:20:21 + + +24 04:20:30 04:21:08 + + +30 04:21:26 04:21:51 +Vst= 28.5 + +31 04:21:57 04:22:32 +Rom_sol= 13.2 + +41 04:23:02 04:23:07 +Ukz= 1.07 + +32 04:23:12 04:23:18 +Imax= 0.0 Umax= 0.0 T= 0.0 + +32 04:23:29 04:24:04 +Imax=11.3 Umax=50.0 T= 9.0 + +33 04:24:08 04:24:33 +Imin=16.2 Umin=25.0 T= 0.5 + +34 04:24:41 04:25:04 +V=300.3 T= 9.5 + +35 04:25:08 04:26:10 +Q= 53.4 T= 9.5 + +36 04:26:15 04:26:53 +P1=0.29 T= 3.0 + +37 04:26:57 04:27:22 +T= 1.0 + +38 04:27:27 04:27:34 +t= 53.8 T= 0.8 + +39 04:27:38 04:27:54 +tcam= 55.3 Tcam= 0.8 tfl= 54.3 Tfl= 0.8 + +40 04:27:59 04:28:06 +t= 57.0 T= 0.8 + +21 13:18:25 13:18:28 +Rsk= 17.1 Rkk= 14.4 + +22 13:56:32 14:07:02 +P1= 13.0 T1=14:02:02 P2= 28.5 T2=14:07:02 Vs= 3.10 + +20 18:13:00 18:13:09 +Riz_sol= 6171.8 + +21 18:13:29 18:13:32 +Rsk=1543.7 Rkk= 14.6 + +21 18:13:41 18:13:44 +Rsk=1658.7 Rkk= 14.6 + +21 18:16:58 18:17:01 +Rsk=2213.2 Rkk= 14.7 + +21 18:17:05 18:17:08 +Rsk=1708.3 Rkk= 14.7 + +21 18:23:30 18:23:33 +Rsk= 17.6 Rkk= 14.8 + +22 18:55:18 19:10:49 +P1= 33.2 T1=19:05:49 P2= 45.0 T2=19:10:49 Vs= 2.35 + +23 19:11:03 19:11:08 + + +24 19:11:17 19:11:56 + + +30 19:12:07 19:12:30 +Vst= 28.4 + +31 19:12:36 19:13:11 +Rom_sol= 13.3 + +32 19:13:41 19:14:17 +Imax=11.3 Umax=50.0 T= 9.0 + +33 19:14:21 19:14:45 +Imin=16.3 Umin=25.0 T= 0.5 + +34 19:14:48 19:15:14 +V=300.3 T= 9.5 + +35 19:15:17 19:16:24 +Q= 54.9 T= 9.6 + +36 19:16:27 19:17:08 +P1=0.29 T= 3.0 + +37 19:17:12 19:17:40 +T= 1.0 + +38 19:17:43 19:17:48 +t= 53.9 T= 0.8 + +39 19:17:52 19:18:09 +tcam= 55.4 Tcam= 0.8 tfl= 54.5 Tfl= 0.8 + +40 19:18:12 19:18:18 +t= 52.8 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.353 new file mode 100644 index 0000000..5d3508e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.353 @@ -0,0 +1,22 @@ +1 00:04:18 1591124658 +2 00:41:52 1591126912 +5 01:33:57 1591130037 +6 01:47:23 1591130843 +7 02:27:27 1591133247 +8 03:19:38 1591136378 +25 04:21:21 1591140081 +9 04:28:56 1591140536 +10 04:57:47 1591142267 +11 08:07:39 1591153659 +12 10:57:49 1591163869 +13 12:50:37 1591170637 +0 12:50:37 1591170637 +14 13:17:22 1591172242 +15 14:08:37 1591175317 +16 14:40:05 1591177205 +1 15:26:51 1591180011 +8 18:09:17 1591189757 +25 19:12:05 1591193525 +9 19:18:55 1591193935 +10 20:01:37 1591196497 +11 23:53:43 1591210423 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.354 new file mode 100644 index 0000000..b55da39 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.355 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.355 new file mode 100644 index 0000000..9c916e6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.355 @@ -0,0 +1 @@ +52 04:23:18 1591140198 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.356 new file mode 100644 index 0000000..130a664 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.356 @@ -0,0 +1,131 @@ +[86] +oper = 1 +begin = 03.06.2020 00:04:18 +norma = 85 +real = 37 + +[87] +oper = 2 +begin = 03.06.2020 00:41:52 +norma = 110 +vac_time = 9 +vac_avg10 = 8.6 +real = 52 + +[88] +oper = 5 +begin = 03.06.2020 01:33:57 +norma = 25 +real = 13 + +[89] +oper = 6 +begin = 03.06.2020 01:47:23 +norma = 35 +real = 40 + +[90] +oper = 7 +begin = 03.06.2020 02:27:27 +norma = 30 +real = 52 + +[91] +oper = 8 +begin = 03.06.2020 03:19:38 +norma = 40 +vac_time = 8 +real = 61 + +[92] +oper = 25 +begin = 03.06.2020 04:21:21 +norma = 30 +real = 7 + +[93] +oper = 9 +begin = 03.06.2020 04:28:56 +norma = 0 +real = 28 + +[94] +oper = 10 +begin = 03.06.2020 04:57:47 +norma = 0 +real = 189 + +[95] +oper = 11 +begin = 03.06.2020 08:07:39 +norma = 0 +real = 170 + +[96] +oper = 12 +begin = 03.06.2020 10:57:49 +norma = 105 +real = 112 + +[97] +oper = 13 +begin = 03.06.2020 12:50:37 +norma = 45 +real = 26 + +[98] +oper = 14 +begin = 03.06.2020 13:17:22 +norma = 40 +vac_time = 8 +real = 51 + +[99] +oper = 15 +begin = 03.06.2020 14:08:37 +norma = 30 +real = 31 + +[00] +oper = 16 +begin = 03.06.2020 14:40:05 +norma = 40 +real = 46 + +[01] +oper = 1 +begin = 03.06.2020 15:26:51 +norma = 85 +real = 162 + +[02] +oper = 8 +begin = 03.06.2020 18:09:17 +norma = 40 +vac_time = 9 +real = 62 + +[03] +oper = 25 +begin = 03.06.2020 19:12:05 +norma = 30 +real = 6 + +[04] +oper = 9 +begin = 03.06.2020 19:18:55 +norma = 0 +real = 42 + +[05] +oper = 10 +begin = 03.06.2020 20:01:37 +norma = 0 +real = 232 + +[06] +oper = 11 +begin = 03.06.2020 23:53:43 +norma = 0 +real = 166 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.357 new file mode 100644 index 0000000..3c5bfff --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.357 @@ -0,0 +1,53 @@ +01:47:53 1591130873 祭 ० ᪠ +01:50:47 1591131047 ⪫祭 ० ᪠ (A) +04:20:33 1591140033 祭 ॣ '-2'(A) +04:21:09 1591140069 ⪫祭 ॣ '-2'(A) +04:28:23 1591140503 祭 ० ࠧ +04:28:25 1591140505 祭 ० ' ⮪ 㣨' +04:48:48 1591141728 祭 ॣ '-2'(A) +04:57:47 1591142267 祭 ⠭ ॣ +04:57:47 1591142267 ⪫祭 ० ࠧ (A) +08:07:39 1591153659 祭 ० +08:07:39 1591153659 ⪫祭 ॣ '-2'(A) +08:07:41 1591153661 祭 ॣ '-2'(A) +09:12:41 1591157561 ⪫祭 ॣ '-2'(A) +10:57:40 1591163860 ⪫祭 ० (A) +10:57:42 1591163862 ⪫祭 ० ' ⮪ 㣨' +10:58:03 1591163883 祭 ० ᪠ +10:58:03 1591163883 祭 ० ᪠ +10:58:04 1591163884 祭 ० ᪠ +10:58:51 1591163931 ⪫祭 ० ᪠ +10:58:53 1591163933 祭 ० ᪠ +10:59:00 1591163940 ⪫祭 ० ᪠ +10:59:01 1591163941 祭 ० ᪠ +10:59:06 1591163946 ⪫祭 ० ᪠ +10:59:08 1591163948 祭 ० ᪠ +10:59:08 1591163948 祭 ० ᪠ +10:59:16 1591163956 ⪫祭 ० ᪠ +10:59:17 1591163957 祭 ० ᪠ +10:59:18 1591163958 祭 ० ᪠ +10:59:25 1591163965 ⪫祭 ० ᪠ +10:59:27 1591163967 祭 ० ᪠ +10:59:31 1591163971 ⪫祭 ० ᪠ +10:59:33 1591163973 祭 ० ᪠ +10:59:43 1591163983 ⪫祭 ० ᪠ +10:59:45 1591163985 祭 ० ᪠ +10:59:50 1591163990 ⪫祭 ० ᪠ (A) +14:08:06 1591175286 祭 ० ࠧ +14:08:08 1591175288 祭 ० ' ⮪ 㣨' +14:09:25 1591175365 祭 ॣ '-2'(A) +14:37:06 1591177026 ⪫祭 ० ࠧ (A) +14:40:06 1591177206 ⪫祭 ० ' ⮪ 㣨' +14:40:08 1591177208 ⪫祭 ॣ '-2'(A) +14:40:18 1591177218 祭 ० ᪠ +14:43:13 1591177393 ⪫祭 ० ᪠ (A) +19:11:19 1591193479 祭 ॣ '-2'(A) +19:11:56 1591193516 ⪫祭 ॣ '-2'(A) +19:18:28 1591193908 祭 ० ࠧ +19:18:30 1591193910 祭 ० ' ⮪ 㣨' +19:44:33 1591195473 祭 ॣ '-2'(A) +20:01:36 1591196496 ⪫祭 ० ࠧ (A) +20:01:37 1591196497 祭 ⠭ ॣ +23:53:42 1591210422 祭 ० +23:53:42 1591210422 ⪫祭 ॣ '-2'(A) +23:53:43 1591210423 祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.359 new file mode 100644 index 0000000..688b37c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.410 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.410 new file mode 100644 index 0000000..7a00e72 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.410 @@ -0,0 +1,3 @@ +19:15:48 1591193748 1 11407 3 25 7 770 9 5150 10 690 +20:53:32 1591199612 1 11407 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3000 9 5150 10 690 11 12 320839 +23:22:08 1591208528 1 11408 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.411 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.411 new file mode 100644 index 0000000..39cb1f8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.411 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.412 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.412 new file mode 100644 index 0000000..9f506b4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.412 @@ -0,0 +1,57 @@ +21 19:14:35 19:14:38 +Rsk= 8.2 Rkk= 5.1 + +20 19:14:45 19:14:53 +Riz_sol= 4760.1 + +22 20:04:58 20:20:05 +P1= 69.2 T1=20:15:05 P2= 85.5 T2=20:20:05 Vs= 3.25 + +22 20:30:00 20:45:07 +P1= 59.4 T1=20:40:07 P2= 72.2 T2=20:45:07 Vs= 2.56 + +23 20:45:14 20:45:19 + + +24 20:45:25 20:46:00 + + +30 20:46:21 20:46:45 +Vst= 32.0 + +31 20:46:49 20:47:22 +Rom_sol= 11.7 + +32 20:47:54 20:48:28 +Imax=11.0 Umax=50.0 T= 9.0 + +33 20:48:33 20:48:51 +Imin=16.0 Umin=25.0 T= 0.5 + +34 20:48:55 20:49:18 +V=300.2 T= 9.5 + +35 20:49:21 20:50:56 +Q= 54.8 T= 9.4 + +36 20:51:00 20:51:34 +P1=0.29 T= 3.0 + +37 20:52:01 20:52:24 +T= 1.0 + +38 20:52:28 20:52:35 +t= 51.9 T= 0.5 + +39 20:52:38 20:52:53 +tcam= 54.1 Tcam= 0.5 tfl= 54.6 Tfl= 0.5 + +40 20:52:57 20:53:04 +t= 51.8 T= 0.5 + +21 23:21:14 23:21:17 +Rsk= 8.3 Rkk= 5.3 + +20 23:21:26 23:21:35 +Riz_sol= 4759.4 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.413 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.413 new file mode 100644 index 0000000..3ed2007 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.413 @@ -0,0 +1,7 @@ +8 19:09:25 1591193365 +25 20:46:19 1591199179 +9 20:53:32 1591199612 +8 21:22:04 1591201324 +13 22:23:53 1591205033 +00 22:25:14 1591205114 +8 23:16:15 1591208175 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.414 new file mode 100644 index 0000000..15e396b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.416 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.416 new file mode 100644 index 0000000..d94dd59 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.416 @@ -0,0 +1,38 @@ +[50] +oper = 8 +begin = 03.06.2020 19:09:25 +norma = 40 +vac_time = 12 +real = 96 + +[51] +oper = 25 +begin = 03.06.2020 20:46:19 +norma = 30 +real = 7 + +[52] +oper = 9 +begin = 03.06.2020 20:53:32 +norma = 0 +real = 28 + +[53] +oper = 8 +begin = 03.06.2020 21:22:04 +norma = 40 +real = 61 + +[54] +oper = 13 +begin = 03.06.2020 22:23:53 +norma = 45 +real = 52 + +[55] +oper = 8 +begin = 03.06.2020 23:16:15 +norma = 40 +vac_time = 11 +real = 51 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.417 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.417 new file mode 100644 index 0000000..e429fd0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.417 @@ -0,0 +1,13 @@ +20:45:27 1591199127 祭 ॣ '-2'(A) +20:46:02 1591199162 ⪫祭 ॣ '-2'(A) +20:53:13 1591199593 祭 ० ࠧ +20:53:14 1591199594 祭 ० ' ⮪ 㣨' +21:19:02 1591201142 祭 ॣ '-2'(A) +21:19:11 1591201151 ⪫祭 ० ' ⮪ 㣨' +21:21:06 1591201266 ⪫祭 ॣ '-2'(A) +21:21:59 1591201319 祭 ० ᪠ +21:21:59 1591201319 祭 ० ᪠ +21:23:52 1591201432 ⪫祭 ० ᪠ +21:23:58 1591201438 祭 ० ᪠ +21:23:58 1591201438 祭 ० ᪠ +21:24:03 1591201443 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.419 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.419 new file mode 100644 index 0000000..0a941e5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.419 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.450 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.450 new file mode 100644 index 0000000..210b0c1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.450 @@ -0,0 +1,6 @@ +06:41:46 1591148506 1 11415 9 3750 12 320252 +09:20:30 1591158030 1 11415 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 5240 9 3750 10 690 11 12 320252 +10:03:09 1591160589 0 A--32-031-2016 ॢ 5 +17:55:03 1591188903 3 14 +19:02:58 1591192978 0 A--32-067-2014 ॢ 0 +22:07:03 1591204023 1 11416 2 BT 18, 20, 22, 23, 25 3 25 4 1 7 670 8 5280 9 5140 10 560 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.451 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.451 new file mode 100644 index 0000000..6973bc6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.451 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.452 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.452 new file mode 100644 index 0000000..d807f61 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.452 @@ -0,0 +1,66 @@ +21 06:39:53 06:39:56 +Rsk= 18.7 Rkk= 15.0 + +22 07:10:22 07:25:26 +P1= 38.9 T1=07:20:26 P2= 51.7 T2=07:25:26 Vs= 2.56 + +20 08:30:10 08:30:20 +Riz_sol= 41.4 + +21 08:30:25 08:30:28 +Rsk= 18.5 Rkk= 14.9 + +22 08:57:57 09:13:02 +P1= 33.9 T1=09:08:02 P2= 44.1 T2=09:13:02 Vs= 2.05 + +23 09:13:14 09:13:19 + + +24 09:13:27 09:14:06 + + +30 09:14:16 09:14:42 +Vst= 29.0 + +31 09:14:44 09:15:18 +Rom_sol= 9.4 + +32 09:15:48 09:16:24 +Imax=10.9 Umax=50.0 T= 9.0 + +33 09:16:27 09:16:45 +Imin=15.8 Umin=25.0 T= 0.5 + +34 05:00:00 09:17:11 +V=300.1 T= 9.5 + +35 09:17:13 09:18:08 +Q= 53.6 T= 9.4 + +36 09:18:11 09:18:42 +P1=0.29 T= 2.9 + +37 09:18:45 09:19:17 +T= 0.9 + +38 09:19:19 09:19:27 +t= 51.5 T= 0.5 + +39 09:19:29 09:19:45 +tcam= 52.3 Tcam= 0.5 tfl= 55.1 Tfl= 0.5 + +40 09:19:47 09:19:55 +t= 51.7 T= 0.5 + +21 17:54:50 17:54:53 +Rsk= 18.5 Rkk= 14.7 + +21 22:05:11 22:05:14 +Rsk= 18.4 Rkk= 14.7 + +22 22:40:03 22:55:08 +P1= 72.5 T1=22:50:08 P2= 98.7 T2=22:55:08 Vs= 5.24 + +22 23:10:01 23:25:06 +P1= 54.2 T1=23:20:06 P2= 74.9 T2=23:25:06 Vs= 4.14 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.453 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.453 new file mode 100644 index 0000000..f828e79 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.453 @@ -0,0 +1,20 @@ +12 01:34:21 1591130061 +13 03:21:45 1591136505 +0 03:21:45 1591136505 +2 06:34:18 1591148058 +5 07:26:33 1591151193 +6 07:39:31 1591151971 +7 08:12:29 1591153949 +8 08:26:25 1591154785 +25 09:14:14 1591157654 +9 09:20:30 1591158030 +10 10:03:09 1591160589 +11 12:41:32 1591170092 +12 15:28:31 1591180111 +13 17:19:08 1591186748 +0 17:19:08 1591186748 +14 17:52:07 1591188727 +15 18:35:53 1591191353 +16 19:06:39 1591193199 +1 19:51:53 1591195913 +2 22:01:10 1591203670 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.454 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.454 new file mode 100644 index 0000000..b717121 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.454 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.455 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.455 new file mode 100644 index 0000000..051107d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.455 @@ -0,0 +1 @@ +3 22:05:07 1591203907 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.456 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.456 new file mode 100644 index 0000000..4282d03 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.456 @@ -0,0 +1,113 @@ +[68] +oper = 12 +begin = 03.06.2020 01:34:21 +norma = 105 +real = 107 + +[69] +oper = 13 +begin = 03.06.2020 03:21:45 +norma = 45 +real = 192 + +[70] +oper = 2 +begin = 03.06.2020 06:34:18 +norma = 110 +vac_time = 9 +real = 52 + +[71] +oper = 5 +begin = 03.06.2020 07:26:33 +norma = 25 +real = 12 + +[72] +oper = 6 +begin = 03.06.2020 07:39:31 +norma = 35 +real = 32 + +[73] +oper = 7 +begin = 03.06.2020 08:12:29 +norma = 30 +real = 13 + +[74] +oper = 8 +begin = 03.06.2020 08:26:25 +norma = 40 +vac_time = 8 +vac_avg10 = 9.1 +real = 47 + +[75] +oper = 25 +begin = 03.06.2020 09:14:14 +norma = 30 +real = 6 + +[76] +oper = 9 +begin = 03.06.2020 09:20:30 +norma = 0 +real = 42 + +[77] +oper = 10 +begin = 03.06.2020 10:03:09 +norma = 0 +real = 158 + +[78] +oper = 11 +begin = 03.06.2020 12:41:32 +norma = 0 +real = 166 + +[79] +oper = 12 +begin = 03.06.2020 15:28:31 +norma = 105 +real = 110 + +[80] +oper = 13 +begin = 03.06.2020 17:19:08 +norma = 45 +real = 32 + +[81] +oper = 14 +begin = 03.06.2020 17:52:07 +norma = 40 +vac_time = 8 +real = 43 + +[82] +oper = 15 +begin = 03.06.2020 18:35:53 +norma = 30 +real = 30 + +[83] +oper = 16 +begin = 03.06.2020 19:06:39 +norma = 40 +real = 45 + +[84] +oper = 1 +begin = 03.06.2020 19:51:53 +norma = 85 +real = 129 + +[85] +oper = 2 +begin = 03.06.2020 22:01:10 +norma = 110 +vac_time = 9 +real = 195 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.457 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.457 new file mode 100644 index 0000000..0e675cb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.457 @@ -0,0 +1,33 @@ +00:39:19 1591126759 ⪫祭 ॣ '-2'(A) +01:34:15 1591130055 ⪫祭 ० (A) +01:34:22 1591130062 ⪫祭 ० ' ⮪ 㣨' +01:35:01 1591130101 祭 ० ᪠ +01:35:02 1591130102 祭 ० ᪠ +01:35:03 1591130103 祭 ० ᪠ +01:37:24 1591130244 ⪫祭 ० ᪠ (A) +07:39:45 1591151985 祭 ० ᪠ +07:39:45 1591151985 祭 ० ᪠ +07:42:08 1591152128 ⪫祭 ० ᪠ (A) +09:13:29 1591157609 祭 ॣ '-2'(A) +09:14:06 1591157646 ⪫祭 ॣ '-2'(A) +09:20:01 1591158001 祭 ० ࠧ +09:20:02 1591158002 祭 ० ' ⮪ 㣨' +09:46:04 1591159564 祭 ॣ '-2'(A) +10:03:09 1591160589 ⪫祭 ० ࠧ (A) +10:03:09 1591160589 祭 ⠭ ॣ +12:41:31 1591170091 祭 ० +12:41:32 1591170092 ⪫祭 ॣ '-2'(A) +12:41:33 1591170093 祭 ॣ '-2'(A) +14:33:32 1591176812 ⪫祭 ॣ '-2'(A) +15:28:29 1591180109 ⪫祭 ० (A) +15:28:33 1591180113 ⪫祭 ० ' ⮪ 㣨' +15:28:44 1591180124 祭 ० ᪠ +15:31:04 1591180264 ⪫祭 ० ᪠ (A) +18:35:44 1591191344 祭 ० ࠧ +18:35:46 1591191346 祭 ० ' ⮪ 㣨' +18:36:36 1591191396 祭 ॣ '-2'(A) +19:02:58 1591192978 ⪫祭 ० ࠧ (A) +19:06:41 1591193201 ⪫祭 ० ' ⮪ 㣨' +19:06:44 1591193204 ⪫祭 ॣ '-2'(A) +19:07:10 1591193230 祭 ० ᪠ +19:09:32 1591193372 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.459 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.459 new file mode 100644 index 0000000..26b4dac Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.459 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.460 new file mode 100644 index 0000000..93bf835 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.460 @@ -0,0 +1,9 @@ +00:11:27 1591125087 1 11477 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 3 5 Ti 6 7 770 8 3000 9 3820 10 705 11 12 321731 +00:40:21 1591126821 0 A--32-029-2014 ॢ 2 +08:52:32 1591156352 3 14 +11:30:49 1591165849 1 11478 3 25 10 670 +11:35:52 1591166152 9 2980 +14:41:35 1591177295 1 11478 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 3 5 Ti 6 7 770 8 3000 9 2980 10 670 11 12 321731 +15:16:13 1591179373 0 A--32-002-2012 ॢ 9 +22:21:23 1591204883 3 14 +23:16:14 1591208174 0 A--32-067-2014 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.461 new file mode 100644 index 0000000..8dc2020 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.462 new file mode 100644 index 0000000..c9b9cfa --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.462 @@ -0,0 +1,120 @@ +22 23:44:54 00:00:01 +P1= 37.2 T1=23:55:01 P2= 50.1 T2=00:00:01 Vs= 2.59 + +23 00:00:34 00:00:39 + + +24 00:00:51 00:01:26 + + +24 00:01:50 00:02:28 + + +30 00:03:37 00:04:08 +Vst= 27.4 + +31 00:04:30 00:05:04 +Rom_sol= 10.8 + +41 00:05:38 00:05:43 +Ukz= 1.10 + +32 00:05:47 00:06:22 +Imax=11.1 Umax=50.0 T= 9.0 + +33 00:06:26 00:06:49 +Imin=16.1 Umin=24.9 T= 0.5 + +34 00:06:52 00:07:16 +V=300.1 T= 9.4 + +35 00:07:19 00:08:15 +Q= 52.9 T= 9.4 + +36 00:08:19 00:08:49 +P1=0.29 T= 2.9 + +37 00:08:53 00:09:17 +T= 0.9 + +38 00:09:23 00:09:35 +t= 54.0 T= 0.5 + +39 00:09:39 00:10:01 +tcam= 53.7 Tcam= 0.5 tfl= 59.5 Tfl= 0.5 + +40 00:10:04 00:10:13 +t= 54.1 T= 0.5 + +21 08:52:50 08:52:53 +Rsk= 20.8 Rkk= 18.6 + +22 09:11:55 09:27:02 +P1= 53.1 T1=09:22:02 P2= 69.8 T2=09:27:02 Vs= 3.33 + +21 11:31:08 11:31:11 +Rsk= 20.7 Rkk= 18.4 + +22 11:52:13 12:07:20 +P1= 39.1 T1=12:02:20 P2= 50.6 T2=12:07:20 Vs= 2.29 + +20 13:59:57 14:00:06 +Riz_sol= 4751.7 + +20 14:00:13 14:00:21 +Riz_sol= 1779.7 + +21 14:00:37 14:00:40 +Rsk= 20.8 Rkk= 19.1 + +22 14:15:42 14:30:49 +P1= 46.3 T1=14:25:49 P2= 59.8 T2=14:30:49 Vs= 2.71 + +23 14:31:07 14:31:12 + + +24 14:31:20 14:31:57 + + +30 14:32:08 14:32:34 +Vst= 27.8 + +31 14:32:42 14:33:12 +Rom_sol= 11.7 + +41 14:36:28 14:36:33 +Ukz= 1.03 + +32 14:36:34 14:37:11 +Imax=11.1 Umax=50.1 T= 9.0 + +33 14:37:16 14:37:37 +Imin=16.1 Umin=24.9 T= 0.5 + +34 14:37:41 14:38:04 +V=300.4 T= 9.4 + +35 14:38:08 14:39:04 +Q= 52.7 T= 9.4 + +36 14:39:09 14:39:39 +P1=0.28 T= 2.9 + +37 14:39:44 14:40:09 +T= 0.9 + +38 14:40:13 14:40:20 +t= 53.9 T= 0.5 + +39 14:40:24 14:40:39 +tcam= 53.8 Tcam= 0.5 tfl= 59.7 Tfl= 0.5 + +40 14:40:43 14:40:50 +t= 54.1 T= 0.5 + +21 22:21:11 22:21:14 +Rsk= 20.1 Rkk= 18.2 + +22 22:40:00 22:50:07 +P1= 15.0 T1=22:45:07 P2= 33.8 T2=22:50:07 Vs= 3.76 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.463 new file mode 100644 index 0000000..ddabeff --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.463 @@ -0,0 +1,26 @@ +25 00:03:32 1591124612 +9 00:11:27 1591125087 +10 00:40:22 1591126822 +11 03:33:14 1591137194 +12 06:23:19 1591147399 +13 08:12:51 1591153971 +0 08:12:51 1591153971 +14 08:49:52 1591156192 +15 09:27:41 1591158461 +16 09:54:00 1591160040 +1 10:29:53 1591162193 +2 11:26:56 1591165616 +5 12:10:57 1591168257 +6 12:24:37 1591169077 +7 13:03:39 1591171419 +8 13:53:09 1591174389 +25 14:32:04 1591176724 +9 14:41:35 1591177295 +10 15:16:13 1591179373 +11 17:18:40 1591186720 +12 20:00:22 1591196422 +13 21:52:08 1591203128 +0 21:52:08 1591203128 +14 22:18:39 1591204719 +15 22:53:56 1591206836 +16 23:18:43 1591208323 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.464 new file mode 100644 index 0000000..fafd431 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.465 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.465 new file mode 100644 index 0000000..4d2f24d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.465 @@ -0,0 +1 @@ +29 00:01:27 1591124487 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.466 new file mode 100644 index 0000000..7c7bd8c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.466 @@ -0,0 +1,148 @@ +[15] +oper = 25 +begin = 03.06.2020 00:03:32 +norma = 30 +real = 7 + +[16] +oper = 9 +begin = 03.06.2020 00:11:27 +norma = 0 +real = 28 + +[17] +oper = 10 +begin = 03.06.2020 00:40:22 +norma = 0 +real = 172 + +[18] +oper = 11 +begin = 03.06.2020 03:33:14 +norma = 0 +real = 170 + +[19] +oper = 12 +begin = 03.06.2020 06:23:19 +norma = 105 +real = 109 + +[20] +oper = 13 +begin = 03.06.2020 08:12:51 +norma = 45 +real = 37 + +[21] +oper = 14 +begin = 03.06.2020 08:49:52 +norma = 40 +vac_time = 8 +real = 37 + +[22] +oper = 15 +begin = 03.06.2020 09:27:41 +norma = 30 +real = 26 + +[23] +oper = 16 +begin = 03.06.2020 09:54:00 +norma = 40 +real = 35 + +[24] +oper = 1 +begin = 03.06.2020 10:29:53 +norma = 85 +real = 57 + +[25] +oper = 2 +begin = 03.06.2020 11:26:56 +norma = 110 +vac_time = 9 +real = 44 + +[26] +oper = 5 +begin = 03.06.2020 12:10:57 +norma = 25 +real = 13 + +[27] +oper = 6 +begin = 03.06.2020 12:24:37 +norma = 35 +real = 39 + +[28] +oper = 7 +begin = 03.06.2020 13:03:39 +norma = 30 +real = 49 + +[29] +oper = 8 +begin = 03.06.2020 13:53:09 +norma = 40 +vac_time = 9 +real = 38 + +[30] +oper = 25 +begin = 03.06.2020 14:32:04 +norma = 30 +real = 9 + +[31] +oper = 9 +begin = 03.06.2020 14:41:35 +norma = 0 +real = 34 + +[32] +oper = 10 +begin = 03.06.2020 15:16:13 +norma = 0 +real = 122 + +[33] +oper = 11 +begin = 03.06.2020 17:18:40 +norma = 0 +real = 161 + +[34] +oper = 12 +begin = 03.06.2020 20:00:22 +norma = 105 +real = 111 + +[35] +oper = 13 +begin = 03.06.2020 21:52:08 +norma = 45 +real = 26 + +[36] +oper = 14 +begin = 03.06.2020 22:18:39 +norma = 40 +vac_time = 8 +real = 35 + +[37] +oper = 15 +begin = 03.06.2020 22:53:56 +norma = 30 +real = 24 + +[38] +oper = 16 +begin = 03.06.2020 23:18:43 +norma = 40 +real = 59 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.467 new file mode 100644 index 0000000..338ac2b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.467 @@ -0,0 +1,51 @@ +00:00:55 1591124455 祭 ॣ '-2'(A) +00:01:27 1591124487 ⪫祭 ॣ '-2'(A) +00:01:52 1591124512 祭 ॣ '-2'(A) +00:02:29 1591124549 ⪫祭 ॣ '-2'(A) +00:10:45 1591125045 祭 ० ࠧ +00:10:48 1591125048 祭 ० ' ⮪ 㣨' +00:31:19 1591126279 祭 ॣ '-2'(A) +00:40:21 1591126821 ⪫祭 ० ࠧ (A) +00:40:21 1591126821 祭 ⠭ ॣ +03:33:13 1591137193 祭 ० +03:33:14 1591137194 ⪫祭 ॣ '-2'(A) +03:33:15 1591137195 祭 ॣ '-2'(A) +04:38:16 1591141096 ⪫祭 ॣ '-2'(A) +06:23:14 1591147394 ⪫祭 ० (A) +06:23:20 1591147400 ⪫祭 ० ' ⮪ 㣨' +06:24:18 1591147458 祭 ० ᪠ +06:26:58 1591147618 ⪫祭 ० ᪠ (A) +09:27:32 1591158452 祭 ० ࠧ +09:27:35 1591158455 祭 ० ' ⮪ 㣨' +09:27:37 1591158457 祭 ॣ '-2'(A) +09:52:18 1591159938 ⪫祭 ० ' ⮪ 㣨' +09:54:05 1591160045 ⪫祭 ॣ '-2'(A) +09:54:11 1591160051 祭 ० ᪠ +09:56:28 1591160188 ⪫祭 ० ᪠ (A) +12:24:47 1591169087 祭 ० ᪠ +12:24:48 1591169088 祭 ० ᪠ +12:27:30 1591169250 ⪫祭 ० ᪠ (A) +14:31:21 1591176681 祭 ॣ '-2'(A) +14:31:57 1591176717 ⪫祭 ॣ '-2'(A) +14:41:02 1591177262 祭 ० ࠧ +14:41:04 1591177264 祭 ० ' ⮪ 㣨' +14:58:30 1591178310 祭 ॣ '-2'(A) +15:16:13 1591179373 ⪫祭 ० ࠧ (A) +15:16:13 1591179373 祭 ⠭ ॣ +17:18:39 1591186719 祭 ० +17:18:40 1591186720 ⪫祭 ॣ '-2'(A) +17:18:41 1591186721 祭 ॣ '-2'(A) +18:27:40 1591190860 ⪫祭 ॣ '-2'(A) +20:00:17 1591196417 ⪫祭 ० (A) +20:00:23 1591196423 ⪫祭 ० ' ⮪ 㣨' +20:01:48 1591196508 祭 ० ᪠ +20:01:49 1591196509 祭 ० ᪠ +20:04:26 1591196666 ⪫祭 ० ᪠ (A) +22:53:23 1591206803 祭 ० ࠧ +22:53:25 1591206805 祭 ० ' ⮪ 㣨' +22:54:44 1591206884 祭 ॣ '-2'(A) +23:16:14 1591208174 ⪫祭 ० ࠧ (A) +23:18:41 1591208321 ⪫祭 ० ' ⮪ 㣨' +23:18:47 1591208327 ⪫祭 ॣ '-2'(A) +23:19:15 1591208355 祭 ० ᪠ +23:21:56 1591208516 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200603.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.469 new file mode 100644 index 0000000..989cac7 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200603.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.170 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.170 new file mode 100644 index 0000000..5ef067c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.170 @@ -0,0 +1,3 @@ +19:32:09 1591281129 1 09206 3 25 4 2 7 770 9 4800 10 690 12 321173 +20:48:55 1591285735 1 09206 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4360 9 4800 10 690 11 12 321173 +21:31:48 1591288308 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.171 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.171 new file mode 100644 index 0000000..8a183ef Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.171 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.172 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.172 new file mode 100644 index 0000000..43ebdd9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.172 @@ -0,0 +1,51 @@ +20 19:29:35 19:29:45 +Riz_sol=13322.2 + +21 19:29:53 19:30:01 +Rsk= 14.1 Rkk= 9.1 + +22 20:20:44 20:36:17 +P1= 40.2 T1=20:31:16 P2= 53.7 T2=20:36:17 Vs= 2.69 + +23 20:36:52 20:36:58 + + +24 20:37:05 20:37:40 + + +30 20:38:06 20:39:25 +Vst= 29.0 + +31 20:39:33 20:40:11 +Rom_sol= 10.1 + +32 20:41:00 20:41:36 +Imax=10.1 Umax=50.6 T= 9.4 + +32 20:41:59 20:43:09 +Imax=10.8 Umax=49.9 T= 9.4 + +33 20:43:13 20:43:43 +Imin=16.0 Umin=25.1 T= 0.8 + +34 20:43:47 20:44:15 +V=301.3 T= 9.5 + +35 20:44:21 20:45:24 +Q= 54.9 T= 9.1 + +36 20:45:30 20:46:07 +P1=0.26 T= 3.0 + +37 20:46:12 20:46:50 +T= 0.7 + +38 20:46:55 20:47:02 +t= 51.5 T= 0.8 + +39 20:47:05 20:47:11 +t= 51.5 T= 0.7 + +40 20:47:15 20:47:21 +t= 51.5 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.173 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.173 new file mode 100644 index 0000000..5f7481b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.173 @@ -0,0 +1,5 @@ +8 19:23:40 1591280620 +00 20:05:19 1591283119 +25 20:38:02 1591285082 +9 20:48:55 1591285735 +10 21:31:49 1591288309 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.174 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.174 new file mode 100644 index 0000000..214d656 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.174 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.175 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.175 new file mode 100644 index 0000000..7f3d5cd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.175 @@ -0,0 +1,3 @@ +47 20:41:36 1591285296 +47 20:41:40 1591285300 +47 20:41:46 1591285306 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.176 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.176 new file mode 100644 index 0000000..4621bce --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.176 @@ -0,0 +1,25 @@ +[88] +oper = 8 +begin = 04.06.2020 19:23:40 +norma = 40 +vac_time = 8 +real = 74 + +[89] +oper = 25 +begin = 04.06.2020 20:38:02 +norma = 30 +real = 10 + +[90] +oper = 9 +begin = 04.06.2020 20:48:55 +norma = 0 +real = 42 + +[91] +oper = 10 +begin = 04.06.2020 21:31:49 +norma = 0 +real = 232 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.177 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.177 new file mode 100644 index 0000000..b6fe195 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.177 @@ -0,0 +1,7 @@ +20:37:07 1591285027 祭 ॣ '-2'(A) +20:37:41 1591285061 ⪫祭 ॣ '-2'(A) +20:47:43 1591285663 祭 ० ࠧ +20:47:47 1591285667 祭 ० ' ⮪ 㣨' +21:14:44 1591287284 祭 ॣ '-2'(A) +21:31:48 1591288308 ⪫祭 ० ࠧ (A) +21:31:48 1591288308 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.179 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.179 new file mode 100644 index 0000000..ac153d6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.179 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.230 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.230 new file mode 100644 index 0000000..742e3be --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.230 @@ -0,0 +1,3 @@ +10:48:42 1591249722 1 06852 9 5140 10 670 11 +14:49:53 1591264193 1 06852 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3500 9 5140 10 670 11 12 321173 +15:18:34 1591265914 0 A--32-068-2019 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.231 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.231 new file mode 100644 index 0000000..9ac708e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.231 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.232 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.232 new file mode 100644 index 0000000..508a67b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.232 @@ -0,0 +1,69 @@ +21 10:47:48 10:47:51 +Rsk= 22.5 Rkk= 20.1 + +22 11:04:23 11:19:54 +P1= 62.5 T1=11:14:54 P2= 79.2 T2=11:19:54 Vs= 3.33 + +22 11:34:22 11:49:54 +P1= 37.4 T1=11:44:54 P2= 48.1 T2=11:49:54 Vs= 2.13 + +20 13:04:08 13:04:17 +Riz_sol= 3252.7 + +21 13:04:23 13:04:26 +Rsk= 22.4 Rkk= 20.1 + +20 14:05:58 14:06:07 +Riz_sol= 3863.5 + +21 14:06:13 14:06:16 +Rsk= 21.8 Rkk= 19.7 + +22 14:24:45 14:35:15 +P1= 28.6 T1=14:30:15 P2= 43.4 T2=14:35:15 Vs= 2.96 + +23 14:37:09 14:37:14 + + +24 14:38:34 14:39:13 + + +30 14:39:47 14:40:23 +Vst= 28.9 + +31 14:40:32 14:41:33 +Rom_sol= 10.8 + +41 14:43:06 14:43:11 +Ukz= 0.82 + +32 14:43:23 14:43:59 +Imax=10.9 Umax=50.1 T= 9.0 + +33 14:44:13 14:44:34 +Imin=15.9 Umin=24.9 T= 0.5 + +34 14:44:49 14:45:12 +V=300.2 T= 9.4 + +35 14:45:14 14:46:38 +Q= 49.9 T= 9.4 + +36 14:46:41 14:47:26 +P1=0.29 T= 2.9 + +37 14:47:29 14:48:05 +T= 0.9 + +38 14:48:08 14:48:14 +t= 53.7 T= 0.5 + +39 14:48:08 14:48:14 +t= 53.7 T= 0.5 + +39 14:48:27 14:48:37 +t= 53.7 T= 0.5 + +40 14:48:56 14:49:04 +t= 52.0 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.233 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.233 new file mode 100644 index 0000000..a7db266 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.233 @@ -0,0 +1,16 @@ +11 01:45:07 1591217107 +12 04:32:06 1591227126 +13 06:16:12 1591233372 +0 06:16:12 1591233372 +2 10:44:17 1591249457 +5 11:50:30 1591253430 +6 12:02:12 1591254132 +7 12:35:34 1591256134 +8 13:02:39 1591257759 +13 13:50:57 1591260657 +8 13:56:07 1591260967 +25 14:39:45 1591263585 +9 14:49:53 1591264193 +10 15:18:34 1591265914 +11 19:38:46 1591281526 +12 22:22:34 1591291354 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.234 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.234 new file mode 100644 index 0000000..306377c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.234 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.235 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.235 new file mode 100644 index 0000000..7b040d3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.235 @@ -0,0 +1 @@ +108 13:45:09 1591260309 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.236 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.236 new file mode 100644 index 0000000..c19d222 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.236 @@ -0,0 +1,93 @@ +[03] +oper = 11 +begin = 04.06.2020 01:45:07 +norma = 0 +real = 166 + +[04] +oper = 12 +begin = 04.06.2020 04:32:06 +norma = 105 +real = 104 + +[05] +oper = 13 +begin = 04.06.2020 06:16:12 +norma = 45 +real = 268 + +[06] +oper = 2 +begin = 04.06.2020 10:44:17 +norma = 110 +vac_time = 7 +real = 66 + +[07] +oper = 5 +begin = 04.06.2020 11:50:30 +norma = 25 +real = 11 + +[08] +oper = 6 +begin = 04.06.2020 12:02:12 +norma = 35 +real = 33 + +[09] +oper = 7 +begin = 04.06.2020 12:35:34 +norma = 30 +real = 27 + +[10] +oper = 8 +begin = 04.06.2020 13:02:39 +norma = 40 +vac_time = 8 +real = 48 + +[11] +oper = 13 +begin = 04.06.2020 13:50:57 +norma = 45 +real = 5 + +[12] +oper = 8 +begin = 04.06.2020 13:56:07 +norma = 40 +vac_time = 10 +real = 43 + +[13] +oper = 25 +begin = 04.06.2020 14:39:45 +norma = 30 +real = 10 + +[14] +oper = 9 +begin = 04.06.2020 14:49:53 +norma = 0 +real = 28 + +[15] +oper = 10 +begin = 04.06.2020 15:18:34 +norma = 0 +real = 260 + +[16] +oper = 11 +begin = 04.06.2020 19:38:46 +norma = 0 +real = 163 + +[17] +oper = 12 +begin = 04.06.2020 22:22:34 +norma = 105 +real = 107 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.237 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.237 new file mode 100644 index 0000000..ed3100c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.237 @@ -0,0 +1,37 @@ +01:45:06 1591217106 祭 ० +01:45:07 1591217107 ⪫祭 ॣ '-2'(A) +01:45:08 1591217108 祭 ॣ '-2'(A) +03:37:06 1591223826 ⪫祭 ॣ '-2'(A) +04:32:03 1591227123 ⪫祭 ० (A) +04:32:08 1591227128 ⪫祭 ० ' ⮪ 㣨' +04:32:19 1591227139 祭 ० ᪠ +04:32:19 1591227139 祭 ० ᪠ +04:32:20 1591227140 祭 ० ᪠ +04:32:20 1591227140 祭 ० ᪠ +04:35:18 1591227318 ⪫祭 ० ᪠ (A) +10:48:44 1591249724 : 㦥 +12:02:24 1591254144 祭 ० ᪠ +12:05:21 1591254321 ⪫祭 ० ᪠ (A) +14:38:36 1591263516 祭 ॣ '-2'(A) +14:39:15 1591263555 ⪫祭 ॣ '-2'(A) +14:40:10 1591263610 ' ' +14:40:10 1591263610 祭 +14:40:35 1591263635 祭 +14:41:34 1591263694 ⪫祭 +14:49:13 1591264153 祭 ० ' ⮪ 㣨' +14:49:15 1591264155 祭 ० ࠧ +14:49:54 1591264194 : 믮 +15:06:33 1591265193 祭 ॣ '-2'(A) +15:18:33 1591265913 祭 ॣ . 殮 㣨 +15:18:34 1591265914 ⪫祭 ० ࠧ (A) +19:38:45 1591281525 祭 ० +19:38:46 1591281526 ⪫祭 ॣ '-2'(A) +19:38:47 1591281527 祭 ॣ '-2'(A) +20:28:48 1591284528 ⪫祭 ॣ '-2'(A) +22:22:29 1591291349 ⪫祭 ० (A) +22:22:30 1591291350 ⪫祭 +22:22:30 1591291350 : +22:22:36 1591291356 ⪫祭 ० ' ⮪ 㣨' +22:27:45 1591291665 祭 ० ᪠ +22:29:56 1591291796 ⪫祭 ० ᪠ (A) +22:52:28 1591293148 : 믮 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.239 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.239 new file mode 100644 index 0000000..53ee1cc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.239 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.270 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.270 new file mode 100644 index 0000000..b55044f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.270 @@ -0,0 +1,9 @@ +02:41:49 1591220509 3 14 6 +06:49:33 1591235373 1 12100 3 32 9 4535 +10:35:39 1591248939 6 +10:36:21 1591248981 1 12100 2 OT-4 3 32 4 2 5 Ti 6 7 770 8 2020 9 4535 10 670 11 12 320542 +11:05:43 1591250743 0 A--32-050-2012 ॢ 1 +17:42:28 1591274548 3 14 +20:42:31 1591285351 1 12101 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 6 9 4200 10 690 +22:07:01 1591290421 1 12101 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 2020 9 4200 10 690 11 12 320542 +22:49:43 1591292983 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.271 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.271 new file mode 100644 index 0000000..5611bf2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.271 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.272 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.272 new file mode 100644 index 0000000..3e84acc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.272 @@ -0,0 +1,123 @@ +21 02:41:17 02:41:20 +Rsk= 15.6 Rkk= 12.9 + +22 03:02:26 03:12:45 +P1= 20.1 T1=03:07:44 P2= 32.5 T2=03:12:45 Vs= 2.47 + +21 06:48:37 06:48:40 +Rsk= 15.9 Rkk= 13.3 + +22 07:24:45 07:40:04 +P1= 44.5 T1=07:35:04 P2= 60.0 T2=07:40:04 Vs= 3.10 + +22 07:42:21 07:57:41 +P1= 43.6 T1=07:52:41 P2= 57.5 T2=07:57:41 Vs= 2.78 + +20 09:23:45 09:23:54 +Riz_sol= 6471.9 + +21 09:24:02 09:24:05 +Rsk= 15.7 Rkk= 13.1 + +22 09:44:32 09:59:52 +P1= 49.3 T1=09:54:52 P2= 66.7 T2=09:59:52 Vs= 3.50 + +22 10:12:19 10:27:38 +P1= 39.4 T1=10:22:38 P2= 52.9 T2=10:27:38 Vs= 2.70 + +23 10:27:47 10:27:52 + + +24 10:27:59 10:28:35 + + +30 10:28:48 10:29:12 +Vst= 28.0 + +31 10:29:43 10:30:16 +Rom_sol= 12.5 + +41 10:30:48 10:30:53 +Ukz= 0.76 + +32 10:30:58 10:31:32 +Imax=27.4 Umax=55.0 T= 9.0 + +33 10:31:37 10:31:55 +Imin=16.2 Umin=25.0 T= 0.5 + +34 10:31:59 10:32:23 +V=300.1 T= 9.7 + +36 10:32:26 10:33:00 +P1=0.29 T= 3.3 + +37 10:33:06 10:33:33 +T= 1.2 + +38 10:33:38 10:33:43 +t= 69.1 T= 0.8 + +39 10:33:48 10:34:03 +tcam= 54.7 Tcam= 0.8 tfl= 61.6 Tfl= 0.8 + +40 10:34:07 10:34:13 +t= 61.2 T= 0.8 + +35 10:34:18 10:35:25 +Q= 54.3 T=12.5 + +21 17:42:19 17:42:22 +Rsk= 17.0 Rkk= 14.4 + +22 17:57:52 18:08:11 +P1= 22.1 T1=18:03:11 P2= 35.6 T2=18:08:11 Vs= 2.69 + +20 20:41:49 20:41:58 +Riz_sol= 6453.1 + +21 20:43:11 20:43:14 +Rsk= 14.9 Rkk= 12.7 + +22 21:19:48 21:35:07 +P1= 44.8 T1=21:30:07 P2= 60.5 T2=21:35:07 Vs= 3.14 + +22 21:44:41 22:00:00 +P1= 37.0 T1=21:55:00 P2= 49.6 T2=22:00:00 Vs= 2.52 + +23 22:00:07 22:00:12 + + +24 22:00:16 22:01:00 + + +30 22:01:07 22:01:33 +Vst= 28.1 + +31 22:01:35 22:02:08 +Rom_sol= 12.6 + +32 22:02:41 22:03:16 +Imax=11.4 Umax=50.0 T= 9.0 + +33 05:00:00 22:03:44 +Imin=16.3 Umin=25.0 T= 0.5 + +34 05:00:00 22:04:08 +V=300.1 T= 9.8 + +35 22:04:10 22:05:03 +Q= 54.3 T= 9.7 + +36 22:05:05 22:05:35 +P1=0.28 T= 3.2 + +37 22:05:37 22:06:04 +T= 1.2 + +38 22:06:06 22:06:11 +t= 57.5 T= 0.8 + +40 22:06:15 22:06:21 +t= 59.1 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.273 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.273 new file mode 100644 index 0000000..3e43e64 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.273 @@ -0,0 +1,27 @@ +12 00:17:16 1591211836 +13 02:15:05 1591218905 +0 02:15:05 1591218905 +14 02:38:34 1591220314 +15 03:16:33 1591222593 +16 03:41:12 1591224072 +1 04:23:34 1591226614 +2 06:45:30 1591235130 +5 07:58:40 1591239520 +6 08:11:46 1591240306 +7 08:48:39 1591242519 +8 09:15:06 1591244106 +25 10:28:44 1591248524 +9 10:36:21 1591248981 +10 11:05:43 1591250743 +11 13:42:59 1591260179 +12 15:43:21 1591267401 +13 17:28:56 1591273736 +0 17:28:56 1591273736 +14 17:40:32 1591274432 +15 18:08:46 1591276126 +16 18:31:58 1591277518 +1 19:04:54 1591279494 +8 20:38:10 1591285090 +25 22:01:05 1591290065 +9 22:07:01 1591290421 +10 22:49:43 1591292983 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.274 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.274 new file mode 100644 index 0000000..abd1833 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.274 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.276 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.276 new file mode 100644 index 0000000..0274a4f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.276 @@ -0,0 +1,156 @@ +[61] +oper = 12 +begin = 04.06.2020 00:17:16 +norma = 105 +real = 117 + +[62] +oper = 13 +begin = 04.06.2020 02:15:05 +norma = 45 +real = 23 + +[63] +oper = 14 +begin = 04.06.2020 02:38:34 +norma = 40 +vac_time = 6 +vac_avg10 = 7.2 +real = 37 + +[64] +oper = 15 +begin = 04.06.2020 03:16:33 +norma = 30 +real = 24 + +[65] +oper = 16 +begin = 04.06.2020 03:41:12 +norma = 40 +real = 42 + +[66] +oper = 1 +begin = 04.06.2020 04:23:34 +norma = 85 +real = 141 + +[67] +oper = 2 +begin = 04.06.2020 06:45:30 +norma = 110 +vac_time = 6 +real = 73 + +[68] +oper = 5 +begin = 04.06.2020 07:58:40 +norma = 25 +real = 13 + +[69] +oper = 6 +begin = 04.06.2020 08:11:46 +norma = 35 +real = 36 + +[70] +oper = 7 +begin = 04.06.2020 08:48:39 +norma = 30 +real = 26 + +[71] +oper = 8 +begin = 04.06.2020 09:15:06 +norma = 40 +vac_time = 9 +real = 73 + +[72] +oper = 25 +begin = 04.06.2020 10:28:44 +norma = 30 +real = 7 + +[73] +oper = 9 +begin = 04.06.2020 10:36:21 +norma = 0 +real = 29 + +[74] +oper = 10 +begin = 04.06.2020 11:05:43 +norma = 0 +real = 157 + +[75] +oper = 11 +begin = 04.06.2020 13:42:59 +norma = 115 +real = 120 + +[76] +oper = 12 +begin = 04.06.2020 15:43:21 +norma = 105 +real = 105 + +[77] +oper = 13 +begin = 04.06.2020 17:28:56 +norma = 45 +real = 11 + +[78] +oper = 14 +begin = 04.06.2020 17:40:32 +norma = 40 +vac_time = 6 +real = 28 + +[79] +oper = 15 +begin = 04.06.2020 18:08:46 +norma = 30 +real = 23 + +[80] +oper = 16 +begin = 04.06.2020 18:31:58 +norma = 40 +real = 32 + +[81] +oper = 1 +begin = 04.06.2020 19:04:54 +norma = 85 +real = 93 + +[82] +oper = 8 +begin = 04.06.2020 20:38:10 +norma = 40 +vac_time = 7 +real = 82 + +[83] +oper = 25 +begin = 04.06.2020 22:01:05 +norma = 30 +real = 5 + +[84] +oper = 9 +begin = 04.06.2020 22:07:01 +norma = 0 +real = 42 + +[85] +oper = 10 +begin = 04.06.2020 22:49:43 +norma = 0 +real = 205 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.277 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.277 new file mode 100644 index 0000000..4d79879 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.277 @@ -0,0 +1,53 @@ +00:17:09 1591211829 ⪫祭 ० (A) +00:17:11 1591211831 ⪫祭 ० ' ⮪ 㣨' +00:19:47 1591211987 祭 ० ᪠ +00:22:31 1591212151 ⪫祭 ० ᪠ (A) +03:16:31 1591222591 祭 ० ࠧ +03:16:34 1591222594 祭 ० ' ⮪ 㣨' +03:16:36 1591222596 祭 ॣ '-2'(A) +03:30:34 1591223434 ⪫祭 ० ' ⮪ 㣨' +03:41:50 1591224110 祭 ० ᪠ +03:41:51 1591224111 祭 ० ᪠ +03:41:51 1591224111 祭 ० ᪠ +03:42:03 1591224123 ⪫祭 ॣ '-2'(A) +03:44:18 1591224258 ⪫祭 ० ᪠ (A) +08:12:21 1591240341 祭 ० ᪠ +08:14:54 1591240494 ⪫祭 ० ᪠ (A) +10:28:01 1591248481 祭 ॣ '-2'(A) +10:28:36 1591248516 ⪫祭 ॣ '-2'(A) +10:35:57 1591248957 祭 ० ࠧ +10:35:59 1591248959 祭 ० ' ⮪ 㣨' +11:02:42 1591250562 祭 ॣ '-2'(A) +11:03:19 1591250599 ⪫祭 ० ᪠ (A) +11:04:24 1591250664 祭 ० ᪠ +11:04:30 1591250670 ⪫祭 ० ᪠ +11:05:43 1591250743 祭 ⠭ ॣ +11:05:43 1591250743 ⪫祭 ० ࠧ (A) +11:12:24 1591251144 祭 ० ᪠ +11:12:31 1591251151 ⪫祭 ० ᪠ +13:42:59 1591260179 祭 ० +13:42:59 1591260179 ⪫祭 ॣ '-2'(A) +13:43:00 1591260180 祭 ॣ '-2'(A) +14:32:19 1591263139 祭 ० +14:32:22 1591263142 ⪫祭 ॣ '-2'(A) +15:42:59 1591267379 ⪫祭 ० (A) +15:43:01 1591267381 ⪫祭 ० ' ⮪ 㣨' +15:45:03 1591267503 祭 ० ᪠ +15:45:03 1591267503 祭 ० ᪠ +15:47:45 1591267665 ⪫祭 ० ᪠ (A) +18:08:25 1591276105 祭 ० ࠧ +18:08:26 1591276106 祭 ० ' ⮪ 㣨' +18:08:27 1591276107 祭 ॣ '-2'(A) +18:28:21 1591277301 ⪫祭 ० ' ⮪ 㣨' +18:30:56 1591277456 ⪫祭 ० ࠧ (A) +18:32:02 1591277522 ⪫祭 ॣ '-2'(A) +18:32:21 1591277541 祭 ० ᪠ +18:32:21 1591277541 祭 ० ᪠ +18:35:05 1591277705 ⪫祭 ० ᪠ (A) +22:00:25 1591290025 祭 ॣ '-2'(A) +22:01:01 1591290061 ⪫祭 ॣ '-2'(A) +22:06:28 1591290388 祭 ० ࠧ +22:06:30 1591290390 祭 ० ' ⮪ 㣨' +22:32:39 1591291959 祭 ॣ '-2'(A) +22:49:43 1591292983 ⪫祭 ० ࠧ (A) +22:49:43 1591292983 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.279 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.279 new file mode 100644 index 0000000..3f31094 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.279 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.330 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.330 new file mode 100644 index 0000000..c29fdbc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.330 @@ -0,0 +1,11 @@ +03:05:41 1591221941 1 11157 3 25 4 2 7 870 9 6330 10 770 12 321730 +06:20:57 1591233657 11 +06:33:58 1591234438 1 11157 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 870 8 5020 9 6330 10 770 11 12 321730 +07:04:50 1591236290 0 A--32-078-2017 ॢ 1 +19:00:57 1591279257 3 14 +20:07:08 1591283228 0 A--32-120-2016 ॢ 0 +22:26:10 1591291570 1 11158 +22:26:44 1591291604 2 BT 18, 20, 22, 23, 25 3 25 7 770 9 4960 10 690 +22:28:08 1591291688 11 +22:36:54 1591292214 1 11158 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 5020 9 4960 10 690 11 12 321730 +23:20:00 1591294800 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.331 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.331 new file mode 100644 index 0000000..51ddbf2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.331 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.332 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.332 new file mode 100644 index 0000000..cdaf84b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.332 @@ -0,0 +1,114 @@ +21 03:03:45 03:03:53 +Rsk= 20.3 Rkk= 15.0 + +22 03:29:59 03:45:33 +P1= 34.5 T1=03:40:33 P2= 47.3 T2=03:45:33 Vs= 2.56 + +20 05:37:21 05:37:31 +Riz_sol= 8221.9 + +22 06:05:05 06:20:39 +P1= 38.8 T1=06:15:39 P2= 52.4 T2=06:20:39 Vs= 2.71 + +23 06:21:24 06:21:30 + + +24 06:21:42 06:22:21 + + +30 06:22:49 06:23:33 +Vst= 28.3 + +31 06:24:05 06:25:06 +Rom_sol= 15.4 + +21 06:26:46 06:26:53 +Rsk= 15.0 Rkk= 15.1 + +41 06:28:09 06:28:14 +Ukz= 0.90 + +32 06:28:20 06:29:29 +Imax=11.0 Umax=50.0 T= 9.4 + +33 06:29:32 06:30:00 +Imin=16.1 Umin=25.0 T= 0.8 + +34 06:30:04 06:30:32 +V=301.8 T= 9.6 + +35 06:30:36 06:31:29 +Q= 54.8 T= 9.0 + +36 06:31:33 06:32:06 +P1=0.25 T= 3.1 + +37 06:32:10 06:32:46 +T= 0.6 + +38 06:32:50 06:32:55 +t= 52.1 T= 0.7 + +39 06:32:59 06:33:04 +t= 52.4 T= 0.8 + +40 06:33:09 06:33:15 +t= 51.9 T= 0.5 + +21 19:00:39 19:00:47 +Rsk= 14.9 Rkk= 14.9 + +22 19:17:12 19:32:48 +P1= 53.0 T1=19:27:48 P2= 69.1 T2=19:32:48 Vs= 3.22 + +20 21:47:52 21:48:01 +Riz_sol= 2679.1 + +21 21:48:22 21:48:29 +Rsk= 20.3 Rkk= 15.0 + +22 22:10:25 22:26:00 +P1= 41.8 T1=22:21:00 P2= 55.8 T2=22:26:00 Vs= 2.80 + +23 22:26:56 22:27:02 + + +24 22:28:14 22:28:49 + + +30 22:29:01 22:29:43 +Vst= 28.6 + +31 22:29:48 22:30:26 +Rom_sol= 12.3 + +41 22:31:00 22:31:05 +Ukz= 1.06 + +32 22:31:11 22:32:19 +Imax=11.0 Umax=50.0 T= 9.2 + +33 22:32:26 22:32:54 +Imin=16.2 Umin=25.1 T= 1.0 + +34 22:32:57 22:33:25 +V=301.8 T= 9.6 + +35 22:33:28 22:34:24 +Q= 53.9 T= 9.2 + +36 22:34:26 22:35:08 +P1=0.28 T= 3.0 + +37 22:35:11 22:35:46 +T= 0.7 + +38 22:35:49 22:35:55 +t= 52.1 T= 0.7 + +39 22:35:57 22:36:03 +t= 52.3 T= 0.7 + +40 22:36:06 22:36:12 +t= 51.9 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.333 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.333 new file mode 100644 index 0000000..38304dc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.333 @@ -0,0 +1,22 @@ +1 00:08:04 1591211284 +2 03:00:49 1591221649 +5 03:48:59 1591224539 +6 04:00:46 1591225246 +7 04:37:05 1591227425 +8 05:33:58 1591230838 +25 06:27:02 1591234022 +9 06:33:58 1591234438 +10 07:04:50 1591236290 +11 12:50:21 1591257021 +12 16:21:24 1591269684 +13 18:21:45 1591276905 +0 18:21:46 1591276906 +14 19:00:16 1591279216 +15 19:34:20 1591281260 +16 20:07:08 1591283228 +16 20:10:31 1591283431 +1 20:46:38 1591285598 +8 21:38:49 1591288729 +25 22:28:57 1591291737 +9 22:36:54 1591292214 +10 23:20:00 1591294800 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.334 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.334 new file mode 100644 index 0000000..8714eb7 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.334 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.336 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.336 new file mode 100644 index 0000000..bc83bdf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.336 @@ -0,0 +1,130 @@ +[15] +oper = 1 +begin = 04.06.2020 00:08:04 +norma = 85 +real = 172 + +[16] +oper = 2 +begin = 04.06.2020 03:00:49 +norma = 110 +vac_time = 8 +real = 48 + +[17] +oper = 5 +begin = 04.06.2020 03:48:59 +norma = 25 +real = 11 + +[18] +oper = 6 +begin = 04.06.2020 04:00:46 +norma = 35 +real = 36 + +[19] +oper = 7 +begin = 04.06.2020 04:37:05 +norma = 30 +real = 56 + +[20] +oper = 8 +begin = 04.06.2020 05:33:58 +norma = 40 +vac_time = 11 +real = 53 + +[21] +oper = 25 +begin = 04.06.2020 06:27:02 +norma = 30 +real = 6 + +[22] +oper = 9 +begin = 04.06.2020 06:33:58 +norma = 0 +real = 30 + +[23] +oper = 10 +begin = 04.06.2020 07:04:50 +norma = 0 +real = 345 + +[24] +oper = 11 +begin = 04.06.2020 12:50:21 +norma = 0 +real = 211 + +[25] +oper = 12 +begin = 04.06.2020 16:21:24 +norma = 105 +real = 120 + +[26] +oper = 13 +begin = 04.06.2020 18:21:45 +norma = 45 +real = 38 + +[27] +oper = 14 +begin = 04.06.2020 19:00:16 +norma = 40 +vac_time = 7 +real = 34 + +[28] +oper = 15 +begin = 04.06.2020 19:34:20 +norma = 30 +real = 32 + +[29] +oper = 16 +begin = 04.06.2020 20:07:08 +norma = 40 +real = 3 + +[30] +oper = 16 +begin = 04.06.2020 20:10:31 +norma = 40 +real = 36 + +[31] +oper = 1 +begin = 04.06.2020 20:46:38 +norma = 85 +real = 52 + +[32] +oper = 8 +begin = 04.06.2020 21:38:49 +norma = 40 +vac_time = 9 +real = 50 + +[33] +oper = 25 +begin = 04.06.2020 22:28:57 +norma = 30 +real = 7 + +[34] +oper = 9 +begin = 04.06.2020 22:36:54 +norma = 0 +real = 43 + +[35] +oper = 10 +begin = 04.06.2020 23:20:00 +norma = 0 +real = 240 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.337 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.337 new file mode 100644 index 0000000..b34b455 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.337 @@ -0,0 +1,50 @@ +04:01:31 1591225291 祭 ० ᪠ +04:05:59 1591225559 ⪫祭 ० ᪠ (A) +06:21:00 1591233660 : 㦥 +06:21:46 1591233706 祭 ॣ '-2'(A) +06:22:22 1591233742 ⪫祭 ॣ '-2'(A) +06:23:49 1591233829 ' ' +06:23:49 1591233829 祭 +06:24:07 1591233847 祭 +06:25:06 1591233906 ⪫祭 +06:33:26 1591234406 祭 ० ࠧ +06:33:27 1591234407 祭 ० ' ⮪ 㣨' +06:33:59 1591234439 : 믮 +06:50:20 1591235420 祭 ॣ '-2'(A) +07:04:50 1591236290 ⪫祭 ० ࠧ (A) +07:04:50 1591236290 祭 ॣ . 殮 㣨 +12:50:21 1591257021 祭 ० +12:50:21 1591257021 ⪫祭 ॣ '-2'(A) +12:50:23 1591257023 祭 ॣ '-2'(A) +13:46:22 1591260382 ⪫祭 ॣ '-2'(A) +16:21:21 1591269681 ⪫祭 ० (A) +16:21:22 1591269682 ⪫祭 +16:21:22 1591269682 : +16:21:26 1591269686 ⪫祭 ० ' ⮪ 㣨' +16:21:37 1591269697 祭 ० ᪠ +16:21:37 1591269697 祭 ० ᪠ +16:21:37 1591269697 祭 ० ᪠ +16:22:11 1591269731 . ⪫祭 ० ᪠ (A) +16:26:26 1591269986 祭 ० ᪠ +16:26:26 1591269986 祭 ० ᪠ +16:30:00 1591270200 ⪫祭 ० ᪠ (A) +16:51:22 1591271482 : 믮 +19:35:12 1591281312 祭 ० ࠧ +19:35:13 1591281313 祭 ० ' ⮪ 㣨' +19:35:14 1591281314 祭 ॣ '-2'(A) +20:07:08 1591283228 ⪫祭 ० ࠧ (A) +20:10:32 1591283432 ⪫祭 ० ' ⮪ 㣨' +20:10:34 1591283434 ⪫祭 ॣ '-2'(A) +20:10:53 1591283453 祭 ० ᪠ +20:10:53 1591283453 祭 ० ᪠ +20:10:53 1591283453 祭 ० ᪠ +20:14:09 1591283649 ⪫祭 ० ᪠ (A) +22:26:46 1591291606 : 㦥 +22:28:09 1591291689 : +22:28:16 1591291696 祭 ॣ '-2'(A) +22:28:50 1591291730 ⪫祭 ॣ '-2'(A) +22:36:18 1591292178 祭 ० ࠧ +22:36:19 1591292179 祭 ० ' ⮪ 㣨' +23:02:56 1591293776 祭 ॣ '-2'(A) +23:20:00 1591294800 ⪫祭 ० ࠧ (A) +23:20:00 1591294800 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.339 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.339 new file mode 100644 index 0000000..8308dca Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.339 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.350 new file mode 100644 index 0000000..9521bd3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.350 @@ -0,0 +1,6 @@ +06:43:35 1591235015 1 09526 4 2 9 5040 10 670 +10:37:43 1591249063 3 37 +10:38:14 1591249094 1 09526 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 37 4 2 5 Ti 6 7 770 8 4910 9 5040 10 670 11 12 321692 +20:04:49 1591283089 1 09527 3 25 9 5030 10 690 +22:59:08 1591293548 1 09527 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4910 9 5030 10 690 11 12 321692 +23:41:49 1591296109 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.351 new file mode 100644 index 0000000..c0220d3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.352 new file mode 100644 index 0000000..caaf2fc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.352 @@ -0,0 +1,120 @@ +21 06:42:12 06:42:15 +Rsk= 17.0 Rkk= 14.2 + +22 07:19:43 07:35:14 +P1= 37.4 T1=07:30:14 P2= 50.1 T2=07:35:14 Vs= 2.54 + +20 09:39:54 09:40:02 +Riz_sol= 6083.2 + +21 09:40:12 09:40:15 +Rsk= 17.1 Rkk= 14.4 + +22 10:12:57 10:28:28 +P1= 43.4 T1=10:23:28 P2= 57.5 T2=10:28:28 Vs= 2.81 + +23 10:28:55 10:29:00 + + +24 10:29:10 10:29:44 + + +24 10:29:56 10:30:35 + + +30 10:30:57 10:31:26 +Vst= 28.2 + +31 10:31:32 10:32:05 +Rom_sol= 13.2 + +41 10:32:52 10:32:57 +Ukz= 1.08 + +32 10:33:01 10:33:35 +Imax=11.3 Umax=50.1 T= 9.0 + +33 10:33:39 10:33:57 +Imin=16.2 Umin=25.0 T= 0.5 + +34 10:33:59 10:34:27 +V=300.3 T= 9.5 + +35 10:34:30 10:35:35 +Q= 53.9 T= 9.5 + +36 10:35:38 10:36:22 +P1=0.29 T= 3.0 + +37 10:36:25 10:36:50 +T= 1.0 + +38 10:36:53 10:36:59 +t= 53.9 T= 0.8 + +39 10:37:02 10:37:20 +tcam= 55.1 Tcam= 0.8 tfl= 54.4 Tfl= 0.8 + +40 10:37:23 10:37:30 +t= 53.3 T= 0.8 + +20 19:56:41 19:56:50 +Riz_sol= 6464.5 + +21 19:56:57 19:57:00 +Rsk= 16.9 Rkk= 14.2 + +22 20:50:27 21:05:57 +P1= 71.1 T1=21:00:57 P2= 97.7 T2=21:05:57 Vs= 5.33 + +22 21:19:40 21:35:11 +P1= 52.1 T1=21:30:11 P2= 72.6 T2=21:35:11 Vs= 4.11 + +22 21:49:39 22:05:10 +P1= 42.9 T1=22:00:10 P2= 59.8 T2=22:05:10 Vs= 3.38 + +22 22:15:02 22:30:33 +P1= 37.2 T1=22:25:33 P2= 52.5 T2=22:30:33 Vs= 3.07 + +22 22:35:38 22:51:09 +P1= 35.3 T1=22:46:09 P2= 49.6 T2=22:51:09 Vs= 2.88 + +23 22:51:26 22:51:31 + + +24 22:51:39 22:52:18 + + +30 22:52:33 22:52:56 +Vst= 28.3 + +31 22:53:03 22:53:38 +Rom_sol= 13.3 + +32 22:54:18 22:54:53 +Imax=11.3 Umax=50.0 T= 9.0 + +33 22:54:56 22:55:13 +Imin=16.2 Umin=25.0 T= 0.5 + +34 05:00:00 22:55:40 +V=300.1 T= 9.5 + +35 22:55:43 22:56:44 +Q= 55.0 T= 9.5 + +36 22:56:47 22:57:25 +P1=0.29 T= 3.1 + +37 22:57:28 22:57:53 +T= 1.0 + +38 22:57:55 22:58:01 +t= 53.8 T= 0.8 + +39 22:58:03 22:58:18 +tcam= 55.1 Tcam= 0.7 tfl= 54.3 Tfl= 0.8 + +40 22:58:20 22:58:25 +t= 57.1 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.353 new file mode 100644 index 0000000..e891281 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.353 @@ -0,0 +1,18 @@ +12 02:40:42 1591220442 +13 04:29:10 1591226950 +0 04:29:10 1591226950 +2 06:39:19 1591234759 +5 07:36:48 1591238208 +6 07:49:02 1591238942 +7 08:26:04 1591241164 +8 09:36:51 1591245411 +25 10:30:51 1591248651 +9 10:38:14 1591249094 +10 11:17:09 1591251429 +12 13:43:33 1591260213 +13 18:02:28 1591275748 +0 18:02:29 1591275749 +8 19:51:36 1591282296 +25 22:52:31 1591293151 +9 22:59:08 1591293548 +10 23:41:49 1591296109 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.354 new file mode 100644 index 0000000..73f7f2b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.355 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.355 new file mode 100644 index 0000000..d90440c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.355 @@ -0,0 +1 @@ +29 10:29:44 1591248584 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.356 new file mode 100644 index 0000000..7eddea7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.356 @@ -0,0 +1,99 @@ +[07] +oper = 12 +begin = 04.06.2020 02:40:42 +norma = 105 +real = 108 + +[08] +oper = 13 +begin = 04.06.2020 04:29:10 +norma = 45 +real = 130 + +[09] +oper = 2 +begin = 04.06.2020 06:39:19 +norma = 110 +vac_time = 9 +real = 57 + +[10] +oper = 5 +begin = 04.06.2020 07:36:48 +norma = 25 +real = 12 + +[11] +oper = 6 +begin = 04.06.2020 07:49:02 +norma = 35 +real = 37 + +[12] +oper = 7 +begin = 04.06.2020 08:26:04 +norma = 30 +real = 70 + +[13] +oper = 8 +begin = 04.06.2020 09:36:51 +norma = 40 +vac_time = 9 +real = 54 + +[14] +oper = 25 +begin = 04.06.2020 10:30:51 +norma = 30 +real = 7 + +[15] +oper = 9 +begin = 04.06.2020 10:38:14 +norma = 0 +real = 38 + +[16] +oper = 10 +begin = 04.06.2020 11:17:09 +norma = 0 +real = 146 + +[17] +oper = 12 +begin = 04.06.2020 13:43:33 +norma = 180 +real = 258 + +[18] +oper = 13 +begin = 04.06.2020 18:02:28 +norma = 45 +real = 109 + +[19] +oper = 8 +begin = 04.06.2020 19:51:36 +norma = 40 +vac_time = 9 +real = 180 + +[20] +oper = 25 +begin = 04.06.2020 22:52:31 +norma = 30 +real = 6 + +[21] +oper = 9 +begin = 04.06.2020 22:59:08 +norma = 0 +real = 42 + +[22] +oper = 10 +begin = 04.06.2020 23:41:49 +norma = 0 +real = 243 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.357 new file mode 100644 index 0000000..40e17cf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.357 @@ -0,0 +1,36 @@ +01:45:42 1591217142 ⪫祭 ॣ '-2'(A) +02:40:40 1591220440 ⪫祭 ० (A) +02:40:42 1591220442 ⪫祭 ० ' ⮪ 㣨' +02:41:46 1591220506 祭 ० ᪠ +02:41:46 1591220506 祭 ० ᪠ +02:41:47 1591220507 祭 ० ᪠ +02:41:47 1591220507 祭 ० ᪠ +02:41:47 1591220507 祭 ० ᪠ +02:41:47 1591220507 祭 ० ᪠ +02:41:48 1591220508 祭 ० ᪠ +02:41:48 1591220508 祭 ० ᪠ +02:41:48 1591220508 祭 ० ᪠ +02:45:29 1591220729 ⪫祭 ० ᪠ (A) +07:49:12 1591238952 祭 ० ᪠ +07:49:12 1591238952 祭 ० ᪠ +07:49:13 1591238953 祭 ० ᪠ +07:49:13 1591238953 祭 ० ᪠ +07:52:55 1591239175 ⪫祭 ० ᪠ (A) +10:29:12 1591248552 祭 ॣ '-2'(A) +10:29:44 1591248584 ⪫祭 ॣ '-2'(A) +10:29:57 1591248597 祭 ॣ '-2'(A) +10:30:36 1591248636 ⪫祭 ॣ '-2'(A) +11:12:34 1591251154 祭 ॣ '-2' +11:17:09 1591251429 祭 ⠭ ॣ +13:33:22 1591259602 ⪫祭 ॣ '-2' +13:44:40 1591260280 祭 ० ᪠ +13:44:41 1591260281 祭 ० ᪠ +13:44:41 1591260281 祭 ० ᪠ +13:47:10 1591260430 ⪫祭 ० ᪠ (A) +22:51:43 1591293103 祭 ॣ '-2'(A) +22:52:19 1591293139 ⪫祭 ॣ '-2'(A) +22:58:38 1591293518 祭 ० ࠧ +22:58:39 1591293519 祭 ० ' ⮪ 㣨' +23:24:44 1591295084 祭 ॣ '-2'(A) +23:41:49 1591296109 ⪫祭 ० ࠧ (A) +23:41:49 1591296109 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.359 new file mode 100644 index 0000000..cb119c0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.410 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.410 new file mode 100644 index 0000000..14bf75c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.410 @@ -0,0 +1,6 @@ +00:15:34 1591211734 1 11408 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3000 9 5150 10 690 11 12 320839 +00:58:02 1591214282 0 A--32-031-2016 ॢ 5 +14:36:04 1591263364 1 11409 2 BT 18, 20, 22, 23, 25 10 670 +17:38:16 1591274296 9 5140 +17:38:44 1591274324 1 11409 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 3000 9 5140 10 670 11 12 320839 +18:13:17 1591276397 0 A--32-002-2012 ॢ 9 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.411 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.411 new file mode 100644 index 0000000..0bc1a11 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.411 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.412 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.412 new file mode 100644 index 0000000..1f0be20 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.412 @@ -0,0 +1,159 @@ +22 23:50:13 00:05:20 +P1= 57.5 T1=00:00:20 P2= 71.4 T2=00:05:20 Vs= 2.77 + +23 00:05:36 00:05:42 + + +24 00:06:12 00:06:51 + + +30 00:07:26 00:07:53 +Vst= 32.0 + +31 00:07:59 00:08:34 +Rom_sol= 12.1 + +32 00:09:26 00:10:04 +Imax=11.0 Umax=50.0 T= 9.0 + +33 00:10:08 00:10:28 +Imin=16.0 Umin=25.0 T= 0.5 + +34 00:10:34 00:10:57 +V=300.2 T= 9.5 + +35 00:11:00 00:12:22 +Q= 54.6 T= 9.4 + +36 00:12:33 00:13:07 +P1=0.29 T= 2.9 + +37 00:13:42 00:14:06 +T= 0.9 + +38 00:14:10 00:14:17 +t= 51.8 T= 0.5 + +39 00:14:21 00:14:35 +tcam= 52.3 Tcam= 0.6 tfl= 55.6 Tfl= 0.5 + +40 00:14:39 00:14:46 +t= 51.9 T= 0.6 + +21 14:36:35 14:36:39 +Rsk= 7.4 Rkk= 4.5 + +21 14:36:42 14:36:45 +Rsk= 7.4 Rkk= 4.5 + +21 14:41:09 14:41:12 +Rsk= 11.1 Rkk= 8.3 + +22 15:09:58 15:25:05 +P1= 55.9 T1=15:20:05 P2= 69.7 T2=15:25:05 Vs= 2.75 + +20 16:39:04 16:39:13 +Riz_sol= 4758.5 + +21 16:39:23 16:39:26 +Rsk= 7.8 Rkk= 4.9 + +21 16:39:38 16:39:41 +Rsk= 7.8 Rkk= 4.9 + +21 16:40:52 16:40:55 +Rsk= 7.8 Rkk= 4.9 + +21 16:41:10 16:41:13 +Rsk= 7.8 Rkk= 4.9 + +21 16:41:41 16:41:44 +Rsk= 4.9 Rkk= 4.9 + +21 16:41:59 16:42:02 +Rsk= 7.8 Rkk= 4.9 + +21 16:42:12 16:42:15 +Rsk= 7.8 Rkk= 4.9 + +21 16:42:21 16:42:24 +Rsk= 7.8 Rkk= 4.9 + +21 16:42:36 16:42:39 +Rsk= 7.8 Rkk= 4.9 + +21 16:42:46 16:42:49 +Rsk= 7.8 Rkk= 4.9 + +21 16:42:53 16:42:56 +Rsk= 7.8 Rkk= 4.9 + +21 16:43:05 16:43:08 +Rsk= 7.8 Rkk= 4.9 + +21 16:43:12 16:43:15 +Rsk= 7.8 Rkk= 4.9 + +21 16:43:21 16:43:24 +Rsk= 7.8 Rkk= 4.9 + +21 16:43:36 16:43:39 +Rsk= 7.8 Rkk= 4.9 + +21 16:43:47 16:43:50 +Rsk= 7.8 Rkk= 4.9 + +21 16:47:38 16:47:41 +Rsk= 7.8 Rkk= 4.9 + +21 16:48:36 16:48:39 +Rsk= 7.8 Rkk= 4.9 + +21 16:52:10 16:52:13 +Rsk= 8.2 Rkk= 5.3 + +22 17:10:19 17:25:27 +P1= 52.7 T1=17:20:27 P2= 62.9 T2=17:25:27 Vs= 2.03 + +23 17:28:33 17:28:39 + + +24 17:28:53 17:29:30 + + +30 17:29:52 17:30:18 +Vst= 31.6 + +31 17:30:24 17:31:10 +Rom_sol= 11.8 + +41 17:31:44 17:31:49 +Ukz= 1.23 + +32 17:31:51 17:32:31 +Imax=11.0 Umax=50.0 T= 9.0 + +33 17:32:42 17:33:06 +Imin=16.0 Umin=25.0 T= 0.5 + +34 17:33:11 17:33:38 +V=300.1 T= 9.5 + +35 17:33:44 17:35:09 +Q= 49.8 T= 9.4 + +36 17:35:14 17:35:50 +P1=0.29 T= 2.9 + +37 17:36:33 17:36:56 +T= 0.9 + +38 17:37:01 17:37:09 +t= 51.8 T= 0.5 + +39 17:37:12 17:37:29 +tcam= 52.2 Tcam= 0.6 tfl= 55.0 Tfl= 0.5 + +40 17:37:32 17:37:40 +t= 51.8 T= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.413 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.413 new file mode 100644 index 0000000..5447a11 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.413 @@ -0,0 +1,16 @@ +25 00:07:23 1591211243 +9 00:15:34 1591211734 +10 00:58:02 1591214282 +11 05:13:35 1591229615 +12 08:00:33 1591239633 +13 09:46:01 1591245961 +0 09:46:01 1591245961 +2 14:33:33 1591263213 +5 15:25:50 1591266350 +6 15:37:55 1591267075 +7 16:11:52 1591269112 +8 16:29:50 1591270190 +25 17:29:45 1591273785 +9 17:38:44 1591274324 +10 18:13:17 1591276397 +11 21:48:44 1591289324 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.414 new file mode 100644 index 0000000..618ce89 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.415 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.415 new file mode 100644 index 0000000..8dcdba5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.415 @@ -0,0 +1,8 @@ +4 16:41:35 1591270895 +4 16:42:33 1591270953 +47 17:36:01 1591274161 +47 17:36:17 1591274177 +47 17:36:18 1591274178 +47 17:36:19 1591274179 +47 17:36:19 1591274179 +47 17:36:20 1591274180 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.416 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.416 new file mode 100644 index 0000000..97a8fe2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.416 @@ -0,0 +1,92 @@ +[56] +oper = 25 +begin = 04.06.2020 00:07:23 +norma = 30 +real = 8 + +[57] +oper = 9 +begin = 04.06.2020 00:15:34 +norma = 0 +real = 42 + +[58] +oper = 10 +begin = 04.06.2020 00:58:02 +norma = 0 +real = 255 + +[59] +oper = 11 +begin = 04.06.2020 05:13:35 +norma = 0 +real = 166 + +[60] +oper = 12 +begin = 04.06.2020 08:00:33 +norma = 105 +real = 105 + +[61] +oper = 13 +begin = 04.06.2020 09:46:01 +norma = 45 +real = 287 + +[62] +oper = 2 +begin = 04.06.2020 14:33:33 +norma = 110 +vac_time = 11 +real = 52 + +[63] +oper = 5 +begin = 04.06.2020 15:25:50 +norma = 25 +real = 12 + +[64] +oper = 6 +begin = 04.06.2020 15:37:55 +norma = 35 +real = 33 + +[65] +oper = 7 +begin = 04.06.2020 16:11:52 +norma = 30 +real = 17 + +[66] +oper = 8 +begin = 04.06.2020 16:29:50 +norma = 40 +vac_time = 11 +real = 59 + +[67] +oper = 25 +begin = 04.06.2020 17:29:45 +norma = 30 +real = 8 + +[68] +oper = 9 +begin = 04.06.2020 17:38:44 +norma = 0 +real = 34 + +[69] +oper = 10 +begin = 04.06.2020 18:13:17 +norma = 0 +real = 215 + +[70] +oper = 11 +begin = 04.06.2020 21:48:44 +norma = 0 +real = 161 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.417 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.417 new file mode 100644 index 0000000..305bc4d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.417 @@ -0,0 +1,32 @@ +00:06:16 1591211176 祭 ॣ '-2'(A) +00:06:51 1591211211 ⪫祭 ॣ '-2'(A) +00:15:03 1591211703 祭 ० ࠧ +00:15:06 1591211706 祭 ० ' ⮪ 㣨' +00:40:58 1591213258 祭 ॣ '-2'(A) +00:58:02 1591214282 ⪫祭 ० ࠧ (A) +00:58:02 1591214282 祭 ⠭ ॣ +05:13:34 1591229614 祭 ० +05:13:35 1591229615 ⪫祭 ॣ '-2'(A) +05:13:36 1591229616 祭 ॣ '-2'(A) +07:05:33 1591236333 ⪫祭 ॣ '-2'(A) +08:00:29 1591239629 ⪫祭 ० (A) +08:00:32 1591239632 ⪫祭 ० ' ⮪ 㣨' +08:00:53 1591239653 祭 ० ᪠ +08:00:53 1591239653 祭 ० ᪠ +08:03:38 1591239818 ⪫祭 ० ᪠ (A) +15:38:00 1591267080 祭 ० ᪠ +15:38:00 1591267080 祭 ० ᪠ +15:38:01 1591267081 祭 ० ᪠ +15:38:01 1591267081 祭 ० ᪠ +15:40:45 1591267245 ⪫祭 ० ᪠ (A) +17:28:55 1591273735 祭 ॣ '-2'(A) +17:29:32 1591273772 ⪫祭 ॣ '-2'(A) +17:38:29 1591274309 祭 ० ࠧ +17:38:32 1591274312 祭 ० ' ⮪ 㣨' +17:55:27 1591275327 祭 ॣ '-2'(A) +18:13:17 1591276397 祭 ⠭ ॣ +18:13:17 1591276397 ⪫祭 ० ࠧ (A) +21:48:43 1591289323 祭 ० +21:48:44 1591289324 ⪫祭 ॣ '-2'(A) +21:48:45 1591289325 祭 ॣ '-2'(A) +22:57:44 1591293464 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.419 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.419 new file mode 100644 index 0000000..81326c1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.419 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.450 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.450 new file mode 100644 index 0000000..e360051 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.450 @@ -0,0 +1,5 @@ +03:35:53 1591223753 1 11416 2 BT 18, 20, 22, 23, 25 3 25 4 1 5 Ti 6 7 670 8 5280 9 5140 10 560 11 12 320252 +04:05:12 1591225512 0 A--32-106-2018 ॢ 2 +14:55:57 1591264557 1 11417 9 5160 +19:13:42 1591280022 1 11417 2 BT 18, 20, 22, 23, 25 3 25 4 1 5 Ti 6 7 670 8 5280 9 5160 10 560 11 12 320252 +19:42:59 1591281779 0 A--32-106-2018 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.451 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.451 new file mode 100644 index 0000000..6b18584 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.451 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.452 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.452 new file mode 100644 index 0000000..5eb1557 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.452 @@ -0,0 +1,138 @@ +22 23:45:15 00:00:20 +P1= 43.5 T1=23:55:20 P2= 61.2 T2=00:00:20 Vs= 3.54 + +22 00:10:10 00:25:14 +P1= 40.5 T1=00:20:14 P2= 56.6 T2=00:25:14 Vs= 3.20 + +22 00:36:28 00:51:33 +P1= 36.8 T1=00:46:33 P2= 52.2 T2=00:51:33 Vs= 3.07 + +22 01:00:44 01:15:49 +P1= 35.4 T1=01:10:49 P2= 50.3 T2=01:15:49 Vs= 2.96 + +20 02:27:20 02:27:29 +Riz_sol= 4857.3 + +21 02:27:45 02:27:48 +Rsk= 18.3 Rkk= 14.5 + +22 03:10:04 03:25:09 +P1= 37.9 T1=03:20:09 P2= 51.6 T2=03:25:09 Vs= 2.73 + +23 03:25:42 03:25:47 + + +24 03:25:59 03:26:36 + + +30 03:27:33 03:28:01 +Vst= 28.9 + +31 03:28:11 03:28:44 +Rom_sol= 6.4 + +41 03:30:31 03:30:36 +Ukz= 2.18 + +32 03:30:43 03:31:20 +Imax=10.9 Umax=50.1 T= 9.0 + +33 03:31:26 03:31:46 +Imin=15.8 Umin=24.9 T= 0.5 + +34 03:31:51 03:32:14 +V=300.0 T= 9.4 + +35 03:32:20 03:33:14 +Q= 53.1 T= 9.4 + +36 03:33:21 03:33:51 +P1=0.29 T= 2.9 + +37 03:33:56 03:34:27 +T= 0.9 + +38 03:34:34 03:34:40 +t= 51.6 T= 0.5 + +39 03:34:46 03:35:02 +tcam= 52.3 Tcam= 0.5 tfl= 55.0 Tfl= 0.5 + +40 03:35:07 03:35:14 +t= 51.6 T= 0.5 + +21 14:53:06 14:53:10 +Rsk= 18.3 Rkk= 14.6 + +22 15:35:01 15:50:06 +P1= 56.0 T1=15:45:06 P2= 75.4 T2=15:50:06 Vs= 3.88 + +22 16:10:01 16:25:06 +P1= 42.2 T1=16:20:06 P2= 57.5 T2=16:25:06 Vs= 3.05 + +22 16:34:52 16:49:56 +P1= 38.6 T1=16:44:56 P2= 52.2 T2=16:49:56 Vs= 2.72 + +20 18:22:50 18:22:59 +Riz_sol= 4856.1 + +21 18:23:20 18:23:23 +Rsk= 18.2 Rkk= 14.7 + +22 18:48:29 19:03:34 +P1= 49.4 T1=18:58:34 P2= 63.7 T2=19:03:34 Vs= 2.86 + +23 19:03:43 19:03:48 + + +23 19:03:57 19:04:03 + + +24 19:04:07 19:04:42 + + +30 19:04:55 19:05:51 +Vst= 28.8 + +31 19:05:56 19:06:35 +Rom_sol= 6.0 + +41 19:07:26 19:07:34 +Ukz= 3.07 + +41 19:07:37 19:07:42 +Ukz= 2.89 + +41 19:07:57 19:08:02 +Ukz= 2.25 + +32 19:08:06 19:08:41 +Imax=10.9 Umax=50.0 T= 9.0 + +32 19:08:46 19:09:21 +Imax=10.9 Umax=50.0 T= 9.0 + +33 19:09:25 19:09:52 +Imin=15.8 Umin=25.0 T= 0.5 + +34 19:09:58 19:10:22 +V=300.2 T= 9.4 + +35 19:10:24 19:11:18 +Q= 53.3 T= 9.4 + +36 19:11:21 19:11:56 +P1=0.30 T= 2.9 + +37 19:11:58 19:12:29 +T= 0.9 + +38 19:12:32 19:12:39 +t= 51.5 T= 0.5 + +39 19:12:41 19:12:58 +tcam= 52.6 Tcam= 0.5 tfl= 52.4 Tfl= 0.5 + +40 19:13:00 19:13:08 +t= 51.7 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.453 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.453 new file mode 100644 index 0000000..bb9eb8c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.453 @@ -0,0 +1,19 @@ +5 01:16:46 1591215406 +6 01:25:03 1591215903 +7 02:10:53 1591218653 +8 02:21:26 1591219286 +25 03:27:29 1591223249 +9 03:35:53 1591223753 +10 04:05:12 1591225512 +12 08:05:06 1591239906 +13 11:05:26 1591250726 +0 11:05:26 1591250726 +2 14:52:55 1591264375 +5 16:50:51 1591271451 +6 17:00:33 1591272033 +7 17:39:55 1591274395 +8 18:16:07 1591276567 +25 19:04:51 1591279491 +9 19:13:42 1591280022 +10 19:43:00 1591281780 +12 23:43:11 1591296191 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.454 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.454 new file mode 100644 index 0000000..e4b54d9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.454 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.455 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.455 new file mode 100644 index 0000000..aae8fc3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.455 @@ -0,0 +1 @@ +47 19:08:41 1591279721 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.456 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.456 new file mode 100644 index 0000000..8ff6c63 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.456 @@ -0,0 +1,111 @@ +[86] +oper = 5 +begin = 04.06.2020 01:16:46 +norma = 25 +real = 8 + +[87] +oper = 6 +begin = 04.06.2020 01:25:03 +norma = 35 +real = 45 + +[88] +oper = 7 +begin = 04.06.2020 02:10:53 +norma = 30 +real = 10 + +[89] +oper = 8 +begin = 04.06.2020 02:21:26 +norma = 40 +vac_time = 8 +real = 66 + +[90] +oper = 25 +begin = 04.06.2020 03:27:29 +norma = 30 +real = 8 + +[91] +oper = 9 +begin = 04.06.2020 03:35:53 +norma = 0 +real = 29 + +[92] +oper = 10 +begin = 04.06.2020 04:05:12 +norma = 0 +real = 239 + +[93] +oper = 12 +begin = 04.06.2020 08:05:06 +norma = 105 +real = 180 + +[94] +oper = 13 +begin = 04.06.2020 11:05:26 +norma = 45 +real = 227 + +[95] +oper = 2 +begin = 04.06.2020 14:52:55 +norma = 110 +vac_time = 9 +real = 117 + +[96] +oper = 5 +begin = 04.06.2020 16:50:51 +norma = 25 +real = 9 + +[97] +oper = 6 +begin = 04.06.2020 17:00:33 +norma = 35 +real = 39 + +[98] +oper = 7 +begin = 04.06.2020 17:39:55 +norma = 30 +real = 36 + +[99] +oper = 8 +begin = 04.06.2020 18:16:07 +norma = 40 +vac_time = 9 +real = 48 + +[00] +oper = 25 +begin = 04.06.2020 19:04:51 +norma = 30 +real = 8 + +[01] +oper = 9 +begin = 04.06.2020 19:13:42 +norma = 0 +real = 29 + +[02] +oper = 10 +begin = 04.06.2020 19:43:00 +norma = 0 +real = 240 + +[03] +oper = 12 +begin = 04.06.2020 23:43:11 +norma = 105 +real = 217 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.457 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.457 new file mode 100644 index 0000000..71608f2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.457 @@ -0,0 +1,32 @@ +01:25:23 1591215923 祭 ० ᪠ +01:25:24 1591215924 祭 ० ᪠ +01:27:46 1591216066 ⪫祭 ० ᪠ (A) +03:26:02 1591223162 祭 ॣ '-2'(A) +03:26:37 1591223197 ⪫祭 ॣ '-2'(A) +03:35:28 1591223728 祭 ० ࠧ +03:35:30 1591223730 祭 ० ' ⮪ 㣨' +03:37:12 1591223832 祭 ॣ '-2'(A) +04:05:12 1591225512 祭 ⠭ ॣ +04:05:12 1591225512 ⪫祭 ० ࠧ (A) +07:57:54 1591239474 祭 ० +07:57:55 1591239475 ⪫祭 ॣ '-2'(A) +07:57:56 1591239476 祭 ॣ '-2'(A) +08:00:54 1591239654 ⪫祭 ० ' ⮪ 㣨' +08:05:10 1591239910 ⪫祭 ॣ '-2'(A) +08:07:26 1591240046 祭 ० ᪠ +08:09:48 1591240188 ⪫祭 ० ᪠ (A) +09:07:55 1591243675 ⪫祭 ० (A) +17:01:18 1591272078 祭 ० ᪠ +17:03:41 1591272221 ⪫祭 ० ᪠ (A) +19:04:08 1591279448 祭 ॣ '-2'(A) +19:04:43 1591279483 ⪫祭 ॣ '-2'(A) +19:13:20 1591280000 祭 ० ࠧ +19:13:20 1591280000 祭 ० ' ⮪ 㣨' +19:15:00 1591280100 祭 ॣ '-2'(A) +19:42:59 1591281779 祭 ⠭ ॣ +19:42:59 1591281779 ⪫祭 ० ࠧ (A) +23:36:58 1591295818 祭 ० +23:36:59 1591295819 ⪫祭 ॣ '-2'(A) +23:37:00 1591295820 祭 ॣ '-2'(A) +23:40:10 1591296010 ⪫祭 ० ' ⮪ 㣨' +23:43:15 1591296195 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200604.459 b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.459 new file mode 100644 index 0000000..f8bf558 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200604.459 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.050 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.050 new file mode 100644 index 0000000..55229ba --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.050 @@ -0,0 +1,3 @@ +17:17:17 1591359437 1 10112 2 BT 18, 20, 22, 23, 25 3 25 4 2 7 770 8 3300 9 5190 10 690 +20:57:23 1591372643 1 10112 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 3300 9 5190 10 690 11 12 321602 +21:40:02 1591375202 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.051 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.051 new file mode 100644 index 0000000..d5d6caa Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.051 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.052 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.052 new file mode 100644 index 0000000..706f244 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.052 @@ -0,0 +1,60 @@ +20 17:17:42 17:17:52 +Riz_sol= 6063.5 + +21 17:17:58 17:18:05 +Rsk= 22.6 Rkk= 17.1 + +20 18:36:54 18:37:04 +Riz_sol= 6749.3 + +21 18:37:08 18:37:16 +Rsk= 23.1 Rkk= 17.4 + +22 19:15:26 19:30:34 +P1=126.4 T1=19:25:34 P2=174.3 T2=19:30:34 Vs= 9.57 + +22 20:00:41 20:15:49 +P1= 55.5 T1=20:10:49 P2= 76.3 T2=20:15:49 Vs= 4.16 + +22 20:29:44 20:44:52 +P1= 40.5 T1=20:39:52 P2= 55.4 T2=20:44:52 Vs= 2.98 + +23 20:45:14 20:45:21 + + +24 20:45:57 20:46:32 + + +30 20:46:42 20:47:20 +Vst= 29.6 + +31 20:47:24 20:48:03 +Rom_sol= 13.1 + +32 20:48:49 20:49:55 +Imax=11.3 Umax=50.0 T= 9.4 + +33 20:50:01 20:50:32 +Imin=16.4 Umin=25.0 T= 0.8 + +34 20:50:39 20:51:08 +V=301.3 T= 9.6 + +35 20:51:16 20:53:03 +Q= 54.7 T= 9.2 + +36 20:53:10 20:53:59 +P1=0.30 T= 3.1 + +37 20:54:36 20:55:10 +T= 0.7 + +38 20:55:17 20:55:23 +t= 51.7 T= 0.5 + +39 20:55:34 20:55:49 +tcam= 51.3 Tcam= 0.5 tfl= 51.6 Tfl= 0.9 + +40 20:55:53 20:55:59 +t= 51.5 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.053 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.053 new file mode 100644 index 0000000..a796720 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.053 @@ -0,0 +1,8 @@ +13 03:00:38 1591308038 +0 03:00:38 1591308038 +8 17:12:33 1591359153 +13 18:18:52 1591363132 +8 18:34:00 1591364040 +25 20:46:40 1591372000 +9 20:57:23 1591372643 +10 21:40:03 1591375203 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.054 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.054 new file mode 100644 index 0000000..916d3a8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.054 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.055 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.055 new file mode 100644 index 0000000..1a93f7d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.055 @@ -0,0 +1,2 @@ +47 20:54:13 1591372453 +47 20:54:20 1591372460 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.056 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.056 new file mode 100644 index 0000000..17e8e54 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.056 @@ -0,0 +1,44 @@ +[17] +oper = 13 +begin = 05.06.2020 03:00:38 +norma = 45 +real = 851 + +[18] +oper = 8 +begin = 05.06.2020 17:12:33 +norma = 40 +vac_time = 9 +real = 66 + +[19] +oper = 13 +begin = 05.06.2020 18:18:52 +norma = 45 +real = 15 + +[20] +oper = 8 +begin = 05.06.2020 18:34:00 +norma = 40 +vac_time = 9 +real = 132 + +[21] +oper = 25 +begin = 05.06.2020 20:46:40 +norma = 30 +real = 10 + +[22] +oper = 9 +begin = 05.06.2020 20:57:23 +norma = 0 +real = 42 + +[23] +oper = 10 +begin = 05.06.2020 21:40:03 +norma = 0 +real = 264 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.057 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.057 new file mode 100644 index 0000000..6af17b3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.057 @@ -0,0 +1,9 @@ +20:45:36 1591371936 祭 ॣ '-2'(A) +20:45:39 1591371939 ⪫祭 ॣ '-2'(A) +20:45:59 1591371959 祭 ॣ '-2'(A) +20:46:33 1591371993 ⪫祭 ॣ '-2'(A) +20:56:16 1591372576 祭 ० ࠧ +20:56:20 1591372580 祭 ० ' ⮪ 㣨' +21:22:57 1591374177 祭 ॣ '-2'(A) +21:40:02 1591375202 ⪫祭 ० ࠧ (A) +21:40:03 1591375203 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.059 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.059 new file mode 100644 index 0000000..c6dac1b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.059 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.170 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.170 new file mode 100644 index 0000000..246b9c7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.170 @@ -0,0 +1,5 @@ +06:51:53 1591321913 1 09207 3 37 7 920 9 5250 10 840 +09:59:53 1591333193 1 09207 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 37 4 2 5 Ti 6 7 920 8 4360 9 5250 10 840 11 12 321173 +10:41:14 1591335674 0 A--32-034-2016 ॢ 2 +19:49:05 1591368545 3 14 +22:21:21 1591377681 1 09208 3 25 4 1 7 770 9 5800 10 650 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.171 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.171 new file mode 100644 index 0000000..2b917ad Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.171 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.172 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.172 new file mode 100644 index 0000000..feb5006 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.172 @@ -0,0 +1,69 @@ +21 06:50:11 06:50:19 +Rsk= 14.6 Rkk= 9.1 + +22 07:14:44 07:25:15 +P1= 18.7 T1=07:20:15 P2= 30.4 T2=07:25:15 Vs= 2.33 + +20 09:10:38 09:10:48 +Riz_sol=12712.8 + +21 09:10:54 09:11:02 +Rsk= 14.3 Rkk= 8.9 + +22 09:34:50 09:50:22 +P1= 39.1 T1=09:45:22 P2= 51.1 T2=09:50:22 Vs= 2.41 + +23 09:50:29 09:50:36 + + +24 09:50:42 09:51:18 + + +30 09:51:55 09:52:34 +Vst= 28.9 + +31 09:52:39 09:53:16 +Rom_sol= 12.9 + +41 09:53:56 09:54:01 +Ukz= 0.87 + +32 09:54:04 09:55:13 +Imax=27.3 Umax=54.9 T= 9.4 + +33 09:55:18 09:55:46 +Imin=16.0 Umin=25.2 T= 1.0 + +34 09:55:51 09:56:18 +V=301.2 T= 9.5 + +35 09:56:21 09:57:19 +Q= 54.8 T= 9.1 + +36 09:57:24 09:57:59 +P1=0.28 T= 3.0 + +37 09:58:05 09:58:41 +T= 0.7 + +38 09:58:45 09:58:51 +t= 51.5 T= 0.7 + +39 09:58:55 09:59:00 +t= 51.4 T= 0.7 + +40 09:59:04 09:59:10 +t= 51.5 T= 0.7 + +21 19:49:21 19:49:28 +Rsk= 14.3 Rkk= 8.8 + +22 20:04:48 20:15:19 +P1= 26.1 T1=20:10:19 P2= 45.9 T2=20:15:19 Vs= 3.96 + +21 22:19:53 22:20:00 +Rsk= 14.2 Rkk= 8.9 + +22 22:51:09 23:06:41 +P1= 43.7 T1=23:01:40 P2= 56.3 T2=23:06:41 Vs= 2.52 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.173 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.173 new file mode 100644 index 0000000..4b6913c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.173 @@ -0,0 +1,24 @@ +11 01:23:54 1591302234 +12 04:10:59 1591312259 +13 05:56:57 1591318617 +0 05:56:57 1591318617 +2 06:44:34 1591321474 +5 07:25:50 1591323950 +6 07:39:09 1591324749 +7 08:12:19 1591326739 +8 09:07:10 1591330030 +25 09:51:51 1591332711 +9 09:59:53 1591333193 +10 10:41:14 1591335674 +11 12:59:18 1591343958 +12 17:09:51 1591358991 +13 19:14:47 1591366487 +0 19:14:47 1591366487 +14 19:46:37 1591368397 +15 20:18:04 1591370284 +16 20:49:34 1591372174 +1 21:31:24 1591374684 +13 22:14:22 1591377262 +2 22:18:30 1591377510 +5 23:07:42 1591380462 +6 23:19:09 1591381149 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.174 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.174 new file mode 100644 index 0000000..5e6b5d0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.174 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.176 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.176 new file mode 100644 index 0000000..7a088c6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.176 @@ -0,0 +1,136 @@ +[92] +oper = 11 +begin = 05.06.2020 01:23:54 +norma = 0 +real = 167 + +[93] +oper = 12 +begin = 05.06.2020 04:10:59 +norma = 105 +real = 105 + +[94] +oper = 13 +begin = 05.06.2020 05:56:57 +norma = 45 +real = 47 + +[95] +oper = 2 +begin = 05.06.2020 06:44:34 +norma = 110 +vac_time = 8 +real = 41 + +[96] +oper = 5 +begin = 05.06.2020 07:25:50 +norma = 25 +real = 13 + +[97] +oper = 6 +begin = 05.06.2020 07:39:09 +norma = 35 +real = 33 + +[98] +oper = 7 +begin = 05.06.2020 08:12:19 +norma = 30 +real = 54 + +[99] +oper = 8 +begin = 05.06.2020 09:07:10 +norma = 40 +vac_time = 8 +real = 44 + +[00] +oper = 25 +begin = 05.06.2020 09:51:51 +norma = 30 +real = 8 + +[01] +oper = 9 +begin = 05.06.2020 09:59:53 +norma = 0 +real = 41 + +[02] +oper = 10 +begin = 05.06.2020 10:41:14 +norma = 0 +real = 138 + +[03] +oper = 11 +begin = 05.06.2020 12:59:18 +norma = 0 +real = 250 + +[04] +oper = 12 +begin = 05.06.2020 17:09:51 +norma = 105 +real = 124 + +[05] +oper = 13 +begin = 05.06.2020 19:14:47 +norma = 45 +real = 31 + +[06] +oper = 14 +begin = 05.06.2020 19:46:37 +norma = 40 +vac_time = 7 +real = 31 + +[07] +oper = 15 +begin = 05.06.2020 20:18:04 +norma = 30 +real = 31 + +[08] +oper = 16 +begin = 05.06.2020 20:49:34 +norma = 40 +real = 41 + +[09] +oper = 1 +begin = 05.06.2020 21:31:24 +norma = 85 +real = 42 + +[10] +oper = 13 +begin = 05.06.2020 22:14:22 +norma = 45 +real = 4 + +[11] +oper = 2 +begin = 05.06.2020 22:18:30 +norma = 110 +vac_time = 7 +real = 49 + +[12] +oper = 5 +begin = 05.06.2020 23:07:42 +norma = 25 +real = 11 + +[13] +oper = 6 +begin = 05.06.2020 23:19:09 +norma = 35 +real = 45 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.177 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.177 new file mode 100644 index 0000000..55a16ae --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.177 @@ -0,0 +1,48 @@ +01:23:53 1591302233 祭 ० +01:23:54 1591302234 ⪫祭 ॣ '-2'(A) +01:23:55 1591302235 祭 ॣ '-2'(A) +04:10:50 1591312250 ⪫祭 ० (A) +04:11:00 1591312260 ⪫祭 ० ' ⮪ 㣨' +04:11:02 1591312262 ⪫祭 ॣ '-2'(A) +04:11:36 1591312296 祭 ० ᪠ +04:11:36 1591312296 祭 ० ᪠ +04:11:37 1591312297 祭 ० ᪠ +04:11:43 1591312303 ⪫祭 ० ᪠ +04:12:27 1591312347 祭 ० ᪠ +04:15:01 1591312501 ⪫祭 ० ᪠ (A) +07:39:19 1591324759 祭 ० ᪠ +07:39:19 1591324759 祭 ० ᪠ +07:39:19 1591324759 祭 ० ᪠ +07:42:14 1591324934 ⪫祭 ० ᪠ (A) +09:50:44 1591332644 祭 ॣ '-2'(A) +09:51:19 1591332679 ⪫祭 ॣ '-2'(A) +09:59:20 1591333160 祭 ० ࠧ +09:59:22 1591333162 祭 ० ' ⮪ 㣨' +10:21:15 1591334475 祭 ॣ '-2'(A) +10:41:14 1591335674 祭 ⠭ ॣ +10:41:14 1591335674 ⪫祭 ० ࠧ (A) +12:59:18 1591343958 祭 ० +12:59:18 1591343958 ⪫祭 ॣ '-2'(A) +12:59:20 1591343960 祭 ॣ '-2'(A) +13:59:19 1591347559 ⪫祭 ॣ '-2'(A) +17:09:31 1591358971 ⪫祭 ० (A) +17:10:37 1591359037 ⪫祭 ० ' ⮪ 㣨' +17:15:47 1591359347 祭 ० ᪠ +17:18:01 1591359481 ⪫祭 ० ᪠ (A) +20:16:12 1591370172 祭 ० ࠧ +20:16:56 1591370216 祭 ० ' ⮪ 㣨' +20:16:57 1591370217 祭 ॣ '-2'(A) +20:17:06 1591370226 ⪫祭 ० ࠧ +20:17:09 1591370229 祭 ० ࠧ +20:17:10 1591370230 ⪫祭 ॣ '-2'(A) +20:19:29 1591370369 祭 ॣ '-2'(A) +20:33:45 1591371225 ⪫祭 ० ' ⮪ 㣨' +20:36:06 1591371366 ⪫祭 ० ࠧ (A) +20:49:38 1591372178 ⪫祭 ॣ '-2'(A) +20:50:30 1591372230 祭 ० ᪠ +20:52:16 1591372336 ⪫祭 ० ᪠ +20:52:24 1591372344 祭 ० ᪠ +20:52:37 1591372357 ⪫祭 ० ᪠ +23:19:29 1591381169 祭 ० ᪠ +23:19:30 1591381170 祭 ० ᪠ +23:22:04 1591381324 ⪫祭 ० ᪠ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.179 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.179 new file mode 100644 index 0000000..7222886 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.179 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.270 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.270 new file mode 100644 index 0000000..ec75b87 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.270 @@ -0,0 +1,3 @@ +13:23:17 1591345397 1 12102 7 870 9 5890 10 770 11 12 321547 +17:58:57 1591361937 1 12102 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 870 8 2020 9 5890 10 770 11 12 321547 +18:29:47 1591363787 0 A--32-078-2017 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.271 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.271 new file mode 100644 index 0000000..8783241 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.271 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.272 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.272 new file mode 100644 index 0000000..a4ea287 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.272 @@ -0,0 +1,63 @@ +21 13:23:31 13:23:34 +Rsk= 15.6 Rkk= 12.9 + +22 13:59:43 14:15:02 +P1= 35.3 T1=14:10:02 P2= 45.6 T2=14:15:02 Vs= 2.05 + +20 17:06:17 17:06:26 +Riz_sol= 1703.2 + +21 17:07:06 17:07:09 +Rsk= 16.4 Rkk= 13.8 + +22 17:35:08 17:50:27 +P1= 33.9 T1=17:45:27 P2= 45.2 T2=17:50:27 Vs= 2.27 + +23 17:50:32 17:50:37 + + +24 17:50:44 17:51:20 + + +30 17:51:28 17:51:54 +Vst= 27.8 + +31 17:51:58 17:52:54 +Rom_sol= 16.6 + +41 17:53:33 17:53:38 +Ukz= 0.99 + +32 17:53:44 17:54:18 +Imax=11.4 Umax=50.0 T= 9.0 + +33 17:54:21 17:54:29 +Imin=15.0 Umin=24.1 T= 1.6 + +33 17:54:38 17:54:42 +Imin=11.7 Umin=11.5 T= 1.6 + +33 17:54:55 17:55:13 +Imin=16.3 Umin=25.0 T= 0.5 + +34 05:00:00 17:55:38 +V=300.1 T= 9.7 + +35 17:55:41 17:56:35 +Q= 54.8 T= 9.7 + +36 17:56:38 17:57:07 +P1=0.29 T= 3.2 + +37 17:57:10 17:57:36 +T= 1.2 + +38 17:57:40 17:57:45 +t= 57.3 T= 0.8 + +39 17:57:47 17:58:02 +tcam= 54.8 Tcam= 0.8 tfl= 61.4 Tfl= 0.8 + +40 17:58:04 17:58:10 +t= 61.8 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.273 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.273 new file mode 100644 index 0000000..ceff954 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.273 @@ -0,0 +1,13 @@ +11 02:15:08 1591305308 +12 05:02:08 1591315328 +13 06:54:01 1591322041 +0 06:54:07 1591322047 +2 13:13:52 1591344832 +5 14:16:41 1591348601 +6 14:29:39 1591349379 +7 15:08:43 1591351723 +8 16:59:21 1591358361 +25 17:51:25 1591361485 +9 17:58:57 1591361937 +10 18:29:48 1591363788 +11 23:57:44 1591383464 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.274 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.274 new file mode 100644 index 0000000..02d15e4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.274 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.275 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.275 new file mode 100644 index 0000000..0294695 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.275 @@ -0,0 +1,3 @@ +55 17:54:30 1591361670 +55 17:54:43 1591361683 +47 17:54:49 1591361689 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.276 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.276 new file mode 100644 index 0000000..182923f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.276 @@ -0,0 +1,74 @@ +[86] +oper = 11 +begin = 05.06.2020 02:15:08 +norma = 0 +real = 167 + +[87] +oper = 12 +begin = 05.06.2020 05:02:08 +norma = 105 +real = 111 + +[88] +oper = 13 +begin = 05.06.2020 06:54:01 +norma = 45 +real = 379 + +[89] +oper = 2 +begin = 05.06.2020 13:13:52 +norma = 110 +vac_time = 8 +real = 62 + +[90] +oper = 5 +begin = 05.06.2020 14:16:41 +norma = 25 +real = 12 + +[91] +oper = 6 +begin = 05.06.2020 14:29:39 +norma = 35 +real = 39 + +[92] +oper = 7 +begin = 05.06.2020 15:08:43 +norma = 30 +real = 110 + +[93] +oper = 8 +begin = 05.06.2020 16:59:21 +norma = 40 +vac_time = 8 +real = 52 + +[94] +oper = 25 +begin = 05.06.2020 17:51:25 +norma = 30 +real = 7 + +[95] +oper = 9 +begin = 05.06.2020 17:58:57 +norma = 0 +real = 30 + +[96] +oper = 10 +begin = 05.06.2020 18:29:48 +norma = 0 +real = 327 + +[97] +oper = 11 +begin = 05.06.2020 23:57:44 +norma = 0 +real = 211 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.277 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.277 new file mode 100644 index 0000000..a2a8570 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.277 @@ -0,0 +1,26 @@ +02:15:08 1591305308 祭 ० +02:15:08 1591305308 ⪫祭 ॣ '-2'(A) +02:15:09 1591305309 祭 ॣ '-2'(A) +04:07:08 1591312028 ⪫祭 ॣ '-2'(A) +05:02:05 1591315325 ⪫祭 ० (A) +05:02:09 1591315329 ⪫祭 ० ' ⮪ 㣨' +05:03:10 1591315390 祭 ० ᪠ +05:03:10 1591315390 祭 ० ᪠ +05:05:48 1591315548 ⪫祭 ० ᪠ (A) +13:23:23 1591345403 : 㦥 +14:30:11 1591349411 祭 ० ᪠ +14:32:29 1591349549 ⪫祭 ० ᪠ (A) +17:50:46 1591361446 祭 ॣ '-2'(A) +17:51:21 1591361481 ⪫祭 ॣ '-2'(A) +17:51:54 1591361514 祭 +17:51:54 1591361514 祭 +17:52:54 1591361574 ⪫祭 +17:58:18 1591361898 祭 ० ࠧ +17:58:19 1591361899 祭 ० ' ⮪ 㣨' +17:58:58 1591361938 : 믮 +18:15:17 1591362917 祭 ॣ '-2'(A) +18:29:47 1591363787 祭 ॣ . 殮 㣨 +18:29:47 1591363787 ⪫祭 ० ࠧ (A) +23:57:44 1591383464 祭 ० +23:57:45 1591383465 ⪫祭 ॣ '-2'(A) +23:57:46 1591383466 祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.279 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.279 new file mode 100644 index 0000000..57ea51e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.279 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.330 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.330 new file mode 100644 index 0000000..89349f9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.330 @@ -0,0 +1,3 @@ +13:39:42 1591346382 1 11159 2 BT 3-1, 6, 8, 9, 14, 15, 16 7 870 9 5880 10 770 11 12 321672 +18:11:44 1591362704 1 11159 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 870 8 5020 9 5880 10 770 11 12 321672 +18:43:07 1591364587 0 A--32-078-2017 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.331 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.331 new file mode 100644 index 0000000..2e7e3a8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.331 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.332 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.332 new file mode 100644 index 0000000..2eaac2c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.332 @@ -0,0 +1,60 @@ +21 13:40:11 13:40:19 +Rsk= 19.9 Rkk= 14.6 + +22 14:08:56 14:24:32 +P1= 46.0 T1=14:19:32 P2= 62.1 T2=14:24:32 Vs= 3.22 + +22 14:40:31 14:56:06 +P1= 32.1 T1=14:51:06 P2= 44.9 T2=14:56:06 Vs= 2.55 + +20 17:17:28 17:17:38 +Riz_sol= 2981.2 + +21 17:17:43 17:17:51 +Rsk= 20.0 Rkk= 14.5 + +22 17:44:25 18:00:01 +P1= 40.2 T1=17:55:01 P2= 54.6 T2=18:00:01 Vs= 2.89 + +23 18:00:21 18:00:27 + + +24 18:01:20 18:01:57 + + +30 18:02:19 18:03:00 +Vst= 28.4 + +31 18:03:41 18:04:42 +Rom_sol= 15.6 + +41 18:05:19 18:05:24 +Ukz= 1.03 + +32 18:05:28 18:06:37 +Imax=11.0 Umax=50.0 T= 9.4 + +33 18:06:43 18:07:20 +Imin=16.1 Umin=25.1 T= 0.8 + +34 18:07:23 18:07:51 +V=301.0 T= 9.8 + +35 18:07:53 18:08:46 +Q= 55.0 T= 9.1 + +36 18:08:50 18:09:23 +P1=0.27 T= 3.1 + +37 18:09:26 18:10:08 +T= 0.7 + +38 18:10:12 18:10:21 +t= 52.1 T= 0.7 + +39 18:10:23 18:10:30 +t= 52.4 T= 0.5 + +40 18:10:33 18:10:44 +t= 52.0 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.333 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.333 new file mode 100644 index 0000000..b22d4d2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.333 @@ -0,0 +1,12 @@ +11 03:20:05 1591309205 +12 06:07:07 1591319227 +13 08:05:39 1591326339 +0 08:05:39 1591326339 +2 13:35:04 1591346104 +5 14:57:00 1591351020 +6 15:09:06 1591351746 +7 15:55:41 1591354541 +8 17:13:49 1591359229 +25 18:02:14 1591362134 +9 18:11:44 1591362704 +10 18:43:07 1591364587 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.334 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.334 new file mode 100644 index 0000000..362d1c8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.334 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.336 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.336 new file mode 100644 index 0000000..fb463d3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.336 @@ -0,0 +1,68 @@ +[36] +oper = 11 +begin = 05.06.2020 03:20:05 +norma = 0 +real = 167 + +[37] +oper = 12 +begin = 05.06.2020 06:07:07 +norma = 105 +real = 118 + +[38] +oper = 13 +begin = 05.06.2020 08:05:39 +norma = 45 +real = 329 + +[39] +oper = 2 +begin = 05.06.2020 13:35:04 +norma = 110 +vac_time = 8 +real = 81 + +[40] +oper = 5 +begin = 05.06.2020 14:57:00 +norma = 25 +real = 12 + +[41] +oper = 6 +begin = 05.06.2020 15:09:06 +norma = 35 +real = 46 + +[42] +oper = 7 +begin = 05.06.2020 15:55:41 +norma = 30 +real = 78 + +[43] +oper = 8 +begin = 05.06.2020 17:13:49 +norma = 40 +vac_time = 8 +real = 48 + +[44] +oper = 25 +begin = 05.06.2020 18:02:14 +norma = 30 +real = 9 + +[45] +oper = 9 +begin = 05.06.2020 18:11:44 +norma = 0 +real = 31 + +[46] +oper = 10 +begin = 05.06.2020 18:43:07 +norma = 0 +real = 334 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.337 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.337 new file mode 100644 index 0000000..135db21 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.337 @@ -0,0 +1,33 @@ +03:20:04 1591309204 祭 ० +03:20:05 1591309205 ⪫祭 ॣ '-2'(A) +03:20:06 1591309206 祭 ॣ '-2'(A) +06:07:01 1591319221 ⪫祭 ० (A) +06:07:09 1591319229 ⪫祭 ० ' ⮪ 㣨' +06:07:12 1591319232 ⪫祭 ॣ '-2'(A) +06:07:48 1591319268 祭 ० ᪠ +06:07:48 1591319268 祭 ० ᪠ +06:07:48 1591319268 祭 ० ᪠ +06:07:49 1591319269 祭 ० ᪠ +06:07:49 1591319269 祭 ० ᪠ +06:07:49 1591319269 祭 ० ᪠ +06:09:38 1591319378 ⪫祭 ० ᪠ +06:09:43 1591319383 祭 ० ᪠ +06:09:44 1591319384 祭 ० ᪠ +06:11:02 1591319462 ⪫祭 ० ᪠ (A) +13:39:57 1591346397 : 㦥 +15:09:45 1591351785 祭 ० ᪠ +15:09:45 1591351785 祭 ० ᪠ +15:09:45 1591351785 祭 ० ᪠ +15:12:37 1591351957 ⪫祭 ० ᪠ (A) +18:01:22 1591362082 祭 ॣ '-2'(A) +18:01:58 1591362118 ⪫祭 ॣ '-2'(A) +18:03:38 1591362218 ' ' +18:03:38 1591362218 祭 +18:03:42 1591362222 祭 +18:04:42 1591362282 ⪫祭 +18:11:13 1591362673 祭 ० ࠧ +18:11:15 1591362675 祭 ० ' ⮪ 㣨' +18:11:44 1591362704 : 믮 +18:28:37 1591363717 祭 ॣ '-2'(A) +18:43:07 1591364587 祭 ॣ . 殮 㣨 +18:43:07 1591364587 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.339 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.339 new file mode 100644 index 0000000..77abedd Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.339 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.350 new file mode 100644 index 0000000..353b7c9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.350 @@ -0,0 +1,4 @@ +12:13:46 1591341226 1 09528 9 4710 +13:20:09 1591345209 1 09528 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4910 9 4710 10 690 11 12 321692 +14:02:49 1591347769 0 A--32-031-2016 ॢ 5 +23:22:29 1591381349 1 09529 4 1 9 5060 10 650 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.351 new file mode 100644 index 0000000..3bdfd4c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.352 new file mode 100644 index 0000000..deba26c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.352 @@ -0,0 +1,57 @@ +20 12:12:14 12:12:22 +Riz_sol= 5130.6 + +21 12:12:49 12:12:52 +Rsk= 19.3 Rkk= 16.6 + +22 12:54:17 13:09:48 +P1= 35.2 T1=13:04:48 P2= 46.9 T2=13:09:48 Vs= 2.34 + +23 13:10:00 13:10:05 + + +24 13:10:13 13:10:46 + + +24 13:11:05 13:11:43 + + +30 13:12:15 13:12:48 +Vst= 28.2 + +31 13:12:54 13:13:28 +Rom_sol= 13.5 + +32 13:14:08 13:14:43 +Imax=11.3 Umax=50.1 T= 9.0 + +33 13:14:46 13:15:13 +Imin=16.3 Umin=25.0 T= 1.6 + +33 13:15:18 13:15:50 +Imin=16.2 Umin=25.0 T= 0.5 + +34 13:15:53 13:16:20 +V=300.3 T= 9.5 + +35 13:16:23 13:17:26 +Q= 53.9 T= 9.5 + +36 13:17:30 13:18:08 +P1=0.29 T= 3.0 + +37 13:18:12 13:18:40 +T= 1.0 + +38 13:18:44 13:18:53 +t= 53.8 T= 0.8 + +39 13:18:59 13:19:20 +tcam= 55.5 Tcam= 0.8 tfl= 54.4 Tfl= 0.8 + +40 13:19:23 13:19:33 +t= 53.0 T= 0.8 + +21 23:21:26 23:21:29 +Rsk= 17.2 Rkk= 14.4 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.353 new file mode 100644 index 0000000..339d2c6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.353 @@ -0,0 +1,13 @@ +11 03:45:37 1591310737 +12 06:32:34 1591320754 +13 08:29:04 1591327744 +0 08:29:04 1591327744 +8 12:09:57 1591340997 +25 13:12:13 1591344733 +9 13:20:09 1591345209 +10 14:02:49 1591347769 +11 17:51:57 1591361517 +12 20:38:58 1591371538 +13 22:28:50 1591378130 +0 22:28:50 1591378130 +2 23:18:00 1591381080 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.354 new file mode 100644 index 0000000..ffe89ad Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.355 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.355 new file mode 100644 index 0000000..0e79ffd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.355 @@ -0,0 +1,2 @@ +29 13:10:46 1591344646 +55 13:15:13 1591344913 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.356 new file mode 100644 index 0000000..55354bb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.356 @@ -0,0 +1,68 @@ +[23] +oper = 11 +begin = 05.06.2020 03:45:37 +norma = 0 +real = 166 + +[24] +oper = 12 +begin = 05.06.2020 06:32:34 +norma = 105 +real = 116 + +[25] +oper = 13 +begin = 05.06.2020 08:29:04 +norma = 45 +real = 220 + +[26] +oper = 8 +begin = 05.06.2020 12:09:57 +norma = 40 +vac_time = 10 +real = 62 + +[27] +oper = 25 +begin = 05.06.2020 13:12:13 +norma = 30 +real = 7 + +[28] +oper = 9 +begin = 05.06.2020 13:20:09 +norma = 0 +real = 42 + +[29] +oper = 10 +begin = 05.06.2020 14:02:49 +norma = 0 +real = 229 + +[30] +oper = 11 +begin = 05.06.2020 17:51:57 +norma = 0 +real = 167 + +[31] +oper = 12 +begin = 05.06.2020 20:38:58 +norma = 105 +real = 109 + +[32] +oper = 13 +begin = 05.06.2020 22:28:50 +norma = 45 +real = 49 + +[33] +oper = 2 +begin = 05.06.2020 23:18:00 +norma = 110 +vac_time = 8 +real = 58 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.357 new file mode 100644 index 0000000..4e5df2a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.357 @@ -0,0 +1,34 @@ +03:45:36 1591310736 祭 ० +03:45:36 1591310736 ⪫祭 ॣ '-2'(A) +03:45:37 1591310737 祭 ॣ '-2'(A) +05:37:37 1591317457 ⪫祭 ॣ '-2'(A) +06:32:33 1591320753 ⪫祭 ० (A) +06:32:35 1591320755 ⪫祭 ० ' ⮪ 㣨' +06:33:07 1591320787 祭 ० ᪠ +06:33:08 1591320788 祭 ० ᪠ +06:33:08 1591320788 祭 ० ᪠ +06:36:53 1591321013 ⪫祭 ० ᪠ (A) +13:10:15 1591344615 祭 ॣ '-2'(A) +13:10:47 1591344647 ⪫祭 ॣ '-2'(A) +13:11:06 1591344666 祭 ॣ '-2'(A) +13:11:44 1591344704 ⪫祭 ॣ '-2'(A) +13:19:42 1591345182 祭 ० ࠧ +13:19:45 1591345185 祭 ० ' ⮪ 㣨' +13:45:44 1591346744 祭 ॣ '-2'(A) +14:02:49 1591347769 祭 ⠭ ॣ +14:02:49 1591347769 ⪫祭 ० ࠧ (A) +17:51:57 1591361517 祭 ० +17:51:58 1591361518 ⪫祭 ॣ '-2'(A) +17:51:59 1591361519 祭 ॣ '-2'(A) +19:43:58 1591368238 ⪫祭 ॣ '-2'(A) +20:38:54 1591371534 ⪫祭 ० (A) +20:38:56 1591371536 ⪫祭 ० ' ⮪ 㣨' +20:39:27 1591371567 祭 ० ᪠ +20:39:27 1591371567 祭 ० ᪠ +20:39:28 1591371568 祭 ० ᪠ +20:41:45 1591371705 ⪫祭 ० ᪠ +20:41:46 1591371706 祭 ० ᪠ +20:41:49 1591371709 . ⪫祭 ० ᪠ (A) +20:45:51 1591371951 祭 ० ᪠ +20:45:51 1591371951 祭 ० ᪠ +20:47:44 1591372064 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.359 new file mode 100644 index 0000000..1869d56 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.410 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.410 new file mode 100644 index 0000000..d1d1d55 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.410 @@ -0,0 +1,6 @@ +03:03:44 1591308224 3 14 +10:55:38 1591336538 1 11410 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 9 4620 10 690 +12:34:37 1591342477 1 11410 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3000 9 4620 10 690 11 12 320839 +14:58:16 1591351096 1 11411 +15:45:16 1591353916 1 11411 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3000 9 4620 10 690 11 12 320839 +16:27:48 1591356468 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.411 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.411 new file mode 100644 index 0000000..642b1d2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.411 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.412 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.412 new file mode 100644 index 0000000..6a4c54c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.412 @@ -0,0 +1,210 @@ +21 03:03:53 03:03:56 +Rsk= 7.6 Rkk= 4.6 + +21 03:04:04 03:04:07 +Rsk= 7.6 Rkk= 4.6 + +21 03:04:14 03:04:17 +Rsk= 7.6 Rkk= 4.6 + +21 03:04:43 03:04:46 +Rsk= 7.6 Rkk= 4.7 + +21 03:04:50 03:04:53 +Rsk= 7.6 Rkk= 4.7 + +21 03:06:22 03:06:25 +Rsk= 7.6 Rkk= 4.6 + +21 03:08:21 03:08:24 +Rsk= 7.6 Rkk= 4.6 + +21 03:08:42 03:08:45 +Rsk= 7.6 Rkk= 4.6 + +21 03:09:21 03:09:24 +Rsk= 4.6 Rkk= 4.6 + +21 03:09:30 03:09:33 +Rsk= 4.6 Rkk= 4.6 + +21 03:09:41 03:09:44 +Rsk= 7.6 Rkk= 4.7 + +21 03:15:01 03:15:04 +Rsk= 7.6 Rkk= 4.6 + +21 03:15:41 03:15:44 +Rsk= 4.6 Rkk= 4.6 + +21 03:15:57 03:16:00 +Rsk= 7.6 Rkk= 4.6 + +21 03:16:34 03:16:37 +Rsk= 7.6 Rkk= 4.6 + +21 03:17:04 03:17:07 +Rsk= 7.5 Rkk= 4.6 + +21 03:17:09 03:17:12 +Rsk= 7.6 Rkk= 4.6 + +21 03:20:56 03:21:00 +Rsk= 4.6 Rkk= 4.6 + +21 03:21:04 03:21:07 +Rsk= 4.6 Rkk= 4.6 + +21 03:22:56 03:22:59 +Rsk= 4.0 Rkk= 4.1 + +21 03:23:11 03:23:14 +Rsk= 6.1 Rkk= 4.0 + +21 03:24:25 03:24:28 +Rsk= 6.1 Rkk= 4.0 + +21 03:24:49 03:24:52 +Rsk= 7.0 Rkk= 4.0 + +21 03:26:57 03:27:00 +Rsk= 7.5 Rkk= 4.6 + +21 03:27:20 03:27:23 +Rsk=4758.7 Rkk=4758.7 + +21 03:27:46 03:27:49 +Rsk= 0.0 Rkk= 2.9 + +21 03:28:09 03:28:12 +Rsk=4758.7 Rkk=4758.7 + +21 03:29:45 03:29:48 +Rsk= 6.9 Rkk= 4.0 + +21 03:30:43 03:30:47 +Rsk= 6.1 Rkk= 4.0 + +21 03:31:12 03:31:15 +Rsk= 32.2 Rkk=4759.1 + +21 03:31:43 03:31:46 +Rsk=4758.5 Rkk= 32.2 + +21 03:32:29 03:32:32 +Rsk= 35.1 Rkk= 32.2 + +22 03:35:01 03:45:08 +P1= 41.6 T1=03:40:08 P2= 63.0 T2=03:45:08 Vs= 4.27 + +21 06:07:38 06:07:41 +Rsk= 8.6 Rkk= 5.7 + +20 10:55:56 10:56:04 +Riz_sol= 4759.0 + +21 10:56:11 10:56:14 +Rsk= 8.1 Rkk= 5.1 + +22 11:13:23 11:28:31 +P1=119.3 T1=11:23:31 P2=146.7 T2=11:28:31 Vs= 5.48 + +22 11:43:22 11:58:29 +P1= 72.3 T1=11:53:29 P2= 89.6 T2=11:58:29 Vs= 3.46 + +22 12:09:54 12:25:01 +P1= 65.6 T1=12:20:01 P2= 79.6 T2=12:25:01 Vs= 2.81 + +23 12:25:21 05:00:00 + + +24 12:25:49 12:26:23 + + +30 12:26:35 12:26:59 +Vst= 31.4 + +31 12:27:03 12:27:37 +Rom_sol= 9.5 + +32 12:28:31 12:29:07 +Imax=11.0 Umax=50.0 T= 9.0 + +33 12:29:12 12:29:31 +Imin=16.0 Umin=25.0 T= 0.5 + +34 12:29:35 12:29:58 +V=300.3 T= 9.4 + +35 12:30:02 12:31:33 +Q= 54.9 T=12.4 + +36 12:31:39 12:32:13 +P1=0.28 T= 3.0 + +37 12:32:45 12:33:08 +T= 0.9 + +38 12:33:12 12:33:23 +t= 51.8 T= 0.6 + +39 12:33:29 12:33:43 +tcam= 54.1 Tcam= 0.5 tfl= 54.5 Tfl= 0.6 + +40 12:33:47 12:33:54 +t= 51.8 T= 0.5 + +20 14:42:15 14:42:24 +Riz_sol= 4758.5 + +21 14:42:30 14:42:33 +Rsk= 7.7 Rkk= 4.8 + +21 14:42:37 14:42:40 +Rsk= 7.7 Rkk= 4.8 + +21 14:54:47 14:54:50 +Rsk= 8.0 Rkk= 5.1 + +22 15:20:38 15:35:45 +P1= 59.8 T1=15:30:45 P2= 73.5 T2=15:35:45 Vs= 2.75 + +23 15:36:14 15:36:20 + + +24 15:36:26 15:37:01 + + +30 15:37:14 15:37:38 +Vst= 31.6 + +31 15:37:43 15:38:16 +Rom_sol= 9.5 + +32 15:39:48 15:40:25 +Imax=11.0 Umax=50.0 T= 9.0 + +33 15:40:28 15:40:47 +Imin=16.0 Umin=25.0 T= 0.5 + +34 15:40:50 15:41:14 +V=300.3 T= 9.4 + +35 15:41:17 15:42:23 +Q= 53.6 T= 9.5 + +36 15:42:29 15:43:05 +P1=0.29 T= 3.0 + +37 15:43:30 15:43:53 +T= 1.0 + +38 15:43:56 15:44:03 +t= 51.8 T= 0.6 + +39 15:44:07 15:44:21 +tcam= 52.2 Tcam= 0.6 tfl= 54.7 Tfl= 0.5 + +40 15:44:25 15:44:32 +t= 51.9 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.413 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.413 new file mode 100644 index 0000000..d1a0206 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.413 @@ -0,0 +1,19 @@ +12 00:30:43 1591299043 +13 02:20:15 1591305615 +0 02:20:15 1591305615 +14 03:03:11 1591308191 +15 03:47:06 1591310826 +16 04:12:45 1591312365 +1 04:56:38 1591314998 +8 10:50:02 1591336202 +25 12:26:34 1591341994 +9 12:34:37 1591342477 +8 13:00:33 1591344033 +13 13:51:54 1591347114 +8 14:38:23 1591349903 +00 15:09:19 1591351759 +25 15:37:13 1591353433 +9 15:45:16 1591353916 +10 16:27:48 1591356468 +11 20:10:05 1591369805 +12 22:57:09 1591379829 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.414 new file mode 100644 index 0000000..127f16e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.415 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.415 new file mode 100644 index 0000000..23bc946 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.415 @@ -0,0 +1,22 @@ +3 03:04:38 1591308278 +4 03:13:27 1591308807 +4 03:13:33 1591308813 +4 03:13:44 1591308824 +4 03:13:48 1591308828 +4 03:13:52 1591308832 +4 03:13:58 1591308838 +4 03:14:03 1591308843 +4 03:14:08 1591308848 +4 03:14:12 1591308852 +4 03:14:36 1591308876 +3 03:14:43 1591308883 +4 03:14:48 1591308888 +4 03:14:53 1591308893 +4 03:14:56 1591308896 +3 03:20:44 1591309244 +4 03:20:48 1591309248 +4 03:20:50 1591309250 +4 03:20:51 1591309251 +4 03:20:53 1591309253 +4 03:20:56 1591309256 +47 12:32:29 1591342349 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.416 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.416 new file mode 100644 index 0000000..4dadf61 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.416 @@ -0,0 +1,106 @@ +[71] +oper = 12 +begin = 05.06.2020 00:30:43 +norma = 105 +real = 109 + +[72] +oper = 13 +begin = 05.06.2020 02:20:15 +norma = 45 +real = 42 + +[73] +oper = 14 +begin = 05.06.2020 03:03:11 +norma = 40 +vac_time = 10 +vac_avg10 = 9.9 +real = 43 + +[74] +oper = 15 +begin = 05.06.2020 03:47:06 +norma = 30 +real = 25 + +[75] +oper = 16 +begin = 05.06.2020 04:12:45 +norma = 40 +real = 43 + +[76] +oper = 1 +begin = 05.06.2020 04:56:38 +norma = 85 +real = 353 + +[77] +oper = 8 +begin = 05.06.2020 10:50:02 +norma = 40 +vac_time = 12 +real = 96 + +[78] +oper = 25 +begin = 05.06.2020 12:26:34 +norma = 30 +real = 8 + +[79] +oper = 9 +begin = 05.06.2020 12:34:37 +norma = 0 +real = 25 + +[80] +oper = 8 +begin = 05.06.2020 13:00:33 +norma = 40 +real = 51 + +[81] +oper = 13 +begin = 05.06.2020 13:51:54 +norma = 45 +real = 46 + +[82] +oper = 8 +begin = 05.06.2020 14:38:23 +norma = 40 +vac_time = 11 +real = 58 + +[83] +oper = 25 +begin = 05.06.2020 15:37:13 +norma = 30 +real = 8 + +[84] +oper = 9 +begin = 05.06.2020 15:45:16 +norma = 0 +real = 42 + +[85] +oper = 10 +begin = 05.06.2020 16:27:48 +norma = 0 +real = 222 + +[86] +oper = 11 +begin = 05.06.2020 20:10:05 +norma = 0 +real = 167 + +[87] +oper = 12 +begin = 05.06.2020 22:57:09 +norma = 105 +real = 110 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.417 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.417 new file mode 100644 index 0000000..b9db7d3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.417 @@ -0,0 +1,45 @@ +00:30:21 1591299021 ⪫祭 ० (A) +00:30:44 1591299044 ⪫祭 ० ' ⮪ 㣨' +00:31:35 1591299095 祭 ० ᪠ +00:34:13 1591299253 ⪫祭 ० ᪠ (A) +03:46:46 1591310806 祭 ० ࠧ +03:46:48 1591310808 祭 ० ' ⮪ 㣨' +03:47:50 1591310870 祭 ॣ '-2'(A) +04:10:51 1591312251 ⪫祭 ० ' ⮪ 㣨' +04:12:48 1591312368 ⪫祭 ॣ '-2'(A) +04:13:31 1591312411 祭 ० ᪠ +04:15:35 1591312535 ⪫祭 ० ᪠ (A) +12:25:43 1591341943 祭 ॣ '-2'(A) +12:25:44 1591341944 ⪫祭 ॣ '-2'(A) +12:25:52 1591341952 祭 ॣ '-2'(A) +12:26:26 1591341986 ⪫祭 ॣ '-2'(A) +12:34:07 1591342447 祭 ० ࠧ +12:34:09 1591342449 祭 ० ' ⮪ 㣨' +12:59:00 1591343940 祭 ॣ '-2'(A) +12:59:09 1591343949 ⪫祭 ० ' ⮪ 㣨' +12:59:34 1591343974 ⪫祭 ॣ '-2'(A) +13:01:10 1591344070 祭 ० ᪠ +13:01:35 1591344095 ⪫祭 ० ᪠ +13:01:36 1591344096 祭 ० ᪠ +13:01:36 1591344096 祭 ० ᪠ +13:02:08 1591344128 ⪫祭 ० ᪠ +13:02:09 1591344129 祭 ० ᪠ +13:02:09 1591344129 祭 ० ᪠ +13:02:19 1591344139 ⪫祭 ० ᪠ +13:02:21 1591344141 祭 ० ᪠ +13:02:25 1591344145 ⪫祭 ० ᪠ (A) +15:36:28 1591353388 祭 ॣ '-2'(A) +15:37:03 1591353423 ⪫祭 ॣ '-2'(A) +15:44:44 1591353884 祭 ० ࠧ +15:44:47 1591353887 祭 ० ' ⮪ 㣨' +16:10:41 1591355441 祭 ॣ '-2'(A) +16:27:48 1591356468 祭 ⠭ ॣ +16:27:48 1591356468 ⪫祭 ० ࠧ (A) +20:10:04 1591369804 祭 ० +20:10:05 1591369805 ⪫祭 ॣ '-2'(A) +20:10:06 1591369806 祭 ॣ '-2'(A) +22:02:07 1591376527 ⪫祭 ॣ '-2'(A) +22:57:03 1591379823 ⪫祭 ० (A) +22:57:10 1591379830 ⪫祭 ० ' ⮪ 㣨' +22:58:06 1591379886 祭 ० ᪠ +23:00:27 1591380027 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200605.419 b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.419 new file mode 100644 index 0000000..47adf4a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200605.419 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.040 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.040 new file mode 100644 index 0000000..a5daaf5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.040 @@ -0,0 +1,8 @@ +05:16:51 1591402611 3 14 +06:13:50 1591406030 0 A--32-067-2014 ॢ 0 +11:23:02 1591424582 1 10059 3 25 9 4650 10 690 +11:23:57 1591424637 2 BT 3-1, 6, 8, 9, 14, 15, 16 +11:26:33 1591424793 11 +12:15:27 1591427727 1 10059 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4020 9 4650 10 690 11 12 321427 +12:58:10 1591430290 0 A--32-031-2016 ॢ 5 +22:23:52 1591464232 1 10060 2 BT 3-1, 6, 8, 9, 14, 15, 16 4 1 8 5050 9 6260 10 650 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.041 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.041 new file mode 100644 index 0000000..e482f5a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.041 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.042 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.042 new file mode 100644 index 0000000..63fd5ac --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.042 @@ -0,0 +1,66 @@ +21 05:16:34 05:16:41 +Rsk= 19.4 Rkk= 14.2 + +22 05:40:08 05:50:39 +P1= 13.5 T1=05:45:39 P2= 36.4 T2=05:50:39 Vs= 4.57 + +20 11:20:10 11:20:20 +Riz_sol= 1804.9 + +21 11:21:30 11:21:38 +Rsk= 13.7 Rkk= 8.7 + +22 11:50:11 12:05:43 +P1= 40.1 T1=12:00:43 P2= 54.1 T2=12:05:43 Vs= 2.80 + +23 12:05:53 12:05:59 + + +24 12:06:05 12:06:43 + + +30 12:06:53 12:07:33 +Vst= 28.7 + +31 12:07:39 12:08:19 +Rom_sol= 10.4 + +41 12:08:41 12:08:46 +Ukz= 1.67 + +41 12:09:30 12:09:35 +Ukz= 1.44 + +32 12:09:41 12:10:51 +Imax=10.8 Umax=50.0 T= 9.2 + +33 12:10:54 12:11:26 +Imin=16.0 Umin=25.0 T= 0.8 + +34 12:11:28 12:11:55 +V=301.2 T= 9.3 + +35 12:11:57 12:13:04 +Q= 54.6 T= 9.2 + +36 12:13:07 12:13:41 +P1=0.30 T= 2.9 + +37 12:13:43 12:14:17 +T= 0.6 + +38 12:14:21 12:14:27 +t= 51.5 T= 0.5 + +39 12:14:29 12:14:35 +t= 51.2 T= 0.4 + +40 12:14:37 12:14:43 +t= 51.2 T= 0.4 + +21 22:24:05 22:24:13 +Rsk= 13.5 Rkk= 8.6 + +22 23:09:55 23:25:27 +P1= 29.8 T1=23:20:27 P2= 40.0 T2=23:25:27 Vs= 2.04 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.043 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.043 new file mode 100644 index 0000000..5f5a813 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.043 @@ -0,0 +1,19 @@ +12 02:42:40 1591393360 +13 04:31:42 1591399902 +0 04:31:42 1591399902 +14 05:16:15 1591402575 +15 05:53:40 1591404820 +16 06:13:50 1591406030 +16 06:18:38 1591406318 +1 07:04:54 1591409094 +8 11:07:15 1591423635 +25 12:06:51 1591427211 +9 12:15:27 1591427727 +10 12:58:11 1591430291 +11 16:45:32 1591443932 +12 19:32:33 1591453953 +13 21:20:20 1591460420 +0 21:20:20 1591460420 +2 22:19:36 1591463976 +5 23:26:45 1591468005 +6 23:38:36 1591468716 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.044 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.044 new file mode 100644 index 0000000..2f715c1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.044 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.046 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.046 new file mode 100644 index 0000000..3e5d295 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.046 @@ -0,0 +1,106 @@ +[97] +oper = 12 +begin = 06.06.2020 02:42:40 +norma = 105 +real = 109 + +[98] +oper = 13 +begin = 06.06.2020 04:31:42 +norma = 45 +real = 44 + +[99] +oper = 14 +begin = 06.06.2020 05:16:15 +norma = 40 +vac_time = 7 +vac_avg10 = 8.0 +real = 37 + +[00] +oper = 15 +begin = 06.06.2020 05:53:40 +norma = 30 +real = 20 + +[01] +oper = 16 +begin = 06.06.2020 06:13:50 +norma = 40 +real = 4 + +[02] +oper = 16 +begin = 06.06.2020 06:18:38 +norma = 40 +real = 46 + +[03] +oper = 1 +begin = 06.06.2020 07:04:54 +norma = 85 +real = 242 + +[04] +oper = 8 +begin = 06.06.2020 11:07:15 +norma = 40 +vac_time = 13 +real = 59 + +[05] +oper = 25 +begin = 06.06.2020 12:06:51 +norma = 30 +real = 8 + +[06] +oper = 9 +begin = 06.06.2020 12:15:27 +norma = 0 +real = 42 + +[07] +oper = 10 +begin = 06.06.2020 12:58:11 +norma = 0 +real = 227 + +[08] +oper = 11 +begin = 06.06.2020 16:45:32 +norma = 0 +real = 167 + +[09] +oper = 12 +begin = 06.06.2020 19:32:33 +norma = 105 +real = 107 + +[10] +oper = 13 +begin = 06.06.2020 21:20:20 +norma = 45 +real = 59 + +[11] +oper = 2 +begin = 06.06.2020 22:19:36 +norma = 110 +vac_time = 8 +real = 67 + +[12] +oper = 5 +begin = 06.06.2020 23:26:45 +norma = 25 +real = 11 + +[13] +oper = 6 +begin = 06.06.2020 23:38:36 +norma = 35 +real = 41 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.047 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.047 new file mode 100644 index 0000000..61d9507 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.047 @@ -0,0 +1,37 @@ +00:48:49 1591386529 ⪫祭 ॣ '-2'(A) +02:42:30 1591393350 ⪫祭 ० (A) +02:42:32 1591393352 ⪫祭 +02:42:32 1591393352 : +02:42:41 1591393361 ⪫祭 ० ' ⮪ 㣨' +02:43:45 1591393425 祭 ० ᪠ +02:43:45 1591393425 祭 ० ᪠ +02:44:31 1591393471 : 믮 +02:47:08 1591393628 ⪫祭 ० ᪠ (A) +05:53:27 1591404807 祭 ० ࠧ +05:53:29 1591404809 祭 ० ' ⮪ 㣨' +05:54:32 1591404872 祭 ॣ '-2'(A) +06:13:50 1591406030 ⪫祭 ० ࠧ (A) +06:16:31 1591406191 ⪫祭 ० ' ⮪ 㣨' +06:16:33 1591406193 ⪫祭 ॣ '-2'(A) +06:18:48 1591406328 祭 ० ᪠ +06:18:48 1591406328 祭 ० ᪠ +06:22:12 1591406532 ⪫祭 ० ᪠ (A) +11:23:15 1591424595 : 㦥 +11:26:35 1591424795 : +12:06:08 1591427168 祭 ॣ '-2'(A) +12:06:43 1591427203 ⪫祭 ॣ '-2'(A) +12:14:54 1591427694 祭 ० ࠧ +12:14:56 1591427696 祭 ० ' ⮪ 㣨' +12:41:06 1591429266 祭 ॣ '-2'(A) +12:58:10 1591430290 ⪫祭 ० ࠧ (A) +12:58:11 1591430291 祭 ⠭ ॣ +16:45:31 1591443931 祭 ० +16:45:32 1591443932 ⪫祭 ॣ '-2'(A) +16:45:33 1591443933 祭 ॣ '-2'(A) +19:32:30 1591453950 ⪫祭 ० (A) +19:32:34 1591453954 ⪫祭 ० ' ⮪ 㣨' +19:32:38 1591453958 ⪫祭 ॣ '-2'(A) +19:33:39 1591454019 祭 ० ᪠ +19:36:34 1591454194 ⪫祭 ० ᪠ (A) +23:39:43 1591468783 祭 ० ᪠ +23:42:37 1591468957 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.049 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.049 new file mode 100644 index 0000000..15db2f6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.049 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.050 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.050 new file mode 100644 index 0000000..b0eb45d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.050 @@ -0,0 +1,4 @@ +11:34:10 1591425250 1 10113 9 4570 +12:31:51 1591428711 1 10113 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 3300 9 4570 10 690 11 12 321602 +13:14:30 1591431270 0 A--32-031-2016 ॢ 5 +22:31:16 1591464676 1 10114 2 BT 3-1, 6, 8, 9, 14, 15, 16 4 1 8 4070 9 5000 10 650 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.051 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.051 new file mode 100644 index 0000000..3e34f1f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.051 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.052 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.052 new file mode 100644 index 0000000..7529146 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.052 @@ -0,0 +1,54 @@ +20 11:32:56 11:33:06 +Riz_sol= 360.9 + +21 11:33:15 11:33:22 +Rsk= 22.6 Rkk= 17.0 + +22 12:05:40 12:20:48 +P1= 30.9 T1=12:15:48 P2= 41.4 T2=12:20:48 Vs= 2.09 + +23 12:21:03 12:21:09 + + +24 12:21:24 12:22:03 + + +30 12:22:11 12:22:56 +Vst= 29.5 + +31 12:23:00 05:00:00 +Rom_sol= 13.2 + +32 12:24:26 12:25:41 +Imax=11.3 Umax=50.0 T= 9.2 + +33 12:25:45 12:26:14 +Imin=16.4 Umin=25.2 T= 1.0 + +34 12:26:18 12:26:45 +V=301.3 T= 9.6 + +35 12:26:48 12:28:17 +Q= 55.0 T= 8.9 + +36 12:28:20 12:29:12 +P1=0.29 T= 3.1 + +37 12:29:53 12:30:27 +T= 0.7 + +38 12:30:30 12:30:41 +t= 51.7 T= 0.7 + +39 12:30:45 12:31:05 +tcam= 51.3 Tcam= 0.7 tfl= 51.6 Tfl= 0.8 + +40 12:31:09 12:31:17 +t= 51.6 T= 0.7 + +21 22:30:23 22:30:31 +Rsk= 22.3 Rkk= 16.6 + +22 23:09:55 23:25:03 +P1= 29.6 T1=23:20:03 P2= 39.1 T2=23:25:03 Vs= 1.90 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.053 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.053 new file mode 100644 index 0000000..43989f9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.053 @@ -0,0 +1,15 @@ +11 02:04:44 1591391084 +12 04:51:46 1591401106 +13 06:41:46 1591407706 +0 06:41:46 1591407706 +8 11:29:19 1591424959 +25 12:22:09 1591428129 +9 12:31:51 1591428711 +10 13:14:30 1591431270 +11 16:57:03 1591444623 +12 19:44:04 1591454644 +13 21:30:50 1591461050 +0 21:30:50 1591461050 +2 22:27:20 1591464440 +5 23:25:43 1591467943 +6 23:38:04 1591468684 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.054 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.054 new file mode 100644 index 0000000..6913e0b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.054 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.055 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.055 new file mode 100644 index 0000000..b2afe21 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.055 @@ -0,0 +1,2 @@ +47 12:29:21 1591428561 +70 12:29:29 1591428569 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.056 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.056 new file mode 100644 index 0000000..88ff835 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.056 @@ -0,0 +1,80 @@ +[24] +oper = 11 +begin = 06.06.2020 02:04:44 +norma = 0 +real = 167 + +[25] +oper = 12 +begin = 06.06.2020 04:51:46 +norma = 105 +real = 110 + +[26] +oper = 13 +begin = 06.06.2020 06:41:46 +norma = 45 +real = 287 + +[27] +oper = 8 +begin = 06.06.2020 11:29:19 +norma = 40 +vac_time = 9 +real = 52 + +[28] +oper = 25 +begin = 06.06.2020 12:22:09 +norma = 30 +real = 9 + +[29] +oper = 9 +begin = 06.06.2020 12:31:51 +norma = 0 +real = 42 + +[30] +oper = 10 +begin = 06.06.2020 13:14:30 +norma = 0 +real = 222 + +[31] +oper = 11 +begin = 06.06.2020 16:57:03 +norma = 0 +real = 167 + +[32] +oper = 12 +begin = 06.06.2020 19:44:04 +norma = 105 +real = 106 + +[33] +oper = 13 +begin = 06.06.2020 21:30:50 +norma = 45 +real = 56 + +[34] +oper = 2 +begin = 06.06.2020 22:27:20 +norma = 110 +vac_time = 8 +real = 58 + +[35] +oper = 5 +begin = 06.06.2020 23:25:43 +norma = 25 +real = 12 + +[36] +oper = 6 +begin = 06.06.2020 23:38:04 +norma = 35 +real = 34 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.057 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.057 new file mode 100644 index 0000000..cdb0d9e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.057 @@ -0,0 +1,27 @@ +02:04:44 1591391084 祭 ० +02:04:45 1591391085 ⪫祭 ॣ '-2'(A) +02:04:46 1591391086 祭 ॣ '-2'(A) +04:51:41 1591401101 ⪫祭 ० (A) +04:51:48 1591401108 ⪫祭 ० ' ⮪ 㣨' +04:51:51 1591401111 ⪫祭 ॣ '-2'(A) +04:52:30 1591401150 祭 ० ᪠ +04:54:51 1591401291 ⪫祭 ० ᪠ (A) +12:21:28 1591428088 祭 ॣ '-2'(A) +12:22:03 1591428123 ⪫祭 ॣ '-2'(A) +12:31:35 1591428695 祭 ० ࠧ +12:31:37 1591428697 祭 ० ' ⮪ 㣨' +12:57:25 1591430245 祭 ॣ '-2'(A) +13:14:30 1591431270 祭 ⠭ ॣ +13:14:30 1591431270 ⪫祭 ० ࠧ (A) +16:57:02 1591444622 祭 ० +16:57:02 1591444622 ⪫祭 ॣ '-2'(A) +16:57:03 1591444623 祭 ॣ '-2'(A) +19:44:00 1591454640 ⪫祭 ० (A) +19:44:06 1591454646 ⪫祭 ० ' ⮪ 㣨' +19:44:08 1591454648 ⪫祭 ॣ '-2'(A) +19:44:46 1591454686 祭 ० ᪠ +19:44:46 1591454686 祭 ० ᪠ +19:47:00 1591454820 ⪫祭 ० ᪠ (A) +23:38:15 1591468695 祭 ० ᪠ +23:38:15 1591468695 祭 ० ᪠ +23:40:29 1591468829 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.059 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.059 new file mode 100644 index 0000000..50ad194 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.059 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.350 new file mode 100644 index 0000000..2144903 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.350 @@ -0,0 +1,6 @@ +02:27:49 1591392469 8 3970 +02:34:54 1591392894 1 09529 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 3970 9 5060 10 650 11 12 321692 +03:08:13 1591394893 0 A--32-129-2016 ॢ 0 +12:21:03 1591428063 3 14 +15:11:49 1591438309 1 09530 2 OT-4 3 25 7 670 8 4490 9 4370 10 560 +19:13:00 1591452780 1 09530 2 OT-4 3 25 4 1 5 Ti 6 7 670 8 4490 9 4370 10 560 11 12 321692 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.351 new file mode 100644 index 0000000..6338526 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.352 new file mode 100644 index 0000000..aedb3bd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.352 @@ -0,0 +1,117 @@ +22 23:59:42 00:15:12 +P1= 36.9 T1=00:10:12 P2= 49.3 T2=00:15:12 Vs= 2.47 + +20 01:29:06 01:29:15 +Riz_sol= 6103.7 + +21 01:29:21 01:29:24 +Rsk= 17.3 Rkk= 14.5 + +22 02:10:48 02:26:18 +P1= 33.1 T1=02:21:18 P2= 45.1 T2=02:26:18 Vs= 2.39 + +23 02:26:27 02:26:33 + + +24 02:26:39 02:27:18 + + +30 02:28:05 02:28:32 +Vst= 28.4 + +31 02:28:36 02:29:08 +Rom_sol= 13.5 + +41 02:29:29 02:29:34 +Ukz= 1.57 + +32 02:29:38 02:30:15 +Imax=11.3 Umax=50.0 T= 9.0 + +33 02:30:18 02:30:44 +Imin=16.2 Umin=25.0 T= 0.5 + +34 02:30:51 02:31:16 +V=300.3 T= 9.5 + +35 02:31:19 02:32:23 +Q= 54.1 T= 9.5 + +36 02:32:26 02:33:05 +P1=0.29 T= 3.0 + +37 02:33:08 02:33:32 +T= 1.0 + +38 02:33:35 02:33:40 +t= 53.8 T= 0.8 + +39 02:33:43 02:34:00 +tcam= 55.3 Tcam= 0.8 tfl= 54.2 Tfl= 0.8 + +40 02:34:03 02:34:08 +t= 53.1 T= 0.8 + +21 12:20:48 12:20:51 +Rsk= 17.0 Rkk= 14.2 + +22 12:49:32 13:00:02 +P1= 23.0 T1=12:55:02 P2= 45.8 T2=13:00:02 Vs= 4.56 + +21 15:05:10 15:05:13 +Rsk= 16.9 Rkk= 14.2 + +22 15:44:38 16:00:09 +P1= 46.4 T1=15:55:09 P2= 61.8 T2=16:00:09 Vs= 3.09 + +22 16:06:13 16:21:44 +P1= 41.0 T1=16:16:44 P2= 54.2 T2=16:21:44 Vs= 2.64 + +20 17:51:57 17:52:06 +Riz_sol= 802.7 + +21 17:52:13 17:52:16 +Rsk= 16.7 Rkk= 13.9 + +22 18:49:40 19:05:11 +P1= 37.5 T1=19:00:10 P2= 50.9 T2=19:05:11 Vs= 2.68 + +23 19:05:20 19:05:25 + + +24 19:05:31 19:06:10 + + +30 19:06:24 19:06:48 +Vst= 28.4 + +31 19:06:55 19:07:28 +Rom_sol= 11.7 + +32 19:08:03 19:08:38 +Imax=11.3 Umax=50.0 T= 9.0 + +33 19:08:40 19:08:58 +Imin=16.3 Umin=25.0 T= 0.5 + +34 05:00:00 19:09:28 +V=300.2 T= 9.5 + +35 19:09:30 19:10:45 +Q= 53.6 T=12.5 + +36 19:10:48 19:11:25 +P1=0.30 T= 3.0 + +37 19:11:28 19:11:53 +T= 1.0 + +38 19:11:55 19:12:01 +t= 53.5 T= 0.8 + +39 19:12:03 19:12:17 +tcam= 55.2 Tcam= 0.8 tfl= 54.0 Tfl= 0.8 + +40 19:12:19 19:12:25 +t= 56.8 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.353 new file mode 100644 index 0000000..bf59879 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.353 @@ -0,0 +1,22 @@ +5 00:16:16 1591384576 +6 00:27:25 1591385245 +7 00:59:59 1591387199 +8 01:27:05 1591388825 +25 02:28:03 1591392483 +9 02:34:54 1591392894 +10 03:08:13 1591394893 +12 07:25:51 1591410351 +13 11:41:27 1591425687 +0 11:41:27 1591425687 +14 12:18:50 1591427930 +15 13:01:20 1591430480 +16 13:18:53 1591431533 +1 14:03:36 1591434216 +2 15:03:19 1591437799 +5 16:22:22 1591442542 +6 16:35:12 1591443312 +7 17:11:59 1591445519 +8 17:46:48 1591447608 +25 19:06:21 1591452381 +9 19:13:00 1591452780 +10 19:39:20 1591454360 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.354 new file mode 100644 index 0000000..51ff48d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.356 new file mode 100644 index 0000000..88abf5a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.356 @@ -0,0 +1,131 @@ +[34] +oper = 5 +begin = 06.06.2020 00:16:16 +norma = 25 +real = 11 + +[35] +oper = 6 +begin = 06.06.2020 00:27:25 +norma = 35 +real = 32 + +[36] +oper = 7 +begin = 06.06.2020 00:59:59 +norma = 30 +real = 27 + +[37] +oper = 8 +begin = 06.06.2020 01:27:05 +norma = 40 +vac_time = 9 +real = 60 + +[38] +oper = 25 +begin = 06.06.2020 02:28:03 +norma = 30 +real = 6 + +[39] +oper = 9 +begin = 06.06.2020 02:34:54 +norma = 0 +real = 33 + +[40] +oper = 10 +begin = 06.06.2020 03:08:13 +norma = 0 +real = 257 + +[41] +oper = 12 +begin = 06.06.2020 07:25:51 +norma = 105 +real = 255 + +[42] +oper = 13 +begin = 06.06.2020 11:41:27 +norma = 45 +real = 37 + +[43] +oper = 14 +begin = 06.06.2020 12:18:50 +norma = 40 +vac_time = 8 +vac_avg10 = 8.7 +real = 42 + +[44] +oper = 15 +begin = 06.06.2020 13:01:20 +norma = 30 +real = 17 + +[45] +oper = 16 +begin = 06.06.2020 13:18:53 +norma = 40 +real = 44 + +[46] +oper = 1 +begin = 06.06.2020 14:03:36 +norma = 85 +real = 59 + +[47] +oper = 2 +begin = 06.06.2020 15:03:19 +norma = 110 +vac_time = 8 +real = 79 + +[48] +oper = 5 +begin = 06.06.2020 16:22:22 +norma = 25 +real = 12 + +[49] +oper = 6 +begin = 06.06.2020 16:35:12 +norma = 35 +real = 36 + +[50] +oper = 7 +begin = 06.06.2020 17:11:59 +norma = 30 +real = 34 + +[51] +oper = 8 +begin = 06.06.2020 17:46:48 +norma = 40 +vac_time = 8 +real = 79 + +[52] +oper = 25 +begin = 06.06.2020 19:06:21 +norma = 30 +real = 6 + +[53] +oper = 9 +begin = 06.06.2020 19:13:00 +norma = 0 +real = 26 + +[54] +oper = 10 +begin = 06.06.2020 19:39:20 +norma = 0 +real = 265 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.357 new file mode 100644 index 0000000..7f223cb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.357 @@ -0,0 +1,36 @@ +00:28:06 1591385286 祭 ० ᪠ +00:28:06 1591385286 祭 ० ᪠ +00:28:06 1591385286 祭 ० ᪠ +00:28:07 1591385287 祭 ० ᪠ +00:30:34 1591385434 ⪫祭 ० ᪠ (A) +02:26:41 1591392401 祭 ॣ '-2'(A) +02:27:18 1591392438 ⪫祭 ॣ '-2'(A) +02:34:17 1591392857 祭 ० ࠧ +02:34:18 1591392858 祭 ० ' ⮪ 㣨' +02:36:15 1591392975 祭 ॣ '-2'(A) +03:08:13 1591394893 祭 ⠭ ॣ +03:08:13 1591394893 ⪫祭 ० ࠧ (A) +07:16:53 1591409813 祭 ० +07:16:54 1591409814 ⪫祭 ॣ '-2'(A) +07:16:55 1591409815 祭 ॣ '-2'(A) +07:22:41 1591410161 ⪫祭 ० ' ⮪ 㣨' +07:25:54 1591410354 ⪫祭 ॣ '-2'(A) +07:26:50 1591410410 祭 ० ᪠ +07:29:23 1591410563 ⪫祭 ० ᪠ (A) +08:26:53 1591414013 ⪫祭 ० (A) +13:00:41 1591430441 祭 ० ࠧ +13:00:43 1591430443 祭 ० ' ⮪ 㣨' +13:01:55 1591430515 祭 ॣ '-2'(A) +13:16:30 1591431390 ⪫祭 ० ' ⮪ 㣨' +13:18:55 1591431535 ⪫祭 ॣ '-2'(A) +13:18:57 1591431537 ⪫祭 ० ࠧ +13:19:45 1591431585 祭 ० ᪠ +13:22:54 1591431774 ⪫祭 ० ᪠ (A) +16:35:27 1591443327 祭 ० ᪠ +16:35:27 1591443327 祭 ० ᪠ +16:35:27 1591443327 祭 ० ᪠ +16:38:48 1591443528 ⪫祭 ० ᪠ (A) +19:05:33 1591452333 祭 ॣ '-2'(A) +19:06:11 1591452371 ⪫祭 ॣ '-2'(A) +19:18:21 1591453101 祭 ॣ '-2' +19:40:20 1591454420 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.359 new file mode 100644 index 0000000..1c8a43b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.410 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.410 new file mode 100644 index 0000000..1698bf8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.410 @@ -0,0 +1,8 @@ +01:58:57 1591390737 1 11412 2 BT 18, 20, 22, 23, 25 4 1 7 690 10 560 +07:03:58 1591409038 1 11412 2 BT 18, 20, 22, 23, 25 3 25 4 1 5 Ti 6 7 690 8 3000 9 4620 10 560 11 12 320839 +07:34:12 1591410852 0 A--32-113-2018 ॢ 1 +15:30:13 1591439413 1 11413 2 BT 3-1, 6, 8, 9, 14, 15, 16 8 4500 9 5850 10 650 +15:31:05 1591439465 7 770 +18:40:02 1591450802 1 11413 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4500 9 5850 10 650 11 12 320839 +21:08:28 1591459708 1 11413 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4500 9 5850 10 650 11 12 320839 +21:41:40 1591461700 0 A--32-129-2018 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.411 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.411 new file mode 100644 index 0000000..0d670be Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.411 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.412 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.412 new file mode 100644 index 0000000..f6ab19d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.412 @@ -0,0 +1,291 @@ +21 01:59:19 01:59:22 +Rsk= 7.6 Rkk= 4.7 + +21 02:19:08 02:19:11 +Rsk= 11.3 Rkk= 8.4 + +22 02:59:57 03:15:04 +P1= 62.0 T1=03:10:04 P2= 80.2 T2=03:15:04 Vs= 3.65 + +22 03:24:53 03:40:00 +P1= 59.9 T1=03:35:00 P2= 76.5 T2=03:40:00 Vs= 3.31 + +22 03:54:56 04:10:03 +P1= 53.6 T1=04:05:03 P2= 69.7 T2=04:10:03 Vs= 3.20 + +21 04:22:27 04:22:30 +Rsk= 11.2 Rkk= 8.3 + +22 04:45:30 05:00:37 +P1= 59.4 T1=04:55:37 P2= 73.7 T2=05:00:37 Vs= 2.86 + +20 06:00:31 06:00:40 +Riz_sol= 13.5 + +21 06:00:48 06:00:51 +Rsk= 8.1 Rkk= 5.2 + +22 06:34:57 06:50:04 +P1= 52.3 T1=06:45:04 P2= 65.3 T2=06:50:04 Vs= 2.61 + +23 06:50:12 06:50:17 + + +24 06:50:21 06:50:59 + + +30 06:51:18 06:51:45 +Vst= 32.2 + +31 06:51:53 06:52:28 +Rom_sol= 7.0 + +41 06:52:51 06:52:56 +Ukz= 2.11 + +32 06:53:00 06:53:37 +Imax=11.0 Umax=50.0 T= 9.0 + +33 06:53:42 06:54:06 +Imin=16.0 Umin=25.0 T= 0.5 + +34 06:54:09 06:54:33 +V=300.3 T= 9.4 + +35 06:54:35 06:55:36 +Q= 52.1 T= 9.4 + +36 06:55:39 06:56:14 +P1=0.29 T= 2.9 + +37 06:56:18 06:56:41 +T= 0.9 + +38 06:56:44 06:56:51 +t= 51.8 T= 0.5 + +39 06:56:54 06:57:10 +tcam= 54.1 Tcam= 0.5 tfl= 56.3 Tfl= 0.5 + +40 06:57:13 06:57:20 +t= 52.0 T= 0.5 + +21 15:30:26 15:30:29 +Rsk= 8.0 Rkk= 5.1 + +22 16:08:45 16:23:52 +P1= 55.8 T1=16:18:52 P2= 69.1 T2=16:23:52 Vs= 2.66 + +20 17:44:05 17:44:14 +Riz_sol= 4757.4 + +21 17:44:20 17:44:23 +Rsk= 8.0 Rkk= 5.1 + +22 18:16:43 18:31:50 +P1= 54.5 T1=18:26:50 P2= 68.6 T2=18:31:50 Vs= 2.83 + +23 18:32:03 18:32:08 + + +24 18:32:13 18:32:52 + + +30 18:33:05 18:33:32 +Vst= 31.6 + +31 18:33:38 18:34:12 +Rom_sol= 14.0 + +41 18:34:49 18:34:54 +Ukz= 1.81 + +32 18:35:00 18:35:36 +Imax=11.0 Umax=50.0 T= 9.0 + +33 18:35:39 18:35:57 +Imin=16.0 Umin=25.0 T= 0.5 + +34 18:36:01 18:36:24 +V=300.2 T= 9.5 + +35 18:36:27 18:37:23 +Q= 54.6 T= 9.4 + +36 18:37:27 18:38:02 +P1=0.29 T= 3.0 + +37 18:38:06 18:38:30 +T= 1.0 + +38 18:38:34 18:38:42 +t= 51.9 T= 0.6 + +39 18:38:45 18:38:52 +t= 52.7 T= 0.6 + +39 18:38:59 18:39:16 +tcam= 54.1 Tcam= 0.5 tfl= 58.1 Tfl= 0.5 + +40 18:39:20 18:39:27 +t= 51.9 T= 0.6 + +20 20:10:05 20:10:14 +Riz_sol= 4757.4 + +21 20:10:21 20:10:24 +Rsk= 7.7 Rkk= 4.9 + +21 20:10:31 20:10:34 +Rsk= 7.7 Rkk= 4.9 + +21 20:10:44 20:10:47 +Rsk= 7.7 Rkk= 4.9 + +21 20:11:19 20:11:22 +Rsk= 7.7 Rkk= 4.9 + +21 20:12:08 20:12:11 +Rsk= 7.7 Rkk= 4.8 + +21 20:12:20 20:12:23 +Rsk= 7.7 Rkk= 4.8 + +21 20:12:26 20:12:29 +Rsk= 7.7 Rkk= 4.8 + +21 20:12:33 20:12:36 +Rsk= 7.7 Rkk= 4.9 + +21 20:13:11 20:13:14 +Rsk= 7.8 Rkk= 4.9 + +21 20:13:44 20:13:47 +Rsk= 4.8 Rkk= 4.9 + +21 20:14:06 20:14:09 +Rsk= 7.8 Rkk= 4.9 + +21 20:14:49 20:14:52 +Rsk= 7.7 Rkk= 4.9 + +21 20:20:05 20:20:08 +Rsk= 7.7 Rkk= 4.9 + +21 20:20:10 20:20:13 +Rsk= 7.7 Rkk= 4.9 + +21 20:20:16 20:20:19 +Rsk= 7.7 Rkk= 4.9 + +21 20:20:23 20:20:26 +Rsk= 7.8 Rkk= 4.9 + +21 20:20:29 20:20:32 +Rsk= 7.8 Rkk= 4.9 + +21 20:20:34 20:20:37 +Rsk= 7.7 Rkk= 4.9 + +21 20:20:40 20:20:43 +Rsk= 7.8 Rkk= 4.9 + +21 20:20:58 20:21:01 +Rsk= 7.7 Rkk= 4.9 + +21 20:21:04 20:21:07 +Rsk= 7.8 Rkk= 4.9 + +21 20:26:35 20:26:38 +Rsk= 7.8 Rkk= 4.9 + +21 20:26:52 20:26:55 +Rsk= 7.8 Rkk= 4.9 + +21 20:26:58 20:27:01 +Rsk= 7.7 Rkk= 4.9 + +21 20:31:06 20:31:09 +Rsk= 0.0 Rkk= 2.9 + +21 20:31:13 20:31:16 +Rsk= 0.0 Rkk= 2.9 + +21 20:32:03 20:32:06 +Rsk= 0.0 Rkk= 2.9 + +21 20:33:19 20:33:22 +Rsk= 7.8 Rkk= 4.9 + +21 20:33:28 20:33:31 +Rsk= 7.8 Rkk= 4.9 + +21 20:33:34 20:33:37 +Rsk= 7.8 Rkk= 4.9 + +21 20:33:40 20:33:43 +Rsk= 7.8 Rkk= 4.9 + +21 20:33:56 20:33:59 +Rsk= 7.8 Rkk= 4.9 + +21 20:34:02 20:34:05 +Rsk= 7.8 Rkk= 4.9 + +21 20:34:31 20:34:35 +Rsk= 7.8 Rkk= 4.9 + +21 20:35:05 20:35:08 +Rsk= 7.8 Rkk= 4.9 + +21 20:35:15 20:35:18 +Rsk= 8.8 Rkk= 6.3 + +22 20:39:58 20:50:05 +P1= 37.6 T1=20:45:05 P2= 52.4 T2=20:50:05 Vs= 2.97 + +22 20:50:23 21:00:30 +P1= 43.4 T1=20:55:30 P2= 55.8 T2=21:00:30 Vs= 2.47 + +23 21:00:44 21:00:49 + + +24 21:00:54 21:01:32 + + +30 21:01:49 21:02:19 +Vst= 31.7 + +31 21:02:23 21:02:56 +Rom_sol= 13.8 + +41 21:03:44 21:03:49 +Ukz= 2.32 + +32 21:03:54 21:04:30 +Imax=11.0 Umax=50.0 T= 9.0 + +33 21:04:34 21:04:53 +Imin=16.0 Umin=25.0 T= 0.5 + +34 21:04:56 21:05:20 +V=300.3 T= 9.5 + +35 21:05:23 21:06:19 +Q= 53.3 T= 9.4 + +36 21:06:23 21:06:58 +P1=0.29 T= 3.0 + +37 21:07:02 21:07:25 +T= 0.9 + +38 21:07:28 21:07:36 +t= 51.9 T= 0.6 + +39 21:07:39 21:07:55 +tcam= 54.1 Tcam= 0.6 tfl= 57.1 Tfl= 0.5 + +40 21:07:58 21:08:06 +t= 52.0 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.413 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.413 new file mode 100644 index 0000000..c4e0c45 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.413 @@ -0,0 +1,28 @@ +13 00:47:27 1591386447 +0 00:47:27 1591386447 +2 01:54:17 1591390457 +7 04:15:04 1591398904 +2 04:22:14 1591399334 +5 05:03:08 1591401788 +6 05:10:54 1591402254 +7 05:50:47 1591404647 +8 05:58:44 1591405124 +25 06:51:11 1591408271 +9 07:03:58 1591409038 +10 07:34:12 1591410852 +12 11:39:51 1591425591 +13 14:47:15 1591436835 +0 14:47:15 1591436835 +2 15:29:51 1591439391 +5 16:24:51 1591442691 +6 16:38:06 1591443486 +7 17:13:37 1591445617 +8 17:40:41 1591447241 +25 18:33:03 1591450383 +9 18:40:02 1591450802 +8 18:56:16 1591451776 +13 19:57:50 1591455470 +8 20:09:44 1591456184 +25 21:01:46 1591459306 +9 21:08:28 1591459708 +10 21:41:41 1591461701 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.414 new file mode 100644 index 0000000..8d426b1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.415 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.415 new file mode 100644 index 0000000..f008fdf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.415 @@ -0,0 +1,2 @@ +47 18:38:54 1591450734 +3 20:12:16 1591456336 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.416 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.416 new file mode 100644 index 0000000..e9ea43d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.416 @@ -0,0 +1,162 @@ +[88] +oper = 13 +begin = 06.06.2020 00:47:27 +norma = 45 +real = 66 + +[89] +oper = 2 +begin = 06.06.2020 01:54:17 +norma = 110 +vac_time = 10 +real = 140 + +[90] +oper = 7 +begin = 06.06.2020 04:15:04 +norma = 30 +real = 7 + +[91] +oper = 2 +begin = 06.06.2020 04:22:14 +norma = 110 +vac_time = 10 +real = 40 + +[92] +oper = 5 +begin = 06.06.2020 05:03:08 +norma = 25 +real = 7 + +[93] +oper = 6 +begin = 06.06.2020 05:10:54 +norma = 35 +real = 39 + +[94] +oper = 7 +begin = 06.06.2020 05:50:47 +norma = 30 +real = 7 + +[95] +oper = 8 +begin = 06.06.2020 05:58:44 +norma = 40 +vac_time = 9 +real = 52 + +[96] +oper = 25 +begin = 06.06.2020 06:51:11 +norma = 30 +real = 12 + +[97] +oper = 9 +begin = 06.06.2020 07:03:58 +norma = 0 +real = 30 + +[98] +oper = 10 +begin = 06.06.2020 07:34:12 +norma = 0 +real = 245 + +[99] +oper = 12 +begin = 06.06.2020 11:39:51 +norma = 105 +real = 187 + +[00] +oper = 13 +begin = 06.06.2020 14:47:15 +norma = 45 +real = 42 + +[01] +oper = 2 +begin = 06.06.2020 15:29:51 +norma = 110 +vac_time = 10 +real = 55 + +[02] +oper = 5 +begin = 06.06.2020 16:24:51 +norma = 25 +real = 13 + +[03] +oper = 6 +begin = 06.06.2020 16:38:06 +norma = 35 +real = 35 + +[04] +oper = 7 +begin = 06.06.2020 17:13:37 +norma = 30 +real = 27 + +[05] +oper = 8 +begin = 06.06.2020 17:40:41 +norma = 40 +vac_time = 10 +real = 52 + +[06] +oper = 25 +begin = 06.06.2020 18:33:03 +norma = 30 +real = 6 + +[07] +oper = 9 +begin = 06.06.2020 18:40:02 +norma = 0 +real = 16 + +[08] +oper = 8 +begin = 06.06.2020 18:56:16 +norma = 40 +real = 61 + +[09] +oper = 13 +begin = 06.06.2020 19:57:50 +norma = 45 +real = 11 + +[10] +oper = 8 +begin = 06.06.2020 20:09:44 +norma = 40 +vac_time = 10 +real = 52 + +[11] +oper = 25 +begin = 06.06.2020 21:01:46 +norma = 30 +real = 6 + +[12] +oper = 9 +begin = 06.06.2020 21:08:28 +norma = 0 +real = 33 + +[13] +oper = 10 +begin = 06.06.2020 21:41:41 +norma = 0 +real = 293 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.417 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.417 new file mode 100644 index 0000000..fe866d4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.417 @@ -0,0 +1,63 @@ +05:11:00 1591402260 祭 ० ᪠ +05:11:01 1591402261 祭 ० ᪠ +05:11:01 1591402261 祭 ० ᪠ +05:13:46 1591402426 ⪫祭 ० ᪠ (A) +06:50:23 1591408223 祭 ॣ '-2'(A) +06:51:01 1591408261 ⪫祭 ॣ '-2'(A) +07:03:30 1591409010 祭 ० ' ⮪ 㣨' +07:03:32 1591409012 祭 ० ࠧ +07:05:10 1591409110 祭 ॣ '-2'(A) +07:34:12 1591410852 ⪫祭 ० ࠧ (A) +07:34:12 1591410852 祭 ⠭ ॣ +11:29:06 1591424946 祭 ० +11:29:07 1591424947 ⪫祭 ॣ '-2'(A) +11:29:08 1591424948 祭 ॣ '-2'(A) +11:33:30 1591425210 ⪫祭 ० ' ⮪ 㣨' +11:39:54 1591425594 ⪫祭 ॣ '-2'(A) +11:40:46 1591425646 祭 ० ᪠ +11:40:46 1591425646 祭 ० ᪠ +11:40:47 1591425647 祭 ० ᪠ +11:40:47 1591425647 祭 ० ᪠ +11:41:14 1591425674 ⪫祭 ० ᪠ +11:41:16 1591425676 祭 ० ᪠ +11:41:16 1591425676 祭 ० ᪠ +11:41:22 1591425682 ⪫祭 ० ᪠ +11:41:24 1591425684 祭 ० ᪠ +11:41:24 1591425684 祭 ० ᪠ +11:41:24 1591425684 祭 ० ᪠ +11:41:29 1591425689 ⪫祭 ० ᪠ +11:41:31 1591425691 祭 ० ᪠ +11:41:31 1591425691 祭 ० ᪠ +11:41:36 1591425696 ⪫祭 ० ᪠ +11:41:39 1591425699 祭 ० ᪠ +11:41:39 1591425699 祭 ० ᪠ +11:41:39 1591425699 祭 ० ᪠ +11:41:39 1591425699 祭 ० ᪠ +11:41:44 1591425704 ⪫祭 ० ᪠ (A) +11:41:45 1591425705 ⪫祭 ० ᪠ +11:41:50 1591425710 祭 ० ᪠ +11:41:50 1591425710 祭 ० ᪠ +11:41:57 1591425717 ⪫祭 ० ᪠ (A) +12:39:05 1591429145 ⪫祭 ० (A) +16:38:40 1591443520 祭 ० ᪠ +16:40:07 1591443607 ⪫祭 ० ᪠ +16:40:16 1591443616 祭 ० ᪠ +16:41:18 1591443678 ⪫祭 ० ᪠ (A) +17:43:39 1591447419 祭 ॣ '-2'(A) +17:44:27 1591447467 ⪫祭 ॣ '-2'(A) +18:32:17 1591450337 祭 ॣ '-2'(A) +18:32:54 1591450374 ⪫祭 ॣ '-2'(A) +18:39:35 1591450775 祭 ० ࠧ +18:39:40 1591450780 祭 ० ' ⮪ 㣨' +18:41:16 1591450876 祭 ॣ '-2'(A) +18:55:07 1591451707 ⪫祭 ० ' ⮪ 㣨' +18:55:19 1591451719 ⪫祭 ॣ '-2'(A) +18:57:18 1591451838 祭 ० ᪠ +19:00:04 1591452004 ⪫祭 ० ᪠ (A) +21:00:56 1591459256 祭 ॣ '-2'(A) +21:01:33 1591459293 ⪫祭 ॣ '-2'(A) +21:08:15 1591459695 祭 ० ࠧ +21:08:17 1591459697 祭 ० ' ⮪ 㣨' +21:09:41 1591459781 祭 ॣ '-2'(A) +21:41:40 1591461700 祭 ⠭ ॣ +21:41:40 1591461700 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.419 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.419 new file mode 100644 index 0000000..9726d73 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.419 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.460 new file mode 100644 index 0000000..11cfcc9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.460 @@ -0,0 +1,6 @@ +10:12:44 1591420364 1 11482 3 37 4 2 7 770 10 670 +13:36:48 1591432608 1 11482 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 770 8 4530 9 4320 10 670 11 12 321731 +14:10:34 1591434634 0 A--32-006-2018 ॢ 4 +21:01:07 1591459267 3 14 +21:57:37 1591462657 0 A--32-067-2014 ॢ 0 +22:57:51 1591466271 1 11483 2 BT 18, 20, 22, 23, 25 3 25 9 4960 10 690 12 1718 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.461 new file mode 100644 index 0000000..28c1154 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.462 new file mode 100644 index 0000000..aa0fc08 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.462 @@ -0,0 +1,69 @@ +21 10:01:39 10:01:42 +Rsk= 18.0 Rkk= 16.0 + +22 10:33:26 10:48:33 +P1= 43.0 T1=10:43:33 P2= 52.2 T2=10:48:33 Vs= 1.86 + +20 12:46:02 12:46:11 +Riz_sol= 446.9 + +21 12:46:19 12:46:22 +Rsk= 17.8 Rkk= 16.1 + +22 13:12:26 13:27:33 +P1= 39.5 T1=13:22:33 P2= 49.1 T2=13:27:33 Vs= 1.92 + +23 13:27:49 13:27:54 + + +24 13:28:06 13:28:44 + + +30 13:29:03 13:29:37 +Vst= 27.8 + +31 13:29:46 13:30:24 +Rom_sol= 13.2 + +41 13:31:03 13:31:08 +Ukz= 0.69 + +32 13:31:10 13:31:46 +Imax=27.2 Umax=55.0 T= 9.0 + +33 13:31:49 13:32:16 +Imin=16.1 Umin=24.8 T= 0.5 + +34 13:32:19 13:32:42 +V=300.1 T= 9.4 + +35 13:32:45 13:33:41 +Q= 53.5 T= 9.4 + +36 13:33:44 13:34:14 +P1=0.28 T= 2.9 + +37 13:34:18 13:34:43 +T= 0.9 + +38 13:34:46 13:34:54 +t= 54.0 T= 0.5 + +39 13:34:57 13:35:20 +tcam= 53.5 Tcam= 0.5 tfl= 59.5 Tfl= 0.5 + +40 13:35:25 13:35:38 +t= 52.6 T= 0.5 + +21 21:00:57 21:01:00 +Rsk= 17.3 Rkk= 15.5 + +22 21:19:54 21:30:01 +P1= 21.8 T1=21:25:01 P2= 45.2 T2=21:30:01 Vs= 4.68 + +21 22:56:36 22:56:39 +Rsk= 17.1 Rkk= 15.4 + +22 23:19:50 23:34:57 +P1= 29.8 T1=23:29:57 P2= 38.1 T2=23:34:57 Vs= 1.65 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.463 new file mode 100644 index 0000000..963360e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.463 @@ -0,0 +1,22 @@ +12 03:12:06 1591395126 +13 06:18:44 1591406324 +0 06:18:44 1591406324 +2 09:57:04 1591419424 +5 10:49:50 1591422590 +6 11:01:06 1591423266 +7 11:40:20 1591425620 +8 12:42:32 1591429352 +25 13:28:59 1591432139 +9 13:36:48 1591432608 +10 14:10:34 1591434634 +11 16:01:23 1591441283 +12 18:50:34 1591451434 +13 20:39:13 1591457953 +0 20:39:13 1591457953 +14 20:58:19 1591459099 +15 21:31:24 1591461084 +16 22:00:42 1591462842 +1 22:37:04 1591465024 +2 22:53:27 1591466007 +5 23:37:17 1591468637 +6 23:49:02 1591469342 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.464 new file mode 100644 index 0000000..bced844 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.466 new file mode 100644 index 0000000..1bd2d3d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.466 @@ -0,0 +1,124 @@ +[78] +oper = 12 +begin = 06.06.2020 03:12:06 +norma = 105 +real = 186 + +[79] +oper = 13 +begin = 06.06.2020 06:18:44 +norma = 45 +real = 218 + +[80] +oper = 2 +begin = 06.06.2020 09:57:04 +norma = 110 +vac_time = 10 +real = 52 + +[81] +oper = 5 +begin = 06.06.2020 10:49:50 +norma = 25 +real = 11 + +[82] +oper = 6 +begin = 06.06.2020 11:01:06 +norma = 35 +real = 39 + +[83] +oper = 7 +begin = 06.06.2020 11:40:20 +norma = 30 +real = 62 + +[84] +oper = 8 +begin = 06.06.2020 12:42:32 +norma = 40 +vac_time = 9 +real = 46 + +[85] +oper = 25 +begin = 06.06.2020 13:28:59 +norma = 30 +real = 7 + +[86] +oper = 9 +begin = 06.06.2020 13:36:48 +norma = 0 +real = 33 + +[87] +oper = 10 +begin = 06.06.2020 14:10:34 +norma = 0 +real = 110 + +[88] +oper = 11 +begin = 06.06.2020 16:01:23 +norma = 0 +real = 169 + +[89] +oper = 12 +begin = 06.06.2020 18:50:34 +norma = 105 +real = 108 + +[90] +oper = 13 +begin = 06.06.2020 20:39:13 +norma = 45 +real = 19 + +[91] +oper = 14 +begin = 06.06.2020 20:58:19 +norma = 40 +vac_time = 8 +real = 33 + +[92] +oper = 15 +begin = 06.06.2020 21:31:24 +norma = 30 +real = 29 + +[93] +oper = 16 +begin = 06.06.2020 22:00:42 +norma = 40 +real = 36 + +[94] +oper = 1 +begin = 06.06.2020 22:37:04 +norma = 85 +real = 16 + +[95] +oper = 2 +begin = 06.06.2020 22:53:27 +norma = 110 +vac_time = 8 +real = 43 + +[96] +oper = 5 +begin = 06.06.2020 23:37:17 +norma = 25 +real = 11 + +[97] +oper = 6 +begin = 06.06.2020 23:49:02 +norma = 35 +real = 42 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.467 new file mode 100644 index 0000000..2482d0c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.467 @@ -0,0 +1,38 @@ +03:04:01 1591394641 祭 ० +03:04:03 1591394643 ⪫祭 ॣ '-2'(A) +03:04:04 1591394644 祭 ॣ '-2'(A) +03:07:47 1591394867 ⪫祭 ० ' ⮪ 㣨' +03:12:18 1591395138 祭 ० ᪠ +03:14:44 1591395284 ⪫祭 ० ᪠ (A) +03:16:00 1591395360 ⪫祭 ॣ '-2'(A) +04:14:00 1591398840 ⪫祭 ० (A) +11:01:35 1591423295 祭 ० ᪠ +11:04:02 1591423442 ⪫祭 ० ᪠ (A) +13:28:06 1591432086 祭 ॣ '-2'(A) +13:28:43 1591432123 ⪫祭 ॣ '-2'(A) +13:36:12 1591432572 祭 ० ࠧ +13:36:17 1591432577 祭 ० ' ⮪ 㣨' +13:56:34 1591433794 祭 ॣ '-2'(A) +14:10:34 1591434634 ⪫祭 ० ࠧ (A) +14:10:34 1591434634 祭 ⠭ ॣ +16:01:22 1591441282 祭 ० +16:01:23 1591441283 ⪫祭 ॣ '-2'(A) +16:01:24 1591441284 祭 ॣ '-2'(A) +17:03:26 1591445006 ⪫祭 ॣ '-2'(A) +18:50:27 1591451427 ⪫祭 ० (A) +18:50:35 1591451435 ⪫祭 ० ' ⮪ 㣨' +18:50:50 1591451450 祭 ० ᪠ +18:50:51 1591451451 祭 ० ᪠ +18:54:13 1591451653 ⪫祭 ० ᪠ (A) +21:30:28 1591461028 祭 ० ࠧ +21:31:47 1591461107 祭 ० ' ⮪ 㣨' +21:31:48 1591461108 祭 ॣ '-2'(A) +21:57:37 1591462657 ⪫祭 ० ࠧ (A) +22:00:43 1591462843 ⪫祭 ० ' ⮪ 㣨' +22:00:46 1591462846 ⪫祭 ॣ '-2'(A) +22:00:52 1591462852 祭 ० ᪠ +22:00:52 1591462852 祭 ० ᪠ +22:00:53 1591462853 祭 ० ᪠ +22:04:27 1591463067 ⪫祭 ० ᪠ (A) +23:49:22 1591469362 祭 ० ᪠ +23:53:48 1591469628 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200606.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.469 new file mode 100644 index 0000000..342c946 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200606.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.040 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.040 new file mode 100644 index 0000000..14d6537 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.040 @@ -0,0 +1,8 @@ +01:35:29 1591475729 1 10060 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 5050 9 6260 10 650 11 12 321427 +02:08:50 1591477730 0 A--32-129-2018 ॢ 1 +12:13:44 1591514024 3 14 +13:05:47 1591517147 0 A--32-067-2014 ॢ 0 +14:32:56 1591522376 1 10061 8 5030 9 6270 +17:46:01 1591533961 3 25 +17:58:29 1591534709 1 10061 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 5030 9 6270 10 650 11 12 321427 +18:32:01 1591536721 0 A--32-129-2018 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.041 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.041 new file mode 100644 index 0000000..522cb5e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.041 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.042 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.042 new file mode 100644 index 0000000..d6a478b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.042 @@ -0,0 +1,135 @@ +20 00:49:15 00:49:24 +Riz_sol= 7.2 + +21 00:49:31 00:49:38 +Rsk= 13.8 Rkk= 8.9 + +20 00:49:57 00:50:07 +Riz_sol= 7.1 + +21 00:50:13 00:50:21 +Rsk= 13.8 Rkk= 9.2 + +22 01:08:57 01:24:28 +P1= 35.9 T1=01:19:28 P2= 48.3 T2=01:24:28 Vs= 2.48 + +23 01:24:50 01:24:56 + + +24 01:25:11 01:25:36 + + +24 01:25:45 01:26:06 + + +24 01:26:49 01:27:24 + + +30 01:27:44 01:28:23 +Vst= 28.9 + +31 01:28:29 01:29:05 +Rom_sol= 15.4 + +41 01:29:27 01:29:32 +Ukz= 1.97 + +32 01:29:35 01:30:43 +Imax=10.9 Umax=50.0 T= 9.2 + +33 01:30:47 01:31:19 +Imin=16.0 Umin=25.0 T= 0.8 + +34 01:31:23 01:31:49 +V=301.2 T= 9.5 + +35 01:31:52 01:32:57 +Q= 55.0 T=12.2 + +36 01:33:01 01:33:38 +P1=0.30 T= 3.0 + +37 01:33:41 01:34:16 +T= 0.6 + +38 01:34:23 01:34:28 +t= 51.5 T= 0.5 + +39 01:34:30 01:34:36 +t= 51.2 T= 0.5 + +40 01:34:39 01:34:44 +t= 51.2 T= 0.7 + +21 12:13:28 12:13:36 +Rsk= 15.4 Rkk= 10.3 + +22 12:36:56 12:47:27 +P1= 20.9 T1=12:42:27 P2= 43.7 T2=12:47:27 Vs= 4.56 + +21 14:21:54 14:22:02 +Rsk= 14.8 Rkk= 9.4 + +22 15:10:37 15:26:08 +P1= 29.3 T1=15:21:08 P2= 38.6 T2=15:26:08 Vs= 1.86 + +20 16:53:33 16:53:43 +Riz_sol= 8.0 + +21 16:53:52 16:54:00 +Rsk= 14.3 Rkk= 8.9 + +22 17:29:58 17:45:29 +P1= 34.5 T1=17:40:29 P2= 45.2 T2=17:45:29 Vs= 2.14 + +23 17:46:19 17:46:26 + + +24 17:46:48 17:47:27 + + +30 17:47:45 17:48:23 +Vst= 28.9 + +31 17:48:29 17:49:07 +Rom_sol= 15.3 + +41 17:49:50 17:49:55 +Ukz= 2.51 + +41 17:51:08 17:51:28 +Ukz= 1.47 + +32 17:51:33 17:52:05 +Imax=10.0 Umax=50.7 T=10.1 + +32 17:52:12 17:52:44 +Imax=10.0 Umax=50.7 T=10.1 + +32 17:52:54 17:54:03 +Imax=10.8 Umax=50.0 T= 9.2 + +33 17:54:06 17:54:36 +Imin=16.0 Umin=25.0 T= 0.8 + +34 17:54:40 17:55:08 +V=301.2 T= 9.3 + +35 17:55:12 17:56:06 +Q= 54.8 T= 9.1 + +36 17:56:10 17:56:45 +P1=0.29 T= 2.9 + +37 17:56:49 17:57:22 +T= 0.6 + +38 17:57:26 17:57:31 +t= 51.5 T= 0.5 + +39 17:57:35 17:57:41 +t= 51.2 T= 0.4 + +40 17:57:45 17:57:51 +t= 51.2 T= 0.4 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.043 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.043 new file mode 100644 index 0000000..62b2011 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.043 @@ -0,0 +1,22 @@ +7 00:20:24 1591471224 +8 00:31:55 1591471915 +25 01:27:42 1591475262 +9 01:35:29 1591475729 +10 02:08:50 1591477730 +12 07:16:30 1591496190 +13 11:30:35 1591511435 +0 11:30:35 1591511435 +14 12:11:53 1591513913 +15 12:48:02 1591516082 +16 13:05:47 1591517147 +16 13:05:55 1591517155 +1 13:44:10 1591519450 +2 14:20:10 1591521610 +5 15:27:21 1591525641 +6 15:37:13 1591526233 +7 16:18:57 1591528737 +8 16:53:07 1591530787 +25 17:47:36 1591534056 +9 17:58:29 1591534709 +10 18:32:01 1591536721 +12 23:53:20 1591556000 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.044 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.044 new file mode 100644 index 0000000..753c7aa Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.044 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.045 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.045 new file mode 100644 index 0000000..a3fcb20 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.045 @@ -0,0 +1,4 @@ +30 01:25:36 1591475136 +30 01:26:06 1591475166 +55 17:52:05 1591534325 +55 17:52:44 1591534364 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.046 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.046 new file mode 100644 index 0000000..dfbfa8f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.046 @@ -0,0 +1,130 @@ +[14] +oper = 7 +begin = 07.06.2020 00:20:24 +norma = 30 +real = 11 + +[15] +oper = 8 +begin = 07.06.2020 00:31:55 +norma = 40 +vac_time = 18 +real = 55 + +[16] +oper = 25 +begin = 07.06.2020 01:27:42 +norma = 30 +real = 7 + +[17] +oper = 9 +begin = 07.06.2020 01:35:29 +norma = 0 +real = 33 + +[18] +oper = 10 +begin = 07.06.2020 02:08:50 +norma = 0 +real = 307 + +[19] +oper = 12 +begin = 07.06.2020 07:16:30 +norma = 105 +real = 254 + +[20] +oper = 13 +begin = 07.06.2020 11:30:35 +norma = 45 +real = 41 + +[21] +oper = 14 +begin = 07.06.2020 12:11:53 +norma = 40 +vac_time = 8 +real = 36 + +[22] +oper = 15 +begin = 07.06.2020 12:48:02 +norma = 30 +real = 17 + +[23] +oper = 16 +begin = 07.06.2020 13:05:47 +norma = 40 +real = 0 + +[24] +oper = 16 +begin = 07.06.2020 13:05:55 +norma = 40 +real = 38 + +[25] +oper = 1 +begin = 07.06.2020 13:44:10 +norma = 85 +real = 36 + +[26] +oper = 2 +begin = 07.06.2020 14:20:10 +norma = 110 +vac_time = 8 +real = 67 + +[27] +oper = 5 +begin = 07.06.2020 15:27:21 +norma = 25 +real = 9 + +[28] +oper = 6 +begin = 07.06.2020 15:37:13 +norma = 35 +real = 41 + +[29] +oper = 7 +begin = 07.06.2020 16:18:57 +norma = 30 +real = 34 + +[30] +oper = 8 +begin = 07.06.2020 16:53:07 +norma = 40 +vac_time = 8 +real = 54 + +[31] +oper = 25 +begin = 07.06.2020 17:47:36 +norma = 30 +real = 10 + +[32] +oper = 9 +begin = 07.06.2020 17:58:29 +norma = 0 +real = 33 + +[33] +oper = 10 +begin = 07.06.2020 18:32:01 +norma = 0 +real = 321 + +[34] +oper = 12 +begin = 07.06.2020 23:53:20 +norma = 105 +real = 264 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.047 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.047 new file mode 100644 index 0000000..e66574d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.047 @@ -0,0 +1,68 @@ +01:25:13 1591475113 祭 ॣ '-2'(A) +01:25:37 1591475137 ⪫祭 ॣ '-2'(A) +01:25:46 1591475146 祭 ॣ '-2'(A) +01:26:07 1591475167 ⪫祭 ॣ '-2'(A) +01:26:50 1591475210 祭 ॣ '-2'(A) +01:27:25 1591475245 ⪫祭 ॣ '-2'(A) +01:34:57 1591475697 祭 ० ࠧ +01:35:01 1591475701 祭 ० ' ⮪ 㣨' +01:36:53 1591475813 祭 ॣ '-2'(A) +02:08:50 1591477730 ⪫祭 ० ࠧ (A) +02:08:50 1591477730 祭 ⠭ ॣ +07:06:15 1591495575 祭 ० +07:06:16 1591495576 ⪫祭 ॣ '-2'(A) +07:06:17 1591495577 祭 ॣ '-2'(A) +07:16:31 1591496191 ⪫祭 ० ' ⮪ 㣨' +07:16:33 1591496193 ⪫祭 ॣ '-2'(A) +07:16:55 1591496215 祭 ० ᪠ +07:16:56 1591496216 祭 ० ᪠ +07:20:19 1591496419 ⪫祭 ० ᪠ (A) +08:16:15 1591499775 ⪫祭 ० (A) +12:47:54 1591516074 祭 ० ࠧ +12:47:56 1591516076 祭 ० ' ⮪ 㣨' +12:48:50 1591516130 祭 ॣ '-2'(A) +13:05:47 1591517147 ⪫祭 ० ࠧ (A) +13:05:57 1591517157 ⪫祭 ० ' ⮪ 㣨' +13:06:00 1591517160 ⪫祭 ॣ '-2'(A) +13:06:43 1591517203 祭 ० ᪠ +13:06:44 1591517204 祭 ० ᪠ +13:06:44 1591517204 祭 ० ᪠ +13:06:44 1591517204 祭 ० ᪠ +13:06:44 1591517204 祭 ० ᪠ +13:07:38 1591517258 ⪫祭 ० ᪠ +13:07:41 1591517261 祭 ० ᪠ +13:07:43 1591517263 . ⪫祭 ० ᪠ (A) +13:07:53 1591517273 祭 ० ᪠ +13:07:53 1591517273 祭 ० ᪠ +13:09:31 1591517371 ⪫祭 ० ᪠ +13:09:33 1591517373 祭 ० ᪠ +13:09:39 1591517379 ⪫祭 ० ᪠ +13:09:40 1591517380 祭 ० ᪠ +13:09:43 1591517383 ⪫祭 ० ᪠ +15:37:45 1591526265 祭 ० ᪠ +15:37:45 1591526265 祭 ० ᪠ +15:37:46 1591526266 祭 ० ᪠ +15:38:08 1591526288 祭 ० ᪠ +15:38:08 1591526288 祭 ० ᪠ +15:38:09 1591526289 祭 ० ᪠ +15:38:09 1591526289 祭 ० ᪠ +15:41:07 1591526467 ⪫祭 ० ᪠ (A) +15:44:19 1591526659 祭 ० ᪠ +15:44:19 1591526659 ⪫祭 ० ᪠ (A) +17:46:51 1591534011 祭 ॣ '-2'(A) +17:47:28 1591534048 ⪫祭 ॣ '-2'(A) +17:58:01 1591534681 祭 ० ࠧ +17:58:02 1591534682 祭 ० ' ⮪ 㣨' +18:00:03 1591534803 祭 ॣ '-2'(A) +18:32:01 1591536721 ⪫祭 ० ࠧ (A) +18:32:01 1591536721 祭 ⠭ ॣ +23:43:16 1591555396 祭 ० +23:43:17 1591555397 ⪫祭 ॣ '-2'(A) +23:43:18 1591555398 祭 ॣ '-2'(A) +23:51:29 1591555889 ⪫祭 ० ' ⮪ 㣨' +23:53:24 1591556004 ⪫祭 ॣ '-2'(A) +23:53:30 1591556010 ⪫祭 ० +23:53:50 1591556030 祭 ० ᪠ +23:53:50 1591556030 祭 ० ᪠ +23:53:50 1591556030 祭 ० ᪠ +23:56:22 1591556182 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.049 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.049 new file mode 100644 index 0000000..6657a45 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.049 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.050 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.050 new file mode 100644 index 0000000..d78527b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.050 @@ -0,0 +1,8 @@ +01:35:59 1591475759 1 10114 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4070 9 5000 10 650 11 12 321602 +02:09:16 1591477756 0 A--32-129-2018 ॢ 1 +11:12:28 1591510348 3 14 +12:07:26 1591513646 0 A--32-067-2014 ॢ 0 +13:54:36 1591520076 1 10115 3 25 9 5550 +16:20:14 1591528814 8 4360 +17:19:34 1591532374 1 10115 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4360 9 5550 10 650 11 12 321602 +17:53:20 1591534400 0 A--32-129-2018 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.051 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.051 new file mode 100644 index 0000000..801a32a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.051 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.052 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.052 new file mode 100644 index 0000000..eab9180 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.052 @@ -0,0 +1,117 @@ +20 00:39:36 00:39:46 +Riz_sol= 8951.0 + +21 00:40:19 00:40:27 +Rsk= 21.9 Rkk= 16.2 + +22 01:09:53 01:25:01 +P1= 34.8 T1=01:20:01 P2= 45.7 T2=01:25:01 Vs= 2.17 + +23 01:25:18 01:25:24 + + +24 01:25:58 01:26:31 + + +30 01:26:49 01:27:29 +Vst= 29.7 + +31 01:27:36 01:28:15 +Rom_sol= 14.1 + +41 01:29:06 01:29:11 +Ukz= 1.34 + +32 01:29:19 01:30:25 +Imax=11.3 Umax=50.0 T= 9.4 + +33 01:30:31 01:31:05 +Imin=16.4 Umin=25.1 T= 0.8 + +34 01:31:10 01:31:38 +V=301.3 T= 9.7 + +35 01:31:42 01:32:49 +Q= 54.8 T= 9.5 + +36 01:32:54 01:33:42 +P1=0.28 T= 3.0 + +37 01:33:47 01:34:20 +T= 0.6 + +38 01:34:25 01:34:32 +t= 51.7 T= 0.7 + +39 01:34:36 01:34:52 +tcam= 51.1 Tcam= 0.7 tfl= 51.6 Tfl= 0.9 + +40 01:34:56 01:35:03 +t= 51.6 T= 0.7 + +21 11:12:43 11:12:51 +Rsk= 22.2 Rkk= 16.5 + +22 11:34:44 11:44:52 +P1= 18.3 T1=11:39:52 P2= 41.2 T2=11:44:52 Vs= 4.58 + +21 13:54:54 13:55:01 +Rsk= 22.3 Rkk= 16.8 + +22 14:43:00 14:53:08 +P1= 16.8 T1=14:48:08 P2= 30.2 T2=14:53:08 Vs= 2.66 + +20 16:20:25 16:20:35 +Riz_sol= 3202.0 + +21 16:20:43 16:20:50 +Rsk= 22.4 Rkk= 16.7 + +22 16:58:53 17:09:00 +P1= 18.0 T1=17:04:00 P2= 30.1 T2=17:09:00 Vs= 2.41 + +23 17:09:26 17:09:32 + + +24 17:10:08 17:10:31 + + +24 17:10:37 17:11:12 + + +30 17:11:21 17:12:01 +Vst= 29.5 + +31 17:12:05 17:12:44 +Rom_sol= 14.1 + +41 17:13:09 17:13:14 +Ukz= 1.36 + +32 17:13:19 17:14:26 +Imax=11.3 Umax=50.0 T= 9.2 + +33 17:14:28 17:14:58 +Imin=16.4 Umin=25.2 T= 1.0 + +34 17:15:00 17:15:29 +V=301.3 T= 9.7 + +35 17:15:31 17:16:38 +Q= 54.5 T= 9.1 + +36 17:16:42 17:17:30 +P1=0.29 T= 3.1 + +37 17:17:32 17:18:06 +T= 0.7 + +38 17:18:09 17:18:17 +t= 51.7 T= 0.7 + +39 17:18:19 17:18:35 +tcam= 51.3 Tcam= 0.7 tfl= 51.6 Tfl= 1.0 + +40 17:18:38 17:18:49 +t= 51.6 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.053 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.053 new file mode 100644 index 0000000..9b36574 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.053 @@ -0,0 +1,22 @@ +7 00:12:38 1591470758 +8 00:32:17 1591471937 +25 01:26:45 1591475205 +9 01:35:59 1591475759 +10 02:09:17 1591477757 +12 06:21:44 1591492904 +13 10:43:20 1591508600 +0 10:43:20 1591508600 +14 11:07:24 1591510044 +15 11:47:44 1591512464 +16 12:07:26 1591513646 +16 12:08:22 1591513702 +1 12:41:36 1591515696 +2 13:49:27 1591519767 +5 14:56:26 1591523786 +6 15:09:23 1591524563 +7 15:54:45 1591527285 +8 16:12:39 1591528359 +25 17:11:19 1591531879 +9 17:19:34 1591532374 +10 17:53:20 1591534400 +12 22:45:01 1591551901 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.054 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.054 new file mode 100644 index 0000000..fb0fa94 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.054 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.055 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.055 new file mode 100644 index 0000000..ff1c205 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.055 @@ -0,0 +1,4 @@ +4 00:39:59 1591472399 +25 17:10:05 1591531805 +33 17:10:31 1591531831 +47 17:13:00 1591531980 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.056 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.056 new file mode 100644 index 0000000..6e8b437 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.056 @@ -0,0 +1,131 @@ +[37] +oper = 7 +begin = 07.06.2020 00:12:38 +norma = 30 +real = 19 + +[38] +oper = 8 +begin = 07.06.2020 00:32:17 +norma = 40 +vac_time = 8 +real = 54 + +[39] +oper = 25 +begin = 07.06.2020 01:26:45 +norma = 30 +real = 9 + +[40] +oper = 9 +begin = 07.06.2020 01:35:59 +norma = 0 +real = 33 + +[41] +oper = 10 +begin = 07.06.2020 02:09:17 +norma = 0 +real = 252 + +[42] +oper = 12 +begin = 07.06.2020 06:21:44 +norma = 105 +real = 261 + +[43] +oper = 13 +begin = 07.06.2020 10:43:20 +norma = 45 +real = 24 + +[44] +oper = 14 +begin = 07.06.2020 11:07:24 +norma = 40 +vac_time = 8 +real = 40 + +[45] +oper = 15 +begin = 07.06.2020 11:47:44 +norma = 30 +real = 19 + +[46] +oper = 16 +begin = 07.06.2020 12:07:26 +norma = 40 +real = 0 + +[47] +oper = 16 +begin = 07.06.2020 12:08:22 +norma = 40 +real = 33 + +[48] +oper = 1 +begin = 07.06.2020 12:41:36 +norma = 85 +real = 67 + +[49] +oper = 2 +begin = 07.06.2020 13:49:27 +norma = 110 +vac_time = 9 +real = 66 + +[50] +oper = 5 +begin = 07.06.2020 14:56:26 +norma = 25 +real = 12 + +[51] +oper = 6 +begin = 07.06.2020 15:09:23 +norma = 35 +real = 45 + +[52] +oper = 7 +begin = 07.06.2020 15:54:45 +norma = 30 +real = 17 + +[53] +oper = 8 +begin = 07.06.2020 16:12:39 +norma = 40 +vac_time = 9 +vac_avg10 = 8.8 +real = 58 + +[54] +oper = 25 +begin = 07.06.2020 17:11:19 +norma = 30 +real = 8 + +[55] +oper = 9 +begin = 07.06.2020 17:19:34 +norma = 0 +real = 33 + +[56] +oper = 10 +begin = 07.06.2020 17:53:20 +norma = 0 +real = 291 + +[57] +oper = 12 +begin = 07.06.2020 22:45:01 +norma = 105 +real = 258 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.057 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.057 new file mode 100644 index 0000000..aa10f32 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.057 @@ -0,0 +1,57 @@ +01:25:59 1591475159 祭 ॣ '-2'(A) +01:26:32 1591475192 ⪫祭 ॣ '-2'(A) +01:35:22 1591475722 祭 ० ࠧ +01:35:25 1591475725 祭 ० ' ⮪ 㣨' +01:37:19 1591475839 祭 ॣ '-2'(A) +02:09:16 1591477756 ⪫祭 ० ࠧ (A) +02:09:17 1591477757 祭 ⠭ ॣ +06:10:58 1591492258 祭 ० +06:10:59 1591492259 ⪫祭 ॣ '-2'(A) +06:11:00 1591492260 祭 ॣ '-2'(A) +06:14:12 1591492452 ⪫祭 ० ' ⮪ 㣨' +06:21:49 1591492909 ⪫祭 ॣ '-2'(A) +06:22:35 1591492955 祭 ० ᪠ +06:24:56 1591493096 ⪫祭 ० ᪠ (A) +07:20:58 1591496458 ⪫祭 ० (A) +11:46:52 1591512412 祭 ० ࠧ +11:46:54 1591512414 祭 ० ' ⮪ 㣨' +11:48:33 1591512513 祭 ॣ '-2'(A) +12:07:26 1591513646 ⪫祭 ० ࠧ (A) +12:07:50 1591513670 ⪫祭 ० ' ⮪ 㣨' +12:08:27 1591513707 ⪫祭 ॣ '-2'(A) +12:08:30 1591513710 祭 ० ᪠ +12:08:30 1591513710 祭 ० ᪠ +12:10:50 1591513850 ⪫祭 ० ᪠ (A) +15:09:40 1591524580 祭 ० ᪠ +15:09:40 1591524580 祭 ० ᪠ +15:12:00 1591524720 ⪫祭 ० ᪠ (A) +17:09:40 1591531780 祭 ॣ '-2'(A) +17:10:06 1591531806 ⪫祭 ॣ '-2'(A) +17:10:09 1591531809 祭 ॣ '-2'(A) +17:10:32 1591531832 ⪫祭 ॣ '-2'(A) +17:10:39 1591531839 祭 ॣ '-2'(A) +17:11:13 1591531873 ⪫祭 ॣ '-2'(A) +17:19:07 1591532347 祭 ० ࠧ +17:19:08 1591532348 祭 ० ' ⮪ 㣨' +17:21:23 1591532483 祭 ॣ '-2'(A) +17:53:20 1591534400 ⪫祭 ० ࠧ (A) +17:53:21 1591534401 祭 ⠭ ॣ +19:17:54 1591539474 ⪫祭 ० ' ⮪ 㣨' +19:18:10 1591539490 ⪫祭 ॣ '-2' +19:18:22 1591539502 祭 ॣ '-2' +19:18:24 1591539504 祭 ० ' ⮪ 㣨' +21:15:36 1591546536 ⪫祭 ० ' ⮪ 㣨' +21:15:39 1591546539 ⪫祭 ॣ '-2' +21:15:49 1591546549 祭 ॣ '-2' +21:15:51 1591546551 祭 ० ' ⮪ 㣨' +22:11:45 1591549905 ⪫祭 ० ' ⮪ 㣨' +22:12:00 1591549920 祭 ० ' ⮪ 㣨' +22:30:29 1591551029 祭 ० +22:30:29 1591551029 ⪫祭 ॣ '-2'(A) +22:30:30 1591551030 祭 ॣ '-2'(A) +22:45:03 1591551903 ⪫祭 ० ' ⮪ 㣨' +22:45:05 1591551905 ⪫祭 ॣ '-2'(A) +22:45:20 1591551920 祭 ० ᪠ +22:45:20 1591551920 祭 ० ᪠ +22:47:42 1591552062 ⪫祭 ० ᪠ (A) +23:40:29 1591555229 ⪫祭 ० (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.059 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.059 new file mode 100644 index 0000000..004e84b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.059 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.100 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.100 new file mode 100644 index 0000000..299bfa2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.100 @@ -0,0 +1,6 @@ +00:54:51 1591473291 1 11129 3 25 4 1 7 770 9 5060 10 650 11 +03:50:49 1591483849 1 11129 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4570 9 5060 10 650 11 12 320346 +04:24:23 1591485863 0 A--32-129-2018 ॢ 1 +14:41:42 1591522902 1 11130 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 9 4410 10 690 +18:27:43 1591536463 1 11130 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4570 9 4410 10 690 11 12 320346 +19:10:29 1591539029 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.101 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.101 new file mode 100644 index 0000000..ef820b2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.101 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.102 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.102 new file mode 100644 index 0000000..b5c5a34 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.102 @@ -0,0 +1,114 @@ +21 00:53:50 00:53:57 +Rsk= 20.3 Rkk= 18.6 + +22 01:30:07 01:45:12 +P1= 55.6 T1=01:40:12 P2= 69.3 T2=01:45:12 Vs= 2.73 + +20 02:51:36 02:51:46 +Riz_sol= 6801.0 + +21 02:51:52 02:51:59 +Rsk= 20.6 Rkk= 19.0 + +22 03:25:03 03:40:09 +P1= 42.5 T1=03:35:08 P2= 56.2 T2=03:40:09 Vs= 2.74 + +23 03:40:29 03:40:35 + + +24 03:40:44 03:41:21 + + +30 03:41:33 03:42:16 +Vst= 28.6 + +31 03:42:21 03:43:01 +Rom_sol= 12.9 + +41 03:43:35 03:43:40 +Ukz= 1.74 + +32 03:43:42 03:45:21 +Imax=11.3 Umax=50.0 T= 9.4 + +33 03:45:25 03:45:57 +Imin=16.5 Umin=25.1 T= 0.8 + +34 03:46:01 03:46:35 +V=301.8 T= 9.7 + +35 03:46:37 03:47:44 +Q= 54.7 T= 9.0 + +40 03:48:14 03:48:21 +t= 51.6 T= 0.5 + +39 03:48:24 03:48:31 +t= 51.5 T= 0.8 + +38 03:48:35 03:48:42 +t= 51.6 T= 0.5 + +37 03:48:45 03:49:31 +T= 0.6 + +36 03:49:35 03:50:13 +P1=0.29 T= 3.0 + +20 14:42:33 14:42:42 +Riz_sol= 367.8 + +21 14:43:00 14:43:07 +Rsk= 21.0 Rkk= 19.3 + +22 16:09:56 16:25:01 +P1= 79.1 T1=16:20:01 P2=109.8 T2=16:25:01 Vs= 6.15 + +22 16:49:57 17:05:03 +P1= 58.6 T1=17:00:03 P2= 81.3 T2=17:05:03 Vs= 4.53 + +22 17:25:00 17:40:05 +P1= 47.0 T1=17:35:05 P2= 65.4 T2=17:40:05 Vs= 3.68 + +22 18:01:45 18:16:51 +P1= 38.6 T1=18:11:51 P2= 53.7 T2=18:16:51 Vs= 3.00 + +23 18:17:22 18:17:29 + + +24 18:17:37 18:18:15 + + +30 18:18:44 18:19:31 +Vst= 28.5 + +31 18:19:41 18:20:19 +Rom_sol= 12.9 + +32 18:20:59 18:22:06 +Imax=11.3 Umax=50.0 T= 9.2 + +33 18:22:25 18:22:54 +Imin=16.4 Umin=25.1 T= 0.8 + +34 18:23:01 18:23:29 +V=301.8 T= 9.5 + +35 18:23:35 18:24:47 +Q= 54.8 T=12.1 + +36 18:24:55 18:25:30 +P1=0.28 T= 3.1 + +37 18:25:35 18:26:13 +T= 0.7 + +38 18:26:18 18:26:25 +t= 51.6 T= 0.7 + +39 18:26:30 18:26:36 +t= 51.5 T= 0.7 + +40 18:26:44 18:26:50 +t= 51.6 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.103 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.103 new file mode 100644 index 0000000..df6e3e1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.103 @@ -0,0 +1,17 @@ +1 00:02:13 1591470133 +2 00:50:42 1591473042 +5 01:46:41 1591476401 +6 01:55:54 1591476954 +7 02:30:33 1591479033 +8 02:45:19 1591479919 +25 03:41:30 1591483290 +9 03:50:49 1591483849 +10 04:24:24 1591485864 +12 08:31:28 1591500688 +13 12:53:59 1591516439 +0 12:53:59 1591516439 +8 14:40:33 1591522833 +25 18:18:39 1591535919 +9 18:27:43 1591536463 +10 19:10:29 1591539029 +11 22:40:34 1591551634 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.104 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.104 new file mode 100644 index 0000000..da00a70 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.104 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.106 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.106 new file mode 100644 index 0000000..22a4190 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.106 @@ -0,0 +1,99 @@ +[13] +oper = 1 +begin = 07.06.2020 00:02:13 +norma = 85 +real = 48 + +[14] +oper = 2 +begin = 07.06.2020 00:50:42 +norma = 110 +vac_time = 8 +real = 55 + +[15] +oper = 5 +begin = 07.06.2020 01:46:41 +norma = 25 +real = 9 + +[16] +oper = 6 +begin = 07.06.2020 01:55:54 +norma = 35 +real = 34 + +[17] +oper = 7 +begin = 07.06.2020 02:30:33 +norma = 30 +real = 14 + +[18] +oper = 8 +begin = 07.06.2020 02:45:19 +norma = 40 +vac_time = 8 +real = 56 + +[19] +oper = 25 +begin = 07.06.2020 03:41:30 +norma = 30 +real = 9 + +[20] +oper = 9 +begin = 07.06.2020 03:50:49 +norma = 0 +real = 33 + +[21] +oper = 10 +begin = 07.06.2020 04:24:24 +norma = 0 +real = 247 + +[22] +oper = 12 +begin = 07.06.2020 08:31:28 +norma = 105 +real = 262 + +[23] +oper = 13 +begin = 07.06.2020 12:53:59 +norma = 45 +real = 106 + +[24] +oper = 8 +begin = 07.06.2020 14:40:33 +norma = 40 +vac_time = 9 +real = 218 + +[25] +oper = 25 +begin = 07.06.2020 18:18:39 +norma = 30 +real = 9 + +[26] +oper = 9 +begin = 07.06.2020 18:27:43 +norma = 0 +real = 42 + +[27] +oper = 10 +begin = 07.06.2020 19:10:29 +norma = 0 +real = 210 + +[28] +oper = 11 +begin = 07.06.2020 22:40:34 +norma = 0 +real = 167 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.107 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.107 new file mode 100644 index 0000000..7f7f577 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.107 @@ -0,0 +1,23 @@ +03:40:46 1591483246 祭 ॣ '-2'(A) +03:41:22 1591483282 ⪫祭 ॣ '-2'(A) +03:50:29 1591483829 祭 ० ࠧ +03:50:32 1591483832 祭 ० ' ⮪ 㣨' +03:52:26 1591483946 祭 ॣ '-2'(A) +04:24:23 1591485863 ⪫祭 ० ࠧ (A) +04:24:24 1591485864 祭 ⠭ ॣ +08:20:17 1591500017 祭 ० +08:20:18 1591500018 ⪫祭 ॣ '-2'(A) +08:20:19 1591500019 祭 ॣ '-2'(A) +08:31:30 1591500690 ⪫祭 ० ' ⮪ 㣨' +08:31:32 1591500692 ⪫祭 ॣ '-2'(A) +09:30:17 1591504217 ⪫祭 ० (A) +18:17:39 1591535859 祭 ॣ '-2'(A) +18:18:15 1591535895 ⪫祭 ॣ '-2'(A) +18:27:07 1591536427 祭 ० ࠧ +18:27:09 1591536429 祭 ० ' ⮪ 㣨' +18:53:24 1591538004 祭 ॣ '-2'(A) +19:10:29 1591539029 ⪫祭 ० ࠧ (A) +19:10:29 1591539029 祭 ⠭ ॣ +22:40:33 1591551633 祭 ० +22:40:34 1591551634 ⪫祭 ॣ '-2'(A) +22:40:35 1591551635 祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.109 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.109 new file mode 100644 index 0000000..159dc99 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.109 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.120 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.120 new file mode 100644 index 0000000..66962cf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.120 @@ -0,0 +1,9 @@ +00:52:28 1591473148 8 4410 12 321438 +03:26:50 1591482410 1 10852 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 4410 9 4260 10 560 11 12 321438 +03:56:03 1591484163 0 A--32-106-2018 ॢ 2 +12:14:00 1591514040 1 10853 4 2 7 770 9 4320 10 690 11 +13:10:31 1591517431 11 +13:20:58 1591518058 1 10853 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4410 9 4320 10 690 11 12 321438 +14:03:31 1591520611 0 A--32-031-2016 ॢ 5 +23:04:13 1591553053 1 10853 7 870 9 5850 10 770 11 12 320715 +23:41:36 1591555296 1 10854 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.121 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.121 new file mode 100644 index 0000000..71c76a3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.121 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.122 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.122 new file mode 100644 index 0000000..d68f7c8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.122 @@ -0,0 +1,111 @@ +22 00:30:29 00:45:36 +P1= 44.6 T1=00:40:36 P2= 57.9 T2=00:45:36 Vs= 2.66 + +20 02:06:03 02:06:12 +Riz_sol= 71.2 + +21 02:06:19 02:06:22 +Rsk= 12.1 Rkk= 8.2 + +22 03:00:28 03:15:35 +P1= 45.4 T1=03:10:35 P2= 58.6 T2=03:15:35 Vs= 2.64 + +23 03:17:47 03:17:52 + + +24 03:18:02 03:18:37 + + +30 03:18:51 03:19:16 +Vst= 30.8 + +31 03:19:27 03:20:07 +Rom_sol= 13.8 + +41 03:20:44 03:20:49 +Ukz= 1.56 + +32 03:20:53 03:21:38 +Imax=11.0 Umax=50.0 T= 9.0 + +33 03:21:42 03:22:07 +Imin=16.0 Umin=24.9 T= 0.5 + +34 03:22:09 03:22:32 +V=300.1 T= 9.4 + +40 03:22:35 03:22:42 +t= 53.4 T= 0.5 + +39 03:22:45 03:23:01 +tcam= 53.1 Tcam= 0.5 tfl= 53.4 Tfl= 0.5 + +38 03:23:05 03:23:13 +t= 53.4 T= 0.5 + +37 03:23:17 03:23:47 +T= 0.9 + +36 03:23:50 03:24:31 +P1=0.29 T= 2.9 + +35 03:24:35 03:26:09 +Q= 52.6 T= 9.4 + +20 12:19:02 12:19:11 +Riz_sol= 4975.1 + +21 12:19:18 12:19:21 +Rsk= 12.6 Rkk= 8.5 + +22 12:55:04 13:10:11 +P1= 52.8 T1=13:05:11 P2= 65.4 T2=13:10:11 Vs= 2.51 + +23 13:10:56 13:11:01 + + +24 13:11:32 13:12:13 + + +30 13:12:51 13:13:22 +Vst= 31.1 + +31 13:13:28 13:14:08 +Rom_sol= 9.6 + +41 13:14:44 13:14:49 +Ukz= 1.33 + +32 13:14:51 13:15:32 +Imax=11.0 Umax=50.0 T= 9.0 + +33 13:15:36 13:16:00 +Imin=16.0 Umin=24.9 T= 0.5 + +34 13:16:17 13:16:49 +V=300.2 T= 9.4 + +35 13:16:59 13:18:21 +Q= 53.5 T= 9.4 + +36 13:18:24 13:18:57 +P1=0.29 T= 2.9 + +37 13:19:00 13:19:31 +T= 0.9 + +38 13:19:35 13:19:49 +t= 53.4 T= 0.5 + +39 13:19:52 13:20:11 +tcam= 53.1 Tcam= 0.5 tfl= 53.4 Tfl= 0.5 + +40 13:20:13 13:20:20 +t= 53.5 T= 0.5 + +21 22:57:09 22:57:12 +Rsk= 11.9 Rkk= 8.0 + +22 23:25:05 23:40:12 +P1= 48.9 T1=23:35:12 P2= 59.7 T2=23:40:12 Vs= 2.16 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.123 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.123 new file mode 100644 index 0000000..0616233 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.123 @@ -0,0 +1,21 @@ +5 00:53:50 1591473230 +6 01:05:43 1591473943 +7 01:46:00 1591476360 +8 02:04:07 1591477447 +25 03:18:48 1591481928 +9 03:26:50 1591482410 +10 03:56:03 1591484163 +12 07:46:05 1591497965 +13 10:50:32 1591509032 +0 10:50:32 1591509032 +8 12:07:28 1591513648 +25 13:12:49 1591517569 +9 13:20:58 1591518058 +10 14:03:32 1591520612 +11 17:31:59 1591533119 +12 20:18:57 1591543137 +13 22:07:06 1591549626 +0 22:07:06 1591549626 +2 22:55:04 1591552504 +5 23:42:26 1591555346 +6 23:54:08 1591556048 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.124 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.124 new file mode 100644 index 0000000..d937ea4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.124 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.126 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.126 new file mode 100644 index 0000000..01c41f2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.126 @@ -0,0 +1,117 @@ +[20] +oper = 5 +begin = 07.06.2020 00:53:50 +norma = 25 +real = 11 + +[21] +oper = 6 +begin = 07.06.2020 01:05:43 +norma = 35 +real = 40 + +[22] +oper = 7 +begin = 07.06.2020 01:46:00 +norma = 30 +real = 18 + +[23] +oper = 8 +begin = 07.06.2020 02:04:07 +norma = 40 +vac_time = 7 +real = 74 + +[24] +oper = 25 +begin = 07.06.2020 03:18:48 +norma = 30 +real = 8 + +[25] +oper = 9 +begin = 07.06.2020 03:26:50 +norma = 0 +real = 29 + +[26] +oper = 10 +begin = 07.06.2020 03:56:03 +norma = 0 +real = 230 + +[27] +oper = 12 +begin = 07.06.2020 07:46:05 +norma = 105 +real = 184 + +[28] +oper = 13 +begin = 07.06.2020 10:50:32 +norma = 45 +real = 76 + +[29] +oper = 8 +begin = 07.06.2020 12:07:28 +norma = 40 +vac_time = 12 +real = 65 + +[30] +oper = 25 +begin = 07.06.2020 13:12:49 +norma = 30 +real = 8 + +[31] +oper = 9 +begin = 07.06.2020 13:20:58 +norma = 0 +real = 42 + +[32] +oper = 10 +begin = 07.06.2020 14:03:32 +norma = 0 +real = 208 + +[33] +oper = 11 +begin = 07.06.2020 17:31:59 +norma = 0 +real = 166 + +[34] +oper = 12 +begin = 07.06.2020 20:18:57 +norma = 105 +real = 108 + +[35] +oper = 13 +begin = 07.06.2020 22:07:06 +norma = 45 +real = 47 + +[36] +oper = 2 +begin = 07.06.2020 22:55:04 +norma = 110 +vac_time = 7 +real = 47 + +[37] +oper = 5 +begin = 07.06.2020 23:42:26 +norma = 25 +real = 11 + +[38] +oper = 6 +begin = 07.06.2020 23:54:08 +norma = 35 +real = 33 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.127 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.127 new file mode 100644 index 0000000..7b503d8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.127 @@ -0,0 +1,50 @@ +01:06:34 1591473994 祭 ० ᪠ +01:08:51 1591474131 ⪫祭 ० ᪠ (A) +03:18:03 1591481883 祭 ॣ '-2'(A) +03:18:38 1591481918 ⪫祭 ॣ '-2'(A) +03:26:26 1591482386 祭 ० ࠧ +03:26:29 1591482389 祭 ० ' ⮪ 㣨' +03:28:02 1591482482 祭 ॣ '-2'(A) +03:56:02 1591484162 祭 ⠭ ॣ +03:56:03 1591484163 ⪫祭 ० ࠧ (A) +07:29:26 1591496966 祭 ० +07:29:27 1591496967 ⪫祭 ॣ '-2'(A) +07:29:28 1591496968 祭 ॣ '-2'(A) +07:29:36 1591496976 ⪫祭 ० ' ⮪ 㣨' +07:46:09 1591497969 ⪫祭 ॣ '-2'(A) +07:46:28 1591497988 祭 ० ᪠ +07:46:28 1591497988 祭 ० ᪠ +07:48:44 1591498124 ⪫祭 ० ᪠ (A) +08:39:29 1591501169 ⪫祭 ० (A) +12:14:02 1591514042 : 㦥 +13:10:33 1591517433 : +13:11:34 1591517494 祭 ॣ '-2'(A) +13:12:13 1591517533 ⪫祭 ॣ '-2'(A) +13:20:40 1591518040 祭 ० ࠧ +13:20:41 1591518041 祭 ० ' ⮪ 㣨' +13:46:28 1591519588 祭 ॣ '-2'(A) +14:03:31 1591520611 ⪫祭 ० ࠧ (A) +14:03:32 1591520612 祭 ⠭ ॣ +17:31:58 1591533118 祭 ० +17:31:59 1591533119 ⪫祭 ॣ '-2'(A) +17:32:00 1591533120 祭 ॣ '-2'(A) +19:24:00 1591539840 ⪫祭 ॣ '-2'(A) +20:18:55 1591543135 ⪫祭 ० (A) +20:18:59 1591543139 ⪫祭 ० ' ⮪ 㣨' +20:20:15 1591543215 祭 ० ᪠ +20:20:15 1591543215 祭 ० ᪠ +20:20:15 1591543215 祭 ० ᪠ +20:20:16 1591543216 祭 ० ᪠ +20:20:16 1591543216 祭 ० ᪠ +20:20:16 1591543216 祭 ० ᪠ +20:22:40 1591543360 ⪫祭 ० ᪠ (A) +23:04:15 1591553055 : 㦥 +23:54:32 1591556072 祭 ० ᪠ +23:54:32 1591556072 祭 ० ᪠ +23:54:32 1591556072 祭 ० ᪠ +23:54:32 1591556072 祭 ० ᪠ +23:54:32 1591556072 祭 ० ᪠ +23:54:32 1591556072 祭 ० ᪠ +23:56:32 1591556192 ⪫祭 ० ᪠ +23:56:33 1591556193 祭 ० ᪠ +23:56:41 1591556201 ⪫祭 ० ᪠ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.129 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.129 new file mode 100644 index 0000000..1f09403 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.129 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.460 new file mode 100644 index 0000000..308bbe1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.460 @@ -0,0 +1,7 @@ +02:03:18 1591477398 1 11483 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 4530 9 4960 10 690 11 12 1718 +02:46:03 1591479963 0 A--32-031-2016 ॢ 5 +11:33:14 1591511594 3 14 +12:22:53 1591514573 0 A--32-067-2014 ॢ 0 +15:19:36 1591525176 1 11484 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 9 6270 10 650 +18:19:02 1591535942 1 11484 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4530 9 6270 10 650 11 12 1718 +18:52:23 1591537943 0 A--32-129-2018 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.461 new file mode 100644 index 0000000..8a6a254 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.462 new file mode 100644 index 0000000..a67c352 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.462 @@ -0,0 +1,111 @@ +20 01:23:37 01:23:46 +Riz_sol= 448.7 + +21 01:23:52 01:23:55 +Rsk= 17.2 Rkk= 15.4 + +22 01:40:12 01:55:19 +P1= 51.4 T1=01:50:19 P2= 63.2 T2=01:55:19 Vs= 2.36 + +23 01:55:31 01:55:36 + + +24 01:55:44 01:56:20 + + +30 01:56:31 01:57:08 +Vst= 27.8 + +31 01:57:26 01:58:00 +Rom_sol= 13.1 + +32 01:58:35 01:59:13 +Imax=11.2 Umax=50.0 T= 9.0 + +33 01:59:21 01:59:38 +Imin=16.1 Umin=24.9 T= 0.5 + +34 01:59:42 02:00:04 +V=300.4 T= 9.4 + +35 02:00:08 02:01:04 +Q= 52.7 T= 9.4 + +36 02:01:08 02:01:39 +P1=0.29 T= 2.9 + +37 02:01:43 02:02:08 +T= 0.9 + +38 02:02:11 02:02:19 +t= 54.0 T= 0.5 + +39 02:02:23 02:02:39 +tcam= 53.7 Tcam= 0.5 tfl= 59.5 Tfl= 0.5 + +40 02:02:42 02:02:49 +t= 54.1 T= 0.5 + +21 11:33:31 11:33:34 +Rsk= 17.6 Rkk= 15.5 + +22 11:51:10 12:01:17 +P1= 18.7 T1=11:56:17 P2= 41.9 T2=12:01:17 Vs= 4.63 + +21 15:19:50 15:19:53 +Rsk= 17.6 Rkk= 15.2 + +22 16:05:00 16:15:08 +P1= 11.9 T1=16:10:08 P2= 24.6 T2=16:15:08 Vs= 2.54 + +20 17:31:39 17:31:47 +Riz_sol= 448.6 + +21 17:31:55 17:31:58 +Rsk= 17.3 Rkk= 15.2 + +22 18:00:16 18:10:23 +P1= 12.6 T1=18:05:23 P2= 26.2 T2=18:10:23 Vs= 2.73 + +23 18:10:46 18:10:51 + + +24 18:10:59 18:11:36 + + +30 18:11:57 18:12:22 +Vst= 27.3 + +31 18:12:30 18:13:15 +Rom_sol= 13.9 + +41 18:13:47 18:13:52 +Ukz= 1.59 + +32 18:13:55 18:14:31 +Imax=11.1 Umax=50.1 T= 9.0 + +33 18:14:35 18:15:02 +Imin=16.1 Umin=25.0 T= 0.5 + +34 18:15:10 18:15:33 +V=300.4 T= 9.4 + +35 18:15:36 18:16:33 +Q= 54.2 T= 9.4 + +36 18:16:36 18:17:06 +P1=0.29 T= 2.9 + +37 18:17:09 18:17:33 +T= 0.9 + +38 18:17:36 18:17:44 +t= 53.9 T= 0.5 + +39 18:17:47 18:18:04 +tcam= 53.4 Tcam= 0.5 tfl= 59.2 Tfl= 0.5 + +40 18:18:07 18:18:14 +t= 52.6 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.463 new file mode 100644 index 0000000..df99536 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.463 @@ -0,0 +1,21 @@ +7 00:31:05 1591471865 +8 01:18:36 1591474716 +25 01:56:29 1591476989 +9 02:03:18 1591477398 +10 02:46:03 1591479963 +11 06:29:29 1591493369 +12 09:16:32 1591503392 +13 11:02:13 1591509733 +0 11:02:13 1591509733 +14 11:30:21 1591511421 +15 12:02:33 1591513353 +16 12:27:01 1591514821 +1 13:03:46 1591517026 +2 15:17:22 1591525042 +5 16:16:20 1591528580 +6 16:59:18 1591531158 +7 17:04:38 1591531478 +8 17:21:46 1591532506 +25 18:11:53 1591535513 +9 18:19:02 1591535942 +10 18:52:24 1591537944 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.464 new file mode 100644 index 0000000..01a79ee Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.465 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.465 new file mode 100644 index 0000000..1023694 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.465 @@ -0,0 +1,3 @@ +17 01:22:31 1591474951 +17 01:22:48 1591474968 +17 01:23:13 1591474993 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.466 new file mode 100644 index 0000000..d5abae0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.466 @@ -0,0 +1,125 @@ +[98] +oper = 7 +begin = 07.06.2020 00:31:05 +norma = 30 +real = 47 + +[99] +oper = 8 +begin = 07.06.2020 01:18:36 +norma = 40 +vac_time = 9 +real = 37 + +[00] +oper = 25 +begin = 07.06.2020 01:56:29 +norma = 30 +real = 6 + +[01] +oper = 9 +begin = 07.06.2020 02:03:18 +norma = 0 +real = 42 + +[02] +oper = 10 +begin = 07.06.2020 02:46:03 +norma = 0 +real = 223 + +[03] +oper = 11 +begin = 07.06.2020 06:29:29 +norma = 0 +real = 167 + +[04] +oper = 12 +begin = 07.06.2020 09:16:32 +norma = 105 +real = 105 + +[05] +oper = 13 +begin = 07.06.2020 11:02:13 +norma = 45 +real = 28 + +[06] +oper = 14 +begin = 07.06.2020 11:30:21 +norma = 40 +vac_time = 8 +real = 32 + +[07] +oper = 15 +begin = 07.06.2020 12:02:33 +norma = 30 +real = 24 + +[08] +oper = 16 +begin = 07.06.2020 12:27:01 +norma = 40 +real = 36 + +[09] +oper = 1 +begin = 07.06.2020 13:03:46 +norma = 85 +real = 133 + +[10] +oper = 2 +begin = 07.06.2020 15:17:22 +norma = 110 +vac_time = 9 +real = 58 + +[11] +oper = 5 +begin = 07.06.2020 16:16:20 +norma = 25 +real = 42 + +[12] +oper = 6 +begin = 07.06.2020 16:59:18 +norma = 35 +real = 5 + +[13] +oper = 7 +begin = 07.06.2020 17:04:38 +norma = 30 +real = 17 + +[14] +oper = 8 +begin = 07.06.2020 17:21:46 +norma = 40 +vac_time = 11 +vac_avg10 = 8.8 +real = 50 + +[15] +oper = 25 +begin = 07.06.2020 18:11:53 +norma = 30 +real = 7 + +[16] +oper = 9 +begin = 07.06.2020 18:19:02 +norma = 0 +real = 33 + +[17] +oper = 10 +begin = 07.06.2020 18:52:24 +norma = 0 +real = 316 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.467 new file mode 100644 index 0000000..4fb49f4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.467 @@ -0,0 +1,37 @@ +01:55:46 1591476946 祭 ॣ '-2'(A) +01:56:22 1591476982 ⪫祭 ॣ '-2'(A) +02:02:58 1591477378 祭 ० ࠧ +02:03:00 1591477380 祭 ० ' ⮪ 㣨' +02:28:56 1591478936 祭 ॣ '-2'(A) +02:46:03 1591479963 ⪫祭 ० ࠧ (A) +02:46:03 1591479963 祭 ⠭ ॣ +06:29:28 1591493368 祭 ० +06:29:30 1591493370 ⪫祭 ॣ '-2'(A) +06:29:31 1591493371 祭 ॣ '-2'(A) +08:21:30 1591500090 ⪫祭 ॣ '-2'(A) +09:16:27 1591503387 ⪫祭 ० (A) +09:16:33 1591503393 ⪫祭 ० ' ⮪ 㣨' +09:17:59 1591503479 祭 ० ᪠ +09:24:01 1591503841 ⪫祭 ० ᪠ (A) +12:02:02 1591513322 祭 ० ࠧ +12:02:04 1591513324 祭 ० ' ⮪ 㣨' +12:03:21 1591513401 祭 ॣ '-2'(A) +12:22:53 1591514573 ⪫祭 ० ࠧ (A) +12:26:59 1591514819 ⪫祭 ० ' ⮪ 㣨' +12:27:04 1591514824 ⪫祭 ॣ '-2'(A) +12:27:30 1591514850 祭 ० ᪠ +12:27:30 1591514850 祭 ० ᪠ +12:27:31 1591514851 祭 ० ᪠ +12:37:03 1591515423 ⪫祭 ० ᪠ (A) +16:28:13 1591529293 祭 ० ᪠ +16:30:36 1591529436 ⪫祭 ० ᪠ (A) +18:11:01 1591535461 祭 ॣ '-2'(A) +18:11:37 1591535497 ⪫祭 ॣ '-2'(A) +18:18:22 1591535902 祭 ० ࠧ +18:18:25 1591535905 祭 ० ' ⮪ 㣨' +18:20:25 1591536025 祭 ॣ '-2'(A) +18:52:23 1591537943 ⪫祭 ० ࠧ (A) +18:52:24 1591537944 祭 ⠭ ॣ +23:51:58 1591555918 祭 ० +23:51:59 1591555919 ⪫祭 ॣ '-2'(A) +23:52:00 1591555920 祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200607.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.469 new file mode 100644 index 0000000..c7b454d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200607.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.100 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.100 new file mode 100644 index 0000000..d6c3494 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.100 @@ -0,0 +1,8 @@ +03:52:31 1591570351 1 11131 3 17 4 3 7 770 9 5040 10 770 11 +08:23:56 1591586636 2 Ti-6Al4VRR 12 321427 +08:31:39 1591587099 2 ᯥਬ +08:32:02 1591587122 2 Ti-6Al4VPW +08:32:15 1591587135 2 BT 3-1, 6, 8, 9, 14, 15, 16 +09:34:01 1591590841 2 Ti-6Al4VRR 7 870 +09:55:18 1591592118 1 11131 2 Ti-6Al4VRR 3 17 4 3 5 Ti 6 7 870 8 4570 9 5040 10 770 11 12 321427 +10:38:40 1591594720 0 A--32-179-2020 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.101 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.101 new file mode 100644 index 0000000..5d5f75c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.101 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.102 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.102 new file mode 100644 index 0000000..adcfd5f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.102 @@ -0,0 +1,60 @@ +21 03:50:49 03:50:56 +Rsk= 20.8 Rkk= 19.2 + +22 04:29:56 04:45:01 +P1= 32.3 T1=04:40:01 P2= 43.1 T2=04:45:01 Vs= 2.16 + +20 06:21:37 06:21:47 +Riz_sol= 9468.8 + +21 06:21:53 06:22:00 +Rsk= 21.7 Rkk= 20.2 + +22 06:50:02 07:05:07 +P1= 41.7 T1=07:00:07 P2= 54.1 T2=07:05:07 Vs= 2.49 + +22 09:35:00 09:45:06 +P1= 7.3 T1=09:40:05 P2= 19.3 T2=09:45:06 Vs= 2.40 + +23 09:45:34 09:45:41 + + +24 09:45:54 09:46:31 + + +30 09:46:42 09:47:27 +Vst= 28.6 + +31 09:47:57 09:48:52 +Rom_sol= 14.1 + +41 09:49:18 09:49:23 +Ukz= 0.97 + +32 09:49:26 09:50:33 +Imax=11.3 Umax=50.0 T= 9.2 + +33 09:50:39 09:51:07 +Imin=16.4 Umin=25.1 T= 0.8 + +34 09:51:11 09:51:42 +V=301.8 T= 9.6 + +35 09:51:45 09:52:47 +Q= 54.9 T= 9.2 + +36 09:52:52 09:53:32 +P1=0.30 T= 3.1 + +37 09:53:36 09:54:13 +T= 0.7 + +38 09:54:17 09:54:24 +t= 51.6 T= 0.5 + +39 09:54:29 09:54:35 +t= 51.6 T= 0.5 + +40 09:54:39 09:54:45 +t= 51.6 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.103 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.103 new file mode 100644 index 0000000..b04835e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.103 @@ -0,0 +1,13 @@ +12 01:28:00 1591561680 +13 03:10:29 1591567829 +0 03:10:29 1591567829 +2 03:47:26 1591570046 +5 04:45:39 1591573539 +6 04:55:27 1591574127 +7 05:26:23 1591575983 +8 06:16:52 1591579012 +25 09:46:39 1591591599 +9 09:55:18 1591592118 +10 10:38:40 1591594720 +11 19:31:01 1591626661 +12 22:03:43 1591635823 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.104 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.104 new file mode 100644 index 0000000..4954d28 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.104 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.106 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.106 new file mode 100644 index 0000000..8c68c43 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.106 @@ -0,0 +1,74 @@ +[29] +oper = 12 +begin = 08.06.2020 01:28:00 +norma = 105 +real = 102 + +[30] +oper = 13 +begin = 08.06.2020 03:10:29 +norma = 45 +real = 36 + +[31] +oper = 2 +begin = 08.06.2020 03:47:26 +norma = 110 +vac_time = 8 +real = 58 + +[32] +oper = 5 +begin = 08.06.2020 04:45:39 +norma = 25 +real = 9 + +[33] +oper = 6 +begin = 08.06.2020 04:55:27 +norma = 35 +real = 30 + +[34] +oper = 7 +begin = 08.06.2020 05:26:23 +norma = 30 +real = 50 + +[35] +oper = 8 +begin = 08.06.2020 06:16:52 +norma = 40 +vac_time = 8 +real = 209 + +[36] +oper = 25 +begin = 08.06.2020 09:46:39 +norma = 30 +real = 8 + +[37] +oper = 9 +begin = 08.06.2020 09:55:18 +norma = 0 +real = 43 + +[38] +oper = 10 +begin = 08.06.2020 10:38:40 +norma = 0 +real = 532 + +[39] +oper = 11 +begin = 08.06.2020 19:31:01 +norma = 0 +real = 152 + +[40] +oper = 12 +begin = 08.06.2020 22:03:43 +norma = 105 +real = 188 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.107 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.107 new file mode 100644 index 0000000..95d6d30 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.107 @@ -0,0 +1,26 @@ +01:27:30 1591561650 ⪫祭 ० (A) +01:28:01 1591561681 ⪫祭 ० ' ⮪ 㣨' +01:28:04 1591561684 ⪫祭 ॣ '-2'(A) +09:34:03 1591590843 : 㦥 +09:45:55 1591591555 祭 ॣ '-2'(A) +09:46:31 1591591591 ⪫祭 ॣ '-2'(A) +09:47:52 1591591672 祭 +09:47:52 1591591672 祭 +09:48:52 1591591732 ⪫祭 +09:54:55 1591592095 祭 ० ࠧ +09:54:56 1591592096 祭 ० ' ⮪ 㣨' +09:54:56 1591592096 ⪫祭 ० ' ⮪ 㣨' +09:54:57 1591592097 祭 ० ' ⮪ 㣨' +09:55:18 1591592118 : 믮 +10:16:40 1591593400 祭 ॣ '-2'(A) +10:38:40 1591594720 ⪫祭 ० ࠧ (A) +10:38:40 1591594720 祭 ॣ . 殮 㣨 +19:31:01 1591626661 祭 ० +19:31:02 1591626662 ⪫祭 ॣ '-2'(A) +19:31:03 1591626663 祭 ॣ '-2'(A) +20:04:03 1591628643 ⪫祭 ॣ '-2'(A) +22:03:25 1591635805 ⪫祭 ० (A) +22:03:26 1591635806 ⪫祭 +22:03:26 1591635806 : +22:03:45 1591635825 ⪫祭 ० ' ⮪ 㣨' +22:33:26 1591637606 : 믮 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.109 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.109 new file mode 100644 index 0000000..5571e42 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.109 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.120 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.120 new file mode 100644 index 0000000..edfce67 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.120 @@ -0,0 +1,8 @@ +01:32:28 1591561948 12 321438 +02:35:25 1591565725 1 10854 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 870 8 4410 9 5850 10 770 11 12 321438 +03:06:08 1591567568 0 A--32-078-2017 ॢ 1 +15:26:47 1591612007 3 14 +15:55:40 1591613740 0 A--32-120-2016 ॢ 0 +17:38:01 1591619881 1 10855 3 25 9 6240 11 12 320715 +20:58:47 1591631927 1 10855 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 870 8 4410 9 6240 10 770 11 12 320715 +21:28:54 1591633734 0 A--32-032-2016 ॢ 6 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.121 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.121 new file mode 100644 index 0000000..12a0350 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.121 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.122 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.122 new file mode 100644 index 0000000..79cf2f7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.122 @@ -0,0 +1,114 @@ +20 01:32:42 01:32:51 +Riz_sol= 4974.8 + +21 01:32:57 01:33:00 +Rsk= 12.4 Rkk= 8.3 + +22 02:15:05 02:25:12 +P1= 27.2 T1=02:20:12 P2= 40.7 T2=02:25:12 Vs= 2.72 + +23 02:27:08 02:27:14 + + +24 02:27:31 02:28:06 + + +30 02:28:20 02:29:02 +Vst= 30.7 + +31 02:29:15 02:30:16 +Rom_sol= 12.5 + +41 02:30:42 02:30:47 +Ukz= 1.21 + +32 02:30:50 02:31:25 +Imax=11.0 Umax=50.0 T= 9.0 + +33 02:31:29 02:31:49 +Imin=16.0 Umin=24.9 T= 0.5 + +34 02:31:52 02:32:15 +V=300.1 T= 9.4 + +40 02:32:17 02:32:24 +t= 53.4 T= 0.5 + +39 02:32:27 02:32:43 +tcam= 53.0 Tcam= 0.5 tfl= 53.3 Tfl= 0.5 + +38 02:32:45 02:32:52 +t= 51.8 T= 0.5 + +37 02:32:55 02:33:25 +T= 0.9 + +36 02:33:28 02:34:00 +P1=0.29 T= 2.9 + +35 02:34:02 02:34:58 +Q= 54.9 T= 9.4 + +21 14:54:42 14:54:46 +Rsk= 11.8 Rkk= 8.0 + +22 15:10:04 15:25:10 +P1= 85.6 T1=15:20:10 P2=101.1 T2=15:25:10 Vs= 3.11 + +21 17:32:38 17:32:41 +Rsk= 11.5 Rkk= 7.7 + +22 17:59:55 18:15:02 +P1= 50.7 T1=18:10:02 P2= 61.0 T2=18:15:02 Vs= 2.06 + +21 20:06:16 20:06:19 +Rsk= 287.7 Rkk= 8.3 + +20 20:06:24 20:06:33 +Riz_sol= 4975.3 + +22 20:35:02 20:50:09 +P1= 57.5 T1=20:45:09 P2= 71.0 T2=20:50:09 Vs= 2.70 + +23 20:50:35 20:50:40 + + +24 20:50:48 20:51:25 + + +30 20:51:39 20:52:03 +Vst= 31.1 + +31 20:52:07 20:52:41 +Rom_sol= 12.5 + +41 20:53:18 20:53:23 +Ukz= 0.96 + +32 20:53:27 20:54:02 +Imax=11.0 Umax=50.1 T= 9.0 + +33 20:54:07 20:54:27 +Imin=16.0 Umin=24.9 T= 0.5 + +34 20:54:32 20:54:55 +V=300.3 T= 9.4 + +35 20:55:00 20:55:55 +Q= 54.7 T= 9.4 + +36 20:56:00 20:56:33 +P1=0.29 T= 2.9 + +37 20:56:38 20:57:09 +T= 0.9 + +38 20:57:15 20:57:21 +t= 53.4 T= 0.5 + +39 20:57:27 20:57:42 +tcam= 51.7 Tcam= 0.5 tfl= 53.1 Tfl= 0.5 + +40 20:57:47 20:57:54 +t= 52.1 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.123 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.123 new file mode 100644 index 0000000..6410312 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.123 @@ -0,0 +1,21 @@ +7 00:27:53 1591558073 +8 01:30:21 1591561821 +25 02:28:17 1591565297 +9 02:35:25 1591565725 +10 03:06:08 1591567568 +11 08:40:16 1591587616 +12 12:11:19 1591600279 +13 14:16:52 1591607812 +0 14:16:52 1591607812 +14 14:52:34 1591609954 +15 15:27:26 1591612046 +16 16:00:14 1591614014 +1 16:42:57 1591616577 +2 17:24:45 1591619085 +5 18:15:55 1591622155 +6 18:28:04 1591622884 +7 19:10:56 1591625456 +8 20:04:21 1591628661 +25 20:51:38 1591631498 +9 20:58:47 1591631927 +10 21:28:54 1591633734 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.124 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.124 new file mode 100644 index 0000000..da544cc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.124 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.126 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.126 new file mode 100644 index 0000000..09e065d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.126 @@ -0,0 +1,125 @@ +[39] +oper = 7 +begin = 08.06.2020 00:27:53 +norma = 30 +real = 62 + +[40] +oper = 8 +begin = 08.06.2020 01:30:21 +norma = 40 +vac_time = 8 +real = 57 + +[41] +oper = 25 +begin = 08.06.2020 02:28:17 +norma = 30 +real = 7 + +[42] +oper = 9 +begin = 08.06.2020 02:35:25 +norma = 0 +real = 30 + +[43] +oper = 10 +begin = 08.06.2020 03:06:08 +norma = 0 +real = 334 + +[44] +oper = 11 +begin = 08.06.2020 08:40:16 +norma = 0 +real = 211 + +[45] +oper = 12 +begin = 08.06.2020 12:11:19 +norma = 105 +real = 125 + +[46] +oper = 13 +begin = 08.06.2020 14:16:52 +norma = 45 +real = 35 + +[47] +oper = 14 +begin = 08.06.2020 14:52:34 +norma = 40 +vac_time = 7 +real = 34 + +[48] +oper = 15 +begin = 08.06.2020 15:27:26 +norma = 30 +real = 32 + +[49] +oper = 16 +begin = 08.06.2020 16:00:14 +norma = 40 +real = 42 + +[50] +oper = 1 +begin = 08.06.2020 16:42:57 +norma = 85 +real = 41 + +[51] +oper = 2 +begin = 08.06.2020 17:24:45 +norma = 110 +vac_time = 8 +vac_avg10 = 8.0 +real = 51 + +[52] +oper = 5 +begin = 08.06.2020 18:15:55 +norma = 25 +real = 12 + +[53] +oper = 6 +begin = 08.06.2020 18:28:04 +norma = 35 +real = 42 + +[54] +oper = 7 +begin = 08.06.2020 19:10:56 +norma = 30 +real = 53 + +[55] +oper = 8 +begin = 08.06.2020 20:04:21 +norma = 40 +vac_time = 8 +real = 47 + +[56] +oper = 25 +begin = 08.06.2020 20:51:38 +norma = 30 +real = 7 + +[57] +oper = 9 +begin = 08.06.2020 20:58:47 +norma = 0 +real = 30 + +[58] +oper = 10 +begin = 08.06.2020 21:28:54 +norma = 0 +real = 286 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.127 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.127 new file mode 100644 index 0000000..d5620bf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.127 @@ -0,0 +1,50 @@ +02:27:31 1591565251 祭 ॣ '-2'(A) +02:28:06 1591565286 ⪫祭 ॣ '-2'(A) +02:28:28 1591565308 ' ' +02:28:28 1591565308 祭 +02:29:15 1591565355 祭 +02:30:15 1591565415 ⪫祭 +02:35:05 1591565705 祭 ० ࠧ +02:35:07 1591565707 祭 ० ' ⮪ 㣨' +02:35:26 1591565726 : 믮 +02:51:39 1591566699 祭 ॣ '-2'(A) +03:06:08 1591567568 祭 ॣ . 殮 㣨 +03:06:08 1591567568 ⪫祭 ० ࠧ (A) +08:40:16 1591587616 祭 ० +08:40:17 1591587617 ⪫祭 ॣ '-2'(A) +08:40:18 1591587618 祭 ॣ '-2'(A) +09:36:17 1591590977 ⪫祭 ॣ '-2'(A) +12:11:14 1591600274 ⪫祭 ० (A) +12:11:16 1591600276 ⪫祭 +12:11:16 1591600276 : 믮 +12:11:16 1591600276 : +12:11:21 1591600281 ⪫祭 ० ' ⮪ 㣨' +12:15:27 1591600527 祭 ० ᪠ +12:18:01 1591600681 ⪫祭 ० ᪠ (A) +15:26:18 1591611978 祭 ० ࠧ +15:26:18 1591611978 ⪫祭 ० ࠧ (A) +15:26:19 1591611979 祭 ० ' ⮪ 㣨' +15:26:29 1591611989 ⪫祭 ० ' ⮪ 㣨' +15:27:27 1591612047 祭 ० ࠧ +15:27:29 1591612049 祭 ० ' ⮪ 㣨' +15:27:31 1591612051 祭 ॣ '-2'(A) +15:55:40 1591613740 ⪫祭 ० ࠧ (A) +16:00:11 1591614011 ⪫祭 ० ' ⮪ 㣨' +16:00:18 1591614018 ⪫祭 ॣ '-2'(A) +16:00:44 1591614044 祭 ० ᪠ +16:00:45 1591614045 祭 ० ᪠ +16:00:45 1591614045 祭 ० ᪠ +16:00:45 1591614045 祭 ० ᪠ +16:03:10 1591614190 ⪫祭 ० ᪠ (A) +18:28:27 1591622907 祭 ० ᪠ +18:28:27 1591622907 祭 ० ᪠ +18:28:27 1591622907 祭 ० ᪠ +18:28:28 1591622908 祭 ० ᪠ +18:30:50 1591623050 ⪫祭 ० ᪠ (A) +20:50:52 1591631452 祭 ॣ '-2'(A) +20:51:27 1591631487 ⪫祭 ॣ '-2'(A) +20:58:19 1591631899 祭 ० ࠧ +20:58:21 1591631901 祭 ० ' ⮪ 㣨' +21:14:56 1591632896 祭 ॣ '-2'(A) +21:28:54 1591633734 ⪫祭 ० ࠧ (A) +21:28:54 1591633734 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200608.129 b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.129 new file mode 100644 index 0000000..1494c77 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200608.129 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.320 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.320 new file mode 100644 index 0000000..7d1ec83 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.320 @@ -0,0 +1,9 @@ +02:46:53 1591652813 1 05129 2 BT 3-1, 6, 8, 9, 14, 15, 16 4 2 7 670 9 4700 10 690 12 320469 +02:47:21 1591652841 7 770 +03:55:34 1591656934 1 05129 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4450 9 4700 10 690 11 12 320469 +04:38:12 1591659492 0 A--32-031-2016 ॢ 5 +14:16:55 1591694215 1 05130 2 OT-4 3 32 9 3310 10 670 12 321689 +16:35:49 1591702549 2 ᯥਬ +18:02:36 1591707756 6 +18:03:58 1591707838 1 05130 2 ᯥਬ 3 32 4 2 5 Ti 6 7 770 8 4450 9 3310 10 670 11 12 321689 +18:53:34 1591710814 0 A--32-050-2020 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.321 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.321 new file mode 100644 index 0000000..1bcf07c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.321 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.322 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.322 new file mode 100644 index 0000000..743bab9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.322 @@ -0,0 +1,120 @@ +20 02:47:40 02:47:48 +Riz_sol= 6529.0 + +21 02:47:56 02:47:59 +Rsk= 20.1 Rkk= 15.0 + +22 03:31:30 03:46:35 +P1= 29.1 T1=03:41:34 P2= 39.5 T2=03:46:35 Vs= 2.09 + +23 03:46:54 03:47:00 + + +24 03:47:06 03:47:46 + + +30 03:47:58 03:48:27 +Vst= 29.9 + +31 03:48:31 03:49:04 +Rom_sol= 12.1 + +32 03:49:34 03:50:08 +Imax=11.2 Umax=50.0 T= 9.0 + +33 03:50:11 03:50:30 +Imin=16.2 Umin=24.9 T= 0.5 + +34 03:50:40 03:51:01 +V=300.4 T= 9.4 + +35 03:51:04 03:52:22 +Q= 54.5 T= 9.4 + +36 03:52:25 03:52:58 +P1=0.29 T= 2.9 + +37 03:53:01 03:53:33 +T= 0.9 + +38 03:53:35 03:53:42 +t= 53.3 T= 0.5 + +39 03:53:45 03:54:00 +tcam= 53.5 Tcam= 0.5 tfl= 52.3 Tfl= 0.5 + +40 03:54:03 03:54:10 +t= 53.1 T= 0.5 + +21 14:15:55 14:15:59 +Rsk= 19.7 Rkk= 14.5 + +22 14:51:03 15:06:08 +P1= 39.2 T1=15:01:08 P2= 52.9 T2=15:06:08 Vs= 2.74 + +20 16:55:05 16:55:14 +Riz_sol=34803.4 + +21 16:55:19 16:55:22 +Rsk= 19.5 Rkk= 14.4 + +22 17:34:55 17:50:00 +P1= 31.4 T1=17:45:00 P2= 42.8 T2=17:50:00 Vs= 2.28 + +23 17:50:10 17:50:15 + + +24 17:50:21 17:50:52 + + +24 17:50:56 17:51:26 + + +24 17:51:34 17:52:04 + + +24 17:52:20 17:52:57 + + +30 17:53:06 17:53:41 +Vst= 29.8 + +31 17:53:43 17:54:19 +Rom_sol= 12.9 + +41 17:55:01 17:55:06 +Ukz= 1.53 + +41 17:55:19 17:55:24 +Ukz= 1.26 + +32 17:55:28 17:56:05 +Imax=27.2 Umax=55.0 T= 9.0 + +33 17:56:09 17:56:34 +Imin=16.2 Umin=24.9 T= 0.5 + +34 17:56:37 17:57:01 +V=300.4 T= 9.4 + +35 17:57:04 17:59:06 +Q= 54.3 T=12.4 + +36 17:59:12 17:59:45 +P1=0.29 T= 2.9 + +37 17:59:49 18:00:21 +T= 0.9 + +38 18:00:24 18:00:36 +t= 53.3 T= 0.5 + +39 18:00:47 18:01:07 +tcam= 53.6 Tcam= 0.5 tfl= 51.8 Tfl= 0.5 + +40 18:01:12 18:01:19 +t= 53.3 T= 0.5 + +40 18:01:55 18:02:02 +t= 51.6 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.323 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.323 new file mode 100644 index 0000000..f314377 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.323 @@ -0,0 +1,20 @@ +13 01:35:49 1591648549 +0 01:35:49 1591648549 +8 02:46:03 1591652763 +25 03:47:56 1591656476 +9 03:55:34 1591656934 +10 04:38:12 1591659492 +11 08:21:49 1591672909 +12 11:08:51 1591682931 +13 12:59:43 1591689583 +0 12:59:43 1591689583 +2 14:13:11 1591693991 +5 15:07:48 1591697268 +6 15:20:41 1591698041 +7 16:03:54 1591700634 +8 16:50:39 1591703439 +25 17:53:04 1591707184 +9 18:03:58 1591707838 +10 18:53:34 1591710814 +11 20:26:54 1591716414 +12 22:27:07 1591723627 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.324 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.324 new file mode 100644 index 0000000..1425b69 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.324 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.325 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.325 new file mode 100644 index 0000000..fc4cfac --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.325 @@ -0,0 +1,4 @@ +35 17:50:52 1591707052 +35 17:51:27 1591707087 +35 17:52:05 1591707125 +47 18:01:20 1591707680 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.326 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.326 new file mode 100644 index 0000000..0740bc7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.326 @@ -0,0 +1,111 @@ +[66] +oper = 13 +begin = 09.06.2020 01:35:49 +norma = 45 +real = 70 + +[67] +oper = 8 +begin = 09.06.2020 02:46:03 +norma = 40 +vac_time = 8 +real = 61 + +[68] +oper = 25 +begin = 09.06.2020 03:47:56 +norma = 30 +real = 7 + +[69] +oper = 9 +begin = 09.06.2020 03:55:34 +norma = 0 +real = 42 + +[70] +oper = 10 +begin = 09.06.2020 04:38:12 +norma = 0 +real = 223 + +[71] +oper = 11 +begin = 09.06.2020 08:21:49 +norma = 0 +real = 167 + +[72] +oper = 12 +begin = 09.06.2020 11:08:51 +norma = 105 +real = 110 + +[73] +oper = 13 +begin = 09.06.2020 12:59:43 +norma = 45 +real = 73 + +[74] +oper = 2 +begin = 09.06.2020 14:13:11 +norma = 110 +vac_time = 9 +real = 54 + +[75] +oper = 5 +begin = 09.06.2020 15:07:48 +norma = 25 +real = 12 + +[76] +oper = 6 +begin = 09.06.2020 15:20:41 +norma = 35 +real = 43 + +[77] +oper = 7 +begin = 09.06.2020 16:03:54 +norma = 30 +real = 46 + +[78] +oper = 8 +begin = 09.06.2020 16:50:39 +norma = 40 +vac_time = 8 +real = 62 + +[79] +oper = 25 +begin = 09.06.2020 17:53:04 +norma = 30 +real = 10 + +[80] +oper = 9 +begin = 09.06.2020 18:03:58 +norma = 0 +real = 49 + +[81] +oper = 10 +begin = 09.06.2020 18:53:34 +norma = 0 +real = 93 + +[82] +oper = 11 +begin = 09.06.2020 20:26:54 +norma = 115 +real = 120 + +[83] +oper = 12 +begin = 09.06.2020 22:27:07 +norma = 105 +real = 114 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.327 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.327 new file mode 100644 index 0000000..27c8081 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.327 @@ -0,0 +1,42 @@ +03:47:09 1591656429 祭 ॣ '-2'(A) +03:47:47 1591656467 ⪫祭 ॣ '-2'(A) +03:55:08 1591656908 祭 ० ࠧ +03:55:10 1591656910 祭 ० ' ⮪ 㣨' +04:21:08 1591658468 祭 ॣ '-2'(A) +04:38:12 1591659492 ⪫祭 ० ࠧ (A) +04:38:13 1591659493 祭 ⠭ ॣ +08:21:49 1591672909 祭 ० +08:21:50 1591672910 ⪫祭 ॣ '-2'(A) +08:21:51 1591672911 祭 ॣ '-2'(A) +10:13:50 1591679630 ⪫祭 ॣ '-2'(A) +11:08:46 1591682926 ⪫祭 ० (A) +11:08:48 1591682928 ⪫祭 ० ' ⮪ 㣨' +11:13:18 1591683198 祭 ० ᪠ +11:15:42 1591683342 ⪫祭 ० ᪠ (A) +15:20:52 1591698052 祭 ० ᪠ +15:20:53 1591698053 祭 ० ᪠ +15:23:35 1591698215 ⪫祭 ० ᪠ (A) +17:50:22 1591707022 祭 ॣ '-2'(A) +17:50:53 1591707053 ⪫祭 ॣ '-2'(A) +17:50:57 1591707057 祭 ॣ '-2'(A) +17:51:27 1591707087 ⪫祭 ॣ '-2'(A) +17:51:35 1591707095 祭 ॣ '-2'(A) +17:52:05 1591707125 ⪫祭 ॣ '-2'(A) +17:52:21 1591707141 祭 ॣ '-2'(A) +17:52:58 1591707178 ⪫祭 ॣ '-2'(A) +18:03:28 1591707808 祭 ० ࠧ +18:03:30 1591707810 祭 ० ' ⮪ 㣨' +18:05:35 1591707935 祭 ॣ '-2'(A) +18:19:59 1591708799 ⪫祭 ० ᪠ (A) +18:29:57 1591709397 ⪫祭 ० ᪠ (A) +18:53:34 1591710814 ⪫祭 ० ࠧ (A) +18:53:34 1591710814 祭 ⠭ ॣ +20:26:54 1591716414 祭 ० +20:26:54 1591716414 ⪫祭 ॣ '-2'(A) +20:26:55 1591716415 祭 ॣ '-2'(A) +21:18:51 1591719531 祭 ० +21:18:52 1591719532 ⪫祭 ॣ '-2'(A) +22:26:55 1591723615 ⪫祭 ० (A) +22:26:56 1591723616 ⪫祭 ० ' ⮪ 㣨' +22:29:00 1591723740 祭 ० ᪠ +22:31:41 1591723901 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.329 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.329 new file mode 100644 index 0000000..9c41260 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.329 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.350 new file mode 100644 index 0000000..b95db7a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.350 @@ -0,0 +1,7 @@ +02:55:51 1591653351 1 09534 7 770 9 4900 10 690 +03:48:35 1591656515 4 2 +03:55:54 1591656954 1 09534 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4490 9 4900 10 690 11 12 321692 +04:38:36 1591659516 0 A--32-031-2016 ॢ 5 +14:37:27 1591695447 1 09535 9 4850 10 670 +22:27:27 1591723647 1 09535 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4490 9 4850 10 670 11 12 321692 +23:02:08 1591725728 0 A--32-002-2012 ॢ 9 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.351 new file mode 100644 index 0000000..2d69039 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.352 new file mode 100644 index 0000000..a65c1c1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.352 @@ -0,0 +1,111 @@ +20 02:54:33 02:54:42 +Riz_sol= 5807.5 + +21 02:54:57 02:55:00 +Rsk= 16.1 Rkk= 13.3 + +22 03:29:47 03:45:18 +P1= 38.2 T1=03:40:18 P2= 51.1 T2=03:45:18 Vs= 2.58 + +23 03:46:19 03:46:24 + + +24 03:46:33 03:47:13 + + +30 03:47:29 03:47:52 +Vst= 28.2 + +31 03:48:49 03:49:22 +Rom_sol= 14.4 + +32 03:49:47 03:50:21 +Imax=11.3 Umax=50.0 T= 9.0 + +33 03:50:25 03:50:46 +Imin=16.2 Umin=25.0 T= 0.5 + +34 03:50:49 03:51:12 +V=300.1 T= 9.6 + +35 03:51:15 03:52:49 +Q= 54.7 T= 9.5 + +36 03:52:52 03:53:34 +P1=0.30 T= 3.0 + +37 03:53:58 03:54:29 +T= 1.0 + +38 03:54:32 03:54:51 +t= 52.9 T= 0.8 + +39 03:54:54 03:55:10 +tcam= 54.8 Tcam= 0.8 tfl= 53.6 Tfl= 0.8 + +40 03:55:14 03:55:20 +t= 56.3 T= 0.8 + +21 14:33:57 14:34:00 +Rsk= 16.0 Rkk= 13.3 + +22 15:03:06 15:18:37 +P1= 37.2 T1=15:13:36 P2= 50.6 T2=15:18:37 Vs= 2.68 + +20 16:34:15 16:34:23 +Riz_sol= 6132.2 + +21 16:34:40 16:34:43 +Rsk= 16.1 Rkk= 13.4 + +22 18:24:13 18:34:44 +P1= 6.0 T1=18:29:44 P2= 18.3 T2=18:34:44 Vs= 2.46 + +22 22:06:27 22:16:57 +P1= 3.5 T1=22:11:57 P2= 14.4 T2=22:16:57 Vs= 2.17 + +23 22:17:28 22:17:33 + + +24 22:17:45 22:18:13 + + +24 22:18:20 22:18:57 + + +30 22:19:20 22:20:00 +Vst= 28.2 + +31 22:20:07 22:20:41 +Rom_sol= 14.3 + +41 22:21:36 22:21:41 +Ukz= 0.92 + +32 22:21:49 22:22:26 +Imax=11.3 Umax=50.0 T= 9.0 + +33 22:22:32 22:22:54 +Imin=16.3 Umin=24.9 T= 0.5 + +34 22:23:00 22:23:24 +V=300.1 T= 9.5 + +35 22:23:30 22:24:33 +Q= 52.4 T= 9.5 + +36 22:24:38 22:25:19 +P1=0.29 T= 3.0 + +37 22:25:23 22:25:48 +T= 1.0 + +38 22:25:52 22:25:59 +t= 52.7 T= 0.8 + +39 22:26:03 22:26:23 +tcam= 54.6 Tcam= 0.8 tfl= 53.2 Tfl= 0.8 + +40 22:26:27 22:26:35 +t= 55.8 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.353 new file mode 100644 index 0000000..a6aff93 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.353 @@ -0,0 +1,18 @@ +13 01:43:58 1591649038 +0 01:43:58 1591649038 +8 02:53:46 1591653226 +25 03:47:26 1591656446 +9 03:55:54 1591656954 +10 04:38:36 1591659516 +11 08:29:26 1591673366 +12 11:16:43 1591683403 +13 13:00:52 1591689652 +0 13:00:52 1591689652 +2 14:22:28 1591694548 +5 15:19:34 1591697974 +6 15:31:28 1591698688 +7 16:08:12 1591700892 +8 16:28:48 1591702128 +25 22:19:11 1591723151 +9 22:27:27 1591723647 +10 23:02:08 1591725728 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.354 new file mode 100644 index 0000000..f3294a3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.355 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.355 new file mode 100644 index 0000000..e957bc1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.355 @@ -0,0 +1 @@ +30 22:18:13 1591723093 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.356 new file mode 100644 index 0000000..60d9797 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.356 @@ -0,0 +1,100 @@ +[90] +oper = 13 +begin = 09.06.2020 01:43:58 +norma = 45 +real = 69 + +[91] +oper = 8 +begin = 09.06.2020 02:53:46 +norma = 40 +vac_time = 7 +vac_avg10 = 10.4 +real = 53 + +[92] +oper = 25 +begin = 09.06.2020 03:47:26 +norma = 30 +real = 8 + +[93] +oper = 9 +begin = 09.06.2020 03:55:54 +norma = 0 +real = 42 + +[94] +oper = 10 +begin = 09.06.2020 04:38:36 +norma = 0 +real = 230 + +[95] +oper = 11 +begin = 09.06.2020 08:29:26 +norma = 0 +real = 167 + +[96] +oper = 12 +begin = 09.06.2020 11:16:43 +norma = 105 +real = 104 + +[97] +oper = 13 +begin = 09.06.2020 13:00:52 +norma = 45 +real = 81 + +[98] +oper = 2 +begin = 09.06.2020 14:22:28 +norma = 110 +vac_time = 11 +real = 57 + +[99] +oper = 5 +begin = 09.06.2020 15:19:34 +norma = 25 +real = 11 + +[00] +oper = 6 +begin = 09.06.2020 15:31:28 +norma = 35 +real = 36 + +[01] +oper = 7 +begin = 09.06.2020 16:08:12 +norma = 30 +real = 20 + +[02] +oper = 8 +begin = 09.06.2020 16:28:48 +norma = 40 +vac_time = 6 +real = 350 + +[03] +oper = 25 +begin = 09.06.2020 22:19:11 +norma = 30 +real = 8 + +[04] +oper = 9 +begin = 09.06.2020 22:27:27 +norma = 0 +real = 34 + +[05] +oper = 10 +begin = 09.06.2020 23:02:08 +norma = 0 +real = 226 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.357 new file mode 100644 index 0000000..2e498d4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.357 @@ -0,0 +1,27 @@ +03:46:35 1591656395 祭 ॣ '-2'(A) +03:47:13 1591656433 ⪫祭 ॣ '-2'(A) +03:55:29 1591656929 祭 ० ࠧ +03:55:31 1591656931 祭 ० ' ⮪ 㣨' +04:21:31 1591658491 祭 ॣ '-2'(A) +04:38:36 1591659516 ⪫祭 ० ࠧ (A) +04:38:36 1591659516 祭 ⠭ ॣ +08:29:25 1591673365 祭 ० +08:29:26 1591673366 ⪫祭 ॣ '-2'(A) +08:29:27 1591673367 祭 ॣ '-2'(A) +10:21:26 1591680086 ⪫祭 ॣ '-2'(A) +11:16:22 1591683382 ⪫祭 ० (A) +11:16:24 1591683384 ⪫祭 ० ' ⮪ 㣨' +11:17:18 1591683438 祭 ० ᪠ +11:20:53 1591683653 ⪫祭 ० ᪠ (A) +15:32:04 1591698724 祭 ० ᪠ +15:32:05 1591698725 祭 ० ᪠ +15:34:39 1591698879 ⪫祭 ० ᪠ (A) +22:17:49 1591723069 祭 ॣ '-2'(A) +22:18:14 1591723094 ⪫祭 ॣ '-2'(A) +22:18:21 1591723101 祭 ॣ '-2'(A) +22:18:58 1591723138 ⪫祭 ॣ '-2'(A) +22:26:48 1591723608 祭 ० ࠧ +22:26:50 1591723610 祭 ० ' ⮪ 㣨' +22:44:23 1591724663 祭 ॣ '-2'(A) +23:02:08 1591725728 ⪫祭 ० ࠧ (A) +23:02:09 1591725729 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200609.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.359 new file mode 100644 index 0000000..09ef292 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200609.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.120 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.120 new file mode 100644 index 0000000..605a9a1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.120 @@ -0,0 +1,10 @@ +00:49:26 1591732166 3 14 +01:48:00 1591735680 0 A--32-067-2014 ॢ 0 +03:11:06 1591740666 1 10857 3 25 9 4070 10 705 12 320542 +09:32:01 1591763521 1 10857 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4410 9 4070 10 705 11 12 320542 +10:00:45 1591765245 0 A--32-076-2015 ॢ 0 +18:58:27 1591797507 3 14 +21:52:21 1591807941 1 10858 3 25 9 4530 10 690 12 321438 +22:19:56 1591809596 11 +23:05:31 1591812331 1 10858 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4410 9 4530 10 690 11 12 321438 +23:48:03 1591814883 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.121 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.121 new file mode 100644 index 0000000..07a155e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.121 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.122 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.122 new file mode 100644 index 0000000..4a8dd9d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.122 @@ -0,0 +1,126 @@ +21 00:49:10 00:49:13 +Rsk= 11.9 Rkk= 7.8 + +22 01:09:58 01:20:05 +P1= 43.0 T1=01:15:05 P2= 66.3 T2=01:20:05 Vs= 4.65 + +21 03:09:55 03:09:58 +Rsk= 11.6 Rkk= 7.8 + +22 03:45:04 03:55:11 +P1= 28.4 T1=03:50:11 P2= 43.6 T2=03:55:11 Vs= 3.04 + +20 05:47:09 05:47:17 +Riz_sol= 4974.7 + +21 05:47:26 05:47:29 +Rsk= 11.8 Rkk= 7.9 + +22 06:15:00 06:30:07 +P1= 55.7 T1=06:25:07 P2= 68.7 T2=06:30:07 Vs= 2.61 + +22 09:13:25 09:23:32 +P1= 12.8 T1=09:18:32 P2= 16.7 T2=09:23:32 Vs= 0.78 + +23 09:23:48 09:23:53 + + +24 09:24:00 09:24:34 + + +30 09:24:44 09:25:13 +Vst= 31.1 + +31 09:25:17 09:26:19 +Rom_sol= 11.6 + +41 09:26:54 09:26:59 +Ukz= 1.02 + +32 09:27:02 09:27:38 +Imax=11.0 Umax=50.0 T= 9.0 + +33 09:27:40 09:27:59 +Imin=16.0 Umin=25.0 T= 0.5 + +34 05:00:00 09:28:25 +V=300.2 T= 9.4 + +35 09:28:27 09:29:29 +Q= 53.4 T= 9.4 + +36 09:29:32 09:30:05 +P1=0.29 T= 2.9 + +37 09:30:07 09:30:37 +T= 0.9 + +38 09:30:39 09:30:47 +t= 53.4 T= 0.5 + +39 09:30:49 09:31:05 +tcam= 53.1 Tcam= 0.5 tfl= 53.3 Tfl= 0.5 + +40 09:31:10 09:31:23 +t= 53.4 T= 0.5 + +21 18:58:40 18:58:43 +Rsk= 11.9 Rkk= 7.9 + +22 19:30:47 19:40:54 +P1= 24.2 T1=19:35:54 P2= 36.6 T2=19:40:54 Vs= 2.48 + +20 21:52:37 21:52:46 +Riz_sol= 1026.5 + +21 21:52:52 21:52:55 +Rsk= 11.6 Rkk= 7.9 + +22 22:45:09 22:55:15 +P1= 20.3 T1=22:50:15 P2= 31.9 T2=22:55:15 Vs= 2.33 + +23 22:55:51 22:55:57 + + +24 22:56:13 22:56:49 + + +30 22:57:03 22:57:32 +Vst= 30.8 + +31 22:57:44 22:58:32 +Rom_sol= 12.0 + +41 22:59:11 22:59:20 +Ukz= 0.97 + +32 22:59:28 23:00:03 +Imax=11.0 Umax=50.0 T= 9.0 + +32 23:00:11 23:00:47 +Imax=11.0 Umax=50.0 T= 9.0 + +33 23:00:51 23:01:12 +Imin=16.0 Umin=24.9 T= 0.5 + +34 23:01:15 23:01:48 +V=300.1 T= 9.4 + +40 23:01:52 23:02:08 +t= 53.4 T= 0.5 + +39 23:02:10 23:02:29 +tcam= 53.0 Tcam= 0.5 tfl= 53.3 Tfl= 0.5 + +38 23:02:32 23:02:43 +t= 51.8 T= 0.5 + +37 23:02:46 23:03:20 +T= 0.9 + +36 23:03:22 23:03:59 +P1=0.28 T= 2.9 + +35 23:04:01 23:04:58 +Q= 54.2 T= 9.4 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.123 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.123 new file mode 100644 index 0000000..898a77c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.123 @@ -0,0 +1,26 @@ +13 00:15:55 1591730155 +0 00:15:55 1591730155 +14 00:47:05 1591732025 +15 01:22:20 1591734140 +16 01:51:50 1591735910 +1 02:25:32 1591737932 +2 03:07:43 1591740463 +5 03:56:32 1591743392 +6 04:08:44 1591744124 +7 04:42:58 1591746178 +8 05:44:26 1591749866 +25 09:24:40 1591763080 +9 09:32:01 1591763521 +10 10:00:45 1591765245 +11 14:02:45 1591779765 +12 16:51:50 1591789910 +13 18:39:43 1591796383 +0 18:39:43 1591796383 +14 18:55:56 1591797356 +15 19:44:01 1591800241 +16 20:01:12 1591801272 +1 20:39:46 1591803586 +8 21:49:05 1591807745 +25 22:57:01 1591811821 +9 23:05:31 1591812331 +10 23:48:03 1591814883 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.124 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.124 new file mode 100644 index 0000000..af6409b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.124 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.125 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.125 new file mode 100644 index 0000000..350b040 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.125 @@ -0,0 +1 @@ +47 23:00:03 1591812003 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.126 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.126 new file mode 100644 index 0000000..184586c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.126 @@ -0,0 +1,149 @@ +[76] +oper = 13 +begin = 10.06.2020 00:15:55 +norma = 45 +real = 31 + +[77] +oper = 14 +begin = 10.06.2020 00:47:05 +norma = 40 +vac_time = 7 +real = 35 + +[78] +oper = 15 +begin = 10.06.2020 01:22:20 +norma = 30 +real = 29 + +[79] +oper = 16 +begin = 10.06.2020 01:51:50 +norma = 40 +real = 33 + +[80] +oper = 1 +begin = 10.06.2020 02:25:32 +norma = 85 +real = 42 + +[81] +oper = 2 +begin = 10.06.2020 03:07:43 +norma = 110 +vac_time = 7 +real = 48 + +[82] +oper = 5 +begin = 10.06.2020 03:56:32 +norma = 25 +real = 12 + +[83] +oper = 6 +begin = 10.06.2020 04:08:44 +norma = 35 +real = 34 + +[84] +oper = 7 +begin = 10.06.2020 04:42:58 +norma = 30 +real = 61 + +[85] +oper = 8 +begin = 10.06.2020 05:44:26 +norma = 40 +vac_time = 7 +real = 220 + +[86] +oper = 25 +begin = 10.06.2020 09:24:40 +norma = 30 +real = 7 + +[87] +oper = 9 +begin = 10.06.2020 09:32:01 +norma = 0 +real = 28 + +[88] +oper = 10 +begin = 10.06.2020 10:00:45 +norma = 0 +real = 242 + +[89] +oper = 11 +begin = 10.06.2020 14:02:45 +norma = 0 +real = 169 + +[90] +oper = 12 +begin = 10.06.2020 16:51:50 +norma = 105 +real = 107 + +[91] +oper = 13 +begin = 10.06.2020 18:39:43 +norma = 45 +real = 16 + +[92] +oper = 14 +begin = 10.06.2020 18:55:56 +norma = 40 +vac_time = 7 +real = 48 + +[93] +oper = 15 +begin = 10.06.2020 19:44:01 +norma = 30 +real = 17 + +[94] +oper = 16 +begin = 10.06.2020 20:01:12 +norma = 40 +real = 38 + +[95] +oper = 1 +begin = 10.06.2020 20:39:46 +norma = 85 +real = 69 + +[96] +oper = 8 +begin = 10.06.2020 21:49:05 +norma = 40 +vac_time = 8 +real = 67 + +[97] +oper = 25 +begin = 10.06.2020 22:57:01 +norma = 30 +real = 8 + +[98] +oper = 9 +begin = 10.06.2020 23:05:31 +norma = 0 +real = 42 + +[99] +oper = 10 +begin = 10.06.2020 23:48:03 +norma = 0 +real = 216 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.127 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.127 new file mode 100644 index 0000000..998643b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.127 @@ -0,0 +1,55 @@ +01:21:36 1591734096 祭 ० ࠧ +01:21:38 1591734098 祭 ० ' ⮪ 㣨' +01:23:03 1591734183 祭 ॣ '-2'(A) +01:48:00 1591735680 ⪫祭 ० ࠧ (A) +01:51:51 1591735911 ⪫祭 ० ' ⮪ 㣨' +01:51:54 1591735914 ⪫祭 ॣ '-2'(A) +01:52:12 1591735932 祭 ० ᪠ +01:54:29 1591736069 ⪫祭 ० ᪠ (A) +03:11:08 1591740668 : 㦥 +04:09:00 1591744140 祭 ० ᪠ +04:09:01 1591744141 祭 ० ᪠ +04:11:15 1591744275 ⪫祭 ० ᪠ (A) +09:24:01 1591763041 祭 ॣ '-2'(A) +09:24:35 1591763075 ⪫祭 ॣ '-2'(A) +09:25:19 1591763119 祭 +09:25:19 1591763119 祭 +09:26:18 1591763178 ⪫祭 +09:31:38 1591763498 祭 ० ࠧ +09:31:39 1591763499 祭 ० ' ⮪ 㣨' +09:32:02 1591763522 : 믮 +09:51:45 1591764705 祭 ॣ '-2'(A) +10:00:45 1591765245 祭 ⠭ ॣ +10:00:45 1591765245 ⪫祭 ० ࠧ (A) +14:02:44 1591779764 祭 ० +14:02:45 1591779765 ⪫祭 ॣ '-2'(A) +14:02:46 1591779766 祭 ॣ '-2'(A) +15:06:45 1591783605 ⪫祭 ॣ '-2'(A) +16:51:46 1591789906 ⪫祭 ० (A) +16:51:47 1591789907 ⪫祭 +16:51:47 1591789907 : 믮 +16:51:47 1591789907 : +16:51:51 1591789911 ⪫祭 ० ' ⮪ 㣨' +16:52:21 1591789941 祭 ० ᪠ +16:54:35 1591790075 ⪫祭 ० ᪠ (A) +19:43:44 1591800224 祭 ० ࠧ +19:43:45 1591800225 祭 ० ' ⮪ 㣨' +19:44:44 1591800284 祭 ॣ '-2'(A) +20:01:13 1591801273 ⪫祭 ० ' ⮪ 㣨' +20:01:15 1591801275 ⪫祭 ॣ '-2'(A) +20:01:52 1591801312 祭 ० ᪠ +20:02:29 1591801349 ⪫祭 ० ᪠ +20:02:31 1591801351 祭 ० ᪠ +20:02:36 1591801356 ⪫祭 ० ᪠ +20:02:39 1591801359 祭 ० ᪠ +20:02:39 1591801359 祭 ० ᪠ +20:02:46 1591801366 ⪫祭 ० ᪠ +21:52:22 1591807942 : 㦥 +22:19:58 1591809598 : +22:56:14 1591811774 祭 ॣ '-2'(A) +22:56:51 1591811811 ⪫祭 ॣ '-2'(A) +23:05:06 1591812306 祭 ० ࠧ +23:05:08 1591812308 祭 ० ' ⮪ 㣨' +23:30:56 1591813856 祭 ॣ '-2'(A) +23:48:03 1591814883 ⪫祭 ० ࠧ (A) +23:48:03 1591814883 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.129 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.129 new file mode 100644 index 0000000..6e81688 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.129 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.320 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.320 new file mode 100644 index 0000000..ea979ac --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.320 @@ -0,0 +1,9 @@ +00:44:01 1591731841 3 14 +00:44:26 1591731866 2 BT 3-1, 6, 8, 9, 14, 15, 16 +04:27:47 1591745267 1 05131 2 OT-4 3 32 6 9 3810 12 320469 +13:54:01 1591779241 1 05131 2 OT-4 3 32 4 2 5 Ti 6 7 770 8 4450 9 3810 10 670 11 12 320469 +14:07:22 1591780042 6 +14:23:20 1591781000 0 A--32-050-2012 ॢ 1 +16:15:22 1591787722 12 320747 +21:14:27 1591805667 3 14 +22:20:31 1591809631 0 A--32-067-2014 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.321 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.321 new file mode 100644 index 0000000..afd59ab Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.321 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.322 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.322 new file mode 100644 index 0000000..98f36bf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.322 @@ -0,0 +1,81 @@ +21 00:44:37 00:44:40 +Rsk= 19.1 Rkk= 13.8 + +22 01:20:19 01:30:24 +P1= 16.7 T1=01:25:24 P2= 37.2 T2=01:30:24 Vs= 4.10 + +21 04:28:07 04:28:10 +Rsk=7481.9 Rkk= 14.2 + +21 04:28:32 04:28:35 +Rsk=7099.5 Rkk= 14.3 + +21 04:29:10 04:29:13 +Rsk= 14.2 Rkk= 14.3 + +22 05:10:03 05:25:08 +P1= 34.6 T1=05:20:08 P2= 47.9 T2=05:25:08 Vs= 2.67 + +20 09:25:13 09:25:22 +Riz_sol= 4806.5 + +21 09:25:34 09:25:37 +Rsk= 20.1 Rkk= 14.0 + +22 09:59:53 10:14:58 +P1= 38.6 T1=10:09:58 P2= 53.9 T2=10:14:58 Vs= 3.05 + +22 10:30:10 10:40:15 +P1= 12.1 T1=10:35:15 P2= 26.7 T2=10:40:15 Vs= 2.90 + +22 13:32:49 13:42:54 +P1= 19.9 T1=13:37:54 P2= 33.8 T2=13:42:54 Vs= 2.78 + +23 13:45:22 13:45:28 + + +24 13:45:37 13:46:15 + + +30 13:46:38 13:47:11 +Vst= 29.5 + +31 13:47:23 13:47:58 +Rom_sol= 12.4 + +41 13:48:21 13:48:26 +Ukz= 1.25 + +32 13:48:29 13:49:09 +Imax=27.2 Umax=55.0 T= 9.0 + +33 13:49:12 13:49:38 +Imin=16.2 Umin=24.9 T= 0.5 + +34 13:49:41 13:50:03 +V=300.0 T= 9.4 + +35 13:50:05 13:51:32 +Q= 54.5 T= 9.4 + +36 13:51:34 13:52:07 +P1=0.30 T= 2.9 + +37 13:52:10 13:52:44 +T= 0.9 + +38 13:52:47 13:52:54 +t= 53.4 T= 0.5 + +39 13:52:57 13:53:12 +tcam= 53.5 Tcam= 0.5 tfl= 52.1 Tfl= 0.5 + +40 13:53:14 13:53:21 +t= 51.6 T= 0.5 + +21 21:14:33 21:14:36 +Rsk= 18.9 Rkk= 13.5 + +22 21:39:58 21:55:03 +P1= 47.8 T1=21:50:03 P2= 65.4 T2=21:55:03 Vs= 3.52 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.323 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.323 new file mode 100644 index 0000000..58ecfbf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.323 @@ -0,0 +1,22 @@ +13 00:21:26 1591730486 +0 00:21:26 1591730486 +14 00:42:29 1591731749 +15 01:32:07 1591734727 +16 01:57:23 1591736243 +1 02:46:57 1591739217 +2 04:26:38 1591745198 +5 05:26:26 1591748786 +6 05:37:30 1591749450 +7 06:23:01 1591752181 +8 09:20:43 1591762843 +25 13:46:33 1591778793 +9 13:54:01 1591779241 +10 14:23:20 1591781000 +11 16:53:55 1591790035 +12 18:54:03 1591797243 +13 20:46:57 1591804017 +0 20:46:57 1591804017 +14 21:10:54 1591805454 +15 21:55:43 1591808143 +16 22:25:11 1591809911 +1 23:10:10 1591812610 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.324 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.324 new file mode 100644 index 0000000..084e67e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.324 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.326 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.326 new file mode 100644 index 0000000..1a5b9b9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.326 @@ -0,0 +1,124 @@ +[84] +oper = 13 +begin = 10.06.2020 00:21:26 +norma = 45 +real = 21 + +[85] +oper = 14 +begin = 10.06.2020 00:42:29 +norma = 40 +vac_time = 7 +real = 49 + +[86] +oper = 15 +begin = 10.06.2020 01:32:07 +norma = 30 +real = 25 + +[87] +oper = 16 +begin = 10.06.2020 01:57:23 +norma = 40 +real = 49 + +[88] +oper = 1 +begin = 10.06.2020 02:46:57 +norma = 85 +real = 99 + +[89] +oper = 2 +begin = 10.06.2020 04:26:38 +norma = 110 +vac_time = 9 +real = 59 + +[90] +oper = 5 +begin = 10.06.2020 05:26:26 +norma = 25 +real = 11 + +[91] +oper = 6 +begin = 10.06.2020 05:37:30 +norma = 35 +real = 45 + +[92] +oper = 7 +begin = 10.06.2020 06:23:01 +norma = 30 +real = 177 + +[93] +oper = 8 +begin = 10.06.2020 09:20:43 +norma = 40 +vac_time = 8 +real = 265 + +[94] +oper = 25 +begin = 10.06.2020 13:46:33 +norma = 30 +real = 7 + +[95] +oper = 9 +begin = 10.06.2020 13:54:01 +norma = 0 +real = 29 + +[96] +oper = 10 +begin = 10.06.2020 14:23:20 +norma = 0 +real = 150 + +[97] +oper = 11 +begin = 10.06.2020 16:53:55 +norma = 115 +real = 120 + +[98] +oper = 12 +begin = 10.06.2020 18:54:03 +norma = 105 +real = 112 + +[99] +oper = 13 +begin = 10.06.2020 20:46:57 +norma = 45 +real = 23 + +[00] +oper = 14 +begin = 10.06.2020 21:10:54 +norma = 40 +vac_time = 7 +real = 44 + +[01] +oper = 15 +begin = 10.06.2020 21:55:43 +norma = 30 +real = 29 + +[02] +oper = 16 +begin = 10.06.2020 22:25:11 +norma = 40 +real = 44 + +[03] +oper = 1 +begin = 10.06.2020 23:10:10 +norma = 85 +real = 81 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.327 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.327 new file mode 100644 index 0000000..b320244 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.327 @@ -0,0 +1,43 @@ +01:31:28 1591734688 祭 ० ࠧ +01:31:31 1591734691 祭 ० ' ⮪ 㣨' +01:32:55 1591734775 祭 ॣ '-2'(A) +01:57:24 1591736244 ⪫祭 ० ' ⮪ 㣨' +01:57:33 1591736253 ⪫祭 ० ࠧ +01:57:34 1591736254 ⪫祭 ॣ '-2'(A) +01:57:49 1591736269 祭 ० ᪠ +01:57:49 1591736269 祭 ० ᪠ +01:57:49 1591736269 祭 ० ᪠ +02:00:02 1591736402 ⪫祭 ० ᪠ (A) +05:37:50 1591749470 祭 ० ᪠ +05:37:50 1591749470 祭 ० ᪠ +05:40:27 1591749627 ⪫祭 ० ᪠ (A) +13:45:39 1591778739 祭 ॣ '-2'(A) +13:46:16 1591778776 ⪫祭 ॣ '-2'(A) +13:53:39 1591779219 祭 ० ࠧ +13:53:41 1591779221 祭 ० ' ⮪ 㣨' +14:06:37 1591779997 ⪫祭 ० ' ⮪ 㣨' +14:08:32 1591780112 祭 ० ' ⮪ 㣨' +14:20:19 1591780819 祭 ॣ '-2'(A) +14:20:37 1591780837 ⪫祭 ० ᪠ (A) +14:23:20 1591781000 ⪫祭 ० ࠧ (A) +14:23:20 1591781000 祭 ⠭ ॣ +16:53:54 1591790034 祭 ० +16:53:55 1591790035 ⪫祭 ॣ '-2'(A) +16:53:56 1591790036 祭 ॣ '-2'(A) +17:41:43 1591792903 祭 ० +17:41:44 1591792904 ⪫祭 ॣ '-2'(A) +18:53:54 1591797234 ⪫祭 ० (A) +18:53:56 1591797236 ⪫祭 ० ' ⮪ 㣨' +18:55:28 1591797328 祭 ० ᪠ +18:55:29 1591797329 祭 ० ᪠ +18:55:29 1591797329 祭 ० ᪠ +18:55:29 1591797329 祭 ० ᪠ +18:57:32 1591797452 ⪫祭 ० ᪠ (A) +21:55:29 1591808129 祭 ० ࠧ +21:55:30 1591808130 祭 ० ' ⮪ 㣨' +21:56:34 1591808194 祭 ॣ '-2'(A) +22:20:31 1591809631 ⪫祭 ० ࠧ (A) +22:25:12 1591809912 ⪫祭 ० ' ⮪ 㣨' +22:25:16 1591809916 ⪫祭 ॣ '-2'(A) +22:25:20 1591809920 祭 ० ᪠ +22:27:24 1591810044 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.329 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.329 new file mode 100644 index 0000000..954a6d5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.329 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.340 new file mode 100644 index 0000000..a268b94 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.340 @@ -0,0 +1,9 @@ +01:03:26 1591733006 3 14 +02:07:12 1591736832 0 A--32-067-2014 ॢ 0 +04:30:08 1591745408 1 09597 3 25 9 4320 10 690 +05:22:21 1591748541 1 09597 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 5050 9 4320 10 690 11 12 320801 +06:04:55 1591751095 0 A--32-031-2016 ॢ 5 +15:24:32 1591784672 1 09598 +15:25:38 1591784738 9 4350 12 321752 +22:44:33 1591811073 1 09598 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 5050 9 4350 10 690 11 12 321752 +23:27:10 1591813630 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.341 new file mode 100644 index 0000000..1c3d516 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.342 new file mode 100644 index 0000000..2d6c62c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.342 @@ -0,0 +1,111 @@ +21 01:03:43 01:03:46 +Rsk= 14.4 Rkk= 13.8 + +22 01:24:18 01:39:45 +P1= 46.5 T1=01:34:45 P2= 58.3 T2=01:39:45 Vs= 2.36 + +20 04:30:40 04:30:49 +Riz_sol= 2006.9 + +21 04:31:34 04:31:37 +Rsk= 14.5 Rkk= 13.9 + +22 04:55:37 05:11:04 +P1= 50.1 T1=05:06:04 P2= 63.8 T2=05:11:04 Vs= 2.74 + +23 05:13:36 05:13:41 + + +24 05:13:49 05:14:29 + + +30 05:15:15 05:15:42 +Vst= 31.1 + +31 05:15:49 05:16:23 +Rom_sol= 10.9 + +32 05:16:49 05:17:26 +Imax=11.0 Umax=50.1 T= 8.9 + +33 05:17:31 05:17:52 +Imin=16.0 Umin=25.0 T= 0.5 + +34 05:17:56 05:18:19 +V=300.5 T= 9.5 + +35 05:18:22 05:19:50 +Q= 54.3 T= 9.4 + +36 05:19:54 05:20:28 +P1=0.29 T= 3.0 + +37 05:20:31 05:20:55 +T= 1.0 + +38 05:20:58 05:21:05 +t= 52.0 T= 0.6 + +39 05:21:08 05:21:16 +t= 51.8 T= 0.6 + +40 05:21:18 05:21:26 +t= 51.8 T= 0.6 + +21 15:03:00 15:03:03 +Rsk= 14.5 Rkk= 14.0 + +22 15:44:53 16:00:20 +P1= 32.7 T1=15:55:20 P2= 42.6 T2=16:00:20 Vs= 1.98 + +20 17:39:05 17:39:14 +Riz_sol= 2005.4 + +21 17:39:26 17:39:29 +Rsk= 14.7 Rkk= 14.1 + +22 18:14:36 18:30:03 +P1= 36.2 T1=18:25:03 P2= 45.9 T2=18:30:03 Vs= 1.93 + +22 22:19:39 22:30:06 +P1= 28.0 T1=22:25:06 P2= 32.8 T2=22:30:06 Vs= 0.96 + +23 22:35:05 22:35:14 + + +24 22:35:28 22:36:09 + + +30 22:36:35 22:37:10 +Vst= 31.2 + +31 22:37:16 05:00:00 +Rom_sol= 10.3 + +32 22:38:30 22:39:09 +Imax=11.0 Umax=50.1 T= 8.9 + +33 22:39:13 22:39:37 +Imin=16.0 Umin=25.0 T= 0.5 + +34 22:39:41 22:40:05 +V=300.0 T= 9.5 + +35 22:40:08 22:41:31 +Q= 54.9 T= 9.5 + +36 22:41:36 22:42:09 +P1=0.29 T= 3.0 + +37 22:42:13 22:42:37 +T= 1.0 + +38 22:42:41 22:42:49 +t= 51.9 T= 0.6 + +39 22:43:08 22:43:17 +t= 51.7 T= 0.6 + +40 22:43:57 22:44:04 +t= 51.8 T= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.343 new file mode 100644 index 0000000..65e7266 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.343 @@ -0,0 +1,22 @@ +13 00:26:30 1591730790 +0 00:26:30 1591730790 +14 00:58:56 1591732736 +15 01:40:37 1591735237 +16 02:08:50 1591736930 +1 02:50:31 1591739431 +8 04:25:31 1591745131 +25 05:15:11 1591748111 +9 05:22:21 1591748541 +10 06:04:55 1591751095 +11 09:28:31 1591763311 +12 12:15:33 1591773333 +13 14:01:06 1591779666 +0 14:01:06 1591779666 +2 14:59:44 1591783184 +5 16:02:13 1591786933 +6 16:13:06 1591787586 +7 16:56:50 1591790210 +8 17:34:31 1591792471 +25 22:36:30 1591810590 +9 22:44:33 1591811073 +10 23:27:10 1591813630 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.344 new file mode 100644 index 0000000..48c0ddb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.346 new file mode 100644 index 0000000..ef7a0c5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.346 @@ -0,0 +1,124 @@ +[79] +oper = 13 +begin = 10.06.2020 00:26:30 +norma = 45 +real = 32 + +[80] +oper = 14 +begin = 10.06.2020 00:58:56 +norma = 40 +vac_time = 7 +real = 41 + +[81] +oper = 15 +begin = 10.06.2020 01:40:37 +norma = 30 +real = 28 + +[82] +oper = 16 +begin = 10.06.2020 02:08:50 +norma = 40 +real = 41 + +[83] +oper = 1 +begin = 10.06.2020 02:50:31 +norma = 85 +real = 95 + +[84] +oper = 8 +begin = 10.06.2020 04:25:31 +norma = 40 +vac_time = 8 +real = 49 + +[85] +oper = 25 +begin = 10.06.2020 05:15:11 +norma = 30 +real = 7 + +[86] +oper = 9 +begin = 10.06.2020 05:22:21 +norma = 0 +real = 42 + +[87] +oper = 10 +begin = 10.06.2020 06:04:55 +norma = 0 +real = 203 + +[88] +oper = 11 +begin = 10.06.2020 09:28:31 +norma = 0 +real = 167 + +[89] +oper = 12 +begin = 10.06.2020 12:15:33 +norma = 105 +real = 105 + +[90] +oper = 13 +begin = 10.06.2020 14:01:06 +norma = 45 +real = 58 + +[91] +oper = 2 +begin = 10.06.2020 14:59:44 +norma = 110 +vac_time = 8 +real = 62 + +[92] +oper = 5 +begin = 10.06.2020 16:02:13 +norma = 25 +real = 10 + +[93] +oper = 6 +begin = 10.06.2020 16:13:06 +norma = 35 +real = 43 + +[94] +oper = 7 +begin = 10.06.2020 16:56:50 +norma = 30 +real = 37 + +[95] +oper = 8 +begin = 10.06.2020 17:34:31 +norma = 40 +vac_time = 7 +real = 301 + +[96] +oper = 25 +begin = 10.06.2020 22:36:30 +norma = 30 +real = 8 + +[97] +oper = 9 +begin = 10.06.2020 22:44:33 +norma = 0 +real = 42 + +[98] +oper = 10 +begin = 10.06.2020 23:27:10 +norma = 0 +real = 196 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.347 new file mode 100644 index 0000000..4a87dcb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.347 @@ -0,0 +1,35 @@ +01:40:06 1591735206 祭 ० ࠧ +01:40:33 1591735233 祭 ० ' ⮪ 㣨' +01:40:34 1591735234 祭 ॣ '-2'(A) +02:07:12 1591736832 ⪫祭 ० ࠧ (A) +02:08:52 1591736932 ⪫祭 ० ' ⮪ 㣨' +02:08:53 1591736933 ⪫祭 ॣ '-2'(A) +02:09:00 1591736940 祭 ० ᪠ +02:09:00 1591736940 祭 ० ᪠ +02:11:54 1591737114 ⪫祭 ० ᪠ (A) +05:13:51 1591748031 祭 ॣ '-2'(A) +05:14:30 1591748070 ⪫祭 ॣ '-2'(A) +05:21:36 1591748496 祭 ० ࠧ +05:21:37 1591748497 祭 ० ' ⮪ 㣨' +05:47:50 1591750070 祭 ॣ '-2'(A) +06:04:55 1591751095 祭 ⠭ ॣ +06:04:55 1591751095 ⪫祭 ० ࠧ (A) +09:28:30 1591763310 祭 ० +09:28:31 1591763311 ⪫祭 ॣ '-2'(A) +09:28:32 1591763312 祭 ॣ '-2'(A) +11:20:30 1591770030 ⪫祭 ॣ '-2'(A) +12:15:27 1591773327 ⪫祭 ० (A) +12:15:35 1591773335 ⪫祭 ० ' ⮪ 㣨' +12:16:47 1591773407 祭 ० ᪠ +12:16:47 1591773407 祭 ० ᪠ +12:19:15 1591773555 ⪫祭 ० ᪠ (A) +16:13:42 1591787622 祭 ० ᪠ +16:13:42 1591787622 祭 ० ᪠ +16:16:12 1591787772 ⪫祭 ० ᪠ (A) +22:35:30 1591810530 祭 ॣ '-2'(A) +22:36:10 1591810570 ⪫祭 ॣ '-2'(A) +22:44:14 1591811054 祭 ० ࠧ +22:44:16 1591811056 祭 ० ' ⮪ 㣨' +23:10:04 1591812604 祭 ॣ '-2'(A) +23:27:09 1591813629 祭 ⠭ ॣ +23:27:10 1591813630 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.349 new file mode 100644 index 0000000..524caa0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.350 new file mode 100644 index 0000000..76d2c4b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.350 @@ -0,0 +1,4 @@ +08:48:09 1591760889 3 14 +09:49:25 1591764565 0 A--32-067-2014 ॢ 0 +11:36:20 1591770980 1 09536 3 37 9 4450 +14:01:38 1591779698 2 p. cao M1,M2,M3,M4 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.351 new file mode 100644 index 0000000..a59d4c9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.352 new file mode 100644 index 0000000..f9d6173 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.352 @@ -0,0 +1,78 @@ +21 08:48:19 08:48:22 +Rsk= 15.6 Rkk= 12.9 + +22 09:08:38 09:24:10 +P1= 58.9 T1=09:19:09 P2= 78.8 T2=09:24:10 Vs= 3.98 + +21 11:22:10 11:22:13 +Rsk= 15.8 Rkk= 13.0 + +22 11:59:34 12:15:05 +P1= 31.4 T1=12:10:05 P2= 43.0 T2=12:15:05 Vs= 2.33 + +20 13:52:34 13:52:42 +Riz_sol= 6320.7 + +21 13:52:51 13:52:54 +Rsk= 15.7 Rkk= 12.9 + +22 14:23:58 14:39:29 +P1= 34.5 T1=14:34:28 P2= 46.6 T2=14:39:29 Vs= 2.41 + +22 14:42:51 14:58:21 +P1= 30.9 T1=14:53:21 P2= 41.5 T2=14:58:21 Vs= 2.14 + +22 22:37:34 22:48:04 +P1= 5.3 T1=22:43:04 P2= 14.2 T2=22:48:04 Vs= 1.78 + +23 22:49:34 22:49:39 + + +24 22:49:53 22:50:29 + + +30 22:51:19 22:51:46 +Vst= 28.0 + +31 22:52:03 22:52:38 +Rom_sol= 14.2 + +41 22:53:21 22:53:26 +Ukz= 0.83 + +32 22:53:38 22:54:13 +Imax=27.3 Umax=55.0 T= 9.0 + +33 22:54:22 22:54:41 +Imin=16.2 Umin=24.9 T= 0.5 + +34 22:54:47 22:55:10 +V=300.3 T= 9.5 + +22 23:37:50 23:48:21 +P1= 4.2 T1=23:43:21 P2= 12.7 T2=23:48:21 Vs= 1.70 + +23 23:49:41 23:49:46 + + +24 23:49:56 23:50:35 + + +30 23:51:14 23:51:38 +Vst= 28.1 + +31 23:51:59 23:52:37 +Rom_sol= 14.2 + +41 23:53:32 23:53:37 +Ukz= 0.74 + +32 23:53:41 23:54:16 +Imax=27.3 Umax=55.0 T= 9.0 + +33 23:54:20 23:54:42 +Imin=16.2 Umin=25.0 T= 0.5 + +34 23:54:45 23:55:09 +V=300.3 T= 9.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.353 new file mode 100644 index 0000000..f710afb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.353 @@ -0,0 +1,15 @@ +11 02:48:37 1591739317 +12 05:49:51 1591750191 +13 07:36:43 1591756603 +0 07:36:43 1591756603 +14 08:46:08 1591760768 +15 09:25:17 1591763117 +16 09:52:37 1591764757 +1 10:31:44 1591767104 +2 11:19:49 1591769989 +5 12:15:50 1591773350 +6 12:28:04 1591774084 +7 13:05:50 1591776350 +8 13:44:32 1591778672 +25 22:51:14 1591811474 +25 23:51:10 1591815070 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.354 new file mode 100644 index 0000000..cbc6b70 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.355 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.355 new file mode 100644 index 0000000..6fd4eee --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.355 @@ -0,0 +1,6 @@ +47 22:57:49 1591811869 +47 22:58:50 1591811930 +47 22:58:52 1591811932 +47 23:03:30 1591812210 +47 23:03:37 1591812217 +47 23:03:37 1591812217 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.356 new file mode 100644 index 0000000..5b97b9e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.356 @@ -0,0 +1,87 @@ +[06] +oper = 11 +begin = 10.06.2020 02:48:37 +norma = 0 +real = 181 + +[07] +oper = 12 +begin = 10.06.2020 05:49:51 +norma = 105 +real = 106 + +[08] +oper = 13 +begin = 10.06.2020 07:36:43 +norma = 45 +real = 69 + +[09] +oper = 14 +begin = 10.06.2020 08:46:08 +norma = 40 +vac_time = 6 +real = 39 + +[10] +oper = 15 +begin = 10.06.2020 09:25:17 +norma = 30 +real = 27 + +[11] +oper = 16 +begin = 10.06.2020 09:52:37 +norma = 40 +real = 39 + +[12] +oper = 1 +begin = 10.06.2020 10:31:44 +norma = 85 +real = 48 + +[13] +oper = 2 +begin = 10.06.2020 11:19:49 +norma = 110 +vac_time = 7 +real = 56 + +[14] +oper = 5 +begin = 10.06.2020 12:15:50 +norma = 25 +real = 12 + +[15] +oper = 6 +begin = 10.06.2020 12:28:04 +norma = 35 +real = 37 + +[16] +oper = 7 +begin = 10.06.2020 13:05:50 +norma = 30 +real = 38 + +[17] +oper = 8 +begin = 10.06.2020 13:44:32 +norma = 40 +vac_time = 8 +real = 546 + +[18] +oper = 25 +begin = 10.06.2020 22:51:14 +norma = 30 +real = 59 + +[19] +oper = 25 +begin = 10.06.2020 23:51:10 +norma = 30 +real = 40 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.357 new file mode 100644 index 0000000..9b99e40 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.357 @@ -0,0 +1,27 @@ +02:48:37 1591739317 祭 ० +02:48:37 1591739317 ⪫祭 ॣ '-2'(A) +02:48:38 1591739318 祭 ॣ '-2'(A) +03:57:37 1591743457 ⪫祭 ॣ '-2'(A) +05:30:13 1591749013 ⪫祭 ० (A) +05:30:15 1591749015 ⪫祭 ० ' ⮪ 㣨' +05:50:16 1591750216 祭 ० ᪠ +05:53:19 1591750399 ⪫祭 ० ᪠ (A) +09:24:52 1591763092 祭 ० ࠧ +09:24:54 1591763094 祭 ० ' ⮪ 㣨' +09:26:05 1591763165 祭 ॣ '-2'(A) +09:49:25 1591764565 ⪫祭 ० ࠧ (A) +09:52:38 1591764758 ⪫祭 ० ' ⮪ 㣨' +09:52:40 1591764760 ⪫祭 ॣ '-2'(A) +09:52:56 1591764776 祭 ० ᪠ +09:52:57 1591764777 祭 ० ᪠ +09:52:57 1591764777 祭 ० ᪠ +09:56:00 1591764960 ⪫祭 ० ᪠ (A) +12:28:16 1591774096 祭 ० ᪠ +12:28:16 1591774096 祭 ० ᪠ +12:28:17 1591774097 祭 ० ᪠ +12:28:17 1591774097 祭 ० ᪠ +12:31:19 1591774279 ⪫祭 ० ᪠ (A) +22:49:54 1591811394 祭 ॣ '-2'(A) +22:50:30 1591811430 ⪫祭 ॣ '-2'(A) +23:49:58 1591814998 祭 ॣ '-2'(A) +23:50:36 1591815036 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.359 new file mode 100644 index 0000000..fe706af Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.460 new file mode 100644 index 0000000..9ab2389 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.460 @@ -0,0 +1,7 @@ +01:31:33 1591734693 3 14 +04:36:55 1591745815 1 11487 2 BT 18, 20, 22, 23, 25 3 25 9 4630 10 690 +05:24:43 1591748683 1 11487 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 4530 9 4630 10 690 11 12 321731 +06:07:28 1591751248 0 A--32-031-2016 ॢ 5 +17:31:01 1591792261 1 11488 2 BT 3-1, 6, 8, 9, 14, 15, 16 8 4710 +22:58:06 1591811886 1 11488 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4710 9 4630 10 690 11 12 321731 +23:40:46 1591814446 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.461 new file mode 100644 index 0000000..ed196a2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.462 new file mode 100644 index 0000000..9147e59 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.462 @@ -0,0 +1,105 @@ +21 01:31:50 01:31:53 +Rsk= 17.0 Rkk= 15.1 + +22 01:48:06 02:03:13 +P1= 65.3 T1=01:58:13 P2= 82.7 T2=02:03:13 Vs= 3.46 + +20 04:36:03 04:36:12 +Riz_sol= 1176.4 + +21 04:37:11 04:37:14 +Rsk= 16.9 Rkk= 14.8 + +22 04:59:59 05:15:07 +P1= 41.4 T1=05:10:07 P2= 53.1 T2=05:15:07 Vs= 2.34 + +23 05:15:57 05:16:02 + + +24 05:16:18 05:16:57 + + +30 05:17:08 05:17:30 +Vst= 27.6 + +31 05:17:41 05:18:15 +Rom_sol= 11.0 + +32 05:18:58 05:19:33 +Imax=11.1 Umax=50.1 T= 9.0 + +33 05:19:37 05:19:59 +Imin=16.1 Umin=24.9 T= 0.5 + +34 05:20:03 05:20:26 +V=300.5 T= 9.4 + +35 05:20:29 05:21:43 +Q= 55.0 T= 9.4 + +36 05:21:46 05:22:16 +P1=0.29 T= 2.9 + +37 05:22:52 05:23:17 +T= 0.9 + +38 05:23:21 05:23:29 +t= 52.6 T= 0.5 + +39 05:23:32 05:23:47 +tcam= 53.7 Tcam= 0.5 tfl= 59.5 Tfl= 0.5 + +40 05:23:51 05:23:58 +t= 54.2 T= 0.5 + +20 17:31:20 17:31:29 +Riz_sol= 6857.3 + +21 17:31:36 17:31:39 +Rsk= 17.0 Rkk= 15.0 + +22 17:59:53 18:15:00 +P1= 36.9 T1=18:10:00 P2= 48.8 T2=18:15:00 Vs= 2.38 + +22 22:24:55 22:35:02 +P1= 17.1 T1=22:30:02 P2= 23.7 T2=22:35:02 Vs= 1.33 + +23 22:36:12 22:36:17 + + +24 22:36:35 22:37:12 + + +30 22:37:29 22:37:58 +Vst= 27.9 + +31 22:38:05 22:38:36 +Rom_sol= 12.2 + +32 22:39:15 22:39:52 +Imax=11.1 Umax=50.1 T= 9.0 + +33 22:39:56 22:40:18 +Imin=16.1 Umin=24.9 T= 0.5 + +34 22:40:23 22:40:45 +V=300.1 T= 9.4 + +35 22:40:50 22:42:13 +Q= 51.3 T= 9.4 + +36 22:42:18 22:42:50 +P1=0.28 T= 2.9 + +37 22:43:18 22:43:43 +T= 0.9 + +38 22:43:48 22:43:57 +t= 54.0 T= 0.5 + +39 22:44:02 22:44:20 +tcam= 52.2 Tcam= 0.5 tfl= 59.6 Tfl= 0.5 + +40 22:44:26 22:44:36 +t= 54.0 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.463 new file mode 100644 index 0000000..db13419 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.463 @@ -0,0 +1,18 @@ +13 00:52:42 1591732362 +0 00:52:42 1591732362 +14 01:27:12 1591734432 +15 02:04:24 1591736664 +16 02:31:54 1591738314 +1 03:18:22 1591741102 +8 04:30:37 1591745437 +25 05:17:05 1591748225 +9 05:24:43 1591748683 +10 06:07:28 1591751248 +11 09:47:30 1591764450 +12 12:34:32 1591774472 +13 14:23:19 1591780999 +0 14:23:19 1591780999 +8 17:25:00 1591791900 +25 22:37:24 1591810644 +9 22:58:06 1591811886 +10 23:40:46 1591814446 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.464 new file mode 100644 index 0000000..9ebd600 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.466 new file mode 100644 index 0000000..9e5b210 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.466 @@ -0,0 +1,100 @@ +[49] +oper = 13 +begin = 10.06.2020 00:52:42 +norma = 45 +real = 34 + +[50] +oper = 14 +begin = 10.06.2020 01:27:12 +norma = 40 +vac_time = 8 +real = 37 + +[51] +oper = 15 +begin = 10.06.2020 02:04:24 +norma = 30 +real = 27 + +[52] +oper = 16 +begin = 10.06.2020 02:31:54 +norma = 40 +real = 46 + +[53] +oper = 1 +begin = 10.06.2020 03:18:22 +norma = 85 +real = 72 + +[54] +oper = 8 +begin = 10.06.2020 04:30:37 +norma = 40 +vac_time = 9 +real = 46 + +[55] +oper = 25 +begin = 10.06.2020 05:17:05 +norma = 30 +real = 7 + +[56] +oper = 9 +begin = 10.06.2020 05:24:43 +norma = 0 +real = 42 + +[57] +oper = 10 +begin = 10.06.2020 06:07:28 +norma = 0 +real = 220 + +[58] +oper = 11 +begin = 10.06.2020 09:47:30 +norma = 0 +real = 167 + +[59] +oper = 12 +begin = 10.06.2020 12:34:32 +norma = 105 +real = 108 + +[60] +oper = 13 +begin = 10.06.2020 14:23:19 +norma = 45 +real = 181 + +[61] +oper = 8 +begin = 10.06.2020 17:25:00 +norma = 40 +vac_time = 9 +vac_avg10 = 9.5 +real = 312 + +[62] +oper = 25 +begin = 10.06.2020 22:37:24 +norma = 30 +real = 20 + +[63] +oper = 9 +begin = 10.06.2020 22:58:06 +norma = 0 +real = 42 + +[64] +oper = 10 +begin = 10.06.2020 23:40:46 +norma = 0 +real = 225 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.467 new file mode 100644 index 0000000..3965250 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.467 @@ -0,0 +1,29 @@ +02:03:50 1591736630 祭 ० ࠧ +02:03:51 1591736631 祭 ० ' ⮪ 㣨' +02:05:13 1591736713 祭 ॣ '-2'(A) +02:28:45 1591738125 ⪫祭 ० ' ⮪ 㣨' +02:31:58 1591738318 ⪫祭 ॣ '-2'(A) +02:32:21 1591738341 祭 ० ᪠ +02:34:23 1591738463 ⪫祭 ० ᪠ (A) +05:16:20 1591748180 祭 ॣ '-2'(A) +05:16:57 1591748217 ⪫祭 ॣ '-2'(A) +05:24:14 1591748654 祭 ० ࠧ +05:24:17 1591748657 祭 ० ' ⮪ 㣨' +05:50:24 1591750224 祭 ॣ '-2'(A) +06:07:28 1591751248 ⪫祭 ० ࠧ (A) +06:07:28 1591751248 祭 ⠭ ॣ +09:47:29 1591764449 祭 ० +09:47:29 1591764449 ⪫祭 ॣ '-2'(A) +09:47:30 1591764450 祭 ॣ '-2'(A) +11:39:30 1591771170 ⪫祭 ॣ '-2'(A) +12:34:27 1591774467 ⪫祭 ० (A) +12:34:33 1591774473 ⪫祭 ० ' ⮪ 㣨' +12:37:19 1591774639 祭 ० ᪠ +12:40:13 1591774813 ⪫祭 ० ᪠ (A) +22:36:36 1591810596 祭 ॣ '-2'(A) +22:37:12 1591810632 ⪫祭 ॣ '-2'(A) +22:57:45 1591811865 祭 ० ࠧ +22:57:49 1591811869 祭 ० ' ⮪ 㣨' +23:23:42 1591813422 祭 ॣ '-2'(A) +23:40:46 1591814446 ⪫祭 ० ࠧ (A) +23:40:46 1591814446 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200610.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.469 new file mode 100644 index 0000000..e4e2278 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200610.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.120 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.120 new file mode 100644 index 0000000..1326914 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.120 @@ -0,0 +1,2 @@ +13:12:16 1591863136 1 10859 2 BT 18, 20, 22, 23, 25 4 2 7 870 9 6660 10 770 +16:50:10 1591876210 11 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.121 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.121 new file mode 100644 index 0000000..16995f1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.121 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.122 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.122 new file mode 100644 index 0000000..71c9bfa --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.122 @@ -0,0 +1,15 @@ +21 13:12:57 13:13:00 +Rsk= 11.9 Rkk= 7.8 + +22 13:55:07 14:05:14 +P1= 25.3 T1=14:00:14 P2= 39.6 T2=14:05:14 Vs= 2.87 + +20 16:50:52 16:51:00 +Riz_sol= 4974.7 + +21 16:51:06 16:51:09 +Rsk= 11.8 Rkk= 7.7 + +22 17:25:04 17:35:11 +P1= 24.9 T1=17:30:11 P2= 37.1 T2=17:35:11 Vs= 2.45 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.123 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.123 new file mode 100644 index 0000000..d969e26 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.123 @@ -0,0 +1,9 @@ +11 03:24:26 1591827866 +12 06:11:25 1591837885 +13 08:02:06 1591844526 +0 08:02:08 1591844528 +2 13:09:29 1591862969 +5 14:09:13 1591866553 +6 14:21:14 1591867274 +7 16:07:19 1591873639 +8 16:36:17 1591875377 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.124 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.124 new file mode 100644 index 0000000..9789380 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.124 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.126 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.126 new file mode 100644 index 0000000..c70fcc3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.126 @@ -0,0 +1,51 @@ +[00] +oper = 11 +begin = 11.06.2020 03:24:26 +norma = 0 +real = 166 + +[01] +oper = 12 +begin = 11.06.2020 06:11:25 +norma = 105 +real = 110 + +[02] +oper = 13 +begin = 11.06.2020 08:02:06 +norma = 45 +real = 307 + +[03] +oper = 2 +begin = 11.06.2020 13:09:29 +norma = 110 +vac_time = 7 +vac_avg10 = 7.4 +real = 59 + +[04] +oper = 5 +begin = 11.06.2020 14:09:13 +norma = 25 +real = 12 + +[05] +oper = 6 +begin = 11.06.2020 14:21:14 +norma = 35 +real = 106 + +[06] +oper = 7 +begin = 11.06.2020 16:07:19 +norma = 30 +real = 28 + +[07] +oper = 8 +begin = 11.06.2020 16:36:17 +norma = 40 +vac_time = 15 +real = 1884 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.127 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.127 new file mode 100644 index 0000000..4c646fd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.127 @@ -0,0 +1,27 @@ +03:24:25 1591827865 祭 ० +03:24:26 1591827866 ⪫祭 ॣ '-2'(A) +03:24:27 1591827867 祭 ॣ '-2'(A) +05:16:26 1591834586 ⪫祭 ॣ '-2'(A) +06:11:23 1591837883 ⪫祭 ० (A) +06:11:27 1591837887 ⪫祭 ० ' ⮪ 㣨' +06:12:11 1591837931 祭 ० ᪠ +06:12:11 1591837931 祭 ० ᪠ +06:12:11 1591837931 祭 ० ᪠ +06:13:51 1591838031 ⪫祭 ० ᪠ +06:13:59 1591838039 祭 ० ᪠ +06:14:13 1591838053 ⪫祭 ० ᪠ (A) +14:21:38 1591867298 祭 ० ᪠ +14:21:38 1591867298 祭 ० ᪠ +14:21:38 1591867298 祭 ० ᪠ +14:21:38 1591867298 祭 ० ᪠ +14:21:38 1591867298 祭 ० ᪠ +14:21:39 1591867299 祭 ० ᪠ +14:21:39 1591867299 祭 ० ᪠ +14:21:40 1591867300 祭 ० ᪠ +14:21:40 1591867300 祭 ० ᪠ +14:21:41 1591867301 祭 ० ᪠ +14:21:41 1591867301 祭 ० ᪠ +14:21:41 1591867301 祭 ० ᪠ +14:21:42 1591867302 祭 ० ᪠ +14:23:59 1591867439 ⪫祭 ० ᪠ (A) +16:50:11 1591876211 : 㦥 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.129 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.129 new file mode 100644 index 0000000..34f3c3e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.129 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.320 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.320 new file mode 100644 index 0000000..2f5eec7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.320 @@ -0,0 +1,6 @@ +00:36:31 1591817791 1 05132 3 32 6 9 3860 12 321547 +04:24:56 1591831496 6 +04:25:28 1591831528 1 05132 2 OT-4 3 32 4 2 5 Ti 6 7 770 8 4450 9 3860 10 670 11 12 321547 +04:54:48 1591833288 0 A--32-050-2012 ॢ 1 +13:05:50 1591862750 3 14 +17:17:52 1591877872 1 05133 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 6 9 3740 10 690 12 320747 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.321 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.321 new file mode 100644 index 0000000..f90d4dc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.321 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.322 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.322 new file mode 100644 index 0000000..4455411 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.322 @@ -0,0 +1,81 @@ +21 00:35:11 00:35:14 +Rsk=8923.1 Rkk= 13.6 + +21 00:37:13 00:37:16 +Rsk= 22.9 Rkk= 13.6 + +22 01:10:01 01:25:06 +P1= 36.2 T1=01:20:06 P2= 50.5 T2=01:25:06 Vs= 2.85 + +20 03:25:37 03:25:45 +Riz_sol=473470.9 + +21 03:25:55 03:25:58 +Rsk= 18.4 Rkk= 13.3 + +22 04:00:00 04:15:05 +P1= 35.2 T1=04:10:05 P2= 49.3 T2=04:15:05 Vs= 2.83 + +24 04:15:22 04:16:17 + + +23 04:16:31 04:16:36 + + +30 04:16:51 04:17:16 +Vst= 29.8 + +31 04:17:23 04:17:57 +Rom_sol= 12.0 + +41 04:18:37 04:18:42 +Ukz= 1.41 + +32 04:18:49 04:19:25 +Imax=27.2 Umax=55.0 T= 9.0 + +33 04:19:29 04:19:51 +Imin=16.2 Umin=25.0 T= 0.5 + +34 04:19:55 04:20:17 +V=300.0 T= 9.4 + +35 04:20:20 04:22:07 +Q= 52.4 T= 9.4 + +36 04:22:10 04:22:43 +P1=0.29 T= 2.9 + +37 04:22:46 04:23:19 +T= 0.9 + +38 04:23:23 04:23:47 +t= 53.3 T= 0.5 + +39 04:23:50 04:24:25 +tcam= 53.4 Tcam= 0.5 tfl= 52.0 Tfl= 0.5 + +40 04:24:28 04:24:35 +t= 51.8 T= 0.5 + +21 13:06:03 13:06:06 +Rsk= 18.3 Rkk= 12.9 + +22 13:50:33 14:00:38 +P1= 16.5 T1=13:55:38 P2= 40.2 T2=14:00:38 Vs= 4.73 + +21 17:18:09 17:18:12 +Rsk= 18.8 Rkk= 13.5 + +22 17:54:55 18:10:00 +P1= 33.5 T1=18:05:00 P2= 47.0 T2=18:10:00 Vs= 2.68 + +20 19:57:54 19:58:02 +Riz_sol= 4805.6 + +21 19:58:07 19:58:10 +Rsk= 18.5 Rkk= 13.3 + +22 20:29:56 20:45:01 +P1= 37.6 T1=20:40:01 P2= 52.2 T2=20:45:01 Vs= 2.92 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.323 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.323 new file mode 100644 index 0000000..9752b66 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.323 @@ -0,0 +1,21 @@ +2 00:31:12 1591817472 +5 01:26:32 1591820792 +6 01:38:10 1591821490 +7 02:23:42 1591824222 +8 03:20:36 1591827636 +25 04:16:48 1591831008 +9 04:25:28 1591831528 +10 04:54:48 1591833288 +11 07:24:20 1591842260 +12 09:24:29 1591849469 +13 11:13:48 1591856028 +0 11:13:48 1591856028 +14 13:04:31 1591862671 +15 14:03:27 1591866207 +16 14:33:36 1591868016 +1 16:08:17 1591873697 +2 17:13:30 1591877610 +5 18:11:11 1591881071 +6 18:22:14 1591881734 +7 19:06:23 1591884383 +8 19:54:11 1591887251 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.324 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.324 new file mode 100644 index 0000000..8563db1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.324 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.326 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.326 new file mode 100644 index 0000000..48175d5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.326 @@ -0,0 +1,126 @@ +[04] +oper = 2 +begin = 11.06.2020 00:31:12 +norma = 110 +vac_time = 8 +vac_avg10 = 8.0 +real = 55 + +[05] +oper = 5 +begin = 11.06.2020 01:26:32 +norma = 25 +real = 11 + +[06] +oper = 6 +begin = 11.06.2020 01:38:10 +norma = 35 +real = 45 + +[07] +oper = 7 +begin = 11.06.2020 02:23:42 +norma = 30 +real = 56 + +[08] +oper = 8 +begin = 11.06.2020 03:20:36 +norma = 40 +vac_time = 8 +real = 56 + +[09] +oper = 25 +begin = 11.06.2020 04:16:48 +norma = 30 +real = 8 + +[10] +oper = 9 +begin = 11.06.2020 04:25:28 +norma = 0 +real = 29 + +[11] +oper = 10 +begin = 11.06.2020 04:54:48 +norma = 0 +real = 149 + +[12] +oper = 11 +begin = 11.06.2020 07:24:20 +norma = 115 +real = 120 + +[13] +oper = 12 +begin = 11.06.2020 09:24:29 +norma = 105 +real = 109 + +[14] +oper = 13 +begin = 11.06.2020 11:13:48 +norma = 45 +real = 110 + +[15] +oper = 14 +begin = 11.06.2020 13:04:31 +norma = 40 +vac_time = 8 +real = 58 + +[16] +oper = 15 +begin = 11.06.2020 14:03:27 +norma = 30 +real = 30 + +[17] +oper = 16 +begin = 11.06.2020 14:33:36 +norma = 40 +real = 94 + +[18] +oper = 1 +begin = 11.06.2020 16:08:17 +norma = 85 +real = 65 + +[19] +oper = 2 +begin = 11.06.2020 17:13:30 +norma = 110 +vac_time = 9 +real = 57 + +[20] +oper = 5 +begin = 11.06.2020 18:11:11 +norma = 25 +real = 11 + +[21] +oper = 6 +begin = 11.06.2020 18:22:14 +norma = 35 +real = 44 + +[22] +oper = 7 +begin = 11.06.2020 19:06:23 +norma = 30 +real = 47 + +[23] +oper = 8 +begin = 11.06.2020 19:54:11 +norma = 40 +vac_time = 8 +real = 1727 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.327 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.327 new file mode 100644 index 0000000..b4d157e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.327 @@ -0,0 +1,30 @@ +01:38:41 1591821521 祭 ० ᪠ +01:38:41 1591821521 祭 ० ᪠ +01:40:49 1591821649 ⪫祭 ० ᪠ (A) +04:15:41 1591830941 祭 ॣ '-2'(A) +04:16:18 1591830978 ⪫祭 ॣ '-2'(A) +04:25:04 1591831504 祭 ० ࠧ +04:25:06 1591831506 祭 ० ' ⮪ 㣨' +04:51:48 1591833108 祭 ॣ '-2'(A) +04:52:10 1591833130 ⪫祭 ० ᪠ (A) +04:54:48 1591833288 ⪫祭 ० ࠧ (A) +04:54:48 1591833288 祭 ⠭ ॣ +07:24:19 1591842259 祭 ० +07:24:20 1591842260 ⪫祭 ॣ '-2'(A) +07:24:21 1591842261 祭 ॣ '-2'(A) +08:27:14 1591846034 祭 ० +08:27:16 1591846036 ⪫祭 ॣ '-2'(A) +09:24:19 1591849459 ⪫祭 ० (A) +09:24:21 1591849461 ⪫祭 ० ' ⮪ 㣨' +09:26:14 1591849574 祭 ० ᪠ +09:28:20 1591849700 ⪫祭 ० ᪠ (A) +14:02:50 1591866170 祭 ० ࠧ +14:02:53 1591866173 祭 ० ' ⮪ 㣨' +14:04:12 1591866252 祭 ॣ '-2'(A) +14:31:56 1591867916 ⪫祭 ० ' ⮪ 㣨' +14:33:40 1591868020 ⪫祭 ॣ '-2'(A) +14:33:54 1591868034 祭 ० ᪠ +14:35:59 1591868159 ⪫祭 ० ᪠ (A) +18:22:26 1591881746 祭 ० ᪠ +18:22:26 1591881746 祭 ० ᪠ +18:24:35 1591881875 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.329 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.329 new file mode 100644 index 0000000..7a424a8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.329 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.340 new file mode 100644 index 0000000..162f88e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.340 @@ -0,0 +1,3 @@ +17:58:42 1591880322 3 14 +20:10:42 1591888242 0 A--32-067-2014 ॢ 0 +21:30:40 1591893040 1 09599 3 25 7 870 9 6260 10 770 12 321075 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.341 new file mode 100644 index 0000000..f437c8d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.342 new file mode 100644 index 0000000..c5e1875 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.342 @@ -0,0 +1,18 @@ +21 17:58:54 17:58:57 +Rsk= 14.5 Rkk= 13.9 + +21 18:48:07 18:48:10 +Rsk= 14.6 Rkk= 14.0 + +22 19:09:43 19:25:09 +P1= 73.0 T1=19:20:09 P2= 99.1 T2=19:25:09 Vs= 5.22 + +22 19:30:50 19:41:16 +P1= 32.3 T1=19:36:16 P2= 55.8 T2=19:41:16 Vs= 4.71 + +21 21:30:48 21:30:51 +Rsk= 14.7 Rkk= 14.2 + +22 22:05:34 22:16:01 +P1= 21.0 T1=22:11:01 P2= 35.9 T2=22:16:01 Vs= 2.98 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.343 new file mode 100644 index 0000000..d0d00f6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.343 @@ -0,0 +1,13 @@ +11 02:43:12 1591825392 +12 05:30:14 1591835414 +13 08:06:12 1591844772 +0 08:06:13 1591844773 +14 17:56:38 1591880198 +1 18:36:28 1591882588 +14 18:47:26 1591883246 +15 19:42:10 1591886530 +16 20:13:24 1591888404 +1 20:48:56 1591890536 +2 21:28:13 1591892893 +5 22:16:43 1591895803 +6 22:28:49 1591896529 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.344 new file mode 100644 index 0000000..b3cacd9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.346 new file mode 100644 index 0000000..41533d4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.346 @@ -0,0 +1,75 @@ +[99] +oper = 11 +begin = 11.06.2020 02:43:12 +norma = 0 +real = 167 + +[00] +oper = 12 +begin = 11.06.2020 05:30:14 +norma = 105 +real = 155 + +[01] +oper = 13 +begin = 11.06.2020 08:06:12 +norma = 45 +real = 590 + +[02] +oper = 14 +begin = 11.06.2020 17:56:38 +norma = 40 +vac_time = 9 +real = 39 + +[03] +oper = 1 +begin = 11.06.2020 18:36:28 +norma = 85 +real = 10 + +[04] +oper = 14 +begin = 11.06.2020 18:47:26 +norma = 40 +vac_time = 8 +real = 54 + +[05] +oper = 15 +begin = 11.06.2020 19:42:10 +norma = 30 +real = 31 + +[06] +oper = 16 +begin = 11.06.2020 20:13:24 +norma = 40 +real = 35 + +[07] +oper = 1 +begin = 11.06.2020 20:48:56 +norma = 85 +real = 39 + +[08] +oper = 2 +begin = 11.06.2020 21:28:13 +norma = 110 +vac_time = 8 +real = 48 + +[09] +oper = 5 +begin = 11.06.2020 22:16:43 +norma = 25 +real = 12 + +[10] +oper = 6 +begin = 11.06.2020 22:28:49 +norma = 35 +real = 841 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.347 new file mode 100644 index 0000000..cb425b2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.347 @@ -0,0 +1,25 @@ +02:43:11 1591825391 祭 ० +02:43:12 1591825392 ⪫祭 ॣ '-2'(A) +02:43:13 1591825393 祭 ॣ '-2'(A) +04:35:14 1591832114 ⪫祭 ॣ '-2'(A) +05:30:09 1591835409 ⪫祭 ० (A) +05:30:15 1591835415 ⪫祭 ० ' ⮪ 㣨' +05:34:55 1591835695 祭 ० ᪠ +05:37:52 1591835872 ⪫祭 ० ᪠ (A) +19:41:41 1591886501 祭 ० ࠧ +19:41:43 1591886503 祭 ० ' ⮪ 㣨' +19:42:56 1591886576 祭 ॣ '-2'(A) +20:10:42 1591888242 ⪫祭 ० ࠧ (A) +20:10:44 1591888244 ⪫祭 ० ' ⮪ 㣨' +20:13:28 1591888408 ⪫祭 ॣ '-2'(A) +20:13:48 1591888428 祭 ० ᪠ +20:14:00 1591888440 祭 ० ᪠ +20:14:00 1591888440 祭 ० ᪠ +20:16:48 1591888608 ⪫祭 ० ᪠ (A) +22:29:13 1591896553 祭 ० ᪠ +22:29:13 1591896553 祭 ० ᪠ +22:29:13 1591896553 祭 ० ᪠ +22:29:13 1591896553 祭 ० ᪠ +22:29:14 1591896554 祭 ० ᪠ +22:29:14 1591896554 祭 ० ᪠ +22:32:14 1591896734 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.349 new file mode 100644 index 0000000..27cd427 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.460 new file mode 100644 index 0000000..89aad0d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.460 @@ -0,0 +1 @@ +10:56:23 1591854983 1 11489 9 4640 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.461 new file mode 100644 index 0000000..c0b0da7 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.462 new file mode 100644 index 0000000..b2baf20 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.462 @@ -0,0 +1,15 @@ +21 10:39:19 10:39:22 +Rsk= 16.3 Rkk= 14.2 + +22 11:09:56 11:25:03 +P1= 38.0 T1=11:20:03 P2= 50.0 T2=11:25:03 Vs= 2.39 + +21 13:00:32 13:00:35 +Rsk= 16.5 Rkk= 14.5 + +20 13:24:32 13:24:40 +Riz_sol= 1143.2 + +22 13:45:05 14:00:12 +P1= 32.0 T1=13:55:12 P2= 44.4 T2=14:00:12 Vs= 2.47 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.463 new file mode 100644 index 0000000..addd6ac --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.463 @@ -0,0 +1,9 @@ +11 03:26:07 1591827967 +12 06:13:08 1591837988 +13 08:17:51 1591845471 +0 08:17:51 1591845471 +2 10:34:37 1591853677 +5 11:25:56 1591856756 +6 11:37:29 1591857449 +7 12:19:06 1591859946 +8 12:49:32 1591861772 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.464 new file mode 100644 index 0000000..0cf9419 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.465 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.465 new file mode 100644 index 0000000..02c67e3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.465 @@ -0,0 +1,6 @@ +17 13:02:54 1591862574 +17 13:03:08 1591862588 +17 13:03:16 1591862596 +17 13:07:14 1591862834 +17 13:10:25 1591863025 +17 13:23:04 1591863784 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.466 new file mode 100644 index 0000000..7baec9f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.466 @@ -0,0 +1,50 @@ +[65] +oper = 11 +begin = 11.06.2020 03:26:07 +norma = 0 +real = 167 + +[66] +oper = 12 +begin = 11.06.2020 06:13:08 +norma = 105 +real = 124 + +[67] +oper = 13 +begin = 11.06.2020 08:17:51 +norma = 45 +real = 136 + +[68] +oper = 2 +begin = 11.06.2020 10:34:37 +norma = 110 +vac_time = 9 +real = 51 + +[69] +oper = 5 +begin = 11.06.2020 11:25:56 +norma = 25 +real = 11 + +[70] +oper = 6 +begin = 11.06.2020 11:37:29 +norma = 35 +real = 41 + +[71] +oper = 7 +begin = 11.06.2020 12:19:06 +norma = 30 +real = 30 + +[72] +oper = 8 +begin = 11.06.2020 12:49:32 +norma = 40 +vac_time = 35 +real = 2131 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.467 new file mode 100644 index 0000000..1f6006a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.467 @@ -0,0 +1,12 @@ +03:26:06 1591827966 祭 ० +03:26:07 1591827967 ⪫祭 ॣ '-2'(A) +03:26:08 1591827968 祭 ॣ '-2'(A) +05:18:08 1591834688 ⪫祭 ॣ '-2'(A) +06:13:05 1591837985 ⪫祭 ० (A) +06:13:10 1591837990 ⪫祭 ० ' ⮪ 㣨' +06:13:53 1591838033 祭 ० ᪠ +06:16:50 1591838210 ⪫祭 ० ᪠ (A) +11:38:03 1591857483 祭 ० ᪠ +11:38:03 1591857483 祭 ० ᪠ +11:38:03 1591857483 祭 ० ᪠ +11:40:08 1591857608 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200611.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.469 new file mode 100644 index 0000000..0b9a8d9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200611.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200612.321 b/Tests/bin/Debug/netcoreapp3.1/temp/20200612.321 new file mode 100644 index 0000000..78b61d8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200612.321 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200612.324 b/Tests/bin/Debug/netcoreapp3.1/temp/20200612.324 new file mode 100644 index 0000000..d1e4d7d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200612.324 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200612.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200612.461 new file mode 100644 index 0000000..d321921 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200612.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200612.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200612.464 new file mode 100644 index 0000000..32bd038 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200612.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.320 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.320 new file mode 100644 index 0000000..4f0b581 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.320 @@ -0,0 +1,4 @@ +00:50:35 1591991435 1 05133 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4450 9 3740 10 690 11 12 320747 +01:33:13 1591993993 0 A--32-031-2016 ॢ 5 +10:16:25 1592025385 3 14 +12:47:23 1592034443 1 05134 2 p. cao M1,M2,M3,M4 3 37 9 4420 10 670 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.321 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.321 new file mode 100644 index 0000000..25826d6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.321 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.322 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.322 new file mode 100644 index 0000000..2a15bdb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.322 @@ -0,0 +1,60 @@ +22 00:08:53 00:23:58 +P1= 44.1 T1=00:18:58 P2= 59.4 T2=00:23:58 Vs= 3.05 + +22 00:24:09 00:39:14 +P1= 66.8 T1=00:34:14 P2= 81.0 T2=00:39:14 Vs= 2.84 + +23 00:39:45 00:39:50 + + +24 00:40:01 00:40:34 + + +24 00:40:56 00:41:34 + + +30 00:41:51 00:42:16 +Vst= 29.8 + +31 00:42:26 00:43:01 +Rom_sol= 11.6 + +32 00:44:18 00:45:05 +Imax=11.2 Umax=50.1 T= 9.0 + +33 00:45:09 00:45:47 +Imin=16.2 Umin=25.0 T= 0.5 + +34 00:45:52 00:46:14 +V=300.1 T= 9.4 + +35 00:46:18 00:47:49 +Q= 52.5 T= 9.4 + +36 00:47:52 00:48:29 +P1=0.30 T= 2.9 + +37 00:48:33 00:49:07 +T= 0.9 + +38 00:49:11 00:49:19 +t= 53.4 T= 0.5 + +39 00:49:23 00:49:41 +tcam= 53.6 Tcam= 0.5 tfl= 52.0 Tfl= 0.5 + +40 00:49:43 00:50:00 +t= 53.3 T= 0.5 + +21 10:16:45 10:16:48 +Rsk= 18.8 Rkk= 13.4 + +22 10:34:59 10:50:04 +P1= 69.5 T1=10:45:04 P2= 94.1 T2=10:50:04 Vs= 4.90 + +21 12:47:51 12:47:54 +Rsk= 18.7 Rkk= 13.4 + +22 13:44:55 13:55:00 +P1= 10.8 T1=13:50:00 P2= 25.8 T2=13:55:00 Vs= 2.99 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.323 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.323 new file mode 100644 index 0000000..ccb7c53 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.323 @@ -0,0 +1,15 @@ +25 00:41:48 1591990908 +9 00:50:35 1591991435 +10 01:33:13 1591993993 +11 04:23:11 1592004191 +12 07:10:15 1592014215 +13 08:59:20 1592020760 +0 08:59:20 1592020760 +14 10:14:46 1592025286 +15 10:51:10 1592027470 +16 11:23:15 1592029395 +1 12:09:44 1592032184 +2 12:46:17 1592034377 +5 13:56:12 1592038572 +6 14:07:52 1592039272 +7 14:49:22 1592041762 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.324 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.324 new file mode 100644 index 0000000..da90896 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.324 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.325 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.325 new file mode 100644 index 0000000..77b7504 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.325 @@ -0,0 +1 @@ +29 00:40:34 1591990834 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.326 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.326 new file mode 100644 index 0000000..4df7264 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.326 @@ -0,0 +1,86 @@ +[24] +oper = 25 +begin = 13.06.2020 00:41:48 +norma = 30 +real = 8 + +[25] +oper = 9 +begin = 13.06.2020 00:50:35 +norma = 0 +real = 42 + +[26] +oper = 10 +begin = 13.06.2020 01:33:13 +norma = 0 +real = 169 + +[27] +oper = 11 +begin = 13.06.2020 04:23:11 +norma = 0 +real = 167 + +[28] +oper = 12 +begin = 13.06.2020 07:10:15 +norma = 105 +real = 109 + +[29] +oper = 13 +begin = 13.06.2020 08:59:20 +norma = 45 +real = 75 + +[30] +oper = 14 +begin = 13.06.2020 10:14:46 +norma = 40 +vac_time = 8 +real = 36 + +[31] +oper = 15 +begin = 13.06.2020 10:51:10 +norma = 30 +real = 32 + +[32] +oper = 16 +begin = 13.06.2020 11:23:15 +norma = 40 +real = 46 + +[33] +oper = 1 +begin = 13.06.2020 12:09:44 +norma = 85 +real = 36 + +[34] +oper = 2 +begin = 13.06.2020 12:46:17 +norma = 110 +vac_time = 8 +real = 69 + +[35] +oper = 5 +begin = 13.06.2020 13:56:12 +norma = 25 +real = 11 + +[36] +oper = 6 +begin = 13.06.2020 14:07:52 +norma = 35 +real = 41 + +[37] +oper = 7 +begin = 13.06.2020 14:49:22 +norma = 30 +real = 556 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.327 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.327 new file mode 100644 index 0000000..27c419e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.327 @@ -0,0 +1,35 @@ +00:40:03 1591990803 祭 ॣ '-2'(A) +00:40:36 1591990836 ⪫祭 ॣ '-2'(A) +00:40:58 1591990858 祭 ॣ '-2'(A) +00:41:34 1591990894 ⪫祭 ॣ '-2'(A) +00:50:08 1591991408 祭 ० ࠧ +00:50:09 1591991409 祭 ० ' ⮪ 㣨' +01:16:09 1591992969 祭 ॣ '-2'(A) +01:33:13 1591993993 ⪫祭 ० ࠧ (A) +01:33:13 1591993993 祭 ⠭ ॣ +04:23:10 1592004190 祭 ० +04:23:11 1592004191 ⪫祭 ॣ '-2'(A) +04:23:12 1592004192 祭 ॣ '-2'(A) +06:15:11 1592010911 ⪫祭 ॣ '-2'(A) +07:10:07 1592014207 ⪫祭 ० (A) +07:10:08 1592014208 ⪫祭 ० ' ⮪ 㣨' +07:11:49 1592014309 祭 ० ᪠ +07:11:50 1592014310 祭 ० ᪠ +07:14:28 1592014468 ⪫祭 ० ᪠ (A) +10:50:38 1592027438 祭 ० ࠧ +10:50:40 1592027440 祭 ० ' ⮪ 㣨' +10:51:57 1592027517 祭 ॣ '-2'(A) +11:21:25 1592029285 ⪫祭 ० ' ⮪ 㣨' +11:23:17 1592029397 ⪫祭 ॣ '-2'(A) +11:23:28 1592029408 祭 ० ᪠ +11:23:29 1592029409 祭 ० ᪠ +11:25:35 1592029535 ⪫祭 ० ᪠ (A) +11:27:32 1592029652 ⪫祭 ० ࠧ (A) +14:08:17 1592039297 祭 ० ᪠ +14:08:18 1592039298 祭 ० ᪠ +14:08:18 1592039298 祭 ० ᪠ +14:08:18 1592039298 祭 ० ᪠ +14:08:18 1592039298 祭 ० ᪠ +14:08:18 1592039298 祭 ० ᪠ +14:08:18 1592039298 祭 ० ᪠ +14:10:23 1592039423 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.329 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.329 new file mode 100644 index 0000000..999faa6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.329 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.350 new file mode 100644 index 0000000..77b6e53 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.350 @@ -0,0 +1,4 @@ +00:35:01 1591990501 1 09537 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4490 9 5070 10 650 11 12 321692 +01:08:20 1591992500 0 A--32-129-2016 ॢ 0 +12:10:09 1592032209 1 09538 4 2 10 690 +13:08:12 1592035692 9 4840 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.351 new file mode 100644 index 0000000..857403d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.352 new file mode 100644 index 0000000..2e93c9e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.352 @@ -0,0 +1,66 @@ +22 00:14:41 00:25:12 +P1= 11.4 T1=00:20:12 P2= 20.9 T2=00:25:12 Vs= 1.89 + +23 00:25:20 00:25:25 + + +24 00:25:33 00:26:07 + + +24 00:26:22 00:26:23 + + +24 00:26:31 00:26:32 + + +24 00:26:56 00:27:35 + + +30 00:27:51 00:28:14 +Vst= 28.1 + +31 00:28:21 00:28:53 +Rom_sol= 13.8 + +41 00:29:32 00:29:37 +Ukz= 1.63 + +32 00:29:40 00:30:14 +Imax=11.2 Umax=50.1 T= 9.0 + +33 00:30:17 00:30:34 +Imin=16.2 Umin=25.0 T= 0.5 + +34 05:00:00 00:31:00 +V=300.2 T= 9.5 + +34 00:31:04 00:31:27 +V=300.4 T= 9.5 + +35 00:31:29 00:32:29 +Q= 54.4 T= 9.5 + +36 00:32:32 00:33:10 +P1=0.29 T= 3.0 + +37 00:33:13 00:33:39 +T= 1.0 + +38 00:33:41 00:33:47 +t= 53.2 T= 0.8 + +39 00:33:49 00:34:03 +tcam= 54.9 Tcam= 0.8 tfl= 53.8 Tfl= 0.8 + +40 00:34:06 00:34:12 +t= 56.3 T= 0.8 + +20 12:09:02 12:09:10 +Riz_sol= 6128.5 + +21 12:09:21 12:09:24 +Rsk= 16.7 Rkk= 14.0 + +22 13:09:05 13:24:36 +P1= 29.0 T1=13:19:36 P2= 40.1 T2=13:24:36 Vs= 2.23 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.353 new file mode 100644 index 0000000..e9af4b4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.353 @@ -0,0 +1,7 @@ +25 00:27:48 1591990068 +9 00:35:01 1591990501 +10 01:08:20 1591992500 +12 05:38:33 1592008713 +13 09:54:44 1592024084 +0 09:54:44 1592024084 +8 12:03:24 1592031804 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.354 new file mode 100644 index 0000000..2df2563 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.355 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.355 new file mode 100644 index 0000000..4a63e02 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.355 @@ -0,0 +1,3 @@ +29 00:26:07 1591989967 +27 00:26:23 1591989983 +27 00:26:32 1591989992 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.356 new file mode 100644 index 0000000..0b32a6d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.356 @@ -0,0 +1,37 @@ +[35] +oper = 25 +begin = 13.06.2020 00:27:48 +norma = 30 +real = 7 + +[36] +oper = 9 +begin = 13.06.2020 00:35:01 +norma = 0 +real = 33 + +[37] +oper = 10 +begin = 13.06.2020 01:08:20 +norma = 0 +real = 270 + +[38] +oper = 12 +begin = 13.06.2020 05:38:33 +norma = 105 +real = 256 + +[39] +oper = 13 +begin = 13.06.2020 09:54:44 +norma = 45 +real = 128 + +[40] +oper = 8 +begin = 13.06.2020 12:03:24 +norma = 40 +vac_time = 7 +real = 734 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.357 new file mode 100644 index 0000000..71c5563 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.357 @@ -0,0 +1,19 @@ +00:25:36 1591989936 祭 ॣ '-2'(A) +00:26:08 1591989968 ⪫祭 ॣ '-2'(A) +00:26:58 1591990018 祭 ॣ '-2'(A) +00:27:36 1591990056 ⪫祭 ॣ '-2'(A) +00:34:31 1591990471 祭 ० ࠧ +00:34:33 1591990473 祭 ० ' ⮪ 㣨' +00:36:23 1591990583 祭 ॣ '-2'(A) +01:08:20 1591992500 ⪫祭 ० ࠧ (A) +01:08:21 1591992501 祭 ⠭ ॣ +05:15:29 1592007329 祭 ० +05:15:30 1592007330 ⪫祭 ॣ '-2'(A) +05:15:31 1592007331 祭 ॣ '-2'(A) +05:23:13 1592007793 ⪫祭 ० ' ⮪ 㣨' +05:38:37 1592008717 ⪫祭 ॣ '-2'(A) +05:39:16 1592008756 祭 ० ᪠ +05:39:17 1592008757 祭 ० ᪠ +05:39:17 1592008757 祭 ० ᪠ +05:42:52 1592008972 ⪫祭 ० ᪠ (A) +06:25:29 1592011529 ⪫祭 ० (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.359 new file mode 100644 index 0000000..ddfdd70 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.460 new file mode 100644 index 0000000..db6011f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.460 @@ -0,0 +1,5 @@ +00:28:45 1591990125 1 11489 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4710 9 4640 10 690 11 12 321731 +01:11:29 1591992689 0 A--32-031-2016 ॢ 5 +10:05:59 1592024759 3 14 +12:45:48 1592034348 3 25 9 3700 10 670 +13:25:58 1592036758 1 11490 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.461 new file mode 100644 index 0000000..8b997d2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.462 new file mode 100644 index 0000000..7601a7a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.462 @@ -0,0 +1,57 @@ +22 00:09:36 00:19:43 +P1= 25.8 T1=00:14:43 P2= 29.8 T2=00:19:43 Vs= 0.81 + +23 00:19:49 00:19:54 + + +24 00:20:03 00:20:42 + + +30 00:20:58 00:21:21 +Vst= 28.0 + +31 00:21:27 00:22:01 +Rom_sol= 10.7 + +32 00:22:44 00:23:20 +Imax=11.1 Umax=50.1 T= 9.0 + +33 00:23:26 00:23:44 +Imin=16.1 Umin=24.9 T= 0.5 + +34 00:23:49 00:24:11 +V=300.5 T= 9.4 + +34 00:24:14 00:24:36 +V=300.6 T= 9.4 + +35 00:24:42 00:25:57 +Q= 54.0 T= 9.4 + +36 00:26:01 00:26:40 +P1=0.28 T= 2.9 + +37 00:26:50 00:27:14 +T= 0.9 + +38 00:27:17 00:27:25 +t= 54.0 T= 0.5 + +39 00:27:28 00:27:45 +tcam= 53.5 Tcam= 0.5 tfl= 59.3 Tfl= 0.5 + +40 00:27:52 00:28:00 +t= 54.0 T= 0.5 + +21 10:05:47 10:05:50 +Rsk= 18.4 Rkk= 16.2 + +22 10:36:48 10:46:55 +P1= 12.2 T1=10:41:55 P2= 23.6 T2=10:46:55 Vs= 2.28 + +21 12:45:03 12:45:06 +Rsk= 18.6 Rkk= 16.9 + +22 13:10:01 13:25:08 +P1= 40.8 T1=13:20:08 P2= 52.9 T2=13:25:08 Vs= 2.41 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.463 new file mode 100644 index 0000000..0353f3b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.463 @@ -0,0 +1,15 @@ +25 00:20:53 1591989653 +9 00:28:45 1591990125 +10 01:11:29 1591992689 +11 04:51:20 1592005880 +12 07:38:19 1592015899 +13 09:26:34 1592022394 +0 09:26:34 1592022394 +14 10:02:46 1592024566 +15 10:49:26 1592027366 +16 11:16:30 1592028990 +1 12:01:34 1592031694 +2 12:40:48 1592034048 +5 13:27:41 1592036861 +6 13:39:39 1592037579 +7 14:17:04 1592039824 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.464 new file mode 100644 index 0000000..4abb02f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.466 new file mode 100644 index 0000000..80013cb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.466 @@ -0,0 +1,86 @@ +[73] +oper = 25 +begin = 13.06.2020 00:20:53 +norma = 30 +real = 7 + +[74] +oper = 9 +begin = 13.06.2020 00:28:45 +norma = 0 +real = 42 + +[75] +oper = 10 +begin = 13.06.2020 01:11:29 +norma = 0 +real = 219 + +[76] +oper = 11 +begin = 13.06.2020 04:51:20 +norma = 0 +real = 166 + +[77] +oper = 12 +begin = 13.06.2020 07:38:19 +norma = 105 +real = 108 + +[78] +oper = 13 +begin = 13.06.2020 09:26:34 +norma = 45 +real = 36 + +[79] +oper = 14 +begin = 13.06.2020 10:02:46 +norma = 40 +vac_time = 8 +real = 46 + +[80] +oper = 15 +begin = 13.06.2020 10:49:26 +norma = 30 +real = 27 + +[81] +oper = 16 +begin = 13.06.2020 11:16:30 +norma = 40 +real = 45 + +[82] +oper = 1 +begin = 13.06.2020 12:01:34 +norma = 85 +real = 39 + +[83] +oper = 2 +begin = 13.06.2020 12:40:48 +norma = 110 +vac_time = 9 +real = 46 + +[84] +oper = 5 +begin = 13.06.2020 13:27:41 +norma = 25 +real = 11 + +[85] +oper = 6 +begin = 13.06.2020 13:39:39 +norma = 35 +real = 37 + +[86] +oper = 7 +begin = 13.06.2020 14:17:04 +norma = 30 +real = 615 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.467 new file mode 100644 index 0000000..8fa359c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.467 @@ -0,0 +1,24 @@ +00:20:05 1591989605 祭 ॣ '-2'(A) +00:20:42 1591989642 ⪫祭 ॣ '-2'(A) +00:28:09 1591990089 祭 ० ࠧ +00:28:12 1591990092 祭 ० ' ⮪ 㣨' +00:54:25 1591991665 祭 ॣ '-2'(A) +01:11:29 1591992689 ⪫祭 ० ࠧ (A) +01:11:29 1591992689 祭 ⠭ ॣ +04:51:19 1592005879 祭 ० +04:51:19 1592005879 ⪫祭 ॣ '-2'(A) +04:51:21 1592005881 祭 ॣ '-2'(A) +06:43:20 1592012600 ⪫祭 ॣ '-2'(A) +07:38:16 1592015896 ⪫祭 ० (A) +07:38:19 1592015899 ⪫祭 ० ' ⮪ 㣨' +07:38:53 1592015933 祭 ० ᪠ +07:41:22 1592016082 ⪫祭 ० ᪠ (A) +10:48:54 1592027334 祭 ० ࠧ +10:48:56 1592027336 祭 ० ' ⮪ 㣨' +10:50:15 1592027415 祭 ॣ '-2'(A) +11:15:33 1592028933 ⪫祭 ० ' ⮪ 㣨' +11:16:33 1592028993 ⪫祭 ॣ '-2'(A) +11:17:14 1592029034 祭 ० ᪠ +11:19:47 1592029187 ⪫祭 ० ᪠ (A) +13:40:06 1592037606 祭 ० ᪠ +13:42:07 1592037727 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200613.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.469 new file mode 100644 index 0000000..8efd4ba Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200613.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.340 new file mode 100644 index 0000000..e77e684 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.340 @@ -0,0 +1,7 @@ +01:15:01 1592079301 1 09599 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 870 8 5050 9 6260 10 770 11 12 321075 +01:45:35 1592081135 0 A--32-032-2016 ॢ 6 +13:51:30 1592124690 3 14 +14:59:27 1592128767 0 A--32-120-2016 ॢ 0 +17:30:05 1592137805 1 09600 3 25 7 770 9 4990 10 690 +18:22:25 1592140945 1 09600 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 5050 9 4990 10 690 11 12 321075 +19:05:00 1592143500 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.341 new file mode 100644 index 0000000..189e6d0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.342 new file mode 100644 index 0000000..41da862 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.342 @@ -0,0 +1,105 @@ +20 00:14:01 00:14:10 +Riz_sol= 1958.5 + +21 00:14:18 00:14:21 +Rsk= 18.8 Rkk= 18.2 + +22 00:49:44 01:05:12 +P1= 53.5 T1=01:00:12 P2= 66.9 T2=01:05:12 Vs= 2.69 + +23 01:05:57 01:06:02 + + +24 01:06:29 01:07:09 + + +30 01:07:32 01:08:07 +Vst= 31.0 + +31 01:08:17 01:08:53 +Rom_sol= 12.9 + +41 01:09:34 01:09:39 +Ukz= 0.90 + +32 01:09:46 01:10:25 +Imax=11.0 Umax=50.0 T= 9.0 + +33 01:10:29 01:10:51 +Imin=16.0 Umin=25.0 T= 0.5 + +34 01:10:55 01:11:18 +V=300.4 T= 9.4 + +35 01:11:22 01:12:19 +Q= 53.4 T= 9.5 + +36 01:12:22 01:12:56 +P1=0.29 T= 3.0 + +37 01:12:59 01:13:22 +T= 1.0 + +38 01:13:26 01:13:39 +t= 51.9 T= 0.5 + +39 01:13:44 01:13:51 +t= 51.7 T= 0.5 + +40 01:13:58 01:14:07 +t= 51.7 T= 0.6 + +21 13:51:48 13:51:51 +Rsk= 16.5 Rkk= 16.8 + +22 14:18:58 14:29:24 +P1= 22.5 T1=14:24:24 P2= 45.7 T2=14:29:24 Vs= 4.64 + +20 17:30:34 17:30:43 +Riz_sol= 1968.2 + +21 17:30:49 17:30:52 +Rsk= 17.4 Rkk= 16.8 + +22 17:57:37 18:13:04 +P1= 45.4 T1=18:08:04 P2= 57.4 T2=18:13:04 Vs= 2.40 + +23 18:14:16 18:14:21 + + +24 18:14:28 18:15:10 + + +30 18:15:25 18:15:51 +Vst= 31.1 + +31 18:16:04 18:16:38 +Rom_sol= 13.2 + +32 18:17:10 18:17:47 +Imax=11.0 Umax=50.1 T= 8.9 + +33 18:17:52 18:18:15 +Imin=16.0 Umin=25.0 T= 0.5 + +34 18:18:18 18:18:41 +V=300.1 T= 9.5 + +35 18:18:46 18:19:55 +Q= 54.7 T=12.4 + +36 18:20:01 18:20:34 +P1=0.29 T= 3.0 + +37 18:20:38 18:21:03 +T= 1.0 + +38 18:21:07 18:21:14 +t= 52.0 T= 0.6 + +39 18:21:17 18:21:24 +t= 51.6 T= 0.6 + +40 18:21:27 18:21:35 +t= 51.7 T= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.343 new file mode 100644 index 0000000..ab75aba --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.343 @@ -0,0 +1,17 @@ +8 00:07:17 1592075237 +25 01:07:30 1592078850 +9 01:15:01 1592079301 +10 01:45:36 1592081136 +11 07:01:42 1592100102 +12 10:31:15 1592112675 +13 12:37:07 1592120227 +0 12:37:07 1592120227 +14 13:48:59 1592124539 +15 14:30:34 1592127034 +16 15:00:22 1592128822 +1 15:42:20 1592131340 +8 17:26:05 1592137565 +25 18:15:21 1592140521 +9 18:22:25 1592140945 +10 19:05:01 1592143501 +11 23:07:22 1592158042 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.344 new file mode 100644 index 0000000..351a69b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.346 new file mode 100644 index 0000000..87e7105 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.346 @@ -0,0 +1,100 @@ +[16] +oper = 8 +begin = 14.06.2020 00:07:17 +norma = 40 +vac_time = 9 +vac_avg10 = 12.7 +real = 60 + +[17] +oper = 25 +begin = 14.06.2020 01:07:30 +norma = 30 +real = 7 + +[18] +oper = 9 +begin = 14.06.2020 01:15:01 +norma = 0 +real = 30 + +[19] +oper = 10 +begin = 14.06.2020 01:45:36 +norma = 0 +real = 316 + +[20] +oper = 11 +begin = 14.06.2020 07:01:42 +norma = 0 +real = 209 + +[21] +oper = 12 +begin = 14.06.2020 10:31:15 +norma = 105 +real = 125 + +[22] +oper = 13 +begin = 14.06.2020 12:37:07 +norma = 45 +real = 71 + +[23] +oper = 14 +begin = 14.06.2020 13:48:59 +norma = 40 +vac_time = 8 +real = 41 + +[24] +oper = 15 +begin = 14.06.2020 14:30:34 +norma = 30 +real = 29 + +[25] +oper = 16 +begin = 14.06.2020 15:00:22 +norma = 40 +real = 41 + +[26] +oper = 1 +begin = 14.06.2020 15:42:20 +norma = 85 +real = 103 + +[27] +oper = 8 +begin = 14.06.2020 17:26:05 +norma = 40 +vac_time = 9 +real = 49 + +[28] +oper = 25 +begin = 14.06.2020 18:15:21 +norma = 30 +real = 7 + +[29] +oper = 9 +begin = 14.06.2020 18:22:25 +norma = 0 +real = 42 + +[30] +oper = 10 +begin = 14.06.2020 19:05:01 +norma = 0 +real = 242 + +[31] +oper = 11 +begin = 14.06.2020 23:07:22 +norma = 0 +real = 166 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.347 new file mode 100644 index 0000000..5a54b26 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.347 @@ -0,0 +1,34 @@ +01:06:31 1592078791 祭 ॣ '-2'(A) +01:07:09 1592078829 ⪫祭 ॣ '-2'(A) +01:14:19 1592079259 祭 ० ࠧ +01:14:21 1592079261 祭 ० ' ⮪ 㣨' +01:31:36 1592080296 祭 ॣ '-2'(A) +01:45:35 1592081135 ⪫祭 ० ࠧ (A) +01:45:36 1592081136 祭 ⠭ ॣ +07:01:41 1592100101 祭 ० +07:01:42 1592100102 ⪫祭 ॣ '-2'(A) +07:01:43 1592100103 祭 ॣ '-2'(A) +08:10:44 1592104244 ⪫祭 ॣ '-2'(A) +10:31:09 1592112669 ⪫祭 ० (A) +10:31:17 1592112677 ⪫祭 ० ' ⮪ 㣨' +10:32:33 1592112753 祭 ० ᪠ +10:32:33 1592112753 祭 ० ᪠ +10:35:08 1592112908 ⪫祭 ० ᪠ (A) +14:30:25 1592127025 祭 ० ࠧ +14:30:27 1592127027 祭 ० ' ⮪ 㣨' +14:30:29 1592127029 祭 ॣ '-2'(A) +14:59:27 1592128767 ⪫祭 ० ࠧ (A) +14:59:32 1592128772 ⪫祭 ० ' ⮪ 㣨' +15:00:26 1592128826 ⪫祭 ॣ '-2'(A) +15:01:07 1592128867 祭 ० ᪠ +15:03:39 1592129019 ⪫祭 ० ᪠ (A) +18:14:29 1592140469 祭 ॣ '-2'(A) +18:15:11 1592140511 ⪫祭 ॣ '-2'(A) +18:21:47 1592140907 祭 ० ࠧ +18:21:49 1592140909 祭 ० ' ⮪ 㣨' +18:47:56 1592142476 祭 ॣ '-2'(A) +19:05:00 1592143500 ⪫祭 ० ࠧ (A) +19:05:01 1592143501 祭 ⠭ ॣ +23:07:21 1592158041 祭 ० +23:07:22 1592158042 ⪫祭 ॣ '-2'(A) +23:07:23 1592158043 祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.349 new file mode 100644 index 0000000..c566120 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.350 new file mode 100644 index 0000000..1443c7f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.350 @@ -0,0 +1,6 @@ +00:24:11 1592076251 1 09538 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4490 9 4840 10 690 11 12 321692 +01:06:54 1592078814 0 A--32-031-2016 ॢ 5 +10:48:55 1592113735 1 09539 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 10 10 705 +10:57:33 1592114253 4 3 9 3900 +14:38:55 1592127535 1 09539 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 10 4 3 5 Ti 6 7 770 8 4490 9 3900 10 705 11 12 321692 +15:36:18 1592130978 0 A--32-171-2018 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.351 new file mode 100644 index 0000000..71a3c80 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.352 new file mode 100644 index 0000000..2deb409 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.352 @@ -0,0 +1,99 @@ +22 00:05:41 00:16:12 +P1= 12.2 T1=00:11:12 P2= 21.5 T2=00:16:12 Vs= 1.87 + +23 00:16:20 00:16:25 + + +24 00:16:50 00:17:28 + + +30 00:17:43 00:18:06 +Vst= 28.4 + +31 00:18:12 00:18:46 +Rom_sol= 13.9 + +32 00:19:16 00:19:50 +Imax=11.3 Umax=50.0 T= 9.0 + +33 00:19:53 00:20:11 +Imin=16.2 Umin=25.0 T= 0.5 + +34 00:20:13 00:20:36 +V=300.3 T= 9.5 + +35 00:20:38 00:21:40 +Q= 54.5 T= 9.5 + +36 00:21:43 00:22:20 +P1=0.29 T= 3.0 + +37 00:22:23 00:22:48 +T= 1.0 + +38 00:22:50 00:22:56 +t= 53.4 T= 0.8 + +39 00:22:59 00:23:13 +tcam= 54.7 Tcam= 0.8 tfl= 54.0 Tfl= 0.8 + +40 00:23:16 00:23:21 +t= 52.9 T= 0.8 + +21 10:49:10 10:49:13 +Rsk= 18.3 Rkk= 15.6 + +22 11:24:57 11:40:27 +P1= 38.2 T1=11:35:27 P2= 52.0 T2=11:40:27 Vs= 2.77 + +20 13:38:26 13:38:35 +Riz_sol= 5966.0 + +21 13:38:42 13:38:45 +Rsk= 18.4 Rkk= 15.6 + +22 14:15:11 14:30:41 +P1= 39.2 T1=14:25:41 P2= 53.7 T2=14:30:41 Vs= 2.90 + +23 14:30:54 14:30:59 + + +24 14:31:07 14:31:43 + + +30 14:31:54 14:32:20 +Vst= 28.0 + +31 14:32:25 14:33:00 +Rom_sol= 13.9 + +41 14:33:24 14:33:29 +Ukz= 1.11 + +32 14:33:33 14:34:12 +Imax=11.3 Umax=50.0 T= 9.0 + +33 14:34:15 14:34:40 +Imin= 8.3 Umin=18.0 T= 3.0 + +34 14:34:44 14:35:06 +V=300.3 T= 9.5 + +35 14:35:12 14:36:13 +Q= 54.3 T= 9.5 + +36 14:36:16 14:36:53 +P1=0.29 T= 3.0 + +37 14:36:56 14:37:20 +T= 1.0 + +38 14:37:23 14:37:29 +t= 53.7 T= 0.8 + +39 14:37:32 14:37:47 +tcam= 55.0 Tcam= 0.8 tfl= 54.2 Tfl= 0.8 + +40 14:37:50 14:37:55 +t= 53.3 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.353 new file mode 100644 index 0000000..71f448d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.353 @@ -0,0 +1,15 @@ +25 00:17:40 1592075860 +9 00:24:11 1592076251 +10 01:06:54 1592078814 +11 05:03:10 1592092990 +12 07:50:11 1592103011 +13 09:37:26 1592109446 +0 09:37:26 1592109446 +2 10:47:32 1592113652 +5 11:41:19 1592116879 +6 11:52:10 1592117530 +7 12:29:10 1592119750 +8 13:36:33 1592123793 +25 14:31:52 1592127112 +9 14:38:55 1592127535 +10 15:26:18 1592130378 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.354 new file mode 100644 index 0000000..900d0b3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.356 new file mode 100644 index 0000000..753a2b6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.356 @@ -0,0 +1,87 @@ +[41] +oper = 25 +begin = 14.06.2020 00:17:40 +norma = 30 +real = 6 + +[42] +oper = 9 +begin = 14.06.2020 00:24:11 +norma = 0 +real = 42 + +[43] +oper = 10 +begin = 14.06.2020 01:06:54 +norma = 0 +real = 236 + +[44] +oper = 11 +begin = 14.06.2020 05:03:10 +norma = 0 +real = 167 + +[45] +oper = 12 +begin = 14.06.2020 07:50:11 +norma = 105 +real = 107 + +[46] +oper = 13 +begin = 14.06.2020 09:37:26 +norma = 45 +real = 70 + +[47] +oper = 2 +begin = 14.06.2020 10:47:32 +norma = 110 +vac_time = 7 +vac_avg10 = 7.2 +real = 53 + +[48] +oper = 5 +begin = 14.06.2020 11:41:19 +norma = 25 +real = 10 + +[49] +oper = 6 +begin = 14.06.2020 11:52:10 +norma = 35 +real = 37 + +[50] +oper = 7 +begin = 14.06.2020 12:29:10 +norma = 30 +real = 67 + +[51] +oper = 8 +begin = 14.06.2020 13:36:33 +norma = 40 +vac_time = 7 +real = 55 + +[52] +oper = 25 +begin = 14.06.2020 14:31:52 +norma = 30 +real = 7 + +[53] +oper = 9 +begin = 14.06.2020 14:38:55 +norma = 0 +real = 47 + +[54] +oper = 10 +begin = 14.06.2020 15:26:18 +norma = 0 +real = 757 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.357 new file mode 100644 index 0000000..5ca8d08 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.357 @@ -0,0 +1,28 @@ +00:16:53 1592075813 祭 ॣ '-2'(A) +00:17:29 1592075849 ⪫祭 ॣ '-2'(A) +00:23:40 1592076220 祭 ० ࠧ +00:23:42 1592076222 祭 ० ' ⮪ 㣨' +00:49:48 1592077788 祭 ॣ '-2'(A) +01:06:53 1592078813 祭 ⠭ ॣ +01:06:54 1592078814 ⪫祭 ० ࠧ (A) +05:03:09 1592092989 祭 ० +05:03:09 1592092989 ⪫祭 ॣ '-2'(A) +05:03:10 1592092990 祭 ॣ '-2'(A) +06:55:10 1592099710 ⪫祭 ॣ '-2'(A) +07:50:06 1592103006 ⪫祭 ० (A) +07:50:09 1592103009 ⪫祭 ० ' ⮪ 㣨' +07:50:47 1592103047 祭 ० ᪠ +07:50:47 1592103047 祭 ० ᪠ +07:53:19 1592103199 ⪫祭 ० ᪠ (A) +11:52:57 1592117577 祭 ० ᪠ +11:52:58 1592117578 祭 ० ᪠ +11:52:58 1592117578 祭 ० ᪠ +11:55:28 1592117728 ⪫祭 ० ᪠ (A) +14:31:08 1592127068 祭 ॣ '-2'(A) +14:31:44 1592127104 ⪫祭 ॣ '-2'(A) +14:38:25 1592127505 祭 ० ࠧ +14:38:27 1592127507 祭 ० ' ⮪ 㣨' +14:55:19 1592128519 祭 ॣ '-2'(A) +15:26:18 1592130378 ⪫祭 ० ࠧ (A) +15:26:18 1592130378 祭 ⠭ ॣ +15:36:18 1592130978 祭 ॣ ।. 60 ᥪ. 殮 㣨 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.359 new file mode 100644 index 0000000..7d22825 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.460 new file mode 100644 index 0000000..312e806 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.460 @@ -0,0 +1,7 @@ +01:44:40 1592081080 1 11490 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4710 9 3700 10 670 11 12 321731 +02:19:23 1592083163 0 A--32-002-2012 ॢ 9 +10:15:31 1592111731 1 00014 3 14 +11:17:19 1592115439 0 A--32-067-2014 ॢ 0 +13:35:08 1592123708 1 11491 2 BT 18, 20, 22, 23, 25 3 25 9 4700 10 690 +14:20:06 1592126406 1 11491 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 4710 9 4700 10 690 11 12 321731 +15:02:49 1592128969 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.461 new file mode 100644 index 0000000..efff607 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.462 new file mode 100644 index 0000000..b2145bf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.462 @@ -0,0 +1,111 @@ +20 00:48:19 00:48:27 +Riz_sol= 1209.4 + +21 00:48:36 00:48:39 +Rsk= 20.9 Rkk= 18.8 + +22 01:15:26 01:30:33 +P1= 44.6 T1=01:25:33 P2= 58.7 T2=01:30:33 Vs= 2.83 + +23 01:31:44 01:31:49 + + +23 01:32:51 01:32:56 + + +24 01:33:06 01:33:45 + + +30 01:34:03 01:34:44 +Vst= 27.5 + +31 01:35:04 01:35:45 +Rom_sol= 10.3 + +41 01:38:13 01:38:18 +Ukz= 0.91 + +32 01:38:19 01:38:57 +Imax=11.2 Umax=50.1 T= 9.0 + +33 01:39:01 01:39:24 +Imin=16.1 Umin=24.9 T= 0.5 + +34 01:39:28 01:39:50 +V=300.4 T= 9.4 + +35 01:39:55 01:41:26 +Q= 55.0 T=12.4 + +36 01:41:31 01:42:01 +P1=0.29 T= 2.9 + +37 01:42:05 01:42:30 +T= 0.9 + +38 01:42:34 01:42:46 +t= 54.0 T= 0.5 + +39 01:42:51 01:43:09 +tcam= 53.6 Tcam= 0.5 tfl= 59.2 Tfl= 0.5 + +40 01:43:13 01:43:20 +t= 54.0 T= 0.5 + +21 10:15:56 10:15:59 +Rsk= 18.4 Rkk= 16.9 + +22 10:35:59 10:46:06 +P1= 20.8 T1=10:41:06 P2= 39.3 T2=10:46:06 Vs= 3.70 + +20 13:36:10 13:36:19 +Riz_sol= 4751.3 + +21 13:36:32 13:36:35 +Rsk= 18.9 Rkk= 16.6 + +22 13:55:43 14:10:50 +P1= 48.8 T1=14:05:50 P2= 63.3 T2=14:10:50 Vs= 2.90 + +23 14:11:06 14:11:11 + + +24 14:11:19 14:11:57 + + +30 14:12:10 14:12:34 +Vst= 27.8 + +31 14:12:39 14:13:14 +Rom_sol= 10.6 + +32 14:13:57 14:14:21 +Imax= 0.0 Umax= 0.0 T= 0.0 + +32 14:14:58 14:15:34 +Imax=11.2 Umax=50.0 T= 9.0 + +33 14:15:39 14:15:59 +Imin=16.1 Umin=25.0 T= 0.5 + +34 14:16:03 14:16:26 +V=300.5 T= 9.4 + +35 14:16:30 14:17:26 +Q= 53.5 T= 9.4 + +36 14:17:32 14:18:01 +P1=0.28 T= 2.9 + +37 14:18:05 14:18:31 +T= 0.9 + +38 14:18:35 14:18:44 +t= 54.0 T= 0.5 + +39 14:18:47 14:19:03 +tcam= 53.7 Tcam= 0.5 tfl= 59.3 Tfl= 0.5 + +40 14:19:07 14:19:16 +t= 52.2 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.463 new file mode 100644 index 0000000..a8e4ce5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.463 @@ -0,0 +1,18 @@ +8 00:33:03 1592076783 +25 01:33:57 1592080437 +9 01:44:40 1592081080 +10 02:19:23 1592083163 +11 05:05:39 1592093139 +12 07:47:18 1592102838 +13 09:37:37 1592109457 +0 09:37:37 1592109457 +14 10:15:03 1592111703 +15 10:46:36 1592113596 +16 11:20:40 1592115640 +1 11:57:39 1592117859 +8 13:28:22 1592123302 +25 14:12:07 1592125927 +9 14:20:06 1592126406 +10 15:02:49 1592128969 +11 18:45:13 1592142313 +12 21:32:13 1592152333 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.464 new file mode 100644 index 0000000..8201c2f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.465 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.465 new file mode 100644 index 0000000..14977f2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.465 @@ -0,0 +1,2 @@ +17 13:35:31 1592123731 +52 14:14:21 1592126061 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.466 new file mode 100644 index 0000000..edf779b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.466 @@ -0,0 +1,105 @@ +[87] +oper = 8 +begin = 14.06.2020 00:33:03 +norma = 40 +vac_time = 16 +real = 60 + +[88] +oper = 25 +begin = 14.06.2020 01:33:57 +norma = 30 +real = 10 + +[89] +oper = 9 +begin = 14.06.2020 01:44:40 +norma = 0 +real = 34 + +[90] +oper = 10 +begin = 14.06.2020 02:19:23 +norma = 0 +real = 166 + +[91] +oper = 11 +begin = 14.06.2020 05:05:39 +norma = 0 +real = 161 + +[92] +oper = 12 +begin = 14.06.2020 07:47:18 +norma = 105 +real = 110 + +[93] +oper = 13 +begin = 14.06.2020 09:37:37 +norma = 45 +real = 37 + +[94] +oper = 14 +begin = 14.06.2020 10:15:03 +norma = 40 +vac_time = 8 +real = 31 + +[95] +oper = 15 +begin = 14.06.2020 10:46:36 +norma = 30 +real = 34 + +[96] +oper = 16 +begin = 14.06.2020 11:20:40 +norma = 40 +real = 36 + +[97] +oper = 1 +begin = 14.06.2020 11:57:39 +norma = 85 +real = 90 + +[98] +oper = 8 +begin = 14.06.2020 13:28:22 +norma = 40 +vac_time = 9 +real = 43 + +[99] +oper = 25 +begin = 14.06.2020 14:12:07 +norma = 30 +real = 7 + +[00] +oper = 9 +begin = 14.06.2020 14:20:06 +norma = 0 +real = 42 + +[01] +oper = 10 +begin = 14.06.2020 15:02:49 +norma = 0 +real = 222 + +[02] +oper = 11 +begin = 14.06.2020 18:45:13 +norma = 0 +real = 167 + +[03] +oper = 12 +begin = 14.06.2020 21:32:13 +norma = 105 +real = 154 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.467 new file mode 100644 index 0000000..291a0e4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.467 @@ -0,0 +1,41 @@ +01:33:07 1592080387 祭 ॣ '-2'(A) +01:33:44 1592080424 ⪫祭 ॣ '-2'(A) +01:43:30 1592081010 祭 ० ࠧ +01:44:06 1592081046 祭 ० ' ⮪ 㣨' +02:01:38 1592082098 祭 ॣ '-2'(A) +02:19:23 1592083163 ⪫祭 ० ࠧ (A) +02:19:23 1592083163 祭 ⠭ ॣ +05:05:38 1592093138 祭 ० +05:05:39 1592093139 ⪫祭 ॣ '-2'(A) +05:05:40 1592093140 祭 ॣ '-2'(A) +06:14:39 1592097279 ⪫祭 ॣ '-2'(A) +07:47:13 1592102833 ⪫祭 ० (A) +07:47:19 1592102839 ⪫祭 ० ' ⮪ 㣨' +07:47:29 1592102849 祭 ० ᪠ +07:49:33 1592102973 ⪫祭 ० ᪠ (A) +10:46:26 1592113586 祭 ० ࠧ +10:46:29 1592113589 祭 ० ' ⮪ 㣨' +10:47:25 1592113645 祭 ॣ '-2'(A) +11:17:19 1592115439 ⪫祭 ० ࠧ (A) +11:20:41 1592115641 ⪫祭 ० ' ⮪ 㣨' +11:20:44 1592115644 ⪫祭 ॣ '-2'(A) +11:20:56 1592115656 祭 ० ᪠ +11:22:53 1592115773 ⪫祭 ० ᪠ (A) +14:11:21 1592125881 祭 ॣ '-2'(A) +14:11:58 1592125918 ⪫祭 ॣ '-2'(A) +14:19:25 1592126365 祭 ० ࠧ +14:19:27 1592126367 祭 ० ' ⮪ 㣨' +14:45:42 1592127942 祭 ॣ '-2'(A) +15:02:49 1592128969 ⪫祭 ० ࠧ (A) +15:02:49 1592128969 祭 ⠭ ॣ +18:45:12 1592142312 祭 ० +18:45:13 1592142313 ⪫祭 ॣ '-2'(A) +18:45:14 1592142314 祭 ॣ '-2'(A) +20:37:13 1592149033 ⪫祭 ॣ '-2'(A) +21:32:10 1592152330 ⪫祭 ० (A) +21:32:14 1592152334 ⪫祭 ० ' ⮪ 㣨' +21:33:19 1592152399 祭 ० ᪠ +21:33:19 1592152399 祭 ० ᪠ +21:35:17 1592152517 ⪫祭 ० ᪠ (A) +21:38:45 1592152725 祭 ० ᪠ +21:38:45 1592152725 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.469 new file mode 100644 index 0000000..0ea1b22 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.480 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.480 new file mode 100644 index 0000000..42da1c0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.480 @@ -0,0 +1,7 @@ +02:07:11 1592082431 1 02537 8 4780 9 3550 10 495 +02:19:22 1592083162 9 5900 10 650 +05:54:11 1592096051 1 02537 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4780 9 5900 10 650 11 12 1718 +06:27:43 1592098063 0 A--32-129-2018 ॢ 1 +18:47:50 1592142470 1 02538 4 2 9 4600 10 690 +20:30:24 1592148624 1 02538 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4780 9 4600 10 690 11 12 1718 +21:13:23 1592151203 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.481 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.481 new file mode 100644 index 0000000..35f41d2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.481 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.482 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.482 new file mode 100644 index 0000000..ae53531 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.482 @@ -0,0 +1,105 @@ +21 02:05:56 02:05:59 +Rsk= 20.2 Rkk= 8.7 + +22 03:29:39 03:44:44 +P1= 47.9 T1=03:39:44 P2= 60.4 T2=03:44:44 Vs= 2.50 + +20 04:40:02 04:40:11 +Riz_sol= 1191.5 + +21 04:40:16 04:40:19 +Rsk= 67.7 Rkk= 57.6 + +22 05:29:49 05:39:54 +P1= 32.2 T1=05:34:54 P2= 43.5 T2=05:39:54 Vs= 2.26 + +23 05:45:37 05:45:43 + + +24 05:45:48 05:46:31 + + +30 05:46:41 05:47:14 +Vst= 23.4 + +31 05:47:19 05:47:54 +Rom_sol= 7.2 + +41 05:48:17 05:48:22 +Ukz= 2.45 + +32 05:48:27 05:49:03 +Imax=10.9 Umax=50.0 T= 9.3 + +33 05:49:36 05:50:00 +Imin=15.9 Umin=25.0 T= 0.8 + +34 05:50:03 05:50:27 +V=300.2 T= 9.4 + +35 05:50:30 05:51:53 +Qkr= 49.8 Tkr= 9.5 Qpd= 0.0 Tpd= 0.0 + +40 05:52:05 05:52:13 +t= 52.2 T= 0.8 + +38 05:52:17 05:52:24 +t= 52.3 T= 0.8 + +37 05:00:00 05:52:52 +T= 1.0 + +36 05:52:54 05:53:50 +Pkr=0.29 Tkr= 3.2 Ppd=0.00 Tpd= 0.0 + +20 18:47:03 18:47:12 +Riz_sol= 2438.6 + +21 18:47:18 18:47:22 +Rsk= 58.2 Rkk= 49.0 + +22 20:04:46 20:19:51 +P1= 62.0 T1=20:14:51 P2= 77.0 T2=20:19:51 Vs= 3.00 + +23 20:20:25 20:20:30 + + +24 20:20:37 20:21:10 + + +24 20:22:06 20:22:44 + + +30 20:22:53 20:23:18 +Vst= 23.4 + +31 20:23:23 20:24:00 +Rom_sol= 7.5 + +32 20:24:52 20:25:29 +Imax=10.9 Umax=50.1 T= 9.3 + +33 20:25:32 20:25:51 +Imin=15.9 Umin=25.0 T= 0.8 + +34 20:25:54 20:26:18 +V=300.0 T= 9.5 + +35 20:26:21 20:27:40 +Qkr= 54.7 Tkr= 9.4 Qpd= 0.0 Tpd= 0.0 + +36 20:27:43 20:28:39 +Pkr=0.29 Tkr= 3.1 Ppd=0.00 Tpd= 0.0 + +37 20:28:42 20:29:08 +T= 1.0 + +38 20:29:13 20:29:21 +t= 52.3 T= 0.6 + +39 20:29:24 20:29:32 +t= 51.7 T= 0.7 + +40 20:29:35 20:29:43 +t= 52.2 T= 0.9 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.483 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.483 new file mode 100644 index 0000000..4e64261 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.483 @@ -0,0 +1,15 @@ +2 02:02:49 1592082169 +5 03:45:25 1592088325 +6 03:54:51 1592088891 +7 04:25:56 1592090756 +8 04:32:21 1592091141 +25 05:46:38 1592095598 +9 05:54:11 1592096051 +10 06:27:43 1592098063 +12 11:27:34 1592116054 +13 16:06:44 1592132804 +0 16:06:44 1592132804 +8 18:44:01 1592142241 +25 20:22:50 1592148170 +9 20:30:24 1592148624 +10 21:13:23 1592151203 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.484 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.484 new file mode 100644 index 0000000..7474146 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.484 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.485 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.485 new file mode 100644 index 0000000..edd414e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.485 @@ -0,0 +1,6 @@ +47 05:49:06 1592095746 +47 05:49:09 1592095749 +47 05:49:10 1592095750 +47 05:49:15 1592095755 +47 05:51:59 1592095919 +29 20:21:10 1592148070 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.486 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.486 new file mode 100644 index 0000000..f5a3040 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.486 @@ -0,0 +1,87 @@ +[41] +oper = 2 +begin = 14.06.2020 02:02:49 +norma = 110 +vac_time = 29 +real = 102 + +[42] +oper = 5 +begin = 14.06.2020 03:45:25 +norma = 25 +real = 9 + +[43] +oper = 6 +begin = 14.06.2020 03:54:51 +norma = 35 +real = 31 + +[44] +oper = 7 +begin = 14.06.2020 04:25:56 +norma = 30 +real = 6 + +[45] +oper = 8 +begin = 14.06.2020 04:32:21 +norma = 40 +vac_time = 28 +real = 74 + +[46] +oper = 25 +begin = 14.06.2020 05:46:38 +norma = 30 +real = 7 + +[47] +oper = 9 +begin = 14.06.2020 05:54:11 +norma = 0 +real = 33 + +[48] +oper = 10 +begin = 14.06.2020 06:27:43 +norma = 0 +real = 299 + +[49] +oper = 12 +begin = 14.06.2020 11:27:34 +norma = 105 +real = 279 + +[50] +oper = 13 +begin = 14.06.2020 16:06:44 +norma = 45 +real = 157 + +[51] +oper = 8 +begin = 14.06.2020 18:44:01 +norma = 40 +vac_time = 30 +real = 98 + +[52] +oper = 25 +begin = 14.06.2020 20:22:50 +norma = 30 +real = 7 + +[53] +oper = 9 +begin = 14.06.2020 20:30:24 +norma = 0 +real = 42 + +[54] +oper = 10 +begin = 14.06.2020 21:13:23 +norma = 0 +real = 219 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.487 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.487 new file mode 100644 index 0000000..c4e04db --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.487 @@ -0,0 +1,35 @@ +03:55:08 1592088908 祭 ० ᪠ +03:55:08 1592088908 祭 ० ᪠ +03:55:08 1592088908 祭 ० ᪠ +03:55:09 1592088909 祭 ० ᪠ +03:55:09 1592088909 祭 ० ᪠ +03:55:09 1592088909 祭 ० ᪠ +03:55:09 1592088909 祭 ० ᪠ +03:55:10 1592088910 祭 ० ᪠ +03:59:03 1592089143 ⪫祭 ० ᪠ (A) +05:45:55 1592095555 祭 ॣ '-2'(A) +05:46:32 1592095592 ⪫祭 ॣ '-2'(A) +05:53:57 1592096037 祭 ० ࠧ +05:54:02 1592096042 祭 ० ' ⮪ 㣨' +05:55:46 1592096146 祭 ॣ '-2'(A) +06:27:43 1592098063 ⪫祭 ० ࠧ (A) +06:27:44 1592098064 祭 ⠭ ॣ +11:23:01 1592115781 祭 ० +11:23:01 1592115781 ⪫祭 ॣ '-2'(A) +11:23:02 1592115782 祭 ॣ '-2'(A) +11:25:30 1592115930 ⪫祭 ० ' ⮪ 㣨' +11:27:36 1592116056 ⪫祭 ॣ '-2'(A) +11:28:10 1592116090 祭 ० ᪠ +11:32:08 1592116328 ⪫祭 ० ᪠ (A) +12:33:01 1592119981 ⪫祭 ० (A) +20:20:39 1592148039 祭 ॣ '-2'(A) +20:21:11 1592148071 ⪫祭 ॣ '-2'(A) +20:21:22 1592148082 祭 ॣ '-2'(A) +20:21:48 1592148108 ⪫祭 ॣ '-2'(A) +20:22:07 1592148127 祭 ॣ '-2'(A) +20:22:44 1592148164 ⪫祭 ॣ '-2'(A) +20:29:50 1592148590 祭 ० ࠧ +20:29:51 1592148591 祭 ० ' ⮪ 㣨' +20:56:19 1592150179 祭 ॣ '-2'(A) +21:13:23 1592151203 ⪫祭 ० ࠧ (A) +21:13:23 1592151203 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200614.489 b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.489 new file mode 100644 index 0000000..8e3560d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200614.489 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.340 new file mode 100644 index 0000000..9a89d0a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.340 @@ -0,0 +1,6 @@ +05:33:56 1592181236 1 09601 2 BT 18, 20, 22, 23, 25 9 4170 12 320801 +09:29:16 1592195356 10 705 12 321315 +10:53:33 1592200413 1 09601 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 5050 9 4170 10 705 11 12 321315 +11:22:18 1592202138 0 A--32-029-2014 ॢ 2 +20:11:16 1592233876 3 14 +22:36:30 1592242590 1 09602 2 p. cao M1,M2,M3,M4 3 37 9 4400 10 670 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.341 new file mode 100644 index 0000000..be6831f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.342 new file mode 100644 index 0000000..3514248 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.342 @@ -0,0 +1,69 @@ +21 05:34:11 05:34:14 +Rsk= 17.1 Rkk= 16.5 + +22 06:56:48 07:07:14 +P1= 14.1 T1=07:02:14 P2= 20.8 T2=07:07:14 Vs= 1.34 + +20 09:28:25 09:28:34 +Riz_sol= 1898.5 + +21 09:28:41 09:28:44 +Rsk= 16.9 Rkk= 16.3 + +22 10:34:34 10:45:01 +P1= 14.2 T1=10:40:01 P2= 22.7 T2=10:45:01 Vs= 1.70 + +23 10:45:12 10:45:18 + + +24 10:45:24 10:46:05 + + +30 10:46:21 10:46:56 +Vst= 31.1 + +31 10:47:05 10:47:43 +Rom_sol= 13.1 + +41 10:48:34 10:48:39 +Ukz= 1.15 + +32 10:48:41 10:49:18 +Imax=11.0 Umax=50.1 T= 8.9 + +33 10:49:22 05:00:00 +Imin=16.0 Umin=25.0 T= 0.5 + +34 10:49:47 10:50:11 +V=300.1 T= 9.5 + +35 10:50:15 10:51:11 +Q= 54.2 T= 9.5 + +36 10:51:15 10:51:48 +P1=0.29 T= 3.0 + +37 10:51:52 10:52:16 +T= 1.0 + +38 10:52:20 10:52:27 +t= 51.9 T= 0.6 + +39 10:52:31 10:52:38 +t= 51.7 T= 0.6 + +40 10:52:41 10:52:48 +t= 51.8 T= 0.6 + +21 20:11:36 20:11:39 +Rsk= 16.8 Rkk= 16.3 + +22 20:32:52 20:48:18 +P1= 50.4 T1=20:43:18 P2= 63.4 T2=20:48:18 Vs= 2.60 + +21 22:36:51 05:00:00 +Rsk= 17.2 Rkk= 16.7 + +22 23:15:17 23:25:44 +P1= 18.7 T1=23:20:44 P2= 32.0 T2=23:25:44 Vs= 2.66 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.343 new file mode 100644 index 0000000..f6133c6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.343 @@ -0,0 +1,22 @@ +12 01:54:21 1592168061 +13 03:43:16 1592174596 +0 03:43:16 1592174596 +2 05:30:58 1592181058 +5 07:08:02 1592186882 +6 07:21:47 1592187707 +7 08:11:35 1592190695 +8 09:25:58 1592195158 +25 10:46:18 1592199978 +9 10:53:33 1592200413 +10 11:22:18 1592202138 +11 14:47:20 1592214440 +12 17:37:30 1592224650 +13 19:29:46 1592231386 +0 19:29:47 1592231387 +14 20:07:06 1592233626 +15 20:49:19 1592236159 +16 21:10:29 1592237429 +1 21:55:21 1592240121 +2 22:33:50 1592242430 +5 23:27:53 1592245673 +6 23:40:01 1592246401 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.344 new file mode 100644 index 0000000..67b9974 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.346 new file mode 100644 index 0000000..06c2990 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.346 @@ -0,0 +1,124 @@ +[32] +oper = 12 +begin = 15.06.2020 01:54:21 +norma = 105 +real = 108 + +[33] +oper = 13 +begin = 15.06.2020 03:43:16 +norma = 45 +real = 107 + +[34] +oper = 2 +begin = 15.06.2020 05:30:58 +norma = 110 +vac_time = 8 +real = 97 + +[35] +oper = 5 +begin = 15.06.2020 07:08:02 +norma = 25 +real = 13 + +[36] +oper = 6 +begin = 15.06.2020 07:21:47 +norma = 35 +real = 49 + +[37] +oper = 7 +begin = 15.06.2020 08:11:35 +norma = 30 +real = 74 + +[38] +oper = 8 +begin = 15.06.2020 09:25:58 +norma = 40 +vac_time = 8 +real = 80 + +[39] +oper = 25 +begin = 15.06.2020 10:46:18 +norma = 30 +real = 7 + +[40] +oper = 9 +begin = 15.06.2020 10:53:33 +norma = 0 +real = 28 + +[41] +oper = 10 +begin = 15.06.2020 11:22:18 +norma = 0 +real = 205 + +[42] +oper = 11 +begin = 15.06.2020 14:47:20 +norma = 0 +real = 170 + +[43] +oper = 12 +begin = 15.06.2020 17:37:30 +norma = 105 +real = 112 + +[44] +oper = 13 +begin = 15.06.2020 19:29:46 +norma = 45 +real = 37 + +[45] +oper = 14 +begin = 15.06.2020 20:07:06 +norma = 40 +vac_time = 8 +real = 42 + +[46] +oper = 15 +begin = 15.06.2020 20:49:19 +norma = 30 +real = 21 + +[47] +oper = 16 +begin = 15.06.2020 21:10:29 +norma = 40 +real = 44 + +[48] +oper = 1 +begin = 15.06.2020 21:55:21 +norma = 85 +real = 38 + +[49] +oper = 2 +begin = 15.06.2020 22:33:50 +norma = 110 +vac_time = 9 +real = 54 + +[50] +oper = 5 +begin = 15.06.2020 23:27:53 +norma = 25 +real = 12 + +[51] +oper = 6 +begin = 15.06.2020 23:40:01 +norma = 35 +real = 34 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.347 new file mode 100644 index 0000000..9a7aeec --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.347 @@ -0,0 +1,35 @@ +00:59:23 1592164763 ⪫祭 ॣ '-2'(A) +01:54:18 1592168058 ⪫祭 ० (A) +01:54:22 1592168062 ⪫祭 ० ' ⮪ 㣨' +01:54:30 1592168070 祭 ० ᪠ +01:54:33 1592168073 祭 ० ᪠ +01:57:30 1592168250 ⪫祭 ० ᪠ (A) +07:22:21 1592187741 祭 ० ᪠ +07:25:22 1592187922 ⪫祭 ० ᪠ (A) +10:45:26 1592199926 祭 ॣ '-2'(A) +10:46:07 1592199967 ⪫祭 ॣ '-2'(A) +10:52:59 1592200379 祭 ० ࠧ +10:53:01 1592200381 祭 ० ' ⮪ 㣨' +11:13:20 1592201600 祭 ॣ '-2'(A) +11:22:18 1592202138 ⪫祭 ० ࠧ (A) +11:22:18 1592202138 祭 ⠭ ॣ +14:47:20 1592214440 祭 ० +14:47:21 1592214441 ⪫祭 ॣ '-2'(A) +14:47:22 1592214442 祭 ॣ '-2'(A) +15:52:21 1592218341 ⪫祭 ॣ '-2'(A) +17:37:19 1592224639 ⪫祭 ० (A) +17:37:32 1592224652 ⪫祭 ० ' ⮪ 㣨' +17:37:50 1592224670 祭 ० ᪠ +17:37:50 1592224670 祭 ० ᪠ +17:37:50 1592224670 祭 ० ᪠ +17:40:50 1592224850 ⪫祭 ० ᪠ (A) +20:48:45 1592236125 祭 ० ࠧ +20:49:01 1592236141 祭 ० ' ⮪ 㣨' +20:49:02 1592236142 祭 ॣ '-2'(A) +21:10:30 1592237430 ⪫祭 ० ' ⮪ 㣨' +21:10:33 1592237433 ⪫祭 ॣ '-2'(A) +21:10:36 1592237436 祭 ० ᪠ +21:13:33 1592237613 ⪫祭 ० ᪠ (A) +23:40:12 1592246412 祭 ० ᪠ +23:40:12 1592246412 祭 ० ᪠ +23:43:12 1592246592 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.349 new file mode 100644 index 0000000..eb16204 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.460 new file mode 100644 index 0000000..e33a1b3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.460 @@ -0,0 +1,8 @@ +01:28:07 1592166487 1 11492 2 BT 3-1, 6, 8, 9, 14, 15, 16 9 3850 10 670 +04:46:02 1592178362 1 11492 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4710 9 3850 10 670 11 12 321731 +05:20:45 1592180445 0 A--32-002-2012 ॢ 9 +13:17:47 1592209067 3 14 +15:25:37 1592216737 1 11493 3 25 9 3640 +16:06:37 1592219197 12 321547 +22:55:25 1592243725 1 11493 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4710 9 3640 10 670 11 12 321547 +23:30:08 1592245808 0 A--32-002-2012 ॢ 9 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.461 new file mode 100644 index 0000000..5b15e06 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.462 new file mode 100644 index 0000000..4362a69 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.462 @@ -0,0 +1,135 @@ +21 01:25:37 01:25:40 +Rsk= 18.7 Rkk= 16.6 + +22 01:51:05 02:06:13 +P1= 41.5 T1=02:01:12 P2= 53.7 T2=02:06:13 Vs= 2.44 + +20 03:45:59 03:46:08 +Riz_sol= 4750.9 + +21 03:46:18 03:46:21 +Rsk= 18.5 Rkk= 16.8 + +22 04:09:59 04:25:07 +P1= 44.1 T1=04:20:07 P2= 57.6 T2=04:25:07 Vs= 2.69 + +23 04:25:23 04:25:28 + + +24 04:25:38 04:26:24 + + +30 04:26:40 04:27:05 +Vst= 27.6 + +31 04:27:09 04:27:46 +Rom_sol= -1.0 + +31 04:34:06 04:34:42 +Rom_sol= -1.0 + +31 04:37:12 04:37:48 +Rom_sol= -1.0 + +31 04:38:24 04:39:24 +Rom_sol= 11.1 + +41 04:39:58 04:40:03 +Ukz= 1.09 + +32 04:40:11 04:40:47 +Imax=11.1 Umax=50.1 T= 9.0 + +33 04:40:51 04:41:12 +Imin=16.1 Umin=25.0 T= 1.6 + +33 04:41:23 04:41:44 +Imin=16.1 Umin=24.9 T= 0.5 + +34 04:41:47 04:42:09 +V=300.5 T= 9.4 + +35 04:42:11 04:43:16 +Q= 52.7 T= 9.4 + +36 04:43:20 04:43:49 +P1=0.29 T= 2.9 + +37 04:43:53 04:44:17 +T= 0.9 + +38 04:44:21 04:44:28 +t= 54.0 T= 0.5 + +39 04:44:31 04:44:46 +tcam= 53.6 Tcam= 0.5 tfl= 59.3 Tfl= 0.5 + +40 04:44:49 04:44:57 +t= 52.3 T= 0.5 + +21 13:18:05 13:18:09 +Rsk= 18.7 Rkk= 16.6 + +22 13:35:41 13:45:48 +P1= 21.8 T1=13:40:48 P2= 43.7 T2=13:45:48 Vs= 4.38 + +21 15:25:56 15:25:59 +Rsk= 8.1 Rkk= 8.7 + +22 15:44:54 16:00:01 +P1= 45.0 T1=15:55:01 P2= 57.8 T2=16:00:01 Vs= 2.56 + +20 18:10:03 18:10:11 +Riz_sol= 951.9 + +21 18:10:29 18:10:32 +Rsk= 9.7 Rkk= 9.5 + +22 18:39:36 18:54:44 +P1= 33.1 T1=18:49:44 P2= 43.3 T2=18:54:44 Vs= 2.04 + +22 22:29:57 22:40:04 +P1= 14.9 T1=22:35:04 P2= 20.8 T2=22:40:04 Vs= 1.17 + +23 22:45:36 22:45:41 + + +24 22:45:50 22:46:28 + + +30 22:46:59 22:47:33 +Vst= 27.8 + +31 22:47:43 22:48:18 +Rom_sol= 11.6 + +41 22:48:40 22:48:45 +Ukz= 0.82 + +32 22:48:47 22:49:26 +Imax=11.1 Umax=50.1 T= 9.0 + +33 22:49:29 22:49:54 +Imin=16.1 Umin=25.0 T= 0.5 + +34 22:49:59 22:50:21 +V=300.4 T= 9.4 + +35 22:50:25 22:51:46 +Q= 53.2 T= 9.4 + +36 22:51:50 22:52:22 +P1=0.29 T= 2.9 + +37 22:52:45 22:53:15 +T= 0.9 + +38 22:53:20 22:53:34 +t= 54.1 T= 0.5 + +39 22:53:37 22:53:59 +tcam= 52.0 Tcam= 0.5 tfl= 59.5 Tfl= 0.5 + +40 22:54:03 22:54:28 +t= 52.4 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.463 new file mode 100644 index 0000000..1c45dfe --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.463 @@ -0,0 +1,26 @@ +13 00:06:35 1592161595 +0 00:06:35 1592161595 +2 01:21:30 1592166090 +5 02:07:38 1592168858 +6 02:19:58 1592169598 +7 02:58:17 1592171897 +8 03:42:40 1592174560 +25 04:26:35 1592177195 +9 04:46:02 1592178362 +10 05:20:45 1592180445 +11 08:14:38 1592190878 +12 10:56:20 1592200580 +13 12:43:48 1592207028 +0 12:43:48 1592207028 +14 13:15:21 1592208921 +15 13:46:54 1592210814 +16 14:15:41 1592212541 +1 14:52:15 1592214735 +2 15:19:23 1592216363 +5 16:09:29 1592219369 +6 16:22:35 1592220155 +7 17:08:52 1592222932 +8 18:06:22 1592226382 +25 22:46:54 1592243214 +9 22:55:25 1592243725 +10 23:30:08 1592245808 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.464 new file mode 100644 index 0000000..3b142c0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.465 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.465 new file mode 100644 index 0000000..01434da --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.465 @@ -0,0 +1,5 @@ +43 04:27:45 1592177265 +43 04:34:41 1592177681 +43 04:37:46 1592177866 +55 04:41:11 1592178071 +47 04:41:17 1592178077 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.466 new file mode 100644 index 0000000..d2b4ded --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.466 @@ -0,0 +1,150 @@ +[04] +oper = 13 +begin = 15.06.2020 00:06:35 +norma = 45 +real = 74 + +[05] +oper = 2 +begin = 15.06.2020 01:21:30 +norma = 110 +vac_time = 9 +real = 46 + +[06] +oper = 5 +begin = 15.06.2020 02:07:38 +norma = 25 +real = 12 + +[07] +oper = 6 +begin = 15.06.2020 02:19:58 +norma = 35 +real = 38 + +[08] +oper = 7 +begin = 15.06.2020 02:58:17 +norma = 30 +real = 44 + +[09] +oper = 8 +begin = 15.06.2020 03:42:40 +norma = 40 +vac_time = 9 +real = 43 + +[10] +oper = 25 +begin = 15.06.2020 04:26:35 +norma = 30 +real = 19 + +[11] +oper = 9 +begin = 15.06.2020 04:46:02 +norma = 0 +real = 34 + +[12] +oper = 10 +begin = 15.06.2020 05:20:45 +norma = 0 +real = 173 + +[13] +oper = 11 +begin = 15.06.2020 08:14:38 +norma = 0 +real = 161 + +[14] +oper = 12 +begin = 15.06.2020 10:56:20 +norma = 105 +real = 107 + +[15] +oper = 13 +begin = 15.06.2020 12:43:48 +norma = 45 +real = 31 + +[16] +oper = 14 +begin = 15.06.2020 13:15:21 +norma = 40 +vac_time = 9 +vac_avg10 = 12.1 +real = 31 + +[17] +oper = 15 +begin = 15.06.2020 13:46:54 +norma = 30 +real = 28 + +[18] +oper = 16 +begin = 15.06.2020 14:15:41 +norma = 40 +real = 36 + +[19] +oper = 1 +begin = 15.06.2020 14:52:15 +norma = 85 +real = 27 + +[20] +oper = 2 +begin = 15.06.2020 15:19:23 +norma = 110 +vac_time = 9 +real = 50 + +[21] +oper = 5 +begin = 15.06.2020 16:09:29 +norma = 25 +real = 13 + +[22] +oper = 6 +begin = 15.06.2020 16:22:35 +norma = 35 +real = 46 + +[23] +oper = 7 +begin = 15.06.2020 17:08:52 +norma = 30 +real = 57 + +[24] +oper = 8 +begin = 15.06.2020 18:06:22 +norma = 40 +vac_time = 9 +real = 280 + +[25] +oper = 25 +begin = 15.06.2020 22:46:54 +norma = 30 +real = 8 + +[26] +oper = 9 +begin = 15.06.2020 22:55:25 +norma = 0 +real = 34 + +[27] +oper = 10 +begin = 15.06.2020 23:30:08 +norma = 0 +real = 161 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.467 new file mode 100644 index 0000000..287eab4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.467 @@ -0,0 +1,35 @@ +02:20:21 1592169621 祭 ० ᪠ +02:22:19 1592169739 ⪫祭 ० ᪠ (A) +04:25:46 1592177146 祭 ॣ '-2'(A) +04:26:23 1592177183 ⪫祭 ॣ '-2'(A) +04:45:14 1592178314 祭 ० ࠧ +04:45:17 1592178317 祭 ० ' ⮪ 㣨' +05:03:00 1592179380 祭 ॣ '-2'(A) +05:20:45 1592180445 祭 ⠭ ॣ +05:20:45 1592180445 ⪫祭 ० ࠧ (A) +08:14:37 1592190877 祭 ० +08:14:38 1592190878 ⪫祭 ॣ '-2'(A) +08:14:39 1592190879 祭 ॣ '-2'(A) +09:23:37 1592195017 ⪫祭 ॣ '-2'(A) +10:56:15 1592200575 ⪫祭 ० (A) +10:56:21 1592200581 ⪫祭 ० ' ⮪ 㣨' +10:56:39 1592200599 祭 ० ᪠ +10:58:42 1592200722 ⪫祭 ० ᪠ (A) +13:46:31 1592210791 祭 ० ࠧ +13:46:34 1592210794 祭 ० ' ⮪ 㣨' +13:47:43 1592210863 祭 ॣ '-2'(A) +14:14:18 1592212458 ⪫祭 ० ' ⮪ 㣨' +14:15:19 1592212519 ⪫祭 ० ࠧ (A) +14:15:45 1592212545 ⪫祭 ॣ '-2'(A) +14:15:52 1592212552 祭 ० ᪠ +14:15:52 1592212552 祭 ० ᪠ +14:17:57 1592212677 ⪫祭 ० ᪠ (A) +16:22:59 1592220179 祭 ० ᪠ +16:25:04 1592220304 ⪫祭 ० ᪠ (A) +22:45:50 1592243150 祭 ॣ '-2'(A) +22:46:27 1592243187 ⪫祭 ॣ '-2'(A) +22:54:55 1592243695 祭 ० ࠧ +22:55:03 1592243703 祭 ० ' ⮪ 㣨' +23:12:24 1592244744 祭 ॣ '-2'(A) +23:30:07 1592245807 祭 ⠭ ॣ +23:30:08 1592245808 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.469 new file mode 100644 index 0000000..faa1ecf Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.480 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.480 new file mode 100644 index 0000000..482793b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.480 @@ -0,0 +1,3 @@ +07:01:57 1592186517 1 02539 2 p. cao M1,M2,M3,M4 3 37 9 3420 10 670 12 321692 +17:45:35 1592225135 1 02539 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 770 8 4780 9 3420 10 670 11 12 321692 +18:19:35 1592227175 0 A--32-006-2018 ॢ 4 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.481 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.481 new file mode 100644 index 0000000..495b1b2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.481 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.482 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.482 new file mode 100644 index 0000000..64d867c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.482 @@ -0,0 +1,63 @@ +21 07:02:20 07:02:23 +Rsk= 65.4 Rkk= 54.3 + +22 08:01:40 08:16:44 +P1= 50.7 T1=08:11:44 P2= 63.2 T2=08:16:44 Vs= 2.51 + +20 10:10:42 10:10:51 +Riz_sol= 1546.1 + +21 10:10:56 10:10:59 +Rsk= 65.6 Rkk= 55.4 + +22 11:01:15 11:16:20 +P1= 75.8 T1=11:11:20 P2= 97.3 T2=11:16:20 Vs= 4.29 + +22 11:32:39 11:42:43 +P1= 29.6 T1=11:37:43 P2= 38.8 T2=11:42:43 Vs= 1.84 + +22 17:20:07 17:30:12 +P1= 30.3 T1=17:25:12 P2= 31.3 T2=17:30:12 Vs= 0.21 + +23 17:35:09 17:35:14 + + +24 17:35:23 17:36:00 + + +30 17:36:20 17:36:50 +Vst= 23.6 + +31 17:36:57 17:37:39 +Rom_sol= 7.4 + +41 17:38:40 17:38:45 +Ukz= 0.71 + +32 17:38:51 17:39:27 +Imax=26.8 Umax=55.1 T= 9.4 + +33 17:39:33 17:39:56 +Imin=15.8 Umin=25.0 T= 0.8 + +34 17:40:00 17:40:24 +V=300.1 T= 9.7 + +35 17:40:28 17:41:47 +Qkr= 52.1 Tkr= 9.5 Qpd= 0.0 Tpd= 0.0 + +36 17:41:52 17:42:47 +Pkr=0.30 Tkr= 3.0 Ppd=0.00 Tpd= 0.0 + +37 17:42:51 17:43:18 +T= 1.3 + +38 17:43:25 17:43:33 +t= 52.4 T= 0.8 + +39 17:43:47 17:43:54 +t= 51.8 T= 0.7 + +40 17:44:12 17:44:19 +t= 52.3 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.483 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.483 new file mode 100644 index 0000000..aae2b4c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.483 @@ -0,0 +1,14 @@ +11 00:52:54 1592164374 +12 03:39:52 1592174392 +13 05:27:38 1592180858 +0 05:27:38 1592180858 +2 06:58:49 1592186329 +5 08:18:53 1592191133 +6 08:30:46 1592191846 +7 09:11:53 1592194313 +8 10:05:26 1592197526 +25 17:36:17 1592224577 +9 17:45:35 1592225135 +10 18:19:35 1592227175 +11 19:46:40 1592232400 +12 22:35:45 1592242545 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.484 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.484 new file mode 100644 index 0000000..5aaab2f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.484 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.486 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.486 new file mode 100644 index 0000000..5d32abd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.486 @@ -0,0 +1,80 @@ +[55] +oper = 11 +begin = 15.06.2020 00:52:54 +norma = 0 +real = 166 + +[56] +oper = 12 +begin = 15.06.2020 03:39:52 +norma = 105 +real = 107 + +[57] +oper = 13 +begin = 15.06.2020 05:27:38 +norma = 45 +real = 91 + +[58] +oper = 2 +begin = 15.06.2020 06:58:49 +norma = 110 +vac_time = 30 +real = 80 + +[59] +oper = 5 +begin = 15.06.2020 08:18:53 +norma = 25 +real = 11 + +[60] +oper = 6 +begin = 15.06.2020 08:30:46 +norma = 35 +real = 41 + +[61] +oper = 7 +begin = 15.06.2020 09:11:53 +norma = 30 +real = 53 + +[62] +oper = 8 +begin = 15.06.2020 10:05:26 +norma = 40 +vac_time = 30 +real = 450 + +[63] +oper = 25 +begin = 15.06.2020 17:36:17 +norma = 30 +real = 9 + +[64] +oper = 9 +begin = 15.06.2020 17:45:35 +norma = 0 +real = 34 + +[65] +oper = 10 +begin = 15.06.2020 18:19:35 +norma = 0 +real = 87 + +[66] +oper = 11 +begin = 15.06.2020 19:46:40 +norma = 0 +real = 169 + +[67] +oper = 12 +begin = 15.06.2020 22:35:45 +norma = 105 +real = 109 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.487 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.487 new file mode 100644 index 0000000..22b7d04 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.487 @@ -0,0 +1,26 @@ +00:52:53 1592164373 祭 ० +00:52:54 1592164374 ⪫祭 ॣ '-2'(A) +00:52:55 1592164375 祭 ॣ '-2'(A) +02:44:54 1592171094 ⪫祭 ॣ '-2'(A) +03:39:50 1592174390 ⪫祭 ० (A) +03:39:52 1592174392 ⪫祭 ० ' ⮪ 㣨' +03:40:11 1592174411 祭 ० ᪠ +03:44:09 1592174649 ⪫祭 ० ᪠ (A) +08:31:29 1592191889 祭 ० ᪠ +08:33:59 1592192039 ⪫祭 ० ᪠ (A) +17:35:24 1592224524 祭 ॣ '-2'(A) +17:36:01 1592224561 ⪫祭 ॣ '-2'(A) +17:44:56 1592225096 祭 ० ࠧ +17:44:59 1592225099 祭 ० ' ⮪ 㣨' +18:05:35 1592226335 祭 ॣ '-2'(A) +18:19:35 1592227175 ⪫祭 ० ࠧ (A) +18:19:36 1592227176 祭 ⠭ ॣ +19:46:39 1592232399 祭 ० +19:46:40 1592232400 ⪫祭 ॣ '-2'(A) +19:46:41 1592232401 祭 ॣ '-2'(A) +20:48:40 1592236120 ⪫祭 ॣ '-2'(A) +22:35:42 1592242542 ⪫祭 ० (A) +22:35:44 1592242544 ⪫祭 ० ' ⮪ 㣨' +22:36:49 1592242609 祭 ० ᪠ +22:36:49 1592242609 祭 ० ᪠ +22:39:22 1592242762 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200615.489 b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.489 new file mode 100644 index 0000000..e9aee76 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200615.489 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.110 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.110 new file mode 100644 index 0000000..1d1300f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.110 @@ -0,0 +1,5 @@ +06:12:11 1592269931 3 14 +07:25:54 1592274354 0 A--32-067-2014 ॢ 0 +09:48:29 1592282909 1 10797 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 9 4700 10 690 12 320201 +19:37:28 1592318248 1 10797 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 5470 9 4700 10 690 11 12 320201 +20:20:19 1592320819 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.111 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.111 new file mode 100644 index 0000000..af28e9a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.111 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.112 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.112 new file mode 100644 index 0000000..b4ab71d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.112 @@ -0,0 +1,69 @@ +21 06:12:22 06:12:25 +Rsk= 28.4 Rkk= 24.6 + +22 06:44:11 06:54:16 +P1= 32.8 T1=06:49:16 P2= 40.4 T2=06:54:16 Vs= 1.52 + +20 09:46:13 09:46:22 +Riz_sol= 487.3 + +21 09:46:29 09:46:32 +Rsk= 28.5 Rkk= 24.8 + +22 10:20:24 10:30:29 +P1= 35.0 T1=10:25:29 P2= 44.6 T2=10:30:29 Vs= 1.93 + +20 12:15:42 12:15:50 +Riz_sol= 406.0 + +21 12:15:59 12:16:02 +Rsk= 28.8 Rkk= 25.1 + +22 12:50:01 13:00:06 +P1= 41.1 T1=12:55:06 P2= 54.0 T2=13:00:06 Vs= 2.59 + +22 19:08:16 19:18:21 +P1= 56.0 T1=19:13:21 P2= 57.1 T2=19:18:21 Vs= 0.21 + +24 19:18:29 19:19:08 + + +23 19:19:15 19:19:21 + + +30 19:19:35 19:20:15 +Vst= 29.8 + +31 19:20:26 19:21:18 +Rom_sol= 11.7 + +32 19:29:36 19:30:11 +Imax=11.0 Umax=50.0 T= 9.0 + +33 19:30:15 19:30:50 +Imin=15.9 Umin=25.0 T= 0.5 + +34 19:30:54 19:31:22 +V=300.1 T= 9.4 + +35 19:31:25 19:32:59 +Q= 52.4 T= 9.4 + +36 19:33:04 19:33:48 +P1=0.29 T= 2.9 + +37 19:33:54 19:34:31 +T= 0.0 + +37 19:34:52 19:35:24 +T= 0.9 + +38 19:35:30 19:35:46 +t= 53.4 T= 0.5 + +39 19:35:50 19:36:16 +tcam= 51.8 Tcam= 0.5 tfl= 52.8 Tfl= 0.5 + +40 19:36:20 19:36:27 +t= 53.3 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.113 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.113 new file mode 100644 index 0000000..5839956 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.113 @@ -0,0 +1,14 @@ +11 01:04:56 1592251496 +12 03:54:00 1592261640 +13 05:44:48 1592268288 +0 05:44:50 1592268290 +14 06:10:22 1592269822 +15 06:57:43 1592272663 +16 07:27:55 1592274475 +1 08:13:21 1592277201 +8 09:41:53 1592282513 +13 10:49:15 1592286555 +8 12:14:10 1592291650 +25 19:19:32 1592317172 +9 19:37:28 1592318248 +10 20:20:19 1592320819 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.114 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.114 new file mode 100644 index 0000000..7b4cae3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.114 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.115 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.115 new file mode 100644 index 0000000..7b3e15b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.115 @@ -0,0 +1 @@ +71 19:34:31 1592318071 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.116 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.116 new file mode 100644 index 0000000..96c576e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.116 @@ -0,0 +1,81 @@ +[43] +oper = 11 +begin = 16.06.2020 01:04:56 +norma = 0 +real = 169 + +[44] +oper = 12 +begin = 16.06.2020 03:54:00 +norma = 105 +real = 110 + +[45] +oper = 13 +begin = 16.06.2020 05:44:48 +norma = 45 +real = 25 + +[46] +oper = 14 +begin = 16.06.2020 06:10:22 +norma = 40 +vac_time = 7 +real = 47 + +[47] +oper = 15 +begin = 16.06.2020 06:57:43 +norma = 30 +real = 30 + +[48] +oper = 16 +begin = 16.06.2020 07:27:55 +norma = 40 +real = 45 + +[49] +oper = 1 +begin = 16.06.2020 08:13:21 +norma = 85 +real = 88 + +[50] +oper = 8 +begin = 16.06.2020 09:41:53 +norma = 40 +vac_time = 8 +real = 67 + +[51] +oper = 13 +begin = 16.06.2020 10:49:15 +norma = 45 +real = 84 + +[52] +oper = 8 +begin = 16.06.2020 12:14:10 +norma = 40 +vac_time = 8 +real = 425 + +[53] +oper = 25 +begin = 16.06.2020 19:19:32 +norma = 30 +real = 17 + +[54] +oper = 9 +begin = 16.06.2020 19:37:28 +norma = 0 +real = 42 + +[55] +oper = 10 +begin = 16.06.2020 20:20:19 +norma = 0 +real = 220 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.117 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.117 new file mode 100644 index 0000000..bf03339 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.117 @@ -0,0 +1,28 @@ +01:04:55 1592251495 祭 ० +01:04:55 1592251495 ⪫祭 ॣ '-2'(A) +01:04:56 1592251496 祭 ॣ '-2'(A) +02:06:57 1592255217 ⪫祭 ॣ '-2'(A) +03:53:59 1592261639 ⪫祭 ० (A) +03:54:02 1592261642 ⪫祭 ० ' ⮪ 㣨' +03:54:39 1592261679 祭 ० ᪠ +03:54:39 1592261679 祭 ० ᪠ +03:54:39 1592261679 祭 ० ᪠ +03:54:40 1592261680 祭 ० ᪠ +03:56:46 1592261806 ⪫祭 ० ᪠ (A) +06:57:02 1592272622 祭 ० ࠧ +06:57:03 1592272623 祭 ० ' ⮪ 㣨' +06:58:30 1592272710 祭 ॣ '-2'(A) +07:25:54 1592274354 ⪫祭 ० ࠧ (A) +07:26:11 1592274371 ⪫祭 ० ' ⮪ 㣨' +07:27:58 1592274478 ⪫祭 ॣ '-2'(A) +07:28:14 1592274494 祭 ० ᪠ +07:28:14 1592274494 祭 ० ᪠ +07:28:15 1592274495 祭 ० ᪠ +07:30:25 1592274625 ⪫祭 ० ᪠ (A) +19:18:32 1592317112 祭 ॣ '-2'(A) +19:19:08 1592317148 ⪫祭 ॣ '-2'(A) +19:36:50 1592318210 祭 ० ࠧ +19:36:50 1592318210 祭 ० ' ⮪ 㣨' +20:03:14 1592319794 祭 ॣ '-2'(A) +20:20:18 1592320818 祭 ⠭ ॣ +20:20:19 1592320819 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.119 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.119 new file mode 100644 index 0000000..e1a0122 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.119 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.450 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.450 new file mode 100644 index 0000000..0a146be --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.450 @@ -0,0 +1,6 @@ +01:18:53 1592252333 3 14 +04:14:15 1592262855 1 11432 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 8 3000 9 4860 10 690 +09:47:48 1592282868 1 11432 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3000 9 4860 10 690 11 12 320252 +10:30:29 1592285429 0 A--32-031-2016 ॢ 5 +20:26:04 1592321164 1 11433 2 p. cao M1,M2,M3,M4 4 1 9 5360 10 650 +23:17:42 1592331462 1 11433 2 p. cao M1,M2,M3,M4 3 25 4 1 5 Ti 6 7 770 8 3000 9 5360 10 650 11 12 320252 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.451 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.451 new file mode 100644 index 0000000..4716a9e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.451 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.452 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.452 new file mode 100644 index 0000000..35be589 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.452 @@ -0,0 +1,141 @@ +21 01:18:33 01:18:36 +Rsk= 17.2 Rkk= 13.6 + +22 01:35:14 01:50:19 +P1= 56.1 T1=01:45:18 P2= 71.5 T2=01:50:19 Vs= 3.07 + +20 04:07:37 04:07:46 +Riz_sol= 4855.8 + +21 04:08:15 04:08:18 +Rsk= 17.1 Rkk= 13.6 + +22 04:30:18 04:45:23 +P1= 73.7 T1=04:40:23 P2=101.7 T2=04:45:23 Vs= 5.60 + +22 05:00:19 05:15:23 +P1= 52.8 T1=05:10:23 P2= 74.5 T2=05:15:23 Vs= 4.33 + +22 05:40:54 05:55:59 +P1= 41.6 T1=05:50:59 P2= 59.2 T2=05:55:59 Vs= 3.53 + +22 06:05:04 06:20:09 +P1= 39.0 T1=06:15:09 P2= 56.1 T2=06:20:09 Vs= 3.43 + +22 06:25:08 06:40:13 +P1= 37.7 T1=06:35:13 P2= 54.2 T2=06:40:13 Vs= 3.29 + +22 06:53:46 07:08:51 +P1= 35.1 T1=07:03:51 P2= 50.3 T2=07:08:51 Vs= 3.03 + +22 09:24:49 09:39:54 +P1= 29.3 T1=09:34:54 P2= 41.7 T2=09:39:54 Vs= 2.48 + +23 09:40:02 09:40:07 + + +24 09:40:11 09:40:49 + + +30 09:41:01 09:41:33 +Vst= 28.7 + +31 09:41:37 09:42:11 +Rom_sol= 13.7 + +32 09:42:42 09:43:20 +Imax=10.9 Umax=50.1 T= 9.0 + +33 09:43:22 09:43:42 +Imin=15.8 Umin=25.0 T= 0.5 + +34 09:43:46 09:44:21 +V=300.2 T= 9.4 + +35 09:44:23 09:45:17 +Q= 54.5 T= 9.4 + +40 09:45:20 09:45:27 +t= 51.7 T= 0.5 + +39 09:45:29 09:45:37 +t= 52.3 T= 0.5 + +39 09:45:40 09:45:56 +tcam= 52.1 Tcam= 0.5 tfl= 55.2 Tfl= 0.5 + +37 09:45:59 09:46:30 +T= 0.9 + +38 09:46:33 09:46:41 +t= 51.6 T= 0.5 + +36 09:46:43 09:47:15 +P1=0.29 T= 2.9 + +21 20:17:46 20:17:49 +Rsk= 17.7 Rkk= 14.0 + +21 20:24:06 20:24:09 +Rsk= 17.7 Rkk= 14.1 + +22 20:32:46 20:47:51 +P1= 73.4 T1=20:42:51 P2= 93.2 T2=20:47:51 Vs= 3.96 + +22 20:53:18 21:08:22 +P1= 48.0 T1=21:03:22 P2= 61.6 T2=21:08:22 Vs= 2.72 + +20 22:18:13 22:18:21 +Riz_sol= 4854.4 + +21 22:18:37 22:18:40 +Rsk= 17.6 Rkk= 14.0 + +22 22:35:26 22:50:30 +P1= 50.0 T1=22:45:30 P2= 65.4 T2=22:50:30 Vs= 3.09 + +22 22:54:42 23:09:47 +P1= 37.9 T1=23:04:47 P2= 49.8 T2=23:09:47 Vs= 2.39 + +23 23:09:57 23:10:02 + + +24 23:10:08 23:10:45 + + +30 23:10:58 23:11:03 +Vst= 22.4 + +30 23:11:07 23:11:32 +Vst= 28.6 + +31 23:11:41 23:12:15 +Rom_sol= 13.3 + +32 23:12:55 23:13:30 +Imax=10.9 Umax=50.1 T= 9.0 + +33 23:13:34 23:13:53 +Imin=15.8 Umin=25.0 T= 0.5 + +34 23:14:03 23:14:26 +V=300.1 T= 9.4 + +35 23:14:30 23:15:23 +Q= 53.6 T= 9.4 + +36 23:15:28 23:15:58 +P1=0.29 T= 2.9 + +37 23:16:02 23:16:34 +T= 0.9 + +38 23:16:38 23:16:45 +t= 51.6 T= 0.5 + +39 23:16:48 23:17:03 +tcam= 52.3 Tcam= 0.5 tfl= 52.7 Tfl= 0.5 + +40 23:17:06 23:17:13 +t= 51.7 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.453 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.453 new file mode 100644 index 0000000..04415eb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.453 @@ -0,0 +1,22 @@ +13 00:29:39 1592249379 +0 00:29:39 1592249379 +14 01:15:21 1592252121 +15 01:52:23 1592254343 +16 02:20:12 1592256012 +1 03:07:03 1592258823 +8 04:02:35 1592262155 +25 09:40:59 1592282459 +9 09:47:48 1592282868 +10 10:30:29 1592285429 +11 14:22:00 1592299320 +12 17:09:21 1592309361 +13 18:54:49 1592315689 +0 18:54:49 1592315689 +2 20:09:53 1592320193 +5 21:09:31 1592323771 +6 21:21:31 1592324491 +7 21:55:51 1592326551 +8 22:12:06 1592327526 +25 23:10:55 1592331055 +9 23:17:42 1592331462 +10 23:42:57 1592332977 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.454 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.454 new file mode 100644 index 0000000..53b0784 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.454 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.455 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.455 new file mode 100644 index 0000000..587f3e5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.455 @@ -0,0 +1,3 @@ +3 04:06:35 1592262395 +47 09:45:37 1592282737 +47 09:45:39 1592282739 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.456 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.456 new file mode 100644 index 0000000..880a0ee --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.456 @@ -0,0 +1,124 @@ +[91] +oper = 13 +begin = 16.06.2020 00:29:39 +norma = 45 +real = 45 + +[92] +oper = 14 +begin = 16.06.2020 01:15:21 +norma = 40 +vac_time = 8 +real = 37 + +[93] +oper = 15 +begin = 16.06.2020 01:52:23 +norma = 30 +real = 27 + +[94] +oper = 16 +begin = 16.06.2020 02:20:12 +norma = 40 +real = 46 + +[95] +oper = 1 +begin = 16.06.2020 03:07:03 +norma = 85 +real = 55 + +[96] +oper = 8 +begin = 16.06.2020 04:02:35 +norma = 40 +vac_time = 9 +real = 338 + +[97] +oper = 25 +begin = 16.06.2020 09:40:59 +norma = 30 +real = 6 + +[98] +oper = 9 +begin = 16.06.2020 09:47:48 +norma = 0 +real = 42 + +[99] +oper = 10 +begin = 16.06.2020 10:30:29 +norma = 0 +real = 231 + +[00] +oper = 11 +begin = 16.06.2020 14:22:00 +norma = 0 +real = 167 + +[01] +oper = 12 +begin = 16.06.2020 17:09:21 +norma = 105 +real = 105 + +[02] +oper = 13 +begin = 16.06.2020 18:54:49 +norma = 45 +real = 75 + +[03] +oper = 2 +begin = 16.06.2020 20:09:53 +norma = 110 +vac_time = 10 +real = 59 + +[04] +oper = 5 +begin = 16.06.2020 21:09:31 +norma = 25 +real = 12 + +[05] +oper = 6 +begin = 16.06.2020 21:21:31 +norma = 35 +real = 34 + +[06] +oper = 7 +begin = 16.06.2020 21:55:51 +norma = 30 +real = 16 + +[07] +oper = 8 +begin = 16.06.2020 22:12:06 +norma = 40 +vac_time = 8 +real = 58 + +[08] +oper = 25 +begin = 16.06.2020 23:10:55 +norma = 30 +real = 6 + +[09] +oper = 9 +begin = 16.06.2020 23:17:42 +norma = 0 +real = 25 + +[10] +oper = 10 +begin = 16.06.2020 23:42:57 +norma = 0 +real = 284 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.457 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.457 new file mode 100644 index 0000000..dded585 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.457 @@ -0,0 +1,32 @@ +01:51:12 1592254272 祭 ० ࠧ +01:51:14 1592254274 祭 ० ' ⮪ 㣨' +01:53:11 1592254391 祭 ॣ '-2'(A) +02:19:37 1592255977 ⪫祭 ० ' ⮪ 㣨' +02:20:17 1592256017 ⪫祭 ॣ '-2'(A) +02:20:24 1592256024 祭 ० ᪠ +02:20:24 1592256024 祭 ० ᪠ +02:20:24 1592256024 祭 ० ᪠ +02:22:49 1592256169 ⪫祭 ० ᪠ (A) +09:40:14 1592282414 祭 ॣ '-2'(A) +09:40:50 1592282450 ⪫祭 ॣ '-2'(A) +09:47:21 1592282841 祭 ० ࠧ +09:47:22 1592282842 祭 ० ' ⮪ 㣨' +10:13:25 1592284405 祭 ॣ '-2'(A) +10:30:29 1592285429 ⪫祭 ० ࠧ (A) +10:30:29 1592285429 祭 ⠭ ॣ +14:21:59 1592299319 祭 ० +14:22:00 1592299320 ⪫祭 ॣ '-2'(A) +14:22:01 1592299321 祭 ॣ '-2'(A) +16:14:00 1592306040 ⪫祭 ॣ '-2'(A) +17:08:56 1592309336 ⪫祭 ० (A) +17:09:23 1592309363 ⪫祭 ० ' ⮪ 㣨' +17:09:43 1592309383 祭 ० ᪠ +17:09:44 1592309384 祭 ० ᪠ +17:09:44 1592309384 祭 ० ᪠ +17:12:04 1592309524 ⪫祭 ० ᪠ (A) +21:21:43 1592324503 祭 ० ᪠ +21:24:03 1592324643 ⪫祭 ० ᪠ (A) +23:10:10 1592331010 祭 ॣ '-2'(A) +23:10:45 1592331045 ⪫祭 ॣ '-2'(A) +23:35:21 1592332521 祭 ॣ '-2' +23:42:56 1592332976 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.459 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.459 new file mode 100644 index 0000000..7196b76 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.459 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.480 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.480 new file mode 100644 index 0000000..9d9d90d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.480 @@ -0,0 +1,6 @@ +02:32:22 1592256742 1 02540 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 9 4860 10 690 +04:35:41 1592264141 1 02540 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4780 9 4860 10 690 11 12 321692 +05:18:42 1592266722 0 A--32-031-2016 ॢ 5 +15:08:25 1592302105 1 02541 2 BT 18, 20, 22, 23, 25 3 25 9 4990 +22:59:14 1592330354 1 02541 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 4780 9 4990 10 690 11 12 321692 +23:42:14 1592332934 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.481 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.481 new file mode 100644 index 0000000..7738cd8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.481 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.482 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.482 new file mode 100644 index 0000000..2520086 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.482 @@ -0,0 +1,105 @@ +20 02:30:54 02:31:03 +Riz_sol= 1109.9 + +21 02:31:11 02:31:14 +Rsk= 63.8 Rkk= 53.5 + +22 03:42:23 03:57:28 +P1= 77.4 T1=03:52:28 P2= 97.6 T2=03:57:28 Vs= 4.03 + +22 04:15:07 04:25:11 +P1= 29.8 T1=04:20:11 P2= 41.3 T2=04:25:11 Vs= 2.30 + +23 04:25:24 04:25:29 + + +24 04:25:46 04:26:25 + + +30 04:26:39 04:27:14 +Vst= 23.6 + +31 04:27:20 04:27:55 +Rom_sol= 7.0 + +32 04:29:30 04:30:07 +Imax=10.9 Umax=50.0 T= 9.3 + +33 04:30:17 04:30:36 +Imin=15.8 Umin=25.0 T= 0.8 + +34 04:30:40 04:31:04 +V=300.4 T= 9.7 + +35 04:31:08 04:32:31 +Qkr= 47.6 Tkr=12.4 Qpd= 0.0 Tpd= 0.0 + +36 04:32:42 04:33:39 +Pkr=0.29 Tkr= 3.2 Ppd=0.00 Tpd= 0.0 + +37 04:33:45 04:34:11 +T= 0.9 + +38 04:34:15 04:34:23 +t= 52.2 T= 0.7 + +39 04:34:27 04:34:33 +t= 51.8 T= 0.5 + +40 04:34:37 04:34:44 +t= 52.3 T= 0.8 + +20 15:07:28 15:07:37 +Riz_sol= 969.3 + +21 15:07:44 15:07:47 +Rsk= 33.8 Rkk= 23.1 + +22 16:52:01 17:02:06 +P1= 20.6 T1=16:57:06 P2= 31.9 T2=17:02:06 Vs= 2.26 + +22 22:35:02 22:45:07 +P1= 22.3 T1=22:40:06 P2= 27.2 T2=22:45:07 Vs= 0.96 + +23 22:45:48 22:45:53 + + +24 22:46:01 22:46:44 + + +24 22:47:12 22:47:49 + + +30 22:48:07 22:48:41 +Vst= 23.8 + +31 22:48:49 22:49:25 +Rom_sol= 7.7 + +32 22:50:15 22:50:55 +Imax=10.9 Umax=50.0 T= 9.3 + +33 22:51:02 22:51:30 +Imin=15.8 Umin=25.0 T= 0.8 + +34 22:51:35 22:51:59 +V=300.3 T= 9.4 + +35 22:52:07 22:53:27 +Qkr= 52.8 Tkr= 9.5 Qpd= 0.0 Tpd= 0.0 + +36 22:53:32 22:54:28 +Pkr=0.30 Tkr= 3.1 Ppd=0.00 Tpd= 0.0 + +37 22:54:32 22:55:01 +T= 1.0 + +38 22:55:06 22:55:15 +t= 52.2 T= 0.7 + +39 22:55:20 22:55:28 +t= 51.8 T= 0.9 + +40 22:55:32 22:55:40 +t= 52.3 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.483 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.483 new file mode 100644 index 0000000..a25f1cc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.483 @@ -0,0 +1,14 @@ +13 00:24:58 1592249098 +0 00:24:58 1592249098 +8 02:28:47 1592256527 +25 04:26:36 1592263596 +9 04:35:41 1592264141 +10 05:18:43 1592266723 +11 09:08:27 1592280507 +12 11:55:29 1592290529 +13 13:44:56 1592297096 +0 13:44:56 1592297096 +8 15:03:38 1592301818 +25 22:48:04 1592329684 +9 22:59:14 1592330354 +10 23:42:14 1592332934 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.484 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.484 new file mode 100644 index 0000000..4ee9347 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.484 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.485 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.485 new file mode 100644 index 0000000..2706eed --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.485 @@ -0,0 +1 @@ +29 22:46:45 1592329605 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.486 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.486 new file mode 100644 index 0000000..e92d7c6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.486 @@ -0,0 +1,75 @@ +[68] +oper = 13 +begin = 16.06.2020 00:24:58 +norma = 45 +real = 123 + +[69] +oper = 8 +begin = 16.06.2020 02:28:47 +norma = 40 +vac_time = 32 +real = 117 + +[70] +oper = 25 +begin = 16.06.2020 04:26:36 +norma = 30 +real = 9 + +[71] +oper = 9 +begin = 16.06.2020 04:35:41 +norma = 0 +real = 43 + +[72] +oper = 10 +begin = 16.06.2020 05:18:43 +norma = 0 +real = 229 + +[73] +oper = 11 +begin = 16.06.2020 09:08:27 +norma = 0 +real = 167 + +[74] +oper = 12 +begin = 16.06.2020 11:55:29 +norma = 105 +real = 109 + +[75] +oper = 13 +begin = 16.06.2020 13:44:56 +norma = 45 +real = 78 + +[76] +oper = 8 +begin = 16.06.2020 15:03:38 +norma = 40 +vac_time = 31 +vac_avg10 = 29.7 +real = 464 + +[77] +oper = 25 +begin = 16.06.2020 22:48:04 +norma = 30 +real = 11 + +[78] +oper = 9 +begin = 16.06.2020 22:59:14 +norma = 0 +real = 43 + +[79] +oper = 10 +begin = 16.06.2020 23:42:14 +norma = 0 +real = 243 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.487 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.487 new file mode 100644 index 0000000..e6c971b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.487 @@ -0,0 +1,24 @@ +04:25:52 1592263552 祭 ॣ '-2'(A) +04:26:26 1592263586 ⪫祭 ॣ '-2'(A) +04:34:59 1592264099 祭 ० ࠧ +04:35:02 1592264102 祭 ० ' ⮪ 㣨' +05:01:37 1592265697 祭 ॣ '-2'(A) +05:18:42 1592266722 ⪫祭 ० ࠧ (A) +05:18:42 1592266722 祭 ⠭ ॣ +09:08:27 1592280507 祭 ० +09:08:28 1592280508 ⪫祭 ॣ '-2'(A) +09:08:29 1592280509 祭 ॣ '-2'(A) +11:00:28 1592287228 ⪫祭 ॣ '-2'(A) +11:55:25 1592290525 ⪫祭 ० (A) +11:55:26 1592290526 ⪫祭 ० ' ⮪ 㣨' +11:55:54 1592290554 祭 ० ᪠ +11:58:24 1592290704 ⪫祭 ० ᪠ (A) +22:46:13 1592329573 祭 ॣ '-2'(A) +22:46:45 1592329605 ⪫祭 ॣ '-2'(A) +22:47:13 1592329633 祭 ॣ '-2'(A) +22:47:50 1592329670 ⪫祭 ॣ '-2'(A) +22:58:46 1592330326 祭 ० ࠧ +22:58:48 1592330328 祭 ० ' ⮪ 㣨' +23:25:09 1592331909 祭 ॣ '-2'(A) +23:42:14 1592332934 ⪫祭 ० ࠧ (A) +23:42:14 1592332934 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200616.489 b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.489 new file mode 100644 index 0000000..0a11e5d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200616.489 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.110 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.110 new file mode 100644 index 0000000..3136707 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.110 @@ -0,0 +1,7 @@ +06:20:26 1592356826 1 10798 2 BT 18, 20, 22, 23, 25 9 4630 +09:03:43 1592366623 12 320826 +11:27:19 1592375239 11 +11:50:23 1592376623 1 10798 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 5470 9 4630 10 690 11 12 320826 +12:20:28 1592378428 0 A--32-074-2016 ॢ 1 +21:26:13 1592411173 3 14 +23:21:17 1592418077 1 10799 2 OT-4 3 25 4 1 7 670 9 4730 10 560 11 12 320936 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.111 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.111 new file mode 100644 index 0000000..6ac5929 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.111 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.112 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.112 new file mode 100644 index 0000000..10fb345 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.112 @@ -0,0 +1,78 @@ +21 06:20:42 06:20:45 +Rsk= 28.0 Rkk= 24.3 + +22 07:03:17 07:13:22 +P1= 35.5 T1=07:08:22 P2= 50.6 T2=07:13:22 Vs= 3.02 + +21 09:03:52 09:03:55 +Rsk= 28.6 Rkk= 24.9 + +20 09:04:02 09:04:11 +Riz_sol= 4851.6 + +21 09:25:45 09:25:48 +Rsk= 28.5 Rkk= 24.8 + +20 09:27:34 09:27:43 +Riz_sol= 4852.8 + +22 09:59:55 10:10:00 +P1= 36.3 T1=10:05:00 P2= 50.0 T2=10:10:00 Vs= 2.74 + +22 11:29:57 11:40:01 +P1= 32.8 T1=11:35:01 P2= 42.0 T2=11:40:01 Vs= 1.84 + +23 11:40:20 11:40:25 + + +24 11:40:31 11:41:10 + + +30 11:41:24 11:41:49 +Vst= 29.5 + +31 11:42:04 11:42:10 +Rom_sol= -1.0 + +31 11:42:17 11:43:16 +Rom_sol= 9.6 + +32 11:44:14 11:44:49 +Imax=11.0 Umax=50.1 T= 9.0 + +33 11:44:55 11:45:15 +Imin=16.0 Umin=25.0 T= 0.5 + +34 11:45:19 11:45:43 +V=300.4 T= 9.4 + +37 11:45:48 11:46:44 +T= 0.9 + +38 11:46:48 11:46:55 +t= 52.0 T= 0.5 + +39 11:47:00 11:47:15 +tcam= 51.7 Tcam= 0.5 tfl= 51.3 Tfl= 0.5 + +40 11:47:19 11:47:26 +t= 53.2 T= 0.5 + +35 11:47:29 11:48:54 +Q= 54.1 T= 9.4 + +36 11:49:01 11:49:42 +P1=0.30 T= 2.9 + +21 21:26:03 21:26:06 +Rsk= 28.3 Rkk= 24.9 + +22 21:44:56 21:55:01 +P1= 43.1 T1=21:50:01 P2= 56.3 T2=21:55:01 Vs= 2.66 + +20 23:20:10 23:20:18 +Riz_sol= 19.6 + +21 23:20:26 23:20:29 +Rsk= 28.5 Rkk= 24.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.113 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.113 new file mode 100644 index 0000000..cb9cb80 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.113 @@ -0,0 +1,21 @@ +11 00:01:15 1592334075 +12 02:48:16 1592344096 +13 04:40:49 1592350849 +0 04:40:49 1592350849 +2 06:14:37 1592356477 +5 07:15:06 1592360106 +6 07:29:11 1592360951 +7 08:09:19 1592363359 +8 09:03:32 1592366612 +25 11:41:21 1592376081 +9 11:50:23 1592376623 +10 12:20:28 1592378428 +11 16:29:30 1592393370 +12 19:12:41 1592403161 +13 21:02:20 1592409740 +0 21:02:20 1592409740 +14 21:24:25 1592411065 +15 21:55:29 1592412929 +16 22:16:51 1592414211 +1 22:41:51 1592415711 +8 23:17:52 1592417872 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.114 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.114 new file mode 100644 index 0000000..5b7a229 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.114 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.115 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.115 new file mode 100644 index 0000000..f7e36b0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.115 @@ -0,0 +1 @@ +92 11:42:10 1592376130 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.116 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.116 new file mode 100644 index 0000000..6edafac --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.116 @@ -0,0 +1,118 @@ +[56] +oper = 11 +begin = 17.06.2020 00:01:15 +norma = 0 +real = 167 + +[57] +oper = 12 +begin = 17.06.2020 02:48:16 +norma = 105 +real = 112 + +[58] +oper = 13 +begin = 17.06.2020 04:40:49 +norma = 45 +real = 93 + +[59] +oper = 2 +begin = 17.06.2020 06:14:37 +norma = 110 +vac_time = 7 +real = 60 + +[60] +oper = 5 +begin = 17.06.2020 07:15:06 +norma = 25 +real = 14 + +[61] +oper = 6 +begin = 17.06.2020 07:29:11 +norma = 35 +real = 40 + +[62] +oper = 7 +begin = 17.06.2020 08:09:19 +norma = 30 +real = 54 + +[63] +oper = 8 +begin = 17.06.2020 09:03:32 +norma = 40 +vac_time = 25 +real = 157 + +[64] +oper = 25 +begin = 17.06.2020 11:41:21 +norma = 30 +real = 9 + +[65] +oper = 9 +begin = 17.06.2020 11:50:23 +norma = 0 +real = 30 + +[66] +oper = 10 +begin = 17.06.2020 12:20:28 +norma = 0 +real = 249 + +[67] +oper = 11 +begin = 17.06.2020 16:29:30 +norma = 0 +real = 163 + +[68] +oper = 12 +begin = 17.06.2020 19:12:41 +norma = 105 +real = 109 + +[69] +oper = 13 +begin = 17.06.2020 21:02:20 +norma = 45 +real = 22 + +[70] +oper = 14 +begin = 17.06.2020 21:24:25 +norma = 40 +vac_time = 7 +real = 31 + +[71] +oper = 15 +begin = 17.06.2020 21:55:29 +norma = 30 +real = 21 + +[72] +oper = 16 +begin = 17.06.2020 22:16:51 +norma = 40 +real = 25 + +[73] +oper = 1 +begin = 17.06.2020 22:41:51 +norma = 85 +real = 36 + +[74] +oper = 8 +begin = 17.06.2020 23:17:52 +norma = 40 +vac_time = 8 +real = 206 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.117 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.117 new file mode 100644 index 0000000..b420a6d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.117 @@ -0,0 +1,40 @@ +00:01:14 1592334074 祭 ० +00:01:14 1592334074 ⪫祭 ॣ '-2'(A) +00:01:15 1592334075 祭 ॣ '-2'(A) +01:53:14 1592340794 ⪫祭 ॣ '-2'(A) +02:48:11 1592344091 ⪫祭 ० (A) +02:48:18 1592344098 ⪫祭 ० ' ⮪ 㣨' +02:49:27 1592344167 祭 ० ᪠ +02:49:28 1592344168 祭 ० ᪠ +02:51:36 1592344296 ⪫祭 ० ᪠ (A) +07:29:50 1592360990 祭 ० ᪠ +07:31:58 1592361118 ⪫祭 ० ᪠ (A) +11:27:22 1592375242 : 㦥 +11:40:34 1592376034 祭 ॣ '-2'(A) +11:41:11 1592376071 ⪫祭 ॣ '-2'(A) +11:42:16 1592376136 ' ' +11:42:16 1592376136 祭 +11:42:16 1592376136 祭 +11:43:16 1592376196 ⪫祭 +11:49:55 1592376595 祭 ० ࠧ +11:49:58 1592376598 祭 ० ' ⮪ 㣨' +11:50:24 1592376624 : 믮 +12:06:59 1592377619 祭 ॣ '-2'(A) +12:20:27 1592378427 祭 ⠭ ॣ +12:20:28 1592378428 ⪫祭 ० ࠧ (A) +16:29:30 1592393370 祭 ० +16:29:30 1592393370 ⪫祭 ॣ '-2'(A) +16:29:31 1592393371 祭 ॣ '-2'(A) +17:25:31 1592396731 ⪫祭 ॣ '-2'(A) +19:12:33 1592403153 ⪫祭 ० (A) +19:12:34 1592403154 ⪫祭 +19:12:34 1592403154 : +19:12:39 1592403159 '⪫ ' +19:12:42 1592403162 ⪫祭 ० ' ⮪ 㣨' +19:12:50 1592403170 祭 ० ᪠ +19:15:03 1592403303 ⪫祭 ० ᪠ (A) +19:42:34 1592404954 : 믮 +21:57:34 1592413054 祭 ॣ '-2' +22:16:55 1592414215 ⪫祭 ॣ '-2'(A) +22:17:01 1592414221 祭 ० ᪠ +22:19:11 1592414351 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.119 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.119 new file mode 100644 index 0000000..a5e06be Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.119 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.450 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.450 new file mode 100644 index 0000000..8353145 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.450 @@ -0,0 +1,3 @@ +12:12:13 1592377933 1 11434 3 37 4 2 9 4910 10 670 +17:54:11 1592398451 1 11434 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 770 8 3000 9 4910 10 670 11 12 320252 +18:27:51 1592400471 0 A--32-006-2018 ॢ 4 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.451 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.451 new file mode 100644 index 0000000..00f1021 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.451 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.452 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.452 new file mode 100644 index 0000000..9d0a896 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.452 @@ -0,0 +1,63 @@ +21 12:02:26 12:02:29 +Rsk= 17.7 Rkk= 14.1 + +22 12:50:01 13:05:05 +P1= 33.2 T1=13:00:05 P2= 45.3 T2=13:05:05 Vs= 2.41 + +21 15:04:08 15:04:11 +Rsk= 17.6 Rkk= 14.0 + +20 15:04:21 15:04:31 +Riz_sol= 4855.4 + +22 15:54:56 16:10:00 +P1= 34.5 T1=16:05:00 P2= 46.2 T2=16:10:00 Vs= 2.35 + +22 17:35:34 17:45:39 +P1= 11.1 T1=17:40:39 P2= 25.7 T2=17:45:39 Vs= 2.92 + +23 17:45:50 17:45:55 + + +24 17:46:09 17:46:45 + + +30 17:47:12 17:47:22 +Vst= 24.0 + +30 17:47:26 17:47:47 +Vst= 29.0 + +31 17:47:54 17:48:29 +Rom_sol= 13.4 + +41 17:49:21 17:49:26 +Ukz= 0.86 + +32 17:49:30 17:50:05 +Imax=26.8 Umax=55.1 T= 9.0 + +33 17:50:09 17:50:27 +Imin=15.8 Umin=25.0 T= 0.5 + +34 17:50:32 17:50:55 +V=300.2 T= 9.4 + +35 17:50:59 17:51:53 +Q= 53.6 T= 9.4 + +36 17:51:57 17:52:27 +P1=0.29 T= 2.9 + +37 17:52:32 17:53:03 +T= 0.9 + +38 17:53:06 17:53:12 +t= 51.6 T= 0.5 + +39 17:53:16 17:53:30 +tcam= 52.3 Tcam= 0.5 tfl= 52.7 Tfl= 0.5 + +40 17:53:34 17:53:41 +t= 51.7 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.453 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.453 new file mode 100644 index 0000000..4a941fe --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.453 @@ -0,0 +1,13 @@ +12 04:27:17 1592350037 +13 08:48:57 1592365737 +0 08:48:57 1592365737 +2 11:56:38 1592376998 +5 13:05:54 1592381154 +6 13:19:32 1592381972 +7 14:00:07 1592384407 +8 15:03:01 1592388181 +25 17:47:07 1592398027 +9 17:54:11 1592398451 +10 18:27:52 1592400472 +11 20:38:37 1592408317 +12 23:27:47 1592418467 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.454 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.454 new file mode 100644 index 0000000..c268f2b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.454 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.456 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.456 new file mode 100644 index 0000000..53b21f5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.456 @@ -0,0 +1,74 @@ +[11] +oper = 12 +begin = 17.06.2020 04:27:17 +norma = 180 +real = 261 + +[12] +oper = 13 +begin = 17.06.2020 08:48:57 +norma = 45 +real = 187 + +[13] +oper = 2 +begin = 17.06.2020 11:56:38 +norma = 110 +vac_time = 11 +real = 69 + +[14] +oper = 5 +begin = 17.06.2020 13:05:54 +norma = 25 +real = 13 + +[15] +oper = 6 +begin = 17.06.2020 13:19:32 +norma = 35 +real = 40 + +[16] +oper = 7 +begin = 17.06.2020 14:00:07 +norma = 30 +real = 62 + +[17] +oper = 8 +begin = 17.06.2020 15:03:01 +norma = 40 +vac_time = 9 +real = 164 + +[18] +oper = 25 +begin = 17.06.2020 17:47:07 +norma = 30 +real = 7 + +[19] +oper = 9 +begin = 17.06.2020 17:54:11 +norma = 0 +real = 33 + +[20] +oper = 10 +begin = 17.06.2020 18:27:52 +norma = 0 +real = 130 + +[21] +oper = 11 +begin = 17.06.2020 20:38:37 +norma = 0 +real = 169 + +[22] +oper = 12 +begin = 17.06.2020 23:27:47 +norma = 105 +real = 110 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.457 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.457 new file mode 100644 index 0000000..62429fa --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.457 @@ -0,0 +1,21 @@ +04:27:27 1592350047 ⪫祭 ॣ '-2'(A) +04:27:53 1592350073 祭 ० ᪠ +04:30:18 1592350218 ⪫祭 ० ᪠ (A) +13:19:55 1592381995 祭 ० ᪠ +13:22:19 1592382139 ⪫祭 ० ᪠ (A) +17:46:10 1592397970 祭 ॣ '-2'(A) +17:46:46 1592398006 ⪫祭 ॣ '-2'(A) +17:53:51 1592398431 祭 ० ࠧ +17:53:52 1592398432 祭 ० ' ⮪ 㣨' +18:13:51 1592399631 祭 ॣ '-2'(A) +18:27:51 1592400471 ⪫祭 ० ࠧ (A) +18:27:52 1592400472 祭 ⠭ ॣ +20:38:36 1592408316 祭 ० +20:38:37 1592408317 ⪫祭 ॣ '-2'(A) +20:38:38 1592408318 祭 ॣ '-2'(A) +21:40:37 1592412037 ⪫祭 ॣ '-2'(A) +23:27:39 1592418459 ⪫祭 ० (A) +23:27:41 1592418461 ⪫祭 ० ' ⮪ 㣨' +23:28:25 1592418505 祭 ० ᪠ +23:28:26 1592418506 祭 ० ᪠ +23:30:49 1592418649 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.459 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.459 new file mode 100644 index 0000000..90517fc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.459 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.480 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.480 new file mode 100644 index 0000000..263f197 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.480 @@ -0,0 +1,3 @@ +11:57:40 1592377060 1 02542 2 p. cao M1,M2,M3,M4 3 37 9 4950 10 670 +17:58:11 1592398691 1 02542 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 770 8 4780 9 4950 10 670 11 12 321692 +18:32:12 1592400732 0 A--32-006-2018 ॢ 4 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.481 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.481 new file mode 100644 index 0000000..33ff907 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.481 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.482 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.482 new file mode 100644 index 0000000..1196cf4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.482 @@ -0,0 +1,63 @@ +21 11:57:56 11:58:00 +Rsk= 66.3 Rkk= 56.4 + +22 12:50:48 13:05:53 +P1= 69.2 T1=13:00:53 P2= 85.6 T2=13:05:53 Vs= 3.28 + +22 13:10:37 13:25:42 +P1= 51.8 T1=13:20:42 P2= 64.6 T2=13:25:42 Vs= 2.56 + +21 15:00:42 15:00:45 +Rsk= 66.1 Rkk= 56.3 + +20 15:09:03 15:09:12 +Riz_sol= 1821.2 + +22 16:04:54 16:19:59 +P1= 50.0 T1=16:14:58 P2= 62.5 T2=16:19:59 Vs= 2.50 + +22 17:39:58 17:50:03 +P1= 32.4 T1=17:45:03 P2= 41.0 T2=17:50:03 Vs= 1.71 + +23 17:50:07 17:50:13 + + +24 17:50:16 17:50:55 + + +30 17:51:02 17:51:30 +Vst= 23.8 + +31 17:51:33 17:52:08 +Rom_sol= 7.1 + +41 17:52:42 17:52:47 +Ukz= 0.66 + +32 17:52:50 17:53:26 +Imax=26.8 Umax=55.0 T= 9.4 + +33 05:00:00 17:53:47 +Imin=15.8 Umin=25.0 T= 0.8 + +34 05:00:00 17:54:12 +V=300.2 T= 9.8 + +35 17:54:55 17:56:14 +Qkr= 52.4 Tkr= 9.7 Qpd= 0.0 Tpd= 0.0 + +40 17:56:17 17:56:24 +t= 52.3 T= 0.7 + +40 17:56:27 17:56:35 +t= 52.3 T= 0.7 + +39 17:56:27 17:56:35 +t= 52.3 T= 0.7 + +38 17:56:39 17:56:46 +t= 52.4 T= 0.7 + +36 05:00:00 17:57:44 +Pkr=0.29 Tkr= 2.9 Ppd=0.00 Tpd= 0.0 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.483 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.483 new file mode 100644 index 0000000..481e094 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.483 @@ -0,0 +1,14 @@ +11 03:46:10 1592347570 +12 06:33:08 1592357588 +13 08:20:09 1592364009 +0 08:20:09 1592364009 +2 11:53:05 1592376785 +5 13:26:30 1592382390 +6 13:37:41 1592383061 +7 14:09:06 1592384946 +8 14:57:49 1592387869 +25 17:51:00 1592398260 +9 17:58:11 1592398691 +10 18:32:12 1592400732 +11 20:42:35 1592408555 +12 23:31:41 1592418701 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.484 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.484 new file mode 100644 index 0000000..82ea145 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.484 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.485 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.485 new file mode 100644 index 0000000..a5b8b0e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.485 @@ -0,0 +1 @@ +47 17:56:25 1592398585 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.486 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.486 new file mode 100644 index 0000000..5e51871 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.486 @@ -0,0 +1,80 @@ +[80] +oper = 11 +begin = 17.06.2020 03:46:10 +norma = 0 +real = 166 + +[81] +oper = 12 +begin = 17.06.2020 06:33:08 +norma = 105 +real = 107 + +[82] +oper = 13 +begin = 17.06.2020 08:20:09 +norma = 45 +real = 212 + +[83] +oper = 2 +begin = 17.06.2020 11:53:05 +norma = 110 +vac_time = 30 +real = 93 + +[84] +oper = 5 +begin = 17.06.2020 13:26:30 +norma = 25 +real = 11 + +[85] +oper = 6 +begin = 17.06.2020 13:37:41 +norma = 35 +real = 31 + +[86] +oper = 7 +begin = 17.06.2020 14:09:06 +norma = 30 +real = 48 + +[87] +oper = 8 +begin = 17.06.2020 14:57:49 +norma = 40 +vac_time = 30 +real = 173 + +[88] +oper = 25 +begin = 17.06.2020 17:51:00 +norma = 30 +real = 7 + +[89] +oper = 9 +begin = 17.06.2020 17:58:11 +norma = 0 +real = 34 + +[90] +oper = 10 +begin = 17.06.2020 18:32:12 +norma = 0 +real = 130 + +[91] +oper = 11 +begin = 17.06.2020 20:42:35 +norma = 0 +real = 169 + +[92] +oper = 12 +begin = 17.06.2020 23:31:41 +norma = 105 +real = 112 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.487 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.487 new file mode 100644 index 0000000..939b216 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.487 @@ -0,0 +1,26 @@ +03:46:10 1592347570 祭 ० +03:46:11 1592347571 ⪫祭 ॣ '-2'(A) +03:46:12 1592347572 祭 ॣ '-2'(A) +05:38:11 1592354291 ⪫祭 ॣ '-2'(A) +06:33:07 1592357587 ⪫祭 ० (A) +06:33:08 1592357588 ⪫祭 ० ' ⮪ 㣨' +06:33:31 1592357611 祭 ० ᪠ +06:36:05 1592357765 ⪫祭 ० ᪠ (A) +13:37:50 1592383070 祭 ० ᪠ +13:37:50 1592383070 祭 ० ᪠ +13:40:24 1592383224 ⪫祭 ० ᪠ (A) +17:50:18 1592398218 祭 ॣ '-2'(A) +17:50:55 1592398255 ⪫祭 ॣ '-2'(A) +17:57:56 1592398676 祭 ० ࠧ +17:57:58 1592398678 祭 ० ' ⮪ 㣨' +18:18:11 1592399891 祭 ॣ '-2'(A) +18:32:12 1592400732 祭 ⠭ ॣ +18:32:12 1592400732 ⪫祭 ० ࠧ (A) +20:42:34 1592408554 祭 ० +20:42:35 1592408555 ⪫祭 ॣ '-2'(A) +20:42:36 1592408556 祭 ॣ '-2'(A) +21:44:36 1592412276 ⪫祭 ॣ '-2'(A) +23:31:37 1592418697 ⪫祭 ० (A) +23:31:39 1592418699 ⪫祭 ० ' ⮪ 㣨' +23:32:00 1592418720 祭 ० ᪠ +23:34:32 1592418872 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200617.489 b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.489 new file mode 100644 index 0000000..5490294 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200617.489 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.340 new file mode 100644 index 0000000..5ba12fc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.340 @@ -0,0 +1,4 @@ +09:36:25 1592454985 1 09606 2 BT 3-1, 6, 8, 9, 14, 15, 16 4 2 9 4000 10 690 +12:49:32 1592466572 1 09606 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4350 9 4000 10 690 11 12 321752 +13:32:06 1592469126 0 A--32-031-2016 ॢ 5 +23:28:11 1592504891 1 09607 2 BT 18, 20, 22, 23, 25 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.341 new file mode 100644 index 0000000..1a763ac Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.342 new file mode 100644 index 0000000..b24c4d2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.342 @@ -0,0 +1,57 @@ +20 09:36:41 09:36:50 +Riz_sol= 1996.5 + +21 09:36:57 09:37:00 +Rsk= 17.2 Rkk= 16.7 + +22 10:14:36 10:30:05 +P1= 42.9 T1=10:25:05 P2= 53.4 T2=10:30:05 Vs= 2.10 + +22 12:29:41 12:40:09 +P1= 27.7 T1=12:35:09 P2= 33.6 T2=12:40:09 Vs= 1.18 + +23 12:40:21 12:40:26 + + +24 12:40:35 12:41:16 + + +30 12:41:31 12:41:57 +Vst= 30.8 + +31 12:43:05 12:43:40 +Rom_sol= 11.1 + +32 12:44:04 12:44:41 +Imax=11.0 Umax=50.0 T= 9.0 + +33 12:44:45 12:45:08 +Imin=16.0 Umin=25.0 T= 0.5 + +34 12:45:11 12:45:36 +V=300.5 T= 9.4 + +35 12:45:40 12:46:39 +Q= 53.0 T= 9.5 + +36 12:46:43 12:47:16 +P1=0.28 T= 3.0 + +37 12:47:20 12:47:45 +T= 1.0 + +38 12:47:48 12:47:57 +t= 52.0 T= 0.6 + +39 12:48:00 12:48:08 +t= 51.7 T= 0.6 + +40 12:48:11 12:48:20 +t= 51.9 T= 0.6 + +20 23:21:17 23:21:26 +Riz_sol= 2044.8 + +21 23:21:38 23:21:41 +Rsk= 17.2 Rkk= 16.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.343 new file mode 100644 index 0000000..45e252f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.343 @@ -0,0 +1,12 @@ +12 03:45:38 1592433938 +13 08:06:28 1592449588 +0 08:06:28 1592449588 +8 09:32:49 1592454769 +25 12:41:27 1592466087 +9 12:49:32 1592466572 +10 13:32:06 1592469126 +11 16:40:14 1592480414 +12 19:27:17 1592490437 +13 21:14:35 1592496875 +0 21:14:35 1592496875 +8 23:14:08 1592504048 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.344 new file mode 100644 index 0000000..22c3ae8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.346 new file mode 100644 index 0000000..03e8e6c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.346 @@ -0,0 +1,62 @@ +[94] +oper = 12 +begin = 18.06.2020 03:45:38 +norma = 180 +real = 260 + +[95] +oper = 13 +begin = 18.06.2020 08:06:28 +norma = 45 +real = 86 + +[96] +oper = 8 +begin = 18.06.2020 09:32:49 +norma = 40 +vac_time = 9 +real = 188 + +[97] +oper = 25 +begin = 18.06.2020 12:41:27 +norma = 30 +real = 8 + +[98] +oper = 9 +begin = 18.06.2020 12:49:32 +norma = 0 +real = 42 + +[99] +oper = 10 +begin = 18.06.2020 13:32:06 +norma = 0 +real = 188 + +[00] +oper = 11 +begin = 18.06.2020 16:40:14 +norma = 0 +real = 167 + +[01] +oper = 12 +begin = 18.06.2020 19:27:17 +norma = 105 +real = 107 + +[02] +oper = 13 +begin = 18.06.2020 21:14:35 +norma = 45 +real = 119 + +[03] +oper = 8 +begin = 18.06.2020 23:14:08 +norma = 40 +vac_time = 9 +real = 297 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.347 new file mode 100644 index 0000000..2c109ea --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.347 @@ -0,0 +1,19 @@ +03:45:41 1592433941 ⪫祭 ॣ '-2'(A) +03:46:48 1592434008 祭 ० ᪠ +03:49:15 1592434155 ⪫祭 ० ᪠ (A) +12:40:36 1592466036 祭 ॣ '-2'(A) +12:41:17 1592466077 ⪫祭 ॣ '-2'(A) +12:48:30 1592466510 祭 ० ࠧ +12:48:32 1592466512 祭 ० ' ⮪ 㣨' +13:15:01 1592468101 祭 ॣ '-2'(A) +13:32:05 1592469125 祭 ⠭ ॣ +13:32:06 1592469126 ⪫祭 ० ࠧ (A) +16:40:13 1592480413 祭 ० +16:40:13 1592480413 ⪫祭 ॣ '-2'(A) +16:40:15 1592480415 祭 ॣ '-2'(A) +18:32:15 1592487135 ⪫祭 ॣ '-2'(A) +19:27:10 1592490430 ⪫祭 ० (A) +19:27:18 1592490438 ⪫祭 ० ' ⮪ 㣨' +19:28:36 1592490516 祭 ० ᪠ +19:28:36 1592490516 祭 ० ᪠ +19:31:01 1592490661 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.349 new file mode 100644 index 0000000..db067e3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.410 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.410 new file mode 100644 index 0000000..6875ed6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.410 @@ -0,0 +1,4 @@ +01:18:23 1592425103 1 11425 3 10 +04:24:55 1592436295 1 11425 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 10 4 3 5 Ti 6 7 770 8 4070 9 3880 10 705 11 12 321162 +05:22:07 1592439727 0 A--32-171-2018 ॢ 0 +21:15:05 1592496905 3 14 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.411 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.411 new file mode 100644 index 0000000..760e85c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.411 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.412 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.412 new file mode 100644 index 0000000..2c55fe0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.412 @@ -0,0 +1,63 @@ +21 01:18:42 01:18:46 +Rsk= 9.4 Rkk= 6.5 + +22 01:45:28 02:00:35 +P1= 44.9 T1=01:55:35 P2= 59.4 T2=02:00:35 Vs= 2.89 + +20 03:28:45 03:28:53 +Riz_sol= 4756.2 + +21 03:29:04 03:29:07 +Rsk= 9.2 Rkk= 6.4 + +22 04:06:07 04:16:14 +P1= 15.0 T1=04:11:14 P2= 28.5 T2=04:16:14 Vs= 2.70 + +23 04:16:25 04:16:31 + + +24 04:16:38 04:17:12 + + +30 04:17:34 04:17:59 +Vst= 31.6 + +31 04:18:11 04:18:45 +Rom_sol= 8.1 + +41 04:19:23 04:19:28 +Ukz= 1.00 + +32 04:19:31 04:20:13 +Imax=11.0 Umax=50.0 T= 9.0 + +33 04:20:16 04:20:41 +Imin= 8.0 Umin=17.9 T= 3.0 + +34 04:20:44 04:21:09 +V=300.3 T= 9.4 + +35 04:21:11 04:22:08 +Q= 51.1 T= 9.4 + +36 04:22:12 04:22:46 +P1=0.29 T= 3.0 + +37 04:22:50 04:23:14 +T= 1.0 + +38 04:23:18 04:23:26 +t= 51.9 T= 0.5 + +39 04:23:30 04:23:45 +tcam= 54.1 Tcam= 0.5 tfl= 54.8 Tfl= 0.6 + +40 04:23:48 04:23:56 +t= 52.0 T= 0.6 + +21 21:15:17 21:15:20 +Rsk= 8.9 Rkk= 6.0 + +22 21:39:14 21:49:21 +P1= 18.2 T1=21:44:21 P2= 33.3 T2=21:49:21 Vs= 3.03 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.413 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.413 new file mode 100644 index 0000000..9b89e69 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.413 @@ -0,0 +1,17 @@ +1 00:04:28 1592420668 +2 01:15:57 1592424957 +5 02:02:25 1592427745 +6 02:14:04 1592428444 +7 02:53:17 1592430797 +8 03:14:50 1592432090 +25 04:17:31 1592435851 +9 04:24:55 1592436295 +10 05:12:07 1592439127 +11 16:32:21 1592479941 +12 19:03:29 1592489009 +13 20:52:55 1592495575 +0 20:52:55 1592495575 +14 21:12:35 1592496755 +15 21:50:24 1592499024 +16 22:16:32 1592500592 +1 23:01:02 1592503262 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.414 new file mode 100644 index 0000000..4ae5adc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.415 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.415 new file mode 100644 index 0000000..7bdca1e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.415 @@ -0,0 +1 @@ +4 03:28:45 1592432925 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.416 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.416 new file mode 100644 index 0000000..d58cf78 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.416 @@ -0,0 +1,99 @@ +[75] +oper = 1 +begin = 18.06.2020 00:04:28 +norma = 85 +real = 71 + +[76] +oper = 2 +begin = 18.06.2020 01:15:57 +norma = 110 +vac_time = 8 +real = 46 + +[77] +oper = 5 +begin = 18.06.2020 02:02:25 +norma = 25 +real = 11 + +[78] +oper = 6 +begin = 18.06.2020 02:14:04 +norma = 35 +real = 39 + +[79] +oper = 7 +begin = 18.06.2020 02:53:17 +norma = 30 +real = 21 + +[80] +oper = 8 +begin = 18.06.2020 03:14:50 +norma = 40 +vac_time = 14 +real = 62 + +[81] +oper = 25 +begin = 18.06.2020 04:17:31 +norma = 30 +real = 7 + +[82] +oper = 9 +begin = 18.06.2020 04:24:55 +norma = 0 +real = 47 + +[83] +oper = 10 +begin = 18.06.2020 05:12:07 +norma = 0 +real = 680 + +[84] +oper = 11 +begin = 18.06.2020 16:32:21 +norma = 0 +real = 151 + +[85] +oper = 12 +begin = 18.06.2020 19:03:29 +norma = 105 +real = 109 + +[86] +oper = 13 +begin = 18.06.2020 20:52:55 +norma = 45 +real = 19 + +[87] +oper = 14 +begin = 18.06.2020 21:12:35 +norma = 40 +vac_time = 7 +real = 37 + +[88] +oper = 15 +begin = 18.06.2020 21:50:24 +norma = 30 +real = 26 + +[89] +oper = 16 +begin = 18.06.2020 22:16:32 +norma = 40 +real = 44 + +[90] +oper = 1 +begin = 18.06.2020 23:01:02 +norma = 85 +real = 104 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.417 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.417 new file mode 100644 index 0000000..308a622 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.417 @@ -0,0 +1,28 @@ +02:14:10 1592428450 祭 ० ᪠ +02:14:10 1592428450 祭 ० ᪠ +02:14:10 1592428450 祭 ० ᪠ +02:14:10 1592428450 祭 ० ᪠ +02:14:11 1592428451 祭 ० ᪠ +02:17:28 1592428648 ⪫祭 ० ᪠ (A) +04:16:40 1592435800 祭 ॣ '-2'(A) +04:17:14 1592435834 ⪫祭 ॣ '-2'(A) +04:24:09 1592436249 祭 ० ' ⮪ 㣨' +04:24:10 1592436250 祭 ० ࠧ +04:41:09 1592437269 祭 ॣ '-2'(A) +05:12:07 1592439127 ⪫祭 ० ࠧ (A) +05:12:07 1592439127 祭 ⠭ ॣ +05:22:08 1592439728 祭 ॣ ।. 60 ᥪ. 殮 㣨 +16:32:21 1592479941 祭 ० +16:32:22 1592479942 ⪫祭 ॣ '-2'(A) +19:03:27 1592489007 ⪫祭 ० (A) +19:03:30 1592489010 ⪫祭 ० ' ⮪ 㣨' +19:08:06 1592489286 祭 ० ᪠ +19:10:41 1592489441 ⪫祭 ० ᪠ (A) +21:49:52 1592498992 祭 ० ࠧ +21:50:26 1592499026 祭 ० ' ⮪ 㣨' +21:50:27 1592499027 祭 ॣ '-2'(A) +22:15:25 1592500525 ⪫祭 ० ' ⮪ 㣨' +22:15:31 1592500531 ⪫祭 ० ࠧ (A) +22:16:36 1592500596 ⪫祭 ॣ '-2'(A) +22:17:32 1592500652 祭 ० ᪠ +22:20:48 1592500848 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.419 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.419 new file mode 100644 index 0000000..44e693a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.419 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.480 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.480 new file mode 100644 index 0000000..9331581 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.480 @@ -0,0 +1,7 @@ +04:39:20 1592437160 1 02543 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 9 4960 10 690 +05:58:03 1592441883 1 02543 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4780 9 4960 10 690 11 12 321692 +06:41:02 1592444462 0 A--32-031-2016 ॢ 5 +17:09:06 1592482146 1 02544 4 1 9 5290 10 650 12 1718 +22:09:15 1592500155 1 02544 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4780 9 5290 10 650 11 12 1718 +22:17:36 1592500656 1 02544 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4780 9 5290 10 650 11 12 1718 +22:50:26 1592502626 0 A--32-129-2018 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.481 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.481 new file mode 100644 index 0000000..2e5e175 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.481 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.482 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.482 new file mode 100644 index 0000000..9651b54 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.482 @@ -0,0 +1,111 @@ +20 04:38:16 04:38:25 +Riz_sol= 1498.2 + +21 04:38:30 04:38:33 +Rsk= 66.5 Rkk= 56.7 + +22 05:34:43 05:49:48 +P1= 53.2 T1=05:44:48 P2= 66.0 T2=05:49:48 Vs= 2.56 + +23 05:49:54 05:49:59 + + +24 05:50:03 05:50:43 + + +30 05:50:58 05:51:22 +Vst= 23.6 + +31 05:51:24 05:52:00 +Rom_sol= 6.9 + +32 05:52:40 05:53:16 +Imax=10.9 Umax=50.0 T= 9.3 + +33 05:53:19 05:53:37 +Imin=15.8 Umin=25.0 T= 0.8 + +34 05:00:00 05:54:04 +V=300.1 T= 9.7 + +35 05:54:07 05:55:28 +Qkr= 53.0 Tkr= 9.8 Qpd= 0.0 Tpd= 0.0 + +40 05:55:32 05:55:40 +t= 52.3 T= 0.8 + +39 05:55:43 05:55:50 +t= 51.7 T= 0.8 + +38 05:55:53 05:56:00 +t= 52.1 T= 0.8 + +37 05:56:03 05:56:31 +T= 1.3 + +36 05:56:34 05:57:29 +Pkr=0.29 Tkr= 2.8 Ppd=0.00 Tpd= 0.0 + +21 17:07:59 17:08:02 +Rsk= 67.8 Rkk= 57.6 + +22 18:08:13 18:23:18 +P1= 58.7 T1=18:18:18 P2= 72.6 T2=18:23:18 Vs= 2.77 + +20 19:20:57 19:21:05 +Riz_sol= 1700.1 + +21 19:21:12 19:21:15 +Rsk= 67.7 Rkk= 57.3 + +22 20:15:31 20:30:36 +P1= 59.7 T1=20:25:36 P2= 70.8 T2=20:30:36 Vs= 2.22 + +23 20:31:08 20:31:13 + + +24 20:31:22 20:32:00 + + +22 21:35:15 21:45:19 +P1= 23.1 T1=21:40:19 P2= 31.3 T2=21:45:19 Vs= 1.65 + +23 21:45:35 21:45:40 + + +24 21:45:58 21:46:33 + + +30 21:47:16 21:48:40 +Vst= 23.4 + +31 21:48:53 21:49:29 +Rom_sol= 7.2 + +41 21:50:09 21:50:14 +Ukz= 1.79 + +32 21:50:16 21:50:53 +Imax=10.9 Umax=50.0 T= 9.3 + +32 21:51:11 21:51:47 +Imax=10.9 Umax=50.0 T= 9.3 + +33 05:00:00 21:52:10 +Imin=15.8 Umin=25.0 T= 0.8 + +35 21:52:51 21:54:11 +Qkr= 54.9 Tkr= 9.7 Qpd= 0.0 Tpd= 0.0 + +40 21:54:13 21:54:21 +t= 52.3 T= 0.9 + +38 21:54:40 21:54:47 +t= 52.3 T= 0.6 + +37 05:00:00 21:55:35 +T= 0.9 + +36 21:55:49 21:56:47 +Pkr=0.30 Tkr= 3.0 Ppd=0.00 Tpd= 0.0 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.483 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.483 new file mode 100644 index 0000000..fcfc1db --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.483 @@ -0,0 +1,20 @@ +13 01:23:46 1592425426 +0 01:23:46 1592425426 +8 04:31:24 1592436684 +25 05:50:55 1592441455 +9 05:58:03 1592441883 +10 06:41:03 1592444463 +11 10:37:55 1592458675 +12 13:24:55 1592468695 +13 15:06:24 1592474784 +0 15:06:24 1592474784 +2 17:04:24 1592481864 +5 18:24:52 1592486692 +6 18:34:24 1592487264 +7 19:04:14 1592489054 +8 19:14:41 1592489681 +25 21:47:13 1592498833 +9 22:09:15 1592500155 +8 22:10:41 1592500241 +9 22:17:36 1592500656 +10 22:50:27 1592502627 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.484 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.484 new file mode 100644 index 0000000..b6f201d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.484 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.485 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.485 new file mode 100644 index 0000000..5190010 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.485 @@ -0,0 +1,32 @@ +47 21:50:53 1592499053 +47 21:51:08 1592499068 +47 21:52:33 1592499153 +47 21:52:37 1592499157 +47 21:52:38 1592499158 +47 21:52:39 1592499159 +80 21:52:39 1592499159 +80 21:52:40 1592499160 +80 21:52:41 1592499161 +80 21:52:42 1592499162 +80 21:52:42 1592499162 +80 21:52:43 1592499163 +80 21:52:43 1592499163 +80 21:52:44 1592499164 +80 21:52:44 1592499164 +80 21:52:45 1592499165 +80 21:52:45 1592499165 +80 21:52:45 1592499165 +80 21:52:46 1592499166 +80 21:52:46 1592499166 +80 21:52:46 1592499166 +80 21:52:47 1592499167 +80 21:52:47 1592499167 +80 21:52:48 1592499168 +80 21:52:48 1592499168 +80 21:52:49 1592499169 +80 21:52:49 1592499169 +80 21:52:49 1592499169 +80 21:52:49 1592499169 +80 21:52:50 1592499170 +80 21:52:50 1592499170 +80 21:52:50 1592499170 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.486 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.486 new file mode 100644 index 0000000..fd26d6d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.486 @@ -0,0 +1,111 @@ +[93] +oper = 13 +begin = 18.06.2020 01:23:46 +norma = 45 +real = 187 + +[94] +oper = 8 +begin = 18.06.2020 04:31:24 +norma = 40 +vac_time = 32 +real = 79 + +[95] +oper = 25 +begin = 18.06.2020 05:50:55 +norma = 30 +real = 7 + +[96] +oper = 9 +begin = 18.06.2020 05:58:03 +norma = 0 +real = 43 + +[97] +oper = 10 +begin = 18.06.2020 06:41:03 +norma = 0 +real = 236 + +[98] +oper = 11 +begin = 18.06.2020 10:37:55 +norma = 0 +real = 167 + +[99] +oper = 12 +begin = 18.06.2020 13:24:55 +norma = 105 +real = 101 + +[00] +oper = 13 +begin = 18.06.2020 15:06:24 +norma = 45 +real = 118 + +[01] +oper = 2 +begin = 18.06.2020 17:04:24 +norma = 110 +vac_time = 31 +real = 80 + +[02] +oper = 5 +begin = 18.06.2020 18:24:52 +norma = 25 +real = 9 + +[03] +oper = 6 +begin = 18.06.2020 18:34:24 +norma = 35 +real = 29 + +[04] +oper = 7 +begin = 18.06.2020 19:04:14 +norma = 30 +real = 10 + +[05] +oper = 8 +begin = 18.06.2020 19:14:41 +norma = 40 +vac_time = 30 +real = 152 + +[06] +oper = 25 +begin = 18.06.2020 21:47:13 +norma = 30 +real = 22 + +[07] +oper = 9 +begin = 18.06.2020 22:09:15 +norma = 0 +real = 1 + +[08] +oper = 8 +begin = 18.06.2020 22:10:41 +norma = 40 +real = 6 + +[09] +oper = 9 +begin = 18.06.2020 22:17:36 +norma = 0 +real = 32 + +[10] +oper = 10 +begin = 18.06.2020 22:50:27 +norma = 0 +real = 272 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.487 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.487 new file mode 100644 index 0000000..cd4fbc5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.487 @@ -0,0 +1,28 @@ +05:50:06 1592441406 祭 ॣ '-2'(A) +05:50:43 1592441443 ⪫祭 ॣ '-2'(A) +05:57:36 1592441856 祭 ० ࠧ +05:57:38 1592441858 祭 ० ' ⮪ 㣨' +06:23:58 1592443438 祭 ॣ '-2'(A) +06:41:02 1592444462 ⪫祭 ० ࠧ (A) +06:41:03 1592444463 祭 ⠭ ॣ +10:37:54 1592458674 祭 ० +10:37:55 1592458675 ⪫祭 ॣ '-2'(A) +10:37:56 1592458676 祭 ॣ '-2'(A) +12:29:55 1592465395 ⪫祭 ॣ '-2'(A) +13:24:52 1592468692 ⪫祭 ० (A) +13:24:53 1592468693 ⪫祭 ० ' ⮪ 㣨' +13:26:03 1592468763 祭 ० ᪠ +13:28:36 1592468916 ⪫祭 ० ᪠ (A) +18:34:44 1592487284 祭 ० ᪠ +18:34:44 1592487284 祭 ० ᪠ +18:34:45 1592487285 祭 ० ᪠ +18:38:42 1592487522 ⪫祭 ० ᪠ (A) +20:31:24 1592494284 祭 ॣ '-2'(A) +20:32:01 1592494321 ⪫祭 ॣ '-2'(A) +21:45:59 1592498759 祭 ॣ '-2'(A) +21:46:34 1592498794 ⪫祭 ॣ '-2'(A) +22:17:14 1592500634 祭 ० ' ⮪ 㣨' +22:17:23 1592500643 祭 ० ࠧ +22:18:29 1592500709 祭 ॣ '-2'(A) +22:50:26 1592502626 祭 ⠭ ॣ +22:50:26 1592502626 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200618.489 b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.489 new file mode 100644 index 0000000..7d7683c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200618.489 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.340 new file mode 100644 index 0000000..3b502c2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.340 @@ -0,0 +1,5 @@ +04:18:00 1592522280 1 09607 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 4350 9 4000 10 690 11 12 321752 +05:00:34 1592524834 0 A--32-031-2016 ॢ 5 +14:57:10 1592560630 1 09607 2 BT 3-1, 6, 8, 9, 14, 15, 16 7 840 9 4885 10 770 +15:56:48 1592564208 1 09608 +22:51:15 1592589075 1 09608 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 840 8 4350 9 4885 10 770 11 12 321752 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.341 new file mode 100644 index 0000000..6a9b947 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.342 new file mode 100644 index 0000000..271a099 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.342 @@ -0,0 +1,117 @@ +22 00:28:33 00:44:01 +P1= 98.5 T1=00:39:01 P2=132.0 T2=00:44:01 Vs= 6.70 + +22 01:34:26 01:49:54 +P1= 75.6 T1=01:44:54 P2=100.0 T2=01:49:54 Vs= 4.90 + +22 02:19:33 02:35:01 +P1= 64.8 T1=02:30:01 P2= 85.3 T2=02:35:01 Vs= 4.10 + +22 02:59:42 03:15:10 +P1= 57.8 T1=03:10:10 P2= 75.1 T2=03:15:10 Vs= 3.45 + +22 03:29:38 03:45:05 +P1= 53.4 T1=03:40:05 P2= 68.8 T2=03:45:05 Vs= 3.07 + +22 03:54:38 04:10:04 +P1= 50.3 T1=04:05:04 P2= 64.5 T2=04:10:04 Vs= 2.84 + +23 04:10:14 04:10:19 + + +24 04:10:28 04:11:06 + + +30 04:11:19 04:11:40 +Vst= 31.0 + +31 04:11:47 04:12:20 +Rom_sol= 11.2 + +32 04:12:48 04:13:24 +Imax=11.0 Umax=50.0 T= 9.0 + +33 04:13:29 04:13:49 +Imin=16.0 Umin=25.0 T= 0.5 + +34 04:13:53 04:14:15 +V=300.1 T= 9.5 + +35 04:14:19 04:15:16 +Q= 53.4 T= 9.4 + +36 04:15:22 04:15:54 +P1=0.29 T= 3.0 + +37 04:15:59 04:16:34 +T= 1.0 + +38 04:16:38 04:16:45 +t= 51.9 T= 0.6 + +39 04:16:50 04:16:57 +t= 51.7 T= 0.6 + +40 04:17:01 04:17:08 +t= 51.8 T= 0.6 + +21 14:55:56 14:55:59 +Rsk= 17.0 Rkk= 16.5 + +22 15:45:07 15:55:35 +P1= 21.2 T1=15:50:35 P2= 36.1 T2=15:55:35 Vs= 2.97 + +20 18:07:14 18:07:23 +Riz_sol= 2075.3 + +21 18:07:33 18:07:36 +Rsk= 16.9 Rkk= 16.4 + +22 18:37:46 18:53:14 +P1= 55.8 T1=18:48:14 P2= 68.8 T2=18:53:14 Vs= 2.61 + +22 22:20:10 22:30:37 +P1= 33.3 T1=22:25:37 P2= 38.6 T2=22:30:37 Vs= 1.06 + +23 22:30:46 22:30:51 + + +24 22:30:57 22:31:36 + + +30 22:31:49 22:32:16 +Vst= 30.8 + +31 22:32:22 22:32:57 +Rom_sol= 13.0 + +41 22:33:33 22:33:38 +Ukz= 1.10 + +32 22:33:41 22:34:17 +Imax=11.0 Umax=50.0 T= 9.0 + +33 22:34:20 22:34:41 +Imin=16.0 Umin=25.0 T= 0.5 + +34 22:34:44 22:35:07 +V=300.3 T= 9.5 + +35 22:35:10 22:36:06 +Q= 54.0 T= 9.4 + +36 22:36:09 22:36:43 +P1=0.29 T= 3.0 + +37 22:36:46 22:37:10 +T= 1.0 + +38 22:37:13 22:37:19 +t= 51.9 T= 0.6 + +39 22:37:22 22:37:29 +t= 51.7 T= 0.6 + +40 22:37:32 22:37:38 +t= 51.8 T= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.343 new file mode 100644 index 0000000..7f83d94 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.343 @@ -0,0 +1,15 @@ +25 04:11:14 1592521874 +9 04:18:00 1592522280 +10 05:00:34 1592524834 +11 08:07:36 1592536056 +12 10:54:40 1592546080 +13 12:44:35 1592552675 +0 12:44:35 1592552675 +2 14:52:36 1592560356 +5 16:19:46 1592565586 +6 16:31:06 1592566266 +7 17:15:09 1592568909 +8 18:06:24 1592571984 +25 22:31:45 1592587905 +9 22:51:15 1592589075 +10 23:33:05 1592591585 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.344 new file mode 100644 index 0000000..adeeec9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.346 new file mode 100644 index 0000000..d1e7e2e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.346 @@ -0,0 +1,86 @@ +[04] +oper = 25 +begin = 19.06.2020 04:11:14 +norma = 30 +real = 6 + +[05] +oper = 9 +begin = 19.06.2020 04:18:00 +norma = 0 +real = 42 + +[06] +oper = 10 +begin = 19.06.2020 05:00:34 +norma = 0 +real = 187 + +[07] +oper = 11 +begin = 19.06.2020 08:07:36 +norma = 0 +real = 167 + +[08] +oper = 12 +begin = 19.06.2020 10:54:40 +norma = 105 +real = 109 + +[09] +oper = 13 +begin = 19.06.2020 12:44:35 +norma = 45 +real = 128 + +[10] +oper = 2 +begin = 19.06.2020 14:52:36 +norma = 110 +vac_time = 9 +real = 87 + +[11] +oper = 5 +begin = 19.06.2020 16:19:46 +norma = 25 +real = 11 + +[12] +oper = 6 +begin = 19.06.2020 16:31:06 +norma = 35 +real = 44 + +[13] +oper = 7 +begin = 19.06.2020 17:15:09 +norma = 30 +real = 51 + +[14] +oper = 8 +begin = 19.06.2020 18:06:24 +norma = 40 +vac_time = 10 +real = 265 + +[15] +oper = 25 +begin = 19.06.2020 22:31:45 +norma = 30 +real = 19 + +[16] +oper = 9 +begin = 19.06.2020 22:51:15 +norma = 0 +real = 41 + +[17] +oper = 10 +begin = 19.06.2020 23:33:05 +norma = 0 +real = 232 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.347 new file mode 100644 index 0000000..4f4dacb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.347 @@ -0,0 +1,23 @@ +04:10:29 1592521829 祭 ॣ '-2'(A) +04:11:07 1592521867 ⪫祭 ॣ '-2'(A) +04:17:16 1592522236 祭 ० ࠧ +04:17:18 1592522238 祭 ० ' ⮪ 㣨' +04:43:30 1592523810 祭 ॣ '-2'(A) +05:00:34 1592524834 ⪫祭 ० ࠧ (A) +05:00:34 1592524834 祭 ⠭ ॣ +08:07:35 1592536055 祭 ० +08:07:37 1592536057 ⪫祭 ॣ '-2'(A) +08:07:38 1592536058 祭 ॣ '-2'(A) +09:59:38 1592542778 ⪫祭 ॣ '-2'(A) +10:54:33 1592546073 ⪫祭 ० (A) +10:54:41 1592546081 ⪫祭 ० ' ⮪ 㣨' +10:57:01 1592546221 祭 ० ᪠ +10:59:54 1592546394 ⪫祭 ० ᪠ (A) +16:14:56 1592565296 祭 ० ᪠ +16:15:24 1592565324 ⪫祭 ० ᪠ +16:31:26 1592566286 祭 ० ᪠ +16:34:19 1592566459 ⪫祭 ० ᪠ (A) +22:30:58 1592587858 祭 ॣ '-2'(A) +22:31:36 1592587896 ⪫祭 ॣ '-2'(A) +23:07:08 1592590028 祭 ॣ '-2' +23:33:05 1592591585 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.349 new file mode 100644 index 0000000..2de2a35 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.410 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.410 new file mode 100644 index 0000000..989bc58 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.410 @@ -0,0 +1,5 @@ +00:50:23 1592509823 1 11426 3 25 10 690 +01:39:31 1592512771 1 11426 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 3 5 Ti 6 7 770 8 4070 9 3880 10 690 11 12 321162 +02:21:59 1592515319 0 A--32-031-2016 ॢ 5 +12:06:29 1592550389 1 11427 2 p. cao M1,M2,M3,M4 3 37 4 2 7 870 9 4960 10 770 12 320542 +17:59:19 1592571559 1 11427 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 870 8 4070 9 4960 10 770 11 12 320542 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.411 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.411 new file mode 100644 index 0000000..e995c38 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.411 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.412 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.412 new file mode 100644 index 0000000..e52ca12 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.412 @@ -0,0 +1,111 @@ +20 00:51:00 00:51:09 +Riz_sol= 4758.6 + +21 00:51:27 00:51:30 +Rsk= 9.6 Rkk= 6.7 + +22 01:14:55 01:30:02 +P1= 45.3 T1=01:25:02 P2= 58.7 T2=01:30:02 Vs= 2.66 + +23 01:32:01 01:32:06 + + +24 01:32:12 01:32:46 + + +30 01:32:58 01:33:25 +Vst= 31.6 + +31 01:33:29 01:34:04 +Rom_sol= 7.9 + +32 01:34:40 01:35:17 +Imax=11.0 Umax=50.0 T= 9.0 + +33 01:35:20 01:35:42 +Imin=16.0 Umin=25.0 T= 0.5 + +34 01:35:46 01:36:09 +V=300.5 T= 9.4 + +35 01:36:11 01:37:08 +Q= 52.0 T= 9.4 + +36 01:37:11 01:37:46 +P1=0.29 T= 2.9 + +37 01:37:51 01:38:15 +T= 0.9 + +38 01:38:19 01:38:26 +t= 51.9 T= 0.5 + +39 01:38:29 01:38:44 +tcam= 54.3 Tcam= 0.5 tfl= 53.1 Tfl= 0.5 + +40 01:38:47 01:38:54 +t= 51.9 T= 0.5 + +21 12:04:53 12:04:56 +Rsk= 9.6 Rkk= 6.8 + +22 12:29:59 12:45:06 +P1= 40.2 T1=12:40:06 P2= 53.5 T2=12:45:06 Vs= 2.66 + +20 14:52:31 14:52:40 +Riz_sol=111600.6 + +21 14:52:46 14:52:49 +Rsk= 9.7 Rkk= 6.8 + +22 15:20:02 15:35:09 +P1= 49.2 T1=15:30:09 P2= 65.2 T2=15:35:09 Vs= 3.19 + +22 15:50:48 16:05:55 +P1= 33.3 T1=16:00:55 P2= 45.3 T2=16:05:55 Vs= 2.40 + +22 17:39:42 17:49:49 +P1= 7.7 T1=17:44:49 P2= 20.5 T2=17:49:49 Vs= 2.57 + +23 17:49:55 17:50:00 + + +24 17:50:05 17:50:39 + + +24 17:50:53 17:51:28 + + +30 17:51:47 17:52:15 +Vst= 30.9 + +31 17:52:21 17:53:00 +Rom_sol= 13.1 + +32 17:53:41 17:54:27 +Imax=27.0 Umax=55.0 T= 9.0 + +33 17:54:30 17:54:49 +Imin=16.0 Umin=25.0 T= 0.5 + +34 17:54:52 17:55:16 +V=300.1 T= 9.5 + +35 17:55:19 17:56:17 +Q= 51.9 T= 9.4 + +36 17:56:21 17:56:58 +P1=0.29 T= 3.0 + +37 17:57:09 17:57:35 +T= 0.9 + +38 17:57:38 17:57:45 +t= 51.9 T= 0.6 + +39 17:57:49 17:58:07 +tcam= 54.1 Tcam= 0.5 tfl= 56.7 Tfl= 0.5 + +40 17:58:11 17:58:17 +t= 51.9 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.413 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.413 new file mode 100644 index 0000000..8561f0b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.413 @@ -0,0 +1,17 @@ +8 00:45:26 1592509526 +25 01:32:58 1592512378 +9 01:39:31 1592512771 +10 02:21:59 1592515319 +11 05:20:17 1592526017 +12 08:07:19 1592536039 +13 09:55:40 1592542540 +0 09:55:40 1592542540 +2 11:54:04 1592549644 +5 12:45:52 1592552752 +6 12:58:35 1592553515 +7 13:35:05 1592555705 +8 14:50:19 1592560219 +25 17:51:46 1592571106 +9 17:59:19 1592571559 +10 18:36:34 1592573794 +11 20:59:29 1592582369 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.414 new file mode 100644 index 0000000..293733d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.415 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.415 new file mode 100644 index 0000000..2981d15 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.415 @@ -0,0 +1 @@ +29 17:50:41 1592571041 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.416 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.416 new file mode 100644 index 0000000..0809725 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.416 @@ -0,0 +1,99 @@ +[91] +oper = 8 +begin = 19.06.2020 00:45:26 +norma = 40 +vac_time = 8 +real = 47 + +[92] +oper = 25 +begin = 19.06.2020 01:32:58 +norma = 30 +real = 6 + +[93] +oper = 9 +begin = 19.06.2020 01:39:31 +norma = 0 +real = 42 + +[94] +oper = 10 +begin = 19.06.2020 02:21:59 +norma = 0 +real = 178 + +[95] +oper = 11 +begin = 19.06.2020 05:20:17 +norma = 0 +real = 167 + +[96] +oper = 12 +begin = 19.06.2020 08:07:19 +norma = 105 +real = 108 + +[97] +oper = 13 +begin = 19.06.2020 09:55:40 +norma = 45 +real = 118 + +[98] +oper = 2 +begin = 19.06.2020 11:54:04 +norma = 110 +vac_time = 11 +real = 51 + +[99] +oper = 5 +begin = 19.06.2020 12:45:52 +norma = 25 +real = 12 + +[00] +oper = 6 +begin = 19.06.2020 12:58:35 +norma = 35 +real = 36 + +[01] +oper = 7 +begin = 19.06.2020 13:35:05 +norma = 30 +real = 75 + +[02] +oper = 8 +begin = 19.06.2020 14:50:19 +norma = 40 +vac_time = 8 +real = 181 + +[03] +oper = 25 +begin = 19.06.2020 17:51:46 +norma = 30 +real = 7 + +[04] +oper = 9 +begin = 19.06.2020 17:59:19 +norma = 0 +real = 37 + +[05] +oper = 10 +begin = 19.06.2020 18:36:34 +norma = 0 +real = 142 + +[06] +oper = 11 +begin = 19.06.2020 20:59:29 +norma = 0 +real = 201 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.417 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.417 new file mode 100644 index 0000000..9737107 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.417 @@ -0,0 +1,23 @@ +01:32:15 1592512335 祭 ॣ '-2'(A) +01:32:49 1592512369 ⪫祭 ॣ '-2'(A) +01:39:06 1592512746 祭 ० ' ⮪ 㣨' +01:39:07 1592512747 祭 ० ࠧ +02:04:56 1592514296 祭 ॣ '-2'(A) +02:21:59 1592515319 ⪫祭 ० ࠧ (A) +02:22:00 1592515320 祭 ⠭ ॣ +05:20:16 1592526016 祭 ० +05:20:17 1592526017 ⪫祭 ॣ '-2'(A) +05:20:19 1592526019 祭 ॣ '-2'(A) +07:12:19 1592532739 ⪫祭 ॣ '-2'(A) +08:07:15 1592536035 ⪫祭 ० (A) +08:07:19 1592536039 ⪫祭 ० ' ⮪ 㣨' +08:07:53 1592536073 祭 ० ᪠ +08:11:07 1592536267 ⪫祭 ० ᪠ (A) +12:58:44 1592553524 祭 ० ᪠ +13:01:47 1592553707 ⪫祭 ० ᪠ (A) +17:50:09 1592571009 祭 ॣ '-2'(A) +17:50:42 1592571042 ⪫祭 ॣ '-2'(A) +17:50:56 1592571056 祭 ॣ '-2'(A) +17:51:30 1592571090 ⪫祭 ॣ '-2'(A) +18:07:08 1592572028 祭 ॣ '-2' +18:36:34 1592573794 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.419 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.419 new file mode 100644 index 0000000..a306907 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.419 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.480 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.480 new file mode 100644 index 0000000..d9226b2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.480 @@ -0,0 +1,3 @@ +10:34:37 1592544877 1 02545 2 p. cao M1,M2,M3,M4 3 37 4 2 9 4950 10 670 +17:38:36 1592570316 1 02545 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 770 8 4780 9 4950 10 670 11 12 1718 +18:12:36 1592572356 0 A--32-006-2018 ॢ 4 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.481 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.481 new file mode 100644 index 0000000..c161342 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.481 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.482 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.482 new file mode 100644 index 0000000..1cd2690 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.482 @@ -0,0 +1,60 @@ +21 10:34:54 10:34:57 +Rsk= 66.7 Rkk= 56.6 + +22 11:25:49 11:40:54 +P1= 68.7 T1=11:35:54 P2= 83.1 T2=11:40:54 Vs= 2.87 + +21 13:24:53 13:24:56 +Rsk= 66.6 Rkk= 56.3 + +20 13:26:30 13:26:39 +Riz_sol= 2231.0 + +22 14:26:02 14:41:07 +P1= 64.9 T1=14:36:07 P2= 77.3 T2=14:41:07 Vs= 2.48 + +22 17:19:55 17:30:00 +P1= 38.0 T1=17:25:00 P2= 45.9 T2=17:30:00 Vs= 1.58 + +23 17:30:10 17:30:15 + + +24 17:30:22 17:30:59 + + +30 17:31:11 17:31:37 +Vst= 23.6 + +31 17:31:41 17:32:16 +Rom_sol= 6.7 + +41 17:32:49 17:32:54 +Ukz= 0.68 + +32 17:32:58 17:33:35 +Imax=26.8 Umax=55.1 T= 9.4 + +33 17:33:40 17:33:59 +Imin=15.9 Umin=25.0 T= 0.8 + +34 17:34:03 17:34:26 +V=300.3 T= 9.6 + +35 17:34:30 17:35:52 +Qkr= 47.3 Tkr= 9.8 Qpd= 0.0 Tpd= 0.0 + +36 17:35:56 17:36:52 +Pkr=0.29 Tkr= 3.0 Ppd=0.00 Tpd= 0.0 + +37 17:36:56 17:37:22 +T= 1.0 + +38 17:37:26 17:37:34 +t= 52.3 T= 0.9 + +39 17:37:38 17:37:47 +t= 51.7 T= 0.9 + +40 17:37:52 17:38:00 +t= 52.3 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.483 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.483 new file mode 100644 index 0000000..fa0e9e8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.483 @@ -0,0 +1,13 @@ +12 03:22:53 1592518973 +13 07:43:13 1592534593 +0 07:43:13 1592534593 +2 10:25:53 1592544353 +5 11:42:20 1592548940 +6 11:53:26 1592549606 +7 12:27:13 1592551633 +8 13:21:34 1592554894 +25 17:31:08 1592569868 +9 17:38:36 1592570316 +10 18:12:37 1592572357 +11 20:20:36 1592580036 +12 23:09:43 1592590183 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.484 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.484 new file mode 100644 index 0000000..d6c6c2b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.484 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.486 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.486 new file mode 100644 index 0000000..ddf7ef9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.486 @@ -0,0 +1,74 @@ +[11] +oper = 12 +begin = 19.06.2020 03:22:53 +norma = 105 +real = 260 + +[12] +oper = 13 +begin = 19.06.2020 07:43:13 +norma = 45 +real = 162 + +[13] +oper = 2 +begin = 19.06.2020 10:25:53 +norma = 110 +vac_time = 31 +real = 76 + +[14] +oper = 5 +begin = 19.06.2020 11:42:20 +norma = 25 +real = 11 + +[15] +oper = 6 +begin = 19.06.2020 11:53:26 +norma = 35 +real = 33 + +[16] +oper = 7 +begin = 19.06.2020 12:27:13 +norma = 30 +real = 54 + +[17] +oper = 8 +begin = 19.06.2020 13:21:34 +norma = 40 +vac_time = 30 +real = 249 + +[18] +oper = 25 +begin = 19.06.2020 17:31:08 +norma = 30 +real = 7 + +[19] +oper = 9 +begin = 19.06.2020 17:38:36 +norma = 0 +real = 34 + +[20] +oper = 10 +begin = 19.06.2020 18:12:37 +norma = 0 +real = 127 + +[21] +oper = 11 +begin = 19.06.2020 20:20:36 +norma = 0 +real = 169 + +[22] +oper = 12 +begin = 19.06.2020 23:09:43 +norma = 105 +real = 110 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.487 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.487 new file mode 100644 index 0000000..94bc639 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.487 @@ -0,0 +1,28 @@ +03:05:41 1592517941 祭 ० +03:05:42 1592517942 ⪫祭 ॣ '-2'(A) +03:05:43 1592517943 祭 ॣ '-2'(A) +03:12:48 1592518368 ⪫祭 ० ' ⮪ 㣨' +03:22:57 1592518977 ⪫祭 ॣ '-2'(A) +03:23:20 1592519000 祭 ० ᪠ +03:23:20 1592519000 祭 ० ᪠ +03:23:20 1592519000 祭 ० ᪠ +03:26:32 1592519192 ⪫祭 ० ᪠ (A) +04:15:41 1592522141 ⪫祭 ० (A) +11:53:34 1592549614 祭 ० ᪠ +11:53:35 1592549615 祭 ० ᪠ +11:56:53 1592549813 ⪫祭 ० ᪠ (A) +17:30:23 1592569823 祭 ॣ '-2'(A) +17:31:00 1592569860 ⪫祭 ॣ '-2'(A) +17:38:09 1592570289 祭 ० ࠧ +17:38:11 1592570291 祭 ० ' ⮪ 㣨' +17:58:36 1592571516 祭 ॣ '-2'(A) +18:12:36 1592572356 ⪫祭 ० ࠧ (A) +18:12:37 1592572357 祭 ⠭ ॣ +20:20:35 1592580035 祭 ० +20:20:35 1592580035 ⪫祭 ॣ '-2'(A) +20:20:36 1592580036 祭 ॣ '-2'(A) +21:22:37 1592583757 ⪫祭 ॣ '-2'(A) +23:09:38 1592590178 ⪫祭 ० (A) +23:09:40 1592590180 ⪫祭 ० ' ⮪ 㣨' +23:10:21 1592590221 祭 ० ᪠ +23:13:41 1592590421 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200619.489 b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.489 new file mode 100644 index 0000000..c275ac5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200619.489 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.450 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.450 new file mode 100644 index 0000000..bef58f1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.450 @@ -0,0 +1,10 @@ +01:02:24 1592683344 3 14 +02:03:03 1592686983 0 A--32-067-2014 ॢ 0 +03:15:45 1592691345 1 11440 3 25 9 4500 10 670 +06:28:42 1592702922 1 11440 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3000 9 4500 10 670 11 12 320252 +06:57:20 1592704640 0 A--32-068-2019 ॢ 2 +15:42:17 1592736137 3 14 +18:32:35 1592746355 1 11441 3 25 9 4780 10 690 +18:32:55 1592746375 11 +19:21:00 1592749260 1 11441 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3000 9 4780 10 690 11 12 320252 +20:03:40 1592751820 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.451 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.451 new file mode 100644 index 0000000..656f95d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.451 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.452 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.452 new file mode 100644 index 0000000..08aa033 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.452 @@ -0,0 +1,117 @@ +21 01:02:10 01:02:13 +Rsk= 16.6 Rkk= 12.9 + +22 01:25:00 01:35:05 +P1= 12.8 T1=01:30:05 P2= 37.6 T2=01:35:05 Vs= 4.94 + +21 03:14:28 03:14:31 +Rsk= 16.9 Rkk= 13.2 + +22 03:40:04 03:55:08 +P1= 31.5 T1=03:50:08 P2= 41.4 T2=03:55:08 Vs= 1.98 + +21 05:41:13 05:41:16 +Rsk= 17.1 Rkk= 13.4 + +20 05:41:48 05:41:57 +Riz_sol= 4857.9 + +22 06:05:00 06:20:05 +P1= 40.5 T1=06:15:05 P2= 53.6 T2=06:20:05 Vs= 2.62 + +23 06:20:18 06:20:23 + + +24 06:20:29 06:21:06 + + +30 06:21:19 06:21:43 +Vst= 28.9 + +31 06:21:54 06:22:54 +Rom_sol= 13.4 + +41 06:23:20 06:23:25 +Ukz= 1.18 + +32 06:23:32 06:24:07 +Imax=10.9 Umax=50.1 T= 9.0 + +33 06:24:10 06:24:30 +Imin=15.8 Umin=24.9 T= 0.5 + +34 06:24:34 06:24:57 +V=300.1 T= 9.4 + +35 06:25:00 06:26:10 +Q= 53.3 T=12.4 + +36 06:26:14 06:26:44 +P1=0.29 T= 2.9 + +37 06:26:47 06:27:18 +T= 0.9 + +38 06:27:22 06:27:30 +t= 51.5 T= 0.5 + +39 06:27:33 06:27:50 +tcam= 52.3 Tcam= 0.5 tfl= 53.3 Tfl= 0.5 + +40 06:27:52 06:28:00 +t= 51.6 T= 0.5 + +21 15:42:29 15:42:32 +Rsk= 16.5 Rkk= 12.9 + +20 18:29:10 18:29:20 +Riz_sol= 4856.5 + +21 18:29:34 18:29:37 +Rsk= 16.7 Rkk= 12.9 + +23 19:11:42 19:11:47 + + +24 19:12:03 19:12:43 + + +30 19:13:14 19:13:40 +Vst= 28.9 + +31 19:13:50 19:14:27 +Rom_sol= 14.5 + +41 19:14:53 19:14:58 +Ukz= 1.19 + +32 19:15:02 19:15:27 +Imax= 0.0 Umax= 0.0 T= 0.0 + +32 19:15:33 19:16:09 +Imax=10.9 Umax=50.1 T= 9.0 + +33 19:16:12 19:16:39 +Imin=15.8 Umin=25.0 T= 0.5 + +34 19:16:47 19:17:12 +V=300.2 T= 9.4 + +35 19:17:15 19:18:08 +Q= 54.4 T= 9.4 + +36 19:18:13 19:18:45 +P1=0.29 T= 2.9 + +37 19:18:49 19:19:20 +T= 0.9 + +38 19:19:24 19:19:32 +t= 51.6 T= 0.5 + +39 19:19:36 19:19:51 +tcam= 52.3 Tcam= 0.5 tfl= 55.6 Tfl= 0.5 + +40 19:19:55 19:20:02 +t= 51.6 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.453 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.453 new file mode 100644 index 0000000..3a16cd7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.453 @@ -0,0 +1,27 @@ +13 00:26:14 1592681174 +0 00:26:14 1592681174 +14 00:59:52 1592683192 +15 01:36:20 1592685380 +16 02:06:12 1592687172 +1 02:51:00 1592689860 +2 03:11:45 1592691105 +5 03:55:54 1592693754 +6 04:07:01 1592694421 +7 04:48:21 1592696901 +8 05:38:26 1592699906 +25 06:21:17 1592702477 +9 06:28:42 1592702922 +10 06:57:20 1592704640 +11 10:58:09 1592719089 +12 13:41:54 1592728914 +13 15:25:17 1592735117 +0 15:25:17 1592735117 +14 15:39:13 1592735953 +15 16:18:05 1592738285 +16 16:41:34 1592739694 +1 17:23:04 1592742184 +8 18:22:33 1592745753 +25 19:13:12 1592748792 +9 19:21:00 1592749260 +10 20:03:40 1592751820 +11 23:52:47 1592765567 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.454 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.454 new file mode 100644 index 0000000..8a4d71d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.454 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.455 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.455 new file mode 100644 index 0000000..293c601 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.455 @@ -0,0 +1 @@ +52 19:15:28 1592748928 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.456 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.456 new file mode 100644 index 0000000..7ce9fd9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.456 @@ -0,0 +1,155 @@ +[90] +oper = 13 +begin = 21.06.2020 00:26:14 +norma = 45 +real = 33 + +[91] +oper = 14 +begin = 21.06.2020 00:59:52 +norma = 40 +vac_time = 8 +real = 36 + +[92] +oper = 15 +begin = 21.06.2020 01:36:20 +norma = 30 +real = 29 + +[93] +oper = 16 +begin = 21.06.2020 02:06:12 +norma = 40 +real = 44 + +[94] +oper = 1 +begin = 21.06.2020 02:51:00 +norma = 85 +real = 20 + +[95] +oper = 2 +begin = 21.06.2020 03:11:45 +norma = 110 +vac_time = 8 +real = 44 + +[96] +oper = 5 +begin = 21.06.2020 03:55:54 +norma = 25 +real = 11 + +[97] +oper = 6 +begin = 21.06.2020 04:07:01 +norma = 35 +real = 41 + +[98] +oper = 7 +begin = 21.06.2020 04:48:21 +norma = 30 +real = 50 + +[99] +oper = 8 +begin = 21.06.2020 05:38:26 +norma = 40 +vac_time = 8 +real = 42 + +[00] +oper = 25 +begin = 21.06.2020 06:21:17 +norma = 30 +real = 7 + +[01] +oper = 9 +begin = 21.06.2020 06:28:42 +norma = 0 +real = 28 + +[02] +oper = 10 +begin = 21.06.2020 06:57:20 +norma = 0 +real = 240 + +[03] +oper = 11 +begin = 21.06.2020 10:58:09 +norma = 0 +real = 163 + +[04] +oper = 12 +begin = 21.06.2020 13:41:54 +norma = 105 +real = 103 + +[05] +oper = 13 +begin = 21.06.2020 15:25:17 +norma = 45 +real = 13 + +[06] +oper = 14 +begin = 21.06.2020 15:39:13 +norma = 40 +vac_time = 8 +real = 38 + +[07] +oper = 15 +begin = 21.06.2020 16:18:05 +norma = 30 +real = 23 + +[08] +oper = 16 +begin = 21.06.2020 16:41:34 +norma = 40 +real = 41 + +[09] +oper = 1 +begin = 21.06.2020 17:23:04 +norma = 85 +real = 59 + +[10] +oper = 8 +begin = 21.06.2020 18:22:33 +norma = 40 +vac_time = 9 +real = 50 + +[11] +oper = 25 +begin = 21.06.2020 19:13:12 +norma = 30 +real = 7 + +[12] +oper = 9 +begin = 21.06.2020 19:21:00 +norma = 0 +real = 42 + +[13] +oper = 10 +begin = 21.06.2020 20:03:40 +norma = 0 +real = 229 + +[14] +oper = 11 +begin = 21.06.2020 23:52:47 +norma = 0 +real = 167 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.457 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.457 new file mode 100644 index 0000000..492e14a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.457 @@ -0,0 +1,56 @@ +01:35:56 1592685356 祭 ० ࠧ +01:35:58 1592685358 祭 ० ' ⮪ 㣨' +01:36:19 1592685379 祭 ॣ '-2'(A) +02:03:03 1592686983 ⪫祭 ० ࠧ (A) +02:06:13 1592687173 ⪫祭 ० ' ⮪ 㣨' +02:06:15 1592687175 ⪫祭 ॣ '-2'(A) +02:06:53 1592687213 祭 ० ᪠ +02:09:14 1592687354 ⪫祭 ० ᪠ (A) +03:15:52 1592691352 : 㦥 +04:07:13 1592694433 祭 ० ᪠ +04:09:34 1592694574 ⪫祭 ० ᪠ (A) +06:20:32 1592702432 祭 ॣ '-2'(A) +06:21:07 1592702467 ⪫祭 ॣ '-2'(A) +06:21:53 1592702513 ' ' +06:21:53 1592702513 祭 +06:21:55 1592702515 祭 +06:22:55 1592702575 ⪫祭 +06:28:10 1592702890 祭 ० ࠧ +06:28:13 1592702893 祭 ० ' ⮪ 㣨' +06:28:43 1592702923 : 믮 +06:45:19 1592703919 祭 ॣ '-2'(A) +06:57:20 1592704640 ⪫祭 ० ࠧ (A) +06:57:20 1592704640 祭 ॣ . 殮 㣨 +10:58:08 1592719088 祭 ० +10:58:09 1592719089 ⪫祭 ॣ '-2'(A) +10:58:10 1592719090 祭 ॣ '-2'(A) +11:48:10 1592722090 ⪫祭 ॣ '-2'(A) +13:41:52 1592728912 ⪫祭 ० (A) +13:41:53 1592728913 ⪫祭 +13:41:53 1592728913 : +13:41:56 1592728916 ⪫祭 ० ' ⮪ 㣨' +13:42:34 1592728954 祭 ० ᪠ +13:42:34 1592728954 祭 ० ᪠ +13:42:34 1592728954 祭 ० ᪠ +13:42:34 1592728954 祭 ० ᪠ +13:44:49 1592729089 ⪫祭 ० ᪠ (A) +14:11:53 1592730713 : 믮 +16:17:44 1592738264 祭 ० ࠧ +16:17:50 1592738270 祭 ० ' ⮪ 㣨' +16:18:53 1592738333 祭 ॣ '-2'(A) +16:41:04 1592739664 ⪫祭 ० ' ⮪ 㣨' +16:41:37 1592739697 ⪫祭 ॣ '-2'(A) +16:42:08 1592739728 祭 ० ᪠ +16:44:24 1592739864 ⪫祭 ० ᪠ (A) +18:32:38 1592746358 : 㦥 +18:32:57 1592746377 : +19:12:09 1592748729 祭 ॣ '-2'(A) +19:12:44 1592748764 ⪫祭 ॣ '-2'(A) +19:20:22 1592749222 祭 ० ࠧ +19:20:25 1592749225 祭 ० ' ⮪ 㣨' +19:46:35 1592750795 祭 ॣ '-2'(A) +20:03:40 1592751820 ⪫祭 ० ࠧ (A) +20:03:40 1592751820 祭 ⠭ ॣ +23:52:46 1592765566 祭 ० +23:52:47 1592765567 ⪫祭 ॣ '-2'(A) +23:52:48 1592765568 祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.459 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.459 new file mode 100644 index 0000000..55a6aef Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.459 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.480 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.480 new file mode 100644 index 0000000..f3ab0e8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.480 @@ -0,0 +1,4 @@ +14:12:12 1592730732 1 02547 +14:12:47 1592730767 4 2 9 4400 10 690 12 1718 +14:17:47 1592731067 1 02547 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 3950 9 4400 10 690 11 12 1718 +15:00:47 1592733647 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.481 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.481 new file mode 100644 index 0000000..b7ccc5f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.481 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.482 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.482 new file mode 100644 index 0000000..c26ffe0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.482 @@ -0,0 +1,60 @@ +20 08:29:22 08:29:31 +Riz_sol= 1884.2 + +21 08:29:50 08:29:53 +Rsk= 64.1 Rkk= 54.1 + +20 10:13:01 10:13:10 +Riz_sol= 1824.4 + +21 10:13:17 10:13:20 +Rsk= 63.1 Rkk= 53.6 + +22 12:26:48 12:41:53 +P1= 71.2 T1=12:36:53 P2= 91.4 T2=12:41:53 Vs= 4.04 + +22 13:07:00 13:22:05 +P1= 62.4 T1=13:17:05 P2= 79.1 T2=13:22:05 Vs= 3.35 + +22 13:33:28 13:48:33 +P1= 60.1 T1=13:43:33 P2= 75.4 T2=13:48:33 Vs= 3.07 + +22 13:54:30 14:09:35 +P1= 59.8 T1=14:04:35 P2= 74.1 T2=14:09:35 Vs= 2.87 + +23 14:09:42 14:09:47 + + +24 14:09:51 14:10:30 + + +30 14:10:43 14:11:12 +Vst= 23.4 + +31 14:11:17 14:11:52 +Rom_sol= 6.7 + +32 14:13:14 14:13:50 +Imax=10.9 Umax=50.1 T= 9.3 + +33 05:00:00 14:14:14 +Imin=15.9 Umin=25.0 T= 0.8 + +34 05:00:00 14:14:42 +V=300.3 T= 9.4 + +35 14:14:45 14:16:04 +Qkr= 54.5 Tkr= 9.5 Qpd= 0.0 Tpd= 0.0 + +40 14:16:07 14:16:15 +t= 52.2 T= 0.5 + +39 14:16:07 14:16:15 +t= 52.2 T= 0.5 + +38 14:16:19 14:16:27 +t= 52.2 T= 0.6 + +36 05:00:00 05:00:00 +Pkr=0.29 Tkr= 3.0 Ppd=0.00 Tpd= 0.0 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.483 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.483 new file mode 100644 index 0000000..10565a9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.483 @@ -0,0 +1,12 @@ +13 03:17:40 1592691460 +0 03:17:40 1592691460 +8 08:22:23 1592709743 +13 08:38:04 1592710684 +8 10:11:16 1592716276 +25 14:10:41 1592730641 +9 14:17:47 1592731067 +10 15:00:47 1592733647 +11 18:31:41 1592746301 +12 21:18:40 1592756320 +13 23:08:03 1592762883 +0 23:08:03 1592762883 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.484 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.484 new file mode 100644 index 0000000..3513c37 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.484 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.486 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.486 new file mode 100644 index 0000000..8bd8b65 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.486 @@ -0,0 +1,62 @@ +[33] +oper = 13 +begin = 21.06.2020 03:17:40 +norma = 45 +real = 304 + +[34] +oper = 8 +begin = 21.06.2020 08:22:23 +norma = 40 +real = 15 + +[35] +oper = 13 +begin = 21.06.2020 08:38:04 +norma = 45 +real = 93 + +[36] +oper = 8 +begin = 21.06.2020 10:11:16 +norma = 40 +vac_time = 32 +vac_avg10 = 30.6 +real = 239 + +[37] +oper = 25 +begin = 21.06.2020 14:10:41 +norma = 30 +real = 7 + +[38] +oper = 9 +begin = 21.06.2020 14:17:47 +norma = 0 +real = 43 + +[39] +oper = 10 +begin = 21.06.2020 15:00:47 +norma = 0 +real = 210 + +[40] +oper = 11 +begin = 21.06.2020 18:31:41 +norma = 0 +real = 166 + +[41] +oper = 12 +begin = 21.06.2020 21:18:40 +norma = 105 +real = 109 + +[42] +oper = 13 +begin = 21.06.2020 23:08:03 +norma = 45 +real = 175 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.487 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.487 new file mode 100644 index 0000000..76f81d9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.487 @@ -0,0 +1,16 @@ +00:00:04 1592679604 ⪫祭 ० (A) +14:09:54 1592730594 祭 ॣ '-2'(A) +14:10:31 1592730631 ⪫祭 ॣ '-2'(A) +14:17:36 1592731056 祭 ० ࠧ +14:17:38 1592731058 祭 ० ' ⮪ 㣨' +14:43:42 1592732622 祭 ॣ '-2'(A) +15:00:47 1592733647 祭 ⠭ ॣ +15:00:47 1592733647 ⪫祭 ० ࠧ (A) +18:31:40 1592746300 祭 ० +18:31:41 1592746301 ⪫祭 ॣ '-2'(A) +18:31:42 1592746302 祭 ॣ '-2'(A) +20:23:42 1592753022 ⪫祭 ॣ '-2'(A) +21:18:38 1592756318 ⪫祭 ० (A) +21:18:40 1592756320 ⪫祭 ० ' ⮪ 㣨' +21:19:00 1592756340 祭 ० ᪠ +21:22:18 1592756538 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200621.489 b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.489 new file mode 100644 index 0000000..b8388b2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200621.489 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.090 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.090 new file mode 100644 index 0000000..56d7dab --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.090 @@ -0,0 +1,4 @@ +02:17:07 1592774227 1 10040 2 p. cao M1,M2,M3,M4 3 25 4 1 5 Ti 6 7 770 8 4655 9 5890 10 650 11 12 321771 +13:58:39 1592816319 1 10041 2 BT 3-1, 6, 8, 9, 14, 15, 16 4 2 9 4920 10 690 12 321427 +23:00:10 1592848810 1 10041 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4655 9 4920 10 690 11 12 321427 +23:42:40 1592851360 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.091 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.091 new file mode 100644 index 0000000..00f5f2d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.091 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.092 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.092 new file mode 100644 index 0000000..da8d331 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.092 @@ -0,0 +1,99 @@ +20 00:49:44 00:49:52 +Riz_sol= 148.6 + +21 00:49:59 00:50:02 +Rsk= 28.1 Rkk= 24.8 + +22 01:54:17 02:04:24 +P1= 29.8 T1=01:59:24 P2= 43.0 T2=02:04:24 Vs= 2.64 + +23 02:07:31 02:07:37 + + +24 02:07:42 02:08:20 + + +30 02:08:30 02:09:09 +Vst= 29.4 + +31 02:09:17 02:09:51 +Rom_sol= 15.2 + +32 02:10:30 02:11:08 +Imax=11.0 Umax=50.0 T= 9.0 + +33 02:11:12 02:11:36 +Imin=16.0 Umin=25.0 T= 0.5 + +34 02:11:39 02:12:06 +V=300.1 T= 9.5 + +35 02:12:09 02:13:56 +Q= 52.4 T=12.4 + +36 02:14:00 02:14:39 +P1=0.30 T= 3.0 + +37 02:14:51 02:15:28 +T= 1.0 + +38 02:15:31 02:15:38 +t= 52.5 T= 0.6 + +39 02:15:41 02:15:52 +t= 54.1 T= 0.6 + +40 02:15:55 02:16:05 +t= 53.4 T= 0.6 + +20 13:54:59 13:55:07 +Riz_sol= 240.7 + +21 13:55:14 13:55:17 +Rsk= 28.3 Rkk= 24.9 + +22 14:34:54 14:45:01 +P1= 30.9 T1=14:40:01 P2= 42.5 T2=14:45:01 Vs= 2.32 + +22 22:35:09 22:45:16 +P1= 26.4 T1=22:40:16 P2= 30.2 T2=22:45:16 Vs= 0.76 + +23 22:50:37 22:50:42 + + +24 22:50:48 22:51:25 + + +30 22:51:38 22:52:06 +Vst= 29.4 + +31 22:52:17 22:53:00 +Rom_sol= 11.3 + +32 22:53:32 22:54:10 +Imax=11.0 Umax=50.0 T= 9.0 + +33 22:54:14 22:54:36 +Imin=16.0 Umin=25.0 T= 0.5 + +34 22:54:40 22:55:04 +V=300.2 T= 9.5 + +35 22:55:08 22:56:34 +Q= 54.0 T= 9.5 + +40 22:56:37 22:56:46 +t= 53.3 T= 0.6 + +39 22:56:49 22:56:57 +t= 54.0 T= 0.6 + +38 22:57:01 22:57:09 +t= 52.5 T= 0.6 + +37 22:57:13 22:57:50 +T= 1.0 + +36 22:57:53 22:58:37 +P1=0.29 T= 3.0 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.093 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.093 new file mode 100644 index 0000000..edc1f0a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.093 @@ -0,0 +1,11 @@ +8 00:46:53 1592768813 +25 02:08:28 1592773708 +9 02:17:07 1592774227 +10 02:43:25 1592775805 +12 07:55:37 1592794537 +13 12:10:47 1592809847 +0 12:10:47 1592809847 +8 13:48:19 1592815699 +25 22:51:34 1592848294 +9 23:00:10 1592848810 +10 23:42:40 1592851360 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.094 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.094 new file mode 100644 index 0000000..839a09b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.094 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.096 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.096 new file mode 100644 index 0000000..0a53b9c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.096 @@ -0,0 +1,62 @@ +[17] +oper = 8 +begin = 22.06.2020 00:46:53 +norma = 40 +vac_time = 8 +real = 81 + +[18] +oper = 25 +begin = 22.06.2020 02:08:28 +norma = 30 +real = 8 + +[19] +oper = 9 +begin = 22.06.2020 02:17:07 +norma = 0 +real = 26 + +[20] +oper = 10 +begin = 22.06.2020 02:43:25 +norma = 0 +real = 312 + +[21] +oper = 12 +begin = 22.06.2020 07:55:37 +norma = 180 +real = 255 + +[22] +oper = 13 +begin = 22.06.2020 12:10:47 +norma = 45 +real = 97 + +[23] +oper = 8 +begin = 22.06.2020 13:48:19 +norma = 40 +vac_time = 8 +real = 543 + +[24] +oper = 25 +begin = 22.06.2020 22:51:34 +norma = 30 +real = 8 + +[25] +oper = 9 +begin = 22.06.2020 23:00:10 +norma = 0 +real = 42 + +[26] +oper = 10 +begin = 22.06.2020 23:42:40 +norma = 0 +real = 240 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.097 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.097 new file mode 100644 index 0000000..24b3821 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.097 @@ -0,0 +1,12 @@ +02:07:44 1592773664 祭 ॣ '-2'(A) +02:08:21 1592773701 ⪫祭 ॣ '-2'(A) +02:39:18 1592775558 祭 ॣ '-2' +02:43:25 1592775805 祭 ⠭ ॣ +07:59:51 1592794791 ⪫祭 ॣ '-2'(A) +22:50:49 1592848249 祭 ॣ '-2'(A) +22:51:26 1592848286 ⪫祭 ॣ '-2'(A) +22:59:18 1592848758 祭 ० ࠧ +22:59:21 1592848761 祭 ० ' ⮪ 㣨' +23:25:36 1592850336 祭 ॣ '-2'(A) +23:42:40 1592851360 ⪫祭 ० ࠧ (A) +23:42:40 1592851360 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.099 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.099 new file mode 100644 index 0000000..8fd6da6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.099 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.170 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.170 new file mode 100644 index 0000000..9988d00 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.170 @@ -0,0 +1,7 @@ +00:30:21 1592767821 3 14 +03:26:31 1592778391 1 09228 2 p. cao M1,M2,M3,M4 3 37 7 1000 9 7870 10 920 +07:02:18 1592791338 1 09228 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 1000 8 4460 9 7870 10 920 11 12 321173 +07:46:41 1592794001 0 A--32-036-2011 ॢ 0 +18:44:14 1592833454 3 14 +20:13:26 1592838806 0 A--32-120-2016 ॢ 0 +23:49:43 1592851783 1 09229 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 7 770 9 4850 10 690 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.171 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.171 new file mode 100644 index 0000000..e21fadb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.171 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.172 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.172 new file mode 100644 index 0000000..f6485a2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.172 @@ -0,0 +1,75 @@ +21 00:30:30 00:30:38 +Rsk= 13.9 Rkk= 8.3 + +22 00:46:39 00:57:11 +P1= 22.1 T1=00:52:11 P2= 40.4 T2=00:57:11 Vs= 3.66 + +21 03:24:15 03:24:23 +Rsk= 14.0 Rkk= 8.3 + +22 03:49:07 04:04:38 +P1= 37.6 T1=03:59:38 P2= 47.7 T2=04:04:38 Vs= 2.01 + +20 05:54:37 05:54:47 +Riz_sol=12452.6 + +21 05:54:59 05:55:06 +Rsk= 14.2 Rkk= 8.6 + +22 06:24:28 06:40:00 +P1= 42.9 T1=06:35:00 P2= 54.8 T2=06:40:00 Vs= 2.38 + +23 06:52:55 06:53:01 + + +24 06:53:09 06:53:47 + + +30 06:54:05 06:54:47 +Vst= 29.0 + +31 06:54:52 06:55:31 +Rom_sol= 12.8 + +41 06:56:05 06:56:10 +Ukz= 0.50 + +32 06:56:16 06:57:26 +Imax=27.3 Umax=54.9 T= 9.4 + +33 06:57:31 06:58:00 +Imin=16.0 Umin=25.1 T= 0.8 + +34 06:58:03 06:58:31 +V=301.2 T= 9.7 + +35 06:58:33 06:59:35 +Q= 54.7 T= 9.1 + +36 06:59:40 07:00:16 +P1=0.20 T= 3.0 + +37 07:00:19 07:00:54 +T= 0.7 + +38 07:01:00 07:01:06 +t= 51.5 T= 0.7 + +39 07:01:09 07:01:15 +t= 51.4 T= 0.7 + +40 07:01:19 07:01:26 +t= 51.5 T= 0.7 + +21 18:43:48 18:43:56 +Rsk= 13.9 Rkk= 8.3 + +22 19:04:32 19:15:05 +P1= 16.8 T1=19:10:05 P2= 31.6 T2=19:15:05 Vs= 2.96 + +20 22:59:59 23:00:09 +Riz_sol=12608.0 + +21 23:00:16 23:00:23 +Rsk= 14.2 Rkk= 8.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.173 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.173 new file mode 100644 index 0000000..ed5af95 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.173 @@ -0,0 +1,22 @@ +14 00:25:14 1592767514 +15 01:00:14 1592769614 +16 01:20:55 1592770855 +1 02:17:56 1592774276 +2 03:15:24 1592777724 +5 04:05:15 1592780715 +6 04:17:47 1592781467 +7 04:49:16 1592783356 +8 05:52:02 1592787122 +25 06:54:02 1592790842 +9 07:02:18 1592791338 +10 07:46:41 1592794001 +11 11:28:10 1592807290 +12 15:37:13 1592822233 +13 18:15:34 1592831734 +0 18:15:34 1592831734 +14 18:41:02 1592833262 +15 19:16:41 1592835401 +16 20:13:26 1592838806 +16 20:15:30 1592838930 +1 20:58:37 1592841517 +8 22:56:59 1592848619 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.174 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.174 new file mode 100644 index 0000000..16f15cf Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.174 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.176 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.176 new file mode 100644 index 0000000..389a543 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.176 @@ -0,0 +1,132 @@ +[64] +oper = 14 +begin = 22.06.2020 00:25:14 +norma = 40 +vac_time = 7 +real = 35 + +[65] +oper = 15 +begin = 22.06.2020 01:00:14 +norma = 30 +real = 20 + +[66] +oper = 16 +begin = 22.06.2020 01:20:55 +norma = 40 +real = 57 + +[67] +oper = 1 +begin = 22.06.2020 02:17:56 +norma = 85 +real = 57 + +[68] +oper = 2 +begin = 22.06.2020 03:15:24 +norma = 110 +vac_time = 9 +vac_avg10 = 7.5 +real = 49 + +[69] +oper = 5 +begin = 22.06.2020 04:05:15 +norma = 25 +real = 12 + +[70] +oper = 6 +begin = 22.06.2020 04:17:47 +norma = 35 +real = 31 + +[71] +oper = 7 +begin = 22.06.2020 04:49:16 +norma = 30 +real = 62 + +[72] +oper = 8 +begin = 22.06.2020 05:52:02 +norma = 40 +vac_time = 7 +real = 62 + +[73] +oper = 25 +begin = 22.06.2020 06:54:02 +norma = 30 +real = 8 + +[74] +oper = 9 +begin = 22.06.2020 07:02:18 +norma = 0 +real = 44 + +[75] +oper = 10 +begin = 22.06.2020 07:46:41 +norma = 0 +real = 221 + +[76] +oper = 11 +begin = 22.06.2020 11:28:10 +norma = 0 +real = 249 + +[77] +oper = 12 +begin = 22.06.2020 15:37:13 +norma = 105 +real = 158 + +[78] +oper = 13 +begin = 22.06.2020 18:15:34 +norma = 45 +real = 25 + +[79] +oper = 14 +begin = 22.06.2020 18:41:02 +norma = 40 +vac_time = 7 +real = 35 + +[80] +oper = 15 +begin = 22.06.2020 19:16:41 +norma = 30 +real = 56 + +[81] +oper = 16 +begin = 22.06.2020 20:13:26 +norma = 40 +real = 2 + +[82] +oper = 16 +begin = 22.06.2020 20:15:30 +norma = 40 +real = 43 + +[83] +oper = 1 +begin = 22.06.2020 20:58:37 +norma = 85 +real = 118 + +[84] +oper = 8 +begin = 22.06.2020 22:56:59 +norma = 40 +vac_time = 7 +real = 70 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.177 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.177 new file mode 100644 index 0000000..4235f12 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.177 @@ -0,0 +1,49 @@ +01:00:21 1592769621 祭 ० ࠧ +01:00:24 1592769624 祭 ० ' ⮪ 㣨' +01:14:25 1592770465 ⪫祭 ० ' ⮪ 㣨' +01:19:00 1592770740 ⪫祭 ० ࠧ (A) +01:21:21 1592770881 祭 ० ᪠ +01:21:22 1592770882 祭 ० ᪠ +01:24:28 1592771068 ⪫祭 ० ᪠ (A) +04:18:07 1592781487 祭 ० ᪠ +04:21:11 1592781671 ⪫祭 ० ᪠ (A) +06:53:11 1592790791 祭 ॣ '-2'(A) +06:53:47 1592790827 ⪫祭 ॣ '-2'(A) +07:01:36 1592791296 祭 ० ࠧ +07:01:38 1592791298 祭 ० ' ⮪ 㣨' +07:04:42 1592791482 祭 ॣ '-2'(A) +07:46:41 1592794001 ⪫祭 ० ࠧ (A) +07:46:41 1592794001 祭 ⠭ ॣ +11:28:10 1592807290 祭 ० +11:28:11 1592807291 ⪫祭 ॣ '-2'(A) +11:28:12 1592807292 祭 ॣ '-2'(A) +15:37:09 1592822229 ⪫祭 ० (A) +15:37:15 1592822235 ⪫祭 ० ' ⮪ 㣨' +15:37:17 1592822237 ⪫祭 ॣ '-2'(A) +15:37:34 1592822254 祭 ० ᪠ +15:37:34 1592822254 祭 ० ᪠ +15:37:34 1592822254 祭 ० ᪠ +15:37:34 1592822254 祭 ० ᪠ +15:40:40 1592822440 ⪫祭 ० ᪠ (A) +19:15:46 1592835346 祭 ० ࠧ +19:15:48 1592835348 祭 ० ' ⮪ 㣨' +19:15:51 1592835351 ⪫祭 ० ' ⮪ 㣨' +19:15:56 1592835356 ⪫祭 ० ࠧ +19:15:58 1592835358 祭 ० ࠧ +19:16:01 1592835361 祭 ० ' ⮪ 㣨' +19:16:04 1592835364 ⪫祭 ० ' ⮪ 㣨' +19:16:06 1592835366 ⪫祭 ० ࠧ +19:16:12 1592835372 祭 ० ࠧ +19:16:14 1592835374 祭 ० ' ⮪ 㣨' +19:16:18 1592835378 ⪫祭 ० ' ⮪ 㣨' +19:16:21 1592835381 ⪫祭 ० ࠧ +19:16:27 1592835387 祭 ० ࠧ +19:16:29 1592835389 祭 ० ' ⮪ 㣨' +19:18:04 1592835484 祭 ॣ '-2'(A) +20:13:26 1592838806 ⪫祭 ० ࠧ (A) +20:15:31 1592838931 ⪫祭 ० ' ⮪ 㣨' +20:15:33 1592838933 ⪫祭 ॣ '-2'(A) +20:15:55 1592838955 祭 ० ᪠ +20:15:55 1592838955 祭 ० ᪠ +20:15:55 1592838955 祭 ० ᪠ +20:19:05 1592839145 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.179 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.179 new file mode 100644 index 0000000..e9f248c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.179 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.450 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.450 new file mode 100644 index 0000000..3d22c6a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.450 @@ -0,0 +1,5 @@ +05:59:16 1592787556 1 11442 2 p. cao M1,M2,M3,M4 3 37 9 3600 10 670 +11:18:52 1592806732 1 11442 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 770 8 3000 9 3600 10 670 11 12 320252 +11:52:33 1592808753 0 A--32-006-2018 ॢ 4 +18:25:33 1592832333 3 14 +20:53:12 1592841192 1 11443 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 7 870 9 6230 10 770 11 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.451 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.451 new file mode 100644 index 0000000..ebeafa6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.451 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.452 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.452 new file mode 100644 index 0000000..de246a9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.452 @@ -0,0 +1,84 @@ +21 05:55:56 05:55:59 +Rsk= 16.8 Rkk= 13.2 + +22 06:40:01 06:50:06 +P1= 7.9 T1=06:45:06 P2= 21.5 T2=06:50:06 Vs= 2.72 + +20 08:50:23 08:50:32 +Riz_sol= 4857.3 + +21 08:50:40 08:50:43 +Rsk= 16.8 Rkk= 13.1 + +22 09:14:03 09:29:07 +P1= 37.4 T1=09:24:07 P2= 49.6 T2=09:29:07 Vs= 2.44 + +22 10:57:47 11:07:51 +P1= 5.6 T1=11:02:51 P2= 12.2 T2=11:07:51 Vs= 1.34 + +23 11:09:47 11:09:52 + + +24 11:10:00 11:10:39 + + +30 11:11:02 11:11:25 +Vst= 28.7 + +30 11:11:41 11:12:11 +Vst= 28.7 + +31 11:12:30 11:13:05 +Rom_sol= 13.7 + +41 11:13:51 11:13:56 +Ukz= 0.79 + +32 11:13:59 11:14:34 +Imax=26.9 Umax=55.1 T= 9.0 + +33 11:14:37 11:14:57 +Imin=15.8 Umin=25.0 T= 0.5 + +34 11:15:01 11:15:24 +V=300.1 T= 9.4 + +35 11:15:28 11:16:22 +Q= 54.2 T= 9.4 + +36 11:16:26 11:16:55 +P1=0.29 T= 2.9 + +37 11:16:59 11:17:31 +T= 0.9 + +38 11:17:34 11:17:41 +t= 51.6 T= 0.5 + +39 11:17:45 11:18:00 +tcam= 52.3 Tcam= 0.5 tfl= 54.4 Tfl= 0.5 + +40 11:18:04 11:18:11 +t= 51.7 T= 0.5 + +21 18:25:40 18:25:43 +Rsk= 16.7 Rkk= 13.2 + +22 18:50:47 19:00:52 +P1= 11.4 T1=18:55:52 P2= 35.0 T2=19:00:52 Vs= 4.73 + +21 20:52:17 20:52:20 +Rsk= 16.9 Rkk= 13.1 + +22 21:19:00 21:34:05 +P1= 45.1 T1=21:29:05 P2= 61.6 T2=21:34:05 Vs= 3.31 + +22 21:41:48 21:56:53 +P1= 35.1 T1=21:51:53 P2= 48.3 T2=21:56:53 Vs= 2.63 + +20 23:18:32 23:18:42 +Riz_sol= 4856.8 + +21 23:18:47 23:18:50 +Rsk= 16.5 Rkk= 13.1 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.453 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.453 new file mode 100644 index 0000000..b525260 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.453 @@ -0,0 +1,24 @@ +12 02:39:49 1592775589 +13 04:35:26 1592782526 +0 04:35:26 1592782526 +2 05:51:46 1592787106 +5 06:51:10 1592790670 +6 07:04:47 1592791487 +7 07:46:01 1592793961 +8 08:45:02 1592797502 +25 11:10:59 1592806259 +9 11:18:52 1592806732 +10 11:52:33 1592808753 +11 13:21:51 1592814111 +12 16:10:57 1592824257 +13 17:59:26 1592830766 +0 17:59:27 1592830767 +14 18:23:31 1592832211 +15 19:01:53 1592834513 +16 19:32:05 1592836325 +1 20:11:59 1592838719 +2 20:49:25 1592840965 +5 21:57:44 1592845064 +6 22:10:06 1592845806 +7 22:46:47 1592848007 +8 23:15:06 1592849706 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.454 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.454 new file mode 100644 index 0000000..5373292 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.454 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.456 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.456 new file mode 100644 index 0000000..c7c36ef --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.456 @@ -0,0 +1,138 @@ +[15] +oper = 12 +begin = 22.06.2020 02:39:49 +norma = 105 +real = 115 + +[16] +oper = 13 +begin = 22.06.2020 04:35:26 +norma = 45 +real = 76 + +[17] +oper = 2 +begin = 22.06.2020 05:51:46 +norma = 110 +vac_time = 9 +real = 59 + +[18] +oper = 5 +begin = 22.06.2020 06:51:10 +norma = 25 +real = 13 + +[19] +oper = 6 +begin = 22.06.2020 07:04:47 +norma = 35 +real = 41 + +[20] +oper = 7 +begin = 22.06.2020 07:46:01 +norma = 30 +real = 59 + +[21] +oper = 8 +begin = 22.06.2020 08:45:02 +norma = 40 +vac_time = 9 +real = 145 + +[22] +oper = 25 +begin = 22.06.2020 11:10:59 +norma = 30 +real = 7 + +[23] +oper = 9 +begin = 22.06.2020 11:18:52 +norma = 0 +real = 33 + +[24] +oper = 10 +begin = 22.06.2020 11:52:33 +norma = 0 +real = 89 + +[25] +oper = 11 +begin = 22.06.2020 13:21:51 +norma = 0 +real = 169 + +[26] +oper = 12 +begin = 22.06.2020 16:10:57 +norma = 105 +real = 108 + +[27] +oper = 13 +begin = 22.06.2020 17:59:26 +norma = 45 +real = 24 + +[28] +oper = 14 +begin = 22.06.2020 18:23:31 +norma = 40 +vac_time = 8 +vac_avg10 = 8.5 +real = 38 + +[29] +oper = 15 +begin = 22.06.2020 19:01:53 +norma = 30 +real = 30 + +[30] +oper = 16 +begin = 22.06.2020 19:32:05 +norma = 40 +real = 39 + +[31] +oper = 1 +begin = 22.06.2020 20:11:59 +norma = 85 +real = 37 + +[32] +oper = 2 +begin = 22.06.2020 20:49:25 +norma = 110 +vac_time = 9 +real = 68 + +[33] +oper = 5 +begin = 22.06.2020 21:57:44 +norma = 25 +real = 12 + +[34] +oper = 6 +begin = 22.06.2020 22:10:06 +norma = 35 +real = 36 + +[35] +oper = 7 +begin = 22.06.2020 22:46:47 +norma = 30 +real = 28 + +[36] +oper = 8 +begin = 22.06.2020 23:15:06 +norma = 40 +vac_time = 8 +real = 48 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.457 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.457 new file mode 100644 index 0000000..c78f0d2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.457 @@ -0,0 +1,32 @@ +01:44:48 1592772288 ⪫祭 ॣ '-2'(A) +02:39:44 1592775584 ⪫祭 ० (A) +02:39:50 1592775590 ⪫祭 ० ' ⮪ 㣨' +02:40:47 1592775647 祭 ० ᪠ +02:43:07 1592775787 ⪫祭 ० ᪠ (A) +07:04:59 1592791499 祭 ० ᪠ +07:07:19 1592791639 ⪫祭 ० ᪠ (A) +11:10:02 1592806202 祭 ॣ '-2'(A) +11:10:40 1592806240 ⪫祭 ॣ '-2'(A) +11:18:22 1592806702 祭 ० ࠧ +11:18:24 1592806704 祭 ० ' ⮪ 㣨' +11:38:32 1592807912 祭 ॣ '-2'(A) +11:52:32 1592808752 祭 ⠭ ॣ +11:52:33 1592808753 ⪫祭 ० ࠧ (A) +13:21:51 1592814111 祭 ० +13:21:52 1592814112 ⪫祭 ॣ '-2'(A) +13:21:53 1592814113 祭 ॣ '-2'(A) +14:23:53 1592817833 ⪫祭 ॣ '-2'(A) +16:10:55 1592824255 ⪫祭 ० (A) +16:10:57 1592824257 ⪫祭 ० ' ⮪ 㣨' +16:11:24 1592824284 祭 ० ᪠ +16:13:40 1592824420 ⪫祭 ० ᪠ (A) +19:01:24 1592834484 祭 ० ࠧ +19:01:25 1592834485 祭 ० ' ⮪ 㣨' +19:01:54 1592834514 祭 ॣ '-2'(A) +19:31:56 1592836316 ⪫祭 ० ' ⮪ 㣨' +19:32:15 1592836335 祭 ० ᪠ +19:34:35 1592836475 ⪫祭 ० ᪠ (A) +19:34:55 1592836495 ⪫祭 ॣ '-2'(A) +20:53:14 1592841194 : 㦥 +22:10:15 1592845815 祭 ० ᪠ +22:12:34 1592845954 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.459 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.459 new file mode 100644 index 0000000..2707c7a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.459 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.480 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.480 new file mode 100644 index 0000000..7ccbb39 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.480 @@ -0,0 +1,3 @@ +02:17:38 1592774258 1 02548 2 BT 3-1, 6, 8, 9, 14, 15, 16 9 4830 +06:28:48 1592789328 1 02548 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3950 9 4830 10 690 11 12 1718 +07:11:48 1592791908 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.481 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.481 new file mode 100644 index 0000000..58deeb3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.481 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.482 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.482 new file mode 100644 index 0000000..3d1ccfc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.482 @@ -0,0 +1,57 @@ +20 02:17:58 02:18:07 +Riz_sol= 2412.0 + +21 02:18:16 02:18:19 +Rsk= 63.7 Rkk= 53.6 + +22 03:42:02 03:57:07 +P1=104.4 T1=03:52:07 P2=136.1 T2=03:57:07 Vs= 6.34 + +22 05:15:06 05:30:11 +P1= 64.5 T1=05:25:11 P2= 82.1 T2=05:30:11 Vs= 3.54 + +22 05:45:04 06:00:09 +P1= 59.9 T1=05:55:09 P2= 75.3 T2=06:00:09 Vs= 3.07 + +22 06:05:01 06:20:06 +P1= 57.6 T1=06:15:06 P2= 72.1 T2=06:20:06 Vs= 2.90 + +23 06:20:14 06:20:19 + + +24 06:20:26 06:21:03 + + +30 06:21:22 06:21:50 +Vst= 23.4 + +31 06:21:55 06:22:28 +Rom_sol= 6.8 + +32 06:23:06 06:23:43 +Imax=10.9 Umax=50.1 T= 9.3 + +33 06:23:47 06:24:05 +Imin=15.9 Umin=25.0 T= 0.8 + +34 06:24:09 06:24:33 +V=300.2 T= 9.7 + +35 06:24:36 06:25:57 +Qkr= 51.8 Tkr= 9.5 Qpd= 0.0 Tpd= 0.0 + +36 06:26:02 06:26:58 +Pkr=0.29 Tkr= 3.0 Ppd=0.00 Tpd= 0.0 + +37 06:27:02 06:27:29 +T= 1.3 + +38 06:27:33 06:27:41 +t= 52.1 T= 0.8 + +39 06:27:45 06:27:52 +t= 51.8 T= 0.5 + +40 06:27:56 06:28:04 +t= 52.2 T= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.483 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.483 new file mode 100644 index 0000000..788588e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.483 @@ -0,0 +1,8 @@ +8 02:03:26 1592773406 +25 06:21:19 1592788879 +9 06:28:48 1592789328 +10 07:11:48 1592791908 +11 11:06:30 1592805990 +12 13:53:47 1592816027 +13 15:42:58 1592822578 +0 15:42:58 1592822578 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.484 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.484 new file mode 100644 index 0000000..3098c30 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.484 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.485 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.485 new file mode 100644 index 0000000..3add643 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.485 @@ -0,0 +1 @@ +109 05:00:16 1592784016 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.486 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.486 new file mode 100644 index 0000000..0fa5790 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.486 @@ -0,0 +1,43 @@ +[43] +oper = 8 +begin = 22.06.2020 02:03:26 +norma = 40 +vac_time = 30 +real = 257 + +[44] +oper = 25 +begin = 22.06.2020 06:21:19 +norma = 30 +real = 7 + +[45] +oper = 9 +begin = 22.06.2020 06:28:48 +norma = 0 +real = 43 + +[46] +oper = 10 +begin = 22.06.2020 07:11:48 +norma = 0 +real = 234 + +[47] +oper = 11 +begin = 22.06.2020 11:06:30 +norma = 0 +real = 167 + +[48] +oper = 12 +begin = 22.06.2020 13:53:47 +norma = 105 +real = 109 + +[49] +oper = 13 +begin = 22.06.2020 15:42:58 +norma = 45 +real = 501 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.487 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.487 new file mode 100644 index 0000000..1a93256 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.487 @@ -0,0 +1,16 @@ +06:20:27 1592788827 祭 ॣ '-2'(A) +06:21:04 1592788864 ⪫祭 ॣ '-2'(A) +06:28:12 1592789292 祭 ० ࠧ +06:28:15 1592789295 祭 ० ' ⮪ 㣨' +06:54:43 1592790883 祭 ॣ '-2'(A) +07:11:48 1592791908 祭 ⠭ ॣ +07:11:48 1592791908 ⪫祭 ० ࠧ (A) +11:06:29 1592805989 祭 ० +11:06:31 1592805991 ⪫祭 ॣ '-2'(A) +11:06:32 1592805992 祭 ॣ '-2'(A) +12:58:31 1592812711 ⪫祭 ॣ '-2'(A) +13:53:27 1592816007 ⪫祭 ० (A) +13:53:29 1592816009 ⪫祭 ० ' ⮪ 㣨' +13:54:25 1592816065 祭 ० ᪠ +13:54:25 1592816065 祭 ० ᪠ +13:58:23 1592816303 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200622.489 b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.489 new file mode 100644 index 0000000..cabcd17 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200622.489 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.090 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.090 new file mode 100644 index 0000000..3b25658 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.090 @@ -0,0 +1,2 @@ +10:08:34 1592888914 1 10042 2 p. cao M1,M2,M3,M4 7 1000 9 7900 10 920 +14:05:13 1592903113 3 37 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.091 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.091 new file mode 100644 index 0000000..a2bf44a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.091 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.092 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.092 new file mode 100644 index 0000000..06ae0f3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.092 @@ -0,0 +1,18 @@ +21 10:07:36 10:07:39 +Rsk= 28.5 Rkk= 24.8 + +21 10:59:23 10:59:26 +Rsk= 28.0 Rkk= 24.7 + +22 11:24:07 11:34:14 +P1= 30.1 T1=11:29:14 P2= 43.0 T2=11:34:14 Vs= 2.58 + +20 14:04:56 14:05:04 +Riz_sol=13869.0 + +21 14:05:24 14:05:27 +Rsk= 28.6 Rkk= 25.3 + +22 14:32:23 14:47:30 +P1= 48.6 T1=14:42:30 P2= 58.7 T2=14:47:30 Vs= 2.01 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.093 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.093 new file mode 100644 index 0000000..3e3d84a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.093 @@ -0,0 +1,11 @@ +11 03:43:05 1592865785 +12 06:30:06 1592875806 +13 08:18:11 1592882291 +0 08:18:11 1592882291 +2 10:05:15 1592888715 +7 10:51:09 1592891469 +2 10:58:58 1592891938 +5 11:35:44 1592894144 +6 11:49:15 1592894955 +7 12:32:10 1592897530 +8 14:04:01 1592903041 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.094 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.094 new file mode 100644 index 0000000..4f49325 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.094 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.096 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.096 new file mode 100644 index 0000000..a51df76 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.096 @@ -0,0 +1,63 @@ +[27] +oper = 11 +begin = 23.06.2020 03:43:05 +norma = 0 +real = 167 + +[28] +oper = 12 +begin = 23.06.2020 06:30:06 +norma = 105 +real = 108 + +[29] +oper = 13 +begin = 23.06.2020 08:18:11 +norma = 45 +real = 107 + +[30] +oper = 2 +begin = 23.06.2020 10:05:15 +norma = 110 +vac_time = 8 +real = 45 + +[31] +oper = 7 +begin = 23.06.2020 10:51:09 +norma = 30 +real = 7 + +[32] +oper = 2 +begin = 23.06.2020 10:58:58 +norma = 110 +vac_time = 8 +real = 36 + +[33] +oper = 5 +begin = 23.06.2020 11:35:44 +norma = 25 +real = 13 + +[34] +oper = 6 +begin = 23.06.2020 11:49:15 +norma = 35 +real = 42 + +[35] +oper = 7 +begin = 23.06.2020 12:32:10 +norma = 30 +real = 91 + +[36] +oper = 8 +begin = 23.06.2020 14:04:01 +norma = 40 +vac_time = 8 +real = 2048 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.097 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.097 new file mode 100644 index 0000000..0482690 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.097 @@ -0,0 +1,6 @@ +03:43:04 1592865784 祭 ० +03:43:05 1592865785 ⪫祭 ॣ '-2'(A) +03:43:06 1592865786 祭 ॣ '-2'(A) +05:35:05 1592872505 ⪫祭 ॣ '-2'(A) +06:30:01 1592875801 ⪫祭 ० (A) +06:30:07 1592875807 ⪫祭 ० ' ⮪ 㣨' diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.099 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.099 new file mode 100644 index 0000000..0e573da Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.099 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.170 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.170 new file mode 100644 index 0000000..4b0e30d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.170 @@ -0,0 +1,3 @@ +00:17:27 1592853447 1 09229 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4460 9 4850 10 690 11 12 321173 +01:00:09 1592856009 0 A--32-031-2016 ॢ 5 +17:12:17 1592914337 1 09230 2 p. cao M1,M2,M3,M4 3 37 9 3890 10 670 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.171 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.171 new file mode 100644 index 0000000..bbdd93a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.171 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.172 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.172 new file mode 100644 index 0000000..8118ebd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.172 @@ -0,0 +1,63 @@ +22 23:50:30 00:06:02 +P1= 32.6 T1=00:01:02 P2= 42.5 T2=00:06:02 Vs= 1.99 + +23 00:06:24 00:06:30 + + +24 00:06:39 00:07:18 + + +30 00:07:34 00:08:16 +Vst= 28.8 + +31 00:08:22 00:09:00 +Rom_sol= 9.9 + +32 00:09:47 00:10:20 +Imax=10.0 Umax=50.6 T=10.1 + +32 00:10:34 00:11:44 +Imax=10.8 Umax=49.9 T= 9.4 + +33 00:11:49 00:12:19 +Imin=16.0 Umin=25.2 T= 1.0 + +34 00:12:24 00:12:51 +V=301.2 T= 9.5 + +35 00:12:55 00:14:18 +Q= 54.9 T= 9.1 + +36 00:14:23 00:14:59 +P1=0.28 T= 3.2 + +37 00:15:25 00:16:01 +T= 0.7 + +38 00:16:06 00:16:12 +t= 51.5 T= 0.7 + +39 00:16:16 00:16:22 +t= 51.4 T= 0.7 + +40 00:16:25 00:16:32 +t= 51.5 T= 0.7 + +21 17:10:57 17:11:04 +Rsk= 14.0 Rkk= 8.4 + +22 17:44:26 17:59:57 +P1= 41.8 T1=17:54:57 P2= 55.0 T2=17:59:57 Vs= 2.64 + +20 20:21:50 20:22:00 +Riz_sol= 1299.6 + +21 20:22:08 20:22:15 +Rsk= 14.1 Rkk= 8.4 + +22 20:46:01 21:01:32 +P1= 55.3 T1=20:56:32 P2= 70.8 T2=21:01:32 Vs= 3.10 + +22 21:14:26 21:24:57 +P1= 21.5 T1=21:19:57 P2= 33.8 T2=21:24:57 Vs= 2.47 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.173 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.173 new file mode 100644 index 0000000..aa78651 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.173 @@ -0,0 +1,12 @@ +25 00:07:27 1592852847 +9 00:17:27 1592853447 +10 01:00:09 1592856009 +11 04:50:58 1592869858 +12 07:38:00 1592879880 +13 09:38:50 1592887130 +0 09:38:50 1592887130 +2 17:07:09 1592914029 +5 18:00:33 1592917233 +6 18:13:32 1592918012 +7 18:55:58 1592920558 +8 20:16:14 1592925374 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.174 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.174 new file mode 100644 index 0000000..280650d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.174 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.175 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.175 new file mode 100644 index 0000000..1b1660c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.175 @@ -0,0 +1 @@ +55 00:10:20 1592853020 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.176 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.176 new file mode 100644 index 0000000..13bdc0a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.176 @@ -0,0 +1,68 @@ +[85] +oper = 25 +begin = 23.06.2020 00:07:27 +norma = 30 +real = 10 + +[86] +oper = 9 +begin = 23.06.2020 00:17:27 +norma = 0 +real = 42 + +[87] +oper = 10 +begin = 23.06.2020 01:00:09 +norma = 0 +real = 230 + +[88] +oper = 11 +begin = 23.06.2020 04:50:58 +norma = 0 +real = 167 + +[89] +oper = 12 +begin = 23.06.2020 07:38:00 +norma = 105 +real = 120 + +[90] +oper = 13 +begin = 23.06.2020 09:38:50 +norma = 45 +real = 448 + +[91] +oper = 2 +begin = 23.06.2020 17:07:09 +norma = 110 +vac_time = 8 +real = 53 + +[92] +oper = 5 +begin = 23.06.2020 18:00:33 +norma = 25 +real = 12 + +[93] +oper = 6 +begin = 23.06.2020 18:13:32 +norma = 35 +real = 42 + +[94] +oper = 7 +begin = 23.06.2020 18:55:58 +norma = 30 +real = 80 + +[95] +oper = 8 +begin = 23.06.2020 20:16:14 +norma = 40 +vac_time = 8 +real = 1708 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.177 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.177 new file mode 100644 index 0000000..8361bbf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.177 @@ -0,0 +1,20 @@ +00:06:41 1592852801 祭 ॣ '-2'(A) +00:07:18 1592852838 ⪫祭 ॣ '-2'(A) +00:16:49 1592853409 祭 ० ࠧ +00:16:51 1592853411 祭 ० ' ⮪ 㣨' +00:43:05 1592854985 祭 ॣ '-2'(A) +01:00:09 1592856009 ⪫祭 ० ࠧ (A) +01:00:09 1592856009 祭 ⠭ ॣ +04:50:57 1592869857 祭 ० +04:50:58 1592869858 ⪫祭 ॣ '-2'(A) +04:50:59 1592869859 祭 ॣ '-2'(A) +07:37:55 1592879875 ⪫祭 ० (A) +07:38:01 1592879881 ⪫祭 ० ' ⮪ 㣨' +07:38:04 1592879884 ⪫祭 ॣ '-2'(A) +07:38:59 1592879939 祭 ० ᪠ +07:42:08 1592880128 ⪫祭 ० ᪠ (A) +18:13:53 1592918033 祭 ० ᪠ +18:13:53 1592918033 祭 ० ᪠ +18:13:54 1592918034 祭 ० ᪠ +18:13:54 1592918034 祭 ० ᪠ +18:16:57 1592918217 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.179 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.179 new file mode 100644 index 0000000..e95d038 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.179 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.340 new file mode 100644 index 0000000..9975b4e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.340 @@ -0,0 +1,5 @@ +00:40:44 1592854844 3 14 +01:37:21 1592858241 0 A--32-067-2014 ॢ 0 +03:20:05 1592864405 1 09613 3 17 7 770 9 6370 10 650 +06:25:18 1592875518 1 09613 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 17 4 1 5 Ti 6 7 770 8 4350 9 6370 10 650 11 12 321752 +22:12:04 1592932324 1 09614 3 25 4 2 9 4710 10 690 12 321315 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.341 new file mode 100644 index 0000000..292b00c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.342 new file mode 100644 index 0000000..7ff44e6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.342 @@ -0,0 +1,69 @@ +21 00:41:03 00:41:06 +Rsk= 15.6 Rkk= 15.0 + +22 01:04:27 01:14:55 +P1= 28.4 T1=01:09:55 P2= 52.3 T2=01:14:55 Vs= 4.78 + +21 03:20:22 03:20:25 +Rsk= 15.2 Rkk= 14.6 + +22 03:51:00 04:06:27 +P1= 57.6 T1=04:01:27 P2= 72.8 T2=04:06:27 Vs= 3.04 + +20 05:33:15 05:33:24 +Riz_sol= 1893.5 + +21 05:33:40 05:33:43 +Rsk= 14.9 Rkk= 14.3 + +22 06:06:37 06:17:04 +P1= 27.9 T1=06:12:04 P2= 41.0 T2=06:17:04 Vs= 2.62 + +23 06:17:47 06:17:53 + + +24 06:18:02 06:18:43 + + +30 06:18:57 06:19:32 +Vst= 31.2 + +31 06:19:42 06:20:17 +Rom_sol= 15.3 + +32 06:20:46 06:21:23 +Imax=11.0 Umax=50.0 T= 9.0 + +33 06:21:26 06:21:47 +Imin=16.0 Umin=25.0 T= 0.5 + +34 06:21:51 06:22:14 +V=300.1 T= 9.5 + +35 06:22:18 06:23:15 +Q= 53.2 T= 9.5 + +36 06:23:18 06:23:52 +P1=0.29 T= 3.0 + +37 06:23:55 06:24:20 +T= 1.0 + +38 06:24:23 06:24:30 +t= 51.9 T= 0.6 + +39 06:24:32 06:24:39 +t= 51.7 T= 0.6 + +40 06:24:42 06:24:49 +t= 51.8 T= 0.6 + +20 21:56:27 21:56:36 +Riz_sol= 1978.9 + +21 21:56:47 21:56:50 +Rsk= 16.5 Rkk= 16.0 + +22 22:44:45 22:55:12 +P1= 19.5 T1=22:50:12 P2= 32.1 T2=22:55:12 Vs= 2.52 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.343 new file mode 100644 index 0000000..863ff32 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.343 @@ -0,0 +1,16 @@ +14 00:36:39 1592854599 +15 01:19:48 1592857188 +16 01:39:38 1592858378 +1 02:23:51 1592861031 +2 03:14:13 1592864053 +5 04:07:57 1592867277 +6 04:20:00 1592868000 +7 05:00:37 1592870437 +8 05:30:03 1592872203 +25 06:18:52 1592875132 +9 06:25:18 1592875518 +10 07:07:37 1592878057 +12 15:28:48 1592908128 +13 19:49:37 1592923777 +0 19:49:37 1592923777 +8 21:53:36 1592931216 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.344 new file mode 100644 index 0000000..46c82c6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.346 new file mode 100644 index 0000000..010980a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.346 @@ -0,0 +1,94 @@ +[78] +oper = 14 +begin = 23.06.2020 00:36:39 +norma = 40 +vac_time = 8 +real = 43 + +[79] +oper = 15 +begin = 23.06.2020 01:19:48 +norma = 30 +real = 19 + +[80] +oper = 16 +begin = 23.06.2020 01:39:38 +norma = 40 +real = 44 + +[81] +oper = 1 +begin = 23.06.2020 02:23:51 +norma = 85 +real = 50 + +[82] +oper = 2 +begin = 23.06.2020 03:14:13 +norma = 110 +vac_time = 10 +real = 53 + +[83] +oper = 5 +begin = 23.06.2020 04:07:57 +norma = 25 +real = 12 + +[84] +oper = 6 +begin = 23.06.2020 04:20:00 +norma = 35 +real = 40 + +[85] +oper = 7 +begin = 23.06.2020 05:00:37 +norma = 30 +real = 29 + +[86] +oper = 8 +begin = 23.06.2020 05:30:03 +norma = 40 +vac_time = 8 +real = 48 + +[87] +oper = 25 +begin = 23.06.2020 06:18:52 +norma = 30 +real = 6 + +[88] +oper = 9 +begin = 23.06.2020 06:25:18 +norma = 0 +real = 42 + +[89] +oper = 10 +begin = 23.06.2020 07:07:37 +norma = 0 +real = 501 + +[90] +oper = 12 +begin = 23.06.2020 15:28:48 +norma = 180 +real = 260 + +[91] +oper = 13 +begin = 23.06.2020 19:49:37 +norma = 45 +real = 123 + +[92] +oper = 8 +begin = 23.06.2020 21:53:36 +norma = 40 +vac_time = 10 +real = 1623 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.347 new file mode 100644 index 0000000..5f02d53 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.347 @@ -0,0 +1,21 @@ +01:19:35 1592857175 祭 ० ࠧ +01:19:37 1592857177 祭 ० ' ⮪ 㣨' +01:20:33 1592857233 祭 ॣ '-2'(A) +01:37:21 1592858241 ⪫祭 ० ࠧ (A) +01:39:39 1592858379 ⪫祭 ० ' ⮪ 㣨' +01:39:42 1592858382 ⪫祭 ॣ '-2'(A) +01:40:08 1592858408 祭 ० ᪠ +01:42:59 1592858579 ⪫祭 ० ᪠ (A) +04:20:23 1592868023 祭 ० ᪠ +04:23:11 1592868191 ⪫祭 ० ᪠ (A) +06:18:03 1592875083 祭 ॣ '-2'(A) +06:18:44 1592875124 ⪫祭 ॣ '-2'(A) +07:07:15 1592878035 祭 ॣ '-2' +07:07:40 1592878060 祭 ⠭ ॣ +11:54:05 1592895245 ⪫祭 ॣ '-2'(A) +11:55:04 1592895304 祭 ॣ '-2' +15:28:52 1592908132 ⪫祭 ॣ '-2'(A) +15:29:32 1592908172 祭 ० ᪠ +15:29:33 1592908173 祭 ० ᪠ +15:29:33 1592908173 祭 ० ᪠ +15:32:25 1592908345 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.349 new file mode 100644 index 0000000..bce4bf6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.410 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.410 new file mode 100644 index 0000000..8537251 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.410 @@ -0,0 +1,4 @@ +04:05:04 1592867104 1 11433 8 4660 9 5850 +08:26:49 1592882809 1 11433 2 BT 18, 20, 22, 23, 25 3 25 4 1 5 Ti 6 7 770 8 4660 9 5850 10 650 11 12 320542 +09:00:17 1592884817 0 A--32-129-2018 ॢ 1 +19:06:50 1592921210 1 11434 2 BT 3-1, 6, 8, 9, 14, 15, 16 4 2 10 690 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.411 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.411 new file mode 100644 index 0000000..b340b26 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.411 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.412 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.412 new file mode 100644 index 0000000..5e75216 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.412 @@ -0,0 +1,78 @@ +21 04:03:11 04:03:14 +Rsk= 8.4 Rkk= 5.5 + +22 04:39:54 04:55:01 +P1= 40.1 T1=04:50:01 P2= 50.9 T2=04:55:01 Vs= 2.18 + +20 06:38:17 06:38:26 +Riz_sol= 4759.1 + +20 06:38:46 06:38:54 +Riz_sol= 4759.4 + +21 06:39:02 06:39:05 +Rsk= 8.4 Rkk= 5.4 + +22 07:45:14 07:55:22 +P1= 14.4 T1=07:50:22 P2= 27.2 T2=07:55:22 Vs= 2.55 + +22 08:09:04 08:19:11 +P1= 12.2 T1=08:14:11 P2= 23.4 T2=08:19:11 Vs= 2.23 + +23 08:19:17 08:19:22 + + +24 08:19:28 08:20:05 + + +30 08:20:15 08:20:42 +Vst= 31.0 + +31 08:20:46 08:21:21 +Rom_sol= 11.7 + +41 08:21:49 08:21:54 +Ukz= 1.88 + +32 08:21:57 08:22:32 +Imax=11.0 Umax=50.0 T= 9.0 + +33 08:22:37 08:22:56 +Imin=16.0 Umin=25.0 T= 0.5 + +34 08:23:00 08:23:23 +V=300.3 T= 9.4 + +35 08:23:26 08:24:22 +Q= 55.0 T= 9.4 + +36 08:24:26 08:25:01 +P1=0.30 T= 3.0 + +37 08:25:05 08:25:28 +T= 0.9 + +38 08:25:32 08:25:39 +t= 51.9 T= 0.5 + +39 08:25:43 08:25:58 +tcam= 54.1 Tcam= 0.5 tfl= 54.7 Tfl= 0.5 + +40 08:26:02 08:26:09 +t= 51.9 T= 0.5 + +20 19:08:34 19:08:42 +Riz_sol= 4759.3 + +21 19:08:49 19:08:52 +Rsk= 8.5 Rkk= 5.7 + +20 21:30:04 21:30:13 +Riz_sol= 4757.3 + +21 21:30:22 21:30:25 +Rsk= 8.3 Rkk= 5.4 + +22 22:07:29 22:22:37 +P1= 34.8 T1=22:17:37 P2= 44.7 T2=22:22:37 Vs= 1.97 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.413 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.413 new file mode 100644 index 0000000..2ca6dd2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.413 @@ -0,0 +1,16 @@ +13 02:43:38 1592862218 +0 02:43:38 1592862218 +2 03:55:12 1592866512 +5 04:55:58 1592870158 +6 05:07:21 1592870841 +7 05:44:34 1592873074 +8 06:36:23 1592876183 +25 08:20:14 1592882414 +9 08:26:49 1592882809 +10 09:00:18 1592884818 +12 13:51:25 1592902285 +13 18:06:31 1592917591 +0 18:06:31 1592917591 +8 19:04:06 1592921046 +13 21:13:58 1592928838 +8 21:29:33 1592929773 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.414 new file mode 100644 index 0000000..c9d4c7a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.416 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.416 new file mode 100644 index 0000000..059e4f8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.416 @@ -0,0 +1,89 @@ +[64] +oper = 13 +begin = 23.06.2020 02:43:38 +norma = 45 +real = 71 + +[65] +oper = 2 +begin = 23.06.2020 03:55:12 +norma = 110 +vac_time = 9 +vac_avg10 = 8.5 +real = 60 + +[66] +oper = 5 +begin = 23.06.2020 04:55:58 +norma = 25 +real = 11 + +[67] +oper = 6 +begin = 23.06.2020 05:07:21 +norma = 35 +real = 37 + +[68] +oper = 7 +begin = 23.06.2020 05:44:34 +norma = 30 +real = 51 + +[69] +oper = 8 +begin = 23.06.2020 06:36:23 +norma = 40 +vac_time = 8 +real = 103 + +[70] +oper = 25 +begin = 23.06.2020 08:20:14 +norma = 30 +real = 6 + +[71] +oper = 9 +begin = 23.06.2020 08:26:49 +norma = 0 +real = 33 + +[72] +oper = 10 +begin = 23.06.2020 09:00:18 +norma = 0 +real = 291 + +[73] +oper = 12 +begin = 23.06.2020 13:51:25 +norma = 105 +real = 255 + +[74] +oper = 13 +begin = 23.06.2020 18:06:31 +norma = 45 +real = 57 + +[75] +oper = 8 +begin = 23.06.2020 19:04:06 +norma = 40 +vac_time = 8 +real = 129 + +[76] +oper = 13 +begin = 23.06.2020 21:13:58 +norma = 45 +real = 15 + +[77] +oper = 8 +begin = 23.06.2020 21:29:33 +norma = 40 +vac_time = 8 +real = 1611 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.417 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.417 new file mode 100644 index 0000000..2df4415 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.417 @@ -0,0 +1,39 @@ +05:07:47 1592870867 祭 ० ᪠ +05:07:54 1592870874 . ⪫祭 ० ᪠ (A) +05:08:56 1592870936 祭 ० ᪠ +05:08:56 1592870936 . ⪫祭 ० ᪠ (A) +05:08:58 1592870938 祭 ० ᪠ +05:08:58 1592870938 . ⪫祭 ० ᪠ (A) +05:08:59 1592870939 祭 ० ᪠ +05:08:59 1592870939 . ⪫祭 ० ᪠ (A) +05:09:01 1592870941 祭 ० ᪠ +05:09:01 1592870941 . ⪫祭 ० ᪠ (A) +05:09:02 1592870942 祭 ० ᪠ +05:09:02 1592870942 . ⪫祭 ० ᪠ (A) +05:09:05 1592870945 祭 ० ᪠ +05:09:05 1592870945 . ⪫祭 ० ᪠ (A) +05:09:16 1592870956 祭 ० ᪠ +05:09:16 1592870956 . ⪫祭 ० ᪠ (A) +05:09:17 1592870957 祭 ० ᪠ +05:09:17 1592870957 . ⪫祭 ० ᪠ (A) +05:09:18 1592870958 祭 ० ᪠ +05:09:18 1592870958 . ⪫祭 ० ᪠ (A) +05:14:16 1592871256 祭 ० ᪠ +05:16:49 1592871409 ⪫祭 ० ᪠ (A) +08:19:31 1592882371 祭 ॣ '-2'(A) +08:20:06 1592882406 ⪫祭 ॣ '-2'(A) +08:26:20 1592882780 祭 ० ࠧ +08:26:23 1592882783 祭 ० ' ⮪ 㣨' +08:28:19 1592882899 祭 ॣ '-2'(A) +09:00:17 1592884817 ⪫祭 ० ࠧ (A) +09:00:17 1592884817 祭 ⠭ ॣ +13:29:20 1592900960 祭 ० +13:29:21 1592900961 ⪫祭 ॣ '-2'(A) +13:29:22 1592900962 祭 ॣ '-2'(A) +13:36:13 1592901373 ⪫祭 ० ' ⮪ 㣨' +13:51:28 1592902288 ⪫祭 ॣ '-2'(A) +13:51:35 1592902295 祭 ० ᪠ +13:51:35 1592902295 祭 ० ᪠ +13:51:36 1592902296 祭 ० ᪠ +13:53:44 1592902424 ⪫祭 ० ᪠ (A) +14:39:20 1592905160 ⪫祭 ० (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200623.419 b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.419 new file mode 100644 index 0000000..b36733d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200623.419 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200624.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200624.341 new file mode 100644 index 0000000..b7f337f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200624.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200624.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200624.344 new file mode 100644 index 0000000..b470e42 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200624.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200624.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200624.347 new file mode 100644 index 0000000..91eb7bc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200624.347 @@ -0,0 +1,2 @@ +20:56:05 1593014165 祭 ॣ '-2'(A) +20:56:07 1593014167 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200624.411 b/Tests/bin/Debug/netcoreapp3.1/temp/20200624.411 new file mode 100644 index 0000000..9e60a4e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200624.411 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200624.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200624.414 new file mode 100644 index 0000000..49c4d27 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200624.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200624.417 b/Tests/bin/Debug/netcoreapp3.1/temp/20200624.417 new file mode 100644 index 0000000..a0f70b5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200624.417 @@ -0,0 +1,4 @@ +20:43:09 1593013389 祭 ॣ '-2'(A) +20:43:11 1593013391 ⪫祭 ॣ '-2'(A) +21:50:29 1593017429 祭 ॣ '-2'(A) +21:50:31 1593017431 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.080 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.080 new file mode 100644 index 0000000..7ed2cb7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.080 @@ -0,0 +1,6 @@ +00:35:50 1593027350 1 05920 2 BT 18, 20, 22, 23, 25 3 25 4 1 5 Ti 6 7 770 8 4690 9 5900 10 650 11 12 321021 +01:17:30 1593029850 0 A--32-129-2018 ॢ 1 +09:54:46 1593060886 3 14 +15:46:12 1593081972 1 05921 3 25 4 2 9 4800 10 690 +22:11:04 1593105064 1 05921 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 4690 9 4800 10 690 11 12 321021 +22:53:45 1593107625 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.081 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.081 new file mode 100644 index 0000000..21a91dd Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.081 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.082 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.082 new file mode 100644 index 0000000..582cf0a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.082 @@ -0,0 +1,186 @@ +22 00:14:58 00:25:03 +P1= 34.3 T1=00:20:03 P2= 44.5 T2=00:25:03 Vs= 2.05 + +23 00:26:01 00:26:09 + + +24 00:26:22 00:26:51 + + +24 00:26:54 00:27:31 + + +30 00:27:42 00:28:18 +Vst= 28.7 + +31 00:28:23 00:29:01 +Rom_sol= 17.1 + +41 00:29:23 00:29:28 +Ukz= 2.10 + +32 00:29:31 00:30:36 +Imax=11.5 Umax=50.0 T= 9.2 + +33 00:30:39 00:31:08 +Imin=16.6 Umin=25.1 T= 0.8 + +34 00:31:11 00:31:39 +V=301.2 T= 9.6 + +35 00:31:42 00:33:02 +Q= 54.9 T=12.3 + +36 00:33:06 00:33:55 +P1=0.28 T= 3.0 + +37 00:33:58 00:34:29 +T= 0.7 + +38 00:34:32 00:34:39 +t= 51.6 T= 0.8 + +39 00:34:41 00:34:57 +tcam= 51.5 Tcam= 0.5 tfl= 51.7 Tfl= 0.7 + +40 00:35:00 00:35:06 +t= 51.7 T= 0.5 + +21 09:53:52 09:53:59 +Rsk= 5.8 Rkk= 0.0 + +21 09:54:17 09:54:24 +Rsk= 5.8 Rkk= 0.0 + +21 09:58:35 09:58:42 +Rsk= 5.8 Rkk= 0.0 + +21 09:59:03 09:59:11 +Rsk= 5.8 Rkk= 0.0 + +21 09:59:46 09:59:54 +Rsk= 0.0 Rkk= 0.0 + +21 10:00:05 10:00:12 +Rsk= 5.8 Rkk= 0.0 + +21 10:00:53 10:01:00 +Rsk= 5.8 Rkk= 0.0 + +21 10:01:14 10:01:22 +Rsk= 5.8 Rkk= 0.0 + +21 10:01:59 10:02:06 +Rsk= 5.8 Rkk= 0.0 + +21 10:03:54 10:04:01 +Rsk= 5.8 Rkk= 0.0 + +21 10:12:51 10:12:59 +Rsk= 5.8 Rkk= 0.0 + +21 10:13:13 10:13:21 +Rsk= 5.8 Rkk= 0.0 + +21 10:26:12 10:26:20 +Rsk= 5.8 Rkk= 0.0 + +21 10:32:39 10:32:46 +Rsk= 5.8 Rkk= 0.0 + +21 10:33:19 10:33:26 +Rsk= 5.8 Rkk= 0.0 + +21 10:34:17 10:34:24 +Rsk= 5.8 Rkk= 0.0 + +21 10:41:58 10:42:05 +Rsk= 5.8 Rkk= 0.0 + +21 10:48:23 10:48:31 +Rsk= 5.9 Rkk= 0.2 + +21 11:39:52 11:39:59 +Rsk= 27.8 Rkk= 22.1 + +21 11:45:59 11:46:07 +Rsk= 27.7 Rkk= 22.1 + +22 12:09:59 12:25:04 +P1= 82.4 T1=12:20:04 P2=100.0 T2=12:25:04 Vs= 3.53 + +20 15:43:49 15:43:59 +Riz_sol= 1570.3 + +21 15:44:12 15:44:20 +Rsk= 28.4 Rkk= 22.8 + +22 16:36:09 16:51:14 +P1= 83.0 T1=16:46:14 P2=110.5 T2=16:51:14 Vs= 5.50 + +22 17:09:49 17:24:54 +P1= 69.4 T1=17:19:54 P2= 93.5 T2=17:24:54 Vs= 4.82 + +22 18:02:27 18:17:32 +P1= 58.2 T1=18:12:32 P2= 78.9 T2=18:17:32 Vs= 4.13 + +22 18:29:21 18:44:27 +P1= 55.3 T1=18:39:27 P2= 74.4 T2=18:44:27 Vs= 3.81 + +22 19:01:26 19:16:31 +P1= 52.5 T1=19:11:31 P2= 70.1 T2=19:16:31 Vs= 3.53 + +22 19:24:05 19:39:10 +P1= 51.2 T1=19:34:10 P2= 68.2 T2=19:39:10 Vs= 3.40 + +22 19:52:50 20:07:55 +P1= 48.1 T1=20:02:55 P2= 64.4 T2=20:07:55 Vs= 3.26 + +22 20:13:54 20:28:59 +P1= 46.6 T1=20:23:59 P2= 62.4 T2=20:28:59 Vs= 3.16 + +22 20:43:21 20:58:26 +P1= 44.3 T1=20:53:26 P2= 59.2 T2=20:58:26 Vs= 2.98 + +22 21:44:30 21:59:35 +P1= 40.7 T1=21:54:35 P2= 54.2 T2=21:59:35 Vs= 2.70 + +23 22:00:01 22:00:07 + + +24 22:00:47 22:01:22 + + +30 22:01:36 22:02:12 +Vst= 28.7 + +31 22:02:21 22:02:59 +Rom_sol= 12.6 + +32 22:04:23 22:05:29 +Imax=11.5 Umax=50.0 T= 9.2 + +33 22:05:33 22:06:02 +Imin=16.7 Umin=25.1 T= 0.8 + +34 22:06:06 22:06:35 +V=301.3 T= 9.7 + +35 22:06:39 22:08:14 +Q= 54.9 T= 9.2 + +36 22:08:20 22:09:14 +P1=0.29 T= 3.0 + +37 22:09:18 22:09:52 +T= 0.7 + +38 22:09:56 22:10:03 +t= 51.5 T= 0.5 + +39 22:10:07 22:10:21 +tcam= 51.5 Tcam= 0.7 tfl= 51.7 Tfl= 0.5 + +40 22:10:26 22:10:33 +t= 51.7 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.083 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.083 new file mode 100644 index 0000000..f0a24c6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.083 @@ -0,0 +1,16 @@ +25 00:27:42 1593026862 +9 00:35:50 1593027350 +10 01:17:31 1593029851 +12 04:56:46 1593043006 +13 09:21:50 1593058910 +0 09:21:50 1593058910 +14 09:50:27 1593060627 +1 11:02:34 1593064954 +14 11:45:45 1593067545 +15 12:25:42 1593069942 +16 12:56:30 1593071790 +1 13:39:28 1593074368 +8 15:36:56 1593081416 +25 22:01:32 1593104492 +9 22:11:04 1593105064 +10 22:53:46 1593107626 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.084 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.084 new file mode 100644 index 0000000..23bfc8c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.084 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.085 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.085 new file mode 100644 index 0000000..c58907a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.085 @@ -0,0 +1 @@ +29 00:26:53 1593026813 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.086 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.086 new file mode 100644 index 0000000..19d056b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.086 @@ -0,0 +1,93 @@ +[42] +oper = 25 +begin = 25.06.2020 00:27:42 +norma = 30 +real = 8 + +[43] +oper = 9 +begin = 25.06.2020 00:35:50 +norma = 0 +real = 41 + +[44] +oper = 10 +begin = 25.06.2020 01:17:31 +norma = 0 +real = 219 + +[45] +oper = 12 +begin = 25.06.2020 04:56:46 +norma = 180 +real = 265 + +[46] +oper = 13 +begin = 25.06.2020 09:21:50 +norma = 45 +real = 28 + +[47] +oper = 14 +begin = 25.06.2020 09:50:27 +norma = 40 +vac_time = 7 +real = 72 + +[48] +oper = 1 +begin = 25.06.2020 11:02:34 +norma = 85 +real = 43 + +[49] +oper = 14 +begin = 25.06.2020 11:45:45 +norma = 40 +vac_time = 7 +real = 39 + +[50] +oper = 15 +begin = 25.06.2020 12:25:42 +norma = 30 +real = 30 + +[51] +oper = 16 +begin = 25.06.2020 12:56:30 +norma = 40 +real = 42 + +[52] +oper = 1 +begin = 25.06.2020 13:39:28 +norma = 85 +real = 117 + +[53] +oper = 8 +begin = 25.06.2020 15:36:56 +norma = 40 +vac_time = 8 +real = 384 + +[54] +oper = 25 +begin = 25.06.2020 22:01:32 +norma = 30 +real = 9 + +[55] +oper = 9 +begin = 25.06.2020 22:11:04 +norma = 0 +real = 42 + +[56] +oper = 10 +begin = 25.06.2020 22:53:46 +norma = 0 +real = 243 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.087 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.087 new file mode 100644 index 0000000..c748b0c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.087 @@ -0,0 +1,44 @@ +00:26:26 1593026786 祭 ॣ '-2'(A) +00:26:54 1593026814 ⪫祭 ॣ '-2'(A) +00:26:58 1593026818 祭 ॣ '-2'(A) +00:27:34 1593026854 ⪫祭 ॣ '-2'(A) +00:35:21 1593027321 祭 ० ࠧ +00:35:23 1593027323 祭 ० ' ⮪ 㣨' +00:45:31 1593027931 祭 ॣ '-2'(A) +01:17:30 1593029850 祭 ⠭ ॣ +01:17:30 1593029850 ⪫祭 ० ࠧ (A) +04:55:43 1593042943 ⪫祭 ० ' ⮪ 㣨' +04:56:50 1593043010 ⪫祭 ॣ '-2'(A) +04:58:18 1593043098 祭 ० ᪠ +04:58:18 1593043098 祭 ० ᪠ +04:58:18 1593043098 祭 ० ᪠ +04:58:19 1593043099 祭 ० ᪠ +04:58:20 1593043100 祭 ० ᪠ +04:58:20 1593043100 祭 ० ᪠ +04:58:21 1593043101 祭 ० ᪠ +05:00:55 1593043255 ⪫祭 ० ᪠ (A) +12:25:38 1593069938 祭 ० ࠧ +12:25:39 1593069939 祭 ० ' ⮪ 㣨' +12:25:41 1593069941 祭 ॣ '-2'(A) +12:39:41 1593070781 ⪫祭 ० ' ⮪ 㣨' +12:56:35 1593071795 ⪫祭 ॣ '-2'(A) +12:56:44 1593071804 祭 ० ᪠ +12:57:21 1593071841 ⪫祭 ० ᪠ +12:57:22 1593071842 祭 ० ᪠ +12:57:34 1593071854 ⪫祭 ० ᪠ +12:57:36 1593071856 祭 ० ᪠ +12:57:36 1593071856 祭 ० ᪠ +12:57:53 1593071873 ⪫祭 ० ᪠ +12:57:54 1593071874 祭 ० ᪠ +12:57:54 1593071874 祭 ० ᪠ +12:58:03 1593071883 ⪫祭 ० ᪠ +12:58:03 1593071883 ⪫祭 ० ᪠ +22:00:18 1593104418 祭 ॣ '-2'(A) +22:00:43 1593104443 ⪫祭 ॣ '-2'(A) +22:00:49 1593104449 祭 ॣ '-2'(A) +22:01:23 1593104483 ⪫祭 ॣ '-2'(A) +22:10:43 1593105043 祭 ० ࠧ +22:10:43 1593105043 祭 ० ' ⮪ 㣨' +22:36:42 1593106602 祭 ॣ '-2'(A) +22:53:45 1593107625 祭 ⠭ ॣ +22:53:45 1593107625 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.089 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.089 new file mode 100644 index 0000000..cd32f4a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.089 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.340 new file mode 100644 index 0000000..b1e4033 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.340 @@ -0,0 +1,5 @@ +01:04:32 1593029072 1 09614 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4350 9 4710 10 690 11 12 321315 +01:47:29 1593031649 0 A--32-031-2016 ॢ 5 +14:11:56 1593076316 1 09615 2 BT 18, 20, 22, 23, 25 9 4810 +17:32:17 1593088337 1 09615 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 4350 9 4810 10 690 11 12 321315 +18:14:52 1593090892 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.341 new file mode 100644 index 0000000..bf592a1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.342 new file mode 100644 index 0000000..7105387 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.342 @@ -0,0 +1,99 @@ +22 00:44:49 00:55:18 +P1= 27.3 T1=00:50:18 P2= 30.2 T2=00:55:18 Vs= 0.58 + +23 00:55:44 00:55:50 + + +24 00:56:18 00:57:00 + + +30 00:57:31 00:58:02 +Vst= 31.0 + +31 00:58:09 00:58:45 +Rom_sol= 11.7 + +32 00:59:29 01:00:06 +Imax=11.0 Umax=50.0 T= 9.0 + +33 01:00:10 01:00:32 +Imin=16.0 Umin=25.0 T= 0.5 + +34 01:00:36 01:00:59 +V=300.2 T= 9.5 + +35 01:01:03 01:02:01 +Q= 52.4 T= 9.4 + +36 01:02:05 01:02:38 +P1=0.29 T= 3.0 + +37 01:02:42 01:03:05 +T= 1.0 + +38 01:03:09 01:03:16 +t= 51.8 T= 0.6 + +39 01:03:20 01:03:27 +t= 51.6 T= 0.5 + +40 01:03:32 01:03:38 +t= 51.8 T= 0.6 + +20 14:12:27 14:12:36 +Riz_sol= 1870.9 + +21 14:12:42 14:12:45 +Rsk= 17.0 Rkk= 16.5 + +22 15:29:33 15:45:01 +P1= 83.8 T1=15:40:01 P2=110.7 T2=15:45:01 Vs= 5.39 + +22 16:03:58 16:19:26 +P1= 63.1 T1=16:14:26 P2= 82.5 T2=16:19:26 Vs= 3.86 + +22 16:40:42 16:56:10 +P1= 52.7 T1=16:51:10 P2= 68.5 T2=16:56:10 Vs= 3.17 + +22 17:06:53 17:22:20 +P1= 48.5 T1=17:17:20 P2= 62.8 T2=17:22:20 Vs= 2.85 + +23 17:22:30 17:22:35 + + +24 17:22:42 17:23:22 + + +30 17:23:43 17:24:13 +Vst= 31.0 + +31 17:24:21 17:24:57 +Rom_sol= 12.5 + +32 17:25:42 17:26:22 +Imax=11.0 Umax=50.1 T= 8.9 + +33 17:26:27 17:26:49 +Imin=16.0 Umin=25.0 T= 0.5 + +34 17:26:55 17:27:18 +V=300.0 T= 9.5 + +35 17:28:24 17:29:23 +Q= 54.2 T= 9.5 + +36 17:29:27 17:30:01 +P1=0.29 T= 3.0 + +37 17:30:05 17:30:29 +T= 1.0 + +38 17:30:34 17:30:41 +t= 51.9 T= 0.6 + +39 17:30:46 17:30:55 +t= 51.6 T= 0.6 + +40 17:31:01 17:31:10 +t= 51.9 T= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.343 new file mode 100644 index 0000000..c059ce5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.343 @@ -0,0 +1,12 @@ +25 00:57:28 1593028648 +9 01:04:32 1593029072 +10 01:47:29 1593031649 +11 05:43:48 1593045828 +12 08:30:48 1593055848 +13 10:22:42 1593062562 +0 10:22:42 1593062562 +8 14:09:13 1593076153 +25 17:23:36 1593087816 +9 17:32:17 1593088337 +10 18:14:52 1593090892 +11 22:20:01 1593105601 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.344 new file mode 100644 index 0000000..869283f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.345 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.345 new file mode 100644 index 0000000..b3cc7c8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.345 @@ -0,0 +1,3 @@ +46 17:27:28 1593088048 +46 17:27:43 1593088063 +46 17:28:13 1593088093 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.346 new file mode 100644 index 0000000..5366528 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.346 @@ -0,0 +1,67 @@ +[93] +oper = 25 +begin = 25.06.2020 00:57:28 +norma = 30 +real = 7 + +[94] +oper = 9 +begin = 25.06.2020 01:04:32 +norma = 0 +real = 42 + +[95] +oper = 10 +begin = 25.06.2020 01:47:29 +norma = 0 +real = 236 + +[96] +oper = 11 +begin = 25.06.2020 05:43:48 +norma = 0 +real = 167 + +[97] +oper = 12 +begin = 25.06.2020 08:30:48 +norma = 105 +real = 111 + +[98] +oper = 13 +begin = 25.06.2020 10:22:42 +norma = 45 +real = 226 + +[99] +oper = 8 +begin = 25.06.2020 14:09:13 +norma = 40 +vac_time = 10 +real = 194 + +[00] +oper = 25 +begin = 25.06.2020 17:23:36 +norma = 30 +real = 8 + +[01] +oper = 9 +begin = 25.06.2020 17:32:17 +norma = 0 +real = 42 + +[02] +oper = 10 +begin = 25.06.2020 18:14:52 +norma = 0 +real = 245 + +[03] +oper = 11 +begin = 25.06.2020 22:20:01 +norma = 0 +real = 167 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.347 new file mode 100644 index 0000000..d65a9a6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.347 @@ -0,0 +1,26 @@ +00:56:20 1593028580 祭 ॣ '-2'(A) +00:57:01 1593028621 ⪫祭 ॣ '-2'(A) +01:03:50 1593029030 祭 ० ࠧ +01:03:52 1593029032 祭 ० ' ⮪ 㣨' +01:30:24 1593030624 祭 ॣ '-2'(A) +01:47:29 1593031649 ⪫祭 ० ࠧ (A) +01:47:29 1593031649 祭 ⠭ ॣ +05:43:48 1593045828 祭 ० +05:43:49 1593045829 ⪫祭 ॣ '-2'(A) +05:43:50 1593045830 祭 ॣ '-2'(A) +07:35:49 1593052549 ⪫祭 ॣ '-2'(A) +08:30:45 1593055845 ⪫祭 ० (A) +08:30:49 1593055849 ⪫祭 ० ' ⮪ 㣨' +08:30:57 1593055857 祭 ० ᪠ +08:30:59 1593055859 祭 ० ᪠ +08:34:35 1593056075 ⪫祭 ० ᪠ (A) +17:22:43 1593087763 祭 ॣ '-2'(A) +17:23:22 1593087802 ⪫祭 ॣ '-2'(A) +17:31:24 1593088284 祭 ० ࠧ +17:31:26 1593088286 祭 ० ' ⮪ 㣨' +17:57:47 1593089867 祭 ॣ '-2'(A) +18:14:52 1593090892 祭 ⠭ ॣ +18:14:52 1593090892 ⪫祭 ० ࠧ (A) +22:20:00 1593105600 祭 ० +22:20:01 1593105601 ⪫祭 ॣ '-2'(A) +22:20:02 1593105602 祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.349 new file mode 100644 index 0000000..36d7817 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.350 new file mode 100644 index 0000000..798f727 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.350 @@ -0,0 +1,8 @@ +01:34:15 1593030855 1 09552 3 37 7 770 9 2850 10 670 +01:34:39 1593030879 2 p. cao M1,M2,M3,M4 +05:36:17 1593045377 1 09552 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 770 8 4490 9 2850 10 670 11 12 321692 +06:10:01 1593047401 0 A--32-006-2018 ॢ 4 +11:54:33 1593068073 3 14 +17:15:18 1593087318 1 09553 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 9 5040 10 690 +21:57:46 1593104266 1 09553 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4490 9 5040 10 690 11 12 321692 +22:40:28 1593106828 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.351 new file mode 100644 index 0000000..51867a8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.352 new file mode 100644 index 0000000..067c8a0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.352 @@ -0,0 +1,120 @@ +21 01:31:53 01:31:56 +Rsk= 19.0 Rkk= 16.4 + +22 02:29:40 02:45:12 +P1= 39.4 T1=02:40:12 P2= 52.1 T2=02:45:12 Vs= 2.55 + +20 04:33:09 04:33:18 +Riz_sol= 6440.3 + +21 04:33:25 04:33:28 +Rsk= 17.3 Rkk= 14.7 + +22 05:04:40 05:20:11 +P1= 46.4 T1=05:15:11 P2= 61.4 T2=05:20:11 Vs= 3.01 + +23 05:20:33 05:20:38 + + +24 05:20:45 05:21:24 + + +30 05:21:36 05:21:59 +Vst= 28.2 + +31 05:22:07 05:22:39 +Rom_sol= 8.6 + +41 05:23:00 05:23:05 +Ukz= 0.90 + +32 05:23:22 05:23:57 +Imax=27.3 Umax=55.0 T= 9.0 + +33 05:24:01 05:24:20 +Imin=16.2 Umin=25.0 T= 0.5 + +34 05:24:28 05:24:51 +V=300.3 T= 9.5 + +35 05:24:55 05:26:36 +Q= 54.6 T= 9.5 + +36 05:26:39 05:27:15 +P1=0.30 T= 3.0 + +37 05:34:34 05:34:59 +T= 1.0 + +38 05:35:01 05:35:07 +t= 53.3 T= 0.8 + +39 05:35:10 05:35:25 +tcam= 54.9 Tcam= 0.8 tfl= 54.0 Tfl= 0.8 + +40 05:35:27 05:35:33 +t= 56.1 T= 0.8 + +21 12:47:46 12:47:49 +Rsk= 17.2 Rkk= 14.4 + +22 13:03:51 13:19:22 +P1= 57.4 T1=13:14:22 P2= 74.3 T2=13:19:22 Vs= 3.38 + +20 17:15:37 17:15:45 +Riz_sol= 6780.3 + +21 17:15:53 17:15:57 +Rsk= 18.0 Rkk= 15.3 + +22 17:59:37 18:15:09 +P1= 44.2 T1=18:10:09 P2= 60.4 T2=18:15:09 Vs= 3.23 + +22 18:34:36 18:50:08 +P1= 33.2 T1=18:45:08 P2= 46.8 T2=18:50:08 Vs= 2.73 + +22 21:29:42 21:40:14 +P1= 11.7 T1=21:35:14 P2= 26.3 T2=21:40:14 Vs= 2.94 + +23 21:43:41 21:43:46 + + +24 21:44:04 21:44:36 + + +24 21:44:58 21:45:36 + + +30 21:46:53 21:47:18 +Vst= 28.1 + +31 21:47:26 21:48:01 +Rom_sol= 13.9 + +32 21:48:45 21:49:23 +Imax=11.3 Umax=50.1 T= 9.0 + +33 21:49:41 21:50:04 +Imin=16.2 Umin=25.0 T= 0.5 + +34 21:50:09 21:50:41 +V=300.3 T= 9.5 + +35 21:50:45 21:51:46 +Q= 53.7 T= 9.5 + +36 21:51:50 21:52:29 +P1=0.30 T= 3.0 + +37 21:52:43 21:53:11 +T= 1.0 + +38 21:53:16 21:53:34 +t= 53.6 T= 0.8 + +39 21:53:55 21:54:20 +tcam= 55.3 Tcam= 0.8 tfl= 54.3 Tfl= 0.8 + +40 21:54:25 21:54:35 +t= 56.6 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.353 new file mode 100644 index 0000000..8630051 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.353 @@ -0,0 +1,21 @@ +1 00:05:48 1593025548 +2 01:27:46 1593030466 +5 02:47:50 1593035270 +6 03:00:40 1593036040 +7 03:35:42 1593038142 +8 04:26:48 1593041208 +25 05:21:34 1593044494 +9 05:36:17 1593045377 +10 06:10:01 1593047401 +11 07:20:30 1593051630 +12 10:09:34 1593061774 +13 12:00:27 1593068427 +0 12:00:27 1593068427 +14 12:44:02 1593071042 +15 13:20:27 1593073227 +16 13:52:23 1593075143 +1 14:34:01 1593077641 +8 17:13:24 1593087204 +25 21:46:05 1593103565 +9 21:57:46 1593104266 +10 22:40:28 1593106828 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.354 new file mode 100644 index 0000000..d99faa0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.355 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.355 new file mode 100644 index 0000000..880719b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.355 @@ -0,0 +1 @@ +29 21:44:36 1593103476 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.356 new file mode 100644 index 0000000..532f031 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.356 @@ -0,0 +1,125 @@ +[33] +oper = 1 +begin = 25.06.2020 00:05:48 +norma = 85 +real = 81 + +[34] +oper = 2 +begin = 25.06.2020 01:27:46 +norma = 110 +vac_time = 8 +real = 80 + +[35] +oper = 5 +begin = 25.06.2020 02:47:50 +norma = 25 +real = 12 + +[36] +oper = 6 +begin = 25.06.2020 03:00:40 +norma = 35 +real = 35 + +[37] +oper = 7 +begin = 25.06.2020 03:35:42 +norma = 30 +real = 51 + +[38] +oper = 8 +begin = 25.06.2020 04:26:48 +norma = 40 +vac_time = 7 +real = 54 + +[39] +oper = 25 +begin = 25.06.2020 05:21:34 +norma = 30 +real = 14 + +[40] +oper = 9 +begin = 25.06.2020 05:36:17 +norma = 0 +real = 33 + +[41] +oper = 10 +begin = 25.06.2020 06:10:01 +norma = 0 +real = 70 + +[42] +oper = 11 +begin = 25.06.2020 07:20:30 +norma = 0 +real = 169 + +[43] +oper = 12 +begin = 25.06.2020 10:09:34 +norma = 105 +real = 110 + +[44] +oper = 13 +begin = 25.06.2020 12:00:27 +norma = 45 +real = 43 + +[45] +oper = 14 +begin = 25.06.2020 12:44:02 +norma = 40 +vac_time = 6 +real = 36 + +[46] +oper = 15 +begin = 25.06.2020 13:20:27 +norma = 30 +real = 31 + +[47] +oper = 16 +begin = 25.06.2020 13:52:23 +norma = 40 +real = 41 + +[48] +oper = 1 +begin = 25.06.2020 14:34:01 +norma = 85 +real = 159 + +[49] +oper = 8 +begin = 25.06.2020 17:13:24 +norma = 40 +vac_time = 7 +vac_avg10 = 6.7 +real = 272 + +[50] +oper = 25 +begin = 25.06.2020 21:46:05 +norma = 30 +real = 11 + +[51] +oper = 9 +begin = 25.06.2020 21:57:46 +norma = 0 +real = 42 + +[52] +oper = 10 +begin = 25.06.2020 22:40:28 +norma = 0 +real = 245 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.357 new file mode 100644 index 0000000..997979e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.357 @@ -0,0 +1,43 @@ +03:01:01 1593036061 祭 ० ᪠ +03:01:01 1593036061 祭 ० ᪠ +03:01:01 1593036061 祭 ० ᪠ +03:01:02 1593036062 祭 ० ᪠ +03:01:30 1593036090 祭 ० ᪠ +03:01:30 1593036090 祭 ० ᪠ +03:01:30 1593036090 祭 ० ᪠ +03:03:59 1593036239 ⪫祭 ० ᪠ (A) +05:20:48 1593044448 祭 ॣ '-2'(A) +05:21:25 1593044485 ⪫祭 ॣ '-2'(A) +05:35:47 1593045347 祭 ० ࠧ +05:35:49 1593045349 祭 ० ' ⮪ 㣨' +05:56:01 1593046561 祭 ॣ '-2'(A) +06:10:01 1593047401 ⪫祭 ० ࠧ (A) +06:10:02 1593047402 祭 ⠭ ॣ +07:20:29 1593051629 祭 ० +07:20:30 1593051630 ⪫祭 ॣ '-2'(A) +07:20:31 1593051631 祭 ॣ '-2'(A) +08:22:30 1593055350 ⪫祭 ॣ '-2'(A) +10:09:32 1593061772 ⪫祭 ० (A) +10:09:34 1593061774 ⪫祭 ० ' ⮪ 㣨' +10:10:22 1593061822 祭 ० ᪠ +10:10:23 1593061823 祭 ० ᪠ +10:10:25 1593061825 祭 ० ᪠ +10:14:05 1593062045 ⪫祭 ० ᪠ (A) +13:20:03 1593073203 祭 ० ࠧ +13:20:05 1593073205 祭 ० ' ⮪ 㣨' +13:20:40 1593073240 祭 ॣ '-2'(A) +13:52:24 1593075144 ⪫祭 ० ' ⮪ 㣨' +13:52:26 1593075146 ⪫祭 ॣ '-2'(A) +13:52:45 1593075165 祭 ० ᪠ +13:52:46 1593075166 祭 ० ᪠ +13:52:46 1593075166 祭 ० ᪠ +13:56:32 1593075392 ⪫祭 ० ᪠ (A) +21:44:04 1593103444 祭 ॣ '-2'(A) +21:44:36 1593103476 ⪫祭 ॣ '-2'(A) +21:44:59 1593103499 祭 ॣ '-2'(A) +21:45:37 1593103537 ⪫祭 ॣ '-2'(A) +21:57:16 1593104236 祭 ० ࠧ +21:57:19 1593104239 祭 ० ' ⮪ 㣨' +22:23:23 1593105803 祭 ॣ '-2'(A) +22:40:28 1593106828 ⪫祭 ० ࠧ (A) +22:40:28 1593106828 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.359 new file mode 100644 index 0000000..dd2ef03 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.410 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.410 new file mode 100644 index 0000000..9b41be1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.410 @@ -0,0 +1,5 @@ +00:27:55 1593026875 1 11434 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4660 9 5850 10 690 11 12 320542 +01:10:26 1593029426 0 A--32-031-2016 ॢ 5 +11:52:17 1593067937 1 11435 4 1 9 4760 10 650 +15:50:16 1593082216 1 11435 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4660 9 4760 10 650 11 12 320542 +16:23:49 1593084229 0 A--32-129-2018 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.411 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.411 new file mode 100644 index 0000000..0b05ef1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.411 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.412 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.412 new file mode 100644 index 0000000..423f4e8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.412 @@ -0,0 +1,105 @@ +22 00:09:59 00:20:07 +P1= 11.2 T1=00:15:07 P2= 17.5 T2=00:20:07 Vs= 1.26 + +23 00:20:26 00:20:31 + + +24 00:20:36 00:21:17 + + +30 00:21:25 00:21:51 +Vst= 32.2 + +31 00:21:54 00:22:28 +Rom_sol= 9.4 + +32 00:23:29 00:24:03 +Imax=11.0 Umax=50.0 T= 9.0 + +33 00:24:06 00:24:25 +Imin=16.0 Umin=25.0 T= 0.5 + +34 05:00:00 00:24:50 +V=300.4 T= 9.4 + +35 00:24:52 00:25:51 +Q= 51.8 T= 9.4 + +36 00:25:53 00:26:27 +P1=0.28 T= 2.9 + +37 00:26:29 00:26:52 +T= 0.9 + +38 00:26:55 00:27:02 +t= 51.9 T= 0.5 + +39 00:27:05 00:27:20 +tcam= 54.1 Tcam= 0.5 tfl= 58.3 Tfl= 0.5 + +40 00:27:23 00:27:30 +t= 51.7 T= 0.5 + +21 11:52:33 11:52:36 +Rsk= 7.9 Rkk= 5.0 + +22 12:29:43 12:44:50 +P1= 44.0 T1=12:39:50 P2= 57.8 T2=12:44:50 Vs= 2.75 + +20 14:02:03 14:02:12 +Riz_sol= 4759.7 + +21 14:02:28 14:02:31 +Rsk= 8.5 Rkk= 5.6 + +22 14:34:14 14:49:21 +P1= 44.9 T1=14:44:21 P2= 57.4 T2=14:49:21 Vs= 2.49 + +22 15:14:56 15:25:03 +P1= 13.7 T1=15:20:03 P2= 26.4 T2=15:25:03 Vs= 2.55 + +23 15:41:00 15:41:05 + + +24 15:42:17 15:42:55 + + +30 15:43:08 15:43:40 +Vst= 31.8 + +31 15:43:44 15:44:26 +Rom_sol= 10.4 + +41 15:44:59 15:45:04 +Ukz= 1.53 + +32 15:45:08 15:45:45 +Imax=11.0 Umax=50.0 T= 9.0 + +33 15:45:48 15:45:55 +Imin=13.5 Umin= 7.5 T= 1.6 + +33 15:46:02 15:46:22 +Imin=16.0 Umin=24.9 T= 0.5 + +34 15:46:26 15:46:49 +V=300.6 T= 9.4 + +35 15:46:52 15:47:49 +Q= 55.0 T= 9.4 + +36 15:47:53 15:48:32 +P1=0.28 T= 3.0 + +37 15:48:36 15:49:01 +T= 1.0 + +38 15:49:05 15:49:12 +t= 51.9 T= 0.5 + +39 15:49:16 15:49:31 +tcam= 54.1 Tcam= 0.5 tfl= 56.3 Tfl= 0.5 + +40 15:49:35 15:49:41 +t= 51.9 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.413 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.413 new file mode 100644 index 0000000..8a83f0b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.413 @@ -0,0 +1,16 @@ +25 00:21:21 1593026481 +9 00:27:55 1593026875 +10 01:10:26 1593029426 +11 05:11:49 1593043909 +12 07:58:52 1593053932 +13 09:43:33 1593060213 +0 09:43:33 1593060213 +2 11:45:48 1593067548 +5 12:45:41 1593071141 +6 12:54:21 1593071661 +7 13:28:12 1593073692 +8 13:59:56 1593075596 +25 15:43:04 1593081784 +9 15:50:16 1593082216 +10 16:23:50 1593084230 +12 20:31:17 1593099077 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.414 new file mode 100644 index 0000000..47da2a5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.415 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.415 new file mode 100644 index 0000000..40e6012 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.415 @@ -0,0 +1 @@ +55 15:45:54 1593081954 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.416 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.416 new file mode 100644 index 0000000..a980670 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.416 @@ -0,0 +1,91 @@ +[78] +oper = 25 +begin = 25.06.2020 00:21:21 +norma = 30 +real = 6 + +[79] +oper = 9 +begin = 25.06.2020 00:27:55 +norma = 0 +real = 42 + +[80] +oper = 10 +begin = 25.06.2020 01:10:26 +norma = 0 +real = 241 + +[81] +oper = 11 +begin = 25.06.2020 05:11:49 +norma = 0 +real = 167 + +[82] +oper = 12 +begin = 25.06.2020 07:58:52 +real = 104 + +[83] +oper = 13 +begin = 25.06.2020 09:43:33 +norma = 45 +real = 122 + +[84] +oper = 2 +begin = 25.06.2020 11:45:48 +norma = 110 +vac_time = 9 +real = 59 + +[85] +oper = 5 +begin = 25.06.2020 12:45:41 +norma = 25 +real = 8 + +[86] +oper = 6 +begin = 25.06.2020 12:54:21 +norma = 35 +real = 33 + +[87] +oper = 7 +begin = 25.06.2020 13:28:12 +norma = 30 +real = 31 + +[88] +oper = 8 +begin = 25.06.2020 13:59:56 +norma = 40 +vac_time = 8 +real = 103 + +[89] +oper = 25 +begin = 25.06.2020 15:43:04 +norma = 30 +real = 7 + +[90] +oper = 9 +begin = 25.06.2020 15:50:16 +norma = 0 +real = 33 + +[91] +oper = 10 +begin = 25.06.2020 16:23:50 +norma = 0 +real = 247 + +[92] +oper = 12 +begin = 25.06.2020 20:31:17 +norma = 105 +real = 252 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.417 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.417 new file mode 100644 index 0000000..136a68b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.417 @@ -0,0 +1,72 @@ +00:20:36 1593026436 祭 ॣ '-2'(A) +00:21:16 1593026476 ⪫祭 ॣ '-2'(A) +00:27:34 1593026854 祭 ० ࠧ +00:27:35 1593026855 祭 ० ' ⮪ 㣨' +00:53:22 1593028402 祭 ॣ '-2'(A) +01:10:26 1593029426 ⪫祭 ० ࠧ (A) +01:10:26 1593029426 祭 ⠭ ॣ +05:11:48 1593043908 祭 ० +05:11:49 1593043909 ⪫祭 ॣ '-2'(A) +05:11:50 1593043910 祭 ॣ '-2'(A) +07:03:50 1593050630 ⪫祭 ॣ '-2'(A) +07:58:47 1593053927 ⪫祭 ० (A) +07:58:53 1593053933 ⪫祭 ० ' ⮪ 㣨' +07:59:09 1593053949 祭 ० ᪠ +07:59:10 1593053950 祭 ० ᪠ +07:59:10 1593053950 祭 ० ᪠ +07:59:10 1593053950 祭 ० ᪠ +07:59:11 1593053951 祭 ० ᪠ +07:59:11 1593053951 祭 ० ᪠ +07:59:11 1593053951 祭 ० ᪠ +07:59:12 1593053952 祭 ० ᪠ +07:59:12 1593053952 祭 ० ᪠ +07:59:13 1593053953 祭 ० ᪠ +07:59:13 1593053953 祭 ० ᪠ +07:59:13 1593053953 祭 ० ᪠ +07:59:13 1593053953 祭 ० ᪠ +07:59:13 1593053953 祭 ० ᪠ +07:59:13 1593053953 祭 ० ᪠ +07:59:25 1593053965 祭 ० ᪠ +07:59:25 1593053965 祭 ० ᪠ +07:59:25 1593053965 祭 ० ᪠ +07:59:25 1593053965 祭 ० ᪠ +07:59:26 1593053966 祭 ० ᪠ +07:59:26 1593053966 祭 ० ᪠ +07:59:31 1593053971 祭 ० ᪠ +07:59:31 1593053971 祭 ० ᪠ +07:59:32 1593053972 祭 ० ᪠ +07:59:32 1593053972 祭 ० ᪠ +07:59:32 1593053972 祭 ० ᪠ +07:59:33 1593053973 祭 ० ᪠ +07:59:33 1593053973 祭 ० ᪠ +07:59:33 1593053973 祭 ० ᪠ +07:59:34 1593053974 祭 ० ᪠ +07:59:34 1593053974 祭 ० ᪠ +07:59:35 1593053975 祭 ० ᪠ +07:59:35 1593053975 祭 ० ᪠ +07:59:35 1593053975 祭 ० ᪠ +08:01:07 1593054067 祭 ० ᪠ +08:01:08 1593054068 祭 ० ᪠ +08:04:14 1593054254 ⪫祭 ० ᪠ (A) +12:54:35 1593071675 祭 ० ᪠ +12:57:45 1593071865 ⪫祭 ० ᪠ (A) +15:41:16 1593081676 祭 ॣ '-2'(A) +15:41:34 1593081694 ⪫祭 ॣ '-2'(A) +15:42:17 1593081737 祭 ॣ '-2'(A) +15:42:54 1593081774 ⪫祭 ॣ '-2'(A) +15:49:48 1593082188 祭 ० ࠧ +15:49:51 1593082191 祭 ० ' ⮪ 㣨' +15:51:47 1593082307 祭 ॣ '-2'(A) +16:23:49 1593084229 ⪫祭 ० ࠧ (A) +16:23:50 1593084230 祭 ⠭ ॣ +20:09:02 1593097742 祭 ० +20:09:03 1593097743 ⪫祭 ॣ '-2'(A) +20:09:04 1593097744 祭 ॣ '-2'(A) +20:16:21 1593098181 ⪫祭 ० ' ⮪ 㣨' +20:28:24 1593098904 祭 ० ' ⮪ 㣨' +20:31:18 1593099078 ⪫祭 ० ' ⮪ 㣨' +20:31:21 1593099081 ⪫祭 ॣ '-2'(A) +20:31:33 1593099093 祭 ० ᪠ +20:31:33 1593099093 祭 ० ᪠ +20:34:48 1593099288 ⪫祭 ० ᪠ (A) +21:19:05 1593101945 ⪫祭 ० (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200625.419 b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.419 new file mode 100644 index 0000000..5d5152b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200625.419 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.080 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.080 new file mode 100644 index 0000000..556f440 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.080 @@ -0,0 +1,3 @@ +09:42:55 1593146575 1 05922 2 OT-4 9 5100 10 650 +22:53:49 1593194029 4 1 8 4100 9 5020 +23:02:33 1593194553 1 05922 2 OT-4 3 25 4 1 5 Ti 6 7 770 8 4100 9 5020 10 650 11 12 321021 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.081 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.081 new file mode 100644 index 0000000..5b7fe65 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.081 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.082 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.082 new file mode 100644 index 0000000..b2254a3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.082 @@ -0,0 +1,66 @@ +21 09:41:59 09:42:06 +Rsk= 27.2 Rkk= 21.5 + +22 10:59:37 11:14:42 +P1= 64.9 T1=11:09:42 P2= 82.6 T2=11:14:42 Vs= 3.54 + +22 11:39:29 11:54:34 +P1= 53.1 T1=11:49:34 P2= 68.2 T2=11:54:34 Vs= 3.03 + +20 13:49:36 13:49:46 +Riz_sol= 1529.8 + +21 13:49:56 13:50:03 +Rsk= 27.6 Rkk= 21.9 + +22 14:20:24 14:35:29 +P1= 86.5 T1=14:30:29 P2=112.5 T2=14:35:29 Vs= 5.20 + +22 14:53:35 15:08:40 +P1= 61.4 T1=15:03:40 P2= 79.8 T2=15:08:40 Vs= 3.66 + +22 15:28:38 15:43:43 +P1= 49.3 T1=15:38:43 P2= 63.8 T2=15:43:43 Vs= 2.89 + +22 22:35:11 22:45:16 +P1= 24.0 T1=22:40:16 P2= 36.5 T2=22:45:16 Vs= 2.52 + +23 22:49:08 22:49:14 + + +24 22:49:22 22:49:59 + + +30 22:50:15 22:50:53 +Vst= 28.7 + +31 22:51:20 22:51:58 +Rom_sol= 12.7 + +32 22:55:59 22:57:05 +Imax=11.5 Umax=50.0 T= 9.4 + +33 22:57:12 22:57:41 +Imin=16.7 Umin=25.1 T= 0.8 + +34 22:57:46 22:58:15 +V=301.2 T= 9.6 + +35 22:58:19 22:59:49 +Q= 55.0 T= 9.2 + +36 22:59:54 23:00:42 +P1=0.27 T= 3.1 + +37 23:00:50 23:01:21 +T= 0.7 + +38 23:01:25 23:01:30 +t= 51.5 T= 0.7 + +39 23:01:34 23:01:48 +tcam= 51.5 Tcam= 0.7 tfl= 51.7 Tfl= 0.5 + +40 23:01:52 23:01:58 +t= 51.7 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.083 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.083 new file mode 100644 index 0000000..ef3ff0e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.083 @@ -0,0 +1,12 @@ +11 02:57:20 1593122240 +12 05:44:25 1593132265 +13 07:32:28 1593138748 +0 07:32:28 1593138748 +2 09:38:05 1593146285 +5 12:41:45 1593157305 +6 12:52:18 1593157938 +7 13:31:19 1593160279 +8 13:47:50 1593161270 +25 22:50:11 1593193811 +9 23:02:33 1593194553 +10 23:25:06 1593195906 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.084 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.084 new file mode 100644 index 0000000..2818289 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.084 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.085 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.085 new file mode 100644 index 0000000..85114f6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.085 @@ -0,0 +1,2 @@ +3 13:49:32 1593161372 +46 22:54:49 1593194089 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.086 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.086 new file mode 100644 index 0000000..b5e5cbb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.086 @@ -0,0 +1,68 @@ +[57] +oper = 11 +begin = 26.06.2020 02:57:20 +norma = 0 +real = 167 + +[58] +oper = 12 +begin = 26.06.2020 05:44:25 +norma = 105 +real = 108 + +[59] +oper = 13 +begin = 26.06.2020 07:32:28 +norma = 45 +real = 125 + +[60] +oper = 2 +begin = 26.06.2020 09:38:05 +norma = 110 +vac_time = 8 +real = 183 + +[61] +oper = 5 +begin = 26.06.2020 12:41:45 +norma = 25 +real = 10 + +[62] +oper = 6 +begin = 26.06.2020 12:52:18 +norma = 35 +real = 39 + +[63] +oper = 7 +begin = 26.06.2020 13:31:19 +norma = 30 +real = 16 + +[64] +oper = 8 +begin = 26.06.2020 13:47:50 +norma = 40 +vac_time = 8 +real = 542 + +[65] +oper = 25 +begin = 26.06.2020 22:50:11 +norma = 30 +real = 12 + +[66] +oper = 9 +begin = 26.06.2020 23:02:33 +norma = 0 +real = 22 + +[67] +oper = 10 +begin = 26.06.2020 23:25:06 +norma = 0 +real = 277 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.087 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.087 new file mode 100644 index 0000000..3efc32a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.087 @@ -0,0 +1,26 @@ +02:57:19 1593122239 祭 ० +02:57:20 1593122240 ⪫祭 ॣ '-2'(A) +02:57:21 1593122241 祭 ॣ '-2'(A) +05:44:17 1593132257 ⪫祭 ० (A) +05:44:27 1593132267 ⪫祭 ० ' ⮪ 㣨' +05:44:29 1593132269 ⪫祭 ॣ '-2'(A) +05:48:29 1593132509 祭 ० ᪠ +05:49:44 1593132584 ⪫祭 ० ᪠ +05:49:48 1593132588 祭 ० ᪠ +05:49:56 1593132596 ⪫祭 ० ᪠ +05:49:58 1593132598 祭 ० ᪠ +05:49:58 1593132598 祭 ० ᪠ +05:49:58 1593132598 祭 ० ᪠ +05:50:05 1593132605 ⪫祭 ० ᪠ +05:50:05 1593132605 ⪫祭 ० ᪠ +05:50:07 1593132607 祭 ० ᪠ +05:50:08 1593132608 祭 ० ᪠ +05:50:52 1593132652 ⪫祭 ० ᪠ (A) +12:52:43 1593157963 祭 ० ᪠ +12:52:43 1593157963 祭 ० ᪠ +12:52:43 1593157963 祭 ० ᪠ +12:55:53 1593158153 ⪫祭 ० ᪠ (A) +22:49:26 1593193766 祭 ॣ '-2'(A) +22:50:01 1593193801 ⪫祭 ॣ '-2'(A) +23:25:05 1593195905 祭 ॣ '-2' +23:25:06 1593195906 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.089 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.089 new file mode 100644 index 0000000..4c41c2e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.089 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.340 new file mode 100644 index 0000000..19d1a5a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.340 @@ -0,0 +1,7 @@ +03:46:36 1593125196 1 09616 2 BT 3-1, 6, 8, 9, 14, 15, 16 4 1 7 670 9 3930 10 560 +06:28:56 1593134936 1 09616 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 4350 9 3930 10 560 11 12 321315 +06:58:13 1593136693 0 A--32-106-2018 ॢ 2 +14:32:26 1593163946 3 14 +18:50:15 1593179415 1 09617 +18:55:13 1593179713 3 17 8 4250 9 4080 12 321672 +22:59:29 1593194369 1 09617 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 17 4 1 5 Ti 6 7 670 8 4250 9 4080 10 560 11 12 321672 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.341 new file mode 100644 index 0000000..16e1fbe Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.342 new file mode 100644 index 0000000..9ed64ac --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.342 @@ -0,0 +1,120 @@ +21 03:45:15 03:45:18 +Rsk= 16.8 Rkk= 16.2 + +22 04:20:31 04:35:58 +P1= 46.0 T1=04:30:58 P2= 58.4 T2=04:35:58 Vs= 2.48 + +20 05:38:17 05:38:26 +Riz_sol= 1858.7 + +21 05:38:32 05:38:35 +Rsk= 16.8 Rkk= 16.2 + +22 06:04:57 06:20:24 +P1= 42.1 T1=06:15:24 P2= 53.0 T2=06:20:24 Vs= 2.18 + +23 06:20:32 06:20:38 + + +24 06:20:43 06:21:22 + + +30 06:21:32 06:21:57 +Vst= 31.2 + +31 06:22:12 06:22:59 +Rom_sol= 11.2 + +41 06:23:40 06:23:45 +Ukz= 1.47 + +32 06:23:51 06:24:27 +Imax=11.0 Umax=50.1 T= 9.0 + +33 06:24:30 06:24:50 +Imin=16.0 Umin=25.0 T= 0.5 + +34 06:24:53 06:25:16 +V=300.4 T= 9.5 + +35 06:25:18 06:26:16 +Q= 53.6 T= 9.5 + +36 06:26:20 06:26:52 +P1=0.29 T= 2.9 + +37 06:26:56 06:27:22 +T= 1.0 + +38 06:27:25 06:27:32 +t= 51.9 T= 0.6 + +39 06:27:35 06:27:41 +t= 51.6 T= 0.6 + +40 06:27:44 06:27:51 +t= 51.8 T= 0.6 + +21 14:32:09 14:32:12 +Rsk= 17.0 Rkk= 16.4 + +22 14:57:35 15:08:03 +P1= 25.2 T1=15:03:03 P2= 48.7 T2=15:08:03 Vs= 4.69 + +21 18:50:31 18:50:34 +Rsk= 17.3 Rkk= 16.7 + +22 19:20:32 19:35:59 +P1= 53.9 T1=19:30:59 P2= 69.9 T2=19:35:59 Vs= 3.20 + +22 19:45:47 19:56:14 +P1= 25.8 T1=19:51:14 P2= 39.9 T2=19:56:14 Vs= 2.83 + +20 21:15:38 21:15:47 +Riz_sol= 1805.5 + +21 21:15:54 21:15:57 +Rsk= 17.0 Rkk= 16.4 + +22 22:35:03 22:45:30 +P1= 19.6 T1=22:40:30 P2= 29.9 T2=22:45:30 Vs= 2.05 + +23 22:45:40 22:45:45 + + +24 22:45:58 22:46:40 + + +30 22:46:53 22:47:26 +Vst= 31.0 + +31 22:47:42 22:49:54 +Rom_sol= 10.7 + +32 22:51:03 22:51:41 +Imax=11.0 Umax=50.1 T= 8.9 + +33 22:51:49 22:52:12 +Imin=16.0 Umin=25.0 T= 0.5 + +34 22:52:16 22:52:43 +V=300.2 T= 9.5 + +35 22:52:46 22:53:43 +Q= 53.9 T= 9.4 + +36 22:53:46 22:54:20 +P1=0.30 T= 3.0 + +37 22:54:23 22:54:49 +T= 1.0 + +38 22:54:52 22:54:59 +t= 51.9 T= 0.6 + +39 22:55:02 22:55:13 +t= 51.7 T= 0.6 + +40 22:55:18 22:55:25 +t= 51.8 T= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.343 new file mode 100644 index 0000000..d5c1003 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.343 @@ -0,0 +1,26 @@ +12 01:07:07 1593115627 +13 02:52:30 1593121950 +0 02:52:30 1593121950 +2 03:41:41 1593124901 +5 04:36:50 1593128210 +6 04:58:21 1593129501 +7 05:18:13 1593130693 +8 05:34:30 1593131670 +25 06:21:30 1593134490 +9 06:28:56 1593134936 +10 06:58:13 1593136693 +12 10:13:13 1593148393 +13 13:24:36 1593159876 +0 13:24:36 1593159876 +14 14:29:15 1593163755 +15 15:09:33 1593166173 +16 15:22:27 1593166947 +1 16:16:35 1593170195 +2 18:42:58 1593178978 +5 19:57:04 1593183424 +6 20:10:00 1593184200 +7 20:46:16 1593186376 +8 21:09:31 1593187771 +25 22:46:50 1593193610 +9 22:59:29 1593194369 +10 23:20:08 1593195608 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.344 new file mode 100644 index 0000000..3b52d56 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.346 new file mode 100644 index 0000000..13bdc31 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.346 @@ -0,0 +1,150 @@ +[04] +oper = 12 +begin = 26.06.2020 01:07:07 +norma = 105 +real = 105 + +[05] +oper = 13 +begin = 26.06.2020 02:52:30 +norma = 45 +real = 49 + +[06] +oper = 2 +begin = 26.06.2020 03:41:41 +norma = 110 +vac_time = 9 +real = 55 + +[07] +oper = 5 +begin = 26.06.2020 04:36:50 +norma = 25 +real = 21 + +[08] +oper = 6 +begin = 26.06.2020 04:58:21 +norma = 35 +real = 19 + +[09] +oper = 7 +begin = 26.06.2020 05:18:13 +norma = 30 +real = 16 + +[10] +oper = 8 +begin = 26.06.2020 05:34:30 +norma = 40 +vac_time = 9 +real = 47 + +[11] +oper = 25 +begin = 26.06.2020 06:21:30 +norma = 30 +real = 7 + +[12] +oper = 9 +begin = 26.06.2020 06:28:56 +norma = 0 +real = 29 + +[13] +oper = 10 +begin = 26.06.2020 06:58:13 +norma = 0 +real = 195 + +[14] +oper = 12 +begin = 26.06.2020 10:13:13 +norma = 105 +real = 191 + +[15] +oper = 13 +begin = 26.06.2020 13:24:36 +norma = 45 +real = 64 + +[16] +oper = 14 +begin = 26.06.2020 14:29:15 +norma = 40 +vac_time = 8 +real = 40 + +[17] +oper = 15 +begin = 26.06.2020 15:09:33 +norma = 30 +real = 12 + +[18] +oper = 16 +begin = 26.06.2020 15:22:27 +norma = 40 +real = 54 + +[19] +oper = 1 +begin = 26.06.2020 16:16:35 +norma = 85 +real = 146 + +[20] +oper = 2 +begin = 26.06.2020 18:42:58 +norma = 110 +vac_time = 9 +vac_avg10 = 8.9 +real = 74 + +[21] +oper = 5 +begin = 26.06.2020 19:57:04 +norma = 25 +real = 12 + +[22] +oper = 6 +begin = 26.06.2020 20:10:00 +norma = 35 +real = 36 + +[23] +oper = 7 +begin = 26.06.2020 20:46:16 +norma = 30 +real = 23 + +[24] +oper = 8 +begin = 26.06.2020 21:09:31 +norma = 40 +vac_time = 8 +real = 97 + +[25] +oper = 25 +begin = 26.06.2020 22:46:50 +norma = 30 +real = 12 + +[26] +oper = 9 +begin = 26.06.2020 22:59:29 +norma = 0 +real = 20 + +[27] +oper = 10 +begin = 26.06.2020 23:20:08 +norma = 0 +real = 376 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.347 new file mode 100644 index 0000000..847da30 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.347 @@ -0,0 +1,41 @@ +00:12:01 1593112321 ⪫祭 ॣ '-2'(A) +01:06:58 1593115618 ⪫祭 ० (A) +01:07:09 1593115629 ⪫祭 ० ' ⮪ 㣨' +01:08:20 1593115700 祭 ० ᪠ +01:08:21 1593115701 祭 ० ᪠ +01:11:59 1593115919 ⪫祭 ० ᪠ (A) +04:44:52 1593128692 祭 ० ᪠ +04:44:53 1593128693 祭 ० ᪠ +04:47:41 1593128861 ⪫祭 ० ᪠ (A) +06:20:45 1593134445 祭 ॣ '-2'(A) +06:21:23 1593134483 ⪫祭 ॣ '-2'(A) +06:28:27 1593134907 祭 ० ࠧ +06:28:29 1593134909 祭 ० ' ⮪ 㣨' +06:30:13 1593135013 祭 ॣ '-2'(A) +06:58:13 1593136693 ⪫祭 ० ࠧ (A) +06:58:13 1593136693 祭 ⠭ ॣ +10:03:09 1593147789 祭 ० +10:03:10 1593147790 ⪫祭 ॣ '-2'(A) +10:03:11 1593147791 祭 ॣ '-2'(A) +10:04:47 1593147887 ⪫祭 ० ' ⮪ 㣨' +10:13:15 1593148395 ⪫祭 ॣ '-2'(A) +10:13:33 1593148413 祭 ० ᪠ +10:16:04 1593148564 ⪫祭 ० ᪠ (A) +11:13:09 1593151989 ⪫祭 ० (A) +15:09:06 1593166146 祭 ० ࠧ +15:09:07 1593166147 祭 ० ' ⮪ 㣨' +15:10:19 1593166219 祭 ॣ '-2'(A) +15:22:02 1593166922 ⪫祭 ० ' ⮪ 㣨' +15:22:31 1593166951 ⪫祭 ॣ '-2'(A) +15:22:35 1593166955 祭 ० ᪠ +15:22:36 1593166956 祭 ० ᪠ +15:22:36 1593166956 祭 ० ᪠ +15:22:51 1593166971 祭 ० ᪠ +15:25:18 1593167118 ⪫祭 ० ᪠ (A) +20:10:31 1593184231 祭 ० ᪠ +20:10:31 1593184231 祭 ० ᪠ +20:12:58 1593184378 ⪫祭 ० ᪠ (A) +22:46:00 1593193560 祭 ॣ '-2'(A) +22:46:42 1593193602 ⪫祭 ॣ '-2'(A) +23:08:29 1593194909 祭 ॣ '-2' +23:26:37 1593195997 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.349 new file mode 100644 index 0000000..0cecb79 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.350 new file mode 100644 index 0000000..e5ddb69 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.350 @@ -0,0 +1,2 @@ +09:33:38 1593146018 1 09554 3 35 7 705 10 615 +21:13:40 1593188020 3 25 4 1 7 615 9 3760 10 495 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.351 new file mode 100644 index 0000000..0fc508c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.352 new file mode 100644 index 0000000..bf877ab --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.352 @@ -0,0 +1,24 @@ +21 09:34:15 09:34:18 +Rsk= 17.2 Rkk= 14.5 + +22 10:05:56 10:21:27 +P1= 64.7 T1=10:16:27 P2= 89.2 T2=10:21:27 Vs= 4.89 + +22 10:42:10 10:57:41 +P1= 48.3 T1=10:52:41 P2= 68.6 T2=10:57:41 Vs= 4.06 + +21 11:12:39 11:12:42 +Rsk= 17.2 Rkk= 14.5 + +22 11:41:30 11:57:01 +P1= 33.6 T1=11:52:01 P2= 44.5 T2=11:57:01 Vs= 2.18 + +21 21:13:56 21:13:59 +Rsk= 17.9 Rkk= 15.2 + +22 21:37:59 21:53:30 +P1= 61.1 T1=21:48:30 P2= 82.3 T2=21:53:30 Vs= 4.24 + +22 22:28:36 22:44:06 +P1= 32.5 T1=22:39:06 P2= 44.5 T2=22:44:06 Vs= 2.40 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.353 new file mode 100644 index 0000000..1cb5b61 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.353 @@ -0,0 +1,14 @@ +11 02:46:11 1593121571 +12 05:33:13 1593131593 +13 07:25:43 1593138343 +0 07:25:43 1593138343 +2 09:31:23 1593145883 +7 11:04:47 1593151487 +2 11:12:28 1593151948 +5 11:57:48 1593154668 +6 12:08:09 1593155289 +7 12:44:17 1593157457 +2 21:04:38 1593187478 +5 22:45:38 1593193538 +6 22:55:38 1593194138 +7 23:36:16 1593196576 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.354 new file mode 100644 index 0000000..55ead05 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.356 new file mode 100644 index 0000000..68c0436 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.356 @@ -0,0 +1,81 @@ +[53] +oper = 11 +begin = 26.06.2020 02:46:11 +norma = 0 +real = 167 + +[54] +oper = 12 +begin = 26.06.2020 05:33:13 +norma = 105 +real = 112 + +[55] +oper = 13 +begin = 26.06.2020 07:25:43 +norma = 45 +real = 125 + +[56] +oper = 2 +begin = 26.06.2020 09:31:23 +norma = 110 +vac_time = 7 +real = 93 + +[57] +oper = 7 +begin = 26.06.2020 11:04:47 +norma = 30 +real = 7 + +[58] +oper = 2 +begin = 26.06.2020 11:12:28 +norma = 110 +vac_time = 7 +real = 45 + +[59] +oper = 5 +begin = 26.06.2020 11:57:48 +norma = 25 +real = 10 + +[60] +oper = 6 +begin = 26.06.2020 12:08:09 +norma = 35 +real = 36 + +[61] +oper = 7 +begin = 26.06.2020 12:44:17 +norma = 30 +real = 500 + +[62] +oper = 2 +begin = 26.06.2020 21:04:38 +norma = 110 +vac_time = 7 +real = 101 + +[63] +oper = 5 +begin = 26.06.2020 22:45:38 +norma = 25 +real = 10 + +[64] +oper = 6 +begin = 26.06.2020 22:55:38 +norma = 35 +real = 40 + +[65] +oper = 7 +begin = 26.06.2020 23:36:16 +norma = 30 +real = 29 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.357 new file mode 100644 index 0000000..0cd2ceb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.357 @@ -0,0 +1,17 @@ +02:46:10 1593121570 祭 ० +02:46:11 1593121571 ⪫祭 ॣ '-2'(A) +02:46:12 1593121572 祭 ॣ '-2'(A) +04:38:11 1593128291 ⪫祭 ॣ '-2'(A) +05:33:09 1593131589 ⪫祭 ० (A) +05:33:11 1593131591 ⪫祭 ० ' ⮪ 㣨' +05:33:44 1593131624 祭 ० ᪠ +05:33:44 1593131624 祭 ० ᪠ +05:37:16 1593131836 ⪫祭 ० ᪠ (A) +12:08:44 1593155324 祭 ० ᪠ +12:08:44 1593155324 祭 ० ᪠ +12:08:44 1593155324 祭 ० ᪠ +12:08:45 1593155325 祭 ० ᪠ +12:11:10 1593155470 ⪫祭 ० ᪠ (A) +22:56:15 1593194175 祭 ० ᪠ +22:56:16 1593194176 祭 ० ᪠ +22:58:42 1593194322 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200626.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.359 new file mode 100644 index 0000000..ac65f61 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200626.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200627.290 b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.290 new file mode 100644 index 0000000..60081c8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.290 @@ -0,0 +1,4 @@ +12:09:30 1593241770 1 06994 2 BT 3-1, 6, 8, 9, 14, 15, 16 4 2 7 770 9 4780 10 690 +12:20:24 1593242424 1 06994 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4930 9 4780 10 690 11 12 321075 +13:03:01 1593244981 0 A--32-031-2016 ॢ 5 +22:28:50 1593278930 1 06995 4 1 8 4450 9 5550 10 650 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200627.291 b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.291 new file mode 100644 index 0000000..5f49104 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.291 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200627.292 b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.292 new file mode 100644 index 0000000..d56e38d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.292 @@ -0,0 +1,66 @@ +20 09:34:52 09:35:00 +Riz_sol= 4797.0 + +21 09:35:13 09:35:16 +Rsk= 34.8 Rkk= 31.0 + +20 10:35:43 10:35:51 +Riz_sol= 4796.8 + +21 10:36:01 10:36:04 +Rsk= 34.7 Rkk= 30.8 + +22 11:47:37 11:57:41 +P1= 22.0 T1=11:52:41 P2= 33.1 T2=11:57:41 Vs= 2.23 + +23 12:10:58 12:11:03 + + +24 12:11:58 12:12:40 + + +30 12:12:54 12:13:22 +Vst= 29.5 + +31 12:13:29 12:14:02 +Rom_sol= 11.6 + +32 12:14:39 12:15:14 +Imax=11.0 Umax=50.0 T= 9.0 + +33 12:15:18 12:15:41 +Imin=16.0 Umin=25.0 T= 0.5 + +34 12:15:44 12:16:07 +V=300.1 T= 9.4 + +35 12:16:10 12:17:11 +Q= 52.8 T= 9.4 + +36 12:17:14 12:17:49 +P1=0.28 T= 2.9 + +37 12:17:53 12:18:31 +T= 0.9 + +38 12:18:35 05:00:00 +t= 54.5 T= 0.5 + +38 12:18:49 12:18:56 +t= 54.5 T= 0.5 + +38 12:19:02 12:19:10 +t= 52.6 T= 0.5 + +39 12:19:14 12:19:30 +tcam= 53.1 Tcam= 0.5 tfl= 53.0 Tfl= 0.5 + +40 12:19:35 12:19:42 +t= 52.5 T= 0.5 + +21 22:27:26 22:27:29 +Rsk= 33.8 Rkk= 29.9 + +22 23:10:01 23:20:05 +P1= 25.4 T1=23:15:05 P2= 40.3 T2=23:20:05 Vs= 2.97 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200627.293 b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.293 new file mode 100644 index 0000000..a9ed2e5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.293 @@ -0,0 +1,16 @@ +12 03:55:57 1593212157 +13 06:58:41 1593223121 +0 06:58:41 1593223121 +8 09:34:20 1593232460 +13 09:48:01 1593233281 +8 10:33:09 1593235989 +25 12:12:50 1593241970 +9 12:20:24 1593242424 +10 13:03:01 1593244981 +11 17:03:25 1593259405 +12 19:50:27 1593269427 +13 21:35:20 1593275720 +0 21:35:20 1593275720 +2 22:25:59 1593278759 +5 23:20:59 1593282059 +6 23:32:37 1593282757 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200627.294 b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.294 new file mode 100644 index 0000000..52d1c59 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.294 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200627.295 b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.295 new file mode 100644 index 0000000..cc843ea --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.295 @@ -0,0 +1,4 @@ +47 12:18:42 1593242322 +47 12:18:44 1593242324 +47 12:18:45 1593242325 +47 12:18:56 1593242336 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200627.296 b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.296 new file mode 100644 index 0000000..3a2226a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.296 @@ -0,0 +1,87 @@ +[51] +oper = 12 +begin = 27.06.2020 03:55:57 +norma = 105 +real = 182 + +[52] +oper = 13 +begin = 27.06.2020 06:58:41 +norma = 45 +real = 155 + +[53] +oper = 8 +begin = 27.06.2020 09:34:20 +norma = 40 +real = 13 + +[54] +oper = 13 +begin = 27.06.2020 09:48:01 +norma = 45 +real = 45 + +[55] +oper = 8 +begin = 27.06.2020 10:33:09 +norma = 40 +vac_time = 7 +real = 99 + +[56] +oper = 25 +begin = 27.06.2020 12:12:50 +norma = 30 +real = 7 + +[57] +oper = 9 +begin = 27.06.2020 12:20:24 +norma = 0 +real = 42 + +[58] +oper = 10 +begin = 27.06.2020 13:03:01 +norma = 0 +real = 240 + +[59] +oper = 11 +begin = 27.06.2020 17:03:25 +norma = 0 +real = 167 + +[60] +oper = 12 +begin = 27.06.2020 19:50:27 +norma = 105 +real = 104 + +[61] +oper = 13 +begin = 27.06.2020 21:35:20 +norma = 45 +real = 50 + +[62] +oper = 2 +begin = 27.06.2020 22:25:59 +norma = 110 +vac_time = 6 +vac_avg10 = 8.0 +real = 55 + +[63] +oper = 5 +begin = 27.06.2020 23:20:59 +norma = 25 +real = 11 + +[64] +oper = 6 +begin = 27.06.2020 23:32:37 +norma = 35 +real = 42 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200627.297 b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.297 new file mode 100644 index 0000000..1928c62 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.297 @@ -0,0 +1,31 @@ +03:45:31 1593211531 祭 ० +03:45:32 1593211532 ⪫祭 ॣ '-2'(A) +03:45:33 1593211533 祭 ॣ '-2'(A) +03:48:39 1593211719 ⪫祭 ० ' ⮪ 㣨' +03:57:38 1593212258 祭 ० ᪠ +03:57:45 1593212265 ⪫祭 ॣ '-2'(A) +04:00:12 1593212412 ⪫祭 ० ᪠ (A) +04:55:31 1593215731 ⪫祭 ० (A) +12:12:03 1593241923 祭 ॣ '-2'(A) +12:12:40 1593241960 ⪫祭 ॣ '-2'(A) +12:19:55 1593242395 祭 ० ࠧ +12:19:57 1593242397 祭 ० ' ⮪ 㣨' +12:45:56 1593243956 祭 ॣ '-2'(A) +13:03:01 1593244981 ⪫祭 ० ࠧ (A) +13:03:01 1593244981 祭 ⠭ ॣ +17:03:25 1593259405 祭 ० +17:03:26 1593259406 ⪫祭 ॣ '-2'(A) +17:03:27 1593259407 祭 ॣ '-2'(A) +18:55:26 1593266126 ⪫祭 ॣ '-2'(A) +19:50:22 1593269422 ⪫祭 ० (A) +19:50:28 1593269428 ⪫祭 ० ' ⮪ 㣨' +19:51:37 1593269497 祭 ० ᪠ +19:51:38 1593269498 祭 ० ᪠ +19:51:38 1593269498 祭 ० ᪠ +19:51:39 1593269499 祭 ० ᪠ +19:54:19 1593269659 ⪫祭 ० ᪠ (A) +23:32:57 1593282777 祭 ० ᪠ +23:32:57 1593282777 祭 ० ᪠ +23:32:57 1593282777 祭 ० ᪠ +23:32:58 1593282778 祭 ० ᪠ +23:35:37 1593282937 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200627.299 b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.299 new file mode 100644 index 0000000..838bfd9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200627.299 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.290 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.290 new file mode 100644 index 0000000..429e82d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.290 @@ -0,0 +1,8 @@ +02:21:12 1593292872 1 06995 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4450 9 5550 10 650 11 12 321075 +02:41:28 1593294088 1 06995 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4450 9 5550 10 650 11 12 321075 +03:15:59 1593296159 0 A--32-129-2018 ॢ 1 +13:38:01 1593333481 3 14 +14:36:50 1593337010 0 A--32-067-2014 ॢ 0 +16:50:00 1593345000 1 06996 3 25 7 670 8 4350 9 4220 10 560 +19:18:52 1593353932 1 06996 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 4350 9 4220 10 560 11 12 321075 +19:48:24 1593355704 0 A--32-106-2018 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.291 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.291 new file mode 100644 index 0000000..73e05f6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.291 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.292 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.292 new file mode 100644 index 0000000..3dcd1aa --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.292 @@ -0,0 +1,111 @@ +21 01:03:47 01:03:50 +Rsk= 33.5 Rkk= 29.4 + +20 01:03:59 01:04:07 +Riz_sol= 4796.7 + +22 01:50:01 02:00:06 +P1= 22.0 T1=01:55:06 P2= 34.3 T2=02:00:06 Vs= 2.46 + +23 02:06:37 02:06:42 + + +24 02:06:50 02:07:28 + + +30 02:07:42 02:08:09 +Vst= 29.3 + +31 02:08:25 02:08:58 +Rom_sol= 12.2 + +41 02:09:21 02:09:26 +Ukz= 1.50 + +32 02:09:29 02:10:07 +Imax=10.9 Umax=55.0 T= 9.0 + +33 02:10:11 02:10:33 +Imin=16.0 Umin=25.0 T= 0.5 + +34 02:10:37 02:11:02 +V=300.2 T= 9.4 + +35 02:11:06 02:12:10 +Q= 52.6 T= 9.4 + +36 02:12:15 02:12:52 +P1=0.28 T= 2.9 + +37 02:12:57 02:13:39 +T= 0.9 + +38 02:13:45 02:13:54 +t= 54.5 T= 0.5 + +39 02:13:59 02:14:14 +tcam= 51.7 Tcam= 0.5 tfl= 53.2 Tfl= 0.5 + +40 02:14:18 02:14:25 +t= 54.2 T= 0.5 + +21 13:38:08 13:38:11 +Rsk= 33.4 Rkk= 29.4 + +22 13:59:28 14:09:32 +P1= 41.3 T1=14:04:32 P2= 63.8 T2=14:09:32 Vs= 4.50 + +21 16:48:47 16:48:50 +Rsk= 33.5 Rkk= 29.7 + +22 17:17:43 17:32:48 +P1= 55.6 T1=17:27:48 P2= 68.7 T2=17:32:48 Vs= 2.62 + +20 18:26:09 18:26:17 +Riz_sol= 2916.0 + +21 18:26:26 18:26:29 +Rsk= 33.5 Rkk= 29.6 + +22 18:56:25 19:11:29 +P1= 45.5 T1=19:06:29 P2= 58.3 T2=19:11:29 Vs= 2.55 + +23 19:11:37 19:11:42 + + +24 19:11:51 19:12:26 + + +30 19:12:37 19:13:08 +Vst= 29.5 + +31 19:13:10 19:13:43 +Rom_sol= 9.6 + +41 19:14:11 19:14:16 +Ukz= 1.70 + +32 19:14:17 19:14:51 +Imax=11.0 Umax=50.0 T= 9.0 + +33 05:00:00 19:15:11 +Imin=16.0 Umin=25.0 T= 0.5 + +34 05:00:00 19:15:37 +V=300.1 T= 9.4 + +35 19:15:40 19:16:39 +Q= 52.9 T= 9.4 + +36 19:16:42 19:17:16 +P1=0.30 T= 2.9 + +37 19:17:18 19:17:56 +T= 0.9 + +38 19:17:57 19:18:04 +t= 54.5 T= 0.5 + +40 19:18:08 19:18:15 +t= 54.2 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.293 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.293 new file mode 100644 index 0000000..eab04c5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.293 @@ -0,0 +1,23 @@ +7 00:15:07 1593285307 +8 01:01:23 1593288083 +25 02:07:39 1593292059 +9 02:21:12 1593292872 +8 02:31:57 1593293517 +9 02:41:28 1593294088 +10 03:15:59 1593296159 +12 07:58:35 1593313115 +13 12:22:09 1593328929 +0 12:22:09 1593328929 +14 13:36:19 1593333379 +15 14:21:02 1593336062 +16 14:37:40 1593337060 +1 16:08:10 1593342490 +2 16:44:22 1593344662 +5 17:33:21 1593347601 +6 17:43:02 1593348182 +7 18:15:18 1593350118 +8 18:21:42 1593350502 +25 19:12:34 1593353554 +9 19:18:52 1593353932 +10 19:48:24 1593355704 +12 23:26:16 1593368776 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.294 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.294 new file mode 100644 index 0000000..151e147 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.294 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.296 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.296 new file mode 100644 index 0000000..bb3a875 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.296 @@ -0,0 +1,136 @@ +[65] +oper = 7 +begin = 28.06.2020 00:15:07 +norma = 30 +real = 46 + +[66] +oper = 8 +begin = 28.06.2020 01:01:23 +norma = 40 +vac_time = 6 +real = 66 + +[67] +oper = 25 +begin = 28.06.2020 02:07:39 +norma = 30 +real = 13 + +[68] +oper = 9 +begin = 28.06.2020 02:21:12 +norma = 0 +real = 10 + +[69] +oper = 8 +begin = 28.06.2020 02:31:57 +norma = 40 +real = 9 + +[70] +oper = 9 +begin = 28.06.2020 02:41:28 +norma = 0 +real = 34 + +[71] +oper = 10 +begin = 28.06.2020 03:15:59 +norma = 0 +real = 282 + +[72] +oper = 12 +begin = 28.06.2020 07:58:35 +norma = 105 +real = 263 + +[73] +oper = 13 +begin = 28.06.2020 12:22:09 +norma = 45 +real = 74 + +[74] +oper = 14 +begin = 28.06.2020 13:36:19 +norma = 40 +vac_time = 6 +real = 44 + +[75] +oper = 15 +begin = 28.06.2020 14:21:02 +norma = 30 +real = 16 + +[76] +oper = 16 +begin = 28.06.2020 14:37:40 +norma = 40 +real = 90 + +[77] +oper = 1 +begin = 28.06.2020 16:08:10 +norma = 85 +real = 36 + +[78] +oper = 2 +begin = 28.06.2020 16:44:22 +norma = 110 +vac_time = 6 +real = 48 + +[79] +oper = 5 +begin = 28.06.2020 17:33:21 +norma = 25 +real = 9 + +[80] +oper = 6 +begin = 28.06.2020 17:43:02 +norma = 35 +real = 32 + +[81] +oper = 7 +begin = 28.06.2020 18:15:18 +norma = 30 +real = 6 + +[82] +oper = 8 +begin = 28.06.2020 18:21:42 +norma = 40 +vac_time = 6 +real = 50 + +[83] +oper = 25 +begin = 28.06.2020 19:12:34 +norma = 30 +real = 6 + +[84] +oper = 9 +begin = 28.06.2020 19:18:52 +norma = 0 +real = 29 + +[85] +oper = 10 +begin = 28.06.2020 19:48:24 +norma = 0 +real = 217 + +[86] +oper = 12 +begin = 28.06.2020 23:26:16 +norma = 105 +real = 185 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.297 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.297 new file mode 100644 index 0000000..5fc9891 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.297 @@ -0,0 +1,62 @@ +02:06:52 1593292012 祭 ॣ '-2'(A) +02:07:29 1593292049 ⪫祭 ॣ '-2'(A) +02:19:35 1593292775 祭 ० ࠧ +02:19:37 1593292777 祭 ० ' ⮪ 㣨' +02:20:03 1593292803 ⪫祭 ० ࠧ +02:20:10 1593292810 ⪫祭 ० ' ⮪ 㣨' +02:20:38 1593292838 祭 ० ࠧ +02:20:40 1593292840 祭 ० ' ⮪ 㣨' +02:22:30 1593292950 祭 ॣ '-2'(A) +02:30:57 1593293457 ⪫祭 ० ' ⮪ 㣨' +02:30:59 1593293459 ⪫祭 ॣ '-2'(A) +02:31:58 1593293518 ⪫祭 ० ࠧ +02:41:16 1593294076 祭 ० ࠧ +02:41:17 1593294077 祭 ० ' ⮪ 㣨' +02:42:03 1593294123 ⪫祭 ० ࠧ +02:42:06 1593294126 祭 ० ࠧ +02:42:16 1593294136 ⪫祭 ० ࠧ +02:42:26 1593294146 ⪫祭 ० ' ⮪ 㣨' +02:42:31 1593294151 祭 ० ࠧ +02:42:35 1593294155 祭 ० ' ⮪ 㣨' +02:44:02 1593294242 祭 ॣ '-2'(A) +03:15:59 1593296159 ⪫祭 ० ࠧ (A) +03:16:00 1593296160 祭 ⠭ ॣ +07:45:06 1593312306 祭 ० +07:45:07 1593312307 ⪫祭 ॣ '-2'(A) +07:45:08 1593312308 祭 ॣ '-2'(A) +07:48:35 1593312515 ⪫祭 ० ' ⮪ 㣨' +07:58:39 1593313119 ⪫祭 ॣ '-2'(A) +07:59:20 1593313160 祭 ० ᪠ +08:01:50 1593313310 ⪫祭 ० ᪠ +08:55:06 1593316506 ⪫祭 ० (A) +14:20:51 1593336051 祭 ० ࠧ +14:20:53 1593336053 祭 ० ' ⮪ 㣨' +14:21:48 1593336108 祭 ॣ '-2'(A) +14:36:50 1593337010 ⪫祭 ० ࠧ (A) +14:36:58 1593337018 ⪫祭 ० ' ⮪ 㣨' +14:37:45 1593337065 ⪫祭 ॣ '-2'(A) +14:38:19 1593337099 祭 ० ᪠ +14:38:19 1593337099 祭 ० ᪠ +14:38:20 1593337100 祭 ० ᪠ +14:38:20 1593337100 祭 ० ᪠ +14:38:20 1593337100 祭 ० ᪠ +14:38:20 1593337100 祭 ० ᪠ +14:40:47 1593337247 ⪫祭 ० ᪠ +17:43:12 1593348192 祭 ० ᪠ +17:45:50 1593348350 ⪫祭 ० ᪠ (A) +19:11:52 1593353512 祭 ॣ '-2'(A) +19:12:27 1593353547 ⪫祭 ॣ '-2'(A) +19:18:23 1593353903 祭 ० ࠧ +19:18:25 1593353905 祭 ० ' ⮪ 㣨' +19:20:24 1593354024 祭 ॣ '-2'(A) +19:48:24 1593355704 祭 ⠭ ॣ +19:48:24 1593355704 ⪫祭 ० ࠧ (A) +23:15:35 1593368135 祭 ० +23:15:36 1593368136 ⪫祭 ॣ '-2'(A) +23:15:38 1593368138 祭 ॣ '-2'(A) +23:18:44 1593368324 ⪫祭 ० ' ⮪ 㣨' +23:26:20 1593368780 ⪫祭 ॣ '-2'(A) +23:27:03 1593368823 祭 ० ᪠ +23:27:03 1593368823 祭 ० ᪠ +23:27:04 1593368824 祭 ० ᪠ +23:29:40 1593368980 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.299 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.299 new file mode 100644 index 0000000..ae23c2a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.299 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.390 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.390 new file mode 100644 index 0000000..26fa3bf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.390 @@ -0,0 +1,8 @@ +03:21:48 1593296508 1 09414 8 4550 9 3380 10 495 +04:46:17 1593301577 2 BT 3-1, 6, 8, 9, 14, 15, 16 +06:29:19 1593307759 1 09414 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 4550 9 3380 10 495 11 12 321547 +06:54:45 1593309285 0 A--32-090-2018 ॢ 2 +15:41:13 1593340873 4 2 7 770 9 5000 10 690 12 1075 +16:25:04 1593343504 1 09415 +16:30:55 1593343855 1 09415 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4550 9 5000 10 690 11 12 1075 +17:13:45 1593346425 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.391 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.391 new file mode 100644 index 0000000..1c05fa1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.391 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.392 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.392 new file mode 100644 index 0000000..6bc5b4f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.392 @@ -0,0 +1,126 @@ +21 03:18:32 03:18:40 +Rsk= 22.0 Rkk= 16.3 + +22 03:58:45 04:08:53 +P1= 54.7 T1=04:03:52 P2= 63.1 T2=04:08:53 Vs= 1.69 + +20 05:32:56 05:33:07 +Riz_sol= 241.1 + +21 05:33:21 05:33:29 +Rsk= 21.7 Rkk= 16.1 + +22 06:01:24 06:11:31 +P1= 56.1 T1=06:06:31 P2= 66.4 T2=06:11:31 Vs= 2.05 + +23 06:14:00 06:14:06 + + +24 06:14:15 06:14:51 + + +30 06:15:09 06:15:47 +Vst= 27.6 + +31 06:15:56 06:16:34 +Rom_sol= 13.6 + +41 06:17:12 06:17:17 +Ukz= 2.62 + +41 06:18:48 06:18:53 +Ukz= 3.17 + +41 06:19:10 06:19:15 +Ukz= 3.10 + +41 06:21:48 06:21:53 +Ukz= 2.91 + +41 06:22:54 06:22:59 +Ukz= 1.78 + +32 06:23:05 06:24:13 +Imax=11.1 Umax=50.0 T= 9.4 + +33 06:24:17 06:24:51 +Imin=16.2 Umin=25.1 T= 2.3 + +34 06:24:55 06:25:22 +V=301.3 T= 9.5 + +35 06:25:27 06:26:20 +Q= 54.9 T= 9.3 + +36 06:26:26 06:26:59 +P1=0.27 T= 3.0 + +37 06:27:03 06:27:32 +T= 0.8 + +38 06:27:37 06:27:48 +t= 51.5 T= 0.7 + +39 06:27:55 06:28:02 +t= 51.6 T= 0.7 + +40 06:28:06 06:28:12 +t= 51.6 T= 0.5 + +21 15:41:27 15:41:35 +Rsk= 22.1 Rkk= 16.5 + +20 15:42:43 15:42:53 +Riz_sol= 0.0 + +20 15:42:58 15:43:08 +Riz_sol= 0.0 + +20 15:47:28 15:47:38 +Riz_sol= 901.8 + +22 16:05:04 16:20:12 +P1= 85.9 T1=16:15:12 P2= 99.5 T2=16:20:12 Vs= 2.72 + +24 16:20:33 16:21:06 + + +23 16:21:22 16:21:28 + + +30 16:21:48 16:22:29 +Vst= 27.3 + +31 16:22:35 16:23:12 +Rom_sol= 14.9 + +21 16:24:08 16:24:16 +Rsk= 16.3 Rkk= 16.4 + +32 16:25:50 16:26:57 +Imax=11.1 Umax=50.0 T= 9.2 + +33 16:27:00 16:27:31 +Imin=16.3 Umin=25.1 T= 2.3 + +34 16:27:34 16:28:01 +V=301.3 T= 9.5 + +35 16:28:03 16:29:02 +Q= 54.1 T= 9.2 + +40 16:29:04 16:29:09 +t= 51.6 T= 0.8 + +39 16:29:12 16:29:16 +t= 51.6 T= 0.5 + +38 16:29:19 16:29:25 +t= 51.5 T= 0.5 + +37 16:29:27 16:29:55 +T= 0.8 + +36 16:29:58 16:30:30 +P1=0.26 T= 3.1 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.393 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.393 new file mode 100644 index 0000000..ca1b6d6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.393 @@ -0,0 +1,18 @@ +13 01:21:13 1593289273 +0 01:21:13 1593289273 +2 03:12:55 1593295975 +5 04:09:50 1593299390 +6 04:24:27 1593300267 +7 05:06:51 1593302811 +8 05:30:06 1593304206 +25 06:15:04 1593306904 +9 06:29:19 1593307759 +10 06:54:45 1593309285 +12 09:40:56 1593319256 +13 12:42:53 1593330173 +0 12:42:53 1593330173 +8 15:31:11 1593340271 +25 16:21:37 1593343297 +9 16:30:55 1593343855 +10 17:13:45 1593346425 +11 21:17:23 1593361043 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.394 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.394 new file mode 100644 index 0000000..64ebe39 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.394 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.396 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.396 new file mode 100644 index 0000000..bb2eb05 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.396 @@ -0,0 +1,99 @@ +[67] +oper = 13 +begin = 28.06.2020 01:21:13 +norma = 45 +real = 111 + +[68] +oper = 2 +begin = 28.06.2020 03:12:55 +norma = 110 +vac_time = 9 +real = 56 + +[69] +oper = 5 +begin = 28.06.2020 04:09:50 +norma = 25 +real = 14 + +[70] +oper = 6 +begin = 28.06.2020 04:24:27 +norma = 35 +real = 42 + +[71] +oper = 7 +begin = 28.06.2020 05:06:51 +norma = 30 +real = 23 + +[72] +oper = 8 +begin = 28.06.2020 05:30:06 +norma = 40 +vac_time = 9 +real = 44 + +[73] +oper = 25 +begin = 28.06.2020 06:15:04 +norma = 30 +real = 14 + +[74] +oper = 9 +begin = 28.06.2020 06:29:19 +norma = 0 +real = 25 + +[75] +oper = 10 +begin = 28.06.2020 06:54:45 +norma = 0 +real = 166 + +[76] +oper = 12 +begin = 28.06.2020 09:40:56 +norma = 105 +real = 181 + +[77] +oper = 13 +begin = 28.06.2020 12:42:53 +norma = 45 +real = 168 + +[78] +oper = 8 +begin = 28.06.2020 15:31:11 +norma = 40 +vac_time = 17 +real = 50 + +[79] +oper = 25 +begin = 28.06.2020 16:21:37 +norma = 30 +real = 9 + +[80] +oper = 9 +begin = 28.06.2020 16:30:55 +norma = 0 +real = 42 + +[81] +oper = 10 +begin = 28.06.2020 17:13:45 +norma = 0 +real = 243 + +[82] +oper = 11 +begin = 28.06.2020 21:17:23 +norma = 0 +real = 167 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.397 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.397 new file mode 100644 index 0000000..6247e71 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.397 @@ -0,0 +1,30 @@ +04:25:30 1593300330 祭 ० ᪠ +04:25:32 1593300332 祭 ० ᪠ +04:25:32 1593300332 祭 ० ᪠ +04:25:33 1593300333 祭 ० ᪠ +04:28:23 1593300503 ⪫祭 ० ᪠ (A) +06:14:17 1593306857 祭 ॣ '-2'(A) +06:14:52 1593306892 ⪫祭 ॣ '-2'(A) +06:28:33 1593307713 祭 ० ࠧ +06:28:36 1593307716 祭 ० ' ⮪ 㣨' +06:30:46 1593307846 祭 ॣ '-2'(A) +06:54:45 1593309285 ⪫祭 ० ࠧ (A) +06:54:45 1593309285 祭 ⠭ ॣ +09:25:00 1593318300 祭 ० +09:25:01 1593318301 ⪫祭 ॣ '-2'(A) +09:25:02 1593318302 祭 ॣ '-2'(A) +09:29:24 1593318564 ⪫祭 ० ' ⮪ 㣨' +09:41:01 1593319261 ⪫祭 ॣ '-2'(A) +09:41:32 1593319292 祭 ० ᪠ +09:44:12 1593319452 ⪫祭 ० ᪠ (A) +10:35:00 1593322500 ⪫祭 ० (A) +16:20:34 1593343234 祭 ॣ '-2'(A) +16:21:07 1593343267 ⪫祭 ॣ '-2'(A) +16:30:34 1593343834 祭 ० ࠧ +16:30:35 1593343835 祭 ० ' ⮪ 㣨' +16:56:40 1593345400 祭 ॣ '-2'(A) +17:13:45 1593346425 ⪫祭 ० ࠧ (A) +17:13:45 1593346425 祭 ⠭ ॣ +21:17:22 1593361042 祭 ० +21:17:22 1593361042 ⪫祭 ॣ '-2'(A) +21:17:23 1593361043 祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200628.399 b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.399 new file mode 100644 index 0000000..4fcdc35 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200628.399 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200629.390 b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.390 new file mode 100644 index 0000000..71accc7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.390 @@ -0,0 +1,8 @@ +03:44:13 1593384253 2 BT 18, 20, 22, 23, 25 9 4900 10 670 +04:30:59 1593387059 1 09416 +08:28:03 1593401283 1 09416 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 4550 9 4900 10 670 11 12 1075 +17:38:50 1593434330 3 14 +18:24:13 1593437053 0 A--32-067-2014 ॢ 0 +19:50:51 1593442251 1 09417 3 25 4 1 9 5370 10 650 12 1727 +22:59:14 1593453554 1 09417 2 BT 18, 20, 22, 23, 25 3 25 4 1 5 Ti 6 7 770 8 4550 9 5370 10 650 11 12 1727 +23:32:50 1593455570 0 A--32-129-2018 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200629.391 b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.391 new file mode 100644 index 0000000..f70d017 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.391 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200629.392 b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.392 new file mode 100644 index 0000000..8092aa2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.392 @@ -0,0 +1,129 @@ +21 03:41:09 03:41:17 +Rsk= 21.8 Rkk= 16.2 + +22 04:08:50 04:18:58 +P1= 53.0 T1=04:13:58 P2= 60.1 T2=04:18:58 Vs= 1.41 + +20 06:39:30 06:39:40 +Riz_sol= 652.2 + +21 06:39:47 06:39:55 +Rsk= 22.2 Rkk= 16.6 + +22 07:16:58 07:27:06 +P1= 49.6 T1=07:22:06 P2= 55.2 T2=07:27:06 Vs= 1.12 + +22 08:05:47 08:15:55 +P1= 49.1 T1=08:10:55 P2= 53.0 T2=08:15:55 Vs= 0.77 + +23 08:17:34 08:17:40 + + +24 08:17:50 08:18:13 + + +24 08:18:42 08:19:18 + + +30 08:19:37 08:20:17 +Vst= 27.3 + +31 08:20:30 08:21:09 +Rom_sol= 14.8 + +41 08:21:49 08:21:54 +Ukz= 0.94 + +32 08:22:00 08:23:08 +Imax=11.1 Umax=50.0 T= 9.4 + +33 08:23:14 08:23:46 +Imin=16.2 Umin=25.0 T= 2.3 + +34 08:23:50 08:24:18 +V=301.3 T= 9.5 + +35 08:24:21 08:25:26 +Q= 54.5 T= 9.2 + +36 08:25:31 08:26:04 +P1=0.28 T= 3.0 + +37 08:26:11 08:26:38 +T= 0.7 + +38 08:26:44 08:26:50 +t= 51.5 T= 0.8 + +39 08:26:55 08:27:00 +t= 51.6 T= 0.7 + +40 08:27:05 08:27:11 +t= 51.6 T= 0.7 + +21 17:38:59 17:39:07 +Rsk= 22.3 Rkk= 16.6 + +22 17:55:09 18:05:16 +P1= 55.0 T1=18:00:16 P2= 59.7 T2=18:05:16 Vs= 0.94 + +21 19:50:09 19:50:17 +Rsk= 21.0 Rkk= 15.4 + +22 20:15:34 20:30:42 +P1= 85.4 T1=20:25:42 P2= 97.4 T2=20:30:42 Vs= 2.41 + +20 21:38:44 21:38:54 +Riz_sol= 265.9 + +21 21:39:02 21:39:10 +Rsk= 22.1 Rkk= 16.5 + +22 22:10:55 22:21:03 +P1= 50.0 T1=22:16:03 P2= 55.2 T2=22:21:03 Vs= 1.05 + +22 22:34:59 22:45:07 +P1= 47.6 T1=22:40:07 P2= 51.6 T2=22:45:07 Vs= 0.79 + +23 22:45:27 22:45:33 + + +24 22:45:40 22:46:14 + + +30 22:46:26 22:47:13 +Vst= 27.4 + +31 22:47:23 22:48:00 +Rom_sol= 14.8 + +41 22:49:46 22:49:51 +Ukz= 1.09 + +32 22:49:54 22:51:00 +Imax=11.1 Umax=50.0 T= 9.4 + +33 22:51:08 22:51:41 +Imin=16.2 Umin=25.0 T= 2.3 + +34 22:51:45 22:52:12 +V=301.4 T= 9.5 + +35 22:52:18 22:53:17 +Q= 54.8 T= 9.1 + +40 22:53:22 22:53:28 +t= 51.6 T= 0.5 + +39 22:53:31 22:53:36 +t= 51.6 T= 0.7 + +38 22:53:38 22:53:43 +t= 51.5 T= 0.7 + +37 22:53:47 22:54:13 +T= 0.7 + +36 22:54:20 22:54:51 +P1=0.28 T= 3.0 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200629.393 b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.393 new file mode 100644 index 0000000..72d7efb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.393 @@ -0,0 +1,28 @@ +12 00:04:36 1593371076 +13 01:54:33 1593377673 +0 01:54:33 1593377673 +2 03:38:38 1593383918 +5 04:32:53 1593387173 +6 04:50:09 1593388209 +7 05:31:36 1593390696 +8 06:37:27 1593394647 +25 08:19:29 1593400769 +9 08:28:03 1593401283 +10 09:08:10 1593403690 +11 13:14:21 1593418461 +12 13:15:46 1593418546 +13 17:27:38 1593433658 +0 17:27:38 1593433658 +14 17:38:46 1593434326 +15 18:05:46 1593435946 +16 18:24:13 1593437053 +16 18:26:13 1593437173 +1 18:50:55 1593438655 +2 19:49:45 1593442185 +5 20:31:35 1593444695 +6 20:39:51 1593445191 +7 21:26:04 1593447964 +8 21:37:01 1593448621 +25 22:46:23 1593452783 +9 22:59:14 1593453554 +10 23:32:50 1593455570 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200629.394 b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.394 new file mode 100644 index 0000000..f90f838 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.394 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200629.395 b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.395 new file mode 100644 index 0000000..2b5eb84 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.395 @@ -0,0 +1 @@ +30 08:18:13 1593400693 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200629.396 b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.396 new file mode 100644 index 0000000..46c86d8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.396 @@ -0,0 +1,162 @@ +[83] +oper = 12 +begin = 29.06.2020 00:04:36 +norma = 105 +real = 109 + +[84] +oper = 13 +begin = 29.06.2020 01:54:33 +norma = 45 +real = 104 + +[85] +oper = 2 +begin = 29.06.2020 03:38:38 +norma = 110 +vac_time = 9 +vac_avg10 = 9.6 +real = 54 + +[86] +oper = 5 +begin = 29.06.2020 04:32:53 +norma = 25 +real = 17 + +[87] +oper = 6 +begin = 29.06.2020 04:50:09 +norma = 35 +real = 41 + +[88] +oper = 7 +begin = 29.06.2020 05:31:36 +norma = 30 +real = 65 + +[89] +oper = 8 +begin = 29.06.2020 06:37:27 +norma = 40 +vac_time = 9 +real = 102 + +[90] +oper = 25 +begin = 29.06.2020 08:19:29 +norma = 30 +real = 8 + +[91] +oper = 9 +begin = 29.06.2020 08:28:03 +norma = 0 +real = 40 + +[92] +oper = 10 +begin = 29.06.2020 09:08:10 +norma = 0 +real = 246 + +[93] +oper = 11 +begin = 29.06.2020 13:14:21 +norma = 0 +real = 1 + +[94] +oper = 12 +begin = 29.06.2020 13:15:46 +norma = 105 +real = 251 + +[95] +oper = 13 +begin = 29.06.2020 17:27:38 +norma = 45 +real = 11 + +[96] +oper = 14 +begin = 29.06.2020 17:38:46 +norma = 40 +vac_time = 8 +real = 27 + +[97] +oper = 15 +begin = 29.06.2020 18:05:46 +norma = 30 +real = 18 + +[98] +oper = 16 +begin = 29.06.2020 18:24:13 +norma = 40 +real = 2 + +[99] +oper = 16 +begin = 29.06.2020 18:26:13 +norma = 40 +real = 24 + +[00] +oper = 1 +begin = 29.06.2020 18:50:55 +norma = 85 +real = 58 + +[01] +oper = 2 +begin = 29.06.2020 19:49:45 +norma = 110 +vac_time = 8 +real = 41 + +[02] +oper = 5 +begin = 29.06.2020 20:31:35 +norma = 25 +real = 8 + +[03] +oper = 6 +begin = 29.06.2020 20:39:51 +norma = 35 +real = 46 + +[04] +oper = 7 +begin = 29.06.2020 21:26:04 +norma = 30 +real = 10 + +[05] +oper = 8 +begin = 29.06.2020 21:37:01 +norma = 40 +vac_time = 8 +real = 69 + +[06] +oper = 25 +begin = 29.06.2020 22:46:23 +norma = 30 +real = 12 + +[07] +oper = 9 +begin = 29.06.2020 22:59:14 +norma = 0 +real = 33 + +[08] +oper = 10 +begin = 29.06.2020 23:32:50 +norma = 0 +real = 306 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200629.397 b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.397 new file mode 100644 index 0000000..75e4390 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.397 @@ -0,0 +1,44 @@ +00:04:20 1593371060 ⪫祭 ० (A) +00:04:37 1593371077 ⪫祭 ० ' ⮪ 㣨' +00:04:41 1593371081 ⪫祭 ॣ '-2'(A) +00:05:31 1593371131 祭 ० ᪠ +00:05:31 1593371131 祭 ० ᪠ +00:05:31 1593371131 祭 ० ᪠ +00:08:25 1593371305 ⪫祭 ० ᪠ (A) +04:47:39 1593388059 祭 ० ᪠ +04:47:40 1593388060 祭 ० ᪠ +04:50:30 1593388230 ⪫祭 ० ᪠ (A) +08:17:52 1593400672 祭 ॣ '-2'(A) +08:18:13 1593400693 ⪫祭 ॣ '-2'(A) +08:18:43 1593400723 祭 ॣ '-2'(A) +08:19:19 1593400759 ⪫祭 ॣ '-2'(A) +09:07:39 1593403659 祭 ॣ '-2' +09:08:09 1593403689 祭 ⠭ ॣ +13:02:38 1593417758 ⪫祭 ॣ '-2' +13:16:58 1593418618 祭 ० ᪠ +13:19:42 1593418782 ⪫祭 ० ᪠ (A) +18:05:28 1593435928 祭 ० ࠧ +18:05:29 1593435929 祭 ० ' ⮪ 㣨' +18:05:30 1593435930 祭 ॣ '-2'(A) +18:24:13 1593437053 ⪫祭 ० ࠧ (A) +18:24:52 1593437092 ⪫祭 ० ' ⮪ 㣨' +18:26:17 1593437177 ⪫祭 ॣ '-2'(A) +18:26:37 1593437197 祭 ० ᪠ +18:29:24 1593437364 ⪫祭 ० ᪠ (A) +20:40:14 1593445214 祭 ० ᪠ +20:42:53 1593445373 ⪫祭 ० ᪠ (A) +22:45:42 1593452742 祭 ॣ '-2'(A) +22:46:14 1593452774 ⪫祭 ॣ '-2'(A) +22:58:43 1593453523 祭 ० ࠧ +22:58:44 1593453524 祭 ० ' ⮪ 㣨' +23:00:51 1593453651 祭 ॣ '-2'(A) +23:32:50 1593455570 祭 ⠭ ॣ +23:32:50 1593455570 ⪫祭 ० ࠧ (A) +23:39:25 1593455965 ⪫祭 ० ' ⮪ 㣨' +23:39:29 1593455969 祭 ० ' ⮪ 㣨' +23:40:06 1593456006 ⪫祭 ० ' ⮪ 㣨' +23:40:07 1593456007 祭 ० ' ⮪ 㣨' +23:40:08 1593456008 ⪫祭 ० ' ⮪ 㣨' +23:40:11 1593456011 祭 ० ' ⮪ 㣨' +23:41:49 1593456109 ⪫祭 ० ' ⮪ 㣨' +23:41:53 1593456113 祭 ० ' ⮪ 㣨' diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200629.399 b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.399 new file mode 100644 index 0000000..703a72b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200629.399 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.330 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.330 new file mode 100644 index 0000000..7019210 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.330 @@ -0,0 +1,4 @@ +06:15:15 1593479715 1 11186 2 BT 18, 20, 22, 23, 25 3 25 9 4820 +10:15:32 1593494132 1 11186 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 4810 9 4820 10 690 11 12 321315 +10:58:16 1593496696 0 A--32-031-2016 ॢ 5 +20:58:45 1593532725 1 11187 9 3660 10 670 11 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.331 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.331 new file mode 100644 index 0000000..5be83ec Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.331 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.332 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.332 new file mode 100644 index 0000000..a0a6bf3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.332 @@ -0,0 +1,66 @@ +20 05:47:33 05:47:43 +Riz_sol= 2870.4 + +21 05:47:50 05:47:58 +Rsk= 20.7 Rkk= 15.4 + +22 06:34:42 06:45:12 +P1= 4.8 T1=06:40:12 P2= 14.9 T2=06:45:12 Vs= 2.03 + +22 09:55:37 10:06:08 +P1= 1.8 T1=10:01:08 P2= 4.9 T2=10:06:08 Vs= 0.62 + +23 10:06:20 10:06:26 + + +24 10:06:31 10:07:08 + + +30 10:07:20 10:08:01 +Vst= 28.4 + +31 10:08:05 10:08:45 +Rom_sol= 15.0 + +32 10:09:22 10:10:30 +Imax=11.0 Umax=50.0 T= 9.4 + +33 10:10:33 10:11:03 +Imin=16.1 Umin=25.0 T= 0.8 + +34 10:11:06 10:11:34 +V=301.7 T= 9.6 + +35 10:11:37 10:12:46 +Q= 55.0 T= 9.2 + +36 10:12:49 10:13:22 +P1=0.29 T= 3.0 + +37 10:13:25 10:14:02 +T= 0.7 + +38 10:14:05 10:14:11 +t= 52.1 T= 0.7 + +39 10:14:14 10:14:20 +t= 52.3 T= 0.7 + +40 10:14:23 10:14:29 +t= 51.9 T= 0.8 + +21 20:56:09 20:56:17 +Rsk= 20.7 Rkk= 15.4 + +22 21:20:00 21:35:29 +P1= 29.2 T1=21:30:29 P2= 39.9 T2=21:35:29 Vs= 2.13 + +21 22:56:28 22:56:36 +Rsk= 20.9 Rkk= 15.6 + +20 22:59:07 22:59:17 +Riz_sol= 2725.0 + +22 23:15:00 23:30:30 +P1= 34.4 T1=23:25:30 P2= 46.3 T2=23:30:30 Vs= 2.37 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.333 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.333 new file mode 100644 index 0000000..b997634 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.333 @@ -0,0 +1,16 @@ +12 00:30:23 1593459023 +13 02:24:32 1593465872 +0 02:24:32 1593465872 +8 05:46:02 1593477962 +25 10:07:18 1593493638 +9 10:15:32 1593494132 +10 10:58:16 1593496696 +11 14:54:48 1593510888 +12 17:42:14 1593520934 +13 19:29:07 1593527347 +0 19:29:07 1593527347 +2 20:54:12 1593532452 +5 21:36:29 1593534989 +6 21:48:18 1593535698 +7 22:24:09 1593537849 +8 22:51:44 1593539504 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.334 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.334 new file mode 100644 index 0000000..79b107a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.334 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.336 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.336 new file mode 100644 index 0000000..1420f29 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.336 @@ -0,0 +1,87 @@ +[31] +oper = 12 +begin = 30.06.2020 00:30:23 +norma = 105 +real = 114 + +[32] +oper = 13 +begin = 30.06.2020 02:24:32 +norma = 45 +real = 201 + +[33] +oper = 8 +begin = 30.06.2020 05:46:02 +norma = 40 +vac_time = 8 +real = 261 + +[34] +oper = 25 +begin = 30.06.2020 10:07:18 +norma = 30 +real = 8 + +[35] +oper = 9 +begin = 30.06.2020 10:15:32 +norma = 0 +real = 42 + +[36] +oper = 10 +begin = 30.06.2020 10:58:16 +norma = 0 +real = 236 + +[37] +oper = 11 +begin = 30.06.2020 14:54:48 +norma = 0 +real = 167 + +[38] +oper = 12 +begin = 30.06.2020 17:42:14 +norma = 105 +real = 106 + +[39] +oper = 13 +begin = 30.06.2020 19:29:07 +norma = 45 +real = 85 + +[40] +oper = 2 +begin = 30.06.2020 20:54:12 +norma = 110 +vac_time = 9 +real = 42 + +[41] +oper = 5 +begin = 30.06.2020 21:36:29 +norma = 25 +real = 11 + +[42] +oper = 6 +begin = 30.06.2020 21:48:18 +norma = 35 +real = 35 + +[43] +oper = 7 +begin = 30.06.2020 22:24:09 +norma = 30 +real = 27 + +[44] +oper = 8 +begin = 30.06.2020 22:51:44 +norma = 40 +vac_time = 8 +real = 1529 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.337 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.337 new file mode 100644 index 0000000..d3fdfe4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.337 @@ -0,0 +1,146 @@ +00:29:07 1593458947 ⪫祭 ० (A) +00:30:24 1593459024 ⪫祭 ० ' ⮪ 㣨' +00:31:51 1593459111 祭 ० ᪠ +00:31:51 1593459111 祭 ० ᪠ +00:31:53 1593459113 . ⪫祭 ० ᪠ (A) +00:31:57 1593459117 祭 ० ᪠ +00:31:57 1593459117 . ⪫祭 ० ᪠ (A) +00:31:57 1593459117 祭 ० ᪠ +00:31:57 1593459117 . ⪫祭 ० ᪠ (A) +00:31:57 1593459117 祭 ० ᪠ +00:31:57 1593459117 . ⪫祭 ० ᪠ (A) +00:32:22 1593459142 祭 ० ᪠ +00:32:22 1593459142 . ⪫祭 ० ᪠ (A) +00:32:23 1593459143 祭 ० ᪠ +00:32:23 1593459143 . ⪫祭 ० ᪠ (A) +00:32:23 1593459143 祭 ० ᪠ +00:32:23 1593459143 . ⪫祭 ० ᪠ (A) +00:32:23 1593459143 祭 ० ᪠ +00:32:23 1593459143 . ⪫祭 ० ᪠ (A) +00:32:24 1593459144 祭 ० ᪠ +00:32:24 1593459144 . ⪫祭 ० ᪠ (A) +00:32:27 1593459147 祭 ० ᪠ +00:32:27 1593459147 . ⪫祭 ० ᪠ (A) +00:32:27 1593459147 祭 ० ᪠ +00:32:27 1593459147 . ⪫祭 ० ᪠ (A) +00:32:28 1593459148 祭 ० ᪠ +00:32:28 1593459148 . ⪫祭 ० ᪠ (A) +00:32:28 1593459148 祭 ० ᪠ +00:32:28 1593459148 . ⪫祭 ० ᪠ (A) +00:32:28 1593459148 祭 ० ᪠ +00:32:28 1593459148 . ⪫祭 ० ᪠ (A) +00:32:28 1593459148 祭 ० ᪠ +00:32:28 1593459148 . ⪫祭 ० ᪠ (A) +00:32:29 1593459149 祭 ० ᪠ +00:32:29 1593459149 . ⪫祭 ० ᪠ (A) +00:32:35 1593459155 祭 ० ᪠ +00:32:35 1593459155 . ⪫祭 ० ᪠ (A) +00:32:35 1593459155 祭 ० ᪠ +00:32:35 1593459155 . ⪫祭 ० ᪠ (A) +00:32:35 1593459155 祭 ० ᪠ +00:32:35 1593459155 . ⪫祭 ० ᪠ (A) +00:32:35 1593459155 祭 ० ᪠ +00:32:35 1593459155 . ⪫祭 ० ᪠ (A) +00:32:35 1593459155 祭 ० ᪠ +00:32:35 1593459155 . ⪫祭 ० ᪠ (A) +00:32:36 1593459156 祭 ० ᪠ +00:32:36 1593459156 . ⪫祭 ० ᪠ (A) +00:32:36 1593459156 祭 ० ᪠ +00:32:36 1593459156 . ⪫祭 ० ᪠ (A) +00:32:36 1593459156 祭 ० ᪠ +00:32:36 1593459156 . ⪫祭 ० ᪠ (A) +00:32:47 1593459167 祭 ० ᪠ +00:32:47 1593459167 . ⪫祭 ० ᪠ (A) +00:32:48 1593459168 祭 ० ᪠ +00:32:48 1593459168 . ⪫祭 ० ᪠ (A) +00:32:48 1593459168 祭 ० ᪠ +00:32:48 1593459168 . ⪫祭 ० ᪠ (A) +00:32:48 1593459168 祭 ० ᪠ +00:32:48 1593459168 . ⪫祭 ० ᪠ (A) +00:32:49 1593459169 祭 ० ᪠ +00:32:49 1593459169 . ⪫祭 ० ᪠ (A) +00:32:49 1593459169 祭 ० ᪠ +00:32:49 1593459169 . ⪫祭 ० ᪠ (A) +00:32:49 1593459169 祭 ० ᪠ +00:32:49 1593459169 . ⪫祭 ० ᪠ (A) +00:32:49 1593459169 祭 ० ᪠ +00:32:49 1593459169 . ⪫祭 ० ᪠ (A) +00:32:50 1593459170 祭 ० ᪠ +00:32:50 1593459170 . ⪫祭 ० ᪠ (A) +00:32:50 1593459170 祭 ० ᪠ +00:32:50 1593459170 . ⪫祭 ० ᪠ (A) +00:32:50 1593459170 祭 ० ᪠ +00:32:50 1593459170 . ⪫祭 ० ᪠ (A) +00:32:51 1593459171 祭 ० ᪠ +00:32:51 1593459171 . ⪫祭 ० ᪠ (A) +00:32:51 1593459171 祭 ० ᪠ +00:32:51 1593459171 . ⪫祭 ० ᪠ (A) +00:32:52 1593459172 祭 ० ᪠ +00:32:52 1593459172 . ⪫祭 ० ᪠ (A) +00:32:52 1593459172 祭 ० ᪠ +00:32:52 1593459172 . ⪫祭 ० ᪠ (A) +00:32:55 1593459175 祭 ० ᪠ +00:32:55 1593459175 . ⪫祭 ० ᪠ (A) +00:32:56 1593459176 祭 ० ᪠ +00:32:56 1593459176 . ⪫祭 ० ᪠ (A) +00:32:56 1593459176 祭 ० ᪠ +00:32:56 1593459176 . ⪫祭 ० ᪠ (A) +00:32:56 1593459176 祭 ० ᪠ +00:32:56 1593459176 . ⪫祭 ० ᪠ (A) +00:32:57 1593459177 祭 ० ᪠ +00:32:57 1593459177 . ⪫祭 ० ᪠ (A) +00:32:57 1593459177 祭 ० ᪠ +00:32:57 1593459177 . ⪫祭 ० ᪠ (A) +00:32:57 1593459177 祭 ० ᪠ +00:32:57 1593459177 . ⪫祭 ० ᪠ (A) +00:33:22 1593459202 祭 ० ᪠ +00:33:22 1593459202 . ⪫祭 ० ᪠ (A) +00:33:23 1593459203 祭 ० ᪠ +00:33:23 1593459203 . ⪫祭 ० ᪠ (A) +00:33:27 1593459207 祭 ० ᪠ +00:33:27 1593459207 . ⪫祭 ० ᪠ (A) +00:33:27 1593459207 祭 ० ᪠ +00:33:27 1593459207 . ⪫祭 ० ᪠ (A) +00:33:27 1593459207 祭 ० ᪠ +00:33:27 1593459207 . ⪫祭 ० ᪠ (A) +00:33:28 1593459208 祭 ० ᪠ +00:33:28 1593459208 . ⪫祭 ० ᪠ (A) +00:33:28 1593459208 祭 ० ᪠ +00:33:28 1593459208 . ⪫祭 ० ᪠ (A) +00:33:28 1593459208 祭 ० ᪠ +00:33:28 1593459208 . ⪫祭 ० ᪠ (A) +00:33:28 1593459208 祭 ० ᪠ +00:33:28 1593459208 . ⪫祭 ० ᪠ (A) +00:33:57 1593459237 祭 ० ᪠ +00:33:57 1593459237 . ⪫祭 ० ᪠ (A) +00:33:58 1593459238 祭 ० ᪠ +00:33:58 1593459238 . ⪫祭 ० ᪠ (A) +00:33:58 1593459238 祭 ० ᪠ +00:33:58 1593459238 . ⪫祭 ० ᪠ (A) +00:33:58 1593459238 祭 ० ᪠ +00:33:58 1593459238 . ⪫祭 ० ᪠ (A) +00:33:58 1593459238 祭 ० ᪠ +00:33:58 1593459238 . ⪫祭 ० ᪠ (A) +00:34:43 1593459283 祭 ० ᪠ +00:37:18 1593459438 ⪫祭 ० ᪠ +10:06:32 1593493592 祭 ॣ '-2'(A) +10:07:08 1593493628 ⪫祭 ॣ '-2'(A) +10:14:55 1593494095 祭 ० ࠧ +10:14:57 1593494097 祭 ० ' ⮪ 㣨' +10:41:12 1593495672 祭 ॣ '-2'(A) +10:58:16 1593496696 ⪫祭 ० ࠧ (A) +10:58:16 1593496696 祭 ⠭ ॣ +14:54:47 1593510887 祭 ० +14:54:47 1593510887 ⪫祭 ॣ '-2'(A) +14:54:49 1593510889 祭 ॣ '-2'(A) +17:41:44 1593520904 ⪫祭 ० (A) +17:42:16 1593520936 ⪫祭 ० ' ⮪ 㣨' +17:42:18 1593520938 ⪫祭 ॣ '-2'(A) +17:42:57 1593520977 祭 ० ᪠ +17:46:27 1593521187 ⪫祭 ० ᪠ (A) +20:58:47 1593532727 : 㦥 +21:48:34 1593535714 祭 ० ᪠ +21:48:35 1593535715 祭 ० ᪠ +21:48:35 1593535715 祭 ० ᪠ +21:48:35 1593535715 祭 ० ᪠ +21:51:47 1593535907 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.339 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.339 new file mode 100644 index 0000000..970ad41 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.339 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.340 new file mode 100644 index 0000000..4a8b8d7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.340 @@ -0,0 +1,5 @@ +01:35:20 1593462920 3 14 +04:31:13 1593473473 1 09622 2 BT 18, 20, 22, 23, 25 3 25 9 4680 10 690 12 321315 +06:00:59 1593478859 1 09622 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 4250 9 4680 10 690 11 12 321315 +06:43:33 1593481413 0 A--32-031-2016 ॢ 5 +18:54:24 1593525264 1 09623 2 BT 3-1, 6, 8, 9, 14, 15, 16 9 4740 12 321752 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.341 new file mode 100644 index 0000000..239da71 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.342 new file mode 100644 index 0000000..cbf4baf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.342 @@ -0,0 +1,69 @@ +21 01:34:22 01:34:25 +Rsk= 16.1 Rkk= 15.5 + +22 01:59:38 02:10:06 +P1= 21.3 T1=02:05:06 P2= 46.3 T2=02:10:06 Vs= 5.00 + +20 04:29:00 04:29:09 +Riz_sol= 1966.9 + +21 04:29:18 04:29:22 +Rsk= 16.5 Rkk= 15.9 + +22 05:39:47 05:50:13 +P1= 15.9 T1=05:45:13 P2= 23.6 T2=05:50:13 Vs= 1.54 + +23 05:52:35 05:52:41 + + +24 05:52:58 05:53:40 + + +30 05:53:51 05:54:15 +Vst= 31.0 + +31 05:54:19 05:54:53 +Rom_sol= 11.3 + +32 05:55:30 05:56:07 +Imax=11.0 Umax=50.1 T= 8.9 + +33 05:56:11 05:56:33 +Imin=16.0 Umin=25.0 T= 0.5 + +34 05:56:37 05:56:59 +V=300.4 T= 9.4 + +35 05:57:03 05:57:59 +Q= 53.9 T= 9.4 + +36 05:58:05 05:58:37 +P1=0.29 T= 3.0 + +37 05:58:42 05:59:05 +T= 1.0 + +38 05:59:10 05:59:18 +t= 51.9 T= 0.6 + +39 05:59:24 05:59:31 +t= 51.6 T= 0.6 + +39 05:59:39 05:59:46 +t= 51.7 T= 0.6 + +40 05:59:49 05:59:57 +t= 51.8 T= 0.6 + +40 06:00:03 06:00:11 +t= 51.8 T= 0.6 + +20 18:41:57 18:42:06 +Riz_sol= 1981.3 + +21 18:42:17 18:42:20 +Rsk= 16.8 Rkk= 16.2 + +22 19:21:51 19:37:18 +P1= 35.2 T1=19:32:18 P2= 45.0 T2=19:37:18 Vs= 1.95 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.343 new file mode 100644 index 0000000..7583d9b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.343 @@ -0,0 +1,15 @@ +13 01:00:20 1593460820 +0 01:00:20 1593460820 +14 01:31:36 1593462696 +15 02:11:09 1593465069 +16 02:36:33 1593466593 +1 03:24:46 1593469486 +8 04:26:09 1593473169 +25 05:53:48 1593478428 +9 06:00:59 1593478859 +10 06:43:33 1593481413 +11 10:30:23 1593495023 +12 13:17:30 1593505050 +13 15:06:20 1593511580 +0 15:06:20 1593511580 +8 18:31:54 1593523914 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.344 new file mode 100644 index 0000000..ec1c871 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.345 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.345 new file mode 100644 index 0000000..576ac0a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.345 @@ -0,0 +1,3 @@ +47 05:59:32 1593478772 +47 05:59:35 1593478775 +47 05:59:57 1593478797 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.346 new file mode 100644 index 0000000..1d92d30 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.346 @@ -0,0 +1,81 @@ +[85] +oper = 13 +begin = 30.06.2020 01:00:20 +norma = 45 +real = 31 + +[86] +oper = 14 +begin = 30.06.2020 01:31:36 +norma = 40 +vac_time = 7 +real = 39 + +[87] +oper = 15 +begin = 30.06.2020 02:11:09 +norma = 30 +real = 25 + +[88] +oper = 16 +begin = 30.06.2020 02:36:33 +norma = 40 +real = 48 + +[89] +oper = 1 +begin = 30.06.2020 03:24:46 +norma = 85 +real = 61 + +[90] +oper = 8 +begin = 30.06.2020 04:26:09 +norma = 40 +vac_time = 8 +real = 87 + +[91] +oper = 25 +begin = 30.06.2020 05:53:48 +norma = 30 +real = 7 + +[92] +oper = 9 +begin = 30.06.2020 06:00:59 +norma = 0 +real = 42 + +[93] +oper = 10 +begin = 30.06.2020 06:43:33 +norma = 0 +real = 226 + +[94] +oper = 11 +begin = 30.06.2020 10:30:23 +norma = 0 +real = 167 + +[95] +oper = 12 +begin = 30.06.2020 13:17:30 +norma = 105 +real = 108 + +[96] +oper = 13 +begin = 30.06.2020 15:06:20 +norma = 45 +real = 205 + +[97] +oper = 8 +begin = 30.06.2020 18:31:54 +norma = 40 +vac_time = 10 +real = 1797 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.347 new file mode 100644 index 0000000..146ab9c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.347 @@ -0,0 +1,22 @@ +02:10:37 1593465037 祭 ० ࠧ +02:10:40 1593465040 祭 ० ' ⮪ 㣨' +02:11:07 1593465067 祭 ॣ '-2'(A) +02:36:17 1593466577 ⪫祭 ० ' ⮪ 㣨' +02:36:37 1593466597 ⪫祭 ॣ '-2'(A) +02:37:14 1593466634 祭 ० ᪠ +02:40:19 1593466819 ⪫祭 ० ᪠ (A) +05:53:01 1593478381 祭 ॣ '-2'(A) +05:53:41 1593478421 ⪫祭 ॣ '-2'(A) +06:00:29 1593478829 祭 ० ࠧ +06:00:31 1593478831 祭 ० ' ⮪ 㣨' +06:26:29 1593480389 祭 ॣ '-2'(A) +06:43:33 1593481413 祭 ⠭ ॣ +06:43:33 1593481413 ⪫祭 ० ࠧ (A) +10:30:22 1593495022 祭 ० +10:30:22 1593495022 ⪫祭 ॣ '-2'(A) +10:30:23 1593495023 祭 ॣ '-2'(A) +12:22:22 1593501742 ⪫祭 ॣ '-2'(A) +13:17:20 1593505040 ⪫祭 ० (A) +13:17:31 1593505051 ⪫祭 ० ' ⮪ 㣨' +13:17:55 1593505075 祭 ० ᪠ +13:20:47 1593505247 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.349 new file mode 100644 index 0000000..19660d4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.370 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.370 new file mode 100644 index 0000000..1e5da95 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.370 @@ -0,0 +1,4 @@ +11:17:50 1593497870 1 06575 3 25 9 4830 +12:08:32 1593500912 1 06575 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 5100 9 4830 10 690 11 12 321730 +12:51:11 1593503471 0 A--32-031-2016 ॢ 5 +23:17:42 1593541062 1 06576 2 BT 18, 20, 22, 23, 25 8 5430 9 5430 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.371 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.371 new file mode 100644 index 0000000..54d5629 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.371 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.372 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.372 new file mode 100644 index 0000000..6d0ae38 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.372 @@ -0,0 +1,54 @@ +20 11:12:02 11:12:11 +Riz_sol= 4920.5 + +21 11:12:14 11:12:17 +Rsk= 14.6 Rkk= 10.0 + +22 11:45:02 12:00:07 +P1= 37.6 T1=11:55:07 P2= 48.4 T2=12:00:07 Vs= 2.16 + +23 12:01:03 12:01:08 + + +24 12:01:22 12:02:11 + + +30 12:02:23 12:02:47 +Vst= 28.5 + +31 12:02:49 12:03:27 +Rom_sol= 12.0 + +32 12:04:09 12:04:45 +Imax=10.9 Umax=50.1 T= 9.0 + +33 05:00:00 12:05:09 +Imin=15.9 Umin=25.0 T= 0.5 + +34 05:00:00 12:05:33 +V=300.2 T= 9.4 + +35 12:05:36 12:06:35 +Q= 54.7 T= 9.4 + +36 12:06:37 12:07:13 +P1=0.29 T= 2.9 + +37 12:07:15 12:07:45 +T= 0.9 + +38 12:07:47 12:07:54 +t= 52.7 T= 0.5 + +39 12:07:47 12:07:54 +t= 52.7 T= 0.5 + +40 12:07:57 12:08:03 +t= 52.8 T= 0.5 + +20 23:15:57 23:16:06 +Riz_sol= 4920.8 + +21 23:16:20 23:16:23 +Rsk= 14.5 Rkk= 10.0 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.373 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.373 new file mode 100644 index 0000000..1d82b87 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.373 @@ -0,0 +1,13 @@ +11 04:02:45 1593471765 +12 06:42:27 1593481347 +13 08:24:33 1593487473 +0 08:24:33 1593487473 +8 11:09:29 1593497369 +25 12:02:20 1593500540 +9 12:08:32 1593500912 +10 12:51:11 1593503471 +11 16:46:10 1593517570 +12 19:33:09 1593527589 +13 21:23:33 1593534213 +0 21:23:33 1593534213 +8 23:13:56 1593540836 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.374 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.374 new file mode 100644 index 0000000..8d93f2e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.374 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.376 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.376 new file mode 100644 index 0000000..a080eb8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.376 @@ -0,0 +1,68 @@ +[55] +oper = 11 +begin = 30.06.2020 04:02:45 +norma = 0 +real = 159 + +[56] +oper = 12 +begin = 30.06.2020 06:42:27 +norma = 105 +real = 102 + +[57] +oper = 13 +begin = 30.06.2020 08:24:33 +norma = 45 +real = 164 + +[58] +oper = 8 +begin = 30.06.2020 11:09:29 +norma = 40 +vac_time = 9 +real = 52 + +[59] +oper = 25 +begin = 30.06.2020 12:02:20 +norma = 30 +real = 6 + +[60] +oper = 9 +begin = 30.06.2020 12:08:32 +norma = 0 +real = 42 + +[61] +oper = 10 +begin = 30.06.2020 12:51:11 +norma = 0 +real = 234 + +[62] +oper = 11 +begin = 30.06.2020 16:46:10 +norma = 0 +real = 166 + +[63] +oper = 12 +begin = 30.06.2020 19:33:09 +norma = 105 +real = 110 + +[64] +oper = 13 +begin = 30.06.2020 21:23:33 +norma = 45 +real = 110 + +[65] +oper = 8 +begin = 30.06.2020 23:13:56 +norma = 40 +vac_time = 9 +real = 1742 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.377 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.377 new file mode 100644 index 0000000..e947701 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.377 @@ -0,0 +1,29 @@ +04:02:44 1593471764 祭 ० +04:02:45 1593471765 ⪫祭 ॣ '-2'(A) +06:33:52 1593480832 ⪫祭 ० (A) +06:34:42 1593480882 祭 ० ᪠ +06:34:44 1593480884 祭 ० ᪠ +06:34:44 1593480884 祭 ० ᪠ +06:34:44 1593480884 祭 ० ᪠ +06:34:44 1593480884 祭 ० ᪠ +06:34:45 1593480885 祭 ० ᪠ +06:34:45 1593480885 祭 ० ᪠ +06:34:45 1593480885 祭 ० ᪠ +06:34:45 1593480885 祭 ० ᪠ +06:37:18 1593481038 ⪫祭 ० ᪠ (A) +06:42:28 1593481348 ⪫祭 ० ' ⮪ 㣨' +12:01:25 1593500485 祭 ॣ '-2'(A) +12:02:12 1593500532 ⪫祭 ॣ '-2'(A) +12:08:07 1593500887 祭 ० ࠧ +12:08:09 1593500889 祭 ० ' ⮪ 㣨' +12:34:07 1593502447 祭 ॣ '-2'(A) +12:51:11 1593503471 ⪫祭 ० ࠧ (A) +12:51:12 1593503472 祭 ⠭ ॣ +16:46:09 1593517569 祭 ० +16:46:10 1593517570 ⪫祭 ॣ '-2'(A) +16:46:11 1593517571 祭 ॣ '-2'(A) +18:38:10 1593524290 ⪫祭 ॣ '-2'(A) +19:33:06 1593527586 ⪫祭 ० (A) +19:33:10 1593527590 ⪫祭 ० ' ⮪ 㣨' +19:34:06 1593527646 祭 ० ᪠ +19:37:41 1593527861 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200630.379 b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.379 new file mode 100644 index 0000000..549a911 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200630.379 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200701.331 b/Tests/bin/Debug/netcoreapp3.1/temp/20200701.331 new file mode 100644 index 0000000..a54ad1d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200701.331 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200701.334 b/Tests/bin/Debug/netcoreapp3.1/temp/20200701.334 new file mode 100644 index 0000000..d147c87 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200701.334 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200701.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200701.341 new file mode 100644 index 0000000..db00a81 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200701.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200701.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200701.344 new file mode 100644 index 0000000..b6943ca Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200701.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200701.371 b/Tests/bin/Debug/netcoreapp3.1/temp/20200701.371 new file mode 100644 index 0000000..4a5a930 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200701.371 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200701.374 b/Tests/bin/Debug/netcoreapp3.1/temp/20200701.374 new file mode 100644 index 0000000..897a757 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200701.374 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200702.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200702.344 new file mode 100644 index 0000000..6728d75 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200702.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200702.374 b/Tests/bin/Debug/netcoreapp3.1/temp/20200702.374 new file mode 100644 index 0000000..afc3dc9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200702.374 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200703.240 b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.240 new file mode 100644 index 0000000..940ead6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.240 @@ -0,0 +1,4 @@ +00:04:47 1593716687 12 24 1 01541 0 A-NTC-ALD-32-24027-2 2 TI6AL4V M5-8 4 01 13 8-01-05654 14 8446 8 3550 9 6629 17 2355 7 2355 15 4.43 16 52.0 +02:57:49 1593727069 12 24 1 01541 0 A-NTC-ALD-32-24027-2 2 TI6AL4V M5-8 4 01 13 8-01-05654 14 8446 8 3550 9 6629 17 2355 7 2355 15 4.43 16 52.0 +03:00:31 1593727231 12 24 1 01541 0 A-NTC-ALD-32-24027-2 2 TI6AL4V M5-8 4 01 13 8-01-05654 14 8446 8 3550 9 6629 17 2355 7 2355 15 4.43 16 52.0 +03:30:41 1593729041 12 24 1 01541 0 A-NTC-ALD-32-24027-2 2 TI6AL4V M5-8 4 01 13 8-01-05654 14 8446 8 3550 9 6629 17 2355 7 2355 15 4.43 16 52.0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200703.241 b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.241 new file mode 100644 index 0000000..22efea5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.241 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200703.242 b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.242 new file mode 100644 index 0000000..f436b2f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.242 @@ -0,0 +1,174 @@ +20 00:04:07 00:04:08 +0.4 + +20 00:04:15 00:04:17 +0.4 + +21 00:04:23 00:04:26 +128.3 171.2 + +21 00:04:28 00:04:29 +128.3 123.1 + +24 00:04:52 00:04:53 + + +23 00:04:54 00:04:56 + + +30 00:04:57 00:06:07 +7.0 10.0 + +41 00:07:11 00:07:16 + + +22 00:27:59 00:32:59 +P1=0.0109 P2=0.0550 T1=00:27:59 T2=00:32:59 Vs=0.0088 + +22 00:33:01 00:38:01 +P1=0.0552 P2=0.0888 T1=00:33:01 T2=00:38:01 Vs=0.0067 + +22 00:38:02 00:40:48 +P1=0.0888 P2=0.1057 T1=00:38:02 T2=00:40:48 Vs=0.0062 + +22 00:51:11 00:56:12 +P1=0.0065 P2=0.0342 T1=00:51:11 T2=00:56:12 Vs=0.0055 + +22 00:56:14 01:01:14 +P1=0.0342 P2=0.0570 T1=00:56:14 T2=01:01:14 Vs=0.0046 + +22 01:01:16 01:04:41 +P1=0.0573 P2=0.0719 T1=01:01:16 T2=01:04:41 Vs=0.0043 + +22 01:20:00 01:25:00 +P1=0.0042 P2=0.0260 T1=01:20:00 T2=01:25:00 Vs=0.0044 + +22 01:25:02 01:30:03 +P1=0.0260 P2=0.0450 T1=01:25:02 T2=01:30:03 Vs=0.0038 + +22 01:31:01 01:36:02 +P1=0.0485 P2=0.0673 T1=01:31:01 T2=01:36:02 Vs=0.0038 + +22 01:50:01 01:55:01 +P1=0.0032 P2=0.0229 T1=01:50:01 T2=01:55:01 Vs=0.0040 + +22 01:55:21 02:00:22 +P1=0.0239 P2=0.0424 T1=01:55:21 T2=02:00:22 Vs=0.0037 + +22 02:00:24 02:05:24 +P1=0.0424 P2=0.0598 T1=02:00:24 T2=02:05:24 Vs=0.0035 + +22 02:20:01 02:25:01 +P1=0.0024 P2=0.0206 T1=02:20:01 T2=02:25:01 Vs=0.0037 + +22 02:25:04 02:30:03 +P1=0.0209 P2=0.0380 T1=02:25:04 T2=02:30:03 Vs=0.0034 + +22 02:30:06 02:35:06 +P1=0.0380 P2=0.0550 T1=02:30:06 T2=02:35:06 Vs=0.0034 + +22 02:45:00 02:50:01 +P1=0.0019 P2=0.0196 T1=02:45:00 T2=02:50:01 Vs=0.0035 + +22 02:50:06 02:55:06 +P1=0.0198 P2=0.0365 T1=02:50:06 T2=02:55:06 Vs=0.0034 + +31 02:57:59 02:58:49 + + +22 02:57:59 03:00:09 +P1=0.0368 P2=0.0534 T1=02:57:59 T2=03:00:09 Vs=0.0033 + +22 03:15:02 03:20:03 +P1=0.0014 P2=0.0186 T1=03:15:02 T2=03:20:03 Vs=0.0034 + +22 03:20:03 03:25:04 +P1=0.0186 P2=0.0350 T1=03:20:03 T2=03:25:04 Vs=0.0033 + +22 03:25:06 03:30:06 +P1=0.0350 P2=0.0514 T1=03:25:06 T2=03:30:06 Vs=0.0032 + +38 03:44:39 03:44:47 +64.8 1.8 + +39 03:44:48 03:45:01 +64.5 1.8 + +40 03:45:04 03:45:12 +64.9 1.8 + +35 03:45:15 03:46:18 +50.5 10.4 + +37 03:46:19 03:46:42 +1.8 + +36 03:46:46 03:47:38 +0.1 4.2 + +34 03:47:41 03:48:04 +1.0 0.0 + +32 03:48:07 03:48:24 +0.5 56.3 10.7 + +33 03:48:28 03:48:33 +4.9 1.7 4.7 + +33 03:48:41 03:49:02 +0.8 2.3 4.1 + +21 16:31:52 16:31:53 +171.2 123.1 + +21 16:31:55 16:31:56 +162.1 162.1 + +22 16:45:06 16:47:10 +P1=0.0165 P2=0.0608 T1=16:45:06 T2=16:47:10 Vs=0.0217 + +22 16:47:10 16:48:08 +P1=0.0611 P2=0.0806 T1=16:47:10 T2=16:48:08 Vs=0.0202 + +22 16:48:09 16:48:20 +P1=0.0808 P2=0.0834 T1=16:48:09 T2=16:48:20 Vs=0.0171 + +22 16:52:53 16:54:09 +P1=0.0121 P2=0.0309 T1=16:52:53 T2=16:54:09 Vs=0.0150 + +22 16:54:10 16:54:54 +P1=0.0309 P2=0.0393 T1=16:54:10 T2=16:54:54 Vs=0.0113 + +22 16:54:55 16:56:12 +P1=0.0396 P2=0.0529 T1=16:54:55 T2=16:56:12 Vs=0.0104 + +22 16:56:13 16:56:33 +P1=0.0532 P2=0.0562 T1=16:56:13 T2=16:56:33 Vs=0.0097 + +21 17:01:53 17:01:55 +171.2 162.1 + +21 17:01:58 17:01:59 +162.1 162.1 + +22 17:12:04 17:13:06 +P1=0.0160 P2=0.0365 T1=17:12:04 T2=17:13:06 Vs=0.0202 + +22 17:13:07 17:14:07 +P1=0.0368 P2=0.0516 T1=17:13:07 T2=17:14:07 Vs=0.0146 + +22 17:14:07 17:14:53 +P1=0.0519 P2=0.0624 T1=17:14:07 T2=17:14:53 Vs=0.0137 + +22 17:14:55 17:16:56 +P1=0.0626 P2=0.0952 T1=17:14:55 T2=17:16:56 Vs=0.0160 + +22 17:16:57 17:17:11 +P1=0.0955 P2=0.0985 T1=17:16:57 T2=17:17:11 Vs=0.0142 + +22 17:25:32 17:25:39 +P1=0.0091 P2=0.0109 T1=17:25:32 T2=17:25:39 Vs=0.0179 + +22 17:32:41 17:37:43 +P1=0.0401 P2=0.0649 T1=17:32:41 T2=17:37:43 Vs=0.0050 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200703.243 b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.243 new file mode 100644 index 0000000..00c4a52 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.243 @@ -0,0 +1,16 @@ +14 02:57:27 1593727047 +8 02:57:47 1593727067 +14 02:59:09 1593727149 +8 03:00:28 1593727228 +14 03:29:08 1593728948 +8 03:30:39 1593729039 +9 03:49:14 1593730154 +10 04:17:14 1593731834 +11 10:29:30 1593754170 +12 10:43:18 1593754998 +13 15:34:05 1593772445 +0 15:34:07 1593772447 +14 16:31:49 1593775909 +15 17:38:10 1593779890 +16 18:01:14 1593781274 +1 18:17:31 1593782251 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200703.244 b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.244 new file mode 100644 index 0000000..3de6616 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.244 @@ -0,0 +1,412 @@ +00:01:51 NEW 0239: . 楢 - +00:01:52 RTN 0239: . 楢 - +00:02:55 ACK 0239: . 楢 - +00:04:02 NEW 0459: PIR001᮪ +00:04:02 NEW 0460: PIR002 ᮪ +00:04:08 NEW 0323: . . +00:04:43 ACK 0323: . . +00:04:43 ACK 0459: PIR001᮪ +00:04:43 ACK 0460: PIR002 ᮪ +00:04:43 RTN 0323: . . +00:32:59 NEW 0190: 訡 ⥪ +00:33:34 NEW 0023: 訡 ஫ +00:33:34 NEW 0034: ஫ ⮢ +00:34:06 ACK 0023: 訡 ஫ +00:34:06 ACK 0034: ஫ ⮢ +00:34:06 ACK 0190: 訡 ⥪ +00:34:06 RTN 0459: PIR001᮪ +00:34:06 RTN 0460: PIR002 ᮪ +00:34:07 RTN 0023: 訡 ஫ +00:34:07 RTN 0034: ஫ ⮢ +00:34:07 RTN 0190: 訡 ⥪ +00:34:08 NEW 0190: 訡 ⥪ +00:34:11 NEW 0023: 訡 ஫ +00:34:11 NEW 0034: ஫ ⮢ +00:34:14 ACK 0023: 訡 ஫ +00:34:14 ACK 0034: ஫ ⮢ +00:34:14 ACK 0190: 訡 ⥪ +00:34:14 RTN 0023: 訡 ஫ +00:34:14 RTN 0034: ஫ ⮢ +00:34:14 RTN 0190: 訡 ⥪ +00:34:16 NEW 0190: 訡 ⥪ +00:34:17 NEW 0023: 訡 ஫ +00:34:17 NEW 0034: ஫ ⮢ +00:34:41 ACK 0023: 訡 ஫ +00:34:41 ACK 0034: ஫ ⮢ +00:34:41 ACK 0190: 訡 ⥪ +00:34:42 RTN 0023: 訡 ஫ +00:34:42 RTN 0034: ஫ ⮢ +00:34:42 RTN 0190: 訡 ⥪ +00:34:42 NEW 0190: 訡 ⥪ +00:38:33 NEW 0023: 訡 ஫ +00:38:33 NEW 0034: ஫ ⮢ +00:38:42 ACK 0023: 訡 ஫ +00:38:42 ACK 0034: ஫ ⮢ +00:38:42 ACK 0190: 訡 ⥪ +00:38:43 RTN 0023: 訡 ஫ +00:38:43 RTN 0034: ஫ ⮢ +00:38:43 RTN 0190: 訡 ⥪ +00:38:46 NEW 0190: 訡 ⥪ +00:59:29 NEW 0023: 訡 ஫ +00:59:29 NEW 0034: ஫ ⮢ +00:59:34 ACK 0023: 訡 ஫ +00:59:34 ACK 0034: ஫ ⮢ +00:59:34 ACK 0190: 訡 ⥪ +00:59:34 RTN 0023: 訡 ஫ +00:59:34 RTN 0034: ஫ ⮢ +00:59:34 RTN 0190: 訡 ⥪ +00:59:36 NEW 0190: 訡 ⥪ +00:59:43 ACK 0190: 訡 ⥪ +00:59:44 RTN 0190: 訡 ⥪ +00:59:47 NEW 0190: 訡 ⥪ +01:54:54 NEW 0023: 訡 ஫ +01:54:54 NEW 0034: ஫ ⮢ +01:54:59 ACK 0023: 訡 ஫ +01:54:59 ACK 0034: ஫ ⮢ +01:54:59 ACK 0190: 訡 ⥪ +01:54:59 RTN 0023: 訡 ஫ +01:54:59 RTN 0034: ஫ ⮢ +01:54:59 RTN 0190: 訡 ⥪ +01:55:01 NEW 0190: 訡 ⥪ +01:55:09 NEW 0023: 訡 ஫ +01:55:09 NEW 0034: ஫ ⮢ +01:55:13 ACK 0023: 訡 ஫ +01:55:13 ACK 0034: ஫ ⮢ +01:55:13 ACK 0190: 訡 ⥪ +01:55:13 RTN 0023: 訡 ஫ +01:55:13 RTN 0034: ஫ ⮢ +01:55:13 RTN 0190: 訡 ⥪ +01:55:16 NEW 0190: 訡 ⥪ +01:55:23 NEW 0023: 訡 ஫ +01:55:23 NEW 0034: ஫ ⮢ +01:56:51 ACK 0023: 訡 ஫ +01:56:51 ACK 0034: ஫ ⮢ +01:56:51 ACK 0190: 訡 ⥪ +01:56:51 RTN 0023: 訡 ஫ +01:56:51 RTN 0034: ஫ ⮢ +01:56:51 RTN 0190: 訡 ⥪ +01:56:52 NEW 0190: 訡 ⥪ +03:31:26 ACK 0190: 訡 ⥪ +03:31:28 RTN 0190: 訡 ⥪ +03:44:40 NEW 0454: TISAH103 - . - +03:44:44 ACK 0454: TISAH103 - . - +03:44:44 RTN 0454: TISAH103 - . - +03:44:51 NEW 0458: TISAH121 Temperatur Ofen +03:44:57 NEW ।0124: TISAH121 - +03:44:58 ACK ।0124: TISAH121 - +03:44:58 ACK 0458: TISAH121 Temperatur Ofen +03:44:58 RTN 0458: TISAH121 Temperatur Ofen +03:45:00 RTN ।0124: TISAH121 - +03:45:05 NEW 0456: TISAH120 - . -- +03:45:10 ACK 0456: TISAH120 - . -- +03:45:10 RTN 0456: TISAH120 - . -- +03:45:44 NEW ।0081: FISAL104 . - +03:45:44 NEW ।0126: PISAL104 . , - +03:45:50 NEW 0451: FISAL104 . - +03:46:15 ACK ।0081: FISAL104 . - +03:46:15 ACK ।0126: PISAL104 . , - +03:46:15 ACK 0451: FISAL104 . - +03:46:15 RTN ।0081: FISAL104 . - +03:46:15 RTN ।0126: PISAL104 . , - +03:46:15 RTN 0451: FISAL104 . - +03:46:24 NEW 0455: FSAL116 -- +03:46:39 ACK 0455: FSAL116 -- +03:46:39 RTN 0455: FSAL116 -- +03:47:14 NEW ।0126: PISAL104 . , - +03:47:14 NEW ।0081: FISAL104 . - +03:47:17 NEW 0452: PISAL104 . , - +03:47:35 ACK ।0081: FISAL104 . - +03:47:35 ACK ।0126: PISAL104 . , - +03:47:35 ACK 0452: PISAL104 . , - +03:47:35 RTN ।0126: PISAL104 . , - +03:47:35 RTN 0452: PISAL104 . , - +03:47:51 NEW 0459: PIR001᮪ +03:48:03 ACK 0459: PIR001᮪ +03:48:03 RTN 0459: PIR001᮪ +03:48:03 RTN ।0081: FISAL104 . - +03:48:07 NEW 0450: . 㣨 +03:48:09 RTN 0450: . 㣨 +03:48:10 NEW 0449: . 㣨 +03:48:23 ACK 0449: . 㣨 +03:48:23 ACK 0450: . 㣨 +03:48:24 RTN 0449: . 㣨 +03:48:30 NEW 0450: . 㣨 +03:48:34 NEW 0337: . . 㣨 +03:48:35 ACK 0337: . . 㣨 +03:48:35 ACK 0450: . 㣨 +03:48:37 RTN 0337: . . 㣨 +03:48:37 RTN 0450: . 㣨 +03:48:42 NEW 0450: . 㣨 +03:48:51 ACK 0450: . 㣨 +03:48:51 RTN 0450: . 㣨 +03:48:56 NEW 0450: . 㣨 +03:49:00 ACK 0450: . 㣨 +03:49:00 RTN 0450: . 㣨 +03:49:01 NEW 0450: . 㣨 +03:49:02 NEW 0378: / -. , ࠭- +03:49:02 RTN 0450: . 㣨 +03:49:03 RTN 0378: / -. , ࠭- +03:49:09 ACK 0378: / -. , ࠭- +03:49:09 ACK 0450: . 㣨 +03:49:15 NEW 0341: 誠 ⠫ 몫祭 +03:49:20 ACK 0341: 誠 ⠫ 몫祭 +03:49:20 NEW 0023: 訡 ஫ +03:49:20 NEW 0034: ஫ ⮢ +03:49:21 RTN 0023: 訡 ஫ +03:49:21 RTN 0034: ஫ ⮢ +03:49:22 NEW 0023: 訡 ஫ +03:49:22 NEW 0034: ஫ ⮢ +03:49:22 RTN 0341: 誠 ⠫ 몫祭 +03:49:26 ACK 0023: 訡 ஫ +03:49:26 ACK 0034: ஫ ⮢ +03:49:26 RTN 0023: 訡 ஫ +03:49:26 RTN 0034: ஫ ⮢ +03:49:30 NEW 0023: 訡 ஫ +03:49:30 NEW 0034: ஫ ⮢ +03:49:31 RTN 0023: 訡 ஫ +03:49:31 RTN 0034: ஫ ⮢ +03:49:34 ACK 0023: 訡 ஫ +03:49:34 ACK 0034: ஫ ⮢ +03:49:34 NEW 0023: 訡 ஫ +03:49:34 NEW 0034: ஫ ⮢ +03:49:34 NEW 0262: ᫨誮 +03:49:34 RTN 0023: 訡 ஫ +03:49:34 RTN 0034: ஫ ⮢ +03:49:36 NEW 0023: 訡 ஫ +03:49:36 NEW 0034: ஫ ⮢ +03:49:38 ACK 0023: 訡 ஫ +03:49:38 ACK 0034: ஫ ⮢ +03:49:38 ACK 0262: ᫨誮 +03:49:38 RTN 0023: 訡 ஫ +03:49:38 RTN 0034: ஫ ⮢ +03:49:48 NEW 0023: 訡 ஫ +03:49:48 NEW 0034: ஫ ⮢ +03:49:51 ACK 0023: 訡 ஫ +03:49:51 ACK 0034: ஫ ⮢ +03:49:52 RTN 0023: 訡 ஫ +03:49:52 RTN 0034: ஫ ⮢ +03:52:51 RTN 0262: ᫨誮 +04:02:37 NEW ।0350: ஦-⠩ +04:02:38 ACK ।0350: ஦-⠩ +04:02:38 RTN ।0350: ஦-⠩ +04:23:42 NEW ।0350: ஦-⠩ +04:23:44 ACK ।0350: ஦-⠩ +04:23:44 RTN ।0350: ஦-⠩ +04:38:30 NEW ।0350: ஦-⠩ +04:38:31 ACK ।0350: ஦-⠩ +04:38:31 RTN ।0350: ஦-⠩ +04:43:31 NEW ।0350: ஦-⠩ +04:43:34 ACK ।0350: ஦-⠩ +04:43:35 RTN ।0350: ஦-⠩ +04:52:03 NEW ।0350: ஦-⠩ +04:52:06 ACK ।0350: ஦-⠩ +04:52:06 RTN ।0350: ஦-⠩ +05:05:06 NEW ।0350: ஦-⠩ +05:05:07 ACK ।0350: ஦-⠩ +05:05:07 RTN ।0350: ஦-⠩ +05:14:20 NEW ।0350: ஦-⠩ +05:14:22 ACK ।0350: ஦-⠩ +05:14:22 RTN ।0350: ஦-⠩ +05:19:23 NEW ।0350: ஦-⠩ +05:19:24 ACK ।0350: ஦-⠩ +05:19:24 RTN ।0350: ஦-⠩ +05:24:24 NEW ।0350: ஦-⠩ +05:24:25 ACK ।0350: ஦-⠩ +05:24:25 RTN ।0350: ஦-⠩ +05:29:26 NEW ।0350: ஦-⠩ +05:29:27 ACK ।0350: ஦-⠩ +05:29:27 RTN ।0350: ஦-⠩ +05:34:27 NEW ।0350: ஦-⠩ +05:34:28 ACK ।0350: ஦-⠩ +05:34:28 RTN ।0350: ஦-⠩ +05:39:29 NEW ।0350: ஦-⠩ +05:39:30 ACK ।0350: ஦-⠩ +05:39:30 RTN ।0350: ஦-⠩ +05:44:30 NEW ।0350: ஦-⠩ +05:44:31 ACK ।0350: ஦-⠩ +05:44:31 RTN ।0350: ஦-⠩ +05:49:31 NEW ।0350: ஦-⠩ +05:49:32 RTN ।0350: ஦-⠩ +05:49:33 ACK ।0350: ஦-⠩ +05:54:33 NEW ।0350: ஦-⠩ +05:54:34 RTN ।0350: ஦-⠩ +05:54:44 ACK ।0350: ஦-⠩ +05:59:43 NEW ।0350: ஦-⠩ +05:59:46 ACK ।0350: ஦-⠩ +05:59:46 RTN ।0350: ஦-⠩ +06:04:44 NEW ।0350: ஦-⠩ +06:04:47 ACK ।0350: ஦-⠩ +06:04:47 RTN ।0350: ஦-⠩ +06:10:47 NEW ।0350: ஦-⠩ +06:10:48 ACK ।0350: ஦-⠩ +06:10:48 RTN ।0350: ஦-⠩ +06:15:49 NEW ।0350: ஦-⠩ +06:15:51 ACK ।0350: ஦-⠩ +06:15:51 RTN ।0350: ஦-⠩ +06:20:50 NEW ।0350: ஦-⠩ +06:20:52 ACK ।0350: ஦-⠩ +06:20:52 RTN ।0350: ஦-⠩ +06:25:51 NEW ।0350: ஦-⠩ +06:25:54 ACK ।0350: ஦-⠩ +06:25:54 RTN ।0350: ஦-⠩ +06:30:54 NEW ।0350: ஦-⠩ +06:30:55 ACK ।0350: ஦-⠩ +06:30:55 RTN ।0350: ஦-⠩ +06:37:28 NEW ।0350: ஦-⠩ +06:37:28 ACK ।0350: ஦-⠩ +06:37:28 RTN ।0350: ஦-⠩ +06:46:35 NEW ।0350: ஦-⠩ +06:46:36 ACK ।0350: ஦-⠩ +06:46:37 RTN ।0350: ஦-⠩ +06:52:59 NEW ।0350: ஦-⠩ +06:53:00 ACK ।0350: ஦-⠩ +06:53:00 RTN ।0350: ஦-⠩ +07:02:34 NEW ।0350: ஦-⠩ +07:02:36 ACK ।0350: ஦-⠩ +07:02:36 RTN ।0350: ஦-⠩ +07:07:36 NEW ।0350: ஦-⠩ +07:07:37 ACK ।0350: ஦-⠩ +07:07:37 RTN ।0350: ஦-⠩ +07:12:38 NEW ।0350: ஦-⠩ +07:12:41 ACK ।0350: ஦-⠩ +07:12:41 RTN ।0350: ஦-⠩ +07:17:41 NEW ।0350: ஦-⠩ +07:17:43 ACK ।0350: ஦-⠩ +07:17:43 RTN ।0350: ஦-⠩ +07:22:44 NEW ।0350: ஦-⠩ +07:22:45 ACK ।0350: ஦-⠩ +07:22:45 RTN ।0350: ஦-⠩ +07:27:45 NEW ।0350: ஦-⠩ +07:27:47 ACK ।0350: ஦-⠩ +07:27:47 RTN ।0350: ஦-⠩ +07:40:02 NEW ।0350: ஦-⠩ +07:40:05 ACK ।0350: ஦-⠩ +07:40:05 RTN ।0350: ஦-⠩ +07:46:51 NEW ।0350: ஦-⠩ +07:46:52 RTN ।0350: ஦-⠩ +07:46:52 ACK ।0350: ஦-⠩ +07:51:53 NEW ।0350: ஦-⠩ +07:51:53 ACK ।0350: ஦-⠩ +07:51:53 RTN ।0350: ஦-⠩ +08:02:30 NEW ।0350: ஦-⠩ +08:02:32 ACK ।0350: ஦-⠩ +08:02:32 RTN ।0350: ஦-⠩ +08:09:55 NEW ।0350: ஦-⠩ +08:09:58 ACK ।0350: ஦-⠩ +08:09:58 RTN ।0350: ஦-⠩ +08:18:57 NEW ।0350: ஦-⠩ +08:18:57 RTN ।0350: ஦-⠩ +08:18:58 ACK ।0350: ஦-⠩ +08:39:29 NEW ।0350: ஦-⠩ +08:39:30 ACK ।0350: ஦-⠩ +08:39:31 RTN ।0350: ஦-⠩ +08:44:30 NEW ।0350: ஦-⠩ +08:44:32 ACK ।0350: ஦-⠩ +08:44:32 RTN ।0350: ஦-⠩ +08:53:22 NEW ।0350: ஦-⠩ +08:53:22 ACK ।0350: ஦-⠩ +08:53:22 RTN ।0350: ஦-⠩ +08:58:23 NEW ।0350: ஦-⠩ +08:58:24 ACK ।0350: ஦-⠩ +08:58:24 RTN ।0350: ஦-⠩ +09:07:03 NEW ।0350: ஦-⠩ +09:07:05 ACK ।0350: ஦-⠩ +09:07:05 RTN ।0350: ஦-⠩ +09:25:22 NEW ।0350: ஦-⠩ +09:25:24 ACK ।0350: ஦-⠩ +09:25:24 RTN ।0350: ஦-⠩ +09:32:35 NEW ।0350: ஦-⠩ +09:32:36 RTN ।0350: ஦-⠩ +09:32:37 ACK ।0350: ஦-⠩ +09:37:36 NEW ।0350: ஦-⠩ +09:37:38 ACK ।0350: ஦-⠩ +09:37:39 RTN ।0350: ஦-⠩ +09:49:59 NEW ।0350: ஦-⠩ +09:50:03 ACK ।0350: ஦-⠩ +09:50:03 RTN ।0350: ஦-⠩ +10:22:47 NEW ।0350: ஦-⠩ +10:22:48 ACK ।0350: ஦-⠩ +10:22:48 RTN ।0350: ஦-⠩ +10:36:45 NEW ।0350: ஦-⠩ +10:36:45 ACK ।0350: ஦-⠩ +10:36:45 RTN ।0350: ஦-⠩ +10:43:17 NEW ।0014: +10:43:17 NEW 0371: / - +10:43:17 NEW 0378: / -. , ࠭- +10:43:17 NEW 0381: / +10:43:18 RTN ।0014: +10:43:18 RTN 0371: / - +10:43:18 RTN 0378: / -. , ࠭- +10:43:18 RTN 0381: / +10:43:24 ACK ।0014: +10:43:24 ACK 0371: / - +10:43:24 ACK 0378: / -. , ࠭- +10:43:24 ACK 0381: / +10:46:16 NEW 0459: PIR001᮪ +10:46:32 ACK 0459: PIR001᮪ +10:48:08 NEW 0460: PIR002 ᮪ +10:48:12 ACK 0460: PIR002 ᮪ +10:48:13 RTN 0460: PIR002 ᮪ +10:48:14 NEW 0460: PIR002 ᮪ +10:53:16 ACK 0460: PIR002 ᮪ +15:52:20 NEW ।0081: FISAL104 . - +15:52:22 NEW ।0126: PISAL104 . , - +15:52:24 NEW 0452: PISAL104 . , - +15:52:26 NEW 0451: FISAL104 . - +15:52:27 ACK ।0081: FISAL104 . - +15:52:27 ACK ।0126: PISAL104 . , - +15:52:27 ACK 0451: FISAL104 . - +15:52:27 ACK 0452: PISAL104 . , - +15:52:27 RTN 0459: PIR001᮪ +15:52:27 RTN 0460: PIR002 ᮪ +15:56:52 NEW 0239: . 楢 - +15:56:53 RTN 0239: . 楢 - +15:59:55 NEW 0301: PSAH602 䨫 ࠢ ᫠ 75% +16:00:38 RTN 0301: PSAH602 䨫 ࠢ ᫠ 75% +16:31:53 ACK 0239: . 楢 - +16:31:53 ACK 0301: PSAH602 䨫 ࠢ ᫠ 75% +16:33:35 RTN ।0081: FISAL104 . - +16:33:35 RTN ।0126: PISAL104 . , - +16:33:35 RTN 0451: FISAL104 . - +16:33:35 RTN 0452: PISAL104 . , - +17:01:49 NEW 0459: PIR001᮪ +17:01:49 NEW 0460: PIR002 ᮪ +17:01:54 ACK 0459: PIR001᮪ +17:01:54 ACK 0460: PIR002 ᮪ +17:18:08 NEW 0457: FSAL111 +17:18:12 ACK 0457: FSAL111 +17:18:12 RTN 0459: PIR001᮪ +17:18:12 RTN 0460: PIR002 ᮪ +17:38:02 RTN 0457: FSAL111 +17:43:09 NEW ।0350: ஦-⠩ +17:43:10 RTN ।0350: ஦-⠩ +17:43:12 ACK ।0350: ஦-⠩ +17:48:12 NEW ।0350: ஦-⠩ +17:48:13 ACK ।0350: ஦-⠩ +17:48:14 RTN ।0350: ஦-⠩ +17:53:13 NEW ।0350: ஦-⠩ +17:53:14 ACK ।0350: ஦-⠩ +17:53:15 RTN ।0350: ஦-⠩ +17:58:14 NEW ।0350: ஦-⠩ +17:58:15 RTN ।0350: ஦-⠩ +17:58:16 ACK ।0350: ஦-⠩ +18:01:12 NEW 0378: / -. , ࠭- +18:01:14 RTN 0378: / -. , ࠭- +18:01:18 ACK 0378: / -. , ࠭- +18:02:14 NEW 0459: PIR001᮪ +18:02:29 ACK 0459: PIR001᮪ +18:04:02 NEW 0460: PIR002 ᮪ +18:04:11 ACK 0460: PIR002 ᮪ +18:17:56 NEW ।0081: FISAL104 . - +18:17:56 NEW ।0126: PISAL104 . , - +18:17:58 NEW 0452: PISAL104 . , - +18:17:59 NEW 0451: FISAL104 . - +18:40:55 ACK ।0081: FISAL104 . - +18:40:55 ACK ।0126: PISAL104 . , - +18:40:55 ACK 0451: FISAL104 . - +18:40:55 ACK 0452: PISAL104 . , - +18:40:55 RTN 0459: PIR001᮪ +18:40:55 RTN 0460: PIR002 ᮪ +19:28:11 NEW 0239: . 楢 - +19:28:12 RTN 0239: . 楢 - +23:46:14 ACK 0239: . 楢 - diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200703.247 b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.247 new file mode 100644 index 0000000..dec4c3f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.247 @@ -0,0 +1,978 @@ +00:02:52 1593716572 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +00:02:53 1593716573 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +00:02:58 1593716578 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +00:02:58 1593716578 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +00:03:28 1593716608 >< (OIP1) +00:03:28 1593716608 >७ ⥪騩< (OIP1) +00:03:29 1593716609 >: 롮 稭< (OIP1) +00:03:29 1593716609 >७ < (OIP1) +00:03:51 1593716631 >७ < (OIP1) +00:03:51 1593716631 >< (OIP1) +00:03:56 1593716636 >< (OIP1) +00:03:56 1593716636 >< (OIP1) +00:03:57 1593716637 >< (OIP1) +00:03:57 1593716637 >嫠 < (OIP1) +00:03:58 1593716638 >嫠 < (OIP1) +00:03:58 1593716638 >< (OIP1) +00:04:00 1593716640 >< (OIP1) +00:04:00 1593716640 >< (OIP1) +00:04:01 1593716641 >< (OIP1) +00:04:01 1593716641 > < (OIP1) +00:04:03 1593716643 > < (OIP1) +00:04:03 1593716643 > < (OIP1) +00:04:04 1593716644 > < (OIP1) +00:04:04 1593716644 >Mpar6Interlocks13< (OIP1) +00:04:05 1593716645 Machine C1_CMD_DIAG_INSU_COIL_SK --test insulation crucible coil(CMD)࠭ (OIP1) +00:04:09 1593716649 Machine C1_CMD_DIAG_INSU_COIL_SK --test insulation crucible coil(CMD)࠭ (OIP1) +00:04:15 1593716655 Machine C1_CMD_DIAG_INSU_COIL_SK --test insulation crucible coil(CMD)࠭ (OIP1) +00:04:18 1593716658 >Mpar6Interlocks13< (OIP1) +00:04:18 1593716658 > < (OIP1) +00:04:19 1593716659 > < (OIP1) +00:04:19 1593716659 >< (OIP1) +00:04:21 1593716661 >< (OIP1) +00:04:21 1593716661 > < (OIP1) +00:04:22 1593716662 > < (OIP1) +00:04:22 1593716662 >Mpar6Interlocks12< (OIP1) +00:04:22 1593716662 Machine C1_CMD_DIAG_INSU_STING_SK --test insulation stinger(CMD)࠭ (OIP1) +00:04:28 1593716668 Machine C1_CMD_DIAG_INSU_FNCE_SK --test insulation furnace(CMD)࠭ (OIP1) +00:04:33 1593716673 >Mpar6Interlocks12< (OIP1) +00:04:33 1593716673 > < (OIP1) +00:04:35 1593716675 > < (OIP1) +00:04:35 1593716675 >Mpar6Interlocks13< (OIP1) +00:04:39 1593716679 >Mpar6Interlocks13< (OIP1) +00:04:39 1593716679 > < (OIP1) +00:04:43 1593716683 > < (OIP1) +00:04:43 1593716683 > < (OIP1) +00:04:45 1593716685 > < (OIP1) +00:04:45 1593716685 >EdtPar1Start< (OIP1) +00:04:46 1593716686 >EdtPar1Start< (OIP1) +00:04:46 1593716686 >EdtPar1Start_2ndPage< (OIP1) +00:04:46 1593716686 >EdtPar1Start_2ndPage< (OIP1) +00:04:46 1593716686 >EdtPar2Melt< (OIP1) +00:04:46 1593716686 >EdtPar2Melt< (OIP1) +00:04:46 1593716686 >EdtPar2Melt_2ndPage< (OIP1) +00:04:46 1593716686 >EdtPar2Melt_2ndPage< (OIP1) +00:04:46 1593716686 >EdtPar3Hottop< (OIP1) +00:04:47 1593716687 >EdtPar3Hottop< (OIP1) +00:04:47 1593716687 >EdtPar3Hottop_2ndPage< (OIP1) +00:04:47 1593716687 >EdtPar3Hottop_2ndPage< (OIP1) +00:04:47 1593716687 >EdtPar4Ctrl< (OIP1) +00:04:47 1593716687 >EdtPar4Ctrl< (OIP1) +00:04:47 1593716687 >EdtPar5Misc< (OIP1) +00:04:47 1593716687 >EdtPar5Misc< (OIP1) +00:04:47 1593716687 >< (OIP1) +00:04:47 1593716687 >஢< (OIP1) +00:04:49 1593716689 - ஢ (OIP1) +00:04:49 1593716689 >஢< (OIP1) +00:04:50 1593716690 >< (OIP1) +00:04:50 1593716690 > < (OIP1) +00:04:50 1593716690 > < (OIP1) +00:04:50 1593716690 >Mpar6Interlocks16< (OIP1) +00:04:51 1593716691 Machine C1_CMD_DIAG_AMC_SK --test AMC(CMD)࠭ (OIP1) +00:04:52 1593716692 >Mpar6Interlocks16< (OIP1) +00:04:52 1593716692 > < (OIP1) +00:04:53 1593716693 > < (OIP1) +00:04:53 1593716693 >Mpar6Interlocks14< (OIP1) +00:04:54 1593716694 Machine C1_CMD_DIAG_MPS_SK --test melt power supply(CMD)࠭ (OIP1) +00:04:56 1593716696 >Mpar6Interlocks14< (OIP1) +00:04:56 1593716696 > < (OIP1) +00:04:57 1593716697 > < (OIP1) +00:04:57 1593716697 >Mpar6Interlocks01< (OIP1) +00:04:57 1593716697 Machine C1_CMD_DIAG_EPD_SK --test electrode processs drive(CMD)࠭ (OIP1) +00:04:58 1593716698 >Mpar6Interlocks01< (OIP1) +00:04:58 1593716698 > < (OIP1) +00:07:10 1593716830 > < (OIP1) +00:07:10 1593716830 >Mpar6Interlocks15< (OIP1) +00:07:11 1593716831 Machine C1_CMD_DIAG_CHD_SK --test charging drive(CMD)࠭ (OIP1) +00:07:12 1593716832 >Mpar6Interlocks15< (OIP1) +00:07:12 1593716832 > < (OIP1) +00:07:58 1593716878 > < (OIP1) +00:07:58 1593716878 >७ ⥪騩< (OIP1) +00:07:59 1593716879 >: 롮 稭< (OIP1) +00:07:59 1593716879 >७ < (OIP1) +00:28:03 1593718083 >७ < (OIP1) +00:28:03 1593718083 >< (OIP1) +00:28:14 1593718094 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +00:33:01 1593718381 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +00:33:50 1593718430 >< (OIP1) +00:33:50 1593718430 >< (OIP1) +00:34:27 1593718467 >< (OIP1) +00:34:27 1593718467 >< (OIP1) +00:38:02 1593718682 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +00:40:48 1593718848 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +00:40:49 1593718849 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +00:51:10 1593719470 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +00:51:12 1593719472 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +00:56:13 1593719773 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:01:16 1593720076 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:04:37 1593720277 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:04:39 1593720279 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:19:59 1593721199 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:20:03 1593721203 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:25:02 1593721502 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:31:01 1593721861 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:32:11 1593721931 >< (OIP1) +01:32:11 1593721931 >< (OIP1) +01:32:18 1593721938 >< (OIP1) +01:32:18 1593721938 >< (OIP1) +01:36:27 1593722187 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:50:00 1593723000 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:50:02 1593723002 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:54:05 1593723245 >< (OIP1) +01:54:05 1593723245 >< (OIP1) +01:54:06 1593723246 >< (OIP1) +01:54:06 1593723246 >< (OIP1) +01:55:21 1593723321 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:56:11 1593723371 >< (OIP1) +01:56:11 1593723371 >७ ⥪騩< (OIP1) +01:56:12 1593723372 >: 롮 稭< (OIP1) +01:56:12 1593723372 >७ < (OIP1) +01:56:48 1593723408 >७ < (OIP1) +01:56:48 1593723408 >< (OIP1) +02:00:23 1593723623 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +02:06:26 1593723986 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +02:12:58 1593724378 >< (OIP1) +02:12:58 1593724378 >७ ⥪騩< (OIP1) +02:12:59 1593724379 >: 롮 稭< (OIP1) +02:12:59 1593724379 >७ < (OIP1) +02:13:46 1593724426 >७ < (OIP1) +02:13:46 1593724426 >< (OIP1) +02:20:00 1593724800 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +02:20:04 1593724804 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +02:25:04 1593725104 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +02:30:06 1593725406 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +02:35:08 1593725708 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +02:45:00 1593726300 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +02:45:03 1593726303 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +02:50:05 1593726605 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +02:55:08 1593726908 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +02:57:11 1593727031 >< (OIP1) +02:57:11 1593727031 > < (OIP1) +02:57:20 1593727040 ⢨ (OIP1) +02:57:21 1593727041 > < (OIP1) +02:57:21 1593727041 >< (OIP1) +02:57:22 1593727042 >< (OIP1) +02:57:22 1593727042 > < (OIP1) +02:57:27 1593727047 > < (OIP1) +02:57:27 1593727047 > < (OIP1) +02:57:28 1593727048 > < (OIP1) +02:57:28 1593727048 >< (OIP1) +02:57:39 1593727059 >< (OIP1) +02:57:39 1593727059 > < (OIP1) +02:57:40 1593727060 ⢨ (OIP1) +02:57:41 1593727061 > < (OIP1) +02:57:41 1593727061 >< (OIP1) +02:57:41 1593727061 >< (OIP1) +02:57:41 1593727061 > < (OIP1) +02:57:46 1593727066 > < (OIP1) +02:57:46 1593727066 > < (OIP1) +02:57:46 1593727066 > < (OIP1) +02:57:46 1593727066 > < (OIP1) +02:57:49 1593727069 > < (OIP1) +02:57:49 1593727069 >EdtPar1Start< (OIP1) +02:57:49 1593727069 >EdtPar1Start< (OIP1) +02:57:49 1593727069 >EdtPar1Start_2ndPage< (OIP1) +02:57:49 1593727069 >EdtPar1Start_2ndPage< (OIP1) +02:57:49 1593727069 >EdtPar2Melt< (OIP1) +02:57:49 1593727069 >EdtPar2Melt< (OIP1) +02:57:49 1593727069 >EdtPar2Melt_2ndPage< (OIP1) +02:57:49 1593727069 >EdtPar2Melt_2ndPage< (OIP1) +02:57:49 1593727069 >EdtPar3Hottop< (OIP1) +02:57:49 1593727069 >EdtPar3Hottop< (OIP1) +02:57:49 1593727069 >EdtPar3Hottop_2ndPage< (OIP1) +02:57:49 1593727069 >EdtPar3Hottop_2ndPage< (OIP1) +02:57:49 1593727069 >EdtPar4Ctrl< (OIP1) +02:57:49 1593727069 >EdtPar4Ctrl< (OIP1) +02:57:49 1593727069 >EdtPar5Misc< (OIP1) +02:57:49 1593727069 >EdtPar5Misc< (OIP1) +02:57:49 1593727069 >< (OIP1) +02:57:49 1593727069 >஢< (OIP1) +02:57:50 1593727070 - ஢ (OIP1) +02:57:50 1593727070 >஢< (OIP1) +02:57:55 1593727075 >< (OIP1) +02:57:55 1593727075 > < (OIP1) +02:57:56 1593727076 > < (OIP1) +02:57:56 1593727076 >Mpar6Interlocks02< (OIP1) +02:57:57 1593727077 Machine C1_CMD_DIAG_COIL_SK --test crucible coil(CMD)࠭ (OIP1) +02:58:00 1593727080 >Mpar6Interlocks< (OIP1) +02:58:00 1593727080 >< (OIP1) +02:58:49 1593727129 >< (OIP1) +02:58:49 1593727129 > < (OIP1) +02:58:56 1593727136 > < (OIP1) +02:58:56 1593727136 >< (OIP1) +02:58:59 1593727139 >< (OIP1) +02:58:59 1593727139 > < (OIP1) +02:59:02 1593727142 ⢨ (OIP1) +02:59:03 1593727143 > < (OIP1) +02:59:03 1593727143 >< (OIP1) +02:59:03 1593727143 >< (OIP1) +02:59:03 1593727143 > < (OIP1) +02:59:09 1593727149 > < (OIP1) +02:59:09 1593727149 > < (OIP1) +02:59:10 1593727150 > < (OIP1) +02:59:10 1593727150 >< (OIP1) +03:00:17 1593727217 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +03:00:19 1593727219 >< (OIP1) +03:00:19 1593727219 > < (OIP1) +03:00:20 1593727220 ⢨ (OIP1) +03:00:22 1593727222 > < (OIP1) +03:00:22 1593727222 >< (OIP1) +03:00:22 1593727222 >< (OIP1) +03:00:22 1593727222 > < (OIP1) +03:00:27 1593727227 > < (OIP1) +03:00:27 1593727227 > < (OIP1) +03:00:28 1593727228 > < (OIP1) +03:00:28 1593727228 > < (OIP1) +03:00:29 1593727229 > < (OIP1) +03:00:29 1593727229 >EdtPar1Start< (OIP1) +03:00:29 1593727229 >EdtPar1Start< (OIP1) +03:00:29 1593727229 >EdtPar1Start_2ndPage< (OIP1) +03:00:30 1593727230 >EdtPar1Start_2ndPage< (OIP1) +03:00:30 1593727230 >EdtPar2Melt< (OIP1) +03:00:30 1593727230 >EdtPar2Melt< (OIP1) +03:00:30 1593727230 >EdtPar2Melt_2ndPage< (OIP1) +03:00:30 1593727230 >EdtPar2Melt_2ndPage< (OIP1) +03:00:30 1593727230 >EdtPar3Hottop< (OIP1) +03:00:30 1593727230 >EdtPar3Hottop< (OIP1) +03:00:30 1593727230 >EdtPar3Hottop_2ndPage< (OIP1) +03:00:30 1593727230 >EdtPar3Hottop_2ndPage< (OIP1) +03:00:30 1593727230 >EdtPar4Ctrl< (OIP1) +03:00:30 1593727230 >EdtPar4Ctrl< (OIP1) +03:00:30 1593727230 >EdtPar5Misc< (OIP1) +03:00:31 1593727231 >EdtPar5Misc< (OIP1) +03:00:31 1593727231 >< (OIP1) +03:00:31 1593727231 >஢< (OIP1) +03:00:31 1593727231 - ஢ (OIP1) +03:00:33 1593727233 >஢< (OIP1) +03:00:40 1593727240 >< (OIP1) +03:00:40 1593727240 > < (OIP1) +03:00:41 1593727241 > < (OIP1) +03:00:41 1593727241 >< (OIP1) +03:15:01 1593728101 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +03:15:03 1593728103 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +03:20:03 1593728403 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +03:25:06 1593728706 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +03:28:58 1593728938 >< (OIP1) +03:28:58 1593728938 > < (OIP1) +03:29:01 1593728941 ⢨ (OIP1) +03:29:02 1593728942 > < (OIP1) +03:29:02 1593728942 >< (OIP1) +03:29:02 1593728942 >< (OIP1) +03:29:02 1593728942 > < (OIP1) +03:29:08 1593728948 > < (OIP1) +03:29:08 1593728948 > < (OIP1) +03:29:09 1593728949 > < (OIP1) +03:29:09 1593728949 >< (OIP1) +03:30:08 1593729008 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +03:30:29 1593729029 >< (OIP1) +03:30:29 1593729029 > < (OIP1) +03:30:32 1593729032 ⢨ (OIP1) +03:30:33 1593729033 > < (OIP1) +03:30:33 1593729033 >< (OIP1) +03:30:33 1593729033 >< (OIP1) +03:30:33 1593729033 > < (OIP1) +03:30:39 1593729039 > < (OIP1) +03:30:39 1593729039 > < (OIP1) +03:30:40 1593729040 > < (OIP1) +03:30:40 1593729040 > < (OIP1) +03:30:40 1593729040 > < (OIP1) +03:30:40 1593729040 >EdtPar1Start< (OIP1) +03:30:40 1593729040 >EdtPar1Start< (OIP1) +03:30:40 1593729040 >EdtPar1Start_2ndPage< (OIP1) +03:30:40 1593729040 >EdtPar1Start_2ndPage< (OIP1) +03:30:40 1593729040 >EdtPar2Melt< (OIP1) +03:30:40 1593729040 >EdtPar2Melt< (OIP1) +03:30:40 1593729040 >EdtPar2Melt_2ndPage< (OIP1) +03:30:40 1593729040 >EdtPar2Melt_2ndPage< (OIP1) +03:30:40 1593729040 >EdtPar3Hottop< (OIP1) +03:30:41 1593729041 >EdtPar3Hottop< (OIP1) +03:30:41 1593729041 >EdtPar3Hottop_2ndPage< (OIP1) +03:30:41 1593729041 >EdtPar3Hottop_2ndPage< (OIP1) +03:30:41 1593729041 >EdtPar4Ctrl< (OIP1) +03:30:41 1593729041 >EdtPar4Ctrl< (OIP1) +03:30:41 1593729041 >EdtPar5Misc< (OIP1) +03:30:41 1593729041 >EdtPar5Misc< (OIP1) +03:30:41 1593729041 >< (OIP1) +03:30:41 1593729041 >஢< (OIP1) +03:30:42 1593729042 - ஢ (OIP1) +03:30:42 1593729042 >஢< (OIP1) +03:30:43 1593729043 >< (OIP1) +03:30:43 1593729043 > < (OIP1) +03:31:01 1593729061 > < (OIP1) +03:31:01 1593729061 >< (OIP1) +03:31:58 1593729118 >< (OIP1) +03:31:58 1593729118 > < (OIP1) +03:44:37 1593729877 > < (OIP1) +03:44:37 1593729877 >Mpar6Interlocks09< (OIP1) +03:44:39 1593729879 Machine C1_CMD_DIAG_CWT_TMP_CRU_SK --test cooling water temperature crucible(CMD)࠭ (OIP1) +03:44:47 1593729887 >Mpar6Interlocks09< (OIP1) +03:44:47 1593729887 > < (OIP1) +03:44:47 1593729887 > < (OIP1) +03:44:47 1593729887 >Mpar6Interlocks10< (OIP1) +03:44:48 1593729888 Machine C1_CMD_DIAG_CWT_TMP_FNC_SK --test cooling water temperature furnace(CMD)࠭ (OIP1) +03:45:01 1593729901 >Mpar6Interlocks< (OIP1) +03:45:01 1593729901 > < (OIP1) +03:45:02 1593729902 > < (OIP1) +03:45:02 1593729902 >Mpar6Interlocks11< (OIP1) +03:45:03 1593729903 Machine C1_CMD_DIAG_CWT_TMP_STING_SK --test cooling water temperature stinger(CMD)࠭ (OIP1) +03:45:14 1593729914 >Mpar6Interlocks11< (OIP1) +03:45:14 1593729914 > < (OIP1) +03:45:15 1593729915 > < (OIP1) +03:45:15 1593729915 >Mpar6Interlocks06< (OIP1) +03:45:15 1593729915 Machine C1_CMD_DIAG_CWT_FLW_CRU_SK --test cooling water flow crucible(CMD)࠭ (OIP1) +03:46:18 1593729978 >Mpar6Interlocks06< (OIP1) +03:46:18 1593729978 > < (OIP1) +03:46:18 1593729978 > < (OIP1) +03:46:18 1593729978 >Mpar6Interlocks08< (OIP1) +03:46:19 1593729979 Machine C1_CMD_DIAG_CWT_FLW_STING_SK --test cooling water flow stinger(CMD)࠭ (OIP1) +03:46:42 1593730002 >Mpar6Interlocks08< (OIP1) +03:46:42 1593730002 > < (OIP1) +03:46:43 1593730003 > < (OIP1) +03:46:43 1593730003 >Mpar6Interlocks07< (OIP1) +03:46:46 1593730006 Machine C1_CMD_DIAG_CWT_PRS_CRU_SK --test cooling water pressure crucible(CMD)࠭ (OIP1) +03:47:38 1593730058 >Mpar6Interlocks07< (OIP1) +03:47:38 1593730058 > < (OIP1) +03:47:39 1593730059 > < (OIP1) +03:47:39 1593730059 >Mpar6Interlocks05< (OIP1) +03:47:41 1593730061 Machine C1_CMD_DIAG_VAC_SK --test vaccum interlock(CMD)࠭ (OIP1) +03:48:04 1593730084 >Mpar6Interlocks05< (OIP1) +03:48:04 1593730084 > < (OIP1) +03:48:05 1593730085 > < (OIP1) +03:48:05 1593730085 >Mpar6Interlocks03< (OIP1) +03:48:06 1593730086 Machine C1_CMD_DIAG_ARC_VLT_MAX_SK --test max arc voltage interlock(CMD)࠭ (OIP1) +03:48:25 1593730105 >Mpar6Interlocks03< (OIP1) +03:48:25 1593730105 > < (OIP1) +03:48:26 1593730106 > < (OIP1) +03:48:26 1593730106 >Mpar6Interlocks04< (OIP1) +03:48:27 1593730107 Machine C1_CMD_DIAG_ARC_VLT_MIN_SK --test min arc voltage interlock(CMD)࠭ (OIP1) +03:48:40 1593730120 Machine C1_CMD_DIAG_ARC_VLT_MIN_SK --test min arc voltage interlock(CMD)࠭ (OIP1) +03:49:07 1593730147 >Mpar6Interlocks04< (OIP1) +03:49:07 1593730147 >< (OIP1) +03:49:21 1593730161 >롮 ० < (OIP1) +03:49:22 1593730162 Melting C1_CMD_CRU_COIL --crucible coil(CMD)࠭ (OIP1) +03:49:23 1593730163 >롮 ० < (OIP1) +03:50:47 1593730247 >< (OIP1) +03:50:47 1593730247 >< (OIP1) +03:57:36 1593730656 >< (OIP1) +03:57:36 1593730656 >< (OIP1) +05:15:14 1593735314 >< (OIP1) +05:15:14 1593735314 >< (OIP1) +05:15:47 1593735347 >< (OIP1) +05:15:47 1593735347 >< (OIP1) +06:13:53 1593738833 >< (OIP1) +06:13:53 1593738833 >< (OIP1) +06:13:57 1593738837 >< (OIP1) +06:13:57 1593738837 >< (OIP1) +06:16:15 1593738975 >< (OIP1) +06:16:15 1593738975 >嫠 < (OIP1) +06:16:17 1593738977 >嫠 < (OIP1) +06:16:17 1593738977 >< (OIP1) +07:41:54 1593744114 >< (OIP1) +07:41:54 1593744114 >७ ⥪騩< (OIP1) +07:41:55 1593744115 >: 롮 稭< (OIP1) +07:41:55 1593744115 >७ < (OIP1) +07:42:28 1593744148 >७ < (OIP1) +07:42:28 1593744148 >< (OIP1) +07:52:30 1593744750 >< (OIP1) +07:52:30 1593744750 >७ ⥪騩< (OIP1) +07:52:31 1593744751 >: 롮 稭< (OIP1) +07:52:31 1593744751 >७ < (OIP1) +07:53:14 1593744794 >७ < (OIP1) +07:53:14 1593744794 >< (OIP1) +07:53:17 1593744797 >< (OIP1) +07:53:17 1593744797 >< (OIP1) +07:56:22 1593744982 >: 롮 稭< (OIP2) +07:56:22 1593744982 >嫠 < (OIP2) +08:13:01 1593745981 >< (OIP1) +08:13:01 1593745981 >< (OIP1) +08:13:07 1593745987 >< (OIP1) +08:13:07 1593745987 >< (OIP1) +08:13:09 1593745989 >< (OIP1) +08:13:09 1593745989 >७ ⥪騩< (OIP1) +08:13:09 1593745989 >: 롮 稭< (OIP1) +08:13:09 1593745989 >७ < (OIP1) +08:13:53 1593746033 >७ < (OIP1) +08:13:53 1593746033 >< (OIP1) +10:27:33 1593754053 >< (OIP1) +10:27:33 1593754053 >< (OIP1) +10:28:02 1593754082 >< (OIP1) +10:28:02 1593754082 >< (OIP1) +10:41:46 1593754906 >< (OIP1) +10:41:46 1593754906 >< (OIP1) +10:41:52 1593754912 >< (OIP1) +10:41:52 1593754912 >< (OIP1) +10:42:03 1593754923 >< (OIP1) +10:42:03 1593754923 >< (OIP1) +10:42:13 1593754933 >< (OIP1) +10:42:13 1593754933 >< (OIP1) +10:42:54 1593754974 >嫠 < (OIP2) +10:42:54 1593754974 >७ ⥪騩< (OIP2) +10:45:16 1593755116 >< (OIP1) +10:45:16 1593755116 >< (OIP1) +10:45:18 1593755118 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +10:45:52 1593755152 >஫ < (OIP1) +10:45:57 1593755157 Vacuum C1_CMD_GAS_PRS_CTR_SK --softkey pressure control gas on/off(CMD)࠭ (OIP1) +10:46:05 1593755165 >஫ < (OIP1) +10:46:05 1593755165 >롮 ० RMC< (OIP1) +10:46:08 1593755168 Vacuum C1_CMD_RmcAut --RMC automatic mode(CMD)࠭ (OIP1) +10:46:09 1593755169 >롮 ० RMC< (OIP1) +10:46:11 1593755171 >롮 ० EFC< (OIP1) +10:46:12 1593755172 Vacuum C1_CMD_EfcAut --EFC automatic mode(CMD)࠭ (OIP1) +10:46:13 1593755173 >롮 ० EFC< (OIP1) +10:47:42 1593755262 >< (OIP1) +10:47:42 1593755262 >< (OIP1) +10:47:52 1593755272 >< (OIP1) +10:47:52 1593755272 >७ ⥪騩< (OIP1) +10:47:53 1593755273 >: 롮 稭< (OIP1) +10:47:53 1593755273 >७ < (OIP1) +10:48:10 1593755290 >७ < (OIP1) +10:48:10 1593755290 >< (OIP1) +10:53:19 1593755599 >஫ < (OIP1) +10:53:22 1593755602 >< (OIP1) +10:53:22 1593755602 >஫ < (OIP1) +10:53:22 1593755602 >< (OIP1) +10:53:23 1593755603 >஫ < (OIP1) +10:53:26 1593755606 Vacuum C1_CMD_GAS_PRS_CTR_SK --softkey pressure control gas on/off(CMD)࠭ (OIP1) +10:53:27 1593755607 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +10:53:36 1593755616 >< (OIP1) +10:53:36 1593755616 >஫ < (OIP1) +10:53:36 1593755616 >< (OIP1) +10:53:40 1593755620 >< (OIP1) +10:53:40 1593755620 >< (OIP1) +10:53:46 1593755626 >< (OIP1) +10:53:46 1593755626 >嫠 < (OIP1) +10:54:53 1593755693 >: 롮 稭< (OIP2) +10:54:53 1593755693 >嫠 < (OIP2) +13:06:30 1593763590 >嫠 < (OIP1) +13:06:30 1593763590 >< (OIP1) +13:06:32 1593763592 >< (OIP1) +13:06:32 1593763592 >७ ⥪騩< (OIP1) +13:06:33 1593763593 >: 롮 稭< (OIP1) +13:06:33 1593763593 >७ < (OIP1) +13:06:40 1593763600 >७ < (OIP1) +13:06:40 1593763600 >< (OIP1) +13:06:40 1593763600 >< (OIP1) +13:06:40 1593763600 >嫠 < (OIP1) +13:06:42 1593763602 >嫠 < (OIP1) +13:06:42 1593763602 >< (OIP1) +15:34:01 1593772441 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +15:34:03 1593772443 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +15:51:52 1593773512 >< (OIP1) +15:51:52 1593773512 >嫠 < (OIP1) +15:51:52 1593773512 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +15:51:54 1593773514 >嫠 < (OIP1) +15:51:54 1593773514 >< (OIP1) +15:51:55 1593773515 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +16:28:23 1593775703 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +16:28:24 1593775704 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +16:28:26 1593775706 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +16:28:29 1593775709 >< (OIP1) +16:28:29 1593775709 >< (OIP1) +16:28:30 1593775710 >< (OIP1) +16:28:30 1593775710 >< (OIP1) +16:31:43 1593775903 >< (OIP1) +16:31:43 1593775903 >嫠 < (OIP1) +16:31:45 1593775905 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +16:31:47 1593775907 >嫠 < (OIP1) +16:31:47 1593775907 > < (OIP1) +16:31:49 1593775909 > < (OIP1) +16:31:49 1593775909 > < (OIP1) +16:31:49 1593775909 > < (OIP1) +16:31:49 1593775909 >Mpar6Interlocks12< (OIP1) +16:31:50 1593775910 Machine C1_CMD_DIAG_INSU_STING_SK --test insulation stinger(CMD)࠭ (OIP1) +16:31:55 1593775915 Machine C1_CMD_DIAG_INSU_FNCE_SK --test insulation furnace(CMD)࠭ (OIP1) +16:31:57 1593775917 >Mpar6Interlocks12< (OIP1) +16:31:57 1593775917 > < (OIP1) +16:31:59 1593775919 > < (OIP1) +16:31:59 1593775919 >< (OIP1) +16:32:00 1593775920 >< (OIP1) +16:32:00 1593775920 >< (OIP1) +16:32:01 1593775921 >< (OIP1) +16:32:01 1593775921 >७ ⥪騩< (OIP1) +16:32:02 1593775922 >: 롮 稭< (OIP1) +16:32:02 1593775922 >७ < (OIP1) +16:32:06 1593775926 >७ < (OIP1) +16:32:06 1593775926 >< (OIP1) +16:32:07 1593775927 >< (OIP1) +16:32:07 1593775927 >< (OIP1) +16:32:15 1593775935 >< (OIP1) +16:32:15 1593775935 >< (OIP1) +16:32:16 1593775936 >< (OIP1) +16:32:16 1593775936 >७ ⥪騩< (OIP1) +16:32:17 1593775937 >: 롮 稭< (OIP1) +16:32:17 1593775937 >७ < (OIP1) +16:32:21 1593775941 >७ < (OIP1) +16:32:21 1593775941 >< (OIP1) +16:33:38 1593776018 >嫠 < (OIP2) +16:33:38 1593776018 >७ ⥪騩< (OIP2) +16:38:05 1593776285 >< (OIP1) +16:38:05 1593776285 > < (OIP1) +16:38:06 1593776286 > < (OIP1) +16:38:06 1593776286 >< (OIP1) +16:38:19 1593776299 >< (OIP1) +16:38:19 1593776299 > < (OIP1) +16:38:39 1593776319 > < (OIP1) +16:38:39 1593776319 >< (OIP1) +16:45:05 1593776705 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +16:45:06 1593776706 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +16:46:42 1593776802 >< (OIP1) +16:46:42 1593776802 >< (OIP1) +16:46:44 1593776804 >< (OIP1) +16:46:44 1593776804 >< (OIP1) +16:47:03 1593776823 >< (OIP1) +16:47:03 1593776823 >< (OIP1) +16:47:03 1593776823 >< (OIP1) +16:47:03 1593776823 >७ ⥪騩< (OIP1) +16:47:04 1593776824 >: 롮 稭< (OIP1) +16:47:04 1593776824 >७ < (OIP1) +16:47:07 1593776827 >७ < (OIP1) +16:47:07 1593776827 >< (OIP1) +16:47:09 1593776829 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +16:47:10 1593776830 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +16:47:11 1593776831 >< (OIP1) +16:47:11 1593776831 >嫠 < (OIP1) +16:47:12 1593776832 >嫠 < (OIP1) +16:47:12 1593776832 >< (OIP1) +16:47:12 1593776832 >< (OIP1) +16:47:12 1593776832 >< (OIP1) +16:47:39 1593776859 >< (OIP1) +16:47:39 1593776859 >< (OIP1) +16:47:40 1593776860 >< (OIP1) +16:47:40 1593776860 >७ ⥪騩< (OIP1) +16:47:40 1593776860 >: 롮 稭< (OIP1) +16:47:40 1593776860 >७ < (OIP1) +16:47:44 1593776864 >७ < (OIP1) +16:47:44 1593776864 >< (OIP1) +16:47:59 1593776879 >< (OIP1) +16:47:59 1593776879 >< (OIP1) +16:48:00 1593776880 >< (OIP1) +16:48:00 1593776880 >७ ⥪騩< (OIP1) +16:48:01 1593776881 >: 롮 稭< (OIP1) +16:48:01 1593776881 >७ < (OIP1) +16:48:03 1593776883 >७ < (OIP1) +16:48:03 1593776883 >< (OIP1) +16:48:08 1593776888 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +16:48:09 1593776889 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +16:48:12 1593776892 >< (OIP1) +16:48:12 1593776892 >< (OIP1) +16:48:13 1593776893 >< (OIP1) +16:48:13 1593776893 >७ ⥪騩< (OIP1) +16:48:13 1593776893 >: 롮 稭< (OIP1) +16:48:13 1593776893 >७ < (OIP1) +16:48:15 1593776895 >७ < (OIP1) +16:48:15 1593776895 >< (OIP1) +16:48:19 1593776899 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +16:48:20 1593776900 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +16:48:22 1593776902 >< (OIP1) +16:48:22 1593776902 >< (OIP1) +16:48:22 1593776902 >< (OIP1) +16:48:22 1593776902 >७ ⥪騩< (OIP1) +16:48:23 1593776903 >: 롮 稭< (OIP1) +16:48:23 1593776903 >७ < (OIP1) +16:48:31 1593776911 >७ < (OIP1) +16:48:31 1593776911 >嫠 < (OIP1) +16:48:31 1593776911 >嫠 < (OIP1) +16:48:31 1593776911 >< (OIP1) +16:48:41 1593776921 >< (OIP1) +16:48:41 1593776921 >嫠 < (OIP1) +16:48:42 1593776922 >嫠 < (OIP1) +16:48:42 1593776922 >< (OIP1) +16:52:52 1593777172 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +16:52:53 1593777173 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +16:53:06 1593777186 >< (OIP1) +16:53:06 1593777186 >< (OIP1) +16:53:07 1593777187 >< (OIP1) +16:53:07 1593777187 >७ ⥪騩< (OIP1) +16:53:07 1593777187 >: 롮 稭< (OIP1) +16:53:07 1593777187 >७ < (OIP1) +16:53:10 1593777190 >७ < (OIP1) +16:53:10 1593777190 >嫠 < (OIP1) +16:53:11 1593777191 >嫠 < (OIP1) +16:53:11 1593777191 >< (OIP1) +16:53:28 1593777208 >< (OIP1) +16:53:28 1593777208 >< (OIP1) +16:53:28 1593777208 >< (OIP1) +16:53:28 1593777208 >७ ⥪騩< (OIP1) +16:53:29 1593777209 >: 롮 稭< (OIP1) +16:53:29 1593777209 >७ < (OIP1) +16:53:31 1593777211 >७ < (OIP1) +16:53:31 1593777211 >嫠 < (OIP1) +16:53:32 1593777212 >嫠 < (OIP1) +16:53:32 1593777212 >< (OIP1) +16:53:49 1593777229 >< (OIP1) +16:53:49 1593777229 >< (OIP1) +16:53:50 1593777230 >< (OIP1) +16:53:50 1593777230 >७ ⥪騩< (OIP1) +16:53:51 1593777231 >: 롮 稭< (OIP1) +16:53:51 1593777231 >७ < (OIP1) +16:53:53 1593777233 >७ < (OIP1) +16:53:53 1593777233 >嫠 < (OIP1) +16:53:53 1593777233 >嫠 < (OIP1) +16:53:53 1593777233 >< (OIP1) +16:54:07 1593777247 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +16:54:09 1593777249 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +16:54:10 1593777250 >< (OIP1) +16:54:10 1593777250 >< (OIP1) +16:54:11 1593777251 >< (OIP1) +16:54:11 1593777251 >嫠 < (OIP1) +16:54:13 1593777253 >嫠 < (OIP1) +16:54:13 1593777253 >< (OIP1) +16:54:34 1593777274 >< (OIP1) +16:54:34 1593777274 >< (OIP1) +16:54:35 1593777275 >< (OIP1) +16:54:35 1593777275 >७ ⥪騩< (OIP1) +16:54:37 1593777277 >: 롮 稭< (OIP1) +16:54:37 1593777277 >७ < (OIP1) +16:54:41 1593777281 >७ < (OIP1) +16:54:41 1593777281 >嫠 < (OIP1) +16:54:42 1593777282 >嫠 < (OIP1) +16:54:42 1593777282 >< (OIP1) +16:54:54 1593777294 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +16:54:55 1593777295 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +16:54:56 1593777296 >< (OIP1) +16:54:56 1593777296 >嫠 < (OIP1) +16:54:58 1593777298 >嫠 < (OIP1) +16:54:58 1593777298 >< (OIP1) +16:55:22 1593777322 >< (OIP1) +16:55:22 1593777322 >< (OIP1) +16:55:23 1593777323 >< (OIP1) +16:55:23 1593777323 >嫠 < (OIP1) +16:55:23 1593777323 >嫠 < (OIP1) +16:55:23 1593777323 >< (OIP1) +16:55:34 1593777334 >< (OIP1) +16:55:34 1593777334 >< (OIP1) +16:55:34 1593777334 >< (OIP1) +16:55:34 1593777334 >७ ⥪騩< (OIP1) +16:55:35 1593777335 >: 롮 稭< (OIP1) +16:55:35 1593777335 >७ < (OIP1) +16:55:40 1593777340 >७ < (OIP1) +16:55:40 1593777340 >嫠 < (OIP1) +16:55:41 1593777341 >嫠 < (OIP1) +16:55:41 1593777341 >< (OIP1) +16:56:12 1593777372 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +16:56:13 1593777373 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +16:56:29 1593777389 >< (OIP1) +16:56:29 1593777389 >< (OIP1) +16:56:30 1593777390 ⢨ (OIP1) +16:56:31 1593777391 >< (OIP1) +16:56:31 1593777391 >< (OIP1) +16:56:32 1593777392 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +16:56:34 1593777394 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +17:00:27 1593777627 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +17:00:29 1593777629 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +17:00:30 1593777630 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +17:01:48 1593777708 >< (OIP1) +17:01:48 1593777708 > < (OIP1) +17:01:51 1593777711 > < (OIP1) +17:01:51 1593777711 > < (OIP1) +17:01:51 1593777711 > < (OIP1) +17:01:51 1593777711 >Mpar6Interlocks12< (OIP1) +17:01:52 1593777712 Machine C1_CMD_DIAG_INSU_STING_SK --test insulation stinger(CMD)࠭ (OIP1) +17:01:58 1593777718 Machine C1_CMD_DIAG_INSU_FNCE_SK --test insulation furnace(CMD)࠭ (OIP1) +17:01:59 1593777719 >Mpar6Interlocks12< (OIP1) +17:01:59 1593777719 > < (OIP1) +17:02:00 1593777720 > < (OIP1) +17:02:00 1593777720 >< (OIP1) +17:02:37 1593777757 >< (OIP1) +17:02:37 1593777757 >嫠 < (OIP1) +17:02:38 1593777758 >嫠 < (OIP1) +17:02:38 1593777758 >< (OIP1) +17:03:23 1593777803 >< (OIP1) +17:03:23 1593777803 >< (OIP1) +17:03:25 1593777805 >< (OIP1) +17:03:25 1593777805 >७ ⥪騩< (OIP1) +17:03:25 1593777805 >: 롮 稭< (OIP1) +17:03:25 1593777805 >७ < (OIP1) +17:03:30 1593777810 >७ < (OIP1) +17:03:30 1593777810 >< (OIP1) +17:03:37 1593777817 >< (OIP1) +17:03:37 1593777817 >嫠 < (OIP1) +17:03:38 1593777818 >嫠 < (OIP1) +17:03:38 1593777818 >< (OIP1) +17:03:54 1593777834 >< (OIP1) +17:03:54 1593777834 > < (OIP1) +17:03:55 1593777835 > < (OIP1) +17:03:55 1593777835 >< (OIP1) +17:04:29 1593777869 >< (OIP1) +17:04:29 1593777869 >< (OIP1) +17:04:30 1593777870 >< (OIP1) +17:04:30 1593777870 >७ ⥪騩< (OIP1) +17:04:32 1593777872 >: 롮 稭< (OIP1) +17:04:32 1593777872 >७ < (OIP1) +17:04:36 1593777876 >७ < (OIP1) +17:04:36 1593777876 >嫠 < (OIP1) +17:04:36 1593777876 >嫠 < (OIP1) +17:04:36 1593777876 >< (OIP1) +17:04:37 1593777877 >< (OIP1) +17:04:37 1593777877 > < (OIP1) +17:04:40 1593777880 > < (OIP1) +17:04:40 1593777880 >< (OIP1) +17:04:43 1593777883 >< (OIP1) +17:04:43 1593777883 >< (OIP1) +17:04:44 1593777884 >< (OIP1) +17:04:44 1593777884 >७ ⥪騩< (OIP1) +17:04:46 1593777886 >: 롮 稭< (OIP1) +17:04:46 1593777886 >७ < (OIP1) +17:04:53 1593777893 >७ < (OIP1) +17:04:53 1593777893 >嫠 < (OIP1) +17:04:53 1593777893 >嫠 < (OIP1) +17:04:53 1593777893 >< (OIP1) +17:08:34 1593778114 >< (OIP1) +17:08:34 1593778114 >< (OIP1) +17:08:34 1593778114 >< (OIP1) +17:08:34 1593778114 >७ ⥪騩< (OIP1) +17:08:35 1593778115 >: 롮 稭< (OIP1) +17:08:35 1593778115 >७ < (OIP1) +17:08:38 1593778118 >७ < (OIP1) +17:08:38 1593778118 >< (OIP1) +17:09:34 1593778174 >< (OIP1) +17:09:34 1593778174 >< (OIP1) +17:09:35 1593778175 >< (OIP1) +17:09:35 1593778175 > < (OIP1) +17:09:37 1593778177 > < (OIP1) +17:09:37 1593778177 >< (OIP1) +17:09:51 1593778191 >< (OIP1) +17:09:51 1593778191 > < (OIP1) +17:09:52 1593778192 > < (OIP1) +17:09:52 1593778192 >< (OIP1) +17:09:55 1593778195 >< (OIP1) +17:09:55 1593778195 >< (OIP1) +17:09:56 1593778196 >< (OIP1) +17:09:56 1593778196 >७ ⥪騩< (OIP1) +17:09:57 1593778197 >: 롮 稭< (OIP1) +17:09:57 1593778197 >७ < (OIP1) +17:10:02 1593778202 >७ < (OIP1) +17:10:02 1593778202 >嫠 < (OIP1) +17:10:02 1593778202 >嫠 < (OIP1) +17:10:02 1593778202 >< (OIP1) +17:12:03 1593778323 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:12:04 1593778324 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +17:12:54 1593778374 >< (OIP1) +17:12:54 1593778374 >< (OIP1) +17:12:56 1593778376 >< (OIP1) +17:12:56 1593778376 >७ ⥪騩< (OIP1) +17:12:57 1593778377 >: 롮 稭< (OIP1) +17:12:57 1593778377 >७ < (OIP1) +17:12:59 1593778379 >७ < (OIP1) +17:12:59 1593778379 >嫠 < (OIP1) +17:12:59 1593778379 >嫠 < (OIP1) +17:12:59 1593778379 >< (OIP1) +17:13:05 1593778385 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:13:07 1593778387 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:13:08 1593778388 >< (OIP1) +17:13:08 1593778388 >< (OIP1) +17:13:08 1593778388 >< (OIP1) +17:13:08 1593778388 >७ ⥪騩< (OIP1) +17:13:10 1593778390 >: 롮 稭< (OIP1) +17:13:10 1593778390 >७ < (OIP1) +17:13:12 1593778392 >७ < (OIP1) +17:13:12 1593778392 >嫠 < (OIP1) +17:13:12 1593778392 >嫠 < (OIP1) +17:13:12 1593778392 >< (OIP1) +17:13:43 1593778423 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:13:45 1593778425 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:13:46 1593778426 >< (OIP1) +17:13:46 1593778426 >< (OIP1) +17:13:46 1593778426 >< (OIP1) +17:13:46 1593778426 >७ ⥪騩< (OIP1) +17:13:47 1593778427 >: 롮 稭< (OIP1) +17:13:47 1593778427 >७ < (OIP1) +17:13:52 1593778432 >७ < (OIP1) +17:13:52 1593778432 >嫠 < (OIP1) +17:13:53 1593778433 >嫠 < (OIP1) +17:13:53 1593778433 >< (OIP1) +17:14:07 1593778447 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:14:07 1593778447 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:14:52 1593778492 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:14:53 1593778493 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:14:56 1593778496 >< (OIP1) +17:14:56 1593778496 >< (OIP1) +17:14:56 1593778496 >< (OIP1) +17:14:56 1593778496 >७ ⥪騩< (OIP1) +17:14:57 1593778497 >: 롮 稭< (OIP1) +17:14:57 1593778497 >७ < (OIP1) +17:14:59 1593778499 >७ < (OIP1) +17:14:59 1593778499 >嫠 < (OIP1) +17:15:00 1593778500 >嫠 < (OIP1) +17:15:00 1593778500 >< (OIP1) +17:16:13 1593778573 >< (OIP1) +17:16:13 1593778573 >< (OIP1) +17:16:16 1593778576 >< (OIP1) +17:16:16 1593778576 >< (OIP1) +17:16:55 1593778615 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:16:56 1593778616 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:16:58 1593778618 >< (OIP1) +17:16:58 1593778618 >< (OIP1) +17:16:59 1593778619 >< (OIP1) +17:16:59 1593778619 >< (OIP1) +17:17:10 1593778630 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:17:11 1593778631 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +17:17:15 1593778635 >< (OIP1) +17:17:15 1593778635 >< (OIP1) +17:17:15 1593778635 >< (OIP1) +17:17:15 1593778635 >७ ⥪騩< (OIP1) +17:17:16 1593778636 >: 롮 稭< (OIP1) +17:17:16 1593778636 >७ < (OIP1) +17:17:23 1593778643 >७ < (OIP1) +17:17:23 1593778643 >嫠 < (OIP1) +17:17:24 1593778644 >嫠 < (OIP1) +17:17:24 1593778644 >< (OIP1) +17:18:01 1593778681 >< (OIP1) +17:18:01 1593778681 >嫠 < (OIP1) +17:18:02 1593778682 >嫠 < (OIP1) +17:18:02 1593778682 >嫠 .< (OIP1) +17:18:04 1593778684 Cooling C1_CMD_CWT_HTR_SK --softkey heater cooling water(CMD)࠭ (OIP1) +17:18:05 1593778685 >嫠 .< (OIP1) +17:18:05 1593778685 >< (OIP1) +17:22:34 1593778954 >< (OIP1) +17:22:34 1593778954 >< (OIP1) +17:23:55 1593779035 >< (OIP1) +17:23:55 1593779035 >७ ⥪騩< (OIP1) +17:23:56 1593779036 >: 롮 稭< (OIP1) +17:23:56 1593779036 >७ < (OIP1) +17:24:12 1593779052 >७ < (OIP1) +17:24:12 1593779052 >< (OIP1) +17:25:08 1593779108 Vacuum C1_CMD_VAC_V089 --[V089] vacuum pump (roots)(CMD)࠭ (OIP1) +17:25:11 1593779111 Vacuum C1_CMD_VAC_V087 --[V087] vacuum pump (roots)(CMD)࠭ (OIP1) +17:25:12 1593779112 Vacuum C1_CMD_VAC_V089 --[V089] vacuum pump (roots)(CMD)࠭ (OIP1) +17:25:13 1593779113 Vacuum C1_CMD_VAC_V087 --[V087] vacuum pump (roots)(CMD)࠭ (OIP1) +17:25:19 1593779119 Vacuum C1_CMD_VAC_V087 --[V087] vacuum pump (roots)(CMD)࠭ (OIP1) +17:25:37 1593779137 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:30:06 1593779406 >< (OIP1) +17:30:06 1593779406 >< (OIP1) +17:30:06 1593779406 >< (OIP1) +17:30:06 1593779406 >७ ⥪騩< (OIP1) +17:30:06 1593779406 >: 롮 稭< (OIP1) +17:30:06 1593779406 >७ < (OIP1) +17:30:29 1593779429 >७ < (OIP1) +17:30:29 1593779429 >嫠 < (OIP1) +17:30:30 1593779430 >嫠 < (OIP1) +17:30:30 1593779430 >< (OIP1) +17:30:42 1593779442 >< (OIP1) +17:30:42 1593779442 >< (OIP1) +17:30:42 1593779442 >< (OIP1) +17:30:42 1593779442 >७ ⥪騩< (OIP1) +17:30:43 1593779443 >: 롮 稭< (OIP1) +17:30:43 1593779443 >७ < (OIP1) +17:30:50 1593779450 >७ < (OIP1) +17:30:50 1593779450 >< (OIP1) +17:31:02 1593779462 >< (OIP1) +17:31:02 1593779462 >< (OIP1) +17:31:03 1593779463 >< (OIP1) +17:31:03 1593779463 >७ ⥪騩< (OIP1) +17:31:04 1593779464 >: 롮 稭< (OIP1) +17:31:04 1593779464 >७ < (OIP1) +17:31:11 1593779471 >७ < (OIP1) +17:31:11 1593779471 >嫠 < (OIP1) +17:31:12 1593779472 >嫠 < (OIP1) +17:31:12 1593779472 >< (OIP1) +17:31:16 1593779476 >< (OIP1) +17:31:16 1593779476 >< (OIP1) +17:31:16 1593779476 >< (OIP1) +17:31:16 1593779476 >७ ⥪騩< (OIP1) +17:31:17 1593779477 >: 롮 稭< (OIP1) +17:31:17 1593779477 >७ < (OIP1) +17:31:24 1593779484 >७ < (OIP1) +17:31:24 1593779484 >嫠 < (OIP1) +17:31:25 1593779485 >嫠 < (OIP1) +17:31:25 1593779485 >< (OIP1) +17:32:06 1593779526 >< (OIP1) +17:32:06 1593779526 >< (OIP1) +17:32:07 1593779527 >< (OIP1) +17:32:07 1593779527 >७ ⥪騩< (OIP1) +17:32:07 1593779527 >: 롮 稭< (OIP1) +17:32:07 1593779527 >७ < (OIP1) +17:32:14 1593779534 >嫠 < (OIP1) +17:32:15 1593779535 >嫠 < (OIP1) +17:32:15 1593779535 >< (OIP1) +17:32:15 1593779535 >< (OIP1) +17:32:15 1593779535 >< (OIP1) +17:32:41 1593779561 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +17:32:42 1593779562 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +17:32:44 1593779564 Vacuum C1_CMD_VAC_V089 --[V089] vacuum pump (roots)(CMD)࠭ (OIP1) +17:33:17 1593779597 >< (OIP1) +17:33:17 1593779597 >< (OIP1) +17:33:18 1593779598 >< (OIP1) +17:33:18 1593779598 >७ ⥪騩< (OIP1) +17:33:19 1593779599 >: 롮 稭< (OIP1) +17:33:19 1593779599 >७ < (OIP1) +17:33:24 1593779604 >७ < (OIP1) +17:33:24 1593779604 >嫠 < (OIP1) +17:33:24 1593779604 >嫠 < (OIP1) +17:33:24 1593779604 >< (OIP1) +17:33:54 1593779634 >< (OIP1) +17:33:54 1593779634 >嫠 < (OIP1) +17:33:57 1593779637 >嫠 < (OIP1) +17:33:57 1593779637 >嫠 .< (OIP1) +17:33:57 1593779637 Cooling C1_CMD_CWT_HTR_SK --softkey heater cooling water(CMD)࠭ (OIP1) +17:34:00 1593779640 >嫠 .< (OIP1) +17:34:00 1593779640 >< (OIP1) +17:35:14 1593779714 >< (OIP1) +17:35:14 1593779714 >< (OIP1) +17:35:15 1593779715 >< (OIP1) +17:35:15 1593779715 >७ ⥪騩< (OIP1) +17:35:16 1593779716 >: 롮 稭< (OIP1) +17:35:16 1593779716 >७ < (OIP1) +17:35:18 1593779718 >७ < (OIP1) +17:35:18 1593779718 >嫠 < (OIP1) +17:35:20 1593779720 >嫠 < (OIP1) +17:35:20 1593779720 >< (OIP1) +17:37:47 1593779867 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +17:37:48 1593779868 Vacuum C1_CMD_VAC_V087 --[V087] vacuum pump (roots)(CMD)࠭ (OIP1) +17:37:48 1593779868 Vacuum C1_CMD_VAC_V089 --[V089] vacuum pump (roots)(CMD)࠭ (OIP1) +17:37:55 1593779875 >< (OIP1) +17:37:55 1593779875 >< (OIP1) +17:38:09 1593779889 >< (OIP1) +17:38:09 1593779889 >ਢઠ< (OIP1) +17:40:10 1593780010 >ਢઠ< (OIP1) +17:40:10 1593780010 >< (OIP1) +17:40:17 1593780017 >< (OIP1) +17:40:17 1593780017 >ਢઠ< (OIP1) +17:47:02 1593780422 >ਢઠ< (OIP1) +17:47:02 1593780422 >< (OIP1) +17:47:10 1593780430 >< (OIP1) +17:47:10 1593780430 >ਢઠ< (OIP1) +17:50:07 1593780607 >ਢઠ< (OIP1) +17:50:07 1593780607 >< (OIP1) +17:50:11 1593780611 >< (OIP1) +17:50:11 1593780611 >ਢઠ< (OIP1) +17:50:13 1593780613 >ਢઠ< (OIP1) +17:50:13 1593780613 >< (OIP1) +17:50:17 1593780617 >< (OIP1) +17:50:17 1593780617 >ਢઠ< (OIP1) +17:50:38 1593780638 >ਢઠ< (OIP1) +17:50:38 1593780638 >< (OIP1) +17:50:44 1593780644 >< (OIP1) +17:50:44 1593780644 >ਢઠ< (OIP1) +18:01:14 1593781274 >ਢઠ< (OIP1) +18:01:14 1593781274 >< (OIP1) +18:01:29 1593781289 >< (OIP1) +18:01:29 1593781289 >< (OIP1) +18:01:29 1593781289 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +18:01:30 1593781290 >஫ < (OIP1) +18:01:56 1593781316 Vacuum C1_CMD_GAS_PRS_CTR_SK --softkey pressure control gas on/off(CMD)࠭ (OIP1) +18:02:13 1593781333 >஫ < (OIP1) +18:04:14 1593781454 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +18:11:26 1593781886 >஫ < (OIP1) +18:11:27 1593781887 Vacuum C1_CMD_GAS_PRS_CTR_SK --softkey pressure control gas on/off(CMD)࠭ (OIP1) +18:11:30 1593781890 >஫ < (OIP1) +18:17:03 1593782223 >< (OIP1) +18:17:03 1593782223 >< (OIP1) +18:17:04 1593782224 >< (OIP1) +18:17:04 1593782224 >७ ⥪騩< (OIP1) +18:17:07 1593782227 >: 롮 稭< (OIP1) +18:17:07 1593782227 >७ < (OIP1) +18:17:15 1593782235 >७ < (OIP1) +18:17:15 1593782235 >< (OIP1) +18:17:18 1593782238 >< (OIP1) +18:17:18 1593782238 >< (OIP1) +18:17:21 1593782241 ⢨ (OIP1) +18:17:21 1593782241 >< (OIP1) +18:17:21 1593782241 >< (OIP1) +18:17:24 1593782244 >< (OIP1) +18:17:24 1593782244 >嫠 < (OIP1) +18:17:25 1593782245 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +18:17:28 1593782248 >嫠 < (OIP1) +18:17:28 1593782248 >< (OIP1) +18:17:28 1593782248 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +18:17:29 1593782249 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200703.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.344 new file mode 100644 index 0000000..0fbd50e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200703.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200704.114 b/Tests/bin/Debug/netcoreapp3.1/temp/20200704.114 new file mode 100644 index 0000000..c36de91 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200704.114 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200704.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200704.344 new file mode 100644 index 0000000..3575a1b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200704.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200705.114 b/Tests/bin/Debug/netcoreapp3.1/temp/20200705.114 new file mode 100644 index 0000000..847791e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200705.114 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200705.174 b/Tests/bin/Debug/netcoreapp3.1/temp/20200705.174 new file mode 100644 index 0000000..2b7815d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200705.174 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200705.241 b/Tests/bin/Debug/netcoreapp3.1/temp/20200705.241 new file mode 100644 index 0000000..cb1112e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200705.241 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200705.244 b/Tests/bin/Debug/netcoreapp3.1/temp/20200705.244 new file mode 100644 index 0000000..db2cb02 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200705.244 @@ -0,0 +1,2 @@ +06:55:18 NEW 0030: 訡 ஫ +07:30:10 ACK 0030: 訡 ஫ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200705.247 b/Tests/bin/Debug/netcoreapp3.1/temp/20200705.247 new file mode 100644 index 0000000..711a642 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200705.247 @@ -0,0 +1,6 @@ +05:09:40 1593907780 >< (OIP1) +05:09:40 1593907780 >७ ⥪騩< (OIP1) +05:09:40 1593907780 >: 롮 稭< (OIP1) +05:09:40 1593907780 >७ < (OIP1) +05:10:41 1593907841 >७ < (OIP1) +05:10:41 1593907841 >< (OIP1) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200705.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200705.344 new file mode 100644 index 0000000..c1e06c9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200705.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200706.034 b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.034 new file mode 100644 index 0000000..66b2c66 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.034 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200706.174 b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.174 new file mode 100644 index 0000000..0c8330a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.174 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200706.211 b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.211 new file mode 100644 index 0000000..4e2fb85 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.211 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200706.214 b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.214 new file mode 100644 index 0000000..cb378e9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.214 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200706.217 b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.217 new file mode 100644 index 0000000..b601bd8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.217 @@ -0,0 +1,12 @@ +14:18:35 1594027115 祭 ॣ '-2'(A) +14:18:37 1594027117 ⪫祭 ॣ '-2'(A) +15:56:53 1594033013 : 㦥 +16:02:36 1594033356 : 祭 ० '孮' +16:07:15 1594033635 ' ' +16:07:15 1594033635 祭 +16:07:19 1594033639 : 祭 筮 ० +16:12:41 1594033961 : ⪫祭 筮 ० +16:12:42 1594033962 : 祭 筮 ० +16:19:29 1594034369 : ⪫祭 筮 ० +16:19:30 1594034370 ⪫祭 +16:19:31 1594034371 : ⪫祭 ० '孮' diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200706.241 b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.241 new file mode 100644 index 0000000..f9011ea Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.241 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200706.244 b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.244 new file mode 100644 index 0000000..e3e50c0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.244 @@ -0,0 +1,2 @@ +22:11:24 NEW ।0354: 訡 +22:11:25 RTN ।0354: 訡 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200706.247 b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.247 new file mode 100644 index 0000000..90a8e4e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.247 @@ -0,0 +1,60 @@ +06:21:39 1593998499 >< (OIP1) +06:21:39 1593998499 >७ ⥪騩< (OIP1) +06:21:40 1593998500 >: 롮 稭< (OIP1) +06:21:40 1593998500 >७ < (OIP1) +06:22:09 1593998529 >७ < (OIP1) +06:22:09 1593998529 >嫠 < (OIP1) +06:22:12 1593998532 >嫠 < (OIP1) +06:22:12 1593998532 >< (OIP1) +06:22:12 1593998532 >< (OIP1) +06:22:12 1593998532 >< (OIP1) +06:22:13 1593998533 >< (OIP1) +06:22:13 1593998533 >७ ⥪騩< (OIP1) +06:22:14 1593998534 >: 롮 稭< (OIP1) +06:22:14 1593998534 >嫠 < (OIP1) +06:22:16 1593998536 >嫠 < (OIP1) +06:22:16 1593998536 >嫠 .< (OIP1) +06:22:19 1593998539 >嫠 .< (OIP1) +06:22:19 1593998539 >嫠 < (OIP1) +06:22:20 1593998540 >嫠 < (OIP1) +06:22:20 1593998540 >嫠 .< (OIP1) +06:22:32 1593998552 >嫠 .< (OIP1) +06:22:32 1593998552 >嫠 < (OIP1) +06:22:36 1593998556 >嫠 < (OIP1) +06:22:36 1593998556 >嫠 .< (OIP1) +06:22:37 1593998557 >嫠 .< (OIP1) +06:22:37 1593998557 >< (OIP1) +06:22:37 1593998557 >< (OIP1) +06:22:37 1593998557 >< (OIP1) +06:22:39 1593998559 >< (OIP1) +06:22:39 1593998559 >< (OIP1) +06:22:40 1593998560 >< (OIP1) +06:22:40 1593998560 >७ ⥪騩< (OIP1) +06:22:41 1593998561 >: 롮 稭< (OIP1) +06:22:41 1593998561 >嫠 < (OIP1) +06:22:42 1593998562 >嫠 < (OIP1) +06:22:42 1593998562 >७ ⥪騩< (OIP1) +06:22:42 1593998562 >: 롮 稭< (OIP1) +06:22:42 1593998562 >ਨ< (OIP1) +06:22:43 1593998563 >ਨ< (OIP1) +06:22:43 1593998563 >७ ⥪騩< (OIP1) +06:22:43 1593998563 >: 롮 稭< (OIP1) +06:22:43 1593998563 >嫠 < (OIP1) +06:22:47 1593998567 >嫠 < (OIP1) +06:22:47 1593998567 >७ ⥪騩< (OIP1) +06:22:48 1593998568 >: 롮 稭< (OIP1) +06:22:48 1593998568 >७ < (OIP1) +07:33:02 1594002782 >७ < (OIP1) +07:33:02 1594002782 >< (OIP1) +07:33:03 1594002783 >< (OIP1) +07:33:03 1594002783 >< (OIP1) +11:10:09 1594015809 >< (OIP1) +11:10:09 1594015809 >< (OIP1) +11:10:09 1594015809 >< (OIP1) +11:10:09 1594015809 >७ ⥪騩< (OIP1) +11:10:10 1594015810 >: 롮 稭< (OIP1) +11:10:10 1594015810 >७ < (OIP1) +15:52:15 1594032735 >७ < (OIP1) +15:52:15 1594032735 >< (OIP1) +15:52:15 1594032735 >< (OIP1) +15:52:15 1594032735 >< (OIP1) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200706.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.344 new file mode 100644 index 0000000..f536536 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200706.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.414 new file mode 100644 index 0000000..b352f0f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200706.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.034 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.034 new file mode 100644 index 0000000..1916915 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.034 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.174 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.174 new file mode 100644 index 0000000..5d195e6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.174 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.210 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.210 new file mode 100644 index 0000000..5dbf57e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.210 @@ -0,0 +1 @@ +20:53:16 1594137196 1 07196 2 p. cao M1,M2,M3,M4 3 30 4 1 8 5310 9 8360 10 750 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.211 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.211 new file mode 100644 index 0000000..5809f69 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.211 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.212 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.212 new file mode 100644 index 0000000..3d64e5e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.212 @@ -0,0 +1,3 @@ +21 20:51:20 20:51:23 +Rsk= 12.1 Rkk= 7.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.213 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.213 new file mode 100644 index 0000000..6ae4c7b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.213 @@ -0,0 +1 @@ +2 12:26:12 1594106772 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.214 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.214 new file mode 100644 index 0000000..875a9cb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.214 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.216 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.216 new file mode 100644 index 0000000..88f944a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.216 @@ -0,0 +1,6 @@ +[97] +oper = 2 +begin = 07.07.2020 12:26:12 +norma = 110 +real = 1216 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.217 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.217 new file mode 100644 index 0000000..967a842 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.217 @@ -0,0 +1,4 @@ +12:26:21 1594106781 : 㦥 +20:53:19 1594137199 : +22:23:12 1594142592 祭 ॣ '-2'(A) +22:23:14 1594142594 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.241 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.241 new file mode 100644 index 0000000..0cca59a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.241 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.244 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.244 new file mode 100644 index 0000000..1671d17 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.244 @@ -0,0 +1 @@ +20:54:25 ACK ।0354: 訡 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.311 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.311 new file mode 100644 index 0000000..6575f76 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.311 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.312 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.312 new file mode 100644 index 0000000..85f1d53 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.312 @@ -0,0 +1,57 @@ +21 05:27:59 05:28:02 +Rsk= 19.0 Rkk= 19.4 + +22 05:52:29 06:03:04 +P1= 27.3 T1=05:58:04 P2= 48.2 T2=06:03:04 Vs= 4.17 + +20 10:26:57 10:27:06 +Riz_sol= 1250.4 + +21 10:27:35 10:27:38 +Rsk= 22.5 Rkk= 19.7 + +22 11:31:24 11:46:59 +P1= 34.7 T1=11:41:59 P2= 47.2 T2=11:46:59 Vs= 2.50 + +23 11:47:24 11:47:29 + + +24 11:47:53 11:48:29 + + +30 11:48:44 11:49:10 +Vst= 30.1 + +31 11:49:33 11:50:34 +Rom_sol= 11.8 + +41 11:51:07 11:51:12 +Ukz= 1.26 + +32 11:51:16 11:51:52 +Imax=11.0 Umax=50.0 T= 9.0 + +33 11:51:58 11:52:24 +Imin=16.0 Umin=25.0 T= 0.5 + +34 11:52:30 11:52:54 +V=300.1 T= 9.6 + +35 11:52:58 11:53:59 +Q= 3.6 T= 9.6 + +36 11:54:05 11:54:42 +P1=0.29 T= 3.1 + +37 11:54:48 11:55:29 +T= 1.1 + +38 11:55:56 11:56:14 +t= 52.1 T= 0.7 + +39 11:56:18 11:56:27 +t= 51.1 T= 0.7 + +40 11:56:32 11:56:45 +t= 54.3 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.313 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.313 new file mode 100644 index 0000000..aa31793 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.313 @@ -0,0 +1,15 @@ +12 02:47:22 1594072042 +13 04:56:06 1594079766 +0 04:56:06 1594079766 +14 05:27:31 1594081651 +15 06:03:48 1594083828 +16 06:31:49 1594085509 +1 06:57:01 1594087021 +8 07:34:12 1594089252 +25 11:48:40 1594104520 +9 11:57:44 1594105064 +10 12:27:49 1594106869 +11 17:52:24 1594126344 +12 20:35:35 1594136135 +13 22:23:08 1594142588 +0 22:23:08 1594142588 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.314 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.314 new file mode 100644 index 0000000..720b112 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.314 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.315 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.315 new file mode 100644 index 0000000..9822449 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.315 @@ -0,0 +1 @@ +17 08:20:35 1594092035 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.316 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.316 new file mode 100644 index 0000000..45df87b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.316 @@ -0,0 +1,80 @@ +[01] +oper = 12 +begin = 07.07.2020 02:47:22 +norma = 105 +real = 128 + +[02] +oper = 13 +begin = 07.07.2020 04:56:06 +norma = 45 +real = 31 + +[03] +oper = 14 +begin = 07.07.2020 05:27:31 +norma = 40 +vac_time = 7 +real = 36 + +[04] +oper = 15 +begin = 07.07.2020 06:03:48 +norma = 30 +real = 28 + +[05] +oper = 16 +begin = 07.07.2020 06:31:49 +norma = 40 +real = 25 + +[06] +oper = 1 +begin = 07.07.2020 06:57:01 +norma = 85 +real = 37 + +[07] +oper = 8 +begin = 07.07.2020 07:34:12 +norma = 40 +vac_time = 173 +real = 254 + +[08] +oper = 25 +begin = 07.07.2020 11:48:40 +norma = 30 +real = 9 + +[09] +oper = 9 +begin = 07.07.2020 11:57:44 +norma = 0 +real = 30 + +[10] +oper = 10 +begin = 07.07.2020 12:27:49 +norma = 0 +real = 324 + +[11] +oper = 11 +begin = 07.07.2020 17:52:24 +norma = 0 +real = 163 + +[12] +oper = 12 +begin = 07.07.2020 20:35:35 +norma = 105 +real = 107 + +[13] +oper = 13 +begin = 07.07.2020 22:23:08 +norma = 45 +real = 183 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.317 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.317 new file mode 100644 index 0000000..f9ab6ca --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.317 @@ -0,0 +1,54 @@ +00:12:20 1594062740 ⪫祭 ॣ '-2'(A) +02:47:21 1594072041 ⪫祭 ० (A) +02:47:21 1594072041 ⪫祭 +02:47:21 1594072041 : +02:47:23 1594072043 ⪫祭 ० ' ⮪ 㣨' +02:49:18 1594072158 祭 ० ᪠ +02:49:18 1594072158 祭 ० ᪠ +02:49:18 1594072158 祭 ० ᪠ +02:51:44 1594072304 ⪫祭 ० ᪠ (A) +03:17:21 1594073841 : 믮 +06:03:45 1594083825 祭 ० ࠧ +06:03:46 1594083826 祭 ० ' ⮪ 㣨' +06:03:47 1594083827 祭 ॣ '-2'(A) +06:20:10 1594084810 ⪫祭 ० ࠧ (A) +06:20:15 1594084815 ⪫祭 ० ' ⮪ 㣨' +06:31:52 1594085512 ⪫祭 ॣ '-2'(A) +06:32:42 1594085562 祭 ० ᪠ +06:32:53 1594085573 祭 ० ᪠ +06:32:53 1594085573 祭 ० ᪠ +06:32:54 1594085574 祭 ० ᪠ +06:35:49 1594085749 ⪫祭 ० ᪠ (A) +07:43:10 1594089790 : 㦥 +11:47:28 1594104448 ' ' +11:47:29 1594104449 祭 +11:47:32 1594104452 ' ' +11:47:53 1594104473 祭 ॣ '-2'(A) +11:48:29 1594104509 ⪫祭 ॣ '-2'(A) +11:49:16 1594104556 ' ' +11:49:27 1594104567 ' ' +11:49:34 1594104574 祭 +11:50:34 1594104634 ⪫祭 +11:57:07 1594105027 祭 ० ࠧ +11:57:09 1594105029 祭 ० ' ⮪ 㣨' +11:57:45 1594105065 : 믮 +12:14:19 1594106059 祭 ॣ '-2'(A) +12:27:49 1594106869 祭 ⠭ ॣ +12:27:49 1594106869 ⪫祭 ० ࠧ (A) +17:52:24 1594126344 祭 ० +17:52:24 1594126344 ⪫祭 ॣ '-2'(A) +17:52:26 1594126346 祭 ॣ '-2'(A) +18:48:25 1594129705 ⪫祭 ॣ '-2'(A) +20:35:27 1594136127 ⪫祭 ० (A) +20:35:29 1594136129 ⪫祭 +20:35:29 1594136129 : +20:35:31 1594136131 ⪫祭 ० ' ⮪ 㣨' +20:36:16 1594136176 祭 ० ᪠ +20:36:16 1594136176 祭 ० ᪠ +20:36:16 1594136176 祭 ० ᪠ +20:36:30 1594136190 祭 ० ᪠ +20:38:56 1594136336 ⪫祭 ० ᪠ +20:38:58 1594136338 祭 ० ᪠ +20:38:58 1594136338 祭 ० ᪠ +20:39:09 1594136349 ⪫祭 ० ᪠ (A) +21:05:29 1594137929 : 믮 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.319 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.319 new file mode 100644 index 0000000..29b1b33 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.319 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.320 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.320 new file mode 100644 index 0000000..f64831a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.320 @@ -0,0 +1,10 @@ +07:40:23 1594089623 3 14 6 +11:15:50 1594102550 1 05163 3 32 +14:12:54 1594113174 2 ᯥਬ +16:00:16 1594119616 6 +16:00:39 1594119639 12 320469 +16:02:42 1594119762 1 05163 2 ᯥਬ 3 32 4 2 5 Ti 6 7 770 8 4450 9 3540 10 670 11 12 320469 +16:52:21 1594122741 0 A--32-050-2020 ॢ 2 +23:03:18 1594144998 3 14 +23:15:34 1594145734 6 +23:15:48 1594145748 2 OT-4 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.321 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.321 new file mode 100644 index 0000000..1019d7d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.321 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.322 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.322 new file mode 100644 index 0000000..b7d149d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.322 @@ -0,0 +1,69 @@ +21 06:05:18 06:05:21 +Rsk= 18.1 Rkk= 13.0 + +22 06:20:28 06:35:33 +P1= 56.8 T1=06:30:33 P2= 76.7 T2=06:35:33 Vs= 3.97 + +21 10:29:34 10:29:37 +Rsk= 17.8 Rkk= 12.6 + +22 11:00:28 11:15:33 +P1= 46.4 T1=11:10:33 P2= 62.1 T2=11:15:33 Vs= 3.14 + +20 15:01:34 15:01:43 +Riz_sol= 4806.0 + +21 15:01:55 15:01:58 +Rsk= 18.2 Rkk= 12.8 + +22 15:35:29 15:50:34 +P1= 36.9 T1=15:45:34 P2= 51.3 T2=15:50:34 Vs= 2.87 + +23 15:51:01 15:51:06 + + +24 15:51:13 15:51:52 + + +30 15:52:08 15:52:44 +Vst= 29.8 + +31 15:52:53 15:53:28 +Rom_sol= 10.4 + +41 15:54:06 15:54:11 +Ukz= 1.14 + +32 15:54:14 15:54:49 +Imax=27.2 Umax=55.0 T= 9.0 + +33 15:54:52 15:55:14 +Imin=16.2 Umin=24.9 T= 0.5 + +34 15:55:17 15:55:39 +V=300.1 T= 9.4 + +35 15:55:41 15:56:47 +Q= 54.8 T= 9.4 + +36 15:56:51 15:57:30 +P1=0.29 T= 2.9 + +37 15:57:34 15:58:06 +T= 0.9 + +38 15:58:10 15:58:17 +t= 52.2 T= 0.5 + +39 15:58:20 15:58:36 +tcam= 52.2 Tcam= 0.5 tfl= 51.8 Tfl= 0.5 + +40 15:58:42 15:58:49 +t= 53.2 T= 0.5 + +21 23:15:57 23:16:00 +Rsk= 17.7 Rkk= 12.5 + +22 23:32:55 23:43:00 +P1= 17.5 T1=23:38:00 P2= 41.3 T2=23:43:00 Vs= 4.77 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.323 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.323 new file mode 100644 index 0000000..ccf4097 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.323 @@ -0,0 +1,21 @@ +11 01:49:44 1594068584 +12 03:49:54 1594075794 +13 05:34:22 1594082062 +0 05:34:22 1594082062 +14 05:59:02 1594083542 +15 07:40:37 1594089637 +16 08:08:36 1594091316 +1 08:43:13 1594093393 +2 10:23:59 1594099439 +5 11:42:57 1594104177 +6 11:56:02 1594104962 +7 12:28:20 1594106900 +8 14:52:46 1594115566 +25 15:52:06 1594119126 +9 16:02:42 1594119762 +10 16:52:21 1594122741 +11 18:27:38 1594128458 +12 20:51:13 1594137073 +13 22:20:56 1594142456 +0 22:20:56 1594142456 +14 22:56:32 1594144592 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.324 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.324 new file mode 100644 index 0000000..e87b7d4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.324 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.326 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.326 new file mode 100644 index 0000000..aafe9a2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.326 @@ -0,0 +1,119 @@ +[36] +oper = 11 +begin = 07.07.2020 01:49:44 +norma = 115 +real = 120 + +[37] +oper = 12 +begin = 07.07.2020 03:49:54 +norma = 105 +real = 104 + +[38] +oper = 13 +begin = 07.07.2020 05:34:22 +norma = 45 +real = 24 + +[39] +oper = 14 +begin = 07.07.2020 05:59:02 +norma = 40 +vac_time = 7 +real = 101 + +[40] +oper = 15 +begin = 07.07.2020 07:40:37 +norma = 30 +real = 27 + +[41] +oper = 16 +begin = 07.07.2020 08:08:36 +norma = 40 +real = 34 + +[42] +oper = 1 +begin = 07.07.2020 08:43:13 +norma = 85 +real = 100 + +[43] +oper = 2 +begin = 07.07.2020 10:23:59 +norma = 110 +vac_time = 8 +real = 78 + +[44] +oper = 5 +begin = 07.07.2020 11:42:57 +norma = 25 +real = 13 + +[45] +oper = 6 +begin = 07.07.2020 11:56:02 +norma = 35 +real = 32 + +[46] +oper = 7 +begin = 07.07.2020 12:28:20 +norma = 30 +real = 144 + +[47] +oper = 8 +begin = 07.07.2020 14:52:46 +norma = 40 +vac_time = 9 +real = 59 + +[48] +oper = 25 +begin = 07.07.2020 15:52:06 +norma = 30 +real = 10 + +[49] +oper = 9 +begin = 07.07.2020 16:02:42 +norma = 0 +real = 49 + +[50] +oper = 10 +begin = 07.07.2020 16:52:21 +norma = 0 +real = 95 + +[51] +oper = 11 +begin = 07.07.2020 18:27:38 +norma = 115 +real = 143 + +[52] +oper = 12 +begin = 07.07.2020 20:51:13 +norma = 105 +real = 89 + +[53] +oper = 13 +begin = 07.07.2020 22:20:56 +norma = 45 +real = 35 + +[54] +oper = 14 +begin = 07.07.2020 22:56:32 +norma = 40 +vac_time = 7 +vac_avg10 = 8.3 +real = 64 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.327 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.327 new file mode 100644 index 0000000..b9b13bb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.327 @@ -0,0 +1,40 @@ +01:49:43 1594068583 祭 ० +01:49:43 1594068583 ⪫祭 ॣ '-2'(A) +01:49:44 1594068584 祭 ॣ '-2'(A) +02:36:07 1594071367 祭 ० +02:36:09 1594071369 ⪫祭 ॣ '-2'(A) +03:49:43 1594075783 ⪫祭 ० (A) +03:49:45 1594075785 ⪫祭 ० ' ⮪ 㣨' +03:50:35 1594075835 祭 ० ᪠ +03:52:58 1594075978 ⪫祭 ० ᪠ (A) +07:40:35 1594089635 祭 ० ࠧ +07:40:36 1594089636 祭 ० ' ⮪ 㣨' +07:40:37 1594089637 祭 ॣ '-2'(A) +08:05:54 1594091154 ⪫祭 ० ' ⮪ 㣨' +08:08:40 1594091320 ⪫祭 ॣ '-2'(A) +08:08:50 1594091330 祭 ० ᪠ +08:08:50 1594091330 祭 ० ᪠ +08:11:04 1594091464 ⪫祭 ० ᪠ (A) +11:56:12 1594104972 祭 ० ᪠ +11:58:20 1594105100 ⪫祭 ० ᪠ (A) +15:51:15 1594119075 祭 ॣ '-2'(A) +15:51:53 1594119113 ⪫祭 ॣ '-2'(A) +16:02:11 1594119731 祭 ० ࠧ +16:02:13 1594119733 祭 ० ' ⮪ 㣨' +16:04:21 1594119861 祭 ॣ '-2'(A) +16:19:10 1594120750 ⪫祭 ० ᪠ (A) +16:20:33 1594120833 ⪫祭 ० ᪠ (A) +16:52:21 1594122741 ⪫祭 ० ࠧ (A) +16:52:21 1594122741 祭 ⠭ ॣ +18:27:37 1594128457 祭 ० +18:27:38 1594128458 ⪫祭 ॣ '-2'(A) +18:27:39 1594128459 祭 ॣ '-2'(A) +18:32:46 1594128766 ⪫祭 ० ᪠ (A) +19:17:38 1594131458 祭 ० +19:17:40 1594131460 ⪫祭 ॣ '-2'(A) +20:27:38 1594135658 ⪫祭 ० (A) +20:27:40 1594135660 ⪫祭 ० ' ⮪ 㣨' +20:28:58 1594135738 祭 ० ᪠ +20:31:00 1594135860 ⪫祭 ० ᪠ (A) +23:59:45 1594148385 祭 ० ࠧ +23:59:46 1594148386 祭 ० ' ⮪ 㣨' diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.329 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.329 new file mode 100644 index 0000000..3d8fff6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.329 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.330 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.330 new file mode 100644 index 0000000..6472205 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.330 @@ -0,0 +1,8 @@ +00:02:25 1594062145 1 11194 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4230 9 3850 10 690 11 12 321544 +00:32:58 1594063978 0 A--32-074-2016 ॢ 1 +09:55:43 1594097743 3 14 +10:56:38 1594101398 0 A--32-067-2014 ॢ 0 +12:23:45 1594106625 1 11195 3 25 9 4020 10 670 +16:47:30 1594122450 2 BT 18, 20, 22, 23, 25 +17:45:09 1594125909 1 11195 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 4230 9 4020 10 670 11 12 321544 +18:13:51 1594127631 0 A--32-068-2019 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.331 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.331 new file mode 100644 index 0000000..c2edcc2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.331 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.332 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.332 new file mode 100644 index 0000000..8e6f65c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.332 @@ -0,0 +1,78 @@ +36 23:59:44 00:00:20 +P1=0.27 T= 3.0 + +37 00:00:25 00:01:07 +T= 0.7 + +38 00:01:11 00:01:19 +t= 52.1 T= 0.7 + +39 00:01:24 00:01:32 +t= 52.4 T= 0.5 + +40 00:01:36 00:01:45 +t= 52.0 T= 0.5 + +21 09:56:18 09:56:25 +Rsk= 17.9 Rkk= 12.7 + +22 10:11:30 10:27:00 +P1= 49.5 T1=10:22:00 P2= 66.5 T2=10:27:00 Vs= 3.39 + +21 12:24:19 12:24:27 +Rsk= 18.2 Rkk= 13.0 + +22 12:39:29 12:54:59 +P1= 36.4 T1=12:49:59 P2= 50.9 T2=12:54:59 Vs= 2.88 + +20 16:47:54 16:48:03 +Riz_sol= 1773.8 + +21 16:48:08 16:48:16 +Rsk= 18.4 Rkk= 13.3 + +22 17:19:33 17:35:04 +P1= 27.5 T1=17:30:04 P2= 39.0 T2=17:35:04 Vs= 2.30 + +23 17:35:19 17:35:26 + + +24 17:35:34 17:36:11 + + +30 17:36:25 17:37:04 +Vst= 28.5 + +31 17:37:08 17:38:09 +Rom_sol= 15.4 + +41 17:38:41 17:38:46 +Ukz= 0.89 + +32 17:38:48 17:39:59 +Imax=11.0 Umax=50.0 T= 9.4 + +33 17:40:03 17:40:38 +Imin=16.2 Umin=25.1 T= 0.8 + +34 17:40:42 17:41:10 +V=301.8 T= 9.6 + +35 17:41:14 17:42:06 +Q= 54.4 T= 9.2 + +36 17:42:10 17:42:43 +P1=0.21 T= 3.0 + +37 17:42:46 17:43:23 +T= 0.7 + +38 17:43:27 17:43:33 +t= 52.1 T= 0.7 + +39 17:43:36 17:43:42 +t= 52.4 T= 0.7 + +40 17:43:45 17:43:52 +t= 52.0 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.333 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.333 new file mode 100644 index 0000000..80b1d1a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.333 @@ -0,0 +1,20 @@ +9 00:02:25 1594062145 +10 00:32:59 1594063979 +11 04:07:42 1594076862 +12 06:50:50 1594086650 +13 08:40:48 1594093248 +0 08:40:48 1594093248 +14 09:51:45 1594097505 +15 10:28:13 1594099693 +16 10:56:38 1594101398 +16 11:00:24 1594101624 +1 11:45:13 1594104313 +2 12:16:32 1594106192 +5 12:55:49 1594108549 +6 13:10:13 1594109413 +7 13:49:44 1594111784 +8 16:43:13 1594122193 +25 17:36:23 1594125383 +9 17:45:09 1594125909 +10 18:13:51 1594127631 +11 21:57:30 1594141050 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.334 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.334 new file mode 100644 index 0000000..f709aab Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.334 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.336 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.336 new file mode 100644 index 0000000..255ebc4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.336 @@ -0,0 +1,117 @@ +[52] +oper = 9 +begin = 07.07.2020 00:02:25 +norma = 0 +real = 30 + +[53] +oper = 10 +begin = 07.07.2020 00:32:59 +norma = 0 +real = 214 + +[54] +oper = 11 +begin = 07.07.2020 04:07:42 +norma = 0 +real = 163 + +[55] +oper = 12 +begin = 07.07.2020 06:50:50 +norma = 105 +real = 109 + +[56] +oper = 13 +begin = 07.07.2020 08:40:48 +norma = 45 +real = 70 + +[57] +oper = 14 +begin = 07.07.2020 09:51:45 +norma = 40 +vac_time = 8 +real = 36 + +[58] +oper = 15 +begin = 07.07.2020 10:28:13 +norma = 30 +real = 28 + +[59] +oper = 16 +begin = 07.07.2020 10:56:38 +norma = 40 +real = 3 + +[60] +oper = 16 +begin = 07.07.2020 11:00:24 +norma = 40 +real = 44 + +[61] +oper = 1 +begin = 07.07.2020 11:45:13 +norma = 85 +real = 31 + +[62] +oper = 2 +begin = 07.07.2020 12:16:32 +norma = 110 +vac_time = 9 +real = 39 + +[63] +oper = 5 +begin = 07.07.2020 12:55:49 +norma = 25 +real = 14 + +[64] +oper = 6 +begin = 07.07.2020 13:10:13 +norma = 35 +real = 39 + +[65] +oper = 7 +begin = 07.07.2020 13:49:44 +norma = 30 +real = 173 + +[66] +oper = 8 +begin = 07.07.2020 16:43:13 +norma = 40 +vac_time = 10 +real = 53 + +[67] +oper = 25 +begin = 07.07.2020 17:36:23 +norma = 30 +real = 8 + +[68] +oper = 9 +begin = 07.07.2020 17:45:09 +norma = 0 +real = 28 + +[69] +oper = 10 +begin = 07.07.2020 18:13:51 +norma = 0 +real = 223 + +[70] +oper = 11 +begin = 07.07.2020 21:57:30 +norma = 0 +real = 163 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.337 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.337 new file mode 100644 index 0000000..acbccb1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.337 @@ -0,0 +1,51 @@ +00:01:51 1594062111 祭 ० ࠧ +00:01:53 1594062113 祭 ० ' ⮪ 㣨' +00:02:26 1594062146 : 믮 +00:19:29 1594063169 祭 ॣ '-2'(A) +00:32:58 1594063978 ⪫祭 ० ࠧ (A) +00:32:59 1594063979 祭 ⠭ ॣ +04:07:41 1594076861 祭 ० +04:07:42 1594076862 ⪫祭 ॣ '-2'(A) +04:07:43 1594076863 祭 ॣ '-2'(A) +05:03:43 1594080223 ⪫祭 ॣ '-2'(A) +06:50:45 1594086645 ⪫祭 ० (A) +06:50:46 1594086646 ⪫祭 +06:50:46 1594086646 : +06:50:51 1594086651 ⪫祭 ० ' ⮪ 㣨' +06:51:12 1594086672 祭 ० ᪠ +06:51:12 1594086672 祭 ० ᪠ +06:54:43 1594086883 ⪫祭 ० ᪠ (A) +07:20:47 1594088447 : 믮 +10:27:26 1594099646 祭 ० ࠧ +10:27:29 1594099649 祭 ० ' ⮪ 㣨' +10:28:55 1594099735 祭 ॣ '-2'(A) +10:56:38 1594101398 ⪫祭 ० ࠧ (A) +11:00:26 1594101626 ⪫祭 ० ' ⮪ 㣨' +11:00:28 1594101628 ⪫祭 ॣ '-2'(A) +11:00:37 1594101637 祭 ० ᪠ +11:00:38 1594101638 祭 ० ᪠ +11:00:38 1594101638 祭 ० ᪠ +11:03:48 1594101828 ⪫祭 ० ᪠ (A) +12:23:55 1594106635 : 㦥 +13:10:24 1594109424 祭 ० ᪠ +13:10:24 1594109424 祭 ० ᪠ +13:10:32 1594109432 祭 ० ᪠ +13:10:32 1594109432 祭 ० ᪠ +13:13:37 1594109617 ⪫祭 ० ᪠ (A) +13:50:47 1594111847 : 㦥 +17:35:37 1594125337 祭 ॣ '-2'(A) +17:36:12 1594125372 ⪫祭 ॣ '-2'(A) +17:36:29 1594125389 ' ' +17:36:29 1594125389 祭 +17:37:09 1594125429 祭 +17:38:09 1594125489 ⪫祭 +17:44:27 1594125867 祭 ० ࠧ +17:44:29 1594125869 祭 ० ' ⮪ 㣨' +17:45:10 1594125910 : 믮 +18:01:50 1594126910 祭 ॣ '-2'(A) +18:13:51 1594127631 ⪫祭 ० ࠧ (A) +18:13:51 1594127631 祭 ॣ . 殮 㣨 +21:57:29 1594141049 祭 ० +21:57:30 1594141050 ⪫祭 ॣ '-2'(A) +21:57:31 1594141051 祭 ॣ '-2'(A) +22:47:31 1594144051 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.339 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.339 new file mode 100644 index 0000000..2b45689 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.339 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.340 new file mode 100644 index 0000000..345e1a5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.340 @@ -0,0 +1,3 @@ +07:31:58 1594089118 3 14 +10:27:17 1594099637 1 09632 3 37 4 2 9 4740 10 670 12 320801 +18:35:59 1594128959 1 09632 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 37 4 2 5 Ti 6 7 770 8 4250 9 4740 10 670 11 12 320801 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.341 new file mode 100644 index 0000000..607e37a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.342 new file mode 100644 index 0000000..4f7d442 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.342 @@ -0,0 +1,63 @@ +21 07:32:06 07:32:09 +Rsk= 15.0 Rkk= 14.2 + +22 07:54:59 08:05:25 +P1= 13.7 T1=08:00:25 P2= 34.2 T2=08:05:25 Vs= 4.08 + +21 10:27:35 10:27:38 +Rsk= 15.1 Rkk= 14.5 + +22 11:04:03 11:14:30 +P1= 13.7 T1=11:09:30 P2= 26.4 T2=11:14:30 Vs= 2.55 + +20 17:23:19 17:23:28 +Riz_sol= 2132.3 + +21 17:23:35 17:23:38 +Rsk= 15.2 Rkk= 14.6 + +22 17:46:25 18:01:52 +P1= 53.3 T1=17:56:52 P2= 72.8 T2=18:01:52 Vs= 3.90 + +22 18:12:35 18:28:03 +P1= 33.6 T1=18:23:03 P2= 44.2 T2=18:28:03 Vs= 2.13 + +23 18:28:12 18:28:17 + + +24 18:28:24 18:29:05 + + +30 18:29:16 18:29:41 +Vst= 31.1 + +31 18:29:51 18:30:25 +Rom_sol= 12.8 + +32 18:31:20 18:31:57 +Imax=27.0 Umax=55.0 T= 9.0 + +33 18:32:00 18:32:21 +Imin=16.0 Umin=25.0 T= 0.5 + +34 18:32:24 18:32:48 +V=300.4 T= 9.4 + +35 18:32:51 18:33:48 +Q= 54.1 T= 9.4 + +36 18:33:51 18:34:25 +P1=0.29 T= 3.0 + +37 18:34:29 18:34:55 +T= 1.0 + +38 18:34:59 18:35:06 +t= 51.9 T= 0.5 + +39 18:35:10 18:35:18 +t= 51.8 T= 0.6 + +40 18:35:21 18:35:29 +t= 51.8 T= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.343 new file mode 100644 index 0000000..28cff85 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.343 @@ -0,0 +1,17 @@ +11 02:37:16 1594071436 +12 05:27:23 1594081643 +13 07:11:05 1594087865 +0 07:11:06 1594087866 +14 07:26:30 1594088790 +15 08:07:17 1594091237 +16 08:40:37 1594093237 +1 09:29:26 1594096166 +2 10:16:45 1594099005 +5 11:20:14 1594102814 +6 11:32:39 1594103559 +7 12:17:28 1594106248 +8 17:19:24 1594124364 +25 18:29:12 1594128552 +9 18:35:59 1594128959 +10 19:16:11 1594131371 +12 21:54:47 1594140887 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.344 new file mode 100644 index 0000000..ecf7991 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.345 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.345 new file mode 100644 index 0000000..54ae911 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.345 @@ -0,0 +1 @@ +47 18:30:58 1594128658 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.346 new file mode 100644 index 0000000..d2aacf1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.346 @@ -0,0 +1,99 @@ +[85] +oper = 11 +begin = 07.07.2020 02:37:16 +norma = 0 +real = 170 + +[86] +oper = 12 +begin = 07.07.2020 05:27:23 +norma = 105 +real = 103 + +[87] +oper = 13 +begin = 07.07.2020 07:11:05 +norma = 45 +real = 15 + +[88] +oper = 14 +begin = 07.07.2020 07:26:30 +norma = 40 +vac_time = 7 +real = 40 + +[89] +oper = 15 +begin = 07.07.2020 08:07:17 +norma = 30 +real = 33 + +[90] +oper = 16 +begin = 07.07.2020 08:40:37 +norma = 40 +real = 48 + +[91] +oper = 1 +begin = 07.07.2020 09:29:26 +norma = 85 +real = 47 + +[92] +oper = 2 +begin = 07.07.2020 10:16:45 +norma = 110 +vac_time = 11 +real = 63 + +[93] +oper = 5 +begin = 07.07.2020 11:20:14 +norma = 25 +real = 12 + +[94] +oper = 6 +begin = 07.07.2020 11:32:39 +norma = 35 +real = 44 + +[95] +oper = 7 +begin = 07.07.2020 12:17:28 +norma = 30 +real = 301 + +[96] +oper = 8 +begin = 07.07.2020 17:19:24 +norma = 40 +vac_time = 8 +real = 69 + +[97] +oper = 25 +begin = 07.07.2020 18:29:12 +norma = 30 +real = 6 + +[98] +oper = 9 +begin = 07.07.2020 18:35:59 +norma = 0 +real = 40 + +[99] +oper = 10 +begin = 07.07.2020 19:16:11 +norma = 0 +real = 158 + +[00] +oper = 12 +begin = 07.07.2020 21:54:47 +norma = 180 +real = 259 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.347 new file mode 100644 index 0000000..577b21b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.347 @@ -0,0 +1,27 @@ +02:37:16 1594071436 祭 ० +02:37:16 1594071436 ⪫祭 ॣ '-2'(A) +02:37:17 1594071437 祭 ॣ '-2'(A) +03:42:18 1594075338 ⪫祭 ॣ '-2'(A) +05:05:40 1594080340 ⪫祭 ० ' ⮪ 㣨' +05:06:30 1594080390 祭 ० ' ⮪ 㣨' +05:27:16 1594081636 ⪫祭 ० (A) +05:27:24 1594081644 ⪫祭 ० ' ⮪ 㣨' +05:28:32 1594081712 祭 ० ᪠ +05:31:06 1594081866 ⪫祭 ० ᪠ (A) +08:06:11 1594091171 祭 ० ࠧ +08:06:13 1594091173 祭 ० ' ⮪ 㣨' +08:07:43 1594091263 祭 ॣ '-2'(A) +08:21:47 1594092107 ⪫祭 ० ' ⮪ 㣨' +08:38:17 1594093097 ⪫祭 ० ࠧ (A) +08:40:41 1594093241 ⪫祭 ॣ '-2'(A) +08:40:43 1594093243 祭 ० ᪠ +08:43:35 1594093415 ⪫祭 ० ᪠ (A) +11:32:46 1594103566 祭 ० ᪠ +11:35:50 1594103750 ⪫祭 ० ᪠ (A) +18:28:24 1594128504 祭 ॣ '-2'(A) +18:29:05 1594128545 ⪫祭 ॣ '-2'(A) +18:51:04 1594129864 祭 ॣ '-2' +19:16:10 1594131370 祭 ⠭ ॣ +21:54:50 1594140890 ⪫祭 ॣ '-2'(A) +21:55:12 1594140912 祭 ० ᪠ +21:58:04 1594141084 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.349 new file mode 100644 index 0000000..79b3a1b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.350 new file mode 100644 index 0000000..76e12b7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.350 @@ -0,0 +1,4 @@ +00:47:38 1594064858 1 09567 2 BT 18, 20, 22, 23, 25 3 37 4 2 5 Ti 6 7 770 8 4640 9 5050 10 670 11 12 321427 +10:26:12 1594099572 3 14 +15:09:48 1594116588 1 09568 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 7 615 9 3900 10 495 12 321692 +18:50:21 1594129821 1 09568 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 615 8 4640 9 3900 10 495 11 12 321692 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.351 new file mode 100644 index 0000000..f71f280 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.352 new file mode 100644 index 0000000..ac21d8e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.352 @@ -0,0 +1,102 @@ +22 00:24:34 00:35:06 +P1= 38.2 T1=00:30:06 P2= 52.1 T2=00:35:06 Vs= 2.78 + +23 00:35:15 00:35:22 + + +24 00:35:30 00:36:07 + + +30 00:36:49 00:37:41 +Vst= 28.0 + +31 00:37:46 00:38:24 +Rom_sol= 15.4 + +24 00:42:10 00:42:47 + + +32 00:43:36 00:44:14 +Imax=27.3 Umax=55.1 T= 9.0 + +33 00:44:17 00:44:37 +Imin=16.2 Umin=24.9 T= 0.5 + +40 05:00:00 00:44:50 +t= 55.6 T= 0.7 + +39 00:44:52 00:45:08 +tcam= 54.6 Tcam= 0.7 tfl= 53.5 Tfl= 0.8 + +35 00:45:11 00:46:10 +Q= 54.0 T= 9.5 + +38 00:46:14 00:46:21 +t= 52.8 T= 0.8 + +36 05:00:00 00:47:00 +P1=0.29 T= 3.0 + +21 10:26:35 10:26:38 +Rsk= 14.9 Rkk= 12.2 + +22 11:04:10 11:14:40 +P1= 35.2 T1=11:09:40 P2= 59.8 T2=11:14:40 Vs= 4.91 + +21 15:10:16 15:10:19 +Rsk= 15.3 Rkk= 12.6 + +22 16:05:05 16:20:35 +P1= 48.8 T1=16:15:35 P2= 63.3 T2=16:20:35 Vs= 2.90 + +20 17:43:46 17:43:55 +Riz_sol= 4931.1 + +21 17:44:24 17:44:27 +Rsk= 12.4 Rkk= 12.5 + +22 18:24:22 18:39:53 +P1= 43.5 T1=18:34:53 P2= 56.5 T2=18:39:53 Vs= 2.60 + +23 18:41:25 18:41:30 + + +24 18:41:45 18:42:23 + + +30 18:42:56 18:43:21 +Vst= 28.4 + +31 18:43:27 18:44:03 +Rom_sol= 15.3 + +41 18:45:00 18:45:05 +Ukz= 2.23 + +32 18:45:12 18:45:47 +Imax=11.3 Umax=50.0 T= 9.0 + +33 18:45:51 18:46:15 +Imin=16.2 Umin=25.0 T= 0.5 + +34 18:46:18 18:46:41 +V=300.3 T= 9.5 + +35 18:46:45 18:47:56 +Q= 54.1 T= 9.5 + +36 18:47:59 18:48:38 +P1=0.29 T= 3.0 + +37 18:48:41 18:49:13 +T= 1.0 + +38 18:49:17 18:49:23 +t= 52.5 T= 0.8 + +39 18:49:26 18:49:42 +tcam= 54.5 Tcam= 0.8 tfl= 53.2 Tfl= 0.8 + +40 18:49:46 18:49:53 +t= 55.8 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.353 new file mode 100644 index 0000000..c89f0a0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.353 @@ -0,0 +1,21 @@ +25 00:43:09 1594064589 +9 00:47:38 1594064858 +10 01:18:41 1594066721 +11 04:15:03 1594077303 +12 04:20:04 1594077604 +13 08:41:26 1594093286 +0 08:41:26 1594093286 +14 10:23:43 1594099423 +15 11:22:58 1594102978 +16 11:39:55 1594103995 +1 12:30:18 1594107018 +2 15:04:14 1594116254 +5 16:22:32 1594120952 +6 16:34:13 1594121653 +7 17:15:29 1594124129 +8 17:38:45 1594125525 +25 18:42:53 1594129373 +9 18:50:21 1594129821 +10 19:13:19 1594131199 +11 22:21:20 1594142480 +12 22:27:13 1594142833 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.354 new file mode 100644 index 0000000..85fff36 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.355 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.355 new file mode 100644 index 0000000..c29897b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.355 @@ -0,0 +1,3 @@ +107 00:19:44 1594063184 +107 00:19:49 1594063189 +29 00:36:08 1594064168 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.356 new file mode 100644 index 0000000..4229f36 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.356 @@ -0,0 +1,124 @@ +[31] +oper = 25 +begin = 07.07.2020 00:43:09 +norma = 30 +real = 4 + +[32] +oper = 9 +begin = 07.07.2020 00:47:38 +norma = 0 +real = 31 + +[33] +oper = 10 +begin = 07.07.2020 01:18:41 +norma = 0 +real = 176 + +[34] +oper = 11 +begin = 07.07.2020 04:15:03 +norma = 0 +real = 5 + +[35] +oper = 12 +begin = 07.07.2020 04:20:04 +norma = 105 +real = 261 + +[36] +oper = 13 +begin = 07.07.2020 08:41:26 +norma = 45 +real = 102 + +[37] +oper = 14 +begin = 07.07.2020 10:23:43 +norma = 40 +vac_time = 7 +real = 59 + +[38] +oper = 15 +begin = 07.07.2020 11:22:58 +norma = 30 +real = 16 + +[39] +oper = 16 +begin = 07.07.2020 11:39:55 +norma = 40 +real = 50 + +[40] +oper = 1 +begin = 07.07.2020 12:30:18 +norma = 85 +real = 153 + +[41] +oper = 2 +begin = 07.07.2020 15:04:14 +norma = 110 +vac_time = 8 +vac_avg10 = 7.5 +real = 78 + +[42] +oper = 5 +begin = 07.07.2020 16:22:32 +norma = 25 +real = 11 + +[43] +oper = 6 +begin = 07.07.2020 16:34:13 +norma = 35 +real = 41 + +[44] +oper = 7 +begin = 07.07.2020 17:15:29 +norma = 30 +real = 23 + +[45] +oper = 8 +begin = 07.07.2020 17:38:45 +norma = 40 +vac_time = 6 +real = 64 + +[46] +oper = 25 +begin = 07.07.2020 18:42:53 +norma = 30 +real = 7 + +[47] +oper = 9 +begin = 07.07.2020 18:50:21 +norma = 0 +real = 22 + +[48] +oper = 10 +begin = 07.07.2020 19:13:19 +norma = 0 +real = 188 + +[49] +oper = 11 +begin = 07.07.2020 22:21:20 +norma = 0 +real = 5 + +[50] +oper = 12 +begin = 07.07.2020 22:27:13 +norma = 105 +real = 172 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.357 new file mode 100644 index 0000000..fdd98a4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.357 @@ -0,0 +1,35 @@ +00:35:36 1594064136 祭 ॣ '-2'(A) +00:36:07 1594064167 ⪫祭 ॣ '-2'(A) +00:42:11 1594064531 祭 ॣ '-2'(A) +00:42:47 1594064567 ⪫祭 ॣ '-2'(A) +01:18:16 1594066696 祭 ॣ '-2' +01:18:40 1594066720 祭 ⠭ ॣ +04:20:08 1594077608 ⪫祭 ॣ '-2'(A) +04:20:38 1594077638 祭 ० ᪠ +04:20:38 1594077638 祭 ० ᪠ +04:20:38 1594077638 祭 ० ᪠ +04:20:38 1594077638 祭 ० ᪠ +04:20:55 1594077655 祭 ० ᪠ +04:20:55 1594077655 祭 ० ᪠ +04:20:56 1594077656 祭 ० ᪠ +04:20:56 1594077656 祭 ० ᪠ +04:24:32 1594077872 ⪫祭 ० ᪠ (A) +11:22:11 1594102931 祭 ० ࠧ +11:22:15 1594102935 ⪫祭 ० ࠧ +11:22:15 1594102935 ⪫祭 ० ࠧ +11:22:27 1594102947 祭 ० ࠧ +11:22:30 1594102950 祭 ० ' ⮪ 㣨' +11:23:47 1594103027 祭 ॣ '-2'(A) +11:39:57 1594103997 ⪫祭 ० ' ⮪ 㣨' +11:39:59 1594103999 ⪫祭 ॣ '-2'(A) +11:41:54 1594104114 祭 ० ᪠ +11:45:28 1594104328 ⪫祭 ० ᪠ (A) +16:35:41 1594121741 祭 ० ᪠ +16:38:41 1594121921 ⪫祭 ० ᪠ (A) +18:41:48 1594129308 祭 ॣ '-2'(A) +18:42:23 1594129343 ⪫祭 ॣ '-2'(A) +19:13:18 1594131198 祭 ॣ '-2' +19:13:19 1594131199 祭 ⠭ ॣ +22:27:17 1594142837 ⪫祭 ॣ '-2'(A) +22:28:16 1594142896 祭 ० ᪠ +22:31:18 1594143078 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.359 new file mode 100644 index 0000000..b5b2e40 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.360 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.360 new file mode 100644 index 0000000..69ed610 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.360 @@ -0,0 +1 @@ +18:39:08 1594129148 1 10790 2 BT 18, 20, 22, 23, 25 3 25 4 1 7 670 8 4280 9 4080 10 560 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.361 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.361 new file mode 100644 index 0000000..f42db18 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.361 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.362 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.362 new file mode 100644 index 0000000..8340f1b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.362 @@ -0,0 +1,6 @@ +21 18:31:40 18:31:43 +Rsk= 13.2 Rkk= 9.6 + +21 20:24:33 20:24:36 +Rsk= 13.6 Rkk= 10.2 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.363 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.363 new file mode 100644 index 0000000..54068cb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.363 @@ -0,0 +1 @@ +2 11:46:32 1594104392 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.364 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.364 new file mode 100644 index 0000000..7e996d8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.364 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.365 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.365 new file mode 100644 index 0000000..36518a5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.365 @@ -0,0 +1 @@ +107 20:23:55 1594135435 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.366 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.366 new file mode 100644 index 0000000..5516124 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.366 @@ -0,0 +1,6 @@ +[82] +oper = 2 +begin = 07.07.2020 11:46:32 +norma = 110 +real = 1552 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.367 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.367 new file mode 100644 index 0000000..e19fea6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.367 @@ -0,0 +1,27 @@ +08:42:08 1594093328 祭 ॣ '-2'(A) +08:42:09 1594093329 ⪫祭 ॣ '-2'(A) +11:25:11 1594103111 : 㦥 +11:47:01 1594104421 : 㦥 +11:52:55 1594104775 : 祭 ० '孮' +11:53:02 1594104782 : 祭 筮 ० +11:53:04 1594104784 : ⪫祭 筮 ० +11:53:05 1594104785 : 祭 筮 ० +11:59:59 1594105199 ' ' +12:00:00 1594105200 祭 +12:06:28 1594105588 : ⪫祭 筮 ० +12:06:31 1594105591 : 祭 筮 ० +12:07:06 1594105626 : ⪫祭 筮 ० +12:07:07 1594105627 : 祭 筮 ० +12:08:24 1594105704 '⪫ ' +12:08:24 1594105704 ⪫祭 +12:08:50 1594105730 : ⪫祭 筮 ० +12:09:02 1594105742 : ⪫祭 ० '孮' +14:43:13 1594114993 : 祭 ० '孮' +14:43:17 1594114997 : 祭 筮 ० +14:43:18 1594114998 祭 +14:45:14 1594115114 ⪫祭 +14:45:29 1594115129 : ⪫祭 筮 ० +14:45:31 1594115131 : ⪫祭 ० '孮' +18:39:11 1594129151 : +18:52:56 1594129976 祭 ॣ '-2'(A) +18:52:56 1594129976 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.370 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.370 new file mode 100644 index 0000000..16e0ef7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.370 @@ -0,0 +1,6 @@ +06:05:25 1594083925 3 14 +07:06:08 1594087568 0 A--32-067-2014 ॢ 0 +08:40:26 1594093226 1 06585 3 25 9 4910 +12:36:19 1594107379 1 06585 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 4740 9 4910 10 560 11 12 321730 +13:05:58 1594109158 0 A--32-106-2018 ॢ 2 +23:04:35 1594145075 1 06586 9 4180 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.371 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.371 new file mode 100644 index 0000000..dcdcbaf Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.371 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.372 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.372 new file mode 100644 index 0000000..5462068 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.372 @@ -0,0 +1,72 @@ +21 06:05:06 06:05:09 +Rsk= 13.5 Rkk= 8.9 + +22 06:30:46 06:40:51 +P1= 47.5 T1=06:35:51 P2= 71.8 T2=06:40:51 Vs= 4.86 + +21 08:40:43 08:40:46 +Rsk= 14.0 Rkk= 9.4 + +22 09:24:05 09:39:10 +P1= 48.6 T1=09:34:10 P2= 59.5 T2=09:39:10 Vs= 2.17 + +20 10:50:45 10:50:53 +Riz_sol= 934.4 + +21 10:51:02 10:51:05 +Rsk= 13.9 Rkk= 9.3 + +22 11:44:20 11:54:25 +P1= 22.6 T1=11:49:25 P2= 37.1 T2=11:54:25 Vs= 2.90 + +22 12:15:31 12:25:36 +P1= 18.8 T1=12:20:36 P2= 28.4 T2=12:25:36 Vs= 1.93 + +23 12:25:58 12:26:04 + + +24 12:26:20 12:26:58 + + +30 12:27:57 12:28:37 +Vst= 28.7 + +31 12:28:43 12:29:18 +Rom_sol= 17.5 + +41 12:30:39 12:30:44 +Ukz= 2.22 + +32 12:30:50 12:31:39 +Imax=10.9 Umax=50.0 T= 9.0 + +33 12:31:45 12:32:04 +Imin=15.9 Umin=24.9 T= 0.5 + +34 12:32:08 12:32:31 +V=300.3 T= 9.4 + +35 12:32:34 12:33:34 +Q= 54.9 T= 9.4 + +36 12:33:40 12:34:16 +P1=0.29 T= 2.9 + +37 12:34:20 12:34:51 +T= 0.9 + +38 12:34:55 12:35:02 +t= 52.1 T= 0.5 + +39 12:35:06 12:35:21 +tcam= 53.4 Tcam= 0.5 tfl= 57.7 Tfl= 0.5 + +40 12:35:25 12:35:31 +t= 54.6 T= 0.5 + +21 23:04:12 23:04:16 +Rsk= 13.4 Rkk= 8.9 + +22 23:43:30 23:58:35 +P1= 53.7 T1=23:53:35 P2= 67.8 T2=23:58:35 Vs= 2.82 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.373 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.373 new file mode 100644 index 0000000..93641d8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.373 @@ -0,0 +1,19 @@ +12 02:05:23 1594069523 +13 05:07:42 1594080462 +0 05:07:42 1594080462 +14 06:02:18 1594083738 +15 06:45:46 1594086346 +16 07:09:05 1594087745 +1 07:49:16 1594090156 +2 08:37:40 1594093060 +5 09:41:36 1594096896 +6 09:50:43 1594097443 +7 10:24:35 1594099475 +8 10:47:32 1594100852 +25 12:27:54 1594106874 +9 12:36:19 1594107379 +10 13:05:59 1594109159 +12 17:12:25 1594123945 +13 20:12:13 1594134733 +0 20:12:13 1594134733 +2 22:56:06 1594144566 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.374 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.374 new file mode 100644 index 0000000..0c2cf9e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.374 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.376 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.376 new file mode 100644 index 0000000..74b507a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.376 @@ -0,0 +1,106 @@ +[54] +oper = 12 +begin = 07.07.2020 02:05:23 +norma = 105 +real = 182 + +[55] +oper = 13 +begin = 07.07.2020 05:07:42 +norma = 45 +real = 54 + +[56] +oper = 14 +begin = 07.07.2020 06:02:18 +norma = 40 +vac_time = 8 +real = 43 + +[57] +oper = 15 +begin = 07.07.2020 06:45:46 +norma = 30 +real = 23 + +[58] +oper = 16 +begin = 07.07.2020 07:09:05 +norma = 40 +real = 40 + +[59] +oper = 1 +begin = 07.07.2020 07:49:16 +norma = 85 +real = 48 + +[60] +oper = 2 +begin = 07.07.2020 08:37:40 +norma = 110 +vac_time = 9 +real = 63 + +[61] +oper = 5 +begin = 07.07.2020 09:41:36 +norma = 25 +real = 9 + +[62] +oper = 6 +begin = 07.07.2020 09:50:43 +norma = 35 +real = 33 + +[63] +oper = 7 +begin = 07.07.2020 10:24:35 +norma = 30 +real = 22 + +[64] +oper = 8 +begin = 07.07.2020 10:47:32 +norma = 40 +vac_time = 9 +real = 100 + +[65] +oper = 25 +begin = 07.07.2020 12:27:54 +norma = 30 +real = 8 + +[66] +oper = 9 +begin = 07.07.2020 12:36:19 +norma = 0 +real = 29 + +[67] +oper = 10 +begin = 07.07.2020 13:05:59 +norma = 0 +real = 246 + +[68] +oper = 12 +begin = 07.07.2020 17:12:25 +norma = 105 +real = 179 + +[69] +oper = 13 +begin = 07.07.2020 20:12:13 +norma = 45 +real = 163 + +[70] +oper = 2 +begin = 07.07.2020 22:56:06 +norma = 110 +vac_time = 10 +real = 65 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.377 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.377 new file mode 100644 index 0000000..fe93a69 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.377 @@ -0,0 +1,36 @@ +01:57:02 1594069022 祭 ० +01:57:03 1594069023 ⪫祭 ॣ '-2'(A) +01:57:04 1594069024 祭 ॣ '-2'(A) +02:01:45 1594069305 ⪫祭 ० ' ⮪ 㣨' +02:05:26 1594069526 ⪫祭 ॣ '-2'(A) +02:05:53 1594069553 祭 ० ᪠ +02:08:36 1594069716 ⪫祭 ० ᪠ (A) +03:07:02 1594073222 ⪫祭 ० (A) +06:45:51 1594086351 祭 ० ࠧ +06:45:54 1594086354 祭 ० ' ⮪ 㣨' +06:45:55 1594086355 祭 ॣ '-2'(A) +07:06:08 1594087568 ⪫祭 ० ࠧ (A) +07:09:06 1594087746 ⪫祭 ० ' ⮪ 㣨' +07:09:08 1594087748 ⪫祭 ॣ '-2'(A) +07:09:46 1594087786 祭 ० ᪠ +07:12:00 1594087920 ⪫祭 ० ᪠ (A) +09:50:53 1594097453 祭 ० ᪠ +09:50:53 1594097453 祭 ० ᪠ +09:53:33 1594097613 ⪫祭 ० ᪠ (A) +12:26:24 1594106784 祭 ॣ '-2'(A) +12:26:58 1594106818 ⪫祭 ॣ '-2'(A) +12:35:41 1594107341 祭 ० ࠧ +12:35:43 1594107343 祭 ० ' ⮪ 㣨' +12:37:59 1594107479 祭 ॣ '-2'(A) +13:05:58 1594109158 ⪫祭 ० ࠧ (A) +13:05:59 1594109159 祭 ⠭ ॣ +17:03:04 1594123384 祭 ० +17:03:05 1594123385 ⪫祭 ॣ '-2'(A) +17:03:06 1594123386 祭 ॣ '-2'(A) +17:06:12 1594123572 ⪫祭 ० ' ⮪ 㣨' +17:12:28 1594123948 ⪫祭 ॣ '-2'(A) +17:13:24 1594124004 祭 ० ᪠ +17:13:24 1594124004 祭 ० ᪠ +17:13:24 1594124004 祭 ० ᪠ +17:15:59 1594124159 ⪫祭 ० ᪠ (A) +18:13:04 1594127584 ⪫祭 ० (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.379 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.379 new file mode 100644 index 0000000..e65c384 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.379 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.390 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.390 new file mode 100644 index 0000000..e57d964 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.390 @@ -0,0 +1,7 @@ +01:04:25 1594065865 1 09425 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 5050 9 4740 10 560 11 12 1727 +01:34:06 1594067646 0 A--32-106-2018 ॢ 2 +10:44:37 1594100677 3 14 +13:57:13 1594112233 1 09426 3 25 8 4710 9 4590 +17:36:11 1594125371 1 09426 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 4710 9 4590 10 560 11 12 1727 +19:47:33 1594133253 1 09427 +21:59:45 1594141185 1 09427 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 4710 9 4590 10 560 11 12 1727 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.391 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.391 new file mode 100644 index 0000000..919d0a6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.391 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.392 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.392 new file mode 100644 index 0000000..5fcebd9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.392 @@ -0,0 +1,168 @@ +20 00:15:24 00:15:35 +Riz_sol= 18.5 + +21 00:16:05 00:16:13 +Rsk= 20.5 Rkk= 15.2 + +22 00:40:11 00:55:19 +P1= 74.3 T1=00:50:19 P2= 86.1 T2=00:55:19 Vs= 2.35 + +23 00:55:34 00:55:40 + + +24 00:55:45 00:56:23 + + +30 00:56:35 00:57:12 +Vst= 27.3 + +31 00:57:18 00:57:56 +Rom_sol= 17.8 + +41 00:58:31 00:58:36 +Ukz= 0.89 + +32 00:58:39 00:59:46 +Imax=11.1 Umax=50.0 T= 9.4 + +33 00:59:49 01:00:19 +Imin=16.2 Umin=25.0 T= 2.3 + +34 01:00:23 01:00:50 +V=301.4 T= 9.6 + +35 01:00:53 01:01:46 +Q= 54.2 T= 9.0 + +36 01:01:49 01:02:26 +P1=0.26 T= 3.0 + +37 01:02:32 01:02:59 +T= 0.7 + +38 01:03:02 01:03:07 +t= 51.5 T= 0.5 + +39 01:03:10 01:03:14 +t= 51.6 T= 0.5 + +40 01:03:17 01:03:22 +t= 51.6 T= 0.7 + +21 10:44:57 10:45:05 +Rsk= 20.0 Rkk= 14.5 + +22 11:21:00 11:31:08 +P1= 60.2 T1=11:26:08 P2= 72.3 T2=11:31:08 Vs= 2.42 + +21 13:58:05 13:58:12 +Rsk= 20.1 Rkk= 14.6 + +22 14:54:58 15:05:06 +P1= 58.5 T1=15:00:06 P2= 70.9 T2=15:05:06 Vs= 2.48 + +20 16:17:08 16:17:19 +Riz_sol= 27.8 + +21 16:17:36 16:17:43 +Rsk= 20.0 Rkk= 14.5 + +22 17:10:19 17:25:27 +P1= 81.5 T1=17:20:27 P2= 95.6 T2=17:25:27 Vs= 2.82 + +23 17:26:31 17:26:38 + + +24 17:27:00 17:27:37 + + +30 17:27:51 17:28:29 +Vst= 27.2 + +31 17:28:37 17:29:15 +Rom_sol= 17.9 + +41 17:29:40 17:29:45 +Ukz= 1.38 + +32 17:29:50 17:30:58 +Imax=11.1 Umax=50.0 T= 9.4 + +33 17:31:03 17:31:35 +Imin=16.3 Umin=25.0 T= 2.3 + +34 17:31:40 17:32:08 +V=301.3 T= 9.5 + +35 17:32:13 17:33:35 +Q= 54.6 T= 9.3 + +36 17:33:43 17:34:15 +P1=0.27 T= 3.0 + +37 17:34:20 17:34:47 +T= 0.7 + +38 17:34:52 17:34:58 +t= 51.5 T= 0.7 + +39 17:35:02 17:35:08 +t= 51.6 T= 0.5 + +40 17:35:11 17:35:20 +t= 51.6 T= 0.7 + +20 19:47:52 19:48:02 +Riz_sol= 26.0 + +21 19:48:11 19:48:18 +Rsk= 20.3 Rkk= 14.9 + +22 20:24:48 20:39:55 +P1= 77.7 T1=20:34:55 P2= 90.2 T2=20:39:55 Vs= 2.49 + +22 21:35:01 21:50:09 +P1= 78.2 T1=21:45:09 P2= 89.1 T2=21:50:09 Vs= 2.19 + +23 21:50:19 21:50:25 + + +24 21:50:40 21:51:17 + + +30 21:51:38 21:52:18 +Vst= 27.3 + +31 21:52:25 21:53:03 +Rom_sol= 17.9 + +41 21:53:33 21:53:38 +Ukz= 1.71 + +32 21:53:44 21:54:52 +Imax=11.1 Umax=50.0 T= 9.2 + +33 21:54:57 21:55:30 +Imin=16.2 Umin=25.1 T= 2.3 + +34 21:55:34 21:56:01 +V=301.4 T= 9.5 + +35 21:56:03 21:57:23 +Q= 54.6 T= 9.2 + +36 21:57:30 21:58:03 +P1=0.27 T= 3.0 + +37 21:58:09 21:58:36 +T= 0.7 + +38 21:58:44 21:58:50 +t= 51.5 T= 0.7 + +39 21:58:54 21:58:59 +t= 51.6 T= 0.7 + +40 21:59:04 21:59:10 +t= 51.6 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.393 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.393 new file mode 100644 index 0000000..be1cafa --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.393 @@ -0,0 +1,25 @@ +8 00:13:02 1594062782 +25 00:56:33 1594065393 +9 01:04:25 1594065865 +10 01:34:07 1594067647 +12 05:59:34 1594083574 +13 09:04:38 1594094678 +0 09:04:38 1594094678 +14 10:41:59 1594100519 +15 11:35:24 1594103724 +16 11:57:00 1594105020 +1 12:37:21 1594107441 +2 13:52:28 1594111948 +5 15:06:12 1594116372 +6 15:20:23 1594117223 +7 15:54:32 1594119272 +8 16:12:51 1594120371 +25 17:27:47 1594124867 +9 17:36:11 1594125371 +8 17:53:20 1594126400 +13 18:56:05 1594130165 +8 19:30:29 1594132229 +00 19:49:56 1594133396 +25 21:51:34 1594140694 +9 21:59:45 1594141185 +10 22:22:17 1594142537 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.394 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.394 new file mode 100644 index 0000000..f963370 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.394 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.396 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.396 new file mode 100644 index 0000000..91cba81 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.396 @@ -0,0 +1,144 @@ +[11] +oper = 8 +begin = 07.07.2020 00:13:02 +norma = 40 +vac_time = 8 +real = 43 + +[12] +oper = 25 +begin = 07.07.2020 00:56:33 +norma = 30 +real = 7 + +[13] +oper = 9 +begin = 07.07.2020 01:04:25 +norma = 0 +real = 29 + +[14] +oper = 10 +begin = 07.07.2020 01:34:07 +norma = 0 +real = 265 + +[15] +oper = 12 +begin = 07.07.2020 05:59:34 +norma = 105 +real = 185 + +[16] +oper = 13 +begin = 07.07.2020 09:04:38 +norma = 45 +real = 97 + +[17] +oper = 14 +begin = 07.07.2020 10:41:59 +norma = 40 +vac_time = 9 +real = 53 + +[18] +oper = 15 +begin = 07.07.2020 11:35:24 +norma = 30 +real = 21 + +[19] +oper = 16 +begin = 07.07.2020 11:57:00 +norma = 40 +real = 40 + +[20] +oper = 1 +begin = 07.07.2020 12:37:21 +norma = 85 +real = 75 + +[21] +oper = 2 +begin = 07.07.2020 13:52:28 +norma = 110 +vac_time = 9 +real = 73 + +[22] +oper = 5 +begin = 07.07.2020 15:06:12 +norma = 25 +real = 14 + +[23] +oper = 6 +begin = 07.07.2020 15:20:23 +norma = 35 +real = 34 + +[24] +oper = 7 +begin = 07.07.2020 15:54:32 +norma = 30 +real = 18 + +[25] +oper = 8 +begin = 07.07.2020 16:12:51 +norma = 40 +vac_time = 10 +real = 74 + +[26] +oper = 25 +begin = 07.07.2020 17:27:47 +norma = 30 +real = 8 + +[27] +oper = 9 +begin = 07.07.2020 17:36:11 +norma = 0 +real = 17 + +[28] +oper = 8 +begin = 07.07.2020 17:53:20 +norma = 40 +real = 62 + +[29] +oper = 13 +begin = 07.07.2020 18:56:05 +norma = 45 +real = 34 + +[30] +oper = 8 +begin = 07.07.2020 19:30:29 +norma = 40 +vac_time = 18 +vac_avg10 = 9.5 +real = 141 + +[31] +oper = 25 +begin = 07.07.2020 21:51:34 +norma = 30 +real = 8 + +[32] +oper = 9 +begin = 07.07.2020 21:59:45 +norma = 0 +real = 22 + +[33] +oper = 10 +begin = 07.07.2020 22:22:17 +norma = 0 +real = 381 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.397 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.397 new file mode 100644 index 0000000..edb19e4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.397 @@ -0,0 +1,45 @@ +00:55:48 1594065348 祭 ॣ '-2'(A) +00:56:23 1594065383 ⪫祭 ॣ '-2'(A) +01:04:05 1594065845 祭 ० ࠧ +01:04:06 1594065846 祭 ० ' ⮪ 㣨' +01:06:07 1594065967 祭 ॣ '-2'(A) +01:34:06 1594067646 ⪫祭 ० ࠧ (A) +01:34:07 1594067647 祭 ⠭ ॣ +05:37:51 1594082271 祭 ० +05:37:52 1594082272 ⪫祭 ॣ '-2'(A) +05:37:53 1594082273 祭 ॣ '-2'(A) +05:59:35 1594083575 ⪫祭 ० ' ⮪ 㣨' +05:59:37 1594083577 ⪫祭 ॣ '-2'(A) +06:00:05 1594083605 祭 ० ᪠ +06:00:05 1594083605 祭 ० ᪠ +06:02:51 1594083771 ⪫祭 ० ᪠ (A) +06:47:51 1594086471 ⪫祭 ० (A) +11:34:35 1594103675 祭 ० ࠧ +11:34:38 1594103678 祭 ० ' ⮪ 㣨' +11:36:17 1594103777 祭 ॣ '-2'(A) +11:55:15 1594104915 ⪫祭 ० ' ⮪ 㣨' +11:57:05 1594105025 ⪫祭 ॣ '-2'(A) +11:57:15 1594105035 祭 ० ᪠ +11:57:15 1594105035 祭 ० ᪠ +12:00:00 1594105200 ⪫祭 ० ᪠ (A) +15:20:31 1594117231 祭 ० ᪠ +15:20:33 1594117233 祭 ० ᪠ +15:20:33 1594117233 祭 ० ᪠ +15:20:33 1594117233 祭 ० ᪠ +15:20:33 1594117233 祭 ० ᪠ +15:20:33 1594117233 祭 ० ᪠ +15:20:34 1594117234 祭 ० ᪠ +15:23:17 1594117397 ⪫祭 ० ᪠ (A) +17:27:03 1594124823 祭 ॣ '-2'(A) +17:27:38 1594124858 ⪫祭 ॣ '-2'(A) +17:35:34 1594125334 祭 ० ࠧ +17:35:36 1594125336 祭 ० ' ⮪ 㣨' +17:37:38 1594125458 祭 ॣ '-2'(A) +17:49:39 1594126179 ⪫祭 ० ' ⮪ 㣨' +17:52:23 1594126343 ⪫祭 ॣ '-2'(A) +17:52:56 1594126376 祭 ० ᪠ +17:55:42 1594126542 ⪫祭 ० ᪠ (A) +21:50:43 1594140643 祭 ॣ '-2'(A) +21:51:18 1594140678 ⪫祭 ॣ '-2'(A) +22:22:14 1594142534 祭 ॣ '-2' +22:22:16 1594142536 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.399 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.399 new file mode 100644 index 0000000..c1ab282 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.399 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.410 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.410 new file mode 100644 index 0000000..2a2338b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.410 @@ -0,0 +1,7 @@ +02:16:14 1594070174 1 11450 9 4760 +02:24:56 1594070696 1 11450 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4660 9 4760 10 690 11 12 320933 +03:07:32 1594073252 0 A--32-031-2016 ॢ 5 +13:49:36 1594111776 1 11451 2 p. cao M1,M2,M3,M4 3 37 9 4890 10 670 +16:17:42 1594120662 12 320839 +17:47:25 1594126045 1 11451 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 770 8 4660 9 4890 10 670 11 12 320839 +18:20:56 1594128056 0 A--32-006-2018 ॢ 4 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.411 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.411 new file mode 100644 index 0000000..fc811cc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.411 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.412 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.412 new file mode 100644 index 0000000..27dd666 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.412 @@ -0,0 +1,105 @@ +20 01:26:59 01:27:07 +Riz_sol= 4755.9 + +21 01:27:24 01:27:27 +Rsk= 9.2 Rkk= 6.3 + +22 02:00:47 02:15:54 +P1= 57.0 T1=02:10:54 P2= 69.2 T2=02:15:54 Vs= 2.44 + +23 02:16:25 02:16:30 + + +24 02:16:35 02:17:10 + + +30 02:17:27 02:17:54 +Vst= 31.5 + +31 02:17:57 02:18:30 +Rom_sol= 9.7 + +32 02:19:15 02:19:51 +Imax=11.0 Umax=50.0 T= 9.0 + +33 02:20:03 02:20:21 +Imin=16.0 Umin=25.0 T= 0.5 + +34 02:20:24 02:20:47 +V=300.4 T= 9.4 + +35 02:20:49 02:22:18 +Q= 53.4 T=12.4 + +36 02:22:27 02:23:01 +P1=0.28 T= 2.9 + +37 02:23:33 02:23:56 +T= 1.0 + +38 02:23:59 02:24:06 +t= 51.9 T= 0.6 + +39 02:24:08 02:24:23 +tcam= 51.7 Tcam= 0.6 tfl= 56.1 Tfl= 0.6 + +40 02:24:26 02:24:32 +t= 51.8 T= 0.5 + +21 13:40:40 13:40:43 +Rsk= 8.7 Rkk= 5.8 + +22 14:24:58 14:35:06 +P1= 26.5 T1=14:30:06 P2= 40.7 T2=14:35:06 Vs= 2.85 + +20 16:16:48 16:16:57 +Riz_sol= 4756.3 + +21 16:17:05 16:17:08 +Rsk= 10.9 Rkk= 8.0 + +22 17:13:16 17:23:23 +P1= 20.9 T1=17:18:23 P2= 31.2 T2=17:23:23 Vs= 2.06 + +23 17:24:43 17:24:48 + + +24 17:24:59 17:25:36 + + +30 17:26:11 17:26:38 +Vst= 32.0 + +31 17:26:44 17:27:18 +Rom_sol= 9.9 + +41 17:28:41 17:28:46 +Ukz= 0.85 + +32 17:28:46 17:29:22 +Imax=27.0 Umax=55.0 T= 9.0 + +33 17:29:28 17:29:48 +Imin=16.0 Umin=24.9 T= 0.5 + +34 17:29:51 17:30:14 +V=300.5 T= 9.4 + +35 17:30:19 17:31:38 +Q= 50.1 T= 9.4 + +36 17:31:42 17:32:20 +P1=0.29 T= 3.0 + +37 17:32:47 17:33:10 +T= 1.0 + +38 17:33:15 17:33:22 +t= 51.9 T= 0.6 + +39 17:33:27 17:33:42 +tcam= 54.2 Tcam= 0.5 tfl= 56.0 Tfl= 0.6 + +40 17:33:47 17:33:53 +t= 51.9 T= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.413 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.413 new file mode 100644 index 0000000..8ab902e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.413 @@ -0,0 +1,20 @@ +13 00:05:26 1594062326 +0 00:05:26 1594062326 +8 01:21:32 1594066892 +25 02:17:22 1594070242 +9 02:24:56 1594070696 +10 03:07:33 1594073253 +11 07:11:14 1594087874 +12 09:58:15 1594097895 +13 11:51:10 1594104670 +0 11:51:10 1594104670 +2 13:36:06 1594110966 +5 14:42:59 1594114979 +6 14:55:14 1594115714 +7 15:58:12 1594119492 +8 16:12:13 1594120333 +25 17:25:59 1594124759 +9 17:47:25 1594126045 +10 18:20:56 1594128056 +11 20:34:57 1594136097 +12 23:23:59 1594146239 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.414 new file mode 100644 index 0000000..a8e19bf Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.416 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.416 new file mode 100644 index 0000000..4ea19d0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.416 @@ -0,0 +1,112 @@ +[50] +oper = 13 +begin = 07.07.2020 00:05:26 +norma = 45 +real = 76 + +[51] +oper = 8 +begin = 07.07.2020 01:21:32 +norma = 40 +vac_time = 9 +real = 55 + +[52] +oper = 25 +begin = 07.07.2020 02:17:22 +norma = 30 +real = 7 + +[53] +oper = 9 +begin = 07.07.2020 02:24:56 +norma = 0 +real = 42 + +[54] +oper = 10 +begin = 07.07.2020 03:07:33 +norma = 0 +real = 243 + +[55] +oper = 11 +begin = 07.07.2020 07:11:14 +norma = 0 +real = 167 + +[56] +oper = 12 +begin = 07.07.2020 09:58:15 +norma = 105 +real = 112 + +[57] +oper = 13 +begin = 07.07.2020 11:51:10 +norma = 45 +real = 104 + +[58] +oper = 2 +begin = 07.07.2020 13:36:06 +norma = 110 +vac_time = 8 +real = 66 + +[59] +oper = 5 +begin = 07.07.2020 14:42:59 +norma = 25 +real = 12 + +[60] +oper = 6 +begin = 07.07.2020 14:55:14 +norma = 35 +real = 62 + +[61] +oper = 7 +begin = 07.07.2020 15:58:12 +norma = 30 +real = 14 + +[62] +oper = 8 +begin = 07.07.2020 16:12:13 +norma = 40 +vac_time = 8 +vac_avg10 = 9.2 +real = 73 + +[63] +oper = 25 +begin = 07.07.2020 17:25:59 +norma = 30 +real = 21 + +[64] +oper = 9 +begin = 07.07.2020 17:47:25 +norma = 0 +real = 33 + +[65] +oper = 10 +begin = 07.07.2020 18:20:56 +norma = 0 +real = 134 + +[66] +oper = 11 +begin = 07.07.2020 20:34:57 +norma = 0 +real = 169 + +[67] +oper = 12 +begin = 07.07.2020 23:23:59 +norma = 105 +real = 105 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.417 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.417 new file mode 100644 index 0000000..41df516 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.417 @@ -0,0 +1,53 @@ +02:16:34 1594070194 祭 ॣ '-2'(A) +02:17:09 1594070229 ⪫祭 ॣ '-2'(A) +02:24:36 1594070676 祭 ० ࠧ +02:24:37 1594070677 祭 ० ' ⮪ 㣨' +02:50:29 1594072229 祭 ॣ '-2'(A) +03:07:32 1594073252 ⪫祭 ० ࠧ (A) +03:07:33 1594073253 祭 ⠭ ॣ +07:11:14 1594087874 祭 ० +07:11:14 1594087874 ⪫祭 ॣ '-2'(A) +07:11:15 1594087875 祭 ॣ '-2'(A) +09:03:15 1594094595 ⪫祭 ॣ '-2'(A) +09:58:13 1594097893 ⪫祭 ० (A) +09:58:17 1594097897 ⪫祭 ० ' ⮪ 㣨' +09:59:01 1594097941 祭 ० ᪠ +09:59:01 1594097941 祭 ० ᪠ +10:01:14 1594098074 ⪫祭 ० ᪠ (A) +14:55:37 1594115737 祭 ० ᪠ +14:55:37 1594115737 祭 ० ᪠ +14:55:38 1594115738 祭 ० ᪠ +14:55:38 1594115738 祭 ० ᪠ +14:57:44 1594115864 ⪫祭 ० ᪠ (A) +17:24:59 1594124699 祭 ॣ '-2'(A) +17:25:34 1594124734 ⪫祭 ॣ '-2'(A) +17:47:06 1594126026 祭 ० ࠧ +17:47:09 1594126029 祭 ० ' ⮪ 㣨' +18:06:56 1594127216 祭 ॣ '-2'(A) +18:20:56 1594128056 ⪫祭 ० ࠧ (A) +18:20:56 1594128056 祭 ⠭ ॣ +20:34:56 1594136096 祭 ० +20:34:58 1594136098 ⪫祭 ॣ '-2'(A) +20:34:59 1594136099 祭 ॣ '-2'(A) +21:36:58 1594139818 ⪫祭 ॣ '-2'(A) +23:23:56 1594146236 ⪫祭 ० (A) +23:24:00 1594146240 ⪫祭 ० ' ⮪ 㣨' +23:24:32 1594146272 祭 ० ᪠ +23:24:33 1594146273 祭 ० ᪠ +23:24:33 1594146273 祭 ० ᪠ +23:24:58 1594146298 ⪫祭 ० ᪠ +23:24:59 1594146299 祭 ० ᪠ +23:24:59 1594146299 祭 ० ᪠ +23:24:59 1594146299 祭 ० ᪠ +23:25:10 1594146310 ⪫祭 ० ᪠ +23:25:11 1594146311 祭 ० ᪠ +23:25:12 1594146312 祭 ० ᪠ +23:25:19 1594146319 ⪫祭 ० ᪠ +23:25:23 1594146323 祭 ० ᪠ +23:25:29 1594146329 ⪫祭 ० ᪠ +23:25:31 1594146331 祭 ० ᪠ +23:25:31 1594146331 祭 ० ᪠ +23:25:31 1594146331 祭 ० ᪠ +23:25:37 1594146337 ⪫祭 ० ᪠ +23:25:38 1594146338 祭 ० ᪠ +23:25:43 1594146343 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.419 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.419 new file mode 100644 index 0000000..a1430cb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.419 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.421 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.421 new file mode 100644 index 0000000..d467bbe Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.421 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.422 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.422 new file mode 100644 index 0000000..c48bde6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.422 @@ -0,0 +1,12 @@ +21 07:55:08 07:55:11 +Rsk= 3.2 Rkk= 3.3 + +21 11:14:53 11:14:56 +Rsk= 3.3 Rkk= 3.5 + +21 11:15:00 11:15:03 +Rsk= 3.3 Rkk= 3.6 + +21 18:13:55 18:13:58 +Rsk= 3.4 Rkk= 3.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.424 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.424 new file mode 100644 index 0000000..a9b6517 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.424 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.440 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.440 new file mode 100644 index 0000000..cc6e26c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.440 @@ -0,0 +1,5 @@ +03:22:08 1594074128 1 09881 9 3570 12 1718 +06:54:07 1594086847 1 09881 2 OT-4 3 25 4 1 5 Ti 6 7 670 8 4750 9 3570 10 495 11 12 1718 +18:55:49 1594130149 1 09882 2 BT 18, 20, 22, 23, 25 9 4120 10 560 +22:55:13 1594144513 1 09882 2 BT 18, 20, 22, 23, 25 3 25 4 1 5 Ti 6 7 670 8 4750 9 4120 10 560 11 12 1718 +23:24:46 1594146286 0 A--32-106-2018 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.441 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.441 new file mode 100644 index 0000000..fad7a01 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.441 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.442 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.442 new file mode 100644 index 0000000..e473fd5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.442 @@ -0,0 +1,120 @@ +21 03:20:42 03:20:50 +Rsk= 17.5 Rkk= 14.1 + +22 04:02:58 04:18:31 +P1= 44.4 T1=04:13:31 P2= 58.3 T2=04:18:31 Vs= 2.78 + +20 05:38:10 05:38:20 +Riz_sol= 105.3 + +21 05:38:25 05:38:33 +Rsk= 17.1 Rkk= 13.9 + +22 06:04:56 06:20:29 +P1= 70.9 T1=06:15:28 P2= 91.7 T2=06:20:29 Vs= 4.16 + +22 06:30:15 06:45:48 +P1= 49.3 T1=06:40:48 P2= 63.5 T2=06:45:48 Vs= 2.83 + +23 06:46:33 06:46:39 + + +24 06:46:45 06:47:25 + + +30 06:47:37 06:48:24 +Vst= 30.1 + +31 06:48:26 06:49:07 +Rom_sol= 13.7 + +32 06:49:43 06:50:50 +Imax=11.4 Umax=49.9 T= 9.4 + +33 06:50:52 06:51:21 +Imin=16.6 Umin=25.0 T= 0.8 + +34 06:51:23 06:51:51 +V=301.5 T= 9.5 + +40 05:00:00 06:52:12 +t= 52.1 T= 0.7 + +39 06:52:28 06:52:35 +t= 51.7 T= 0.5 + +38 06:52:38 06:52:45 +t= 51.9 T= 0.5 + +37 06:52:48 06:53:14 +T= 0.7 + +36 06:53:17 06:53:49 +P1=0.29 T= 3.1 + +21 18:56:10 18:56:18 +Rsk= 17.7 Rkk= 14.3 + +22 20:09:38 20:25:12 +P1= 46.0 T1=20:20:12 P2= 58.6 T2=20:25:12 Vs= 2.53 + +20 21:31:13 21:31:23 +Riz_sol= 162.1 + +20 21:38:30 21:38:41 +Riz_sol= 159.6 + +21 21:38:52 21:39:00 +Rsk= 17.2 Rkk= 14.0 + +22 22:29:52 22:45:24 +P1= 44.0 T1=22:40:24 P2= 55.9 T2=22:45:24 Vs= 2.39 + +23 22:45:36 22:45:42 + + +24 22:45:47 22:46:24 + + +30 22:46:42 22:47:28 +Vst= 30.2 + +31 22:47:33 22:48:11 +Rom_sol= 13.7 + +41 22:48:33 22:48:39 +Ukz= 1.70 + +32 22:48:43 22:49:50 +Imax=11.4 Umax=49.9 T= 9.4 + +33 22:49:54 22:50:20 +Imin=16.6 Umin=25.0 T= 0.2 + +33 22:50:26 22:50:53 +Imin=16.6 Umin=25.2 T= 1.7 + +33 22:51:03 22:51:31 +Imin=16.6 Umin=25.1 T= 0.8 + +34 22:51:36 22:52:05 +V=301.5 T= 9.6 + +35 22:52:09 22:53:03 +Q= 54.8 T= 9.3 + +36 22:53:07 22:53:37 +P1=0.30 T= 3.0 + +37 22:53:42 22:54:10 +T= 0.7 + +38 22:54:14 22:54:20 +t= 51.9 T= 0.5 + +39 22:54:24 22:54:30 +t= 51.7 T= 0.5 + +40 22:54:35 22:54:41 +t= 52.1 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.443 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.443 new file mode 100644 index 0000000..d2028c6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.443 @@ -0,0 +1,23 @@ +13 01:57:21 1594069041 +0 01:57:22 1594069042 +2 03:17:34 1594073854 +5 04:28:55 1594078135 +6 04:39:10 1594078750 +7 05:15:34 1594080934 +8 05:35:55 1594082155 +25 06:47:33 1594086453 +9 06:54:07 1594086847 +10 07:16:31 1594088191 +12 10:36:50 1594100210 +13 13:42:39 1594111359 +0 13:42:39 1594111359 +2 18:51:36 1594129896 +5 20:26:27 1594135587 +6 20:36:33 1594136193 +7 21:05:29 1594137929 +2 21:23:59 1594139039 +7 21:37:16 1594139836 +8 21:38:13 1594139893 +25 22:46:38 1594143998 +9 22:55:13 1594144513 +10 23:24:46 1594146286 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.444 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.444 new file mode 100644 index 0000000..5adfd4e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.444 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.445 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.445 new file mode 100644 index 0000000..b8f82b4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.445 @@ -0,0 +1,2 @@ +56 22:50:20 1594144220 +55 22:50:53 1594144253 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.446 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.446 new file mode 100644 index 0000000..8f41f20 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.446 @@ -0,0 +1,130 @@ +[93] +oper = 13 +begin = 07.07.2020 01:57:21 +norma = 45 +real = 80 + +[94] +oper = 2 +begin = 07.07.2020 03:17:34 +norma = 110 +vac_time = 9 +real = 71 + +[95] +oper = 5 +begin = 07.07.2020 04:28:55 +norma = 25 +real = 10 + +[96] +oper = 6 +begin = 07.07.2020 04:39:10 +norma = 35 +real = 36 + +[97] +oper = 7 +begin = 07.07.2020 05:15:34 +norma = 30 +real = 20 + +[98] +oper = 8 +begin = 07.07.2020 05:35:55 +norma = 40 +vac_time = 8 +real = 71 + +[99] +oper = 25 +begin = 07.07.2020 06:47:33 +norma = 30 +real = 6 + +[00] +oper = 9 +begin = 07.07.2020 06:54:07 +norma = 0 +real = 22 + +[01] +oper = 10 +begin = 07.07.2020 07:16:31 +norma = 0 +real = 200 + +[02] +oper = 12 +begin = 07.07.2020 10:36:50 +norma = 180 +real = 185 + +[03] +oper = 13 +begin = 07.07.2020 13:42:39 +norma = 45 +real = 308 + +[04] +oper = 2 +begin = 07.07.2020 18:51:36 +norma = 110 +vac_time = 9 +real = 94 + +[05] +oper = 5 +begin = 07.07.2020 20:26:27 +norma = 25 +real = 10 + +[06] +oper = 6 +begin = 07.07.2020 20:36:33 +norma = 35 +real = 28 + +[07] +oper = 7 +begin = 07.07.2020 21:05:29 +norma = 30 +real = 18 + +[08] +oper = 2 +begin = 07.07.2020 21:23:59 +norma = 110 +real = 13 + +[09] +oper = 7 +begin = 07.07.2020 21:37:16 +norma = 30 +real = 0 + +[10] +oper = 8 +begin = 07.07.2020 21:38:13 +norma = 40 +vac_time = 23 +real = 68 + +[11] +oper = 25 +begin = 07.07.2020 22:46:38 +norma = 30 +real = 8 + +[12] +oper = 9 +begin = 07.07.2020 22:55:13 +norma = 0 +real = 29 + +[13] +oper = 10 +begin = 07.07.2020 23:24:46 +norma = 0 +real = 207 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.447 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.447 new file mode 100644 index 0000000..d1aba1c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.447 @@ -0,0 +1,25 @@ +04:39:28 1594078768 祭 ० ᪠ +04:39:28 1594078768 祭 ० ᪠ +04:39:29 1594078769 祭 ० ᪠ +04:39:33 1594078773 祭 ० ᪠ +04:39:34 1594078774 祭 ० ᪠ +04:39:34 1594078774 祭 ० ᪠ +04:43:19 1594078999 ⪫祭 ० ᪠ (A) +06:46:48 1594086408 祭 ॣ '-2'(A) +06:47:26 1594086446 ⪫祭 ॣ '-2'(A) +07:16:30 1594088190 祭 ॣ '-2' +07:16:31 1594088191 祭 ⠭ ॣ +10:36:54 1594100214 ⪫祭 ॣ '-2'(A) +10:37:06 1594100226 祭 ० ᪠ +10:37:06 1594100226 祭 ० ᪠ +10:40:17 1594100417 ⪫祭 ० ᪠ (A) +20:36:42 1594136202 祭 ० ᪠ +20:36:42 1594136202 祭 ० ᪠ +20:40:18 1594136418 ⪫祭 ० ᪠ (A) +22:45:48 1594143948 祭 ॣ '-2'(A) +22:46:25 1594143985 ⪫祭 ॣ '-2'(A) +22:54:52 1594144492 祭 ० ࠧ +22:54:55 1594144495 祭 ० ' ⮪ 㣨' +22:56:47 1594144607 祭 ॣ '-2'(A) +23:24:46 1594146286 ⪫祭 ० ࠧ (A) +23:24:46 1594146286 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.449 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.449 new file mode 100644 index 0000000..fa4f562 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.449 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.450 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.450 new file mode 100644 index 0000000..29340b5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.450 @@ -0,0 +1,5 @@ +11:20:09 1594102809 3 14 +15:21:29 1594117289 1 11458 3 25 9 5400 +16:38:48 1594121928 2 BT 18, 20, 22, 23, 25 3 37 11 12 321731 +22:28:00 1594142880 2 p. cao M1,M2,M3,M4 +23:01:01 1594144861 1 11458 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 870 8 3000 9 5400 10 770 11 12 321731 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.451 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.451 new file mode 100644 index 0000000..99c9af8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.451 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.452 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.452 new file mode 100644 index 0000000..3263543 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.452 @@ -0,0 +1,69 @@ +21 11:02:17 11:02:20 +Rsk= 16.0 Rkk= 12.5 + +21 11:20:28 11:20:31 +Rsk= 16.1 Rkk= 12.6 + +22 11:48:28 11:58:32 +P1= 10.2 T1=11:53:32 P2= 33.1 T2=11:58:32 Vs= 4.58 + +21 15:18:09 15:18:12 +Rsk= 16.3 Rkk= 12.8 + +22 15:50:29 16:05:34 +P1= 45.2 T1=16:00:34 P2= 62.1 T2=16:05:34 Vs= 3.39 + +22 16:20:01 16:35:06 +P1= 24.4 T1=16:30:06 P2= 34.7 T2=16:35:06 Vs= 2.06 + +20 18:37:55 18:38:04 +Riz_sol= 4854.1 + +21 18:38:11 18:38:14 +Rsk= 16.4 Rkk= 12.8 + +22 22:28:39 22:38:44 +P1= 9.9 T1=22:33:44 P2= 20.9 T2=22:38:44 Vs= 2.20 + +23 22:53:13 22:53:18 + + +24 22:53:31 22:54:10 + + +30 22:54:27 22:54:50 +Vst= 28.6 + +31 22:54:55 22:55:29 +Rom_sol= 14.3 + +32 22:55:59 22:56:35 +Imax=26.8 Umax=55.0 T= 9.0 + +33 22:56:38 22:57:01 +Imin=15.8 Umin=25.0 T= 0.5 + +34 22:57:03 22:57:26 +V=300.3 T= 9.4 + +35 22:57:29 22:58:27 +Q= 52.7 T= 9.4 + +35 22:57:29 22:58:27 +Q= 52.7 T= 9.4 + +36 22:58:31 22:59:01 +P1=0.29 T= 2.9 + +37 22:59:04 22:59:35 +T= 0.9 + +38 22:59:38 22:59:45 +t= 51.7 T= 0.5 + +39 22:59:48 23:00:03 +tcam= 52.5 Tcam= 0.5 tfl= 56.1 Tfl= 0.5 + +40 23:00:06 23:00:14 +t= 51.7 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.453 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.453 new file mode 100644 index 0000000..2c1a144 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.453 @@ -0,0 +1,17 @@ +11 04:47:45 1594079265 +12 08:18:49 1594091929 +13 10:29:19 1594099759 +0 10:29:19 1594099759 +13 11:17:14 1594102634 +14 11:19:26 1594102766 +15 11:59:47 1594105187 +16 12:32:10 1594107130 +1 13:17:53 1594109873 +2 15:14:54 1594116894 +5 16:40:18 1594122018 +6 16:51:36 1594122696 +7 17:31:06 1594125066 +8 18:32:13 1594128733 +25 22:54:23 1594144463 +9 23:01:01 1594144861 +10 23:34:20 1594146860 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.454 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.454 new file mode 100644 index 0000000..3a936e4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.454 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.455 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.455 new file mode 100644 index 0000000..adda5dd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.455 @@ -0,0 +1 @@ +109 19:37:37 1594132657 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.456 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.456 new file mode 100644 index 0000000..45df4d0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.456 @@ -0,0 +1,99 @@ +[51] +oper = 11 +begin = 07.07.2020 04:47:45 +norma = 0 +real = 211 + +[52] +oper = 12 +begin = 07.07.2020 08:18:49 +norma = 105 +real = 130 + +[53] +oper = 13 +begin = 07.07.2020 10:29:19 +norma = 45 +real = 47 + +[54] +oper = 13 +begin = 07.07.2020 11:17:14 +norma = 45 +real = 2 + +[55] +oper = 14 +begin = 07.07.2020 11:19:26 +norma = 40 +vac_time = 33 +real = 40 + +[56] +oper = 15 +begin = 07.07.2020 11:59:47 +norma = 30 +real = 32 + +[57] +oper = 16 +begin = 07.07.2020 12:32:10 +norma = 40 +real = 45 + +[58] +oper = 1 +begin = 07.07.2020 13:17:53 +norma = 85 +real = 117 + +[59] +oper = 2 +begin = 07.07.2020 15:14:54 +norma = 110 +vac_time = 9 +real = 85 + +[60] +oper = 5 +begin = 07.07.2020 16:40:18 +norma = 25 +real = 11 + +[61] +oper = 6 +begin = 07.07.2020 16:51:36 +norma = 35 +real = 39 + +[62] +oper = 7 +begin = 07.07.2020 17:31:06 +norma = 30 +real = 61 + +[63] +oper = 8 +begin = 07.07.2020 18:32:13 +norma = 40 +vac_time = 9 +real = 262 + +[64] +oper = 25 +begin = 07.07.2020 22:54:23 +norma = 30 +real = 6 + +[65] +oper = 9 +begin = 07.07.2020 23:01:01 +norma = 0 +real = 33 + +[66] +oper = 10 +begin = 07.07.2020 23:34:20 +norma = 0 +real = 162 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.457 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.457 new file mode 100644 index 0000000..af50c1c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.457 @@ -0,0 +1,30 @@ +04:47:44 1594079264 祭 ० +04:47:45 1594079265 ⪫祭 ॣ '-2'(A) +04:47:46 1594079266 祭 ॣ '-2'(A) +05:43:45 1594082625 ⪫祭 ॣ '-2'(A) +08:18:44 1594091924 ⪫祭 ० (A) +08:18:46 1594091926 ⪫祭 +08:18:46 1594091926 : +08:18:50 1594091930 ⪫祭 ० ' ⮪ 㣨' +08:19:31 1594091971 祭 ० ᪠ +08:21:53 1594092113 ⪫祭 ० ᪠ (A) +08:48:46 1594093726 : 믮 +11:00:02 1594101602 : 㦥 +11:19:45 1594102785 : +11:59:18 1594105158 祭 ० ࠧ +11:59:24 1594105164 祭 ० ' ⮪ 㣨' +12:15:39 1594106139 祭 ॣ '-2'(A) +12:30:57 1594107057 ⪫祭 ० ' ⮪ 㣨' +12:32:15 1594107135 ⪫祭 ॣ '-2'(A) +12:32:26 1594107146 祭 ० ᪠ +12:32:26 1594107146 祭 ० ᪠ +12:32:26 1594107146 祭 ० ᪠ +12:35:01 1594107301 ⪫祭 ० ᪠ (A) +15:21:32 1594117292 : 㦥 +16:38:57 1594121937 : +16:51:51 1594122711 祭 ० ᪠ +16:54:28 1594122868 ⪫祭 ० ᪠ (A) +22:53:33 1594144413 祭 ॣ '-2'(A) +22:54:11 1594144451 ⪫祭 ॣ '-2'(A) +23:04:18 1594145058 祭 ॣ '-2' +23:34:20 1594146860 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.459 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.459 new file mode 100644 index 0000000..098a176 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.459 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.460 new file mode 100644 index 0000000..bcdad7a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.460 @@ -0,0 +1,6 @@ +02:35:33 1594071333 3 14 +03:28:24 1594074504 0 A--32-120-2016 ॢ 0 +05:22:28 1594081348 1 11521 3 37 9 4660 +10:22:26 1594099346 1 11521 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 870 8 3340 9 4660 10 770 11 12 321731 +19:06:20 1594130780 1 11521 3 14 +20:01:26 1594134086 0 A--32-120-2016 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.461 new file mode 100644 index 0000000..1ccf22e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.462 new file mode 100644 index 0000000..d616594 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.462 @@ -0,0 +1,69 @@ +21 02:35:44 02:35:47 +Rsk= 14.8 Rkk= 15.2 + +22 03:02:40 03:12:47 +P1= 16.0 T1=03:07:47 P2= 35.0 T2=03:12:47 Vs= 3.80 + +21 05:21:42 05:21:45 +Rsk= 16.6 Rkk= 14.9 + +22 07:00:03 07:15:10 +P1= 25.1 T1=07:10:10 P2= 35.1 T2=07:15:10 Vs= 1.99 + +20 09:06:29 09:06:37 +Riz_sol= 1050.7 + +21 09:06:45 09:06:48 +Rsk= 16.6 Rkk= 14.5 + +22 09:39:51 09:54:58 +P1= 39.6 T1=09:49:58 P2= 51.8 T2=09:54:58 Vs= 2.44 + +23 10:14:38 10:14:43 + + +24 10:14:53 10:15:30 + + +30 10:15:42 10:16:06 +Vst= 27.5 + +31 10:16:11 10:16:45 +Rom_sol= 11.1 + +32 10:17:50 10:18:24 +Imax=27.1 Umax=55.1 T= 9.0 + +33 10:18:27 10:18:47 +Imin=16.1 Umin=24.9 T= 0.5 + +34 10:18:50 10:19:12 +V=300.1 T= 9.4 + +35 10:19:15 10:20:15 +Q= 54.9 T= 9.4 + +36 10:20:20 10:20:49 +P1=0.29 T= 2.9 + +37 10:20:53 10:21:18 +T= 0.9 + +38 10:21:21 10:21:27 +t= 55.7 T= 0.5 + +39 10:21:32 10:21:47 +tcam= 53.5 Tcam= 0.5 tfl= 59.5 Tfl= 0.5 + +40 10:21:50 05:00:00 +t= 53.0 T= 0.5 + +21 19:05:57 19:06:00 +Rsk= 17.2 Rkk= 15.1 + +22 19:30:02 19:40:09 +P1= 16.0 T1=19:35:09 P2= 31.9 T2=19:40:09 Vs= 3.17 + +21 22:57:46 22:57:49 +Rsk= 17.4 Rkk= 15.1 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.463 new file mode 100644 index 0000000..0489a22 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.463 @@ -0,0 +1,24 @@ +13 02:02:46 1594069366 +0 02:02:46 1594069366 +14 02:35:08 1594071308 +15 03:14:01 1594073641 +16 03:40:32 1594075232 +1 04:28:32 1594078112 +2 05:19:35 1594081175 +5 07:16:20 1594088180 +6 07:29:27 1594088967 +7 08:05:17 1594091117 +8 08:57:19 1594094239 +25 10:15:37 1594098937 +9 10:22:26 1594099346 +10 10:59:27 1594101567 +11 13:08:09 1594109289 +12 16:30:19 1594121419 +13 18:39:21 1594129161 +0 18:39:22 1594129162 +14 19:04:04 1594130644 +15 19:45:49 1594133149 +16 20:14:29 1594134869 +1 21:02:03 1594137723 +2 22:51:54 1594144314 +7 23:21:57 1594146117 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.464 new file mode 100644 index 0000000..ef53a72 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.466 new file mode 100644 index 0000000..62ec036 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.466 @@ -0,0 +1,138 @@ +[88] +oper = 13 +begin = 07.07.2020 02:02:46 +norma = 45 +real = 32 + +[89] +oper = 14 +begin = 07.07.2020 02:35:08 +norma = 40 +vac_time = 8 +real = 38 + +[90] +oper = 15 +begin = 07.07.2020 03:14:01 +norma = 30 +real = 26 + +[91] +oper = 16 +begin = 07.07.2020 03:40:32 +norma = 40 +real = 48 + +[92] +oper = 1 +begin = 07.07.2020 04:28:32 +norma = 85 +real = 51 + +[93] +oper = 2 +begin = 07.07.2020 05:19:35 +norma = 110 +vac_time = 9 +real = 116 + +[94] +oper = 5 +begin = 07.07.2020 07:16:20 +norma = 25 +real = 13 + +[95] +oper = 6 +begin = 07.07.2020 07:29:27 +norma = 35 +real = 35 + +[96] +oper = 7 +begin = 07.07.2020 08:05:17 +norma = 30 +real = 52 + +[97] +oper = 8 +begin = 07.07.2020 08:57:19 +norma = 40 +vac_time = 10 +vac_avg10 = 9.2 +real = 78 + +[98] +oper = 25 +begin = 07.07.2020 10:15:37 +norma = 30 +real = 6 + +[99] +oper = 9 +begin = 07.07.2020 10:22:26 +norma = 0 +real = 37 + +[00] +oper = 10 +begin = 07.07.2020 10:59:27 +norma = 0 +real = 128 + +[01] +oper = 11 +begin = 07.07.2020 13:08:09 +norma = 0 +real = 202 + +[02] +oper = 12 +begin = 07.07.2020 16:30:19 +norma = 105 +real = 129 + +[03] +oper = 13 +begin = 07.07.2020 18:39:21 +norma = 45 +real = 24 + +[04] +oper = 14 +begin = 07.07.2020 19:04:04 +norma = 40 +vac_time = 8 +real = 41 + +[05] +oper = 15 +begin = 07.07.2020 19:45:49 +norma = 30 +real = 28 + +[06] +oper = 16 +begin = 07.07.2020 20:14:29 +norma = 40 +real = 47 + +[07] +oper = 1 +begin = 07.07.2020 21:02:03 +norma = 85 +real = 109 + +[08] +oper = 2 +begin = 07.07.2020 22:51:54 +norma = 110 +vac_time = 10 +real = 30 + +[09] +oper = 7 +begin = 07.07.2020 23:21:57 +norma = 30 +real = 80 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.467 new file mode 100644 index 0000000..6fc9618 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.467 @@ -0,0 +1,28 @@ +03:13:41 1594073621 祭 ० ࠧ +03:13:43 1594073623 祭 ० ' ⮪ 㣨' +03:14:30 1594073670 祭 ॣ '-2'(A) +03:28:24 1594074504 ⪫祭 ० ࠧ (A) +03:29:05 1594074545 ⪫祭 ० ' ⮪ 㣨' +03:40:36 1594075236 ⪫祭 ॣ '-2'(A) +03:40:57 1594075257 祭 ० ᪠ +03:40:57 1594075257 祭 ० ᪠ +03:40:57 1594075257 祭 ० ᪠ +03:42:55 1594075375 ⪫祭 ० ᪠ (A) +07:29:42 1594088982 祭 ० ᪠ +07:29:43 1594088983 祭 ० ᪠ +07:31:40 1594089100 ⪫祭 ० ᪠ (A) +10:14:53 1594098893 祭 ॣ '-2'(A) +10:15:30 1594098930 ⪫祭 ॣ '-2'(A) +10:59:09 1594101549 祭 ॣ '-2' +10:59:26 1594101566 祭 ⠭ ॣ +16:30:22 1594121422 ⪫祭 ॣ '-2'(A) +16:31:28 1594121488 祭 ० ᪠ +16:33:26 1594121606 ⪫祭 ० ᪠ (A) +19:45:38 1594133138 祭 ० ࠧ +19:45:40 1594133140 祭 ० ' ⮪ 㣨' +19:47:08 1594133228 祭 ॣ '-2'(A) +20:01:26 1594134086 ⪫祭 ० ࠧ (A) +20:01:52 1594134112 ⪫祭 ० ' ⮪ 㣨' +20:14:34 1594134874 ⪫祭 ॣ '-2'(A) +20:15:00 1594134900 祭 ० ᪠ +20:16:58 1594135018 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.469 new file mode 100644 index 0000000..c801852 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.481 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.481 new file mode 100644 index 0000000..8b05dfb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.481 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.484 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.484 new file mode 100644 index 0000000..6f3c5e6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.484 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.911 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.911 new file mode 100644 index 0000000..5aee45f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.911 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.912 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.912 new file mode 100644 index 0000000..f8d25ca --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.912 @@ -0,0 +1,6 @@ +22 02:03:11 02:08:10 +P1=20.5 P2=32.5 T1=02:03:11 T2=02:08:10 Vs= 2.4 + +22 04:30:30 04:35:29 +P1=26.9 P2=32.0 T1=04:30:30 T2=04:35:29 Vs= 1.0 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.913 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.913 new file mode 100644 index 0000000..729ec87 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.913 @@ -0,0 +1,6 @@ +12 01:07:00 1594066020 +10 02:09:51 1594069791 +12 04:58:00 1594079880 +00 13:53:22 1594112002 +13 13:53:22 1594112002 +08 22:56:36 1594144596 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.921 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.921 new file mode 100644 index 0000000..a0de0d5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.921 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.922 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.922 new file mode 100644 index 0000000..6be511c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.922 @@ -0,0 +1,3 @@ +22 23:08:15 23:13:15 +P1=49.5 P2=63.0 T1=23:08:15 T2=23:13:15 Vs= 2.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.923 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.923 new file mode 100644 index 0000000..b8fc7af --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.923 @@ -0,0 +1,3 @@ +12 01:07:00 1594066020 +08 12:34:57 1594107297 +10 23:20:38 1594146038 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.930 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.930 new file mode 100644 index 0000000..d8851fc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.930 @@ -0,0 +1,2 @@ +02:29:35 1594070975 1 01239 2 BT8 3 3 10000 6 690 7 5415 8 4930 9 320491 +02:37:33 1594071453 0 A_NTC_GRE_32_004_2018_rev2 1 01239 2 BT8 3 3 10000 4 9692 5 9692 6 690 7 5415 8 4930 9 320491 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.931 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.931 new file mode 100644 index 0000000..cab473f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.931 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.932 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.932 new file mode 100644 index 0000000..6714d6d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.932 @@ -0,0 +1,30 @@ +22 02:03:02 02:08:06 +P1= 26.5 T1=02:03:05 P2= 28.6 T2=02:08:06 Vs= 0.41 + +32 02:18:36 02:18:55 +Umax=85.0 T= 3.0 + +34 02:19:00 02:19:31 +V= 0.3 T= 9.0 + +43 02:19:36 02:21:57 +Ttgl= 0.0 + +38 02:22:03 02:22:19 +t= 50.0 T= 0.1 + +42 02:22:26 02:25:01 +Qtgl=63.04 T= 0.0 + +35 02:25:12 02:26:05 +Qizl=108.4 T= 0.0 + +37 02:26:12 02:27:57 +T= 0.0 + +21 02:28:12 02:28:14 +Rsk= 1.8 + +44 02:31:54 02:32:03 + + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.933 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.933 new file mode 100644 index 0000000..3086920 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.933 @@ -0,0 +1,6 @@ +10 02:32:32 1594071152 +17 05:02:17 1594080137 +10 05:09:19 1594080559 +12 05:16:21 1594080981 +13 12:11:20 1594105880 +0 12:11:20 1594105880 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.934 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.934 new file mode 100644 index 0000000..f6163a9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.934 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.941 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.941 new file mode 100644 index 0000000..c6338dd Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.941 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.943 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.943 new file mode 100644 index 0000000..5906dca --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.943 @@ -0,0 +1,6 @@ +17 01:01:06 1594065666 +12 01:02:59 1594065779 +10 01:10:51 1594066251 +12 01:26:48 1594067208 +13 11:13:25 1594102405 +0 11:13:25 1594102405 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200707.944 b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.944 new file mode 100644 index 0000000..0e55d85 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200707.944 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.010 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.010 new file mode 100644 index 0000000..1c1fe51 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.010 @@ -0,0 +1,5 @@ +08:27:28 1594178848 9 4150 +08:52:43 1594180363 2 BT 3-1, 6, 8, 9, 14, 15, 16 +08:53:18 1594180398 2 Ti-6Al4V-Ti_Str +09:47:27 1594183647 1 05661 2 Ti-6Al4V-Ti_Str 3 20 4 1 5 Ti 6 7 770 8 2026 9 4150 10 560 11 12 321543 +10:21:13 1594185673 0 A--32-124-2018 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.011 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.011 new file mode 100644 index 0000000..49cdae3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.011 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.012 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.012 new file mode 100644 index 0000000..6cb6c8e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.012 @@ -0,0 +1,63 @@ +22 23:59:48 00:15:22 +P1= 44.9 T1=00:10:22 P2= 59.4 T2=00:15:22 Vs= 2.89 + +20 01:19:40 01:19:48 +Riz_sol= 4938.7 + +21 01:19:57 01:20:00 +Rsk= 9.4 Rkk= 9.2 + +22 02:39:25 02:55:01 +P1= 46.3 T1=02:50:01 P2= 62.1 T2=02:55:01 Vs= 3.17 + +22 03:33:07 03:48:42 +P1= 41.4 T1=03:43:42 P2= 56.2 T2=03:48:42 Vs= 2.96 + +22 04:43:40 04:59:15 +P1= 38.5 T1=04:54:15 P2= 52.8 T2=04:59:15 Vs= 2.87 + +22 09:18:10 09:33:45 +P1= 39.6 T1=09:28:45 P2= 52.7 T2=09:33:45 Vs= 2.61 + +23 09:34:20 05:00:00 + + +24 09:35:13 09:35:49 + + +30 09:37:05 09:37:33 +Vst= 36.1 + +31 09:37:54 09:38:28 +Rom_sol= 17.1 + +41 09:40:09 09:40:14 +Ukz= 1.10 + +32 09:40:23 09:40:59 +Imax=11.0 Umax=50.0 T= 9.0 + +33 09:41:15 09:41:39 +Imin=15.9 Umin=25.0 T= 0.5 + +34 09:41:44 09:42:08 +V=300.2 T= 9.7 + +36 09:43:15 09:43:56 +P1=0.29 T= 3.2 + +37 09:44:02 09:44:27 +T= 1.2 + +38 09:44:33 09:44:41 +t= 52.1 T= 0.8 + +39 09:44:46 09:44:55 +t= 51.4 T= 0.8 + +40 09:45:01 09:45:09 +t= 53.7 T= 0.7 + +35 09:45:14 09:46:07 +Q= 54.6 T= 9.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.013 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.013 new file mode 100644 index 0000000..e372480 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.013 @@ -0,0 +1,10 @@ +5 00:18:29 1594149509 +6 00:29:38 1594150178 +7 01:04:45 1594152285 +8 01:16:44 1594153004 +25 09:36:53 1594183013 +9 09:47:27 1594183647 +10 10:21:13 1594185673 +12 18:16:47 1594214207 +13 22:25:21 1594229121 +0 22:25:21 1594229121 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.014 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.014 new file mode 100644 index 0000000..faada3d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.014 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.015 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.015 new file mode 100644 index 0000000..125174d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.015 @@ -0,0 +1,2 @@ +47 09:42:13 1594183333 +47 09:42:46 1594183366 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.016 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.016 new file mode 100644 index 0000000..e7f3fd9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.016 @@ -0,0 +1,55 @@ +[79] +oper = 5 +begin = 08.07.2020 00:18:29 +norma = 25 +real = 11 + +[80] +oper = 6 +begin = 08.07.2020 00:29:38 +norma = 35 +real = 35 + +[81] +oper = 7 +begin = 08.07.2020 01:04:45 +norma = 30 +real = 11 + +[82] +oper = 8 +begin = 08.07.2020 01:16:44 +norma = 40 +vac_time = 23 +real = 500 + +[83] +oper = 25 +begin = 08.07.2020 09:36:53 +norma = 30 +real = 10 + +[84] +oper = 9 +begin = 08.07.2020 09:47:27 +norma = 0 +real = 33 + +[85] +oper = 10 +begin = 08.07.2020 10:21:13 +norma = 0 +real = 475 + +[86] +oper = 12 +begin = 08.07.2020 18:16:47 +norma = 105 +real = 248 + +[87] +oper = 13 +begin = 08.07.2020 22:25:21 +norma = 45 +real = 878 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.017 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.017 new file mode 100644 index 0000000..5646c72 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.017 @@ -0,0 +1,15 @@ +09:35:15 1594182915 祭 ॣ '-2'(A) +09:35:50 1594182950 ⪫祭 ॣ '-2'(A) +09:46:38 1594183598 祭 ० ࠧ +09:46:40 1594183600 祭 ० ' ⮪ 㣨' +09:48:15 1594183695 祭 ॣ '-2'(A) +10:21:13 1594185673 祭 ⠭ ॣ +10:21:13 1594185673 ⪫祭 ० ࠧ (A) +18:10:07 1594213807 祭 ० +18:10:08 1594213808 ⪫祭 ॣ '-2'(A) +18:10:09 1594213809 祭 ॣ '-2'(A) +18:11:06 1594213866 ⪫祭 ० ' ⮪ 㣨' +18:11:12 1594213872 祭 ० ' ⮪ 㣨' +18:11:14 1594213874 ⪫祭 ० ' ⮪ 㣨' +18:16:50 1594214210 ⪫祭 ॣ '-2'(A) +19:20:07 1594218007 ⪫祭 ० (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.019 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.019 new file mode 100644 index 0000000..5d4d7c0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.019 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.020 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.020 new file mode 100644 index 0000000..499bc00 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.020 @@ -0,0 +1,6 @@ +08:45:49 1594179949 3 14 +10:15:52 1594185352 0 A--32-120-2016 ॢ 0 +13:06:24 1594195584 1 05152 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 7 770 9 4590 10 670 11 12 321454 +20:03:13 1594220593 12 321284 +22:55:44 1594230944 1 05152 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3100 9 4590 10 670 11 12 321284 +23:24:21 1594232661 0 A--32-068-2019 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.021 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.021 new file mode 100644 index 0000000..e24b67f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.021 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.022 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.022 new file mode 100644 index 0000000..1c69fd1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.022 @@ -0,0 +1,72 @@ +21 08:46:09 08:46:12 +Rsk= 14.3 Rkk= 10.9 + +22 09:10:24 09:20:28 +P1= 20.8 T1=09:15:28 P2= 44.0 T2=09:20:28 Vs= 4.64 + +21 13:06:49 13:06:52 +Rsk= 14.5 Rkk= 11.1 + +22 13:59:46 14:14:50 +P1= 44.1 T1=14:09:50 P2= 61.3 T2=14:14:50 Vs= 3.45 + +22 14:34:36 14:49:41 +P1= 37.2 T1=14:44:41 P2= 51.2 T2=14:49:41 Vs= 2.79 + +20 20:02:15 20:02:25 +Riz_sol= 2756.5 + +21 20:02:33 20:02:36 +Rsk= 14.6 Rkk= 11.3 + +22 20:58:12 21:13:16 +P1= 43.2 T1=21:08:16 P2= 59.7 T2=21:13:16 Vs= 3.29 + +22 21:33:26 21:48:31 +P1= 39.2 T1=21:43:31 P2= 52.4 T2=21:48:31 Vs= 2.64 + +22 22:30:31 22:45:36 +P1= 31.9 T1=22:40:36 P2= 42.7 T2=22:45:36 Vs= 2.17 + +23 22:45:49 22:45:54 + + +24 22:46:02 22:46:38 + + +30 22:47:00 22:47:30 +Vst= 29.4 + +31 22:47:48 22:48:49 +Rom_sol= 12.8 + +41 22:49:11 22:49:16 +Ukz= 1.23 + +32 22:49:28 22:50:06 +Imax=10.8 Umax=50.0 T= 9.0 + +33 22:50:11 22:50:44 +Imin=15.8 Umin=25.0 T= 2.0 + +34 22:50:48 22:51:14 +V=300.4 T= 9.4 + +35 22:51:20 22:52:34 +Q= 48.2 T= 9.4 + +40 22:52:39 22:52:48 +t= 51.2 T= 0.5 + +39 22:52:53 22:53:11 +tcam= 52.5 Tcam= 0.5 tfl= 60.9 Tfl= 0.5 + +38 22:53:16 22:53:25 +t= 53.5 T= 0.5 + +37 22:53:31 22:53:58 +T= 0.9 + +36 22:54:04 22:54:41 +P1=0.29 T= 2.9 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.023 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.023 new file mode 100644 index 0000000..9249d41 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.023 @@ -0,0 +1,16 @@ +11 02:47:20 1594158440 +12 06:07:05 1594170425 +13 08:07:07 1594177627 +0 08:07:07 1594177627 +14 08:43:36 1594179816 +15 09:39:33 1594183173 +16 10:21:01 1594185661 +1 11:08:47 1594188527 +2 13:00:49 1594195249 +5 14:51:10 1594201870 +6 15:01:45 1594202505 +7 16:00:14 1594206014 +8 19:49:50 1594219790 +25 22:46:57 1594230417 +9 22:55:44 1594230944 +10 23:24:21 1594232661 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.024 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.024 new file mode 100644 index 0000000..b170a9c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.024 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.026 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.026 new file mode 100644 index 0000000..eb2179f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.026 @@ -0,0 +1,93 @@ +[07] +oper = 11 +begin = 08.07.2020 02:47:20 +norma = 0 +real = 199 + +[08] +oper = 12 +begin = 08.07.2020 06:07:05 +norma = 105 +real = 120 + +[09] +oper = 13 +begin = 08.07.2020 08:07:07 +norma = 45 +real = 36 + +[10] +oper = 14 +begin = 08.07.2020 08:43:36 +norma = 40 +vac_time = 8 +real = 55 + +[11] +oper = 15 +begin = 08.07.2020 09:39:33 +norma = 30 +real = 41 + +[12] +oper = 16 +begin = 08.07.2020 10:21:01 +norma = 40 +real = 47 + +[13] +oper = 1 +begin = 08.07.2020 11:08:47 +norma = 85 +real = 112 + +[14] +oper = 2 +begin = 08.07.2020 13:00:49 +norma = 110 +vac_time = 9 +real = 110 + +[15] +oper = 5 +begin = 08.07.2020 14:51:10 +norma = 25 +real = 10 + +[16] +oper = 6 +begin = 08.07.2020 15:01:45 +norma = 35 +real = 58 + +[17] +oper = 7 +begin = 08.07.2020 16:00:14 +norma = 30 +real = 229 + +[18] +oper = 8 +begin = 08.07.2020 19:49:50 +norma = 40 +vac_time = 14 +real = 177 + +[19] +oper = 25 +begin = 08.07.2020 22:46:57 +norma = 30 +real = 8 + +[20] +oper = 9 +begin = 08.07.2020 22:55:44 +norma = 0 +real = 28 + +[21] +oper = 10 +begin = 08.07.2020 23:24:21 +norma = 0 +real = 228 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.027 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.027 new file mode 100644 index 0000000..55e6d93 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.027 @@ -0,0 +1,29 @@ +06:07:08 1594170428 ⪫祭 ॣ '-2'(A) +06:07:23 1594170443 祭 ० ᪠ +06:09:58 1594170598 ⪫祭 ० ᪠ (A) +09:39:19 1594183159 祭 ० ࠧ +09:39:20 1594183160 祭 ० ' ⮪ 㣨' +09:40:53 1594183253 祭 ॣ '-2'(A) +10:15:52 1594185352 ⪫祭 ० ࠧ (A) +10:16:00 1594185360 ⪫祭 ० ' ⮪ 㣨' +10:21:05 1594185665 ⪫祭 ॣ '-2'(A) +10:21:46 1594185706 祭 ० ᪠ +10:22:53 1594185773 ⪫祭 ० ᪠ +10:22:55 1594185775 祭 ० ᪠ +10:23:03 1594185783 ⪫祭 ० ᪠ +13:06:26 1594195586 : 㦥 +15:02:13 1594202533 祭 ० ᪠ +15:02:13 1594202533 祭 ० ᪠ +15:02:14 1594202534 祭 ० ᪠ +15:04:47 1594202687 ⪫祭 ० ᪠ (A) +22:46:05 1594230365 祭 ॣ '-2'(A) +22:46:40 1594230400 ⪫祭 ॣ '-2'(A) +22:47:39 1594230459 祭 +22:47:50 1594230470 祭 +22:48:50 1594230530 ⪫祭 +22:55:08 1594230908 祭 ० ࠧ +22:55:11 1594230911 祭 ० ' ⮪ 㣨' +22:55:45 1594230945 : 믮 +23:12:20 1594231940 祭 ॣ '-2'(A) +23:24:21 1594232661 ⪫祭 ० ࠧ (A) +23:24:21 1594232661 祭 ॣ . 殮 㣨 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.029 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.029 new file mode 100644 index 0000000..abf17d8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.029 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.030 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.030 new file mode 100644 index 0000000..9fa729d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.030 @@ -0,0 +1,5 @@ +00:12:20 1594149140 1 08233 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 2400 9 4370 10 690 11 12 321594 +00:54:53 1594151693 0 A--32-031-2016 ॢ 5 +12:54:01 1594194841 1 08234 2 BT 18, 20, 22, 23, 25 9 4550 +13:53:24 1594198404 1 08234 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 2400 9 4550 10 690 11 12 321594 +14:35:56 1594200956 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.031 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.031 new file mode 100644 index 0000000..8b71f78 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.031 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.032 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.032 new file mode 100644 index 0000000..16b8e44 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.032 @@ -0,0 +1,93 @@ +22 23:50:13 00:00:34 +P1= 9.5 T1=23:55:34 P2= 23.4 T2=00:00:34 Vs= 2.77 + +23 00:02:51 00:02:57 + + +24 00:03:21 00:03:53 + + +30 00:04:07 00:04:47 +Vst= 31.1 + +31 00:04:54 00:05:31 +Rom_sol= 10.4 + +41 00:06:09 00:06:14 +Ukz= 1.16 + +32 00:06:19 00:07:25 +Imax=11.4 Umax=50.0 T= 9.2 + +33 00:07:30 00:07:58 +Imin=16.5 Umin=25.1 T= 0.8 + +34 00:08:03 00:08:30 +V=301.3 T= 9.5 + +35 00:08:34 00:09:30 +Q= 54.8 T= 8.9 + +36 00:09:35 00:10:06 +P1=0.19 T= 2.9 + +37 00:10:13 00:10:42 +T= 0.5 + +38 00:10:58 00:11:04 +t= 51.3 T= 0.4 + +39 00:11:08 00:11:13 +t= 51.6 T= 0.4 + +40 00:11:17 00:11:22 +t= 51.8 T= 0.5 + +20 12:57:05 12:57:16 +Riz_sol= 6567.3 + +22 13:25:50 13:41:11 +P1= 37.0 T1=13:36:11 P2= 50.7 T2=13:41:11 Vs= 2.75 + +23 13:43:53 13:44:01 + + +21 13:44:19 13:44:26 +Rsk= 12.2 Rkk= 7.0 + +24 13:44:38 13:45:14 + + +30 13:45:25 13:46:04 +Vst= 31.2 + +31 13:46:09 13:46:46 +Rom_sol= 10.5 + +32 13:47:43 13:48:49 +Imax=11.4 Umax=50.0 T= 9.4 + +33 13:49:20 13:49:49 +Imin=16.5 Umin=25.1 T= 0.8 + +34 13:49:52 13:50:23 +V=301.4 T= 9.3 + +35 13:50:27 13:51:21 +Q= 54.9 T= 9.0 + +36 13:51:24 13:51:53 +P1=0.30 T= 2.9 + +37 13:51:56 13:52:23 +T= 0.6 + +38 13:52:26 13:52:31 +t= 51.3 T= 0.5 + +39 13:52:34 13:52:40 +t= 51.7 T= 0.4 + +40 13:52:43 13:52:48 +t= 51.9 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.033 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.033 new file mode 100644 index 0000000..601800c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.033 @@ -0,0 +1,15 @@ +25 00:04:03 1594148643 +9 00:12:20 1594149140 +10 00:54:53 1594151693 +11 04:26:48 1594164408 +12 07:13:46 1594174426 +13 09:04:06 1594181046 +0 09:04:06 1594181046 +8 12:52:35 1594194755 +25 13:45:22 1594197922 +9 13:53:24 1594198404 +10 14:35:56 1594200956 +11 18:17:10 1594214230 +12 21:04:07 1594224247 +13 22:51:57 1594230717 +0 22:51:57 1594230717 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.034 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.034 new file mode 100644 index 0000000..9b2bbe6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.034 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.035 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.035 new file mode 100644 index 0000000..e338b87 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.035 @@ -0,0 +1 @@ +67 00:10:54 1594149054 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.036 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.036 new file mode 100644 index 0000000..9259a91 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.036 @@ -0,0 +1,79 @@ +[08] +oper = 25 +begin = 08.07.2020 00:04:03 +norma = 30 +real = 8 + +[09] +oper = 9 +begin = 08.07.2020 00:12:20 +norma = 0 +real = 42 + +[10] +oper = 10 +begin = 08.07.2020 00:54:53 +norma = 0 +real = 211 + +[11] +oper = 11 +begin = 08.07.2020 04:26:48 +norma = 0 +real = 166 + +[12] +oper = 12 +begin = 08.07.2020 07:13:46 +norma = 105 +real = 110 + +[13] +oper = 13 +begin = 08.07.2020 09:04:06 +norma = 45 +real = 228 + +[14] +oper = 8 +begin = 08.07.2020 12:52:35 +norma = 40 +vac_time = 7 +real = 52 + +[15] +oper = 25 +begin = 08.07.2020 13:45:22 +norma = 30 +real = 8 + +[16] +oper = 9 +begin = 08.07.2020 13:53:24 +norma = 0 +real = 42 + +[17] +oper = 10 +begin = 08.07.2020 14:35:56 +norma = 0 +real = 221 + +[18] +oper = 11 +begin = 08.07.2020 18:17:10 +norma = 0 +real = 166 + +[19] +oper = 12 +begin = 08.07.2020 21:04:07 +norma = 105 +real = 107 + +[20] +oper = 13 +begin = 08.07.2020 22:51:57 +norma = 45 +real = 202 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.037 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.037 new file mode 100644 index 0000000..95c9e66 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.037 @@ -0,0 +1,31 @@ +00:03:21 1594148601 祭 ॣ '-2'(A) +00:03:53 1594148633 ⪫祭 ॣ '-2'(A) +00:11:39 1594149099 祭 ० ࠧ +00:11:40 1594149100 祭 ० ' ⮪ 㣨' +00:37:47 1594150667 祭 ॣ '-2'(A) +00:54:53 1594151693 祭 ⠭ ॣ +00:54:53 1594151693 ⪫祭 ० ࠧ (A) +04:26:47 1594164407 祭 ० +04:26:48 1594164408 ⪫祭 ॣ '-2'(A) +04:26:49 1594164409 祭 ॣ '-2'(A) +07:13:44 1594174424 ⪫祭 ० (A) +07:13:47 1594174427 ⪫祭 ० ' ⮪ 㣨' +07:13:51 1594174431 ⪫祭 ॣ '-2'(A) +07:15:35 1594174535 祭 ० ᪠ +07:18:10 1594174690 ⪫祭 ० ᪠ (A) +13:44:40 1594197880 祭 ॣ '-2'(A) +13:45:15 1594197915 ⪫祭 ॣ '-2'(A) +13:52:56 1594198376 祭 ० ࠧ +13:52:58 1594198378 祭 ० ' ⮪ 㣨' +14:18:51 1594199931 祭 ॣ '-2'(A) +14:35:56 1594200956 ⪫祭 ० ࠧ (A) +14:35:56 1594200956 祭 ⠭ ॣ +18:17:09 1594214229 祭 ० +18:17:10 1594214230 ⪫祭 ॣ '-2'(A) +18:17:11 1594214231 祭 ॣ '-2'(A) +21:04:06 1594224246 ⪫祭 ० (A) +21:04:09 1594224249 ⪫祭 ० ' ⮪ 㣨' +21:04:12 1594224252 ⪫祭 ॣ '-2'(A) +21:07:22 1594224442 祭 ० ᪠ +21:07:22 1594224442 祭 ० ᪠ +21:10:03 1594224603 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.039 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.039 new file mode 100644 index 0000000..55621d6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.039 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.050 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.050 new file mode 100644 index 0000000..f01d0b3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.050 @@ -0,0 +1,4 @@ +01:29:54 1594153794 8 5340 9 8370 12 321427 +02:40:11 1594158011 1 10156 2 p. cao M1,M2,M3,M4 3 30 4 1 5 Ti 6 7 920 8 5340 9 8370 10 750 11 12 321427 +15:25:38 1594203938 1 10157 +19:29:23 1594218563 1 10157 2 p. cao M1,M2,M3,M4 3 30 4 1 5 Ti 6 7 920 8 5340 9 8370 10 750 11 12 321427 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.051 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.051 new file mode 100644 index 0000000..c9b1ef4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.051 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.052 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.052 new file mode 100644 index 0000000..c70b201 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.052 @@ -0,0 +1,102 @@ +21 01:28:44 01:28:51 +Rsk= 21.1 Rkk= 15.6 + +20 01:28:58 01:29:08 +Riz_sol= 522.7 + +22 02:15:03 02:30:11 +P1= 42.0 T1=02:25:11 P2= 55.5 T2=02:30:11 Vs= 2.70 + +23 02:30:28 02:30:34 + + +24 02:30:42 02:31:16 + + +30 02:31:29 02:32:09 +Vst= 29.6 + +31 02:32:15 02:33:07 +Rom_sol= 19.2 + +32 02:33:42 02:34:49 +Imax=27.7 Umax=55.0 T= 9.2 + +33 02:34:53 02:35:27 +Imin=16.4 Umin=25.1 T= 0.8 + +34 02:35:31 02:36:01 +V=301.2 T= 9.6 + +35 02:36:06 02:37:18 +Q= 54.7 T= 9.3 + +36 02:37:23 02:38:15 +P1=0.29 T= 3.1 + +37 02:38:19 02:38:56 +T= 0.7 + +38 02:39:03 02:39:10 +t= 51.7 T= 0.7 + +39 02:39:14 02:39:29 +tcam= 51.3 Tcam= 0.7 tfl= 51.6 Tfl= 0.9 + +40 02:39:32 02:39:40 +t= 51.6 T= 0.7 + +21 15:28:05 15:28:12 +Rsk= 20.7 Rkk= 15.2 + +22 17:06:25 17:21:33 +P1= 44.9 T1=17:16:33 P2= 57.8 T2=17:21:33 Vs= 2.59 + +20 18:22:24 18:22:34 +Riz_sol= 876.3 + +21 18:22:41 18:22:49 +Rsk= 20.7 Rkk= 15.2 + +22 19:04:54 19:20:02 +P1= 46.3 T1=19:15:02 P2= 59.4 T2=19:20:02 Vs= 2.62 + +23 19:20:11 19:20:17 + + +24 19:20:27 19:21:02 + + +30 19:21:14 19:21:55 +Vst= 29.8 + +31 19:21:59 19:22:40 +Rom_sol= 19.2 + +32 19:23:22 19:24:30 +Imax=27.8 Umax=54.9 T= 9.4 + +33 19:24:34 19:25:11 +Imin=16.4 Umin=25.2 T= 1.0 + +34 19:25:13 19:25:41 +V=301.1 T= 9.5 + +35 19:25:43 19:26:49 +Q= 54.2 T= 9.1 + +36 19:26:58 19:27:46 +P1=0.28 T= 3.0 + +37 19:27:49 19:28:23 +T= 0.8 + +38 19:28:26 19:28:32 +t= 51.7 T= 0.7 + +39 19:28:35 19:28:52 +tcam= 51.3 Tcam= 0.7 tfl= 51.6 Tfl= 0.9 + +40 19:28:56 19:29:01 +t= 51.5 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.053 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.053 new file mode 100644 index 0000000..af1f195 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.053 @@ -0,0 +1,18 @@ +5 00:11:21 1594149081 +6 00:22:26 1594149746 +7 01:04:12 1594152252 +8 01:22:02 1594153322 +25 02:31:26 1594157486 +9 02:40:11 1594158011 +10 03:05:09 1594159509 +12 08:36:37 1594179397 +13 13:25:08 1594196708 +0 13:25:08 1594196708 +2 15:22:34 1594203754 +5 17:22:26 1594210946 +6 17:32:40 1594211560 +7 18:06:15 1594213575 +8 18:21:45 1594214505 +25 19:21:11 1594218071 +9 19:29:23 1594218563 +10 19:54:22 1594220062 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.054 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.054 new file mode 100644 index 0000000..85fe598 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.054 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.055 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.055 new file mode 100644 index 0000000..75325f9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.055 @@ -0,0 +1,4 @@ +47 02:33:29 1594157609 +4 15:26:04 1594203964 +4 15:26:53 1594204013 +4 15:27:16 1594204036 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.056 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.056 new file mode 100644 index 0000000..5ffa627 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.056 @@ -0,0 +1,106 @@ +[13] +oper = 5 +begin = 08.07.2020 00:11:21 +norma = 25 +real = 11 + +[14] +oper = 6 +begin = 08.07.2020 00:22:26 +norma = 35 +real = 41 + +[15] +oper = 7 +begin = 08.07.2020 01:04:12 +norma = 30 +real = 17 + +[16] +oper = 8 +begin = 08.07.2020 01:22:02 +norma = 40 +vac_time = 19 +real = 69 + +[17] +oper = 25 +begin = 08.07.2020 02:31:26 +norma = 30 +real = 8 + +[18] +oper = 9 +begin = 08.07.2020 02:40:11 +norma = 0 +real = 24 + +[19] +oper = 10 +begin = 08.07.2020 03:05:09 +norma = 0 +real = 331 + +[20] +oper = 12 +begin = 08.07.2020 08:36:37 +norma = 180 +real = 288 + +[21] +oper = 13 +begin = 08.07.2020 13:25:08 +norma = 45 +real = 117 + +[22] +oper = 2 +begin = 08.07.2020 15:22:34 +norma = 110 +vac_time = 47 +vac_avg10 = 15.3 +real = 119 + +[23] +oper = 5 +begin = 08.07.2020 17:22:26 +norma = 25 +real = 10 + +[24] +oper = 6 +begin = 08.07.2020 17:32:40 +norma = 35 +real = 33 + +[25] +oper = 7 +begin = 08.07.2020 18:06:15 +norma = 30 +real = 15 + +[26] +oper = 8 +begin = 08.07.2020 18:21:45 +norma = 40 +vac_time = 9 +real = 59 + +[27] +oper = 25 +begin = 08.07.2020 19:21:11 +norma = 30 +real = 8 + +[28] +oper = 9 +begin = 08.07.2020 19:29:23 +norma = 0 +real = 24 + +[29] +oper = 10 +begin = 08.07.2020 19:54:22 +norma = 0 +real = 339 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.057 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.057 new file mode 100644 index 0000000..0acbacc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.057 @@ -0,0 +1,16 @@ +00:22:46 1594149766 祭 ० ᪠ +00:25:30 1594149930 ⪫祭 ० ᪠ (A) +02:30:43 1594157443 祭 ॣ '-2'(A) +02:31:17 1594157477 ⪫祭 ॣ '-2'(A) +02:54:59 1594158899 祭 ॣ '-2' +03:05:08 1594159508 祭 ⠭ ॣ +08:36:42 1594179402 ⪫祭 ॣ '-2'(A) +08:37:30 1594179450 祭 ० ᪠ +08:40:13 1594179613 ⪫祭 ० ᪠ (A) +17:33:13 1594211593 祭 ० ᪠ +17:33:14 1594211594 祭 ० ᪠ +17:35:53 1594211753 ⪫祭 ० ᪠ (A) +19:20:30 1594218030 祭 ॣ '-2'(A) +19:21:03 1594218063 ⪫祭 ॣ '-2'(A) +19:43:35 1594219415 祭 ॣ '-2' +19:54:21 1594220061 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.059 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.059 new file mode 100644 index 0000000..a69f95f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.059 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.080 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.080 new file mode 100644 index 0000000..87bf1ae --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.080 @@ -0,0 +1,7 @@ +00:53:34 1594151614 1 05935 3 25 9 5100 12 321173 +04:12:08 1594163528 7 840 +04:13:22 1594163602 1 05935 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 840 8 4890 9 5100 10 770 11 12 321173 +14:55:18 1594202118 3 14 +16:07:59 1594206479 0 A--32-120-2016 ॢ 0 +18:05:20 1594213520 1 05936 3 25 9 4975 +22:57:40 1594231060 1 05936 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 840 8 4890 9 4975 10 770 11 12 321173 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.081 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.081 new file mode 100644 index 0000000..6116e38 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.081 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.082 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.082 new file mode 100644 index 0000000..11237dd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.082 @@ -0,0 +1,129 @@ +21 00:52:19 00:52:27 +Rsk= 25.4 Rkk= 19.9 + +22 01:25:02 01:40:07 +P1= 67.2 T1=01:35:07 P2= 81.8 T2=01:40:07 Vs= 2.93 + +20 03:12:57 03:13:07 +Riz_sol= 2751.9 + +21 03:13:22 03:13:30 +Rsk= 24.8 Rkk= 19.3 + +22 03:46:00 04:01:05 +P1= 59.0 T1=03:56:05 P2= 72.8 T2=04:01:05 Vs= 2.77 + +23 04:01:39 04:01:45 + + +24 04:01:58 04:02:44 + + +30 04:02:56 04:03:37 +Vst= 28.5 + +31 04:03:51 04:04:32 +Rom_sol= 14.6 + +41 04:05:05 04:05:10 +Ukz= 1.05 + +32 04:05:15 04:06:20 +Imax=11.5 Umax=50.0 T= 9.2 + +33 04:06:25 04:07:04 +Imin=16.7 Umin=25.1 T= 0.8 + +34 04:07:08 04:07:36 +V=301.2 T= 9.6 + +35 04:07:40 04:08:53 +Q= 54.9 T= 9.1 + +36 04:08:57 04:09:52 +P1=0.29 T= 3.1 + +37 04:09:58 04:10:29 +T= 0.7 + +40 04:10:33 04:10:39 +t= 51.7 T= 0.8 + +39 04:10:43 04:10:58 +tcam= 51.5 Tcam= 0.7 tfl= 51.7 Tfl= 0.5 + +38 04:11:02 04:11:09 +t= 51.5 T= 0.8 + +21 14:56:00 14:56:07 +Rsk= 19.3 Rkk= 19.3 + +22 15:35:01 15:45:06 +P1= 25.0 T1=15:40:06 P2= 42.6 T2=15:45:06 Vs= 3.53 + +21 18:05:44 18:05:52 +Rsk= 25.2 Rkk= 19.7 + +22 18:50:00 19:05:05 +P1= 47.8 T1=19:00:05 P2= 59.8 T2=19:05:05 Vs= 2.40 + +20 21:08:38 21:08:48 +Riz_sol= 2956.3 + +21 21:09:08 21:09:15 +Rsk= 25.2 Rkk= 19.6 + +22 21:50:30 22:05:35 +P1= 49.8 T1=22:00:35 P2= 62.1 T2=22:05:35 Vs= 2.46 + +22 22:35:02 22:45:07 +P1= 23.1 T1=22:40:07 P2= 36.1 T2=22:45:07 Vs= 2.61 + +23 22:45:23 22:45:30 + + +24 22:45:39 22:46:14 + + +30 22:46:38 22:47:15 +Vst= 28.6 + +31 22:47:23 22:48:01 +Rom_sol= 14.5 + +41 22:48:40 22:48:45 +Ukz= 1.74 + +41 22:49:15 22:49:16 +Ukz= 0.00 + +41 22:50:27 22:50:32 +Ukz= 1.39 + +32 22:50:53 22:52:05 +Imax=11.5 Umax=50.0 T= 9.2 + +33 22:52:09 22:52:38 +Imin=16.7 Umin=25.1 T= 0.8 + +34 22:52:42 22:53:11 +V=301.2 T= 9.6 + +35 22:53:15 22:54:26 +Q= 55.0 T= 9.5 + +36 22:54:31 22:55:20 +P1=0.30 T= 3.0 + +37 22:55:24 22:55:54 +T= 0.7 + +38 22:55:57 22:56:03 +t= 51.5 T= 0.5 + +39 22:56:07 22:56:21 +tcam= 51.5 Tcam= 0.5 tfl= 51.7 Tfl= 0.5 + +40 22:56:24 22:56:30 +t= 51.7 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.083 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.083 new file mode 100644 index 0000000..baa9229 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.083 @@ -0,0 +1,26 @@ +1 00:24:21 1594149861 +2 00:49:36 1594151376 +5 01:42:00 1594154520 +6 01:56:31 1594155391 +7 02:36:07 1594157767 +8 03:09:49 1594159789 +25 04:02:53 1594162973 +9 04:13:22 1594163602 +10 04:51:24 1594165884 +11 09:11:54 1594181514 +12 09:15:16 1594181716 +13 14:02:44 1594198964 +0 14:02:44 1594198964 +14 14:50:35 1594201835 +15 15:53:28 1594205608 +16 16:08:00 1594206480 +16 16:15:44 1594206944 +1 17:03:19 1594209799 +2 17:59:39 1594213179 +5 19:07:00 1594217220 +6 19:20:04 1594218004 +7 20:01:52 1594220512 +8 21:05:48 1594224348 +25 22:46:31 1594230391 +9 22:57:40 1594231060 +10 23:40:09 1594233609 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.084 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.084 new file mode 100644 index 0000000..51e0056 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.084 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.085 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.085 new file mode 100644 index 0000000..bc87bb9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.085 @@ -0,0 +1 @@ +3 21:09:02 1594224542 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.086 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.086 new file mode 100644 index 0000000..9708ca5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.086 @@ -0,0 +1,155 @@ +[17] +oper = 1 +begin = 08.07.2020 00:24:21 +norma = 85 +real = 25 + +[18] +oper = 2 +begin = 08.07.2020 00:49:36 +norma = 110 +vac_time = 8 +real = 52 + +[19] +oper = 5 +begin = 08.07.2020 01:42:00 +norma = 25 +real = 14 + +[20] +oper = 6 +begin = 08.07.2020 01:56:31 +norma = 35 +real = 39 + +[21] +oper = 7 +begin = 08.07.2020 02:36:07 +norma = 30 +real = 33 + +[22] +oper = 8 +begin = 08.07.2020 03:09:49 +norma = 40 +vac_time = 8 +real = 53 + +[23] +oper = 25 +begin = 08.07.2020 04:02:53 +norma = 30 +real = 10 + +[24] +oper = 9 +begin = 08.07.2020 04:13:22 +norma = 0 +real = 38 + +[25] +oper = 10 +begin = 08.07.2020 04:51:24 +norma = 0 +real = 260 + +[26] +oper = 11 +begin = 08.07.2020 09:11:54 +norma = 0 +real = 3 + +[27] +oper = 12 +begin = 08.07.2020 09:15:16 +norma = 105 +real = 287 + +[28] +oper = 13 +begin = 08.07.2020 14:02:44 +norma = 45 +real = 47 + +[29] +oper = 14 +begin = 08.07.2020 14:50:35 +norma = 40 +vac_time = 7 +real = 62 + +[30] +oper = 15 +begin = 08.07.2020 15:53:28 +norma = 30 +real = 14 + +[31] +oper = 16 +begin = 08.07.2020 16:08:00 +norma = 40 +real = 7 + +[32] +oper = 16 +begin = 08.07.2020 16:15:44 +norma = 40 +real = 47 + +[33] +oper = 1 +begin = 08.07.2020 17:03:19 +norma = 85 +real = 56 + +[34] +oper = 2 +begin = 08.07.2020 17:59:39 +norma = 110 +vac_time = 9 +real = 67 + +[35] +oper = 5 +begin = 08.07.2020 19:07:00 +norma = 25 +real = 13 + +[36] +oper = 6 +begin = 08.07.2020 19:20:04 +norma = 35 +real = 41 + +[37] +oper = 7 +begin = 08.07.2020 20:01:52 +norma = 30 +real = 63 + +[38] +oper = 8 +begin = 08.07.2020 21:05:48 +norma = 40 +vac_time = 8 +real = 100 + +[39] +oper = 25 +begin = 08.07.2020 22:46:31 +norma = 30 +real = 11 + +[40] +oper = 9 +begin = 08.07.2020 22:57:40 +norma = 0 +real = 42 + +[41] +oper = 10 +begin = 08.07.2020 23:40:09 +norma = 0 +real = 254 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.087 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.087 new file mode 100644 index 0000000..6e1b76b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.087 @@ -0,0 +1,27 @@ +01:57:06 1594155426 祭 ० ᪠ +01:58:47 1594155527 ⪫祭 ० ᪠ +04:02:11 1594162931 祭 ॣ '-2'(A) +04:02:45 1594162965 ⪫祭 ॣ '-2'(A) +04:45:40 1594165540 祭 ॣ '-2' +04:51:24 1594165884 祭 ⠭ ॣ +09:06:17 1594181177 ⪫祭 ॣ '-2' +09:16:09 1594181769 祭 ० ᪠ +09:18:35 1594181915 ⪫祭 ० ᪠ (A) +15:53:35 1594205615 祭 ० ࠧ +15:53:36 1594205616 祭 ० ' ⮪ 㣨' +15:53:38 1594205618 祭 ॣ '-2'(A) +16:07:59 1594206479 ⪫祭 ० ࠧ (A) +16:09:09 1594206549 ⪫祭 ० ' ⮪ 㣨' +16:15:49 1594206949 ⪫祭 ॣ '-2'(A) +16:16:16 1594206976 祭 ० ᪠ +16:18:11 1594207091 ⪫祭 ० ᪠ +16:18:14 1594207094 祭 ० ᪠ +16:18:33 1594207113 ⪫祭 ० ᪠ +16:18:35 1594207115 祭 ० ᪠ +16:18:40 1594207120 ⪫祭 ० ᪠ (A) +19:20:52 1594218052 祭 ० ᪠ +19:23:47 1594218227 ⪫祭 ० ᪠ (A) +22:45:43 1594230343 祭 ॣ '-2'(A) +22:46:16 1594230376 ⪫祭 ॣ '-2'(A) +23:40:53 1594233653 祭 ॣ '-2' +23:47:17 1594234037 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.089 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.089 new file mode 100644 index 0000000..1c68e3e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.089 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.090 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.090 new file mode 100644 index 0000000..a1d5e78 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.090 @@ -0,0 +1,4 @@ +01:10:34 1594152634 1 10056 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 1000 8 4655 9 8460 10 920 11 12 321801 +01:55:08 1594155308 0 A--32-036-2011 ॢ 0 +13:54:03 1594198443 3 14 +21:42:28 1594226548 1 10057 3 37 7 870 9 5410 10 770 12 320542 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.091 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.091 new file mode 100644 index 0000000..137f78b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.091 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.092 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.092 new file mode 100644 index 0000000..5a2f3f1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.092 @@ -0,0 +1,60 @@ +20 00:17:01 00:17:10 +Riz_sol= 8316.0 + +21 00:17:15 00:17:18 +Rsk= 26.9 Rkk= 23.5 + +22 00:45:18 01:00:25 +P1= 47.6 T1=00:55:25 P2= 60.2 T2=01:00:25 Vs= 2.51 + +23 01:02:54 01:02:59 + + +24 01:03:04 01:03:42 + + +30 01:04:09 01:04:34 +Vst= 29.3 + +31 01:04:36 01:05:09 +Rom_sol= 12.5 + +41 01:05:29 01:05:34 +Ukz= 0.65 + +32 01:05:35 01:06:10 +Imax=27.1 Umax=55.0 T= 9.0 + +33 05:00:00 01:06:29 +Imin=16.0 Umin=25.0 T= 0.5 + +34 05:00:00 01:06:53 +V=300.2 T= 9.4 + +35 01:06:54 01:08:09 +Q= 53.2 T= 9.5 + +36 01:08:11 01:08:50 +P1=0.28 T= 3.0 + +37 01:08:52 01:09:26 +T= 1.0 + +38 01:09:28 01:09:35 +t= 52.9 T= 0.6 + +40 01:09:39 01:09:45 +t= 53.3 T= 0.5 + +21 13:54:11 13:54:14 +Rsk= 26.2 Rkk= 22.8 + +22 14:55:45 15:05:52 +P1= 24.4 T1=15:00:52 P2= 35.0 T2=15:05:52 Vs= 2.11 + +21 21:41:09 21:41:12 +Rsk= 24.0 Rkk= 20.7 + +22 22:30:09 22:45:16 +P1= 41.8 T1=22:40:16 P2= 51.4 T2=22:45:16 Vs= 1.91 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.093 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.093 new file mode 100644 index 0000000..6e34eab --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.093 @@ -0,0 +1,17 @@ +7 00:01:00 1594148460 +8 00:12:40 1594149160 +25 01:04:07 1594152247 +9 01:10:34 1594152634 +10 01:55:08 1594155308 +11 05:59:17 1594169957 +12 10:08:27 1594184907 +13 12:54:43 1594194883 +0 12:54:43 1594194883 +14 13:47:08 1594198028 +15 15:21:31 1594203691 +16 16:02:59 1594206179 +1 16:50:27 1594209027 +2 21:38:55 1594226335 +5 22:46:10 1594230370 +6 22:58:24 1594231104 +7 23:32:19 1594233139 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.094 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.094 new file mode 100644 index 0000000..33862bb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.094 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.096 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.096 new file mode 100644 index 0000000..0cf3f38 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.096 @@ -0,0 +1,100 @@ +[40] +oper = 7 +begin = 08.07.2020 00:01:00 +norma = 30 +real = 11 + +[41] +oper = 8 +begin = 08.07.2020 00:12:40 +norma = 40 +vac_time = 9 +vac_avg10 = 8.0 +real = 51 + +[42] +oper = 25 +begin = 08.07.2020 01:04:07 +norma = 30 +real = 6 + +[43] +oper = 9 +begin = 08.07.2020 01:10:34 +norma = 0 +real = 44 + +[44] +oper = 10 +begin = 08.07.2020 01:55:08 +norma = 0 +real = 244 + +[45] +oper = 11 +begin = 08.07.2020 05:59:17 +norma = 0 +real = 249 + +[46] +oper = 12 +begin = 08.07.2020 10:08:27 +norma = 105 +real = 166 + +[47] +oper = 13 +begin = 08.07.2020 12:54:43 +norma = 45 +real = 52 + +[48] +oper = 14 +begin = 08.07.2020 13:47:08 +norma = 40 +vac_time = 10 +real = 94 + +[49] +oper = 15 +begin = 08.07.2020 15:21:31 +norma = 30 +real = 41 + +[50] +oper = 16 +begin = 08.07.2020 16:02:59 +norma = 40 +real = 47 + +[51] +oper = 1 +begin = 08.07.2020 16:50:27 +norma = 85 +real = 288 + +[52] +oper = 2 +begin = 08.07.2020 21:38:55 +norma = 110 +vac_time = 8 +real = 67 + +[53] +oper = 5 +begin = 08.07.2020 22:46:10 +norma = 25 +real = 12 + +[54] +oper = 6 +begin = 08.07.2020 22:58:24 +norma = 35 +real = 33 + +[55] +oper = 7 +begin = 08.07.2020 23:32:19 +norma = 30 +real = 99 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.097 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.097 new file mode 100644 index 0000000..9e63b99 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.097 @@ -0,0 +1,24 @@ +01:03:09 1594152189 祭 ॣ '-2'(A) +01:03:43 1594152223 ⪫祭 ॣ '-2'(A) +01:09:54 1594152594 祭 ० ࠧ +01:09:56 1594152596 祭 ० ' ⮪ 㣨' +01:13:08 1594152788 祭 ॣ '-2'(A) +01:55:08 1594155308 祭 ⠭ ॣ +01:55:08 1594155308 ⪫祭 ० ࠧ (A) +05:59:17 1594169957 祭 ० +05:59:17 1594169957 ⪫祭 ॣ '-2'(A) +05:59:18 1594169958 祭 ॣ '-2'(A) +07:08:16 1594174096 ⪫祭 ॣ '-2'(A) +10:08:17 1594184897 ⪫祭 ० (A) +10:08:28 1594184908 ⪫祭 ० ' ⮪ 㣨' +15:21:02 1594203662 祭 ० ࠧ +15:21:04 1594203664 祭 ० ' ⮪ 㣨' +15:21:30 1594203690 祭 ॣ '-2'(A) +15:35:28 1594204528 ⪫祭 ० ' ⮪ 㣨' +15:41:17 1594204877 ⪫祭 ० ࠧ (A) +16:03:02 1594206182 ⪫祭 ॣ '-2'(A) +16:03:13 1594206193 祭 ० ᪠ +16:05:34 1594206334 ⪫祭 ० ᪠ (A) +22:58:46 1594231126 祭 ० ᪠ +22:58:46 1594231126 祭 ० ᪠ +23:01:04 1594231264 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.099 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.099 new file mode 100644 index 0000000..8e232c4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.099 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.100 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.100 new file mode 100644 index 0000000..f423735 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.100 @@ -0,0 +1,4 @@ +10:07:18 1594184838 3 14 +14:58:19 1594202299 1 11161 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 7 770 9 4180 10 670 11 +22:55:14 1594230914 1 11161 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4570 9 4180 10 670 11 12 321801 +23:23:56 1594232636 0 A--32-068-2019 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.101 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.101 new file mode 100644 index 0000000..8892e25 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.101 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.102 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.102 new file mode 100644 index 0000000..6e0c12b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.102 @@ -0,0 +1,75 @@ +21 10:07:25 10:07:33 +Rsk=6498.0 Rkk= 17.8 + +21 10:07:51 10:07:58 +Rsk= 17.9 Rkk= 18.0 + +22 10:30:12 10:45:18 +P1= 48.1 T1=10:40:18 P2= 63.9 T2=10:45:18 Vs= 3.16 + +21 14:58:37 14:58:44 +Rsk= 19.4 Rkk= 17.8 + +22 15:24:52 15:39:58 +P1= 46.3 T1=15:34:58 P2= 62.2 T2=15:39:58 Vs= 3.18 + +22 15:50:14 16:05:20 +P1= 32.2 T1=16:00:19 P2= 43.9 T2=16:05:20 Vs= 2.34 + +20 19:27:06 19:27:16 +Riz_sol=10128.7 + +21 19:27:23 19:27:31 +Rsk= 19.0 Rkk= 17.5 + +22 20:02:25 20:17:30 +P1= 33.0 T1=20:12:30 P2= 45.2 T2=20:17:30 Vs= 2.43 + +22 22:30:41 22:40:46 +P1= 10.9 T1=22:35:46 P2= 23.1 T2=22:40:46 Vs= 2.44 + +23 22:44:52 22:44:58 + + +24 22:45:05 22:45:43 + + +30 22:45:57 22:46:36 +Vst= 28.5 + +31 22:46:43 22:47:44 +Rom_sol= 14.3 + +41 22:48:14 22:48:19 +Ukz= 1.19 + +32 22:48:24 22:49:33 +Imax=11.3 Umax=50.0 T= 9.4 + +33 22:49:36 22:49:47 +Imin=15.1 Umin=24.2 T= 0.2 + +33 22:49:54 22:50:28 +Imin=16.4 Umin=25.1 T= 0.8 + +34 22:50:31 22:51:00 +V=301.8 T= 9.5 + +35 22:51:05 22:52:28 +Q= 54.8 T= 9.3 + +36 22:52:32 22:53:08 +P1=0.30 T= 3.0 + +37 22:53:11 22:53:49 +T= 0.7 + +38 22:53:52 22:54:00 +t= 51.6 T= 0.5 + +39 22:54:02 22:54:09 +t= 51.5 T= 0.5 + +40 22:54:12 22:54:19 +t= 51.6 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.103 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.103 new file mode 100644 index 0000000..a58b7fd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.103 @@ -0,0 +1,17 @@ +10 00:20:50 1594149650 +11 03:20:35 1594160435 +12 06:40:24 1594172424 +13 08:43:21 1594179801 +0 08:43:21 1594179801 +14 10:03:34 1594184614 +15 10:46:30 1594187190 +16 11:26:00 1594189560 +1 11:57:44 1594191464 +2 14:51:41 1594201901 +5 16:06:10 1594206370 +6 16:17:32 1594207052 +7 17:00:24 1594209624 +8 18:55:21 1594216521 +25 22:45:53 1594230353 +9 22:55:14 1594230914 +10 23:23:57 1594232637 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.104 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.104 new file mode 100644 index 0000000..be6b4a7 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.104 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.105 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.105 new file mode 100644 index 0000000..f5d17f0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.105 @@ -0,0 +1 @@ +56 22:49:47 1594230587 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.106 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.106 new file mode 100644 index 0000000..eaf41ae --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.106 @@ -0,0 +1,100 @@ +[68] +oper = 10 +begin = 08.07.2020 00:20:50 +norma = 0 +real = 179 + +[69] +oper = 11 +begin = 08.07.2020 03:20:35 +norma = 0 +real = 199 + +[70] +oper = 12 +begin = 08.07.2020 06:40:24 +norma = 105 +real = 122 + +[71] +oper = 13 +begin = 08.07.2020 08:43:21 +norma = 45 +real = 80 + +[72] +oper = 14 +begin = 08.07.2020 10:03:34 +norma = 40 +vac_time = 7 +real = 42 + +[73] +oper = 15 +begin = 08.07.2020 10:46:30 +norma = 30 +real = 39 + +[74] +oper = 16 +begin = 08.07.2020 11:26:00 +norma = 40 +real = 31 + +[75] +oper = 1 +begin = 08.07.2020 11:57:44 +norma = 85 +real = 173 + +[76] +oper = 2 +begin = 08.07.2020 14:51:41 +norma = 110 +vac_time = 8 +vac_avg10 = 7.8 +real = 74 + +[77] +oper = 5 +begin = 08.07.2020 16:06:10 +norma = 25 +real = 11 + +[78] +oper = 6 +begin = 08.07.2020 16:17:32 +norma = 35 +real = 42 + +[79] +oper = 7 +begin = 08.07.2020 17:00:24 +norma = 30 +real = 114 + +[80] +oper = 8 +begin = 08.07.2020 18:55:21 +norma = 40 +vac_time = 32 +real = 230 + +[81] +oper = 25 +begin = 08.07.2020 22:45:53 +norma = 30 +real = 9 + +[82] +oper = 9 +begin = 08.07.2020 22:55:14 +norma = 0 +real = 28 + +[83] +oper = 10 +begin = 08.07.2020 23:23:57 +norma = 0 +real = 217 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.107 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.107 new file mode 100644 index 0000000..182648b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.107 @@ -0,0 +1,21 @@ +00:20:47 1594149647 祭 ॣ '-2' +00:20:49 1594149649 祭 ⠭ ॣ +03:18:17 1594160297 ⪫祭 ॣ '-2' +10:46:06 1594187166 祭 ० ࠧ +10:46:08 1594187168 祭 ० ' ⮪ 㣨' +10:46:27 1594187187 祭 ॣ '-2'(A) +11:00:29 1594188029 ⪫祭 ० ' ⮪ 㣨' +11:19:57 1594189197 ⪫祭 ० ࠧ (A) +11:26:04 1594189564 ⪫祭 ॣ '-2'(A) +14:58:21 1594202301 : 㦥 +22:18:01 1594228681 祭 +22:45:08 1594230308 祭 ॣ '-2'(A) +22:45:44 1594230344 ⪫祭 ॣ '-2'(A) +22:46:44 1594230404 祭 +22:47:44 1594230464 ⪫祭 +22:54:45 1594230885 祭 ० ࠧ +22:54:46 1594230886 祭 ० ' ⮪ 㣨' +22:55:15 1594230915 : 믮 +23:11:56 1594231916 祭 ॣ '-2'(A) +23:23:56 1594232636 祭 ॣ . 殮 㣨 +23:23:56 1594232636 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.109 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.109 new file mode 100644 index 0000000..43dcf10 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.109 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.110 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.110 new file mode 100644 index 0000000..825f5d2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.110 @@ -0,0 +1,4 @@ +07:11:11 1594174271 3 14 +10:40:08 1594186808 1 10824 2 BT 18, 20, 22, 23, 25 3 25 9 4120 12 320201 +22:53:41 1594230821 1 10824 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 3100 9 4120 10 670 11 12 320201 +23:22:15 1594232535 0 A--32-068-2019 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.111 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.111 new file mode 100644 index 0000000..e1c11fa Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.111 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.112 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.112 new file mode 100644 index 0000000..3f4ab9f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.112 @@ -0,0 +1,66 @@ +21 07:10:59 07:11:02 +Rsk= 23.8 Rkk= 20.5 + +22 07:26:56 07:37:00 +P1= 43.7 T1=07:32:00 P2= 65.5 T2=07:37:00 Vs= 4.36 + +21 10:38:49 10:38:52 +Rsk= 23.8 Rkk= 20.5 + +22 11:35:52 11:50:57 +P1= 57.3 T1=11:45:57 P2= 68.3 T2=11:50:57 Vs= 2.21 + +20 18:18:20 18:18:28 +Riz_sol= 4856.9 + +21 18:18:36 18:18:39 +Rsk= 23.5 Rkk= 20.4 + +22 18:54:47 19:04:51 +P1= 28.5 T1=18:59:51 P2= 42.2 T2=19:04:51 Vs= 2.74 + +22 22:30:34 22:40:39 +P1= 26.7 T1=22:35:39 P2= 29.1 T2=22:40:39 Vs= 0.46 + +23 22:43:12 22:43:18 + + +24 22:43:26 22:44:05 + + +30 22:44:45 22:45:13 +Vst= 29.9 + +31 22:45:25 22:46:25 +Rom_sol= 12.5 + +41 22:47:35 22:47:40 +Ukz= 1.15 + +32 22:47:42 22:48:17 +Imax=11.0 Umax=50.0 T= 9.0 + +33 22:48:23 22:48:44 +Imin=15.9 Umin=25.0 T= 0.5 + +34 22:48:48 22:49:11 +V=300.5 T= 9.4 + +35 22:49:15 22:50:16 +Q= 53.7 T= 9.4 + +36 22:50:24 22:50:59 +P1=0.29 T= 2.9 + +37 22:51:07 22:51:38 +T= 0.9 + +38 22:51:44 22:51:51 +t= 52.4 T= 0.5 + +39 22:52:09 22:52:24 +tcam= 52.3 Tcam= 0.5 tfl= 52.5 Tfl= 0.5 + +40 22:52:30 22:52:37 +t= 53.1 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.113 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.113 new file mode 100644 index 0000000..2943b97 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.113 @@ -0,0 +1,16 @@ +11 02:21:19 1594156879 +12 05:05:05 1594166705 +13 06:47:16 1594172836 +0 06:47:16 1594172836 +14 07:09:35 1594174175 +15 07:37:31 1594175851 +16 07:56:22 1594176982 +1 08:41:32 1594179692 +2 10:34:17 1594186457 +5 15:20:45 1594203645 +6 15:33:06 1594204386 +7 16:10:44 1594206644 +8 18:16:16 1594214176 +25 22:44:42 1594230282 +9 22:53:41 1594230821 +10 23:22:16 1594232536 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.114 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.114 new file mode 100644 index 0000000..fc7f35a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.114 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.116 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.116 new file mode 100644 index 0000000..baa0241 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.116 @@ -0,0 +1,93 @@ +[97] +oper = 11 +begin = 08.07.2020 02:21:19 +norma = 0 +real = 163 + +[98] +oper = 12 +begin = 08.07.2020 05:05:05 +norma = 105 +real = 102 + +[99] +oper = 13 +begin = 08.07.2020 06:47:16 +norma = 45 +real = 22 + +[00] +oper = 14 +begin = 08.07.2020 07:09:35 +norma = 40 +vac_time = 7 +real = 27 + +[01] +oper = 15 +begin = 08.07.2020 07:37:31 +norma = 30 +real = 18 + +[02] +oper = 16 +begin = 08.07.2020 07:56:22 +norma = 40 +real = 45 + +[03] +oper = 1 +begin = 08.07.2020 08:41:32 +norma = 85 +real = 112 + +[04] +oper = 2 +begin = 08.07.2020 10:34:17 +norma = 110 +vac_time = 22 +real = 286 + +[05] +oper = 5 +begin = 08.07.2020 15:20:45 +norma = 25 +real = 12 + +[06] +oper = 6 +begin = 08.07.2020 15:33:06 +norma = 35 +real = 37 + +[07] +oper = 7 +begin = 08.07.2020 16:10:44 +norma = 30 +real = 125 + +[08] +oper = 8 +begin = 08.07.2020 18:16:16 +norma = 40 +vac_time = 8 +real = 268 + +[09] +oper = 25 +begin = 08.07.2020 22:44:42 +norma = 30 +real = 8 + +[10] +oper = 9 +begin = 08.07.2020 22:53:41 +norma = 0 +real = 28 + +[11] +oper = 10 +begin = 08.07.2020 23:22:16 +norma = 0 +real = 220 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.117 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.117 new file mode 100644 index 0000000..447862f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.117 @@ -0,0 +1,44 @@ +02:21:18 1594156878 祭 ० +02:21:19 1594156879 ⪫祭 ॣ '-2'(A) +02:21:20 1594156880 祭 ॣ '-2'(A) +03:11:19 1594159879 ⪫祭 ॣ '-2'(A) +05:05:01 1594166701 ⪫祭 ० (A) +05:05:01 1594166701 ⪫祭 +05:05:01 1594166701 : +05:05:07 1594166707 ⪫祭 ० ' ⮪ 㣨' +05:07:05 1594166825 祭 ० ᪠ +05:09:10 1594166950 ⪫祭 ० ᪠ (A) +05:35:01 1594168501 : 믮 +07:37:10 1594175830 祭 ० ࠧ +07:37:11 1594175831 祭 ० ' ⮪ 㣨' +07:37:12 1594175832 祭 ॣ '-2'(A) +07:56:23 1594176983 ⪫祭 ० ' ⮪ 㣨' +07:56:25 1594176985 ⪫祭 ॣ '-2'(A) +07:57:02 1594177022 祭 ० ᪠ +07:57:23 1594177043 ⪫祭 ० ᪠ +07:57:24 1594177044 祭 ० ᪠ +07:57:33 1594177053 ⪫祭 ० ᪠ +07:57:37 1594177057 祭 ० ᪠ +07:57:48 1594177068 ⪫祭 ० ᪠ +07:57:52 1594177072 祭 ० ᪠ +07:57:59 1594177079 ⪫祭 ० ᪠ (A) +10:40:10 1594186810 : 㦥 +15:33:45 1594204425 祭 ० ᪠ +15:34:00 1594204440 . ⪫祭 ० ᪠ (A) +15:35:14 1594204514 祭 ० ᪠ +15:35:37 1594204537 ⪫祭 ० ᪠ +15:35:40 1594204540 祭 ० ᪠ +15:36:02 1594204562 ⪫祭 ० ᪠ +15:36:05 1594204565 祭 ० ᪠ +15:36:14 1594204574 ⪫祭 ० ᪠ (A) +22:20:27 1594228827 祭 +22:43:28 1594230208 祭 ॣ '-2'(A) +22:44:07 1594230247 ⪫祭 ॣ '-2'(A) +22:45:26 1594230326 祭 +22:46:26 1594230386 ⪫祭 +22:53:24 1594230804 祭 ० ࠧ +22:53:26 1594230806 祭 ० ' ⮪ 㣨' +22:53:43 1594230823 : 믮 +23:10:15 1594231815 祭 ॣ '-2'(A) +23:22:15 1594232535 ⪫祭 ० ࠧ (A) +23:22:16 1594232536 祭 ॣ . 殮 㣨 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.119 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.119 new file mode 100644 index 0000000..326031a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.119 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.120 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.120 new file mode 100644 index 0000000..963849b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.120 @@ -0,0 +1,6 @@ +03:39:29 1594161569 3 14 +04:39:59 1594165199 0 A--32-120-2016 ॢ 0 +05:59:47 1594169987 1 10886 3 37 7 1000 8 8450 10 920 +11:49:26 1594190966 9 8450 +17:08:18 1594210098 1 10886 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 1000 8 8450 9 8450 10 920 11 12 321438 +17:52:28 1594212748 0 A--32-036-2011 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.121 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.121 new file mode 100644 index 0000000..106b3ec Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.121 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.122 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.122 new file mode 100644 index 0000000..d78ed74 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.122 @@ -0,0 +1,72 @@ +21 03:39:45 03:39:49 +Rsk= 12.6 Rkk= 8.6 + +22 03:59:54 04:10:01 +P1= 39.9 T1=04:05:01 P2= 62.8 T2=04:10:01 Vs= 4.57 + +21 06:00:10 06:00:13 +Rsk= 12.4 Rkk= 8.6 + +22 06:40:57 06:56:04 +P1= 50.4 T1=06:51:04 P2= 67.2 T2=06:56:04 Vs= 3.37 + +22 07:10:39 07:25:46 +P1= 41.9 T1=07:20:46 P2= 56.0 T2=07:25:46 Vs= 2.80 + +21 11:51:20 11:51:23 +Rsk= 12.4 Rkk= 8.4 + +20 12:16:32 12:16:40 +Riz_sol= 4974.3 + +22 13:01:08 13:16:15 +P1= 56.0 T1=13:11:15 P2= 74.8 T2=13:16:15 Vs= 3.76 + +22 13:40:10 13:55:17 +P1= 43.3 T1=13:50:17 P2= 58.6 T2=13:55:17 Vs= 3.05 + +22 16:45:17 17:00:24 +P1= 42.3 T1=16:55:24 P2= 55.9 T2=17:00:24 Vs= 2.70 + +23 17:00:32 17:00:37 + + +24 17:00:43 17:01:20 + + +30 17:01:33 17:01:57 +Vst= 31.2 + +31 17:02:01 17:02:34 +Rom_sol= 13.9 + +41 17:03:17 17:03:22 +Ukz= 0.69 + +32 17:03:25 17:03:59 +Imax=27.0 Umax=55.0 T= 9.0 + +33 17:04:03 17:04:21 +Imin=16.0 Umin=24.9 T= 0.5 + +34 17:04:26 17:04:49 +V=300.4 T= 9.4 + +35 17:04:51 17:05:48 +Q= 53.5 T= 9.4 + +36 17:05:54 17:06:26 +P1=0.29 T= 2.9 + +37 17:06:31 17:07:00 +T= 0.9 + +38 17:07:05 17:07:12 +t= 53.4 T= 0.4 + +39 17:07:16 17:07:30 +tcam= 53.0 Tcam= 0.5 tfl= 53.2 Tfl= 0.5 + +40 17:07:34 17:07:41 +t= 52.1 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.123 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.123 new file mode 100644 index 0000000..4f5f359 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.123 @@ -0,0 +1,16 @@ +12 00:54:03 1594151643 +13 03:01:00 1594159260 +0 03:01:00 1594159260 +14 03:37:36 1594161456 +15 04:11:10 1594163470 +16 04:44:34 1594165474 +1 05:21:05 1594167665 +2 05:56:56 1594169816 +5 07:30:06 1594175406 +6 07:42:36 1594176156 +7 08:22:17 1594178537 +8 11:44:29 1594190669 +25 17:01:27 1594209687 +9 17:08:18 1594210098 +10 17:52:29 1594212749 +11 22:00:03 1594227603 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.124 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.124 new file mode 100644 index 0000000..22a6dbc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.124 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.125 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.125 new file mode 100644 index 0000000..2c53d65 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.125 @@ -0,0 +1 @@ +17 11:53:11 1594191191 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.126 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.126 new file mode 100644 index 0000000..0c0f852 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.126 @@ -0,0 +1,93 @@ +[98] +oper = 12 +begin = 08.07.2020 00:54:03 +norma = 105 +real = 126 + +[99] +oper = 13 +begin = 08.07.2020 03:01:00 +norma = 45 +real = 36 + +[00] +oper = 14 +begin = 08.07.2020 03:37:36 +norma = 40 +vac_time = 7 +real = 33 + +[01] +oper = 15 +begin = 08.07.2020 04:11:10 +norma = 30 +real = 33 + +[02] +oper = 16 +begin = 08.07.2020 04:44:34 +norma = 40 +real = 36 + +[03] +oper = 1 +begin = 08.07.2020 05:21:05 +norma = 85 +real = 35 + +[04] +oper = 2 +begin = 08.07.2020 05:56:56 +norma = 110 +vac_time = 7 +real = 93 + +[05] +oper = 5 +begin = 08.07.2020 07:30:06 +norma = 25 +real = 12 + +[06] +oper = 6 +begin = 08.07.2020 07:42:36 +norma = 35 +real = 39 + +[07] +oper = 7 +begin = 08.07.2020 08:22:17 +norma = 30 +real = 202 + +[08] +oper = 8 +begin = 08.07.2020 11:44:29 +norma = 40 +vac_time = 33 +real = 316 + +[09] +oper = 25 +begin = 08.07.2020 17:01:27 +norma = 30 +real = 6 + +[10] +oper = 9 +begin = 08.07.2020 17:08:18 +norma = 0 +real = 44 + +[11] +oper = 10 +begin = 08.07.2020 17:52:29 +norma = 0 +real = 247 + +[12] +oper = 11 +begin = 08.07.2020 22:00:03 +norma = 0 +real = 249 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.127 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.127 new file mode 100644 index 0000000..9f1aa28 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.127 @@ -0,0 +1,57 @@ +00:54:08 1594151648 ⪫祭 ॣ '-2'(A) +00:55:00 1594151700 祭 ० ᪠ +00:55:01 1594151701 祭 ० ᪠ +00:55:01 1594151701 祭 ० ᪠ +00:55:01 1594151701 祭 ० ᪠ +00:55:01 1594151701 祭 ० ᪠ +00:55:02 1594151702 祭 ० ᪠ +00:55:02 1594151702 祭 ० ᪠ +00:55:02 1594151702 祭 ० ᪠ +00:55:03 1594151703 祭 ० ᪠ +00:57:26 1594151846 ⪫祭 ० ᪠ (A) +04:10:45 1594163445 祭 ० ࠧ +04:10:47 1594163447 祭 ० ' ⮪ 㣨' +04:12:22 1594163542 祭 ॣ '-2'(A) +04:39:59 1594165199 ⪫祭 ० ࠧ (A) +04:44:36 1594165476 ⪫祭 ० ' ⮪ 㣨' +04:44:38 1594165478 ⪫祭 ॣ '-2'(A) +04:45:00 1594165500 祭 ० ᪠ +04:45:01 1594165501 祭 ० ᪠ +04:45:01 1594165501 祭 ० ᪠ +04:45:01 1594165501 祭 ० ᪠ +04:45:01 1594165501 祭 ० ᪠ +04:45:02 1594165502 祭 ० ᪠ +04:45:34 1594165534 ⪫祭 ० ᪠ +04:45:38 1594165538 祭 ० ᪠ +04:46:08 1594165568 ⪫祭 ० ᪠ +04:46:10 1594165570 祭 ० ᪠ +04:46:47 1594165607 ⪫祭 ० ᪠ +04:46:50 1594165610 祭 ० ᪠ +04:46:53 1594165613 . ⪫祭 ० ᪠ (A) +04:47:04 1594165624 祭 ० ᪠ +04:47:05 1594165625 祭 ० ᪠ +04:47:17 1594165637 ⪫祭 ० ᪠ +04:47:20 1594165640 祭 ० ᪠ +04:47:29 1594165649 ⪫祭 ० ᪠ +04:47:30 1594165650 祭 ० ᪠ +04:47:36 1594165656 ⪫祭 ० ᪠ (A) +07:43:37 1594176217 祭 ० ᪠ +07:43:37 1594176217 祭 ० ᪠ +07:44:51 1594176291 ⪫祭 ० ᪠ +07:44:53 1594176293 祭 ० ᪠ +07:45:03 1594176303 ⪫祭 ० ᪠ +07:45:05 1594176305 祭 ० ᪠ +07:45:13 1594176313 ⪫祭 ० ᪠ +07:45:15 1594176315 祭 ० ᪠ +07:45:19 1594176319 ⪫祭 ० ᪠ +17:00:42 1594209642 祭 ॣ '-2'(A) +17:01:18 1594209678 ⪫祭 ॣ '-2'(A) +17:07:53 1594210073 祭 ० ࠧ +17:07:54 1594210074 祭 ० ' ⮪ 㣨' +17:10:32 1594210232 祭 ॣ '-2'(A) +17:52:28 1594212748 ⪫祭 ० ࠧ (A) +17:52:29 1594212749 祭 ⠭ ॣ +22:00:02 1594227602 祭 ० +22:00:02 1594227602 ⪫祭 ॣ '-2'(A) +22:00:03 1594227603 祭 ॣ '-2'(A) +23:09:03 1594231743 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.129 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.129 new file mode 100644 index 0000000..bb3b592 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.129 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.150 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.150 new file mode 100644 index 0000000..cf2b1ae --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.150 @@ -0,0 +1,6 @@ +02:40:09 1594158009 3 14 +11:21:36 1594189296 1 05003 3 32 9 3570 +17:46:03 1594212363 6 +17:48:50 1594212530 1 05003 2 OT-4 3 32 4 2 5 Ti 6 7 770 8 3000 9 3570 10 670 11 12 320995 +18:17:39 1594214259 0 A--32-050-2012 ॢ 1 +22:33:07 1594229587 6 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.151 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.151 new file mode 100644 index 0000000..ff811cc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.151 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.152 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.152 new file mode 100644 index 0000000..bade8ae --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.152 @@ -0,0 +1,66 @@ +21 02:40:22 02:40:25 +Rsk= 48.4 Rkk= 20.1 + +22 02:59:11 03:09:26 +P1= 20.1 T1=03:04:26 P2= 36.7 T2=03:09:26 Vs= 3.31 + +21 11:22:06 11:22:09 +Rsk= 49.0 Rkk= 20.4 + +22 12:05:31 12:20:47 +P1= 36.4 T1=12:15:47 P2= 47.1 T2=12:20:47 Vs= 2.12 + +20 14:08:54 14:09:03 +Riz_sol= 843.7 + +21 14:09:12 14:09:15 +Rsk= 23.5 Rkk= 20.2 + +22 14:49:53 15:05:08 +P1= 35.1 T1=15:00:08 P2= 45.2 T2=15:05:08 Vs= 2.03 + +22 17:25:05 17:35:20 +P1= 10.3 T1=17:30:20 P2= 18.2 T2=17:35:20 Vs= 1.58 + +23 17:35:43 17:35:48 + + +24 17:35:57 17:36:34 + + +30 17:36:48 17:37:25 +Vst= 47.7 + +31 17:37:35 17:38:10 +Rom_sol= 11.4 + +41 17:40:39 17:40:44 +Ukz= 1.09 + +32 17:40:49 17:41:28 +Imax=26.9 Umax=55.0 T= 9.0 + +33 17:41:33 17:41:58 +Imin=15.9 Umin=25.0 T= 0.5 + +34 17:42:04 17:42:28 +V=300.1 T= 9.8 + +35 17:42:32 17:43:40 +Q= 42.7 T= 9.8 + +36 17:43:45 17:44:22 +P1=0.29 T= 3.3 + +37 17:44:33 17:44:53 +T= 1.3 + +38 17:44:58 17:45:12 +t= 53.5 T= 1.0 + +39 17:45:16 17:45:26 +t= 53.2 T= 1.0 + +40 17:45:30 17:45:40 +t= 52.1 T= 0.9 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.153 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.153 new file mode 100644 index 0000000..08f82fb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.153 @@ -0,0 +1,16 @@ +13 02:04:21 1594155861 +0 02:04:21 1594155861 +14 02:28:29 1594157309 +15 07:04:39 1594173879 +16 07:20:37 1594174837 +1 08:30:30 1594179030 +2 11:20:18 1594189218 +5 12:21:27 1594192887 +6 12:32:31 1594193551 +7 13:12:30 1594195950 +8 14:08:32 1594199312 +25 17:36:44 1594211804 +9 17:48:50 1594212530 +10 18:17:39 1594214259 +11 20:30:52 1594222252 +12 22:30:59 1594229459 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.154 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.154 new file mode 100644 index 0000000..0f1f492 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.154 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.156 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.156 new file mode 100644 index 0000000..b3c588d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.156 @@ -0,0 +1,93 @@ +[49] +oper = 13 +begin = 08.07.2020 02:04:21 +norma = 45 +real = 24 + +[50] +oper = 14 +begin = 08.07.2020 02:28:29 +norma = 40 +vac_time = 12 +real = 276 + +[51] +oper = 15 +begin = 08.07.2020 07:04:39 +norma = 30 +real = 15 + +[52] +oper = 16 +begin = 08.07.2020 07:20:37 +norma = 40 +real = 69 + +[53] +oper = 1 +begin = 08.07.2020 08:30:30 +norma = 85 +real = 169 + +[54] +oper = 2 +begin = 08.07.2020 11:20:18 +norma = 110 +vac_time = 10 +real = 61 + +[55] +oper = 5 +begin = 08.07.2020 12:21:27 +norma = 25 +real = 11 + +[56] +oper = 6 +begin = 08.07.2020 12:32:31 +norma = 35 +real = 39 + +[57] +oper = 7 +begin = 08.07.2020 13:12:30 +norma = 30 +real = 56 + +[58] +oper = 8 +begin = 08.07.2020 14:08:32 +norma = 40 +vac_time = 9 +real = 208 + +[59] +oper = 25 +begin = 08.07.2020 17:36:44 +norma = 30 +real = 12 + +[60] +oper = 9 +begin = 08.07.2020 17:48:50 +norma = 0 +real = 28 + +[61] +oper = 10 +begin = 08.07.2020 18:17:39 +norma = 0 +real = 133 + +[62] +oper = 11 +begin = 08.07.2020 20:30:52 +norma = 115 +real = 120 + +[63] +oper = 12 +begin = 08.07.2020 22:30:59 +norma = 105 +real = 106 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.157 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.157 new file mode 100644 index 0000000..7a907fe --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.157 @@ -0,0 +1,28 @@ +07:04:22 1594173862 祭 ० ࠧ +07:04:26 1594173866 祭 ० ' ⮪ 㣨' +07:05:07 1594173907 祭 ॣ '-2'(A) +07:20:05 1594174805 ⪫祭 ० ' ⮪ 㣨' +07:20:41 1594174841 ⪫祭 ० ࠧ +07:20:41 1594174841 ⪫祭 ॣ '-2'(A) +07:21:26 1594174886 祭 ० ᪠ +07:24:08 1594175048 ⪫祭 ० ᪠ (A) +12:31:59 1594193519 祭 ० ᪠ +12:34:40 1594193680 ⪫祭 ० ᪠ (A) +17:35:57 1594211757 祭 ॣ '-2'(A) +17:36:34 1594211794 ⪫祭 ॣ '-2'(A) +17:48:19 1594212499 祭 ० ࠧ +17:48:22 1594212502 祭 ० ' ⮪ 㣨' +18:14:38 1594214078 祭 ॣ '-2'(A) +18:15:24 1594214124 ⪫祭 ० ᪠ (A) +18:17:39 1594214259 ⪫祭 ० ࠧ (A) +18:17:39 1594214259 祭 ⠭ ॣ +20:30:51 1594222251 祭 ० +20:30:52 1594222252 ⪫祭 ॣ '-2'(A) +20:30:53 1594222253 祭 ॣ '-2'(A) +21:04:55 1594224295 祭 ० +21:05:02 1594224302 ⪫祭 ॣ '-2'(A) +22:30:51 1594229451 ⪫祭 ० (A) +22:30:53 1594229453 ⪫祭 ० ' ⮪ 㣨' +22:36:09 1594229769 祭 ० ᪠ +22:36:10 1594229770 祭 ० ᪠ +22:39:39 1594229979 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.159 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.159 new file mode 100644 index 0000000..19fdfd8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.159 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.160 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.160 new file mode 100644 index 0000000..93ce13d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.160 @@ -0,0 +1,4 @@ +01:14:10 1594152850 1 05368 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 770 8 3000 9 4900 10 670 11 12 320507 +01:47:43 1594154863 0 A--32-006-2018 ॢ 4 +09:47:54 1594183674 3 14 +19:12:46 1594217566 1 05369 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 7 670 8 5240 9 5060 10 560 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.161 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.161 new file mode 100644 index 0000000..a31175b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.161 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.162 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.162 new file mode 100644 index 0000000..527e0fe --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.162 @@ -0,0 +1,81 @@ +22 00:47:19 00:57:24 +P1= 16.0 T1=00:52:24 P2= 22.9 T2=00:57:24 Vs= 1.39 + +23 00:57:29 00:57:34 + + +24 00:57:45 00:58:22 + + +30 00:58:35 00:58:58 +Vst= 33.0 + +31 00:59:03 00:59:36 +Rom_sol= 14.2 + +41 01:00:03 01:00:08 +Ukz= 0.57 + +32 01:00:14 01:00:48 +Imax=27.3 Umax=55.1 T= 9.0 + +33 01:00:54 01:01:11 +Imin=16.3 Umin=25.0 T= 0.5 + +34 01:01:21 01:01:45 +V=300.4 T= 9.6 + +35 01:01:52 01:02:55 +Q= 52.2 T= 9.6 + +36 01:03:00 01:03:31 +P1=0.29 T= 3.1 + +37 01:03:35 01:04:00 +T= 1.1 + +38 01:04:04 01:04:10 +t= 52.9 T= 0.9 + +39 01:04:13 01:04:27 +tcam= 55.7 Tcam= 0.9 tfl= 55.7 Tfl= 1.1 + +40 01:04:32 01:04:33 +t= 56.8 T= 1.1 + +40 01:04:44 01:04:46 +t= 56.9 T= 1.1 + +40 01:05:00 01:05:01 +t= 56.8 T= 1.1 + +40 01:06:13 01:06:14 +t= 56.7 T= 1.1 + +40 01:06:22 01:06:23 +t= 56.9 T= 1.1 + +40 01:06:26 01:06:27 +t= 53.6 T= 1.1 + +40 01:08:59 01:09:01 +t= 56.7 T= 1.1 + +40 01:09:19 01:09:20 +t= 48.7 T= 1.1 + +40 01:11:44 01:11:50 +t= 53.8 T= 0.9 + +21 09:48:09 09:48:12 +Rsk= 48.4 Rkk= 20.7 + +22 10:22:31 10:32:36 +P1= 18.5 T1=10:27:36 P2= 29.1 T2=10:32:36 Vs= 2.14 + +21 19:11:19 19:11:22 +Rsk= 48.1 Rkk= 21.6 + +22 19:59:23 20:14:28 +P1= 43.8 T1=20:09:28 P2= 58.5 T2=20:14:28 Vs= 2.94 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.163 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.163 new file mode 100644 index 0000000..1272484 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.163 @@ -0,0 +1,14 @@ +25 00:58:30 1594151910 +9 01:14:10 1594152850 +10 01:47:44 1594154864 +11 04:03:38 1594163018 +12 06:52:47 1594173167 +13 08:46:41 1594180001 +0 08:46:41 1594180001 +14 09:47:43 1594183663 +15 10:40:31 1594186831 +16 11:08:01 1594188481 +1 12:15:22 1594192522 +2 19:08:55 1594217335 +5 22:38:45 1594229925 +6 22:50:05 1594230605 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.164 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.164 new file mode 100644 index 0000000..4167f62 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.164 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.165 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.165 new file mode 100644 index 0000000..1832ef5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.165 @@ -0,0 +1,13 @@ +46 00:03:23 1594148603 +46 00:03:25 1594148605 +46 00:34:24 1594150464 +46 00:34:30 1594150470 +55 01:04:32 1594152272 +55 01:04:45 1594152285 +55 01:05:00 1594152300 +55 01:06:13 1594152373 +55 01:06:22 1594152382 +55 01:06:27 1594152387 +47 01:08:41 1594152521 +55 01:09:00 1594152540 +55 01:09:19 1594152559 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.166 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.166 new file mode 100644 index 0000000..db27727 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.166 @@ -0,0 +1,80 @@ +[41] +oper = 25 +begin = 08.07.2020 00:58:30 +norma = 30 +real = 15 + +[42] +oper = 9 +begin = 08.07.2020 01:14:10 +norma = 0 +real = 33 + +[43] +oper = 10 +begin = 08.07.2020 01:47:44 +norma = 0 +real = 135 + +[44] +oper = 11 +begin = 08.07.2020 04:03:38 +norma = 0 +real = 169 + +[45] +oper = 12 +begin = 08.07.2020 06:52:47 +norma = 105 +real = 113 + +[46] +oper = 13 +begin = 08.07.2020 08:46:41 +norma = 45 +real = 61 + +[47] +oper = 14 +begin = 08.07.2020 09:47:43 +norma = 40 +vac_time = 7 +real = 52 + +[48] +oper = 15 +begin = 08.07.2020 10:40:31 +norma = 30 +real = 27 + +[49] +oper = 16 +begin = 08.07.2020 11:08:01 +norma = 40 +real = 67 + +[50] +oper = 1 +begin = 08.07.2020 12:15:22 +norma = 85 +real = 413 + +[51] +oper = 2 +begin = 08.07.2020 19:08:55 +norma = 110 +vac_time = 9 +real = 209 + +[52] +oper = 5 +begin = 08.07.2020 22:38:45 +norma = 25 +real = 11 + +[53] +oper = 6 +begin = 08.07.2020 22:50:05 +norma = 35 +real = 76 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.167 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.167 new file mode 100644 index 0000000..3659405 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.167 @@ -0,0 +1,27 @@ +00:57:46 1594151866 祭 ॣ '-2'(A) +00:58:22 1594151902 ⪫祭 ॣ '-2'(A) +01:13:33 1594152813 祭 ० ࠧ +01:13:36 1594152816 祭 ० ' ⮪ 㣨' +01:33:40 1594154020 祭 ॣ '-2'(A) +01:47:43 1594154863 ⪫祭 ० ࠧ (A) +01:47:44 1594154864 祭 ⠭ ॣ +04:03:38 1594163018 祭 ० +04:03:38 1594163018 ⪫祭 ॣ '-2'(A) +04:03:40 1594163020 祭 ॣ '-2'(A) +05:05:40 1594166740 ⪫祭 ॣ '-2'(A) +06:52:45 1594173165 ⪫祭 ० (A) +06:52:49 1594173169 ⪫祭 ० ' ⮪ 㣨' +06:53:36 1594173216 祭 ० ᪠ +06:53:36 1594173216 祭 ० ᪠ +06:53:36 1594173216 祭 ० ᪠ +06:56:00 1594173360 ⪫祭 ० ᪠ (A) +10:40:17 1594186817 祭 ० ࠧ +10:40:20 1594186820 祭 ० ' ⮪ 㣨' +10:40:29 1594186829 祭 ॣ '-2'(A) +10:54:44 1594187684 ⪫祭 ० ' ⮪ 㣨' +11:08:04 1594188484 ⪫祭 ॣ '-2'(A) +11:08:14 1594188494 祭 ० ᪠ +11:10:35 1594188635 ⪫祭 ० ᪠ (A) +22:53:20 1594230800 祭 ० ᪠ +22:53:20 1594230800 祭 ० ᪠ +22:55:49 1594230949 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.169 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.169 new file mode 100644 index 0000000..d21218a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.169 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.170 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.170 new file mode 100644 index 0000000..7e110a7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.170 @@ -0,0 +1,7 @@ +02:38:38 1594157918 1 09245 4 3 9 3300 10 705 +06:53:15 1594173195 1 09245 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 3 5 Ti 6 7 770 8 4460 9 3300 10 705 11 12 321173 +10:44:12 1594187052 1 09246 +12:18:53 1594192733 1 09246 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 3 5 Ti 6 7 770 8 4460 9 3300 10 705 11 12 321173 +12:47:46 1594194466 0 A--32-029-2014 ॢ 2 +20:38:52 1594222732 3 14 +21:54:08 1594227248 0 A--32-067-2014 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.171 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.171 new file mode 100644 index 0000000..9595f7f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.171 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.172 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.172 new file mode 100644 index 0000000..a0d4ae7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.172 @@ -0,0 +1,135 @@ +21 02:38:49 02:38:57 +Rsk= 13.7 Rkk= 8.1 + +22 02:59:39 03:15:11 +P1= 55.8 T1=03:10:11 P2= 74.6 T2=03:15:11 Vs= 3.76 + +22 03:39:39 03:55:11 +P1= 33.5 T1=03:50:11 P2= 44.7 T2=03:55:11 Vs= 2.24 + +20 05:17:44 05:17:54 +Riz_sol=10711.2 + +21 05:19:31 05:19:39 +Rsk= 13.6 Rkk= 8.0 + +22 06:00:05 06:15:37 +P1= 39.9 T1=06:10:37 P2= 51.0 T2=06:15:37 Vs= 2.23 + +24 06:17:15 06:17:52 + + +23 06:18:01 06:18:07 + + +30 06:18:21 06:19:01 +Vst= 28.8 + +31 06:19:06 06:19:44 +Rom_sol= 10.4 + +22 06:30:01 06:40:34 +P1= 16.9 T1=06:35:34 P2= 31.4 T2=06:40:34 Vs= 2.89 + +24 06:43:48 06:44:27 + + +23 06:44:35 06:44:41 + + +30 06:45:02 06:45:44 +Vst= 28.7 + +31 06:45:48 06:46:23 +Rom_sol= 10.4 + +41 06:46:41 06:46:46 +Ukz= 0.85 + +32 06:46:50 06:47:59 +Imax=10.8 Umax=49.9 T= 9.4 + +33 06:48:03 06:48:32 +Imin=16.0 Umin=25.0 T= 0.8 + +34 06:48:35 06:49:03 +V=301.2 T= 9.5 + +35 06:49:09 06:50:21 +Q= 54.8 T= 9.1 + +36 06:50:26 06:51:01 +P1=0.29 T= 3.2 + +37 06:51:09 06:51:43 +T= 0.7 + +38 06:51:47 06:51:53 +t= 51.5 T= 0.5 + +39 06:51:56 06:52:02 +t= 51.4 T= 0.5 + +40 06:52:05 05:00:00 +t= 51.4 T= 0.8 + +20 10:43:52 10:44:01 +Riz_sol=11141.1 + +21 10:44:22 10:44:29 +Rsk= 13.8 Rkk= 8.3 + +22 11:14:23 11:29:55 +P1= 48.8 T1=11:24:55 P2= 65.0 T2=11:29:55 Vs= 3.25 + +22 11:40:23 11:55:55 +P1= 37.4 T1=11:50:55 P2= 49.0 T2=11:55:55 Vs= 2.33 + +23 11:56:03 11:56:09 + + +24 11:56:16 11:56:54 + + +30 11:57:08 11:57:47 +Vst= 28.9 + +31 11:57:51 11:58:29 +Rom_sol= 10.4 + +41 12:13:06 12:13:11 +Ukz= 1.23 + +32 12:13:14 12:14:22 +Imax=10.8 Umax=49.9 T= 9.4 + +33 12:14:26 12:14:54 +Imin=16.0 Umin=25.2 T= 1.0 + +34 12:14:58 12:15:27 +V=301.2 T= 9.6 + +35 12:15:30 12:16:50 +Q= 54.7 T= 9.3 + +36 12:16:54 12:17:29 +P1=0.27 T= 3.0 + +37 12:17:32 12:18:07 +T= 0.7 + +38 12:18:10 12:18:16 +t= 51.5 T= 0.7 + +39 12:18:19 12:18:26 +t= 51.4 T= 0.7 + +40 12:18:28 12:18:34 +t= 51.4 T= 0.7 + +21 20:39:28 20:39:36 +Rsk= 13.6 Rkk= 8.0 + +22 21:04:20 21:14:51 +P1= 15.3 T1=21:09:51 P2= 34.7 T2=21:14:51 Vs= 3.87 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.173 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.173 new file mode 100644 index 0000000..d2d0118 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.173 @@ -0,0 +1,23 @@ +2 02:26:50 1594157210 +5 03:56:19 1594162579 +6 04:10:06 1594163406 +7 04:44:28 1594165468 +8 05:15:04 1594167304 +25 06:18:17 1594171097 +9 06:53:15 1594173195 +8 07:14:14 1594174454 +13 08:25:07 1594178707 +8 10:30:25 1594186225 +00 11:51:06 1594191066 +25 11:57:04 1594191424 +9 12:18:53 1594192733 +10 12:47:47 1594194467 +11 15:26:37 1594203997 +12 18:16:41 1594214201 +13 20:07:45 1594220865 +0 20:07:45 1594220865 +14 20:38:10 1594222690 +15 21:16:06 1594224966 +16 21:54:09 1594227249 +16 21:58:08 1594227488 +1 22:42:52 1594230172 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.174 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.174 new file mode 100644 index 0000000..320964c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.174 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.175 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.175 new file mode 100644 index 0000000..bf1ac32 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.175 @@ -0,0 +1 @@ +17 20:39:19 1594222759 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.176 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.176 new file mode 100644 index 0000000..5498e94 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.176 @@ -0,0 +1,131 @@ +[79] +oper = 2 +begin = 08.07.2020 02:26:50 +norma = 110 +vac_time = 8 +real = 89 + +[80] +oper = 5 +begin = 08.07.2020 03:56:19 +norma = 25 +real = 13 + +[81] +oper = 6 +begin = 08.07.2020 04:10:06 +norma = 35 +real = 34 + +[82] +oper = 7 +begin = 08.07.2020 04:44:28 +norma = 30 +real = 30 + +[83] +oper = 8 +begin = 08.07.2020 05:15:04 +norma = 40 +vac_time = 7 +vac_avg10 = 7.6 +real = 63 + +[84] +oper = 25 +begin = 08.07.2020 06:18:17 +norma = 30 +real = 34 + +[85] +oper = 9 +begin = 08.07.2020 06:53:15 +norma = 0 +real = 20 + +[86] +oper = 8 +begin = 08.07.2020 07:14:14 +norma = 40 +real = 70 + +[87] +oper = 13 +begin = 08.07.2020 08:25:07 +norma = 45 +real = 125 + +[88] +oper = 8 +begin = 08.07.2020 10:30:25 +norma = 40 +vac_time = 14 +real = 86 + +[89] +oper = 25 +begin = 08.07.2020 11:57:04 +norma = 30 +real = 21 + +[90] +oper = 9 +begin = 08.07.2020 12:18:53 +norma = 0 +real = 28 + +[91] +oper = 10 +begin = 08.07.2020 12:47:47 +norma = 0 +real = 158 + +[92] +oper = 11 +begin = 08.07.2020 15:26:37 +norma = 0 +real = 170 + +[93] +oper = 12 +begin = 08.07.2020 18:16:41 +norma = 105 +real = 111 + +[94] +oper = 13 +begin = 08.07.2020 20:07:45 +norma = 45 +real = 30 + +[95] +oper = 14 +begin = 08.07.2020 20:38:10 +norma = 40 +vac_time = 6 +real = 37 + +[96] +oper = 15 +begin = 08.07.2020 21:16:06 +norma = 30 +real = 38 + +[97] +oper = 16 +begin = 08.07.2020 21:54:09 +norma = 40 +real = 3 + +[98] +oper = 16 +begin = 08.07.2020 21:58:08 +norma = 40 +real = 44 + +[99] +oper = 1 +begin = 08.07.2020 22:42:52 +norma = 85 +real = 189 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.177 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.177 new file mode 100644 index 0000000..58bb9e5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.177 @@ -0,0 +1,42 @@ +04:10:18 1594163418 祭 ० ᪠ +04:10:18 1594163418 祭 ० ᪠ +04:10:19 1594163419 祭 ० ᪠ +04:13:23 1594163603 ⪫祭 ० ᪠ (A) +06:17:17 1594171037 祭 ॣ '-2'(A) +06:17:53 1594171073 ⪫祭 ॣ '-2'(A) +06:43:50 1594172630 祭 ॣ '-2'(A) +06:44:28 1594172668 ⪫祭 ॣ '-2'(A) +06:52:19 1594173139 祭 ० ࠧ +06:52:20 1594173140 祭 ० ' ⮪ 㣨' +07:12:56 1594174376 祭 ॣ '-2'(A) +07:13:05 1594174385 ⪫祭 ० ' ⮪ 㣨' +07:13:17 1594174397 ⪫祭 ॣ '-2'(A) +07:13:36 1594174416 祭 ० ᪠ +07:13:36 1594174416 祭 ० ᪠ +07:13:36 1594174416 祭 ० ᪠ +07:13:36 1594174416 祭 ० ᪠ +07:13:36 1594174416 祭 ० ᪠ +07:16:42 1594174602 ⪫祭 ० ᪠ (A) +11:56:18 1594191378 祭 ॣ '-2'(A) +11:56:55 1594191415 ⪫祭 ॣ '-2'(A) +12:18:41 1594192721 祭 ० ࠧ +12:18:42 1594192722 祭 ० ' ⮪ 㣨' +12:38:47 1594193927 祭 ॣ '-2'(A) +12:47:46 1594194466 ⪫祭 ० ࠧ (A) +12:47:47 1594194467 祭 ⠭ ॣ +15:26:37 1594203997 祭 ० +15:26:37 1594203997 ⪫祭 ॣ '-2'(A) +15:26:38 1594203998 祭 ॣ '-2'(A) +18:16:37 1594214197 ⪫祭 ० (A) +18:16:43 1594214203 ⪫祭 ० ' ⮪ 㣨' +18:16:45 1594214205 ⪫祭 ॣ '-2'(A) +18:18:16 1594214296 祭 ० ᪠ +18:21:24 1594214484 ⪫祭 ० ᪠ (A) +21:15:15 1594224915 祭 ० ࠧ +21:15:17 1594224917 祭 ० ' ⮪ 㣨' +21:16:44 1594225004 祭 ॣ '-2'(A) +21:54:08 1594227248 ⪫祭 ० ࠧ (A) +21:58:09 1594227489 ⪫祭 ० ' ⮪ 㣨' +21:58:12 1594227492 ⪫祭 ॣ '-2'(A) +21:58:29 1594227509 祭 ० ᪠ +22:01:39 1594227699 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.179 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.179 new file mode 100644 index 0000000..443b327 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.179 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.210 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.210 new file mode 100644 index 0000000..ff2c814 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.210 @@ -0,0 +1,3 @@ +17:50:29 1594212629 12 320279 +18:39:17 1594215557 1 07196 2 p. cao M1,M2,M3,M4 3 30 4 1 5 Ti 6 7 920 8 5310 9 8360 10 750 11 12 320279 +18:51:14 1594216274 1 07196 2 p. cao M1,M2,M3,M4 3 30 4 1 5 Ti 6 7 920 8 5310 9 8360 10 750 11 12 320279 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.211 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.211 new file mode 100644 index 0000000..5056300 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.211 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.212 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.212 new file mode 100644 index 0000000..90208c2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.212 @@ -0,0 +1,84 @@ +20 13:17:26 13:17:35 +Riz_sol= 4971.1 + +21 13:17:43 13:17:46 +Rsk= 11.9 Rkk= 7.6 + +20 16:38:09 16:38:18 +Riz_sol= 4972.0 + +21 16:38:25 16:38:28 +Rsk= 12.2 Rkk= 7.7 + +22 17:36:46 17:46:50 +P1= 52.7 T1=17:41:50 P2= 58.1 T2=17:46:50 Vs= 1.08 + +23 17:48:42 17:48:47 + + +24 17:50:34 17:51:11 + + +30 17:51:26 17:51:52 +Vst= 30.5 + +31 17:52:03 17:52:40 +Rom_sol= 18.5 + +32 18:14:11 18:14:47 +Imax=26.8 Umax=55.0 T= 9.0 + +33 18:14:50 18:15:10 +Imin=15.9 Umin=25.0 T= 0.5 + +34 18:15:12 18:15:35 +V=300.2 T= 9.6 + +35 18:15:38 18:16:36 +Q= 54.6 T= 9.6 + +22 18:17:07 18:27:11 +P1= 42.6 T1=18:22:11 P2= 46.6 T2=18:27:11 Vs= 0.81 + +23 18:30:17 18:30:23 + + +24 18:30:35 18:31:12 + + +30 18:31:22 18:31:48 +Vst= 30.2 + +31 18:31:55 18:32:39 +Rom_sol= 18.6 + +32 18:33:19 18:33:56 +Imax=26.9 Umax=55.0 T= 9.0 + +33 18:33:58 18:34:21 +Imin=15.9 Umin=24.9 T= 0.5 + +34 18:34:25 18:34:47 +V=300.2 T= 9.6 + +35 18:34:51 18:35:49 +Q= 54.3 T= 9.6 + +36 18:35:54 18:36:27 +P1=0.30 T= 3.1 + +37 18:36:32 18:37:01 +T= 1.1 + +38 18:37:04 18:37:11 +t= 51.7 T= 0.7 + +39 18:37:14 18:37:37 +tcam= 51.3 Tcam= 0.7 tfl= 64.7 Tfl= 0.7 + +40 18:37:41 18:37:49 +t= 52.0 T= 0.7 + +40 18:37:56 18:38:04 +t= 55.5 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.213 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.213 new file mode 100644 index 0000000..9960a29 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.213 @@ -0,0 +1,10 @@ +7 08:42:45 1594179765 +8 12:35:55 1594193755 +13 15:18:32 1594203512 +8 16:37:43 1594208263 +25 17:51:24 1594212684 +25 18:31:19 1594215079 +9 18:39:17 1594215557 +8 18:47:41 1594216061 +9 18:51:14 1594216274 +10 19:15:11 1594217711 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.214 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.214 new file mode 100644 index 0000000..5ccc71c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.214 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.215 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.215 new file mode 100644 index 0000000..5825ab9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.215 @@ -0,0 +1 @@ +47 18:37:49 1594215469 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.216 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.216 new file mode 100644 index 0000000..132cc53 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.216 @@ -0,0 +1,61 @@ +[98] +oper = 7 +begin = 08.07.2020 08:42:45 +norma = 30 +real = 233 + +[99] +oper = 8 +begin = 08.07.2020 12:35:55 +norma = 40 +real = 162 + +[00] +oper = 13 +begin = 08.07.2020 15:18:32 +norma = 45 +real = 79 + +[01] +oper = 8 +begin = 08.07.2020 16:37:43 +norma = 40 +vac_time = 9 +real = 73 + +[02] +oper = 25 +begin = 08.07.2020 17:51:24 +norma = 30 +real = 39 + +[03] +oper = 25 +begin = 08.07.2020 18:31:19 +norma = 30 +real = 7 + +[04] +oper = 9 +begin = 08.07.2020 18:39:17 +norma = 0 +real = 8 + +[05] +oper = 8 +begin = 08.07.2020 18:47:41 +norma = 40 +real = 3 + +[06] +oper = 9 +begin = 08.07.2020 18:51:14 +norma = 0 +real = 23 + +[07] +oper = 10 +begin = 08.07.2020 19:15:11 +norma = 0 +real = 336 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.217 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.217 new file mode 100644 index 0000000..dbd0271 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.217 @@ -0,0 +1,8 @@ +08:32:56 1594179176 祭 ० ' ⮪ 㣨' +08:32:57 1594179177 ⪫祭 ० ' ⮪ 㣨' +17:50:37 1594212637 祭 ॣ '-2'(A) +17:51:12 1594212672 ⪫祭 ॣ '-2'(A) +18:30:37 1594215037 祭 ॣ '-2'(A) +18:31:12 1594215072 ⪫祭 ॣ '-2'(A) +19:14:34 1594217674 祭 ॣ '-2' +19:15:10 1594217710 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.219 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.219 new file mode 100644 index 0000000..acf4afa Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.219 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.230 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.230 new file mode 100644 index 0000000..07482fd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.230 @@ -0,0 +1,5 @@ +10:45:43 1594187143 3 14 +12:19:04 1594192744 0 A--32-120-2016 ॢ 0 +13:54:55 1594198495 1 06889 3 37 9 5286 +22:58:33 1594231113 1 06889 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 37 4 3 5 Ti 6 7 920 8 4800 9 5286 10 840 11 12 320252 +23:40:52 1594233652 0 A--32-080-2017 ॢ 3 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.231 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.231 new file mode 100644 index 0000000..25d9db3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.231 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.232 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.232 new file mode 100644 index 0000000..1785163 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.232 @@ -0,0 +1,69 @@ +21 10:45:31 10:45:34 +Rsk= 19.0 Rkk= 16.3 + +22 11:23:14 11:33:45 +P1= 15.9 T1=11:28:45 P2= 37.3 T2=11:33:45 Vs= 4.28 + +21 13:53:44 13:53:47 +Rsk= 18.9 Rkk= 16.3 + +22 14:36:36 14:52:06 +P1= 32.8 T1=14:47:06 P2= 43.9 T2=14:52:06 Vs= 2.21 + +20 19:08:41 19:08:50 +Riz_sol= 4773.4 + +21 19:08:56 19:08:59 +Rsk= 19.0 Rkk= 16.2 + +22 19:50:20 20:05:51 +P1= 42.7 T1=20:00:51 P2= 58.6 T2=20:05:51 Vs= 3.18 + +22 20:54:45 21:05:16 +P1= 14.6 T1=21:00:16 P2= 27.8 T2=21:05:16 Vs= 2.64 + +22 22:39:44 22:50:14 +P1= 14.3 T1=22:45:14 P2= 25.1 T2=22:50:14 Vs= 2.16 + +23 22:50:22 22:50:27 + + +24 22:50:31 22:51:08 + + +30 22:51:21 22:51:47 +Vst= 29.1 + +31 22:51:50 22:52:52 +Rom_sol= 12.1 + +41 22:53:30 22:53:35 +Ukz= 1.05 + +32 22:53:38 22:54:13 +Imax=26.9 Umax=55.0 T= 9.0 + +33 22:54:15 22:54:34 +Imin=15.9 Umin=25.0 T= 0.5 + +34 05:00:00 22:54:58 +V=300.1 T= 9.4 + +35 22:55:01 22:55:55 +Q= 53.2 T= 9.4 + +36 22:55:57 22:56:30 +P1=0.29 T= 2.9 + +37 22:56:32 22:57:04 +T= 0.9 + +38 22:57:06 22:57:13 +t= 51.3 T= 0.5 + +39 22:57:16 22:57:22 +t= 52.7 T= 0.5 + +40 22:57:25 22:57:32 +t= 52.8 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.233 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.233 new file mode 100644 index 0000000..378ae37 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.233 @@ -0,0 +1,16 @@ +11 03:26:47 1594160807 +12 07:08:54 1594174134 +13 09:15:19 1594181719 +0 09:15:19 1594181719 +14 10:43:30 1594187010 +15 11:35:31 1594190131 +16 12:20:04 1594192804 +1 13:09:42 1594195782 +2 13:50:21 1594198221 +5 14:53:40 1594202020 +6 15:05:45 1594202745 +7 15:50:40 1594205440 +8 19:04:19 1594217059 +25 22:51:19 1594230679 +9 22:58:33 1594231113 +10 23:40:53 1594233653 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.234 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.234 new file mode 100644 index 0000000..f2a01e4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.234 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.236 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.236 new file mode 100644 index 0000000..07f8b02 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.236 @@ -0,0 +1,93 @@ +[48] +oper = 11 +begin = 08.07.2020 03:26:47 +norma = 0 +real = 222 + +[49] +oper = 12 +begin = 08.07.2020 07:08:54 +norma = 105 +real = 126 + +[50] +oper = 13 +begin = 08.07.2020 09:15:19 +norma = 45 +real = 88 + +[51] +oper = 14 +begin = 08.07.2020 10:43:30 +norma = 40 +vac_time = 7 +real = 52 + +[52] +oper = 15 +begin = 08.07.2020 11:35:31 +norma = 30 +real = 44 + +[53] +oper = 16 +begin = 08.07.2020 12:20:04 +norma = 40 +real = 49 + +[54] +oper = 1 +begin = 08.07.2020 13:09:42 +norma = 85 +real = 40 + +[55] +oper = 2 +begin = 08.07.2020 13:50:21 +norma = 110 +vac_time = 8 +real = 63 + +[56] +oper = 5 +begin = 08.07.2020 14:53:40 +norma = 25 +real = 12 + +[57] +oper = 6 +begin = 08.07.2020 15:05:45 +norma = 35 +real = 44 + +[58] +oper = 7 +begin = 08.07.2020 15:50:40 +norma = 30 +real = 193 + +[59] +oper = 8 +begin = 08.07.2020 19:04:19 +norma = 40 +vac_time = 8 +real = 227 + +[60] +oper = 25 +begin = 08.07.2020 22:51:19 +norma = 30 +real = 7 + +[61] +oper = 9 +begin = 08.07.2020 22:58:33 +norma = 0 +real = 42 + +[62] +oper = 10 +begin = 08.07.2020 23:40:53 +norma = 0 +real = 194 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.237 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.237 new file mode 100644 index 0000000..b22225c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.237 @@ -0,0 +1,34 @@ +03:26:46 1594160806 祭 ० +03:26:47 1594160807 ⪫祭 ॣ '-2'(A) +03:26:48 1594160808 祭 ॣ '-2'(A) +04:38:48 1594165128 ⪫祭 ॣ '-2'(A) +07:03:49 1594173829 ⪫祭 ० ' ⮪ 㣨' +07:12:17 1594174337 ⪫祭 ० +07:12:18 1594174338 ⪫祭 +07:12:18 1594174338 : +07:13:31 1594174411 祭 ० ᪠ +07:15:48 1594174548 ⪫祭 ० ᪠ (A) +07:42:16 1594176136 : 믮 +11:34:56 1594190096 祭 ० ࠧ +11:34:58 1594190098 祭 ० ' ⮪ 㣨' +11:36:49 1594190209 祭 ॣ '-2'(A) +12:19:04 1594192744 ⪫祭 ० ࠧ (A) +12:20:06 1594192806 ⪫祭 ० ' ⮪ 㣨' +12:20:07 1594192807 ⪫祭 ॣ '-2'(A) +12:20:23 1594192823 祭 ० ᪠ +12:20:24 1594192824 祭 ० ᪠ +12:23:11 1594192991 ⪫祭 ० ᪠ (A) +13:54:58 1594198498 : 㦥 +15:06:00 1594202760 祭 ० ᪠ +15:08:54 1594202934 ⪫祭 ० ᪠ (A) +22:50:34 1594230634 祭 ॣ '-2'(A) +22:51:10 1594230670 ⪫祭 ॣ '-2'(A) +22:51:25 1594230685 祭 +22:51:52 1594230712 祭 +22:52:52 1594230772 ⪫祭 +22:57:54 1594231074 祭 ० ࠧ +22:57:56 1594231076 祭 ० ' ⮪ 㣨' +22:58:34 1594231114 : 믮 +23:19:54 1594232394 祭 ॣ '-2'(A) +23:40:52 1594233652 ⪫祭 ० ࠧ (A) +23:40:53 1594233653 祭 ॣ . 殮 㣨 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.239 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.239 new file mode 100644 index 0000000..b044848 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.239 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.241 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.241 new file mode 100644 index 0000000..c7e1e87 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.241 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.270 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.270 new file mode 100644 index 0000000..001671f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.270 @@ -0,0 +1,7 @@ +02:13:14 1594156394 1 12136 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 3 5 Ti 6 7 870 8 2020 9 5050 10 770 11 12 320801 +02:44:31 1594158271 0 A--32-078-2017 ॢ 1 +14:01:43 1594198903 3 14 +18:09:54 1594213794 1 12137 2 OT-4 3 32 9 4600 11 12 321801 +22:22:43 1594228963 6 +22:23:03 1594228983 1 12137 2 OT-4 3 32 4 3 5 Ti 6 7 870 8 2020 9 4600 10 770 11 12 321801 +23:13:16 1594231996 0 A--32-059-2019 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.271 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.271 new file mode 100644 index 0000000..d95634e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.271 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.272 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.272 new file mode 100644 index 0000000..a0839d1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.272 @@ -0,0 +1,120 @@ +20 01:23:22 01:23:31 +Riz_sol= 5988.5 + +21 01:23:38 01:23:41 +Rsk= 13.5 Rkk= 11.0 + +22 01:50:02 02:05:20 +P1= 38.0 T1=02:00:20 P2= 52.2 T2=02:05:20 Vs= 2.84 + +23 02:05:28 02:05:33 + + +24 02:05:44 02:06:22 + + +30 02:06:34 02:06:59 +Vst= 28.2 + +31 02:07:04 02:08:05 +Rom_sol= 13.3 + +41 02:08:23 02:08:28 +Ukz= 0.80 + +32 02:08:30 02:09:05 +Imax=11.6 Umax=50.0 T= 9.0 + +33 02:09:09 02:09:28 +Imin=16.2 Umin=25.0 T= 0.5 + +34 02:09:31 02:09:54 +V=300.3 T= 9.7 + +35 02:09:58 02:10:52 +Q= 54.7 T= 9.7 + +36 02:10:55 02:11:25 +P1=0.29 T= 3.2 + +37 02:11:28 02:11:56 +T= 1.2 + +38 02:11:59 02:12:05 +t= 58.6 T= 0.8 + +39 02:12:08 02:12:22 +tcam= 53.9 Tcam= 0.8 tfl= 60.9 Tfl= 0.8 + +40 02:12:25 02:12:30 +t= 58.0 T= 0.8 + +21 14:01:27 14:01:30 +Rsk= 12.9 Rkk= 10.3 + +22 14:34:22 14:44:40 +P1= 16.6 T1=14:39:40 P2= 32.4 T2=14:44:40 Vs= 3.16 + +21 18:01:48 18:01:51 +Rsk= 12.8 Rkk= 10.2 + +22 18:57:15 19:07:33 +P1= 15.9 T1=19:02:33 P2= 30.6 T2=19:07:33 Vs= 2.96 + +20 21:06:15 21:06:23 +Riz_sol= 5820.9 + +21 21:06:33 21:06:36 +Rsk= 13.7 Rkk= 11.1 + +22 21:37:07 21:52:25 +P1= 41.9 T1=21:47:25 P2= 57.5 T2=21:52:25 Vs= 3.12 + +22 22:00:33 22:15:52 +P1= 34.0 T1=22:10:52 P2= 45.7 T2=22:15:52 Vs= 2.34 + +23 22:16:00 22:16:05 + + +24 22:16:11 22:16:49 + + +30 22:16:57 22:17:19 +Vst= 28.2 + +31 22:17:22 22:17:55 +Rom_sol= 13.3 + +41 22:18:22 22:18:27 +Ukz= 1.16 + +32 22:18:31 22:19:06 +Imax=27.5 Umax=55.0 T= 9.0 + +33 22:19:09 22:19:26 +Imin=16.3 Umin=25.0 T= 0.5 + +34 05:00:00 22:19:53 +V=300.1 T= 9.7 + +35 22:19:55 22:20:48 +Q= 54.2 T= 9.7 + +36 22:20:51 22:21:22 +P1=0.29 T= 3.2 + +37 22:21:25 22:21:53 +T= 1.3 + +38 22:21:56 22:22:02 +t= 64.5 T= 0.8 + +39 22:22:05 22:22:20 +tcam= 54.2 Tcam= 0.8 tfl= 60.5 Tfl= 0.8 + +40 22:22:23 22:22:25 +t= 60.4 T= 1.4 + +40 22:22:29 22:22:35 +t= 60.2 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.273 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.273 new file mode 100644 index 0000000..1750c6e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.273 @@ -0,0 +1,22 @@ +6 00:09:01 1594148941 +7 00:47:33 1594151253 +8 01:17:07 1594153027 +25 02:06:29 1594155989 +9 02:13:14 1594156394 +10 02:44:31 1594158271 +11 07:29:59 1594175399 +12 11:01:03 1594188063 +13 13:03:39 1594195419 +0 13:03:39 1594195419 +14 13:59:24 1594198764 +15 14:47:02 1594201622 +16 15:16:14 1594203374 +1 16:04:47 1594206287 +2 18:01:16 1594213276 +5 19:08:21 1594217301 +6 19:21:57 1594218117 +7 20:02:38 1594220558 +8 21:03:25 1594224205 +25 22:16:56 1594228616 +9 22:23:03 1594228983 +10 23:13:16 1594231996 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.274 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.274 new file mode 100644 index 0000000..3be41a0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.274 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.275 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.275 new file mode 100644 index 0000000..3ff897a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.275 @@ -0,0 +1 @@ +55 22:22:25 1594228945 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.276 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.276 new file mode 100644 index 0000000..98b3ac0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.276 @@ -0,0 +1,131 @@ +[97] +oper = 6 +begin = 08.07.2020 00:09:01 +norma = 35 +real = 38 + +[98] +oper = 7 +begin = 08.07.2020 00:47:33 +norma = 30 +real = 29 + +[99] +oper = 8 +begin = 08.07.2020 01:17:07 +norma = 40 +vac_time = 7 +vac_avg10 = 6.7 +real = 49 + +[00] +oper = 25 +begin = 08.07.2020 02:06:29 +norma = 30 +real = 6 + +[01] +oper = 9 +begin = 08.07.2020 02:13:14 +norma = 0 +real = 31 + +[02] +oper = 10 +begin = 08.07.2020 02:44:31 +norma = 0 +real = 285 + +[03] +oper = 11 +begin = 08.07.2020 07:29:59 +norma = 0 +real = 211 + +[04] +oper = 12 +begin = 08.07.2020 11:01:03 +norma = 105 +real = 122 + +[05] +oper = 13 +begin = 08.07.2020 13:03:39 +norma = 45 +real = 55 + +[06] +oper = 14 +begin = 08.07.2020 13:59:24 +norma = 40 +vac_time = 6 +real = 47 + +[07] +oper = 15 +begin = 08.07.2020 14:47:02 +norma = 30 +real = 29 + +[08] +oper = 16 +begin = 08.07.2020 15:16:14 +norma = 40 +real = 48 + +[09] +oper = 1 +begin = 08.07.2020 16:04:47 +norma = 85 +real = 116 + +[10] +oper = 2 +begin = 08.07.2020 18:01:16 +norma = 110 +vac_time = 7 +real = 67 + +[11] +oper = 5 +begin = 08.07.2020 19:08:21 +norma = 25 +real = 13 + +[12] +oper = 6 +begin = 08.07.2020 19:21:57 +norma = 35 +real = 40 + +[13] +oper = 7 +begin = 08.07.2020 20:02:38 +norma = 30 +real = 60 + +[14] +oper = 8 +begin = 08.07.2020 21:03:25 +norma = 40 +vac_time = 7 +real = 73 + +[15] +oper = 25 +begin = 08.07.2020 22:16:56 +norma = 30 +real = 6 + +[16] +oper = 9 +begin = 08.07.2020 22:23:03 +norma = 0 +real = 50 + +[17] +oper = 10 +begin = 08.07.2020 23:13:16 +norma = 0 +real = 158 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.277 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.277 new file mode 100644 index 0000000..db6df43 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.277 @@ -0,0 +1,44 @@ +00:09:16 1594148956 祭 ० ᪠ +00:09:16 1594148956 祭 ० ᪠ +00:11:45 1594149105 ⪫祭 ० ᪠ (A) +02:05:47 1594155947 祭 ॣ '-2'(A) +02:06:20 1594155980 祭 +02:06:23 1594155983 ⪫祭 ॣ '-2'(A) +02:07:05 1594156025 祭 +02:08:05 1594156085 ⪫祭 +02:12:36 1594156356 祭 ० ࠧ +02:12:38 1594156358 祭 ० ' ⮪ 㣨' +02:13:15 1594156395 : 믮 +02:30:01 1594157401 祭 ॣ '-2'(A) +02:44:31 1594158271 ⪫祭 ० ࠧ (A) +02:44:31 1594158271 祭 ॣ . 殮 㣨 +07:29:59 1594175399 祭 ० +07:30:00 1594175400 ⪫祭 ॣ '-2'(A) +07:30:01 1594175401 祭 ॣ '-2'(A) +08:26:00 1594178760 ⪫祭 ॣ '-2'(A) +11:00:59 1594188059 ⪫祭 ० (A) +11:01:01 1594188061 ⪫祭 +11:01:01 1594188061 : +11:01:05 1594188065 ⪫祭 ० ' ⮪ 㣨' +11:02:15 1594188135 祭 ० ᪠ +11:02:15 1594188135 祭 ० ᪠ +11:05:05 1594188305 ⪫祭 ० ᪠ (A) +11:31:01 1594189861 : 믮 +14:46:53 1594201613 祭 ० ࠧ +14:46:55 1594201615 祭 ० ' ⮪ 㣨' +14:47:02 1594201622 祭 ॣ '-2'(A) +15:16:15 1594203375 ⪫祭 ० ' ⮪ 㣨' +15:16:17 1594203377 ⪫祭 ॣ '-2'(A) +15:16:34 1594203394 祭 ० ᪠ +15:16:35 1594203395 祭 ० ᪠ +15:19:23 1594203563 ⪫祭 ० ᪠ (A) +19:22:21 1594218141 祭 ० ᪠ +19:24:49 1594218289 ⪫祭 ० ᪠ (A) +22:16:13 1594228573 祭 ॣ '-2'(A) +22:16:50 1594228610 ⪫祭 ॣ '-2'(A) +22:22:48 1594228968 祭 ० ࠧ +22:22:49 1594228969 祭 ० ' ⮪ 㣨' +22:24:46 1594229086 祭 ॣ '-2'(A) +22:54:23 1594230863 ⪫祭 ० ᪠ (A) +23:13:15 1594231995 祭 ⠭ ॣ +23:13:16 1594231996 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.279 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.279 new file mode 100644 index 0000000..e4c6c3c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.279 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.280 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.280 new file mode 100644 index 0000000..7f28e04 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.280 @@ -0,0 +1,2 @@ +16:32:37 1594207957 1 11694 8 5100 9 5000 12 321801 +23:00:25 1594231225 1 11694 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 5100 9 5000 10 650 11 12 321801 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.281 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.281 new file mode 100644 index 0000000..3afd895 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.281 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.282 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.282 new file mode 100644 index 0000000..72895c0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.282 @@ -0,0 +1,66 @@ +21 16:31:55 16:31:58 +Rsk= 9.6 Rkk= 6.6 + +22 17:24:16 17:39:49 +P1= 41.7 T1=17:34:49 P2= 53.2 T2=17:39:49 Vs= 2.30 + +20 18:58:20 18:58:28 +Riz_sol= 4246.0 + +21 18:58:34 18:58:37 +Rsk= 10.3 Rkk= 7.4 + +22 19:40:07 19:50:41 +P1= 18.2 T1=19:45:41 P2= 32.6 T2=19:50:41 Vs= 2.89 + +22 22:34:53 22:45:25 +P1= 24.3 T1=22:40:25 P2= 30.7 T2=22:45:25 Vs= 1.29 + +23 22:45:31 22:45:37 + + +24 22:45:41 22:46:20 + + +30 22:46:29 22:46:54 +Vst= 30.1 + +31 22:47:00 22:47:39 +Rom_sol= 14.3 + +41 22:48:46 22:48:52 +Ukz= 3.02 + +41 22:48:59 22:49:04 +Ukz= 2.82 + +41 22:49:21 22:49:26 +Ukz= 2.16 + +32 22:49:30 22:50:04 +Imax=11.0 Umax=50.0 T= 9.0 + +33 22:50:07 22:50:25 +Imin=16.0 Umin=25.0 T= 0.5 + +34 05:00:00 22:50:51 +V=300.4 T= 9.4 + +35 22:50:54 22:52:23 +Q= 53.4 T= 9.4 + +36 22:52:26 22:53:03 +P1=0.29 T= 2.9 + +37 22:53:14 22:53:48 +T= 0.9 + +38 22:53:51 22:53:59 +t= 53.9 T= 0.4 + +39 22:54:01 22:54:16 +tcam= 52.9 Tcam= 0.5 tfl= 62.7 Tfl= 0.4 + +40 22:54:19 22:54:26 +t= 53.3 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.283 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.283 new file mode 100644 index 0000000..cf6599a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.283 @@ -0,0 +1,11 @@ +12 03:27:11 1594160831 +13 09:15:17 1594181717 +0 09:15:17 1594181717 +2 16:28:35 1594207715 +5 17:40:32 1594212032 +6 17:54:29 1594212869 +7 18:34:46 1594215286 +8 18:58:03 1594216683 +25 22:46:27 1594230387 +9 23:00:25 1594231225 +10 23:26:19 1594232779 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.284 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.284 new file mode 100644 index 0000000..b4f138b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.284 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.286 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.286 new file mode 100644 index 0000000..78e7be0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.286 @@ -0,0 +1,63 @@ +[67] +oper = 12 +begin = 08.07.2020 03:27:11 +norma = 180 +real = 348 + +[68] +oper = 13 +begin = 08.07.2020 09:15:17 +norma = 45 +real = 433 + +[69] +oper = 2 +begin = 08.07.2020 16:28:35 +norma = 110 +vac_time = 8 +real = 71 + +[70] +oper = 5 +begin = 08.07.2020 17:40:32 +norma = 25 +real = 13 + +[71] +oper = 6 +begin = 08.07.2020 17:54:29 +norma = 35 +real = 40 + +[72] +oper = 7 +begin = 08.07.2020 18:34:46 +norma = 30 +real = 23 + +[73] +oper = 8 +begin = 08.07.2020 18:58:03 +norma = 40 +vac_time = 8 +vac_avg10 = 8.4 +real = 228 + +[74] +oper = 25 +begin = 08.07.2020 22:46:27 +norma = 30 +real = 13 + +[75] +oper = 9 +begin = 08.07.2020 23:00:25 +norma = 0 +real = 25 + +[76] +oper = 10 +begin = 08.07.2020 23:26:19 +norma = 0 +real = 228 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.287 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.287 new file mode 100644 index 0000000..a0529c4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.287 @@ -0,0 +1,9 @@ +03:27:15 1594160835 ⪫祭 ॣ '-2'(A) +03:27:57 1594160877 祭 ० ᪠ +03:30:20 1594161020 ⪫祭 ० ᪠ (A) +17:55:20 1594212920 祭 ० ᪠ +17:57:38 1594213058 ⪫祭 ० ᪠ (A) +22:45:43 1594230343 祭 ॣ '-2'(A) +22:46:21 1594230381 ⪫祭 ॣ '-2'(A) +23:23:22 1594232602 祭 ॣ '-2' +23:26:18 1594232778 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.289 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.289 new file mode 100644 index 0000000..90ae6bb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.289 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.290 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.290 new file mode 100644 index 0000000..ed638c3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.290 @@ -0,0 +1,4 @@ +05:03:24 1594166604 1 07008 8 4940 9 4740 10 560 +09:38:15 1594183095 1 07008 2 p. cao M1,M2,M3,M4 3 25 4 1 5 Ti 6 7 670 8 4940 9 4740 10 560 11 12 321847 +10:08:32 1594184912 0 A--32-109-2016 ॢ 0 +20:45:32 1594223132 1 07009 2 OT-4 8 4740 9 4520 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.291 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.291 new file mode 100644 index 0000000..91c3d80 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.291 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.292 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.292 new file mode 100644 index 0000000..8799401 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.292 @@ -0,0 +1,75 @@ +21 05:02:41 05:02:44 +Rsk= 28.5 Rkk= 24.6 + +22 05:45:06 06:00:11 +P1= 70.4 T1=05:55:11 P2= 85.8 T2=06:00:11 Vs= 3.08 + +22 06:05:02 06:20:06 +P1= 59.4 T1=06:15:06 P2= 72.6 T2=06:20:06 Vs= 2.63 + +20 07:20:48 07:20:57 +Riz_sol= 9.4 + +21 07:22:05 07:22:08 +Rsk= 29.0 Rkk= 25.1 + +22 09:14:09 09:29:13 +P1= 42.9 T1=09:24:13 P2= 53.0 T2=09:29:13 Vs= 2.01 + +23 09:29:41 09:29:47 + + +24 09:29:56 09:30:33 + + +30 09:30:55 09:31:18 +Vst= 29.5 + +31 09:31:27 09:32:02 +Rom_sol= 15.9 + +41 09:32:33 09:32:38 +Ukz= 1.25 + +32 09:32:48 09:33:22 +Imax=10.9 Umax=58.3 T= 9.0 + +33 09:33:25 09:33:52 +Imin=15.9 Umin=24.9 T= 0.5 + +34 09:33:56 09:34:22 +V=300.1 T= 9.4 + +35 09:34:25 09:35:24 +Q= 53.2 T= 9.4 + +36 09:35:28 09:36:02 +P1=0.29 T= 2.9 + +37 09:36:06 09:36:44 +T= 0.9 + +38 09:36:48 09:36:55 +t= 53.3 T= 0.5 + +39 09:36:59 09:37:14 +tcam= 52.4 Tcam= 0.5 tfl= 53.2 Tfl= 0.5 + +40 09:37:17 09:37:24 +t= 53.0 T= 0.5 + +21 20:39:34 20:39:37 +Rsk= 26.1 Rkk= 22.2 + +22 21:17:49 21:32:54 +P1= 69.1 T1=21:27:54 P2= 85.7 T2=21:32:54 Vs= 3.31 + +22 21:45:25 22:00:29 +P1= 51.2 T1=21:55:29 P2= 63.8 T2=22:00:29 Vs= 2.51 + +20 23:07:03 23:07:12 +Riz_sol= 10.4 + +21 23:07:18 23:07:21 +Rsk= 29.1 Rkk= 25.2 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.293 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.293 new file mode 100644 index 0000000..a253122 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.293 @@ -0,0 +1,20 @@ +13 02:47:57 1594158477 +0 02:47:57 1594158477 +2 04:57:23 1594166243 +5 06:20:49 1594171249 +6 06:31:15 1594171875 +7 07:02:00 1594173720 +8 07:14:40 1594174480 +25 09:30:52 1594182652 +9 09:38:15 1594183095 +10 10:08:32 1594184912 +12 13:54:23 1594198463 +10 13:56:43 1594198603 +12 14:17:50 1594199870 +13 17:21:08 1594210868 +0 17:21:09 1594210869 +2 20:36:51 1594222611 +5 22:02:15 1594227735 +6 22:12:26 1594228346 +7 22:49:10 1594230550 +8 23:05:01 1594231501 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.294 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.294 new file mode 100644 index 0000000..7af25db Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.294 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.296 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.296 new file mode 100644 index 0000000..964cfc6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.296 @@ -0,0 +1,112 @@ +[31] +oper = 13 +begin = 08.07.2020 02:47:57 +norma = 45 +real = 129 + +[32] +oper = 2 +begin = 08.07.2020 04:57:23 +norma = 110 +vac_time = 7 +real = 83 + +[33] +oper = 5 +begin = 08.07.2020 06:20:49 +norma = 25 +real = 10 + +[34] +oper = 6 +begin = 08.07.2020 06:31:15 +norma = 35 +real = 30 + +[35] +oper = 7 +begin = 08.07.2020 07:02:00 +norma = 30 +real = 12 + +[36] +oper = 8 +begin = 08.07.2020 07:14:40 +norma = 40 +vac_time = 7 +real = 136 + +[37] +oper = 25 +begin = 08.07.2020 09:30:52 +norma = 30 +real = 7 + +[38] +oper = 9 +begin = 08.07.2020 09:38:15 +norma = 0 +real = 30 + +[39] +oper = 10 +begin = 08.07.2020 10:08:32 +norma = 0 +real = 225 + +[40] +oper = 12 +begin = 08.07.2020 13:54:23 +norma = 180 +real = 2 + +[41] +oper = 10 +begin = 08.07.2020 13:56:43 +norma = 0 +real = 21 + +[42] +oper = 12 +begin = 08.07.2020 14:17:50 +norma = 180 +real = 183 + +[43] +oper = 13 +begin = 08.07.2020 17:21:08 +norma = 45 +real = 195 + +[44] +oper = 2 +begin = 08.07.2020 20:36:51 +norma = 110 +vac_time = 7 +real = 85 + +[45] +oper = 5 +begin = 08.07.2020 22:02:15 +norma = 25 +real = 10 + +[46] +oper = 6 +begin = 08.07.2020 22:12:26 +norma = 35 +real = 36 + +[47] +oper = 7 +begin = 08.07.2020 22:49:10 +norma = 30 +real = 15 + +[48] +oper = 8 +begin = 08.07.2020 23:05:01 +norma = 40 +vac_time = 6 +real = 56 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.297 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.297 new file mode 100644 index 0000000..aac7898 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.297 @@ -0,0 +1,78 @@ +09:29:56 1594182596 祭 ॣ '-2'(A) +09:30:34 1594182634 ⪫祭 ॣ '-2'(A) +09:37:42 1594183062 祭 ० ࠧ +09:37:45 1594183065 祭 ० ' ⮪ 㣨' +09:39:32 1594183172 祭 ॣ '-2'(A) +10:08:32 1594184912 ⪫祭 ० ࠧ (A) +10:08:32 1594184912 祭 ⠭ ॣ +13:54:25 1594198465 ⪫祭 ० ' ⮪ 㣨' +13:54:27 1594198467 ⪫祭 ॣ '-2'(A) +13:56:34 1594198594 祭 ॣ '-2' +14:17:53 1594199873 ⪫祭 ॣ '-2'(A) +14:18:13 1594199893 祭 ० ᪠ +14:18:13 1594199893 祭 ० ᪠ +14:18:13 1594199893 祭 ० ᪠ +14:18:14 1594199894 祭 ० ᪠ +14:18:14 1594199894 祭 ० ᪠ +14:18:15 1594199895 祭 ० ᪠ +14:18:15 1594199895 祭 ० ᪠ +14:18:15 1594199895 祭 ० ᪠ +14:18:16 1594199896 祭 ० ᪠ +14:18:16 1594199896 祭 ० ᪠ +14:18:16 1594199896 祭 ० ᪠ +14:18:17 1594199897 祭 ० ᪠ +14:18:18 1594199898 祭 ० ᪠ +14:18:18 1594199898 祭 ० ᪠ +14:18:18 1594199898 祭 ० ᪠ +14:18:19 1594199899 祭 ० ᪠ +14:18:19 1594199899 祭 ० ᪠ +14:18:19 1594199899 祭 ० ᪠ +14:18:19 1594199899 祭 ० ᪠ +14:18:21 1594199901 祭 ० ᪠ +14:18:21 1594199901 祭 ० ᪠ +14:18:21 1594199901 祭 ० ᪠ +14:18:21 1594199901 祭 ० ᪠ +14:18:39 1594199919 祭 ० ᪠ +14:18:39 1594199919 祭 ० ᪠ +14:18:40 1594199920 祭 ० ᪠ +14:18:40 1594199920 祭 ० ᪠ +14:18:40 1594199920 祭 ० ᪠ +14:18:42 1594199922 祭 ० ᪠ +14:18:43 1594199923 祭 ० ᪠ +14:18:44 1594199924 祭 ० ᪠ +14:18:45 1594199925 祭 ० ᪠ +14:18:45 1594199925 祭 ० ᪠ +14:18:45 1594199925 祭 ० ᪠ +14:18:45 1594199925 祭 ० ᪠ +14:18:46 1594199926 祭 ० ᪠ +14:18:47 1594199927 祭 ० ᪠ +14:18:47 1594199927 祭 ० ᪠ +14:18:48 1594199928 祭 ० ᪠ +22:13:25 1594228405 祭 ० ᪠ +22:13:26 1594228406 祭 ० ᪠ +22:13:26 1594228406 祭 ० ᪠ +22:13:26 1594228406 祭 ० ᪠ +22:13:27 1594228407 祭 ० ᪠ +22:13:29 1594228409 祭 ० ᪠ +22:13:29 1594228409 祭 ० ᪠ +22:13:29 1594228409 祭 ० ᪠ +22:13:30 1594228410 祭 ० ᪠ +22:13:30 1594228410 祭 ० ᪠ +22:13:30 1594228410 祭 ० ᪠ +22:13:30 1594228410 祭 ० ᪠ +22:13:31 1594228411 祭 ० ᪠ +22:13:31 1594228411 祭 ० ᪠ +22:13:36 1594228416 祭 ० ᪠ +22:13:47 1594228427 祭 ० ᪠ +22:13:47 1594228427 祭 ० ᪠ +22:13:48 1594228428 祭 ० ᪠ +22:13:49 1594228429 祭 ० ᪠ +22:13:50 1594228430 祭 ० ᪠ +22:13:53 1594228433 祭 ० ᪠ +22:13:54 1594228434 祭 ० ᪠ +22:13:54 1594228434 祭 ० ᪠ +22:13:54 1594228434 祭 ० ᪠ +22:13:55 1594228435 祭 ० ᪠ +22:13:55 1594228435 祭 ० ᪠ +22:13:56 1594228436 祭 ० ᪠ +22:13:58 1594228438 祭 ० ᪠ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.299 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.299 new file mode 100644 index 0000000..cd7ef1f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.299 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.310 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.310 new file mode 100644 index 0000000..2d0e235 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.310 @@ -0,0 +1,7 @@ +01:30:14 1594153814 1 07435 9 4710 +02:55:44 1594158944 11 +03:02:13 1594159333 1 07435 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4980 9 4710 10 690 11 12 321689 +03:44:50 1594161890 0 A--32-031-2016 ॢ 5 +18:54:14 1594216454 1 07436 9 4910 12 320469 +23:02:57 1594231377 1 07436 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4980 9 4910 10 690 11 12 320469 +23:45:35 1594233935 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.311 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.311 new file mode 100644 index 0000000..b7b108d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.311 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.312 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.312 new file mode 100644 index 0000000..f7a89c4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.312 @@ -0,0 +1,108 @@ +20 01:29:10 01:29:19 +Riz_sol= 1207.8 + +21 01:29:34 01:29:37 +Rsk= 23.1 Rkk= 20.3 + +22 02:38:51 02:54:27 +P1= 39.0 T1=02:49:27 P2= 53.3 T2=02:54:27 Vs= 2.85 + +23 02:54:35 02:54:40 + + +24 02:54:47 02:55:26 + + +30 02:55:59 02:56:23 +Vst= 30.0 + +31 02:56:27 02:57:02 +Rom_sol= 12.4 + +41 02:57:25 02:57:30 +Ukz= 1.02 + +32 02:57:34 02:58:09 +Imax=11.0 Umax=50.0 T= 9.0 + +33 02:58:12 02:58:30 +Imin=16.0 Umin=25.0 T= 0.5 + +34 02:58:33 02:58:56 +V=300.1 T= 9.6 + +35 02:58:58 03:00:00 +Q= 28.8 T= 9.6 + +36 03:00:03 03:00:39 +P1=0.29 T= 3.1 + +37 03:00:42 03:01:19 +T= 1.1 + +38 03:01:22 03:01:29 +t= 51.1 T= 0.7 + +39 03:01:33 03:01:41 +t= 52.1 T= 0.7 + +40 03:01:45 03:01:52 +t= 51.1 T= 0.7 + +20 18:53:13 18:53:23 +Riz_sol= 1211.0 + +21 18:53:31 18:53:34 +Rsk= 22.9 Rkk= 20.1 + +22 20:12:19 20:27:54 +P1= 41.8 T1=20:22:54 P2= 57.1 T2=20:27:54 Vs= 3.05 + +22 20:52:03 21:07:38 +P1= 36.8 T1=21:02:38 P2= 50.4 T2=21:07:38 Vs= 2.72 + +22 22:34:07 22:49:42 +P1= 39.0 T1=22:44:42 P2= 50.7 T2=22:49:42 Vs= 2.34 + +23 22:53:46 22:53:51 + + +24 22:53:58 22:54:37 + + +30 22:54:56 22:55:24 +Vst= 29.8 + +31 22:55:28 22:56:04 +Rom_sol= 12.3 + +32 22:56:50 22:57:25 +Imax=11.0 Umax=50.0 T= 9.0 + +33 22:57:28 22:57:47 +Imin=16.0 Umin=25.0 T= 0.5 + +34 22:57:50 22:58:13 +V=300.2 T= 9.6 + +35 22:58:17 22:58:37 +Q= 21.6 T=10.0 + +35 22:59:03 23:00:00 +Q= 3.6 T= 9.6 + +36 23:00:05 23:00:40 +P1=0.29 T= 3.1 + +37 23:00:44 23:01:21 +T= 1.1 + +38 23:01:24 23:01:31 +t= 51.2 T= 0.7 + +39 23:01:34 23:01:41 +t= 52.2 T= 0.7 + +40 23:01:44 23:01:51 +t= 51.2 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.313 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.313 new file mode 100644 index 0000000..96b9783 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.313 @@ -0,0 +1,12 @@ +8 01:26:51 1594153611 +25 02:55:56 1594158956 +9 03:02:13 1594159333 +10 03:44:50 1594161890 +11 07:38:30 1594175910 +12 10:25:31 1594185931 +13 12:18:01 1594192681 +0 12:18:01 1594192681 +8 18:51:47 1594216307 +25 22:54:53 1594230893 +9 23:02:57 1594231377 +10 23:45:35 1594233935 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.314 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.314 new file mode 100644 index 0000000..26a367f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.314 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.315 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.315 new file mode 100644 index 0000000..ee52a13 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.315 @@ -0,0 +1 @@ +55 22:58:37 1594231117 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.316 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.316 new file mode 100644 index 0000000..ddaf677 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.316 @@ -0,0 +1,68 @@ +[14] +oper = 8 +begin = 08.07.2020 01:26:51 +norma = 40 +vac_time = 8 +real = 89 + +[15] +oper = 25 +begin = 08.07.2020 02:55:56 +norma = 30 +real = 6 + +[16] +oper = 9 +begin = 08.07.2020 03:02:13 +norma = 0 +real = 42 + +[17] +oper = 10 +begin = 08.07.2020 03:44:50 +norma = 0 +real = 233 + +[18] +oper = 11 +begin = 08.07.2020 07:38:30 +norma = 0 +real = 167 + +[19] +oper = 12 +begin = 08.07.2020 10:25:31 +norma = 105 +real = 112 + +[20] +oper = 13 +begin = 08.07.2020 12:18:01 +norma = 45 +real = 393 + +[21] +oper = 8 +begin = 08.07.2020 18:51:47 +norma = 40 +vac_time = 8 +real = 243 + +[22] +oper = 25 +begin = 08.07.2020 22:54:53 +norma = 30 +real = 8 + +[23] +oper = 9 +begin = 08.07.2020 23:02:57 +norma = 0 +real = 42 + +[24] +oper = 10 +begin = 08.07.2020 23:45:35 +norma = 0 +real = 242 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.317 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.317 new file mode 100644 index 0000000..14b0c97 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.317 @@ -0,0 +1,25 @@ +01:29:02 1594153742 : 㦥 +02:54:49 1594158889 祭 ॣ '-2'(A) +02:55:26 1594158926 ⪫祭 ॣ '-2'(A) +02:55:46 1594158946 : +03:02:00 1594159320 祭 ० ࠧ +03:02:02 1594159322 祭 ० ' ⮪ 㣨' +03:27:46 1594160866 祭 ॣ '-2'(A) +03:44:50 1594161890 ⪫祭 ० ࠧ (A) +03:44:50 1594161890 祭 ⠭ ॣ +07:38:29 1594175909 祭 ० +07:38:30 1594175910 ⪫祭 ॣ '-2'(A) +07:38:31 1594175911 祭 ॣ '-2'(A) +09:30:30 1594182630 ⪫祭 ॣ '-2'(A) +10:25:26 1594185926 ⪫祭 ० (A) +10:25:32 1594185932 ⪫祭 ० ' ⮪ 㣨' +10:32:30 1594186350 祭 ० ᪠ +10:32:31 1594186351 祭 ० ᪠ +10:34:50 1594186490 ⪫祭 ० ᪠ (A) +22:54:00 1594230840 祭 ॣ '-2'(A) +22:54:38 1594230878 ⪫祭 ॣ '-2'(A) +23:02:15 1594231335 祭 ० ࠧ +23:02:17 1594231337 祭 ० ' ⮪ 㣨' +23:28:30 1594232910 祭 ॣ '-2'(A) +23:45:35 1594233935 祭 ⠭ ॣ +23:45:35 1594233935 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.319 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.319 new file mode 100644 index 0000000..bfc4d87 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.319 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.320 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.320 new file mode 100644 index 0000000..95efc2d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.320 @@ -0,0 +1,4 @@ +02:18:56 1594156736 1 05164 3 32 9 3590 +17:50:40 1594212640 6 +17:55:10 1594212910 1 05164 2 OT-4 3 32 4 2 5 Ti 6 7 770 8 4450 9 3590 10 670 11 12 320469 +18:24:29 1594214669 0 A--32-050-2012 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.321 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.321 new file mode 100644 index 0000000..20f5916 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.321 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.322 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.322 new file mode 100644 index 0000000..18d379e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.322 @@ -0,0 +1,75 @@ +21 02:17:19 02:17:22 +Rsk=3809.3 Rkk= 13.4 + +21 02:17:41 02:17:44 +Rsk= 18.7 Rkk= 13.6 + +22 02:51:06 03:06:11 +P1= 45.2 T1=03:01:11 P2= 60.6 T2=03:06:11 Vs= 3.09 + +22 03:15:34 03:30:38 +P1= 36.1 T1=03:25:38 P2= 48.5 T2=03:30:38 Vs= 2.48 + +20 06:25:46 06:25:54 +Riz_sol= 6361.5 + +21 06:26:01 06:26:04 +Rsk= 18.7 Rkk= 12.9 + +20 11:06:09 11:06:18 +Riz_sol= 4806.5 + +21 11:06:23 11:06:26 +Rsk=3487.7 Rkk= 11.2 + +21 11:06:34 11:06:37 +Rsk= 17.0 Rkk= 11.3 + +22 11:57:57 12:08:02 +P1= 14.7 T1=12:03:01 P2= 29.6 T2=12:08:02 Vs= 2.99 + +22 17:31:07 17:41:12 +P1= 14.9 T1=17:36:12 P2= 25.6 T2=17:41:12 Vs= 2.13 + +23 17:42:45 17:42:50 + + +24 17:42:55 17:43:40 + + +30 17:44:03 17:44:32 +Vst= 29.4 + +31 17:44:35 17:45:10 +Rom_sol= 10.4 + +41 17:45:36 17:45:41 +Ukz= 1.04 + +32 17:45:47 17:46:26 +Imax=27.2 Umax=55.0 T= 9.0 + +33 17:46:40 17:47:00 +Imin=16.2 Umin=24.9 T= 0.5 + +34 05:00:00 17:47:25 +V=300.1 T= 9.4 + +35 17:47:32 17:48:30 +Q= 53.6 T= 9.4 + +36 17:48:34 17:49:07 +P1=0.29 T= 2.9 + +37 17:49:09 17:49:42 +T= 0.9 + +38 17:49:44 17:49:51 +t= 52.2 T= 0.5 + +39 17:49:53 17:50:08 +tcam= 51.3 Tcam= 0.5 tfl= 52.3 Tfl= 0.5 + +40 17:50:11 17:50:18 +t= 53.2 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.323 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.323 new file mode 100644 index 0000000..2f03548 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.323 @@ -0,0 +1,15 @@ +15 00:00:36 1594148436 +16 00:26:55 1594150015 +1 01:29:30 1594153770 +2 02:14:59 1594156499 +5 03:32:10 1594161130 +6 03:43:42 1594161822 +7 04:17:07 1594163827 +8 06:23:03 1594171383 +13 08:36:36 1594179396 +8 11:05:08 1594188308 +25 17:44:01 1594212241 +9 17:55:10 1594212910 +10 18:24:29 1594214669 +11 20:31:34 1594222294 +12 22:32:20 1594229540 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.324 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.324 new file mode 100644 index 0000000..aafca24 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.324 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.326 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.326 new file mode 100644 index 0000000..edc349c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.326 @@ -0,0 +1,93 @@ +[55] +oper = 15 +begin = 08.07.2020 00:00:36 +norma = 30 +real = 26 + +[56] +oper = 16 +begin = 08.07.2020 00:26:55 +norma = 40 +real = 62 + +[57] +oper = 1 +begin = 08.07.2020 01:29:30 +norma = 85 +real = 45 + +[58] +oper = 2 +begin = 08.07.2020 02:14:59 +norma = 110 +vac_time = 8 +real = 77 + +[59] +oper = 5 +begin = 08.07.2020 03:32:10 +norma = 25 +real = 11 + +[60] +oper = 6 +begin = 08.07.2020 03:43:42 +norma = 35 +real = 33 + +[61] +oper = 7 +begin = 08.07.2020 04:17:07 +norma = 30 +real = 125 + +[62] +oper = 8 +begin = 08.07.2020 06:23:03 +norma = 40 +vac_time = 8 +real = 133 + +[63] +oper = 13 +begin = 08.07.2020 08:36:36 +norma = 45 +real = 148 + +[64] +oper = 8 +begin = 08.07.2020 11:05:08 +norma = 40 +vac_time = 8 +real = 398 + +[65] +oper = 25 +begin = 08.07.2020 17:44:01 +norma = 30 +real = 11 + +[66] +oper = 9 +begin = 08.07.2020 17:55:10 +norma = 0 +real = 29 + +[67] +oper = 10 +begin = 08.07.2020 18:24:29 +norma = 0 +real = 127 + +[68] +oper = 11 +begin = 08.07.2020 20:31:34 +norma = 115 +real = 120 + +[69] +oper = 12 +begin = 08.07.2020 22:32:20 +norma = 105 +real = 116 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.327 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.327 new file mode 100644 index 0000000..504f57e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.327 @@ -0,0 +1,35 @@ +00:01:24 1594148484 祭 ॣ '-2'(A) +00:26:56 1594150016 ⪫祭 ० ' ⮪ 㣨' +00:27:11 1594150031 ⪫祭 ॣ '-2'(A) +00:27:12 1594150032 ⪫祭 ० ࠧ +00:27:21 1594150041 祭 ० ᪠ +00:27:21 1594150041 祭 ० ᪠ +00:27:21 1594150041 祭 ० ᪠ +00:27:21 1594150041 祭 ० ᪠ +00:27:21 1594150041 祭 ० ᪠ +00:27:22 1594150042 祭 ० ᪠ +00:27:22 1594150042 祭 ० ᪠ +00:27:22 1594150042 祭 ० ᪠ +00:27:22 1594150042 祭 ० ᪠ +00:29:28 1594150168 ⪫祭 ० ᪠ (A) +03:43:53 1594161833 祭 ० ᪠ +03:43:54 1594161834 祭 ० ᪠ +03:45:57 1594161957 ⪫祭 ० ᪠ (A) +17:43:02 1594212182 祭 ॣ '-2'(A) +17:43:41 1594212221 ⪫祭 ॣ '-2'(A) +17:54:38 1594212878 祭 ० ࠧ +17:54:40 1594212880 祭 ० ' ⮪ 㣨' +18:21:28 1594214488 祭 ॣ '-2'(A) +18:21:59 1594214519 ⪫祭 ० ᪠ (A) +18:24:29 1594214669 ⪫祭 ० ࠧ (A) +18:24:29 1594214669 祭 ⠭ ॣ +20:31:34 1594222294 祭 ० +20:31:35 1594222295 ⪫祭 ॣ '-2'(A) +20:31:36 1594222296 祭 ॣ '-2'(A) +21:13:56 1594224836 祭 ० +21:13:57 1594224837 ⪫祭 ॣ '-2'(A) +22:31:34 1594229494 ⪫祭 ० (A) +22:31:36 1594229496 ⪫祭 ० ' ⮪ 㣨' +22:33:15 1594229595 祭 ० ᪠ +22:33:15 1594229595 祭 ० ᪠ +22:35:07 1594229707 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.329 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.329 new file mode 100644 index 0000000..48637fc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.329 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.330 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.330 new file mode 100644 index 0000000..5840fd0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.330 @@ -0,0 +1,8 @@ +03:02:17 1594159337 1 11196 3 14 +03:57:08 1594162628 0 A--32-067-2014 ॢ 0 +05:44:37 1594169077 1 11197 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 8 4910 +06:36:29 1594172189 1 11198 +06:37:20 1594172240 1 11196 +13:13:18 1594195998 9 4910 +16:12:25 1594206745 1 11196 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4910 9 4910 10 670 11 12 321544 +16:41:09 1594208469 0 A--32-068-2019 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.331 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.331 new file mode 100644 index 0000000..55ca08e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.331 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.332 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.332 new file mode 100644 index 0000000..3998cbe --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.332 @@ -0,0 +1,66 @@ +22 03:15:52 03:31:22 +P1= 68.2 T1=03:26:22 P2= 89.7 T2=03:31:22 Vs= 4.28 + +21 03:32:08 03:32:15 +Rsk= 18.2 Rkk= 12.9 + +21 05:43:38 05:43:46 +Rsk= 18.1 Rkk= 13.0 + +22 06:20:03 06:35:33 +P1= 29.1 T1=06:30:33 P2= 41.6 T2=06:35:33 Vs= 2.50 + +20 09:02:07 09:02:16 +Riz_sol= 6679.7 + +21 09:02:40 09:02:47 +Rsk= 18.1 Rkk= 12.9 + +22 09:39:42 09:50:14 +P1= 8.6 T1=09:45:14 P2= 23.5 T2=09:50:14 Vs= 2.97 + +22 15:52:14 16:02:44 +P1= 14.6 T1=15:57:44 P2= 14.6 T2=16:02:44 Vs= 0.00 + +23 16:03:13 16:03:19 + + +24 16:03:25 16:03:59 + + +30 16:04:10 16:04:50 +Vst= 28.5 + +31 16:04:54 16:05:55 +Rom_sol= 15.4 + +41 16:06:24 16:06:29 +Ukz= 1.03 + +32 16:06:31 16:07:41 +Imax=11.0 Umax=50.0 T= 9.4 + +33 16:07:45 16:08:13 +Imin=16.2 Umin=25.1 T= 1.0 + +34 16:08:17 16:08:44 +V=301.7 T= 9.6 + +35 16:08:47 16:09:42 +Q= 54.6 T= 9.2 + +36 16:09:44 16:10:19 +P1=0.26 T= 3.0 + +37 16:10:22 16:10:59 +T= 0.7 + +38 16:11:02 16:11:08 +t= 52.1 T= 0.5 + +39 16:11:10 16:11:20 +t= 52.4 T= 0.5 + +40 16:11:22 16:11:29 +t= 52.0 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.333 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.333 new file mode 100644 index 0000000..72b9daf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.333 @@ -0,0 +1,17 @@ +12 00:41:16 1594150876 +13 02:28:16 1594157296 +0 02:28:16 1594157296 +14 03:00:46 1594159246 +15 03:33:12 1594161192 +16 03:57:08 1594162628 +16 04:00:35 1594162835 +1 04:42:14 1594165334 +2 05:42:40 1594168960 +5 06:37:57 1594172277 +6 06:48:29 1594172909 +7 07:22:20 1594174940 +8 08:59:23 1594180763 +25 16:04:07 1594206247 +9 16:12:25 1594206745 +10 16:41:09 1594208469 +11 21:17:50 1594225070 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.334 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.334 new file mode 100644 index 0000000..6277ee9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.334 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.336 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.336 new file mode 100644 index 0000000..e70c095 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.336 @@ -0,0 +1,100 @@ +[71] +oper = 12 +begin = 08.07.2020 00:41:16 +norma = 105 +real = 107 + +[72] +oper = 13 +begin = 08.07.2020 02:28:16 +norma = 45 +real = 32 + +[73] +oper = 14 +begin = 08.07.2020 03:00:46 +norma = 40 +vac_time = 8 +real = 32 + +[74] +oper = 15 +begin = 08.07.2020 03:33:12 +norma = 30 +real = 23 + +[75] +oper = 16 +begin = 08.07.2020 03:57:08 +norma = 40 +real = 3 + +[76] +oper = 16 +begin = 08.07.2020 04:00:35 +norma = 40 +real = 41 + +[77] +oper = 1 +begin = 08.07.2020 04:42:14 +norma = 85 +real = 60 + +[78] +oper = 2 +begin = 08.07.2020 05:42:40 +norma = 110 +vac_time = 8 +real = 55 + +[79] +oper = 5 +begin = 08.07.2020 06:37:57 +norma = 25 +real = 10 + +[80] +oper = 6 +begin = 08.07.2020 06:48:29 +norma = 35 +real = 33 + +[81] +oper = 7 +begin = 08.07.2020 07:22:20 +norma = 30 +real = 97 + +[82] +oper = 8 +begin = 08.07.2020 08:59:23 +norma = 40 +vac_time = 8 +vac_avg10 = 8.5 +real = 424 + +[83] +oper = 25 +begin = 08.07.2020 16:04:07 +norma = 30 +real = 8 + +[84] +oper = 9 +begin = 08.07.2020 16:12:25 +norma = 0 +real = 28 + +[85] +oper = 10 +begin = 08.07.2020 16:41:09 +norma = 0 +real = 276 + +[86] +oper = 11 +begin = 08.07.2020 21:17:50 +norma = 0 +real = 163 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.337 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.337 new file mode 100644 index 0000000..d66eed9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.337 @@ -0,0 +1,37 @@ +00:41:11 1594150871 ⪫祭 ० (A) +00:41:13 1594150873 ⪫祭 +00:41:13 1594150873 : +00:41:17 1594150877 ⪫祭 ० ' ⮪ 㣨' +00:42:06 1594150926 祭 ० ᪠ +00:42:06 1594150926 祭 ० ᪠ +00:45:49 1594151149 ⪫祭 ० ᪠ (A) +01:11:13 1594152673 : 믮 +03:32:31 1594161151 祭 ० ࠧ +03:33:30 1594161210 祭 ० ' ⮪ 㣨' +03:33:31 1594161211 祭 ॣ '-2'(A) +03:57:08 1594162628 ⪫祭 ० ࠧ (A) +04:00:37 1594162837 ⪫祭 ० ' ⮪ 㣨' +04:00:39 1594162839 ⪫祭 ॣ '-2'(A) +04:00:45 1594162845 祭 ० ᪠ +04:00:45 1594162845 祭 ० ᪠ +04:00:45 1594162845 祭 ० ᪠ +04:04:07 1594163047 ⪫祭 ० ᪠ (A) +05:44:39 1594169079 : 㦥 +06:48:36 1594172916 祭 ० ᪠ +06:48:36 1594172916 祭 ० ᪠ +06:59:33 1594173573 ⪫祭 ० ᪠ +11:50:16 1594191016 祭 ॣ '-2'(A) +16:03:59 1594206239 ⪫祭 ॣ '-2'(A) +16:04:13 1594206253 祭 +16:04:55 1594206295 祭 +16:05:55 1594206355 ⪫祭 +16:11:50 1594206710 祭 ० ࠧ +16:11:52 1594206712 祭 ० ' ⮪ 㣨' +16:12:25 1594206745 : 믮 +16:29:08 1594207748 祭 ॣ '-2'(A) +16:41:09 1594208469 ⪫祭 ० ࠧ (A) +16:41:09 1594208469 祭 ॣ . 殮 㣨 +21:17:49 1594225069 祭 ० +21:17:50 1594225070 ⪫祭 ॣ '-2'(A) +21:17:51 1594225071 祭 ॣ '-2'(A) +22:07:52 1594228072 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.339 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.339 new file mode 100644 index 0000000..542e82a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.339 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.340 new file mode 100644 index 0000000..3c10101 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.340 @@ -0,0 +1,6 @@ +02:44:01 1594158241 3 14 +03:37:43 1594161463 0 A--32-067-2014 ॢ 0 +05:48:00 1594169280 1 09633 3 37 12 321752 +13:37:49 1594197469 1 09633 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 37 4 2 5 Ti 6 7 770 8 4250 9 4740 10 670 11 12 321752 +22:13:47 1594228427 3 14 +23:16:47 1594232207 0 A--32-067-2014 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.341 new file mode 100644 index 0000000..c820e88 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.342 new file mode 100644 index 0000000..22da67b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.342 @@ -0,0 +1,69 @@ +21 02:43:42 02:43:45 +Rsk= 15.0 Rkk= 14.4 + +22 02:59:37 03:15:04 +P1= 66.6 T1=03:10:03 P2= 87.1 T2=03:15:04 Vs= 4.10 + +21 05:46:13 05:46:16 +Rsk= 15.0 Rkk= 14.4 + +22 06:34:39 06:45:06 +P1= 14.7 T1=06:40:06 P2= 27.5 T2=06:45:06 Vs= 2.55 + +20 09:34:59 09:35:08 +Riz_sol= 2042.9 + +21 09:35:18 09:35:21 +Rsk= 15.4 Rkk= 14.7 + +22 10:22:22 10:32:50 +P1= 15.0 T1=10:27:50 P2= 27.7 T2=10:32:50 Vs= 2.53 + +22 13:19:37 13:30:04 +P1= 30.3 T1=13:25:04 P2= 32.8 T2=13:30:04 Vs= 0.50 + +23 13:30:19 13:30:24 + + +24 13:30:29 13:31:07 + + +30 13:31:18 13:31:47 +Vst= 31.3 + +31 13:31:52 13:32:25 +Rom_sol= 12.6 + +32 13:32:55 13:33:33 +Imax=27.0 Umax=55.0 T= 9.0 + +33 13:33:35 13:34:04 +Imin=16.0 Umin=25.0 T= 0.5 + +34 13:34:08 13:34:33 +V=300.4 T= 9.5 + +35 13:34:36 13:35:33 +Q= 53.1 T= 9.5 + +36 13:35:36 13:36:10 +P1=0.29 T= 3.0 + +37 13:36:13 13:36:38 +T= 1.0 + +38 13:36:42 13:36:52 +t= 51.9 T= 0.6 + +39 13:36:56 13:37:03 +t= 51.7 T= 0.6 + +40 13:37:08 13:37:15 +t= 51.8 T= 0.6 + +21 22:14:10 22:14:13 +Rsk= 14.8 Rkk= 14.2 + +22 22:32:41 22:48:08 +P1= 67.9 T1=22:43:08 P2= 92.0 T2=22:48:08 Vs= 4.81 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.343 new file mode 100644 index 0000000..1b2d7b8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.343 @@ -0,0 +1,20 @@ +13 02:14:14 1594156454 +0 02:14:14 1594156454 +14 02:41:27 1594158087 +15 03:15:45 1594160145 +16 03:39:29 1594161569 +1 04:16:44 1594163804 +2 05:42:16 1594168936 +5 06:53:31 1594173211 +6 07:05:00 1594173900 +7 07:49:43 1594176583 +8 09:32:39 1594182759 +25 13:31:15 1594197075 +9 13:37:49 1594197469 +10 14:26:05 1594200365 +12 16:46:14 1594208774 +13 21:08:01 1594224481 +0 21:08:01 1594224481 +14 22:07:05 1594228025 +15 22:55:26 1594230926 +16 23:19:53 1594232393 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.344 new file mode 100644 index 0000000..6fc7181 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.346 new file mode 100644 index 0000000..3d595b7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.346 @@ -0,0 +1,112 @@ +[01] +oper = 13 +begin = 08.07.2020 02:14:14 +norma = 45 +real = 27 + +[02] +oper = 14 +begin = 08.07.2020 02:41:27 +norma = 40 +vac_time = 7 +real = 34 + +[03] +oper = 15 +begin = 08.07.2020 03:15:45 +norma = 30 +real = 23 + +[04] +oper = 16 +begin = 08.07.2020 03:39:29 +norma = 40 +real = 37 + +[05] +oper = 1 +begin = 08.07.2020 04:16:44 +norma = 85 +real = 85 + +[06] +oper = 2 +begin = 08.07.2020 05:42:16 +norma = 110 +vac_time = 8 +real = 71 + +[07] +oper = 5 +begin = 08.07.2020 06:53:31 +norma = 25 +real = 11 + +[08] +oper = 6 +begin = 08.07.2020 07:05:00 +norma = 35 +real = 44 + +[09] +oper = 7 +begin = 08.07.2020 07:49:43 +norma = 30 +real = 102 + +[10] +oper = 8 +begin = 08.07.2020 09:32:39 +norma = 40 +vac_time = 8 +real = 238 + +[11] +oper = 25 +begin = 08.07.2020 13:31:15 +norma = 30 +real = 6 + +[12] +oper = 9 +begin = 08.07.2020 13:37:49 +norma = 0 +real = 48 + +[13] +oper = 10 +begin = 08.07.2020 14:26:05 +norma = 0 +real = 140 + +[14] +oper = 12 +begin = 08.07.2020 16:46:14 +norma = 180 +real = 261 + +[15] +oper = 13 +begin = 08.07.2020 21:08:01 +norma = 45 +real = 59 + +[16] +oper = 14 +begin = 08.07.2020 22:07:05 +norma = 40 +vac_time = 7 +real = 48 + +[17] +oper = 15 +begin = 08.07.2020 22:55:26 +norma = 30 +real = 24 + +[18] +oper = 16 +begin = 08.07.2020 23:19:53 +norma = 40 +real = 45 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.347 new file mode 100644 index 0000000..65c7cfd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.347 @@ -0,0 +1,29 @@ +03:15:44 1594160144 祭 ० ࠧ +03:15:46 1594160146 祭 ० ' ⮪ 㣨' +03:15:48 1594160148 祭 ॣ '-2'(A) +03:37:43 1594161463 ⪫祭 ० ࠧ (A) +03:38:33 1594161513 ⪫祭 ० ' ⮪ 㣨' +03:39:33 1594161573 ⪫祭 ॣ '-2'(A) +03:40:28 1594161628 祭 ० ᪠ +03:43:09 1594161789 ⪫祭 ० ᪠ (A) +07:05:29 1594173929 祭 ० ᪠ +07:05:29 1594173929 祭 ० ᪠ +07:08:13 1594174093 ⪫祭 ० ᪠ (A) +13:30:30 1594197030 祭 ॣ '-2'(A) +13:31:07 1594197067 ⪫祭 ॣ '-2'(A) +14:15:52 1594199752 祭 ॣ '-2' +14:26:05 1594200365 祭 ⠭ ॣ +16:46:17 1594208777 ⪫祭 ॣ '-2'(A) +16:46:27 1594208787 祭 ० ᪠ +16:46:27 1594208787 祭 ० ᪠ +16:49:45 1594208985 ⪫祭 ० ᪠ (A) +22:54:53 1594230893 祭 ० ࠧ +22:54:55 1594230895 祭 ० ' ⮪ 㣨' +22:56:12 1594230972 祭 ॣ '-2'(A) +23:16:47 1594232207 ⪫祭 ० ࠧ (A) +23:19:54 1594232394 ⪫祭 ० ' ⮪ 㣨' +23:19:56 1594232396 ⪫祭 ॣ '-2'(A) +23:20:01 1594232401 祭 ० ᪠ +23:20:01 1594232401 祭 ० ᪠ +23:20:02 1594232402 祭 ० ᪠ +23:23:20 1594232600 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.349 new file mode 100644 index 0000000..d430618 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.350 new file mode 100644 index 0000000..d11d3fe --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.350 @@ -0,0 +1,10 @@ +01:50:33 1594155033 3 14 +02:39:41 1594157981 0 A--32-067-2014 ॢ 0 +06:05:34 1594170334 1 09569 2 p. cao M1,M2,M3,M4 3 37 9 3740 10 670 +06:06:13 1594170373 2 p. cao M1,M2,M3,M4 7 670 +07:01:21 1594173681 7 770 +10:47:48 1594187268 1 09569 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 770 8 4640 9 3740 10 670 11 12 321692 +11:21:30 1594189290 0 A--32-006-2018 ॢ 4 +18:37:30 1594215450 3 14 +19:47:40 1594219660 0 A--32-067-2014 ॢ 0 +21:48:13 1594226893 1 09570 3 37 9 3770 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.351 new file mode 100644 index 0000000..ade15a6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.352 new file mode 100644 index 0000000..a5caa25 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.352 @@ -0,0 +1,87 @@ +21 01:50:45 01:50:48 +Rsk= 15.0 Rkk= 12.3 + +22 02:09:12 02:24:42 +P1= 73.0 T1=02:19:42 P2= 91.8 T2=02:24:42 Vs= 3.76 + +21 05:43:35 05:43:38 +Rsk= 14.9 Rkk= 12.2 + +22 06:30:00 06:45:30 +P1= 45.4 T1=06:40:30 P2= 59.3 T2=06:45:30 Vs= 2.79 + +20 08:06:13 08:06:21 +Riz_sol= 6260.0 + +21 08:06:29 08:06:32 +Rsk= 14.9 Rkk= 12.2 + +22 08:55:14 09:10:46 +P1= 35.9 T1=09:05:45 P2= 47.6 T2=09:10:46 Vs= 2.34 + +22 10:22:17 10:32:48 +P1= 8.6 T1=10:27:48 P2= 19.9 T2=10:32:48 Vs= 2.27 + +23 10:37:45 10:37:50 + + +24 10:38:27 10:38:27 + + +24 10:38:35 10:38:36 + + +24 10:39:23 10:39:23 + + +24 10:39:33 10:40:10 + + +30 10:40:28 10:40:54 +Vst= 28.2 + +31 10:40:59 10:41:34 +Rom_sol= 8.7 + +41 10:42:07 10:42:12 +Ukz= 0.99 + +32 10:42:18 10:42:53 +Imax=27.3 Umax=55.0 T= 9.0 + +33 10:42:56 10:43:21 +Imin=16.2 Umin=25.0 T= 0.5 + +34 10:43:26 10:43:49 +V=300.3 T= 9.5 + +35 10:43:52 10:44:51 +Q= 53.8 T= 9.5 + +36 10:44:56 10:45:34 +P1=0.30 T= 3.0 + +37 10:45:39 10:46:04 +T= 1.0 + +38 10:46:07 10:46:14 +t= 52.6 T= 0.8 + +39 10:46:17 10:46:32 +tcam= 54.4 Tcam= 0.8 tfl= 53.4 Tfl= 0.8 + +40 10:46:36 10:46:42 +t= 55.4 T= 0.8 + +21 18:37:16 18:37:19 +Rsk= 14.9 Rkk= 12.2 + +22 19:09:41 19:20:11 +P1= 26.1 T1=19:15:11 P2= 50.6 T2=19:20:11 Vs= 4.91 + +21 21:47:30 21:47:33 +Rsk= 14.8 Rkk= 12.0 + +22 22:39:54 22:55:24 +P1= 34.5 T1=22:50:24 P2= 46.0 T2=22:55:24 Vs= 2.29 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.353 new file mode 100644 index 0000000..9c61280 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.353 @@ -0,0 +1,26 @@ +13 01:20:06 1594153206 +0 01:20:06 1594153206 +14 01:46:55 1594154815 +15 02:25:32 1594157132 +16 02:40:46 1594158046 +1 03:14:43 1594160083 +2 05:37:43 1594168663 +5 06:46:52 1594172812 +6 06:59:20 1594173560 +7 07:29:41 1594175381 +8 08:02:59 1594177379 +25 10:40:27 1594186827 +9 10:47:48 1594187268 +10 11:21:30 1594189290 +11 12:55:20 1594194920 +12 15:44:29 1594205069 +13 17:41:12 1594212072 +0 17:41:12 1594212072 +14 18:35:39 1594215339 +15 19:21:08 1594218068 +16 19:50:37 1594219837 +1 20:37:32 1594222652 +2 21:45:15 1594226715 +5 22:57:16 1594231036 +6 23:10:09 1594231809 +7 23:51:34 1594234294 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.354 new file mode 100644 index 0000000..d092087 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.355 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.355 new file mode 100644 index 0000000..bb2b7a2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.355 @@ -0,0 +1,3 @@ +27 10:38:28 1594186708 +27 10:38:36 1594186716 +27 10:39:24 1594186764 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.356 new file mode 100644 index 0000000..68d8e92 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.356 @@ -0,0 +1,149 @@ +[51] +oper = 13 +begin = 08.07.2020 01:20:06 +norma = 45 +real = 26 + +[52] +oper = 14 +begin = 08.07.2020 01:46:55 +norma = 40 +vac_time = 7 +real = 38 + +[53] +oper = 15 +begin = 08.07.2020 02:25:32 +norma = 30 +real = 15 + +[54] +oper = 16 +begin = 08.07.2020 02:40:46 +norma = 40 +real = 33 + +[55] +oper = 1 +begin = 08.07.2020 03:14:43 +norma = 85 +real = 143 + +[56] +oper = 2 +begin = 08.07.2020 05:37:43 +norma = 110 +vac_time = 7 +real = 69 + +[57] +oper = 5 +begin = 08.07.2020 06:46:52 +norma = 25 +real = 12 + +[58] +oper = 6 +begin = 08.07.2020 06:59:20 +norma = 35 +real = 30 + +[59] +oper = 7 +begin = 08.07.2020 07:29:41 +norma = 30 +real = 33 + +[60] +oper = 8 +begin = 08.07.2020 08:02:59 +norma = 40 +vac_time = 6 +real = 157 + +[61] +oper = 25 +begin = 08.07.2020 10:40:27 +norma = 30 +real = 7 + +[62] +oper = 9 +begin = 08.07.2020 10:47:48 +norma = 0 +real = 33 + +[63] +oper = 10 +begin = 08.07.2020 11:21:30 +norma = 0 +real = 93 + +[64] +oper = 11 +begin = 08.07.2020 12:55:20 +norma = 0 +real = 169 + +[65] +oper = 12 +begin = 08.07.2020 15:44:29 +norma = 105 +real = 116 + +[66] +oper = 13 +begin = 08.07.2020 17:41:12 +norma = 45 +real = 54 + +[67] +oper = 14 +begin = 08.07.2020 18:35:39 +norma = 40 +vac_time = 6 +real = 45 + +[68] +oper = 15 +begin = 08.07.2020 19:21:08 +norma = 30 +real = 29 + +[69] +oper = 16 +begin = 08.07.2020 19:50:37 +norma = 40 +real = 46 + +[70] +oper = 1 +begin = 08.07.2020 20:37:32 +norma = 85 +real = 67 + +[71] +oper = 2 +begin = 08.07.2020 21:45:15 +norma = 110 +vac_time = 6 +real = 72 + +[72] +oper = 5 +begin = 08.07.2020 22:57:16 +norma = 25 +real = 12 + +[73] +oper = 6 +begin = 08.07.2020 23:10:09 +norma = 35 +real = 41 + +[74] +oper = 7 +begin = 08.07.2020 23:51:34 +norma = 30 +real = 22 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.357 new file mode 100644 index 0000000..cf3c268 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.357 @@ -0,0 +1,44 @@ +02:25:28 1594157128 祭 ० ࠧ +02:25:30 1594157130 祭 ० ' ⮪ 㣨' +02:25:31 1594157131 祭 ॣ '-2'(A) +02:39:41 1594157981 ⪫祭 ० ࠧ (A) +02:40:47 1594158047 ⪫祭 ० ' ⮪ 㣨' +02:40:48 1594158048 ⪫祭 ॣ '-2'(A) +02:40:58 1594158058 祭 ० ᪠ +02:40:59 1594158059 祭 ० ᪠ +02:44:00 1594158240 ⪫祭 ० ᪠ (A) +06:59:30 1594173570 祭 ० ᪠ +06:59:30 1594173570 祭 ० ᪠ +07:02:34 1594173754 ⪫祭 ० ᪠ (A) +10:38:00 1594186680 祭 ॣ '-2'(A) +10:38:26 1594186706 ⪫祭 ॣ '-2'(A) +10:39:28 1594186768 祭 ॣ '-2'(A) +10:39:30 1594186770 ⪫祭 ॣ '-2'(A) +10:39:36 1594186776 祭 ॣ '-2'(A) +10:40:12 1594186812 ⪫祭 ॣ '-2'(A) +10:47:18 1594187238 祭 ० ࠧ +10:47:19 1594187239 祭 ० ' ⮪ 㣨' +11:07:29 1594188449 祭 ॣ '-2'(A) +11:21:30 1594189290 ⪫祭 ० ࠧ (A) +11:21:30 1594189290 祭 ⠭ ॣ +12:55:19 1594194919 祭 ० +12:55:21 1594194921 ⪫祭 ॣ '-2'(A) +12:55:22 1594194922 祭 ॣ '-2'(A) +13:57:20 1594198640 ⪫祭 ॣ '-2'(A) +15:44:23 1594205063 ⪫祭 ० (A) +15:44:25 1594205065 ⪫祭 ० ' ⮪ 㣨' +15:45:12 1594205112 祭 ० ᪠ +15:48:13 1594205293 ⪫祭 ० ᪠ (A) +19:20:41 1594218041 祭 ० ࠧ +19:20:43 1594218043 祭 ० ' ⮪ 㣨' +19:21:33 1594218093 祭 ॣ '-2'(A) +19:47:40 1594219660 ⪫祭 ० ࠧ (A) +19:50:38 1594219838 ⪫祭 ० ' ⮪ 㣨' +19:50:40 1594219840 ⪫祭 ॣ '-2'(A) +19:50:54 1594219854 祭 ० ᪠ +19:50:54 1594219854 祭 ० ᪠ +19:53:54 1594220034 ⪫祭 ० ᪠ (A) +23:10:21 1594231821 祭 ० ᪠ +23:10:21 1594231821 祭 ० ᪠ +23:10:22 1594231822 祭 ० ᪠ +23:13:21 1594232001 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.359 new file mode 100644 index 0000000..5efcd76 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.361 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.361 new file mode 100644 index 0000000..a074fd1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.361 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.362 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.362 new file mode 100644 index 0000000..375a27d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.362 @@ -0,0 +1,42 @@ +21 09:14:48 09:14:51 +Rsk= 13.3 Rkk= 9.8 + +22 11:28:15 11:38:48 +P1= 44.8 T1=11:33:48 P2= 51.9 T2=11:38:48 Vs= 1.41 + +20 14:48:50 14:48:57 +Riz_sol= 2202.2 + +21 14:49:04 14:49:07 +Rsk= 13.2 Rkk= 9.5 + +22 15:39:32 15:55:04 +P1= 57.2 T1=15:50:04 P2= 71.5 T2=15:55:04 Vs= 2.85 + +22 16:27:40 16:43:12 +P1= 48.9 T1=16:38:12 P2= 59.7 T2=16:43:12 Vs= 2.17 + +23 16:43:30 16:43:36 + + +24 16:43:45 16:44:24 + + +30 16:44:39 16:45:07 +Vst= 28.8 + +31 16:45:15 16:45:42 +Rom_sol= -1.0 + +31 16:48:08 16:48:35 +Rom_sol= -1.0 + +31 16:51:42 16:52:10 +Rom_sol= -1.0 + +31 16:52:39 16:53:07 +Rom_sol= -1.0 + +31 16:56:35 16:57:03 +Rom_sol= -1.0 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.363 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.363 new file mode 100644 index 0000000..076734a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.363 @@ -0,0 +1,5 @@ +5 13:39:05 1594197545 +6 13:50:42 1594198242 +7 14:24:36 1594200276 +8 14:47:48 1594201668 +25 16:44:36 1594208676 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.364 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.364 new file mode 100644 index 0000000..31634eb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.364 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.365 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.365 new file mode 100644 index 0000000..c6d3178 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.365 @@ -0,0 +1,5 @@ +44 16:45:43 1594208743 +44 16:48:36 1594208916 +44 16:52:10 1594209130 +44 16:53:07 1594209187 +44 16:57:03 1594209423 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.366 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.366 new file mode 100644 index 0000000..f215557 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.366 @@ -0,0 +1,33 @@ +vac_time = 3 +vac_avg10 = 6.3 +[83] +oper = 5 +begin = 08.07.2020 13:39:05 +norma = 25 +real = 11 + +[84] +oper = 6 +begin = 08.07.2020 13:50:42 +norma = 35 +real = 33 + +[85] +oper = 7 +begin = 08.07.2020 14:24:36 +norma = 30 +real = 23 + +[86] +oper = 8 +begin = 08.07.2020 14:47:48 +norma = 40 +vac_time = 6 +real = 116 + +[87] +oper = 25 +begin = 08.07.2020 16:44:36 +norma = 30 +real = 463 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.367 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.367 new file mode 100644 index 0000000..91faa19 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.367 @@ -0,0 +1,60 @@ +13:53:26 1594198406 祭 ० ᪠ +13:53:26 1594198406 祭 ० ᪠ +13:53:28 1594198408 祭 ० ᪠ +13:53:28 1594198408 祭 ० ᪠ +13:53:29 1594198409 祭 ० ᪠ +13:53:29 1594198409 祭 ० ᪠ +13:53:29 1594198409 祭 ० ᪠ +13:53:30 1594198410 祭 ० ᪠ +13:53:30 1594198410 祭 ० ᪠ +13:53:30 1594198410 祭 ० ᪠ +13:53:30 1594198410 祭 ० ᪠ +13:53:31 1594198411 祭 ० ᪠ +13:53:31 1594198411 祭 ० ᪠ +13:53:32 1594198412 祭 ० ᪠ +13:53:32 1594198412 祭 ० ᪠ +13:53:32 1594198412 祭 ० ᪠ +13:53:33 1594198413 祭 ० ᪠ +13:53:33 1594198413 祭 ० ᪠ +13:53:33 1594198413 祭 ० ᪠ +13:53:34 1594198414 祭 ० ᪠ +13:53:49 1594198429 祭 ० ᪠ +13:53:49 1594198429 祭 ० ᪠ +13:53:49 1594198429 祭 ० ᪠ +13:53:49 1594198429 祭 ० ᪠ +13:53:50 1594198430 祭 ० ᪠ +13:53:50 1594198430 祭 ० ᪠ +13:53:50 1594198430 祭 ० ᪠ +13:53:50 1594198430 祭 ० ᪠ +13:53:50 1594198430 祭 ० ᪠ +13:54:19 1594198459 祭 ० ᪠ +13:54:20 1594198460 祭 ० ᪠ +13:54:20 1594198460 祭 ० ᪠ +13:54:20 1594198460 祭 ० ᪠ +13:54:21 1594198461 祭 ० ᪠ +13:54:21 1594198461 祭 ० ᪠ +13:54:21 1594198461 祭 ० ᪠ +13:54:22 1594198462 祭 ० ᪠ +13:54:22 1594198462 祭 ० ᪠ +13:54:22 1594198462 祭 ० ᪠ +13:54:23 1594198463 祭 ० ᪠ +13:54:23 1594198463 祭 ० ᪠ +13:54:24 1594198464 祭 ० ᪠ +13:54:25 1594198465 祭 ० ᪠ +13:54:25 1594198465 祭 ० ᪠ +13:54:25 1594198465 祭 ० ᪠ +13:54:26 1594198466 祭 ० ᪠ +13:54:27 1594198467 祭 ० ᪠ +13:54:27 1594198467 祭 ० ᪠ +13:54:27 1594198467 祭 ० ᪠ +13:54:28 1594198468 祭 ० ᪠ +13:54:28 1594198468 祭 ० ᪠ +13:54:29 1594198469 祭 ० ᪠ +13:54:29 1594198469 祭 ० ᪠ +13:54:30 1594198470 祭 ० ᪠ +13:54:30 1594198470 祭 ० ᪠ +13:54:31 1594198471 祭 ० ᪠ +16:43:48 1594208628 祭 ॣ '-2'(A) +16:44:25 1594208665 ⪫祭 ॣ '-2'(A) +17:05:03 1594209903 祭 ॣ '-2'(A) +17:05:04 1594209904 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.370 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.370 new file mode 100644 index 0000000..fc7871e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.370 @@ -0,0 +1,4 @@ +02:45:26 1594158326 1 06586 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 4740 9 4180 10 560 11 12 321730 +03:14:45 1594160085 0 A--32-106-2018 ॢ 2 +10:18:41 1594185521 3 14 +20:34:53 1594222493 1 06587 3 25 9 3250 10 495 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.371 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.371 new file mode 100644 index 0000000..eb21c8c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.371 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.372 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.372 new file mode 100644 index 0000000..76ec1d7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.372 @@ -0,0 +1,69 @@ +20 01:27:59 01:28:07 +Riz_sol= 4917.9 + +21 01:28:16 01:28:19 +Rsk= 13.6 Rkk= 9.1 + +22 02:21:28 02:36:33 +P1= 50.5 T1=02:31:33 P2= 64.5 T2=02:36:33 Vs= 2.79 + +23 02:36:49 02:36:54 + + +24 02:37:12 02:37:47 + + +30 02:38:11 02:38:46 +Vst= 28.5 + +31 02:38:57 02:39:32 +Rom_sol= 10.5 + +41 02:39:55 02:40:00 +Ukz= 1.93 + +32 02:40:06 02:40:41 +Imax=10.9 Umax=50.0 T= 9.0 + +33 02:40:47 02:41:07 +Imin=15.9 Umin=24.9 T= 0.5 + +34 02:41:10 02:41:33 +V=300.1 T= 9.4 + +35 02:41:39 02:42:38 +Q= 53.6 T= 9.4 + +36 02:42:48 02:43:24 +P1=0.29 T= 2.9 + +37 02:43:28 02:43:59 +T= 0.9 + +38 02:44:03 02:44:11 +t= 54.5 T= 0.5 + +39 02:44:14 02:44:29 +tcam= 53.4 Tcam= 0.5 tfl= 58.0 Tfl= 0.5 + +40 02:44:32 02:44:40 +t= 52.4 T= 0.5 + +21 10:18:50 10:18:53 +Rsk= 13.2 Rkk= 8.7 + +22 11:00:20 11:10:24 +P1= 24.1 T1=11:05:24 P2= 43.1 T2=11:10:24 Vs= 3.79 + +21 20:35:09 20:35:12 +Rsk= 13.2 Rkk= 8.6 + +22 21:13:57 21:29:01 +P1= 65.3 T1=21:24:01 P2= 86.5 T2=21:29:01 Vs= 4.23 + +22 21:43:36 21:58:40 +P1= 54.7 T1=21:53:40 P2= 71.2 T2=21:58:40 Vs= 3.30 + +22 22:19:30 22:34:35 +P1= 44.5 T1=22:29:35 P2= 58.7 T2=22:34:35 Vs= 2.83 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.373 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.373 new file mode 100644 index 0000000..4d1f715 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.373 @@ -0,0 +1,18 @@ +5 00:01:34 1594148494 +6 00:13:54 1594149234 +7 00:50:47 1594151447 +8 01:21:21 1594153281 +25 02:38:08 1594157888 +9 02:45:26 1594158326 +10 03:14:45 1594160085 +12 06:45:02 1594172702 +13 09:53:17 1594183997 +0 09:53:17 1594183997 +14 10:16:56 1594185416 +15 12:13:55 1594192435 +16 12:30:51 1594193451 +1 13:15:16 1594196116 +2 20:31:47 1594222307 +5 22:36:21 1594229781 +6 22:46:46 1594230406 +7 23:31:24 1594233084 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.374 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.374 new file mode 100644 index 0000000..2ac8f9a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.374 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.376 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.376 new file mode 100644 index 0000000..5871e47 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.376 @@ -0,0 +1,105 @@ +[71] +oper = 5 +begin = 08.07.2020 00:01:34 +norma = 25 +real = 12 + +[72] +oper = 6 +begin = 08.07.2020 00:13:54 +norma = 35 +real = 36 + +[73] +oper = 7 +begin = 08.07.2020 00:50:47 +norma = 30 +real = 30 + +[74] +oper = 8 +begin = 08.07.2020 01:21:21 +norma = 40 +vac_time = 9 +real = 76 + +[75] +oper = 25 +begin = 08.07.2020 02:38:08 +norma = 30 +real = 7 + +[76] +oper = 9 +begin = 08.07.2020 02:45:26 +norma = 0 +real = 29 + +[77] +oper = 10 +begin = 08.07.2020 03:14:45 +norma = 0 +real = 210 + +[78] +oper = 12 +begin = 08.07.2020 06:45:02 +norma = 105 +real = 188 + +[79] +oper = 13 +begin = 08.07.2020 09:53:17 +norma = 45 +real = 23 + +[80] +oper = 14 +begin = 08.07.2020 10:16:56 +norma = 40 +vac_time = 7 +real = 116 + +[81] +oper = 15 +begin = 08.07.2020 12:13:55 +norma = 30 +real = 16 + +[82] +oper = 16 +begin = 08.07.2020 12:30:51 +norma = 40 +real = 44 + +[83] +oper = 1 +begin = 08.07.2020 13:15:16 +norma = 85 +real = 436 + +[84] +oper = 2 +begin = 08.07.2020 20:31:47 +norma = 110 +vac_time = 10 +real = 124 + +[85] +oper = 5 +begin = 08.07.2020 22:36:21 +norma = 25 +real = 10 + +[86] +oper = 6 +begin = 08.07.2020 22:46:46 +norma = 35 +real = 44 + +[87] +oper = 7 +begin = 08.07.2020 23:31:24 +norma = 30 +real = 48 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.377 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.377 new file mode 100644 index 0000000..54795ed --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.377 @@ -0,0 +1,29 @@ +00:14:28 1594149268 祭 ० ᪠ +00:17:12 1594149432 ⪫祭 ० ᪠ (A) +02:37:13 1594157833 祭 ॣ '-2'(A) +02:37:47 1594157867 ⪫祭 ॣ '-2'(A) +02:44:52 1594158292 祭 ० ࠧ +02:44:54 1594158294 祭 ० ' ⮪ 㣨' +02:46:46 1594158406 祭 ॣ '-2'(A) +03:14:45 1594160085 ⪫祭 ० ࠧ (A) +03:14:45 1594160085 祭 ⠭ ॣ +06:33:06 1594171986 祭 ० +06:33:07 1594171987 ⪫祭 ॣ '-2'(A) +06:33:08 1594171988 祭 ॣ '-2'(A) +06:45:04 1594172704 ⪫祭 ० ' ⮪ 㣨' +06:45:06 1594172706 ⪫祭 ॣ '-2'(A) +06:45:18 1594172718 祭 ० ᪠ +06:48:02 1594172882 ⪫祭 ० ᪠ (A) +07:43:07 1594176187 ⪫祭 ० (A) +12:12:57 1594192377 祭 ० ࠧ +12:12:58 1594192378 祭 ० ' ⮪ 㣨' +12:14:41 1594192481 祭 ॣ '-2'(A) +12:30:52 1594193452 ⪫祭 ० ' ⮪ 㣨' +12:30:54 1594193454 ⪫祭 ॣ '-2'(A) +12:31:14 1594193474 祭 ० ᪠ +12:31:14 1594193474 祭 ० ᪠ +12:31:14 1594193474 祭 ० ᪠ +12:32:08 1594193528 ⪫祭 ० ࠧ (A) +12:33:56 1594193636 ⪫祭 ० ᪠ (A) +22:47:09 1594230429 祭 ० ᪠ +22:50:23 1594230623 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.379 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.379 new file mode 100644 index 0000000..739ed07 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.379 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.390 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.390 new file mode 100644 index 0000000..cf16dde --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.390 @@ -0,0 +1,5 @@ +08:58:07 1594180687 3 14 +10:51:46 1594187506 0 A--32-067-2014 ॢ 0 +17:32:11 1594211531 1 09428 3 25 8 4900 9 3680 10 495 12 321021 +23:09:22 1594231762 1 09428 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 4900 9 3680 10 495 11 12 321021 +23:34:40 1594233280 0 A--32-090-2018 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.391 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.391 new file mode 100644 index 0000000..5958302 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.391 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.392 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.392 new file mode 100644 index 0000000..ade5fa7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.392 @@ -0,0 +1,75 @@ +21 08:57:46 08:57:54 +Rsk= 19.9 Rkk= 14.5 + +22 09:44:20 09:54:27 +P1= 59.6 T1=09:49:27 P2= 70.6 T2=09:54:27 Vs= 2.19 + +21 17:29:59 17:30:06 +Rsk= 19.7 Rkk= 14.3 + +22 18:07:22 18:22:30 +P1= 97.4 T1=18:17:30 P2=120.6 T2=18:22:30 Vs= 4.64 + +22 18:35:55 18:51:02 +P1= 88.0 T1=18:46:02 P2=107.3 T2=18:51:02 Vs= 3.86 + +22 18:59:12 19:14:19 +P1= 85.8 T1=19:09:19 P2=103.5 T2=19:14:19 Vs= 3.53 + +22 19:29:17 19:44:24 +P1= 78.1 T1=19:39:24 P2= 93.3 T2=19:44:24 Vs= 3.04 + +21 21:10:04 21:10:11 +Rsk= 19.9 Rkk= 14.6 + +20 21:10:18 21:10:28 +Riz_sol= 27.4 + +22 21:53:17 22:08:25 +P1= 78.5 T1=22:03:25 P2= 93.3 T2=22:08:25 Vs= 2.95 + +22 22:43:32 22:58:39 +P1= 73.6 T1=22:53:39 P2= 86.7 T2=22:58:39 Vs= 2.61 + +23 22:59:12 22:59:19 + + +24 22:59:25 22:59:59 + + +30 23:00:08 23:00:49 +Vst= 27.3 + +31 23:00:56 23:01:34 +Rom_sol= 17.9 + +41 23:02:10 23:02:15 +Ukz= 2.15 + +32 23:02:22 23:03:30 +Imax=11.1 Umax=50.0 T= 9.2 + +33 23:03:35 23:04:06 +Imin=16.2 Umin=25.0 T= 2.3 + +34 23:04:11 23:04:39 +V=301.4 T= 9.5 + +35 23:04:46 23:06:05 +Q= 55.0 T= 9.2 + +36 23:06:13 23:06:47 +P1=0.27 T= 3.1 + +37 23:06:52 23:07:20 +T= 0.7 + +38 23:07:25 23:07:33 +t= 51.5 T= 0.7 + +39 23:07:41 23:07:50 +t= 51.6 T= 0.7 + +40 23:07:56 23:08:03 +t= 51.6 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.393 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.393 new file mode 100644 index 0000000..7151d89 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.393 @@ -0,0 +1,16 @@ +12 04:43:20 1594165400 +13 07:49:37 1594176577 +0 07:49:38 1594176578 +14 08:56:02 1594180562 +15 10:33:16 1594186396 +16 10:51:46 1594187506 +16 10:54:43 1594187683 +1 11:46:11 1594190771 +2 17:25:18 1594211118 +5 19:49:18 1594219758 +6 19:59:25 1594220365 +7 20:44:03 1594223043 +8 21:06:48 1594224408 +25 23:00:05 1594231205 +9 23:09:22 1594231762 +10 23:34:40 1594233280 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.394 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.394 new file mode 100644 index 0000000..0b6d560 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.394 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.395 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.395 new file mode 100644 index 0000000..f655f73 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.395 @@ -0,0 +1 @@ +107 18:59:06 1594216746 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.396 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.396 new file mode 100644 index 0000000..45645b1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.396 @@ -0,0 +1,93 @@ +[34] +oper = 12 +begin = 08.07.2020 04:43:20 +norma = 180 +real = 186 + +[35] +oper = 13 +begin = 08.07.2020 07:49:37 +norma = 45 +real = 66 + +[36] +oper = 14 +begin = 08.07.2020 08:56:02 +norma = 40 +vac_time = 8 +real = 97 + +[37] +oper = 15 +begin = 08.07.2020 10:33:16 +norma = 30 +real = 18 + +[38] +oper = 16 +begin = 08.07.2020 10:51:46 +norma = 40 +real = 2 + +[39] +oper = 16 +begin = 08.07.2020 10:54:43 +norma = 40 +real = 51 + +[40] +oper = 1 +begin = 08.07.2020 11:46:11 +norma = 85 +real = 339 + +[41] +oper = 2 +begin = 08.07.2020 17:25:18 +norma = 110 +vac_time = 9 +real = 144 + +[42] +oper = 5 +begin = 08.07.2020 19:49:18 +norma = 25 +real = 10 + +[43] +oper = 6 +begin = 08.07.2020 19:59:25 +norma = 35 +real = 44 + +[44] +oper = 7 +begin = 08.07.2020 20:44:03 +norma = 30 +real = 22 + +[45] +oper = 8 +begin = 08.07.2020 21:06:48 +norma = 40 +vac_time = 9 +real = 113 + +[46] +oper = 25 +begin = 08.07.2020 23:00:05 +norma = 30 +real = 9 + +[47] +oper = 9 +begin = 08.07.2020 23:09:22 +norma = 0 +real = 25 + +[48] +oper = 10 +begin = 08.07.2020 23:34:40 +norma = 0 +real = 174 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.397 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.397 new file mode 100644 index 0000000..1bac9d9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.397 @@ -0,0 +1,25 @@ +04:43:23 1594165403 ⪫祭 ॣ '-2'(A) +04:44:03 1594165443 祭 ० ᪠ +04:46:19 1594165579 ⪫祭 ० ᪠ (A) +10:32:09 1594186329 祭 ० ࠧ +10:32:10 1594186330 祭 ० ' ⮪ 㣨' +10:34:09 1594186449 祭 ॣ '-2'(A) +10:51:46 1594187506 ⪫祭 ० ࠧ (A) +10:54:45 1594187685 ⪫祭 ० ' ⮪ 㣨' +10:54:47 1594187687 ⪫祭 ॣ '-2'(A) +10:55:03 1594187703 祭 ० ᪠ +10:55:03 1594187703 祭 ० ᪠ +10:55:03 1594187703 祭 ० ᪠ +10:55:03 1594187703 祭 ० ᪠ +10:55:03 1594187703 祭 ० ᪠ +10:55:04 1594187704 祭 ० ᪠ +10:57:46 1594187866 ⪫祭 ० ᪠ (A) +20:01:42 1594220502 祭 ० ᪠ +20:04:27 1594220667 ⪫祭 ० ᪠ (A) +22:59:26 1594231166 祭 ॣ '-2'(A) +23:00:00 1594231200 ⪫祭 ॣ '-2'(A) +23:08:21 1594231701 祭 ० ࠧ +23:08:23 1594231703 祭 ० ' ⮪ 㣨' +23:10:41 1594231841 祭 ॣ '-2'(A) +23:34:40 1594233280 ⪫祭 ० ࠧ (A) +23:34:41 1594233281 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.399 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.399 new file mode 100644 index 0000000..6c12f8d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.399 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.410 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.410 new file mode 100644 index 0000000..28ee4ec --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.410 @@ -0,0 +1,7 @@ +01:28:17 1594153697 3 14 +05:13:24 1594167204 1 11452 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 9 4480 10 690 +05:20:10 1594167610 1 11452 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4660 9 4480 10 690 11 12 320839 +06:02:43 1594170163 0 A--32-031-2016 ॢ 5 +18:05:57 1594213557 1 11453 8 3810 9 4790 10 650 +23:00:05 1594231205 1 11453 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3810 9 4790 10 650 11 12 320839 +23:33:13 1594233193 0 A--32-129-2018 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.411 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.411 new file mode 100644 index 0000000..52b73b5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.411 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.412 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.412 new file mode 100644 index 0000000..5f99b2a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.412 @@ -0,0 +1,120 @@ +21 01:28:35 01:28:38 +Rsk= 9.5 Rkk= 6.5 + +22 01:44:56 01:55:03 +P1= 37.6 T1=01:50:03 P2= 57.5 T2=01:55:03 Vs= 3.97 + +20 04:26:36 04:26:45 +Riz_sol= 4756.2 + +21 04:26:50 04:26:53 +Rsk= 9.4 Rkk= 6.4 + +22 04:54:56 05:10:03 +P1= 48.9 T1=05:05:03 P2= 60.3 T2=05:10:03 Vs= 2.29 + +23 05:10:15 05:10:20 + + +24 05:10:28 05:11:03 + + +30 05:11:13 05:11:40 +Vst= 32.1 + +31 05:11:45 05:12:18 +Rom_sol= 9.6 + +32 05:14:24 05:14:59 +Imax=11.0 Umax=50.0 T= 9.0 + +33 05:15:05 05:15:25 +Imin=16.0 Umin=25.0 T= 0.5 + +34 05:15:29 05:15:52 +V=300.2 T= 9.5 + +35 05:15:54 05:17:36 +Q= 51.0 T= 9.4 + +36 05:17:39 05:18:42 +P1=0.27 T= 2.9 + +37 05:18:44 05:19:07 +T= 1.0 + +38 05:19:11 05:19:19 +t= 51.8 T= 0.6 + +39 05:19:24 05:19:39 +tcam= 51.8 Tcam= 0.6 tfl= 54.2 Tfl= 0.6 + +40 05:19:42 05:19:48 +t= 51.9 T= 0.5 + +21 18:04:36 18:04:39 +Rsk= 8.9 Rkk= 5.9 + +22 18:30:04 18:45:11 +P1= 86.5 T1=18:40:11 P2=107.1 T2=18:45:11 Vs= 4.12 + +22 19:00:11 19:15:19 +P1= 50.6 T1=19:10:19 P2= 63.8 T2=19:15:19 Vs= 2.64 + +21 20:33:19 20:33:22 +Rsk= 8.8 Rkk= 5.9 + +20 20:33:29 20:33:38 +Riz_sol= 4756.0 + +22 21:11:14 21:26:22 +P1= 53.9 T1=21:21:22 P2= 69.0 T2=21:26:22 Vs= 3.02 + +22 21:33:39 21:48:46 +P1= 46.2 T1=21:43:46 P2= 58.7 T2=21:48:46 Vs= 2.49 + +22 22:34:57 22:45:04 +P1= 19.2 T1=22:40:04 P2= 31.7 T2=22:45:04 Vs= 2.51 + +23 22:50:07 22:50:12 + + +24 22:50:23 22:51:00 + + +30 22:51:15 22:51:43 +Vst= 31.2 + +31 22:51:50 22:52:24 +Rom_sol= 9.9 + +41 22:53:00 22:53:05 +Ukz= 1.68 + +32 22:53:11 22:53:47 +Imax=11.0 Umax=50.0 T= 9.0 + +33 22:53:51 22:54:10 +Imin=16.0 Umin=25.0 T= 0.5 + +34 22:54:16 22:54:39 +V=300.2 T= 9.5 + +35 22:54:44 22:56:05 +Q= 53.1 T= 9.5 + +36 22:56:09 22:56:43 +P1=0.29 T= 3.0 + +37 22:57:15 22:57:38 +T= 1.0 + +38 22:57:41 22:57:48 +t= 51.9 T= 0.6 + +39 22:57:58 22:58:13 +tcam= 52.9 Tcam= 0.5 tfl= 56.6 Tfl= 0.5 + +40 22:58:18 22:58:25 +t= 51.8 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.413 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.413 new file mode 100644 index 0000000..f20d020 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.413 @@ -0,0 +1,22 @@ +13 01:09:52 1594152592 +0 01:09:52 1594152592 +14 01:25:39 1594153539 +15 01:55:37 1594155337 +16 02:25:13 1594157113 +1 03:05:06 1594159506 +8 04:20:11 1594164011 +25 05:11:08 1594167068 +9 05:20:10 1594167610 +10 06:02:44 1594170164 +11 09:41:21 1594183281 +12 12:28:20 1594193300 +13 14:18:24 1594199904 +0 14:18:24 1594199904 +2 17:59:42 1594213182 +5 19:16:04 1594217764 +6 19:27:50 1594218470 +7 20:03:45 1594220625 +8 20:29:33 1594222173 +25 22:51:11 1594230671 +9 23:00:05 1594231205 +10 23:33:13 1594233193 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.414 new file mode 100644 index 0000000..6b21db3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.415 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.415 new file mode 100644 index 0000000..eb62b8f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.415 @@ -0,0 +1,2 @@ +47 05:14:03 1594167243 +47 22:57:01 1594231021 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.416 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.416 new file mode 100644 index 0000000..f74f666 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.416 @@ -0,0 +1,124 @@ +[68] +oper = 13 +begin = 08.07.2020 01:09:52 +norma = 45 +real = 15 + +[69] +oper = 14 +begin = 08.07.2020 01:25:39 +norma = 40 +vac_time = 7 +real = 29 + +[70] +oper = 15 +begin = 08.07.2020 01:55:37 +norma = 30 +real = 29 + +[71] +oper = 16 +begin = 08.07.2020 02:25:13 +norma = 40 +real = 39 + +[72] +oper = 1 +begin = 08.07.2020 03:05:06 +norma = 85 +real = 75 + +[73] +oper = 8 +begin = 08.07.2020 04:20:11 +norma = 40 +vac_time = 8 +real = 50 + +[74] +oper = 25 +begin = 08.07.2020 05:11:08 +norma = 30 +real = 9 + +[75] +oper = 9 +begin = 08.07.2020 05:20:10 +norma = 0 +real = 42 + +[76] +oper = 10 +begin = 08.07.2020 06:02:44 +norma = 0 +real = 218 + +[77] +oper = 11 +begin = 08.07.2020 09:41:21 +norma = 0 +real = 166 + +[78] +oper = 12 +begin = 08.07.2020 12:28:20 +norma = 105 +real = 110 + +[79] +oper = 13 +begin = 08.07.2020 14:18:24 +norma = 45 +real = 221 + +[80] +oper = 2 +begin = 08.07.2020 17:59:42 +norma = 110 +vac_time = 8 +real = 76 + +[81] +oper = 5 +begin = 08.07.2020 19:16:04 +norma = 25 +real = 11 + +[82] +oper = 6 +begin = 08.07.2020 19:27:50 +norma = 35 +real = 35 + +[83] +oper = 7 +begin = 08.07.2020 20:03:45 +norma = 30 +real = 25 + +[84] +oper = 8 +begin = 08.07.2020 20:29:33 +norma = 40 +vac_time = 8 +real = 141 + +[85] +oper = 25 +begin = 08.07.2020 22:51:11 +norma = 30 +real = 8 + +[86] +oper = 9 +begin = 08.07.2020 23:00:05 +norma = 0 +real = 33 + +[87] +oper = 10 +begin = 08.07.2020 23:33:13 +norma = 0 +real = 256 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.417 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.417 new file mode 100644 index 0000000..18cf120 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.417 @@ -0,0 +1,43 @@ +01:55:19 1594155319 祭 ० ࠧ +01:55:47 1594155347 祭 ० ' ⮪ 㣨' +01:55:48 1594155348 祭 ॣ '-2'(A) +02:11:54 1594156314 ⪫祭 ० ' ⮪ 㣨' +02:23:53 1594157033 ⪫祭 ० ࠧ (A) +02:25:17 1594157117 ⪫祭 ॣ '-2'(A) +02:25:48 1594157148 祭 ० ᪠ +02:27:55 1594157275 ⪫祭 ० ᪠ (A) +05:10:28 1594167028 祭 ॣ '-2'(A) +05:11:02 1594167062 ⪫祭 ॣ '-2'(A) +05:19:53 1594167593 祭 ० ࠧ +05:19:55 1594167595 祭 ० ' ⮪ 㣨' +05:45:40 1594169140 祭 ॣ '-2'(A) +06:02:43 1594170163 ⪫祭 ० ࠧ (A) +06:02:44 1594170164 祭 ⠭ ॣ +09:41:20 1594183280 祭 ० +09:41:21 1594183281 ⪫祭 ॣ '-2'(A) +09:41:22 1594183282 祭 ॣ '-2'(A) +11:33:18 1594189998 ⪫祭 ॣ '-2'(A) +12:28:14 1594193294 ⪫祭 ० (A) +12:28:21 1594193301 ⪫祭 ० ' ⮪ 㣨' +12:28:43 1594193323 祭 ० ᪠ +12:28:43 1594193323 祭 ० ᪠ +12:28:44 1594193324 祭 ० ᪠ +12:28:44 1594193324 祭 ० ᪠ +12:28:44 1594193324 祭 ० ᪠ +12:28:44 1594193324 祭 ० ᪠ +12:28:45 1594193325 祭 ० ᪠ +12:30:49 1594193449 ⪫祭 ० ᪠ (A) +19:28:18 1594218498 祭 ० ᪠ +19:28:18 1594218498 祭 ० ᪠ +19:28:18 1594218498 祭 ० ᪠ +19:28:18 1594218498 祭 ० ᪠ +19:28:19 1594218499 祭 ० ᪠ +19:28:19 1594218499 祭 ० ᪠ +19:30:24 1594218624 ⪫祭 ० ᪠ (A) +22:50:25 1594230625 祭 ॣ '-2'(A) +22:51:00 1594230660 ⪫祭 ॣ '-2'(A) +22:59:45 1594231185 祭 ० ࠧ +22:59:47 1594231187 祭 ० ' ⮪ 㣨' +23:01:18 1594231278 祭 ॣ '-2'(A) +23:33:13 1594233193 祭 ⠭ ॣ +23:33:13 1594233193 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.419 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.419 new file mode 100644 index 0000000..308a265 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.419 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.420 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.420 new file mode 100644 index 0000000..9f55a56 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.420 @@ -0,0 +1 @@ +21:39:44 1594226384 1 09421 3 37 7 870 9 6090 10 770 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.421 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.421 new file mode 100644 index 0000000..77b8b35 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.421 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.422 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.422 new file mode 100644 index 0000000..59ec4f1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.422 @@ -0,0 +1,48 @@ +21 19:05:32 19:05:35 +Rsk= 4.9 Rkk= 5.3 + +21 19:05:38 19:05:41 +Rsk= 4.9 Rkk= 5.4 + +21 19:05:44 19:05:47 +Rsk= 5.0 Rkk= 5.4 + +21 19:05:49 19:05:52 +Rsk= 5.0 Rkk= 5.4 + +21 19:05:55 19:05:58 +Rsk= 5.0 Rkk= 5.4 + +21 19:21:45 19:21:48 +Rsk= 4.9 Rkk= 5.4 + +21 19:22:06 19:22:09 +Rsk= 4.9 Rkk= 5.4 + +21 19:22:18 19:22:21 +Rsk= 5.0 Rkk= 5.4 + +21 19:48:48 19:48:51 +Rsk= 5.0 Rkk= 5.4 + +21 19:50:34 19:50:37 +Rsk= 5.0 Rkk= 5.4 + +21 19:50:57 19:51:00 +Rsk= 5.0 Rkk= 5.4 + +21 20:37:55 20:37:58 +Rsk= 5.0 Rkk= 5.4 + +21 21:37:07 21:37:10 +Rsk= 5.1 Rkk= 5.4 + +21 21:37:43 21:37:46 +Rsk= 5.2 Rkk= 5.4 + +22 22:35:05 22:50:09 +P1= 57.2 T1=22:45:09 P2= 79.2 T2=22:50:09 Vs= 4.40 + +22 23:20:04 23:30:07 +P1= 18.6 T1=23:25:07 P2= 33.5 T2=23:30:07 Vs= 2.97 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.423 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.423 new file mode 100644 index 0000000..85fb46d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.423 @@ -0,0 +1,5 @@ +2 21:36:34 1594226194 +5 23:31:56 1594233116 +6 23:39:19 1594233559 +5 23:48:09 1594234089 +6 23:58:42 1594234722 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.424 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.424 new file mode 100644 index 0000000..d259b66 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.424 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.426 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.426 new file mode 100644 index 0000000..0c80839 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.426 @@ -0,0 +1,31 @@ +[09] +oper = 2 +begin = 08.07.2020 21:36:34 +norma = 110 +vac_time = 9 +real = 115 + +[10] +oper = 5 +begin = 08.07.2020 23:31:56 +norma = 25 +real = 7 + +[11] +oper = 6 +begin = 08.07.2020 23:39:19 +norma = 35 +real = 8 + +[12] +oper = 5 +begin = 08.07.2020 23:48:09 +norma = 25 +real = 10 + +[13] +oper = 6 +begin = 08.07.2020 23:58:42 +norma = 35 +real = 166 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.427 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.427 new file mode 100644 index 0000000..bbb41b3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.427 @@ -0,0 +1 @@ +23:59:29 1594234769 祭 ० ᪠ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.440 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.440 new file mode 100644 index 0000000..c09806b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.440 @@ -0,0 +1,4 @@ +06:40:02 1594172402 1 09883 8 4370 9 4240 +13:44:32 1594197872 1 09883 2 BT 18, 20, 22, 23, 25 3 25 4 1 5 Ti 6 7 670 8 4370 9 4240 10 560 11 12 1718 +14:14:05 1594199645 0 A--32-106-2018 ॢ 2 +22:34:36 1594229676 1 09884 7 770 9 5120 10 650 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.441 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.441 new file mode 100644 index 0000000..640b6e5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.441 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.442 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.442 new file mode 100644 index 0000000..abf1abd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.442 @@ -0,0 +1,66 @@ +21 06:39:05 06:39:12 +Rsk= 17.4 Rkk= 14.0 + +22 07:29:27 07:45:00 +P1= 49.5 T1=07:40:00 P2= 62.3 T2=07:45:00 Vs= 2.56 + +20 10:18:02 10:18:12 +Riz_sol= 126.6 + +21 10:18:17 10:18:25 +Rsk= 17.1 Rkk= 13.8 + +22 12:06:34 12:17:07 +P1= 10.9 T1=12:12:07 P2= 17.6 T2=12:17:07 Vs= 1.33 + +22 13:22:00 13:32:33 +P1= 21.8 T1=13:27:33 P2= 30.6 T2=13:32:33 Vs= 1.75 + +23 13:32:56 13:33:02 + + +24 13:33:19 13:33:56 + + +30 13:34:12 13:34:53 +Vst= 30.0 + +31 13:34:56 13:35:49 +Rom_sol= 13.7 + +41 13:36:25 13:36:30 +Ukz= 1.48 + +32 05:00:00 13:37:51 +Imax=11.4 Umax=49.9 T= 9.4 + +33 13:37:55 13:39:14 +Imin=16.6 Umin=25.0 T= 0.8 + +34 13:39:17 13:39:57 +V=301.5 T= 9.6 + +35 13:40:00 13:41:06 +Q= 54.9 T= 9.3 + +40 13:41:10 13:41:23 +t= 52.1 T= 0.5 + +39 13:41:26 13:41:46 +t= 51.6 T= 0.7 + +38 13:41:50 13:41:58 +t= 51.9 T= 0.5 + +37 13:42:01 13:42:34 +T= 0.8 + +36 13:42:38 13:43:12 +P1=0.28 T= 3.0 + +21 22:34:53 22:35:01 +Rsk= 17.2 Rkk= 14.0 + +22 23:14:38 23:30:11 +P1= 48.6 T1=23:25:11 P2= 62.3 T2=23:30:11 Vs= 2.74 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.443 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.443 new file mode 100644 index 0000000..18b11aa --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.443 @@ -0,0 +1,17 @@ +12 02:52:01 1594158721 +13 05:54:00 1594169640 +0 05:54:00 1594169640 +2 06:36:32 1594172192 +5 07:46:07 1594176367 +6 07:55:37 1594176937 +7 10:06:40 1594184800 +8 10:17:07 1594185427 +25 13:34:09 1594197249 +9 13:44:32 1594197872 +10 14:14:05 1594199645 +12 17:49:46 1594212586 +13 20:51:36 1594223496 +0 20:51:36 1594223496 +2 22:30:42 1594229442 +5 23:30:51 1594233051 +6 23:43:37 1594233817 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.444 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.444 new file mode 100644 index 0000000..20a5776 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.444 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.445 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.445 new file mode 100644 index 0000000..644327b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.445 @@ -0,0 +1 @@ +25 13:33:15 1594197195 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.446 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.446 new file mode 100644 index 0000000..3c504aa --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.446 @@ -0,0 +1,93 @@ +[14] +oper = 12 +begin = 08.07.2020 02:52:01 +norma = 105 +real = 181 + +[15] +oper = 13 +begin = 08.07.2020 05:54:00 +norma = 45 +real = 42 + +[16] +oper = 2 +begin = 08.07.2020 06:36:32 +norma = 110 +vac_time = 8 +real = 69 + +[17] +oper = 5 +begin = 08.07.2020 07:46:07 +norma = 25 +real = 9 + +[18] +oper = 6 +begin = 08.07.2020 07:55:37 +norma = 35 +real = 131 + +[19] +oper = 7 +begin = 08.07.2020 10:06:40 +norma = 30 +real = 10 + +[20] +oper = 8 +begin = 08.07.2020 10:17:07 +norma = 40 +vac_time = 8 +real = 197 + +[21] +oper = 25 +begin = 08.07.2020 13:34:09 +norma = 30 +real = 10 + +[22] +oper = 9 +begin = 08.07.2020 13:44:32 +norma = 0 +real = 29 + +[23] +oper = 10 +begin = 08.07.2020 14:14:05 +norma = 0 +real = 215 + +[24] +oper = 12 +begin = 08.07.2020 17:49:46 +norma = 105 +real = 181 + +[25] +oper = 13 +begin = 08.07.2020 20:51:36 +norma = 45 +real = 99 + +[26] +oper = 2 +begin = 08.07.2020 22:30:42 +norma = 110 +vac_time = 9 +real = 60 + +[27] +oper = 5 +begin = 08.07.2020 23:30:51 +norma = 25 +real = 12 + +[28] +oper = 6 +begin = 08.07.2020 23:43:37 +norma = 35 +real = 43 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.447 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.447 new file mode 100644 index 0000000..f24cef5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.447 @@ -0,0 +1,31 @@ +02:39:06 1594157946 祭 ० +02:39:07 1594157947 ⪫祭 ॣ '-2'(A) +02:39:08 1594157948 祭 ॣ '-2'(A) +02:51:58 1594158718 ⪫祭 ० ' ⮪ 㣨' +02:52:05 1594158725 ⪫祭 ॣ '-2'(A) +02:53:03 1594158783 ⪫祭 ० +02:53:39 1594158819 祭 ० ᪠ +02:56:19 1594158979 ⪫祭 ० ᪠ (A) +07:56:15 1594176975 祭 ० ᪠ +07:58:59 1594177139 ⪫祭 ० ᪠ (A) +13:33:09 1594197189 祭 ॣ '-2'(A) +13:33:15 1594197195 ⪫祭 ॣ '-2'(A) +13:33:20 1594197200 祭 ॣ '-2'(A) +13:33:56 1594197236 ⪫祭 ॣ '-2'(A) +13:43:20 1594197800 祭 ० ࠧ +13:43:37 1594197817 祭 ० ' ⮪ 㣨' +13:46:07 1594197967 祭 ॣ '-2'(A) +14:14:05 1594199645 ⪫祭 ० ࠧ (A) +14:14:06 1594199646 祭 ⠭ ॣ +17:37:10 1594211830 祭 ० +17:37:10 1594211830 ⪫祭 ॣ '-2'(A) +17:37:11 1594211831 祭 ॣ '-2'(A) +17:45:22 1594212322 ⪫祭 ० ' ⮪ 㣨' +17:49:50 1594212590 ⪫祭 ॣ '-2'(A) +17:50:11 1594212611 祭 ० ᪠ +17:50:11 1594212611 祭 ० ᪠ +17:53:24 1594212804 ⪫祭 ० ᪠ (A) +18:47:10 1594216030 ⪫祭 ० (A) +23:43:57 1594233837 祭 ० ᪠ +23:43:57 1594233837 祭 ० ᪠ +23:47:15 1594234035 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.449 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.449 new file mode 100644 index 0000000..3b828db Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.449 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.450 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.450 new file mode 100644 index 0000000..89834f6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.450 @@ -0,0 +1,4 @@ +09:04:07 1594181047 3 14 +12:40:53 1594194053 3 25 4 1 7 770 9 6090 10 650 +15:10:44 1594203044 1 11459 +17:53:53 1594212833 1 11459 2 p. cao M1,M2,M3,M4 3 25 4 1 5 Ti 6 7 770 8 3000 9 6090 10 650 11 12 321731 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.451 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.451 new file mode 100644 index 0000000..3efd794 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.451 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.452 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.452 new file mode 100644 index 0000000..f329c36 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.452 @@ -0,0 +1,69 @@ +21 09:04:18 09:04:21 +Rsk= 16.1 Rkk= 12.4 + +22 09:24:13 09:39:18 +P1= 63.7 T1=09:34:18 P2= 86.3 T2=09:39:18 Vs= 4.52 + +21 12:41:44 12:41:47 +Rsk= 16.3 Rkk= 12.7 + +22 13:14:41 13:29:45 +P1= 57.0 T1=13:24:45 P2= 78.7 T2=13:29:45 Vs= 4.35 + +21 14:31:13 14:31:16 +Rsk= 16.1 Rkk= 12.8 + +22 14:54:44 15:09:49 +P1= 31.4 T1=15:04:49 P2= 43.2 T2=15:09:49 Vs= 2.34 + +20 16:58:21 16:58:29 +Riz_sol= 9.6 + +21 16:58:36 16:58:39 +Rsk= 16.1 Rkk= 12.4 + +22 17:30:20 17:45:25 +P1= 36.8 T1=17:40:25 P2= 49.9 T2=17:45:25 Vs= 2.63 + +23 17:45:33 17:45:39 + + +24 17:45:46 17:46:23 + + +30 17:46:34 17:46:58 +Vst= 28.6 + +31 17:47:05 17:47:40 +Rom_sol= 15.2 + +32 17:48:29 17:48:54 +Imax= 0.0 Umax= 0.0 T= 0.0 + +32 17:48:59 17:49:35 +Imax=10.9 Umax=50.1 T= 9.0 + +33 17:49:38 17:49:56 +Imin=15.8 Umin=25.0 T= 0.5 + +34 17:50:00 17:50:23 +V=300.1 T= 9.4 + +35 17:50:26 17:51:20 +Q= 53.2 T= 9.4 + +36 17:51:23 17:51:54 +P1=0.29 T= 2.9 + +37 17:51:57 17:52:28 +T= 0.9 + +38 17:52:32 17:52:40 +t= 51.7 T= 0.5 + +39 17:52:43 17:53:00 +tcam= 52.4 Tcam= 0.5 tfl= 56.1 Tfl= 0.5 + +40 17:53:04 17:53:13 +t= 51.7 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.453 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.453 new file mode 100644 index 0000000..2bfe390 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.453 @@ -0,0 +1,19 @@ +11 02:16:35 1594156595 +12 05:36:55 1594168615 +13 07:37:05 1594175825 +0 07:37:05 1594175825 +14 09:01:57 1594180917 +15 09:40:48 1594183248 +16 10:16:58 1594185418 +1 10:57:43 1594187863 +2 12:41:25 1594194085 +7 14:24:42 1594200282 +2 14:27:58 1594200478 +5 15:12:16 1594203136 +6 15:24:34 1594203874 +7 16:11:06 1594206666 +8 16:55:41 1594209341 +25 17:46:31 1594212391 +9 17:53:53 1594212833 +10 18:17:19 1594214239 +12 23:29:34 1594232974 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.454 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.454 new file mode 100644 index 0000000..63bb8c7 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.454 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.455 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.455 new file mode 100644 index 0000000..95731e6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.455 @@ -0,0 +1,2 @@ +3 16:58:09 1594209489 +52 17:48:54 1594212534 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.456 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.456 new file mode 100644 index 0000000..ebd99e3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.456 @@ -0,0 +1,113 @@ +[67] +oper = 11 +begin = 08.07.2020 02:16:35 +norma = 0 +real = 200 + +[68] +oper = 12 +begin = 08.07.2020 05:36:55 +norma = 105 +real = 120 + +[69] +oper = 13 +begin = 08.07.2020 07:37:05 +norma = 45 +real = 84 + +[70] +oper = 14 +begin = 08.07.2020 09:01:57 +norma = 40 +vac_time = 8 +real = 38 + +[71] +oper = 15 +begin = 08.07.2020 09:40:48 +norma = 30 +real = 36 + +[72] +oper = 16 +begin = 08.07.2020 10:16:58 +norma = 40 +real = 40 + +[73] +oper = 1 +begin = 08.07.2020 10:57:43 +norma = 85 +real = 103 + +[74] +oper = 2 +begin = 08.07.2020 12:41:25 +norma = 110 +vac_time = 9 +real = 103 + +[75] +oper = 7 +begin = 08.07.2020 14:24:42 +norma = 30 +real = 3 + +[76] +oper = 2 +begin = 08.07.2020 14:27:58 +norma = 110 +vac_time = 9 +vac_avg10 = 11.2 +real = 44 + +[77] +oper = 5 +begin = 08.07.2020 15:12:16 +norma = 25 +real = 12 + +[78] +oper = 6 +begin = 08.07.2020 15:24:34 +norma = 35 +real = 46 + +[79] +oper = 7 +begin = 08.07.2020 16:11:06 +norma = 30 +real = 44 + +[80] +oper = 8 +begin = 08.07.2020 16:55:41 +norma = 40 +vac_time = 9 +real = 50 + +[81] +oper = 25 +begin = 08.07.2020 17:46:31 +norma = 30 +real = 7 + +[82] +oper = 9 +begin = 08.07.2020 17:53:53 +norma = 0 +real = 23 + +[83] +oper = 10 +begin = 08.07.2020 18:17:19 +norma = 0 +real = 312 + +[84] +oper = 12 +begin = 08.07.2020 23:29:34 +norma = 180 +real = 271 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.457 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.457 new file mode 100644 index 0000000..afeeb73 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.457 @@ -0,0 +1,27 @@ +02:49:07 1594158547 ⪫祭 ॣ '-2' +02:49:11 1594158551 祭 ॣ '-2' +05:37:00 1594168620 ⪫祭 ॣ '-2'(A) +05:38:10 1594168690 祭 ० ᪠ +05:38:10 1594168690 祭 ० ᪠ +05:38:10 1594168690 祭 ० ᪠ +05:38:10 1594168690 祭 ० ᪠ +05:38:11 1594168691 祭 ० ᪠ +05:38:11 1594168691 祭 ० ᪠ +05:40:43 1594168843 ⪫祭 ० ᪠ (A) +09:40:40 1594183240 祭 ० ࠧ +09:40:43 1594183243 祭 ० ' ⮪ 㣨' +09:40:44 1594183244 祭 ॣ '-2'(A) +10:15:47 1594185347 ⪫祭 ० ' ⮪ 㣨' +10:17:01 1594185421 ⪫祭 ॣ '-2'(A) +10:17:37 1594185457 祭 ० ᪠ +10:17:39 1594185459 祭 ० ᪠ +10:20:31 1594185631 ⪫祭 ० ᪠ (A) +15:24:42 1594203882 祭 ० ᪠ +15:32:17 1594204337 ⪫祭 ० ᪠ (A) +17:45:47 1594212347 祭 ॣ '-2'(A) +17:46:24 1594212384 ⪫祭 ॣ '-2'(A) +18:00:39 1594213239 祭 ॣ '-2' +18:17:18 1594214238 祭 ⠭ ॣ +23:30:27 1594233027 祭 ० ᪠ +23:30:48 1594233048 ⪫祭 ॣ '-2'(A) +23:32:52 1594233172 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.459 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.459 new file mode 100644 index 0000000..414ce69 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.459 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.460 new file mode 100644 index 0000000..bdcbd00 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.460 @@ -0,0 +1,5 @@ +00:55:08 1594151708 1 11522 3 25 4 1 7 770 9 6090 10 650 12 1718 +06:14:04 1594170844 1 11522 2 p. cao M1,M2,M3,M4 3 25 4 1 5 Ti 6 7 770 8 3340 9 6090 10 650 11 12 1718 +19:30:15 1594218615 1 11523 2 BT 18, 20, 22, 23, 25 8 4000 9 5110 12 321731 +22:57:37 1594231057 1 11523 2 BT 18, 20, 22, 23, 25 3 25 4 1 5 Ti 6 7 770 8 4000 9 5110 10 650 11 12 321731 +23:30:54 1594233054 0 A--32-129-2018 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.461 new file mode 100644 index 0000000..c2d4714 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.462 new file mode 100644 index 0000000..8c59829 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.462 @@ -0,0 +1,132 @@ +21 00:55:37 00:55:40 +Rsk= 17.5 Rkk= 15.3 + +22 01:36:08 01:51:15 +P1= 65.9 T1=01:46:15 P2= 90.2 T2=01:51:15 Vs= 4.87 + +22 02:10:08 02:25:15 +P1= 45.6 T1=02:20:15 P2= 62.9 T2=02:25:15 Vs= 3.46 + +22 02:45:40 03:00:47 +P1= 35.0 T1=02:55:47 P2= 48.3 T2=03:00:47 Vs= 2.67 + +20 04:22:41 04:22:50 +Riz_sol= 1762.7 + +21 04:22:58 04:23:01 +Rsk= 17.4 Rkk= 15.0 + +22 04:48:13 05:03:20 +P1= 67.7 T1=04:58:20 P2= 91.9 T2=05:03:20 Vs= 4.84 + +22 05:51:10 06:06:17 +P1= 38.9 T1=06:01:17 P2= 53.8 T2=06:06:17 Vs= 2.98 + +23 06:06:26 06:06:31 + + +24 06:06:36 06:07:15 + + +30 06:07:24 06:07:49 +Vst= 27.8 + +31 06:07:54 06:08:28 +Rom_sol= 15.4 + +32 06:09:56 06:10:31 +Imax=11.1 Umax=50.1 T= 9.0 + +33 06:10:34 06:10:55 +Imin=16.1 Umin=24.9 T= 0.5 + +40 05:00:00 06:11:07 +t= 53.0 T= 0.5 + +40 05:00:00 06:11:07 +t= 53.0 T= 0.5 + +40 06:11:12 06:11:19 +t= 54.1 T= 0.5 + +35 06:11:23 06:12:17 +Q= 54.2 T= 9.4 + +39 06:12:20 06:12:37 +tcam= 51.5 Tcam= 0.5 tfl= 59.4 Tfl= 0.5 + +38 06:12:40 06:12:49 +t= 52.0 T= 0.5 + +37 05:00:00 06:13:17 +T= 0.9 + +36 06:13:20 06:13:51 +P1=0.29 T= 2.9 + +21 19:28:26 19:28:29 +Rsk= 5.1 Rkk= 2.6 + +21 19:28:44 19:28:47 +Rsk= 3.2 Rkk= 3.4 + +21 19:28:54 19:28:57 +Rsk= 6.7 Rkk= 3.9 + +21 19:30:31 19:30:34 +Rsk= 17.4 Rkk= 14.4 + +22 20:16:06 20:31:13 +P1= 40.4 T1=20:26:13 P2= 52.5 T2=20:31:13 Vs= 2.41 + +20 21:46:38 21:46:46 +Riz_sol= 313.6 + +21 21:46:52 21:46:55 +Rsk= 17.1 Rkk= 14.9 + +22 22:33:05 22:48:12 +P1= 34.9 T1=22:43:12 P2= 44.5 T2=22:48:12 Vs= 1.91 + +23 22:48:22 22:48:27 + + +24 22:48:32 22:49:11 + + +30 22:49:26 22:50:09 +Vst= 27.5 + +31 22:50:13 22:50:49 +Rom_sol= 16.4 + +41 22:51:24 22:51:29 +Ukz= 1.42 + +32 22:51:32 22:52:12 +Imax=11.1 Umax=50.0 T= 9.0 + +33 22:52:15 22:52:51 +Imin=16.1 Umin=24.9 T= 0.5 + +34 22:52:54 22:53:16 +V=301.0 T= 9.4 + +35 22:53:19 22:54:15 +Q= 53.7 T= 9.4 + +36 22:54:18 22:54:48 +P1=0.28 T= 2.9 + +37 22:54:51 22:55:18 +T= 0.9 + +38 22:55:22 22:55:32 +t= 54.0 T= 0.5 + +39 22:55:36 22:55:52 +tcam= 52.7 Tcam= 0.5 tfl= 59.5 Tfl= 0.5 + +40 22:55:56 22:56:04 +t= 52.9 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.463 new file mode 100644 index 0000000..06ca1df --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.463 @@ -0,0 +1,19 @@ +2 00:42:02 1594150922 +5 03:03:57 1594159437 +6 03:14:58 1594160098 +7 04:06:13 1594163173 +8 04:15:48 1594163748 +25 06:07:21 1594170441 +9 06:14:04 1594170844 +10 06:30:42 1594171842 +12 11:48:45 1594190925 +13 16:11:50 1594206710 +0 16:11:50 1594206710 +2 19:26:22 1594218382 +5 20:32:39 1594222359 +6 20:43:01 1594222981 +7 21:23:25 1594225405 +8 21:43:54 1594226634 +25 22:49:23 1594230563 +9 22:57:37 1594231057 +10 23:30:54 1594233054 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.464 new file mode 100644 index 0000000..5d4f860 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.465 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.465 new file mode 100644 index 0000000..390e0a1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.465 @@ -0,0 +1,7 @@ +47 06:11:06 1594170666 +47 06:11:07 1594170667 +47 06:11:08 1594170668 +47 06:11:08 1594170668 +47 06:11:09 1594170669 +47 06:11:09 1594170669 +47 06:11:10 1594170670 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.466 new file mode 100644 index 0000000..3c290ea --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.466 @@ -0,0 +1,112 @@ +[10] +oper = 2 +begin = 08.07.2020 00:42:02 +norma = 110 +vac_time = 14 +real = 141 + +[11] +oper = 5 +begin = 08.07.2020 03:03:57 +norma = 25 +real = 11 + +[12] +oper = 6 +begin = 08.07.2020 03:14:58 +norma = 35 +real = 51 + +[13] +oper = 7 +begin = 08.07.2020 04:06:13 +norma = 30 +real = 9 + +[14] +oper = 8 +begin = 08.07.2020 04:15:48 +norma = 40 +vac_time = 8 +real = 111 + +[15] +oper = 25 +begin = 08.07.2020 06:07:21 +norma = 30 +real = 6 + +[16] +oper = 9 +begin = 08.07.2020 06:14:04 +norma = 0 +real = 16 + +[17] +oper = 10 +begin = 08.07.2020 06:30:42 +norma = 0 +real = 318 + +[18] +oper = 12 +begin = 08.07.2020 11:48:45 +norma = 180 +real = 263 + +[19] +oper = 13 +begin = 08.07.2020 16:11:50 +norma = 45 +real = 194 + +[20] +oper = 2 +begin = 08.07.2020 19:26:22 +norma = 110 +vac_time = 11 +real = 66 + +[21] +oper = 5 +begin = 08.07.2020 20:32:39 +norma = 25 +real = 10 + +[22] +oper = 6 +begin = 08.07.2020 20:43:01 +norma = 35 +real = 40 + +[23] +oper = 7 +begin = 08.07.2020 21:23:25 +norma = 30 +real = 20 + +[24] +oper = 8 +begin = 08.07.2020 21:43:54 +norma = 40 +vac_time = 10 +real = 65 + +[25] +oper = 25 +begin = 08.07.2020 22:49:23 +norma = 30 +real = 8 + +[26] +oper = 9 +begin = 08.07.2020 22:57:37 +norma = 0 +real = 33 + +[27] +oper = 10 +begin = 08.07.2020 23:30:54 +norma = 0 +real = 263 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.467 new file mode 100644 index 0000000..3832f70 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.467 @@ -0,0 +1,23 @@ +03:15:12 1594160112 祭 ० ᪠ +03:15:13 1594160113 祭 ० ᪠ +03:15:13 1594160113 祭 ० ᪠ +03:15:13 1594160113 祭 ० ᪠ +03:15:13 1594160113 祭 ० ᪠ +03:15:13 1594160113 祭 ० ᪠ +03:17:14 1594160234 ⪫祭 ० ᪠ (A) +06:06:40 1594170400 祭 ॣ '-2'(A) +06:07:15 1594170435 ⪫祭 ॣ '-2'(A) +06:30:17 1594171817 祭 ॣ '-2' +06:30:41 1594171841 祭 ⠭ ॣ +11:48:58 1594190938 祭 ० ᪠ +11:51:00 1594191060 ⪫祭 ० ᪠ (A) +11:52:38 1594191158 ⪫祭 ॣ '-2'(A) +20:43:26 1594223006 祭 ० ᪠ +20:45:22 1594223122 ⪫祭 ० ᪠ (A) +22:48:35 1594230515 祭 ॣ '-2'(A) +22:49:12 1594230552 ⪫祭 ॣ '-2'(A) +22:57:01 1594231021 祭 ० ࠧ +22:57:03 1594231023 祭 ० ' ⮪ 㣨' +22:58:58 1594231138 祭 ॣ '-2'(A) +23:30:54 1594233054 ⪫祭 ० ࠧ (A) +23:30:54 1594233054 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.469 new file mode 100644 index 0000000..152bb12 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.480 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.480 new file mode 100644 index 0000000..c556197 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.480 @@ -0,0 +1,2 @@ +01:05:22 1594152322 1 02562 9 5410 +07:09:52 1594174192 1 02562 2 p. cao M1,M2,M3,M4 3 25 4 1 5 Ti 6 7 770 8 4130 9 5410 10 650 11 12 1718 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.481 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.481 new file mode 100644 index 0000000..24785c5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.481 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.482 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.482 new file mode 100644 index 0000000..da34a47 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.482 @@ -0,0 +1,117 @@ +21 01:01:18 01:01:21 +Rsk= 10.7 Rkk= 0.5 + +21 01:01:27 01:01:30 +Rsk= 10.6 Rkk= 0.5 + +21 01:01:33 01:01:36 +Rsk= 10.8 Rkk= 0.6 + +21 01:01:39 01:01:42 +Rsk= 10.8 Rkk= 0.6 + +21 01:01:47 01:01:50 +Rsk= 11.0 Rkk= 0.7 + +21 01:02:01 01:02:04 +Rsk= 10.4 Rkk= 0.9 + +21 01:02:39 01:02:42 +Rsk= 11.5 Rkk= 1.8 + +21 01:02:44 01:02:47 +Rsk= 11.7 Rkk= 1.9 + +21 01:02:50 01:02:53 +Rsk= 12.0 Rkk= 2.2 + +21 01:03:10 01:03:13 +Rsk= 12.6 Rkk= 2.8 + +21 01:03:16 01:03:19 +Rsk= 12.8 Rkk= 3.0 + +21 01:03:22 01:03:25 +Rsk= 13.1 Rkk= 3.3 + +21 01:03:28 01:03:31 +Rsk= 13.4 Rkk= 3.6 + +21 01:03:33 01:03:36 +Rsk= 13.7 Rkk= 3.9 + +21 01:03:39 01:03:42 +Rsk= 14.0 Rkk= 4.1 + +21 01:03:44 01:03:47 +Rsk= 14.4 Rkk= 4.4 + +21 01:03:49 01:03:52 +Rsk= 14.7 Rkk= 4.7 + +21 01:03:54 01:03:57 +Rsk= 15.0 Rkk= 5.0 + +21 01:04:00 01:04:03 +Rsk= 15.5 Rkk= 5.3 + +22 02:26:50 02:41:55 +P1= 87.2 T1=02:36:55 P2=117.7 T2=02:41:55 Vs= 6.10 + +22 03:14:59 03:30:04 +P1= 62.5 T1=03:25:04 P2= 82.4 T2=03:30:04 Vs= 3.97 + +22 04:19:59 04:30:04 +P1= 23.4 T1=04:25:04 P2= 37.5 T2=04:30:04 Vs= 2.81 + +20 05:56:37 05:56:45 +Riz_sol= 1195.6 + +21 05:56:54 05:56:57 +Rsk= 69.9 Rkk= 60.6 + +22 06:23:16 06:38:20 +P1= 57.2 T1=06:33:20 P2= 72.9 T2=06:38:20 Vs= 3.15 + +22 06:45:00 07:00:05 +P1= 51.2 T1=06:55:05 P2= 64.4 T2=07:00:05 Vs= 2.63 + +23 07:00:39 07:00:45 + + +24 07:00:54 07:01:33 + + +30 07:02:06 07:02:37 +Vst= 23.6 + +31 07:02:46 07:03:20 +Rom_sol= 7.0 + +32 07:03:52 07:04:28 +Imax=10.9 Umax=50.0 T= 9.3 + +33 07:04:31 07:04:55 +Imin=15.9 Umin=25.0 T= 0.8 + +34 07:05:00 07:05:23 +V=300.5 T= 9.7 + +35 07:05:27 07:06:47 +Qkr= 54.4 Tkr= 9.5 Qpd= 0.0 Tpd= 0.0 + +36 07:06:53 07:07:50 +Pkr=0.29 Tkr= 3.2 Ppd=0.00 Tpd= 0.0 + +37 07:07:54 07:08:20 +T= 1.0 + +38 07:08:25 07:08:32 +t= 52.2 T= 0.9 + +39 07:08:38 07:08:45 +t= 51.7 T= 0.9 + +40 07:08:52 07:08:59 +t= 51.2 T= 0.9 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.483 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.483 new file mode 100644 index 0000000..cbb8781 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.483 @@ -0,0 +1,11 @@ +2 00:58:22 1594151902 +5 04:30:58 1594164658 +6 04:40:44 1594165244 +7 05:15:17 1594167317 +8 05:43:14 1594168994 +25 07:01:55 1594173715 +9 07:09:52 1594174192 +10 07:36:59 1594175819 +12 12:19:16 1594192756 +13 16:51:18 1594209078 +0 16:51:18 1594209078 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.484 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.484 new file mode 100644 index 0000000..0610df9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.484 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.486 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.486 new file mode 100644 index 0000000..16c828c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.486 @@ -0,0 +1,63 @@ +[85] +oper = 2 +begin = 08.07.2020 00:58:22 +norma = 110 +vac_time = 11 +real = 212 + +[86] +oper = 5 +begin = 08.07.2020 04:30:58 +norma = 25 +real = 9 + +[87] +oper = 6 +begin = 08.07.2020 04:40:44 +norma = 35 +real = 34 + +[88] +oper = 7 +begin = 08.07.2020 05:15:17 +norma = 30 +real = 27 + +[89] +oper = 8 +begin = 08.07.2020 05:43:14 +norma = 40 +vac_time = 14 +vac_avg10 = 11.5 +real = 78 + +[90] +oper = 25 +begin = 08.07.2020 07:01:55 +norma = 30 +real = 7 + +[91] +oper = 9 +begin = 08.07.2020 07:09:52 +norma = 0 +real = 27 + +[92] +oper = 10 +begin = 08.07.2020 07:36:59 +norma = 0 +real = 282 + +[93] +oper = 12 +begin = 08.07.2020 12:19:16 +norma = 180 +real = 272 + +[94] +oper = 13 +begin = 08.07.2020 16:51:18 +norma = 45 +real = 1572 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.487 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.487 new file mode 100644 index 0000000..fdf7f99 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.487 @@ -0,0 +1,26 @@ +04:40:56 1594165256 祭 ० ᪠ +04:40:56 1594165256 祭 ० ᪠ +04:40:57 1594165257 祭 ० ᪠ +04:40:58 1594165258 祭 ० ᪠ +04:44:22 1594165462 ⪫祭 ० ᪠ (A) +07:00:57 1594173657 祭 ॣ '-2'(A) +07:01:34 1594173694 ⪫祭 ॣ '-2'(A) +07:35:00 1594175700 祭 ॣ '-2' +07:36:58 1594175818 祭 ⠭ ॣ +12:19:19 1594192759 ⪫祭 ॣ '-2'(A) +12:19:55 1594192795 祭 ० ᪠ +12:20:45 1594192845 ⪫祭 ० ᪠ +12:20:46 1594192846 祭 ० ᪠ +12:20:51 1594192851 ⪫祭 ० ᪠ +12:20:52 1594192852 祭 ० ᪠ +12:20:52 1594192852 祭 ० ᪠ +12:21:03 1594192863 ⪫祭 ० ᪠ +12:21:05 1594192865 祭 ० ᪠ +12:21:12 1594192872 ⪫祭 ० ᪠ +12:21:14 1594192874 祭 ० ᪠ +12:21:14 1594192874 祭 ० ᪠ +12:21:15 1594192875 祭 ० ᪠ +12:21:19 1594192879 ⪫祭 ० ᪠ +12:21:21 1594192881 祭 ० ᪠ +12:21:21 1594192881 祭 ० ᪠ +12:22:13 1594192933 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.489 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.489 new file mode 100644 index 0000000..21811a6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.489 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.911 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.911 new file mode 100644 index 0000000..2328f10 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.911 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.912 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.912 new file mode 100644 index 0000000..891b552 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.912 @@ -0,0 +1,9 @@ +22 11:45:22 11:50:22 +P1=35.8 P2=77.7 T1=11:45:22 T2=11:50:22 Vs= 8.4 + +22 13:09:56 13:14:57 +P1=27.1 P2=64.8 T1=13:09:56 T2=13:14:57 Vs= 7.6 + +22 15:11:58 15:16:58 +P1=21.7 P2=57.2 T1=15:11:58 T2=15:16:58 Vs= 7.1 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.920 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.920 new file mode 100644 index 0000000..17982f2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.920 @@ -0,0 +1 @@ +02:15:51 1594156551 1 9-92-07033 2 ‚’6-ƒ„3 3 10200 4 2 5 2 6 690 7 5387 10 89 11 89 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.921 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.921 new file mode 100644 index 0000000..0d658e6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.921 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.922 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.922 new file mode 100644 index 0000000..ccfe8c5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.922 @@ -0,0 +1,3 @@ +22 02:30:51 02:35:52 +P1=51.4 P2=54.4 T1=02:30:51 T2=02:35:52 Vs= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.923 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.923 new file mode 100644 index 0000000..5f5a015 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.923 @@ -0,0 +1,6 @@ +17 00:37:03 1594064223 +10 02:15:51 1594156551 +12 02:58:00 1594159080 +00 11:42:21 1594190541 +13 11:42:21 1594190541 +08 22:30:58 1594229458 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.930 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.930 new file mode 100644 index 0000000..377c9ca --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.930 @@ -0,0 +1,2 @@ +10:42:18 1594186938 7 5371 8 4400 9 321715 +11:06:29 1594188389 0 A_NTC_GRE_32_004_2018_rev2 1 01240 2 BT8 3 3 10000 4 9692 5 9692 6 690 7 5371 8 4400 9 321715 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.931 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.931 new file mode 100644 index 0000000..44f3e99 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.931 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.932 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.932 new file mode 100644 index 0000000..14603b6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.932 @@ -0,0 +1,36 @@ +22 05:22:27 05:27:30 +P1= 51.2 T1=05:22:30 P2= 84.0 T2=05:27:30 Vs= 6.47 + +22 06:45:05 06:50:11 +P1= 36.2 T1=06:45:08 P2= 46.7 T2=06:50:11 Vs= 2.07 + +21 10:42:37 10:42:39 +Rsk= 2.2 + +22 10:42:52 10:47:57 +P1= 26.2 T1=10:42:54 P2= 32.6 T2=10:47:57 Vs= 1.26 + +32 10:49:19 10:49:33 +Umax=85.0 T= 3.0 + +34 10:49:37 10:50:03 +V= 0.3 T= 9.0 + +43 10:50:08 10:52:29 +Ttgl= 0.0 + +38 10:52:34 10:52:50 +t= 50.0 T= 0.1 + +42 10:52:56 10:54:56 +Qtgl=63.98 T= 0.0 + +35 10:55:01 10:55:58 +Qizl=109.9 T= 0.0 + +37 10:56:04 10:57:50 +T= 0.0 + +44 11:00:38 11:00:48 + + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.933 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.933 new file mode 100644 index 0000000..0ae34cc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.933 @@ -0,0 +1,8 @@ +8 03:21:12 1594160472 +10 11:01:28 1594188088 +17 13:23:38 1594196618 +12 13:25:31 1594196731 +10 13:30:28 1594197028 +12 13:43:19 1594197799 +13 20:30:30 1594222230 +0 20:30:30 1594222230 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.934 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.934 new file mode 100644 index 0000000..e1d2e05 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.934 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.940 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.940 new file mode 100644 index 0000000..913c8b3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.940 @@ -0,0 +1,3 @@ +04:21:59 1594164119 2 Ti6Al4V 4 9772 5 9772 6 770 7 5300 9 320491 +04:27:13 1594164433 8 5390 +05:47:27 1594169247 0 A_NTC_GRE_32_003_2017_rev0 1 00812 2 Ti6Al4V 3 15770 4 9772 5 9772 6 770 7 5300 8 5390 9 320491 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.941 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.941 new file mode 100644 index 0000000..dc1edf6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.941 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.942 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.942 new file mode 100644 index 0000000..59ca1ea --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.942 @@ -0,0 +1,36 @@ +22 04:08:00 04:13:05 +P1= 48.0 T1=04:08:02 P2= 53.2 T2=04:13:05 Vs= 1.03 + +21 04:22:29 04:22:32 +Rsk= 4.2 + +32 04:23:08 04:23:21 +Umax=85.0 T= 3.0 + +34 04:23:29 04:23:55 +V= 0.3 T= 9.0 + +43 04:24:00 04:26:34 +Ttgl= 0.0 + +38 04:27:34 04:28:05 +t= 50.0 T= 0.5 + +42 04:28:13 04:30:22 +Qtgl=61.62 T= 0.0 + +35 04:30:29 04:31:26 +Qizl=108.9 T= 0.0 + +37 04:31:34 04:33:24 +T= 0.0 + +22 05:34:09 05:39:13 +P1= 42.5 T1=05:34:11 P2= 45.6 T2=05:39:13 Vs= 0.61 + +21 05:40:17 05:40:20 +Rsk= 2.6 + +44 05:41:45 05:41:52 + + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.943 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.943 new file mode 100644 index 0000000..9910633 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.943 @@ -0,0 +1,8 @@ +8 00:55:33 1594151733 +10 05:42:26 1594168946 +17 09:17:16 1594181836 +12 09:19:16 1594181956 +10 09:24:56 1594182296 +12 09:52:24 1594183944 +13 19:03:49 1594217029 +0 19:03:49 1594217029 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200708.944 b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.944 new file mode 100644 index 0000000..d55e14e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200708.944 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.010 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.010 new file mode 100644 index 0000000..f6bf7ab --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.010 @@ -0,0 +1,2 @@ +13:08:17 1594282097 1 05662 8 2060 9 4200 12 321454 +21:14:12 1594311252 1 05662 2 Ti-6Al4V-Ti_Str 3 20 4 1 5 Ti 6 7 770 8 2060 9 0 10 560 11 12 321454 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.011 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.011 new file mode 100644 index 0000000..d6fa68e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.011 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.012 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.012 new file mode 100644 index 0000000..b097f31 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.012 @@ -0,0 +1,81 @@ +21 13:08:37 13:08:40 +Rsk= 8.8 Rkk= 8.3 + +22 15:11:29 15:27:04 +P1= 52.0 T1=15:22:04 P2= 69.9 T2=15:27:04 Vs= 3.59 + +22 15:39:24 15:54:59 +P1= 48.9 T1=15:49:59 P2= 65.6 T2=15:54:59 Vs= 3.34 + +22 15:55:36 16:11:11 +P1= 57.9 T1=16:06:11 P2= 74.4 T2=16:11:11 Vs= 3.29 + +22 16:28:54 16:44:28 +P1= 45.8 T1=16:39:28 P2= 61.5 T2=16:44:28 Vs= 3.13 + +22 16:45:03 17:00:36 +P1= 54.0 T1=16:55:36 P2= 69.6 T2=17:00:36 Vs= 3.12 + +22 17:16:08 17:31:43 +P1= 43.8 T1=17:26:43 P2= 59.3 T2=17:31:43 Vs= 3.09 + +22 17:32:17 17:47:50 +P1= 52.3 T1=17:42:50 P2= 65.7 T2=17:47:50 Vs= 2.67 + +20 19:19:44 19:19:53 +Riz_sol= 2011.5 + +21 19:20:04 19:20:07 +Rsk= 8.5 Rkk= 8.0 + +22 20:40:08 20:55:43 +P1= 48.1 T1=20:50:43 P2= 62.7 T2=20:55:43 Vs= 2.92 + +23 20:58:18 20:58:24 + + +24 20:58:31 20:59:08 + + +30 21:01:33 21:01:49 +Vst= 24.0 + +30 21:02:03 21:02:27 +Vst= 35.8 + +31 21:02:35 21:03:09 +Rom_sol= 16.6 + +41 21:07:57 21:08:02 +Ukz= 1.34 + +32 21:08:09 21:08:46 +Imax=11.0 Umax=50.0 T= 9.0 + +33 21:08:52 21:09:17 +Imin=15.9 Umin=25.0 T= 0.5 + +34 21:09:23 21:09:47 +V=300.1 T= 9.7 + +35 21:09:54 21:10:11 +Q= 54.9 T=10.0 + +35 21:10:38 21:11:32 +Q= 45.8 T= 9.6 + +36 21:11:38 21:12:12 +P1=0.29 T= 3.2 + +37 21:12:17 21:12:42 +T= 1.2 + +38 21:12:49 21:12:59 +t= 52.2 T= 0.8 + +39 21:13:04 21:13:12 +t= 53.4 T= 0.7 + +40 21:13:17 21:13:26 +t= 52.6 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.013 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.013 new file mode 100644 index 0000000..bee2e16 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.013 @@ -0,0 +1,8 @@ +2 13:04:20 1594281860 +5 17:51:12 1594299072 +6 18:02:22 1594299742 +7 18:43:12 1594302192 +8 19:14:55 1594304095 +25 21:01:19 1594310479 +9 21:14:12 1594311252 +10 21:36:39 1594312599 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.014 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.014 new file mode 100644 index 0000000..21bfd37 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.014 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.015 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.015 new file mode 100644 index 0000000..082d2d1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.015 @@ -0,0 +1,3 @@ +55 21:10:11 1594311011 +47 21:10:18 1594311018 +47 21:10:20 1594311020 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.016 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.016 new file mode 100644 index 0000000..3dca1c7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.016 @@ -0,0 +1,50 @@ +[88] +oper = 2 +begin = 09.07.2020 13:04:20 +norma = 110 +vac_time = 33 +real = 286 + +[89] +oper = 5 +begin = 09.07.2020 17:51:12 +norma = 25 +real = 11 + +[90] +oper = 6 +begin = 09.07.2020 18:02:22 +norma = 35 +real = 40 + +[91] +oper = 7 +begin = 09.07.2020 18:43:12 +norma = 30 +real = 31 + +[92] +oper = 8 +begin = 09.07.2020 19:14:55 +norma = 40 +vac_time = 23 +real = 106 + +[93] +oper = 25 +begin = 09.07.2020 21:01:19 +norma = 30 +real = 12 + +[94] +oper = 9 +begin = 09.07.2020 21:14:12 +norma = 0 +real = 22 + +[95] +oper = 10 +begin = 09.07.2020 21:36:39 +norma = 0 +real = 482 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.017 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.017 new file mode 100644 index 0000000..a7641b4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.017 @@ -0,0 +1,4 @@ +20:58:34 1594310314 祭 ॣ '-2'(A) +20:59:09 1594310349 ⪫祭 ॣ '-2'(A) +21:36:37 1594312597 祭 ॣ '-2' +21:36:39 1594312599 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.019 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.019 new file mode 100644 index 0000000..97b6d05 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.019 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.020 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.020 new file mode 100644 index 0000000..d25851f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.020 @@ -0,0 +1,3 @@ +09:41:58 1594269718 3 14 +10:48:49 1594273729 0 A--32-067-2014 ॢ 0 +14:08:36 1594285716 1 05153 3 25 9 3250 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.021 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.021 new file mode 100644 index 0000000..89c168b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.021 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.022 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.022 new file mode 100644 index 0000000..c378d2b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.022 @@ -0,0 +1,36 @@ +21 09:42:10 09:42:13 +Rsk= 13.6 Rkk= 10.4 + +22 10:04:22 10:19:26 +P1= 59.7 T1=10:14:26 P2= 81.2 T2=10:19:26 Vs= 4.30 + +21 14:09:07 14:09:10 +Rsk= 13.8 Rkk= 10.4 + +22 15:23:35 15:38:40 +P1= 41.9 T1=15:33:40 P2= 57.7 T2=15:38:40 Vs= 3.15 + +22 15:46:41 16:01:46 +P1= 39.5 T1=15:56:46 P2= 53.7 T2=16:01:46 Vs= 2.83 + +20 19:21:30 19:21:40 +Riz_sol= 7130.7 + +21 19:21:46 19:21:49 +Rsk= 14.1 Rkk= 10.7 + +22 20:58:56 21:14:01 +P1= 55.6 T1=21:09:01 P2= 79.9 T2=21:14:01 Vs= 4.85 + +20 22:07:48 22:07:58 +Riz_sol= 6648.0 + +21 22:08:15 22:08:18 +Rsk= 14.3 Rkk= 10.8 + +22 22:47:07 23:02:12 +P1= 81.5 T1=22:57:12 P2=118.2 T2=23:02:12 Vs= 7.34 + +22 23:27:53 23:42:58 +P1= 74.5 T1=23:37:58 P2=106.9 T2=23:42:58 Vs= 6.47 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.023 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.023 new file mode 100644 index 0000000..30b5c00 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.023 @@ -0,0 +1,15 @@ +11 03:12:39 1594246359 +12 05:56:30 1594256190 +13 07:45:09 1594262709 +0 07:45:09 1594262709 +14 09:39:17 1594269557 +15 10:23:00 1594272180 +16 10:51:06 1594273866 +1 11:27:27 1594276047 +2 14:05:37 1594285537 +5 16:03:44 1594292624 +6 16:15:38 1594293338 +7 16:58:54 1594295934 +8 19:14:40 1594304080 +13 21:30:16 1594312216 +8 22:05:27 1594314327 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.024 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.024 new file mode 100644 index 0000000..58d14fc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.024 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.026 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.026 new file mode 100644 index 0000000..7dfbe61 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.026 @@ -0,0 +1,88 @@ +[22] +oper = 11 +begin = 09.07.2020 03:12:39 +norma = 0 +real = 163 + +[23] +oper = 12 +begin = 09.07.2020 05:56:30 +norma = 105 +real = 108 + +[24] +oper = 13 +begin = 09.07.2020 07:45:09 +norma = 45 +real = 114 + +[25] +oper = 14 +begin = 09.07.2020 09:39:17 +norma = 40 +vac_time = 9 +real = 43 + +[26] +oper = 15 +begin = 09.07.2020 10:23:00 +norma = 30 +real = 28 + +[27] +oper = 16 +begin = 09.07.2020 10:51:06 +norma = 40 +real = 36 + +[28] +oper = 1 +begin = 09.07.2020 11:27:27 +norma = 85 +real = 158 + +[29] +oper = 2 +begin = 09.07.2020 14:05:37 +norma = 110 +vac_time = 9 +real = 118 + +[30] +oper = 5 +begin = 09.07.2020 16:03:44 +norma = 25 +real = 11 + +[31] +oper = 6 +begin = 09.07.2020 16:15:38 +norma = 35 +real = 43 + +[32] +oper = 7 +begin = 09.07.2020 16:58:54 +norma = 30 +real = 135 + +[33] +oper = 8 +begin = 09.07.2020 19:14:40 +norma = 40 +vac_time = 9 +real = 135 + +[34] +oper = 13 +begin = 09.07.2020 21:30:16 +norma = 45 +real = 35 + +[35] +oper = 8 +begin = 09.07.2020 22:05:27 +norma = 40 +vac_time = 9 +real = 204 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.027 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.027 new file mode 100644 index 0000000..d147458 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.027 @@ -0,0 +1,27 @@ +03:12:38 1594246358 祭 ० +03:12:39 1594246359 ⪫祭 ॣ '-2'(A) +03:12:40 1594246360 祭 ॣ '-2'(A) +04:02:41 1594249361 ⪫祭 ॣ '-2'(A) +05:56:23 1594256183 ⪫祭 ० (A) +05:56:24 1594256184 ⪫祭 +05:56:24 1594256184 : +05:56:31 1594256191 ⪫祭 ० ' ⮪ 㣨' +05:57:11 1594256231 祭 ० ᪠ +05:57:12 1594256232 祭 ० ᪠ +05:58:23 1594256303 : 믮 +06:00:06 1594256406 ⪫祭 ० ᪠ (A) +10:22:39 1594272159 祭 ० ࠧ +10:22:41 1594272161 祭 ० ' ⮪ 㣨' +10:23:46 1594272226 祭 ॣ '-2'(A) +10:48:49 1594273729 ⪫祭 ० ࠧ (A) +10:49:42 1594273782 ⪫祭 ० ' ⮪ 㣨' +10:51:09 1594273869 ⪫祭 ॣ '-2'(A) +10:52:04 1594273924 祭 ० ᪠ +10:52:04 1594273924 祭 ० ᪠ +10:53:42 1594274022 ⪫祭 ० ᪠ +10:53:44 1594274024 祭 ० ᪠ +10:53:50 1594274030 ⪫祭 ० ᪠ +14:08:39 1594285719 : 㦥 +16:16:46 1594293406 祭 ० ᪠ +16:16:46 1594293406 祭 ० ᪠ +16:19:17 1594293557 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.029 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.029 new file mode 100644 index 0000000..481d11c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.029 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.030 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.030 new file mode 100644 index 0000000..aeefe69 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.030 @@ -0,0 +1,12 @@ +02:19:18 1594243158 1 08235 9 4240 10 670 +05:02:30 1594252950 11 +05:11:45 1594253505 1 08235 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 2400 9 4240 10 670 11 12 321594 +05:40:16 1594255216 0 A--32-068-2019 ॢ 2 +15:00:53 1594288853 3 14 +15:59:32 1594292372 0 A--32-067-2014 ॢ 0 +18:58:50 1594303130 1 08236 3 10 +18:59:54 1594303194 9 4980 10 690 +19:01:27 1594303287 2 BT 3-1, 6, 8, 9, 14, 15, 16 +19:02:17 1594303337 11 +19:41:18 1594305678 1 08236 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 10 4 2 5 Ti 6 7 770 8 2400 9 4980 10 690 11 12 321594 +20:36:34 1594308994 0 A--32-170-2018 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.031 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.031 new file mode 100644 index 0000000..36e3db1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.031 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.032 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.032 new file mode 100644 index 0000000..bc163ec --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.032 @@ -0,0 +1,111 @@ +21 02:18:35 02:18:43 +Rsk= 11.3 Rkk= 6.8 + +22 02:44:53 03:00:14 +P1= 42.2 T1=02:55:14 P2= 57.1 T2=03:00:14 Vs= 2.98 + +21 04:13:01 04:13:09 +Rsk= 11.9 Rkk= 7.0 + +20 04:15:29 04:15:39 +Riz_sol= 6229.4 + +22 04:46:40 05:02:01 +P1= 29.9 T1=04:57:01 P2= 40.8 T2=05:02:01 Vs= 2.18 + +23 05:02:48 05:02:54 + + +24 05:02:59 05:03:35 + + +30 05:03:48 05:04:29 +Vst= 31.1 + +31 05:04:38 05:05:39 +Rom_sol= 10.5 + +41 05:06:17 05:06:22 +Ukz= 1.18 + +32 05:06:25 05:07:31 +Imax=11.4 Umax=50.0 T= 9.2 + +33 05:07:34 05:08:03 +Imin=16.5 Umin=25.1 T= 0.8 + +34 05:08:08 05:08:36 +V=301.4 T= 9.5 + +35 05:08:39 05:09:35 +Q= 54.7 T= 9.1 + +36 05:09:38 05:10:07 +P1=0.30 T= 3.0 + +37 05:10:10 05:10:43 +T= 0.6 + +38 05:10:46 05:10:52 +t= 51.3 T= 0.4 + +39 05:10:55 05:11:00 +t= 51.7 T= 0.4 + +40 05:11:03 05:11:08 +t= 51.9 T= 0.7 + +21 15:01:27 15:01:35 +Rsk= 11.9 Rkk= 6.7 + +22 15:18:41 15:34:02 +P1= 58.2 T1=15:29:02 P2= 76.1 T2=15:34:02 Vs= 3.57 + +20 18:44:47 18:44:57 +Riz_sol= 5878.9 + +21 18:45:05 18:45:13 +Rsk= 11.6 Rkk= 6.6 + +22 19:13:00 19:28:21 +P1= 41.6 T1=19:23:21 P2= 55.3 T2=19:28:21 Vs= 2.74 + +23 19:29:04 19:29:10 + + +24 19:29:30 19:30:04 + + +30 19:30:38 19:31:26 +Vst= 31.0 + +31 19:32:23 19:33:07 +Rom_sol= 10.5 + +32 19:34:57 19:36:05 +Imax=11.4 Umax=50.0 T= 9.4 + +33 19:36:10 19:36:50 +Imin= 8.3 Umin=18.0 T= 3.4 + +34 19:36:54 19:37:22 +V=301.3 T= 9.3 + +35 19:37:26 19:38:26 +Q= 54.8 T= 9.0 + +36 19:38:30 19:39:00 +P1=0.24 T= 3.0 + +37 19:39:04 19:39:34 +T= 0.6 + +38 19:39:38 19:39:48 +t= 51.3 T= 0.4 + +39 19:39:53 19:40:00 +t= 51.7 T= 0.7 + +40 19:40:03 19:40:10 +t= 51.9 T= 0.4 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.033 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.033 new file mode 100644 index 0000000..9bb5a8b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.033 @@ -0,0 +1,21 @@ +2 02:14:49 1594242889 +5 03:01:23 1594245683 +6 03:16:45 1594246605 +7 03:56:58 1594249018 +8 04:12:25 1594249945 +25 05:03:45 1594253025 +9 05:11:45 1594253505 +10 05:40:17 1594255217 +11 09:25:53 1594268753 +12 12:09:39 1594278579 +13 14:01:33 1594285293 +0 14:01:33 1594285293 +14 15:00:34 1594288834 +15 15:34:50 1594290890 +16 15:59:33 1594292373 +16 16:01:37 1594292497 +1 16:41:37 1594294897 +8 18:42:10 1594302130 +25 19:30:33 1594305033 +9 19:41:18 1594305678 +10 20:26:34 1594308394 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.034 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.034 new file mode 100644 index 0000000..b929055 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.034 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.036 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.036 new file mode 100644 index 0000000..eda06a4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.036 @@ -0,0 +1,125 @@ +[21] +oper = 2 +begin = 09.07.2020 02:14:49 +norma = 110 +vac_time = 7 +vac_avg10 = 7.0 +real = 46 + +[22] +oper = 5 +begin = 09.07.2020 03:01:23 +norma = 25 +real = 15 + +[23] +oper = 6 +begin = 09.07.2020 03:16:45 +norma = 35 +real = 40 + +[24] +oper = 7 +begin = 09.07.2020 03:56:58 +norma = 30 +real = 15 + +[25] +oper = 8 +begin = 09.07.2020 04:12:25 +norma = 40 +vac_time = 7 +real = 51 + +[26] +oper = 25 +begin = 09.07.2020 05:03:45 +norma = 30 +real = 8 + +[27] +oper = 9 +begin = 09.07.2020 05:11:45 +norma = 0 +real = 28 + +[28] +oper = 10 +begin = 09.07.2020 05:40:17 +norma = 0 +real = 225 + +[29] +oper = 11 +begin = 09.07.2020 09:25:53 +norma = 0 +real = 163 + +[30] +oper = 12 +begin = 09.07.2020 12:09:39 +norma = 105 +real = 111 + +[31] +oper = 13 +begin = 09.07.2020 14:01:33 +norma = 45 +real = 59 + +[32] +oper = 14 +begin = 09.07.2020 15:00:34 +norma = 40 +vac_time = 7 +real = 34 + +[33] +oper = 15 +begin = 09.07.2020 15:34:50 +norma = 30 +real = 24 + +[34] +oper = 16 +begin = 09.07.2020 15:59:33 +norma = 40 +real = 2 + +[35] +oper = 16 +begin = 09.07.2020 16:01:37 +norma = 40 +real = 40 + +[36] +oper = 1 +begin = 09.07.2020 16:41:37 +norma = 85 +real = 120 + +[37] +oper = 8 +begin = 09.07.2020 18:42:10 +norma = 40 +vac_time = 7 +real = 48 + +[38] +oper = 25 +begin = 09.07.2020 19:30:33 +norma = 30 +real = 10 + +[39] +oper = 9 +begin = 09.07.2020 19:41:18 +norma = 0 +real = 45 + +[40] +oper = 10 +begin = 09.07.2020 20:26:34 +norma = 0 +real = 977 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.037 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.037 new file mode 100644 index 0000000..1303a64 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.037 @@ -0,0 +1,44 @@ +03:17:38 1594246658 祭 ० ᪠ +03:20:18 1594246818 ⪫祭 ० ᪠ (A) +05:02:32 1594252952 : 㦥 +05:03:02 1594252982 祭 ॣ '-2'(A) +05:03:36 1594253016 ⪫祭 ॣ '-2'(A) +05:04:36 1594253076 祭 +05:04:40 1594253080 祭 +05:05:40 1594253140 ⪫祭 +05:11:16 1594253476 祭 ० ࠧ +05:11:18 1594253478 祭 ० ' ⮪ 㣨' +05:11:45 1594253505 : 믮 +05:28:15 1594254495 祭 ॣ '-2'(A) +05:40:16 1594255216 祭 ॣ . 殮 㣨 +05:40:16 1594255216 ⪫祭 ० ࠧ (A) +09:25:52 1594268752 祭 ० +09:25:54 1594268754 ⪫祭 ॣ '-2'(A) +09:25:55 1594268755 祭 ॣ '-2'(A) +10:15:54 1594271754 ⪫祭 ॣ '-2'(A) +12:09:34 1594278574 ⪫祭 ० (A) +12:09:35 1594278575 ⪫祭 +12:09:35 1594278575 : +12:09:41 1594278581 ⪫祭 ० ' ⮪ 㣨' +12:10:01 1594278601 祭 ० ᪠ +12:11:35 1594278695 : 믮 +12:12:19 1594278739 ⪫祭 ० ᪠ (A) +15:34:20 1594290860 祭 ० ࠧ +15:34:21 1594290861 祭 ० ' ⮪ 㣨' +15:36:09 1594290969 祭 ॣ '-2'(A) +15:41:05 1594291265 ⪫祭 ० ' ⮪ 㣨' +15:48:40 1594291720 祭 ० ' ⮪ 㣨' +15:59:32 1594292372 ⪫祭 ० ࠧ (A) +15:59:45 1594292385 ⪫祭 ० ' ⮪ 㣨' +16:01:42 1594292502 ⪫祭 ॣ '-2'(A) +16:02:29 1594292549 祭 ० ᪠ +16:02:30 1594292550 祭 ० ᪠ +16:04:44 1594292684 ⪫祭 ० ᪠ (A) +19:29:31 1594304971 祭 ॣ '-2'(A) +19:30:05 1594305005 ⪫祭 ॣ '-2'(A) +19:40:47 1594305647 祭 ० ࠧ +19:40:49 1594305649 祭 ० ' ⮪ 㣨' +19:57:34 1594306654 祭 ॣ '-2'(A) +20:26:34 1594308394 ⪫祭 ० ࠧ (A) +20:26:34 1594308394 祭 ⠭ ॣ +20:36:34 1594308994 祭 ॣ ।. 60 ᥪ. 殮 㣨 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.039 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.039 new file mode 100644 index 0000000..0b709ab Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.039 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.050 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.050 new file mode 100644 index 0000000..d9628b9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.050 @@ -0,0 +1 @@ +22:36:57 1594316217 1 10158 9 8500 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.051 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.051 new file mode 100644 index 0000000..e02f719 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.051 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.052 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.052 new file mode 100644 index 0000000..982225d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.052 @@ -0,0 +1,15 @@ +21 22:38:03 22:38:11 +Rsk= 1.0 Rkk= 0.3 + +21 22:40:19 22:40:26 +Rsk= 0.7 Rkk= 0.4 + +21 22:46:34 22:46:42 +Rsk= 0.3 Rkk= 3.2 + +21 22:48:11 22:48:19 +Rsk= 1.9 Rkk= 3.5 + +21 23:26:26 23:26:33 +Rsk= 6.4 Rkk= 7.3 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.053 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.053 new file mode 100644 index 0000000..822b515 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.053 @@ -0,0 +1,4 @@ +12 01:34:05 1594240445 +13 06:25:57 1594257957 +0 06:25:57 1594257957 +2 22:37:34 1594316254 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.054 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.054 new file mode 100644 index 0000000..b6f1daf Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.054 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.056 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.056 new file mode 100644 index 0000000..1cd8076 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.056 @@ -0,0 +1,19 @@ +[30] +oper = 12 +begin = 09.07.2020 01:34:05 +norma = 180 +real = 291 + +[31] +oper = 13 +begin = 09.07.2020 06:25:57 +norma = 45 +real = 971 + +[32] +oper = 2 +begin = 09.07.2020 22:37:34 +norma = 110 +vac_time = 111 +real = 227 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.057 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.057 new file mode 100644 index 0000000..b8e04ee --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.057 @@ -0,0 +1,4 @@ +01:34:10 1594240450 ⪫祭 ॣ '-2'(A) +01:34:39 1594240479 祭 ० ᪠ +01:34:39 1594240479 祭 ० ᪠ +01:37:24 1594240644 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.059 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.059 new file mode 100644 index 0000000..5fb70c0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.059 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.080 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.080 new file mode 100644 index 0000000..eb8bed0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.080 @@ -0,0 +1,4 @@ +11:16:37 1594275397 3 14 +15:00:26 1594288826 1 05937 3 25 9 6598 +22:57:46 1594317466 1 05938 +23:05:02 1594317902 1 05938 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 840 8 4890 9 6598 10 770 11 12 321173 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.081 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.081 new file mode 100644 index 0000000..1eed157 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.081 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.082 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.082 new file mode 100644 index 0000000..e3e235a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.082 @@ -0,0 +1,78 @@ +21 11:16:20 11:16:28 +Rsk= 23.8 Rkk= 18.3 + +22 11:43:28 11:58:33 +P1= 64.3 T1=11:53:33 P2= 80.4 T2=11:58:33 Vs= 3.22 + +21 14:59:28 14:59:36 +Rsk= 23.8 Rkk= 18.3 + +22 15:37:55 15:53:00 +P1= 80.7 T1=15:48:00 P2=100.5 T2=15:53:00 Vs= 3.96 + +22 16:15:12 16:30:17 +P1= 59.9 T1=16:25:17 P2= 73.6 T2=16:30:17 Vs= 2.74 + +21 17:32:21 17:32:29 +Rsk= 23.8 Rkk= 18.3 + +22 18:20:31 18:30:36 +P1= 35.5 T1=18:25:36 P2= 59.5 T2=18:30:36 Vs= 4.81 + +22 18:45:08 18:55:13 +P1= 30.7 T1=18:50:13 P2= 51.8 T2=18:55:13 Vs= 4.21 + +20 20:58:51 20:59:01 +Riz_sol= 2847.7 + +21 20:59:09 20:59:16 +Rsk= 23.8 Rkk= 18.2 + +22 22:44:06 22:54:11 +P1= 21.5 T1=22:49:11 P2= 36.0 T2=22:54:11 Vs= 2.90 + +23 22:54:16 22:54:23 + + +24 22:54:28 22:55:04 + + +30 22:55:16 22:55:52 +Vst= 28.7 + +31 22:55:56 22:56:35 +Rom_sol= 14.4 + +41 22:58:41 22:58:46 +Ukz= 1.55 + +41 22:58:56 22:59:01 +Ukz= 1.39 + +32 22:59:04 23:00:10 +Imax=11.5 Umax=50.0 T= 9.4 + +33 23:00:15 23:00:48 +Imin=16.7 Umin=25.1 T= 0.8 + +34 23:00:52 23:01:20 +V=301.2 T= 9.6 + +35 23:01:23 23:02:34 +Q= 55.0 T= 9.1 + +36 23:02:37 23:03:27 +P1=0.29 T= 3.1 + +37 23:03:31 23:04:01 +T= 0.7 + +38 23:04:05 23:04:11 +t= 51.5 T= 0.7 + +39 23:04:14 23:04:28 +tcam= 51.5 Tcam= 0.7 tfl= 51.7 Tfl= 0.5 + +40 23:04:31 23:04:37 +t= 51.7 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.083 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.083 new file mode 100644 index 0000000..30ae8f9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.083 @@ -0,0 +1,21 @@ +11 03:54:25 1594248865 +12 03:56:11 1594248971 +13 08:52:12 1594266732 +0 08:52:12 1594266732 +14 11:14:14 1594275254 +15 12:01:12 1594278072 +16 12:27:31 1594279651 +1 13:14:06 1594282446 +2 14:58:47 1594288727 +5 16:31:44 1594294304 +6 16:45:28 1594295128 +7 17:19:12 1594297152 +14 17:31:49 1594297909 +15 18:56:41 1594303001 +16 19:28:07 1594304887 +1 20:20:17 1594308017 +00 20:37:52 1594309072 +8 20:56:41 1594310201 +25 22:55:13 1594317313 +9 23:05:02 1594317902 +10 23:39:09 1594319949 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.084 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.084 new file mode 100644 index 0000000..67a9bea Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.084 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.086 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.086 new file mode 100644 index 0000000..8db5893 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.086 @@ -0,0 +1,118 @@ +[42] +oper = 11 +begin = 09.07.2020 03:54:25 +norma = 0 +real = 1 + +[43] +oper = 12 +begin = 09.07.2020 03:56:11 +norma = 105 +real = 296 + +[44] +oper = 13 +begin = 09.07.2020 08:52:12 +norma = 45 +real = 142 + +[45] +oper = 14 +begin = 09.07.2020 11:14:14 +norma = 40 +vac_time = 7 +real = 46 + +[46] +oper = 15 +begin = 09.07.2020 12:01:12 +norma = 30 +real = 26 + +[47] +oper = 16 +begin = 09.07.2020 12:27:31 +norma = 40 +real = 46 + +[48] +oper = 1 +begin = 09.07.2020 13:14:06 +norma = 85 +real = 104 + +[49] +oper = 2 +begin = 09.07.2020 14:58:47 +norma = 110 +vac_time = 8 +real = 92 + +[50] +oper = 5 +begin = 09.07.2020 16:31:44 +norma = 25 +real = 13 + +[51] +oper = 6 +begin = 09.07.2020 16:45:28 +norma = 35 +real = 33 + +[52] +oper = 7 +begin = 09.07.2020 17:19:12 +norma = 30 +real = 12 + +[53] +oper = 14 +begin = 09.07.2020 17:31:49 +norma = 40 +vac_time = 7 +real = 84 + +[54] +oper = 15 +begin = 09.07.2020 18:56:41 +norma = 30 +real = 31 + +[55] +oper = 16 +begin = 09.07.2020 19:28:07 +norma = 40 +real = 52 + +[56] +oper = 1 +begin = 09.07.2020 20:20:17 +norma = 85 +real = 36 + +[57] +oper = 8 +begin = 09.07.2020 20:56:41 +norma = 40 +vac_time = 8 +real = 118 + +[58] +oper = 25 +begin = 09.07.2020 22:55:13 +norma = 30 +real = 9 + +[59] +oper = 9 +begin = 09.07.2020 23:05:02 +norma = 0 +real = 34 + +[60] +oper = 10 +begin = 09.07.2020 23:39:09 +norma = 0 +real = 387 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.087 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.087 new file mode 100644 index 0000000..d645c31 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.087 @@ -0,0 +1,18 @@ +03:56:14 1594248974 ⪫祭 ॣ '-2'(A) +03:57:13 1594249033 祭 ० ᪠ +04:05:02 1594249502 ⪫祭 ० ᪠ (A) +12:02:59 1594278179 祭 ० ࠧ +12:03:01 1594278181 祭 ० ' ⮪ 㣨' +12:05:18 1594278318 祭 ॣ '-2'(A) +12:27:14 1594279634 ⪫祭 ० ' ⮪ 㣨' +12:27:36 1594279656 ⪫祭 ॣ '-2'(A) +12:28:09 1594279689 祭 ० ᪠ +12:28:09 1594279689 祭 ० ᪠ +12:28:15 1594279695 . ⪫祭 ० ᪠ (A) +16:45:46 1594295146 祭 ० ᪠ +16:45:47 1594295147 祭 ० ᪠ +16:45:49 1594295149 . ⪫祭 ० ᪠ (A) +22:54:31 1594317271 祭 ॣ '-2'(A) +22:55:06 1594317306 ⪫祭 ॣ '-2'(A) +23:35:12 1594319712 祭 ॣ '-2' +23:39:08 1594319948 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.089 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.089 new file mode 100644 index 0000000..70389dd Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.089 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.090 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.090 new file mode 100644 index 0000000..d1f61c0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.090 @@ -0,0 +1,6 @@ +02:24:01 1594243441 1 10057 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 870 8 4655 9 5410 10 770 11 12 320542 +14:50:48 1594288248 3 14 +16:00:55 1594292455 0 A--32-120-2016 ॢ 0 +19:06:11 1594303571 1 10058 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 10 7 770 9 5080 10 690 +20:54:34 1594310074 1 10058 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 10 4 2 5 Ti 6 7 770 8 4655 9 5080 10 690 11 12 320542 +21:49:53 1594313393 0 A--32-170-2018 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.091 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.091 new file mode 100644 index 0000000..ffe6ac5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.091 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.092 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.092 new file mode 100644 index 0000000..a5215d2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.092 @@ -0,0 +1,108 @@ +21 01:11:59 01:12:02 +Rsk= 25.5 Rkk= 22.4 + +20 01:23:25 01:23:34 +Riz_sol=11233.4 + +22 01:59:56 02:15:03 +P1= 42.3 T1=02:10:03 P2= 52.6 T2=02:15:03 Vs= 2.06 + +23 02:15:20 02:15:25 + + +24 02:15:32 02:16:10 + + +30 02:16:22 02:16:47 +Vst= 29.1 + +31 02:16:55 02:17:28 +Rom_sol= 13.0 + +32 02:17:54 02:18:30 +Imax=27.1 Umax=55.0 T= 9.0 + +33 02:18:45 02:19:06 +Imin=16.0 Umin=25.0 T= 0.5 + +34 02:19:37 02:20:00 +V=300.2 T= 9.4 + +35 02:20:12 02:21:14 +Q= 53.8 T= 9.4 + +36 02:21:18 02:21:59 +P1=0.29 T= 2.9 + +37 02:22:02 02:22:38 +T= 1.0 + +38 02:22:42 02:22:50 +t= 53.0 T= 0.5 + +39 02:22:53 02:23:01 +t= 51.7 T= 0.6 + +40 02:23:04 02:23:11 +t= 52.3 T= 0.6 + +21 14:51:10 14:51:13 +Rsk= 24.9 Rkk= 21.6 + +22 15:19:53 15:35:00 +P1= 59.3 T1=15:30:00 P2= 74.9 T2=15:35:00 Vs= 3.12 + +21 19:05:23 19:05:26 +Rsk= 26.0 Rkk= 22.0 + +20 19:15:12 19:15:20 +Riz_sol=10869.8 + +22 20:05:32 20:20:38 +P1= 51.2 T1=20:15:38 P2= 67.0 T2=20:20:38 Vs= 3.15 + +22 20:30:08 20:45:15 +P1= 48.0 T1=20:40:15 P2= 62.5 T2=20:45:15 Vs= 2.89 + +23 20:45:46 20:45:52 + + +24 20:45:58 20:46:34 + + +30 20:46:48 20:47:25 +Vst= 29.3 + +31 20:47:34 20:48:10 +Rom_sol= 11.5 + +41 20:48:50 20:48:55 +Ukz= 0.85 + +32 20:48:59 20:49:34 +Imax=11.0 Umax=50.0 T= 9.0 + +33 20:49:38 20:50:01 +Imin= 8.0 Umin=18.0 T= 3.0 + +34 20:50:11 20:50:33 +V=300.1 T= 9.5 + +35 20:50:37 20:51:43 +Q= 54.3 T= 9.4 + +40 20:51:48 20:51:56 +t= 52.1 T= 0.6 + +39 20:51:59 20:52:06 +t= 52.6 T= 0.6 + +38 20:52:10 20:52:17 +t= 53.0 T= 0.6 + +37 20:52:22 20:52:57 +T= 1.0 + +36 20:53:01 20:53:41 +P1=0.30 T= 3.0 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.093 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.093 new file mode 100644 index 0000000..9e8dafe --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.093 @@ -0,0 +1,16 @@ +8 01:11:19 1594239079 +25 02:16:18 1594242978 +9 02:24:01 1594243441 +10 03:00:26 1594245626 +11 05:38:04 1594255084 +12 09:00:29 1594267229 +13 11:07:51 1594274871 +0 11:07:51 1594274871 +14 14:50:43 1594288243 +15 15:36:34 1594290994 +16 16:03:50 1594292630 +1 16:53:48 1594295628 +8 18:53:18 1594302798 +25 20:46:45 1594309605 +9 20:54:34 1594310074 +10 21:39:53 1594312793 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.094 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.094 new file mode 100644 index 0000000..7cb268d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.094 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.095 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.095 new file mode 100644 index 0000000..23fe01a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.095 @@ -0,0 +1 @@ +17 19:06:30 1594303590 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.096 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.096 new file mode 100644 index 0000000..f3f9307 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.096 @@ -0,0 +1,93 @@ +[56] +oper = 8 +begin = 09.07.2020 01:11:19 +norma = 40 +vac_time = 13 +real = 64 + +[57] +oper = 25 +begin = 09.07.2020 02:16:18 +norma = 30 +real = 7 + +[58] +oper = 9 +begin = 09.07.2020 02:24:01 +norma = 0 +real = 36 + +[59] +oper = 10 +begin = 09.07.2020 03:00:26 +norma = 0 +real = 157 + +[60] +oper = 11 +begin = 09.07.2020 05:38:04 +norma = 0 +real = 202 + +[61] +oper = 12 +begin = 09.07.2020 09:00:29 +norma = 105 +real = 127 + +[62] +oper = 13 +begin = 09.07.2020 11:07:51 +norma = 45 +real = 222 + +[63] +oper = 14 +begin = 09.07.2020 14:50:43 +norma = 40 +vac_time = 8 +real = 45 + +[64] +oper = 15 +begin = 09.07.2020 15:36:34 +norma = 30 +real = 27 + +[65] +oper = 16 +begin = 09.07.2020 16:03:50 +norma = 40 +real = 49 + +[66] +oper = 1 +begin = 09.07.2020 16:53:48 +norma = 85 +real = 119 + +[67] +oper = 8 +begin = 09.07.2020 18:53:18 +norma = 40 +vac_time = 22 +real = 113 + +[68] +oper = 25 +begin = 09.07.2020 20:46:45 +norma = 30 +real = 7 + +[69] +oper = 9 +begin = 09.07.2020 20:54:34 +norma = 0 +real = 45 + +[70] +oper = 10 +begin = 09.07.2020 21:39:53 +norma = 0 +real = 941 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.097 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.097 new file mode 100644 index 0000000..43fe06b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.097 @@ -0,0 +1,24 @@ +02:15:33 1594242933 祭 ॣ '-2'(A) +02:16:10 1594242970 ⪫祭 ॣ '-2'(A) +02:38:07 1594244287 祭 ॣ '-2' +03:00:25 1594245625 祭 ⠭ ॣ +09:00:33 1594267233 ⪫祭 ॣ '-2'(A) +09:01:03 1594267263 祭 ० ᪠ +09:03:21 1594267401 ⪫祭 ० ᪠ (A) +15:36:22 1594290982 祭 ० ࠧ +15:36:24 1594290984 祭 ० ' ⮪ 㣨' +15:36:32 1594290992 祭 ॣ '-2'(A) +16:00:55 1594292455 ⪫祭 ० ࠧ (A) +16:03:52 1594292632 ⪫祭 ० ' ⮪ 㣨' +16:03:54 1594292634 ⪫祭 ॣ '-2'(A) +16:04:08 1594292648 祭 ० ᪠ +16:04:08 1594292648 祭 ० ᪠ +16:06:24 1594292784 ⪫祭 ० ᪠ (A) +20:46:01 1594309561 祭 ॣ '-2'(A) +20:46:35 1594309595 ⪫祭 ॣ '-2'(A) +20:53:51 1594310031 祭 ० ࠧ +20:53:55 1594310035 祭 ० ' ⮪ 㣨' +21:10:53 1594311053 祭 ॣ '-2'(A) +21:39:53 1594312793 ⪫祭 ० ࠧ (A) +21:39:53 1594312793 祭 ⠭ ॣ +21:49:53 1594313393 祭 ॣ ।. 60 ᥪ. 殮 㣨 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.099 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.099 new file mode 100644 index 0000000..7ffe321 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.099 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.100 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.100 new file mode 100644 index 0000000..76c4606 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.100 @@ -0,0 +1,4 @@ +08:47:22 1594266442 3 14 +13:30:54 1594283454 1 11162 3 25 9 3680 +17:53:39 1594299219 1 11162 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4570 9 3680 10 670 11 12 321801 +18:22:26 1594300946 0 A--32-068-2019 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.101 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.101 new file mode 100644 index 0000000..15401ca Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.101 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.102 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.102 new file mode 100644 index 0000000..3817d9e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.102 @@ -0,0 +1,63 @@ +21 08:47:31 08:47:38 +Rsk= 18.6 Rkk= 17.0 + +22 09:05:31 09:20:36 +P1= 54.8 T1=09:15:36 P2= 73.7 T2=09:20:36 Vs= 3.77 + +21 13:31:17 13:31:25 +Rsk= 18.2 Rkk= 16.6 + +22 14:05:13 14:20:18 +P1= 51.7 T1=14:15:18 P2= 65.8 T2=14:20:18 Vs= 2.81 + +20 16:56:53 16:57:03 +Riz_sol= 8748.9 + +21 16:57:16 16:57:24 +Rsk= 18.4 Rkk= 16.9 + +22 17:28:22 17:43:28 +P1= 41.9 T1=17:38:28 P2= 56.8 T2=17:43:28 Vs= 2.98 + +23 17:44:02 17:44:08 + + +24 17:44:20 17:44:57 + + +30 17:45:11 17:45:47 +Vst= 28.6 + +31 17:45:52 17:46:53 +Rom_sol= 13.5 + +41 17:47:35 17:47:40 +Ukz= 1.00 + +32 17:47:44 17:48:54 +Imax=11.3 Umax=50.0 T= 9.4 + +33 17:48:58 17:49:30 +Imin=16.4 Umin=25.1 T= 0.8 + +34 17:49:32 17:50:01 +V=301.8 T= 9.7 + +36 17:50:04 17:50:40 +P1=0.30 T= 3.1 + +35 17:50:43 17:51:42 +Q= 54.9 T= 9.2 + +37 17:51:45 17:52:22 +T= 0.7 + +38 17:52:26 17:52:32 +t= 51.6 T= 0.5 + +39 17:52:35 17:52:42 +t= 51.5 T= 0.5 + +40 17:52:45 17:52:52 +t= 51.6 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.103 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.103 new file mode 100644 index 0000000..280ed90 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.103 @@ -0,0 +1,17 @@ +11 03:01:16 1594245676 +12 05:45:01 1594255501 +13 07:33:51 1594262031 +0 07:33:51 1594262031 +14 08:38:29 1594265909 +15 09:21:51 1594268511 +16 09:45:25 1594269925 +1 10:20:36 1594272036 +2 13:28:05 1594283285 +5 14:22:15 1594286535 +6 14:32:00 1594287120 +7 15:06:06 1594289166 +8 16:55:02 1594295702 +25 17:45:09 1594298709 +9 17:53:39 1594299219 +10 18:22:27 1594300947 +11 21:28:05 1594312085 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.104 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.104 new file mode 100644 index 0000000..3316688 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.104 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.106 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.106 new file mode 100644 index 0000000..6543f4a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.106 @@ -0,0 +1,99 @@ +[84] +oper = 11 +begin = 09.07.2020 03:01:16 +norma = 0 +real = 163 + +[85] +oper = 12 +begin = 09.07.2020 05:45:01 +norma = 105 +real = 108 + +[86] +oper = 13 +begin = 09.07.2020 07:33:51 +norma = 45 +real = 64 + +[87] +oper = 14 +begin = 09.07.2020 08:38:29 +norma = 40 +vac_time = 9 +real = 43 + +[88] +oper = 15 +begin = 09.07.2020 09:21:51 +norma = 30 +real = 23 + +[89] +oper = 16 +begin = 09.07.2020 09:45:25 +norma = 40 +real = 35 + +[90] +oper = 1 +begin = 09.07.2020 10:20:36 +norma = 85 +real = 187 + +[91] +oper = 2 +begin = 09.07.2020 13:28:05 +norma = 110 +vac_time = 9 +real = 54 + +[92] +oper = 5 +begin = 09.07.2020 14:22:15 +norma = 25 +real = 9 + +[93] +oper = 6 +begin = 09.07.2020 14:32:00 +norma = 35 +real = 34 + +[94] +oper = 7 +begin = 09.07.2020 15:06:06 +norma = 30 +real = 108 + +[95] +oper = 8 +begin = 09.07.2020 16:55:02 +norma = 40 +vac_time = 8 +real = 50 + +[96] +oper = 25 +begin = 09.07.2020 17:45:09 +norma = 30 +real = 8 + +[97] +oper = 9 +begin = 09.07.2020 17:53:39 +norma = 0 +real = 28 + +[98] +oper = 10 +begin = 09.07.2020 18:22:27 +norma = 0 +real = 185 + +[99] +oper = 11 +begin = 09.07.2020 21:28:05 +norma = 0 +real = 163 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.107 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.107 new file mode 100644 index 0000000..99ca7db --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.107 @@ -0,0 +1,32 @@ +03:01:16 1594245676 祭 ० +03:01:17 1594245677 ⪫祭 ॣ '-2'(A) +03:01:18 1594245678 祭 ॣ '-2'(A) +03:51:17 1594248677 ⪫祭 ॣ '-2'(A) +05:44:59 1594255499 ⪫祭 ० (A) +05:45:00 1594255500 ⪫祭 +05:45:00 1594255500 : +05:45:03 1594255503 ⪫祭 ० ' ⮪ 㣨' +06:14:59 1594257299 : 믮 +09:21:31 1594268491 祭 ० ࠧ +09:21:35 1594268495 祭 ० ' ⮪ 㣨' +09:21:50 1594268510 祭 ॣ '-2'(A) +09:35:53 1594269353 ⪫祭 ० ' ⮪ 㣨' +09:43:07 1594269787 ⪫祭 ० ࠧ (A) +09:45:29 1594269929 ⪫祭 ॣ '-2'(A) +13:30:56 1594283456 : 㦥 +17:44:05 1594298645 ' ' +17:44:05 1594298645 祭 +17:44:23 1594298663 祭 ॣ '-2'(A) +17:44:58 1594298698 ⪫祭 ॣ '-2'(A) +17:45:53 1594298753 祭 +17:46:53 1594298813 ⪫祭 +17:53:12 1594299192 祭 ० ࠧ +17:53:13 1594299193 祭 ० ' ⮪ 㣨' +17:53:39 1594299219 : 믮 +18:10:25 1594300225 祭 ॣ '-2'(A) +18:22:26 1594300946 祭 ॣ . 殮 㣨 +18:22:26 1594300946 ⪫祭 ० ࠧ (A) +21:28:04 1594312084 祭 ० +21:28:05 1594312085 ⪫祭 ॣ '-2'(A) +21:28:06 1594312086 祭 ॣ '-2'(A) +22:18:05 1594315085 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.109 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.109 new file mode 100644 index 0000000..740001e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.109 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.110 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.110 new file mode 100644 index 0000000..2505625 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.110 @@ -0,0 +1,5 @@ +09:12:41 1594267961 3 14 +12:46:57 1594280817 1 10825 2 p. cao M1,M2,M3,M4 3 25 9 4740 12 321438 +15:13:17 1594289597 2 ᯥਬ 3 37 +16:43:48 1594295028 1 10825 2 ᯥਬ 3 37 4 2 5 Ti 6 7 770 8 3100 9 4740 10 670 11 12 321438 +17:18:24 1594297104 0 A--32-075-2018 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.111 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.111 new file mode 100644 index 0000000..15db0fb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.111 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.112 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.112 new file mode 100644 index 0000000..3904e83 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.112 @@ -0,0 +1,66 @@ +21 09:12:56 09:12:59 +Rsk= 22.5 Rkk= 19.2 + +22 09:50:02 10:00:07 +P1= 40.2 T1=09:55:07 P2= 59.1 T2=10:00:07 Vs= 3.78 + +21 12:47:14 12:47:17 +Rsk= 22.6 Rkk= 19.3 + +22 13:30:21 13:45:26 +P1= 68.8 T1=13:40:26 P2= 82.8 T2=13:45:26 Vs= 2.79 + +20 15:28:10 15:28:18 +Riz_sol= 4856.9 + +21 15:28:25 15:28:28 +Rsk= 22.7 Rkk= 19.4 + +22 15:55:40 16:10:45 +P1= 65.6 T1=16:05:45 P2= 82.3 T2=16:10:45 Vs= 3.33 + +22 16:20:09 16:35:14 +P1= 51.4 T1=16:30:14 P2= 62.4 T2=16:35:14 Vs= 2.19 + +23 16:35:21 16:35:27 + + +24 16:35:33 16:36:11 + + +30 16:36:25 16:36:50 +Vst= 29.9 + +31 16:37:00 16:38:01 +Rom_sol= 13.5 + +41 16:38:27 16:38:32 +Ukz= 0.83 + +32 16:38:36 16:39:10 +Imax=27.0 Umax=55.0 T= 9.0 + +33 16:39:15 16:39:33 +Imin=15.9 Umin=25.0 T= 0.5 + +34 16:39:36 16:39:58 +V=300.1 T= 9.4 + +35 16:40:03 16:41:18 +Q= 53.8 T= 9.4 + +36 16:41:22 16:41:57 +P1=0.29 T= 2.9 + +37 16:42:00 16:42:29 +T= 0.9 + +38 16:42:33 16:42:40 +t= 52.3 T= 0.5 + +39 16:42:44 16:42:59 +tcam= 53.4 Tcam= 0.5 tfl= 53.0 Tfl= 0.5 + +40 16:43:03 16:43:10 +t= 53.1 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.113 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.113 new file mode 100644 index 0000000..6c043e9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.113 @@ -0,0 +1,18 @@ +11 03:03:00 1594245780 +12 05:46:43 1594255603 +13 07:34:09 1594262049 +0 07:34:09 1594262049 +14 09:10:02 1594267802 +15 10:01:10 1594270870 +16 10:28:43 1594272523 +1 11:15:58 1594275358 +2 12:40:50 1594280450 +5 13:46:52 1594284412 +6 13:59:02 1594285142 +7 14:37:30 1594287450 +8 15:26:23 1594290383 +25 16:36:23 1594294583 +9 16:43:48 1594295028 +10 17:18:24 1594297104 +11 19:41:11 1594305671 +12 22:33:24 1594316004 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.114 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.114 new file mode 100644 index 0000000..c6142b1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.114 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.116 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.116 new file mode 100644 index 0000000..5727171 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.116 @@ -0,0 +1,105 @@ +[12] +oper = 11 +begin = 09.07.2020 03:03:00 +norma = 0 +real = 163 + +[13] +oper = 12 +begin = 09.07.2020 05:46:43 +norma = 105 +real = 107 + +[14] +oper = 13 +begin = 09.07.2020 07:34:09 +norma = 45 +real = 95 + +[15] +oper = 14 +begin = 09.07.2020 09:10:02 +norma = 40 +vac_time = 10 +real = 51 + +[16] +oper = 15 +begin = 09.07.2020 10:01:10 +norma = 30 +real = 27 + +[17] +oper = 16 +begin = 09.07.2020 10:28:43 +norma = 40 +real = 47 + +[18] +oper = 1 +begin = 09.07.2020 11:15:58 +norma = 85 +real = 84 + +[19] +oper = 2 +begin = 09.07.2020 12:40:50 +norma = 110 +vac_time = 11 +real = 66 + +[20] +oper = 5 +begin = 09.07.2020 13:46:52 +norma = 25 +real = 12 + +[21] +oper = 6 +begin = 09.07.2020 13:59:02 +norma = 35 +real = 38 + +[22] +oper = 7 +begin = 09.07.2020 14:37:30 +norma = 30 +real = 48 + +[23] +oper = 8 +begin = 09.07.2020 15:26:23 +norma = 40 +vac_time = 9 +real = 70 + +[24] +oper = 25 +begin = 09.07.2020 16:36:23 +norma = 30 +real = 7 + +[25] +oper = 9 +begin = 09.07.2020 16:43:48 +norma = 0 +real = 34 + +[26] +oper = 10 +begin = 09.07.2020 17:18:24 +norma = 0 +real = 142 + +[27] +oper = 11 +begin = 09.07.2020 19:41:11 +norma = 0 +real = 172 + +[28] +oper = 12 +begin = 09.07.2020 22:33:24 +norma = 105 +real = 110 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.117 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.117 new file mode 100644 index 0000000..83c140e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.117 @@ -0,0 +1,63 @@ +03:02:59 1594245779 祭 ० +03:03:00 1594245780 ⪫祭 ॣ '-2'(A) +03:03:01 1594245781 祭 ॣ '-2'(A) +03:53:00 1594248780 ⪫祭 ॣ '-2'(A) +05:46:42 1594255602 ⪫祭 ० (A) +05:46:43 1594255603 ⪫祭 +05:46:43 1594255603 : +05:46:45 1594255605 ⪫祭 ० ' ⮪ 㣨' +05:47:23 1594255643 祭 ० ᪠ +05:47:24 1594255644 祭 ० ᪠ +05:47:24 1594255644 祭 ० ᪠ +05:47:24 1594255644 祭 ० ᪠ +05:47:24 1594255644 祭 ० ᪠ +05:47:25 1594255645 祭 ० ᪠ +05:49:43 1594255783 ⪫祭 ० ᪠ (A) +06:16:42 1594257402 : 믮 +10:00:49 1594270849 祭 ० ࠧ +10:00:50 1594270850 祭 ० ' ⮪ 㣨' +10:01:54 1594270914 祭 ॣ '-2'(A) +10:28:44 1594272524 ⪫祭 ० ' ⮪ 㣨' +10:28:47 1594272527 ⪫祭 ॣ '-2'(A) +10:29:18 1594272558 祭 ० ᪠ +10:30:52 1594272652 ⪫祭 ० ᪠ +10:30:55 1594272655 祭 ० ᪠ +10:30:58 1594272658 ⪫祭 ० ᪠ +13:59:50 1594285190 祭 ० ᪠ +14:02:02 1594285322 ⪫祭 ० ᪠ (A) +15:13:20 1594289600 : 㦥 +16:35:35 1594294535 祭 ॣ '-2'(A) +16:36:11 1594294571 ⪫祭 ॣ '-2'(A) +16:36:55 1594294615 祭 +16:37:01 1594294621 祭 +16:38:01 1594294681 ⪫祭 +16:43:22 1594295002 祭 ० ࠧ +16:43:24 1594295004 祭 ० ' ⮪ 㣨' +16:43:49 1594295029 : 믮 +17:03:24 1594296204 祭 ॣ '-2'(A) +17:18:24 1594297104 ⪫祭 ० ࠧ (A) +17:18:24 1594297104 祭 ॣ . 殮 㣨 +18:25:22 1594301122 ⪫祭 ० ' ⮪ 㣨' +18:25:24 1594301124 ⪫祭 ॣ '-2'(A) +18:26:25 1594301185 祭 ० ' ⮪ 㣨' +18:26:42 1594301202 ⪫祭 ० ' ⮪ 㣨' +18:28:39 1594301319 祭 ० ' ⮪ 㣨' +18:33:59 1594301639 祭 ॣ '-2' +19:41:11 1594305671 祭 ० +19:41:12 1594305672 ⪫祭 ॣ '-2'(A) +19:41:13 1594305673 祭 ॣ '-2'(A) +20:46:12 1594309572 ⪫祭 ॣ '-2'(A) +22:33:14 1594315994 ⪫祭 ० (A) +22:33:16 1594315996 ⪫祭 +22:33:16 1594315996 : +22:33:17 1594315997 ⪫祭 ० ' ⮪ 㣨' +22:34:26 1594316066 祭 ० ᪠ +22:34:26 1594316066 祭 ० ᪠ +22:34:26 1594316066 祭 ० ᪠ +22:34:54 1594316094 . ⪫祭 ० ᪠ (A) +22:35:09 1594316109 祭 ० ᪠ +22:35:09 1594316109 祭 ० ᪠ +22:35:10 1594316110 祭 ० ᪠ +22:35:10 1594316110 祭 ० ᪠ +22:37:16 1594316236 ⪫祭 ० ᪠ (A) +23:03:16 1594317796 : 믮 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.119 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.119 new file mode 100644 index 0000000..2a11d3a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.119 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.120 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.120 new file mode 100644 index 0000000..ecd444c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.120 @@ -0,0 +1,3 @@ +05:17:47 1594253867 3 14 +06:42:03 1594258923 0 A--32-120-2016 ॢ 0 +18:46:53 1594302413 1 10887 3 37 9 8370 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.121 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.121 new file mode 100644 index 0000000..e62a65f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.121 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.122 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.122 new file mode 100644 index 0000000..47e411b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.122 @@ -0,0 +1,27 @@ +21 05:18:02 05:18:05 +Rsk= 12.2 Rkk= 8.2 + +22 05:50:17 06:05:24 +P1= 59.5 T1=06:00:24 P2= 78.7 T2=06:05:24 Vs= 3.82 + +21 18:46:01 18:46:04 +Rsk= 15.7 Rkk= 11.6 + +22 19:25:01 19:40:08 +P1= 67.6 T1=19:35:08 P2= 88.9 T2=19:40:08 Vs= 4.27 + +22 20:00:00 20:15:06 +P1= 50.8 T1=20:10:06 P2= 67.7 T2=20:15:06 Vs= 3.37 + +22 20:30:39 20:45:46 +P1= 46.1 T1=20:40:46 P2= 61.0 T2=20:45:46 Vs= 2.99 + +20 22:52:20 22:52:29 +Riz_sol= 4974.3 + +21 22:52:36 22:52:39 +Rsk= 15.9 Rkk= 11.9 + +22 23:35:04 23:50:11 +P1= 53.9 T1=23:45:11 P2= 71.2 T2=23:50:11 Vs= 3.46 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.123 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.123 new file mode 100644 index 0000000..66cbc66 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.123 @@ -0,0 +1,12 @@ +12 02:09:04 1594242544 +13 04:44:03 1594251843 +0 04:44:03 1594251843 +14 05:17:45 1594253865 +15 06:06:04 1594256764 +16 06:45:24 1594259124 +1 07:33:46 1594262026 +2 18:43:12 1594302192 +5 20:46:39 1594309599 +6 20:59:27 1594310367 +7 21:43:16 1594312996 +8 22:51:24 1594317084 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.124 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.124 new file mode 100644 index 0000000..d41ccf5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.124 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.126 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.126 new file mode 100644 index 0000000..3954db3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.126 @@ -0,0 +1,69 @@ +[13] +oper = 12 +begin = 09.07.2020 02:09:04 +norma = 105 +real = 154 + +[14] +oper = 13 +begin = 09.07.2020 04:44:03 +norma = 45 +real = 33 + +[15] +oper = 14 +begin = 09.07.2020 05:17:45 +norma = 40 +vac_time = 7 +real = 48 + +[16] +oper = 15 +begin = 09.07.2020 06:06:04 +norma = 30 +real = 39 + +[17] +oper = 16 +begin = 09.07.2020 06:45:24 +norma = 40 +real = 48 + +[18] +oper = 1 +begin = 09.07.2020 07:33:46 +norma = 85 +real = 669 + +[19] +oper = 2 +begin = 09.07.2020 18:43:12 +norma = 110 +vac_time = 8 +real = 123 + +[20] +oper = 5 +begin = 09.07.2020 20:46:39 +norma = 25 +real = 12 + +[21] +oper = 6 +begin = 09.07.2020 20:59:27 +norma = 35 +real = 43 + +[22] +oper = 7 +begin = 09.07.2020 21:43:16 +norma = 30 +real = 68 + +[23] +oper = 8 +begin = 09.07.2020 22:51:24 +norma = 40 +vac_time = 7 +real = 91 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.127 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.127 new file mode 100644 index 0000000..6238c9f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.127 @@ -0,0 +1,36 @@ +02:09:03 1594242543 ⪫祭 ० (A) +02:09:05 1594242545 ⪫祭 ० ' ⮪ 㣨' +02:10:02 1594242602 祭 ० ᪠ +02:10:03 1594242603 祭 ० ᪠ +02:10:03 1594242603 祭 ० ᪠ +02:10:03 1594242603 祭 ० ᪠ +02:10:03 1594242603 祭 ० ᪠ +02:10:03 1594242603 祭 ० ᪠ +02:10:04 1594242604 祭 ० ᪠ +02:12:19 1594242739 ⪫祭 ० ᪠ +02:12:20 1594242740 祭 ० ᪠ +02:12:35 1594242755 ⪫祭 ० ᪠ (A) +06:05:57 1594256757 祭 ० ࠧ +06:05:58 1594256758 祭 ० ' ⮪ 㣨' +06:06:21 1594256781 ⪫祭 ० ' ⮪ 㣨' +06:06:33 1594256793 ⪫祭 ० ࠧ +06:06:34 1594256794 祭 ० ࠧ +06:06:35 1594256795 祭 ० ' ⮪ 㣨' +06:07:50 1594256870 祭 ॣ '-2'(A) +06:42:03 1594258923 ⪫祭 ० ࠧ (A) +06:42:18 1594258938 ⪫祭 ० ' ⮪ 㣨' +06:45:28 1594259128 ⪫祭 ॣ '-2'(A) +06:45:58 1594259158 祭 ० ᪠ +06:45:58 1594259158 祭 ० ᪠ +06:45:58 1594259158 祭 ० ᪠ +06:45:59 1594259159 祭 ० ᪠ +06:48:27 1594259307 ⪫祭 ० ᪠ (A) +11:13:45 1594275225 祭 ॣ '-2'(A) +11:13:46 1594275226 ⪫祭 ॣ '-2'(A) +11:49:39 1594277379 祭 ॣ '-2'(A) +11:49:39 1594277379 ⪫祭 ॣ '-2'(A) +20:59:51 1594310391 祭 ० ᪠ +20:59:51 1594310391 祭 ० ᪠ +20:59:51 1594310391 祭 ० ᪠ +20:59:52 1594310392 祭 ० ᪠ +21:03:06 1594310586 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.129 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.129 new file mode 100644 index 0000000..663baa7 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.129 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.150 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.150 new file mode 100644 index 0000000..c546ae3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.150 @@ -0,0 +1,4 @@ +00:55:09 1594238109 3 14 +04:30:11 1594251011 1 05004 2 p. cao M1,M2,M3,M4 3 17 4 1 9 4050 10 650 +09:59:23 1594270763 1 05004 2 p. cao M1,M2,M3,M4 3 17 4 1 5 Ti 6 7 770 8 3000 9 4050 10 650 11 12 320995 +22:47:14 1594316834 1 05005 2 BT 18, 20, 22, 23, 25 3 25 8 4050 9 5120 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.151 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.151 new file mode 100644 index 0000000..1465001 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.151 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.152 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.152 new file mode 100644 index 0000000..fded391 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.152 @@ -0,0 +1,72 @@ +21 00:54:57 00:55:00 +Rsk= 48.4 Rkk= 19.6 + +22 01:19:45 01:30:01 +P1= 27.4 T1=01:25:01 P2= 50.2 T2=01:30:01 Vs= 4.55 + +21 04:20:12 04:20:15 +Rsk= 51.1 Rkk= 20.4 + +22 05:19:48 05:35:03 +P1= 77.9 T1=05:30:03 P2=100.7 T2=05:35:03 Vs= 4.56 + +22 05:50:52 06:06:07 +P1= 54.2 T1=06:01:07 P2= 72.0 T2=06:06:07 Vs= 3.57 + +22 06:29:49 06:45:04 +P1= 39.5 T1=06:40:04 P2= 52.0 T2=06:45:04 Vs= 2.50 + +20 08:54:16 08:54:25 +Riz_sol= 4834.4 + +21 08:54:34 08:54:37 +Rsk= 22.4 Rkk= 18.6 + +22 09:36:18 09:51:34 +P1= 45.4 T1=09:46:34 P2= 59.7 T2=09:51:34 Vs= 2.86 + +23 09:51:42 09:51:47 + + +24 09:51:56 09:52:34 + + +30 09:52:50 09:53:09 +Vst= 48.0 + +31 09:53:15 09:53:48 +Rom_sol= 11.8 + +32 09:54:28 09:55:05 +Imax=10.9 Umax=50.0 T= 9.0 + +33 09:55:09 09:55:30 +Imin=15.9 Umin=24.9 T= 0.5 + +34 09:55:34 09:55:58 +V=300.0 T= 9.9 + +35 09:56:01 09:57:08 +Q= 52.7 T= 9.9 + +36 09:57:13 09:57:47 +P1=0.29 T= 3.4 + +37 09:58:10 09:58:30 +T= 1.4 + +38 09:58:34 09:58:41 +t= 53.4 T= 0.9 + +39 09:58:45 09:58:53 +t= 53.3 T= 0.9 + +40 09:58:57 09:59:04 +t= 52.2 T= 0.9 + +21 22:46:11 22:46:14 +Rsk= 47.7 Rkk= 19.2 + +22 23:16:35 23:31:50 +P1= 57.9 T1=23:26:50 P2= 72.4 T2=23:31:50 Vs= 2.90 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.153 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.153 new file mode 100644 index 0000000..a73dfd9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.153 @@ -0,0 +1,18 @@ +13 00:17:36 1594235856 +0 00:17:36 1594235856 +14 00:53:54 1594238034 +15 01:30:31 1594240231 +16 01:53:04 1594241584 +1 02:39:59 1594244399 +2 04:18:12 1594250292 +5 07:46:06 1594262766 +6 07:56:05 1594263365 +7 08:35:56 1594265756 +8 08:53:20 1594266800 +25 09:52:48 1594270368 +9 09:59:23 1594270763 +10 10:19:04 1594271944 +12 16:12:49 1594293169 +13 20:34:54 1594308894 +0 20:34:55 1594308895 +2 22:43:12 1594316592 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.154 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.154 new file mode 100644 index 0000000..1ea140a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.154 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.155 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.155 new file mode 100644 index 0000000..1e0c79b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.155 @@ -0,0 +1 @@ +47 09:57:59 1594270679 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.156 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.156 new file mode 100644 index 0000000..a0f10ba --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.156 @@ -0,0 +1,100 @@ +[64] +oper = 13 +begin = 09.07.2020 00:17:36 +norma = 45 +real = 36 + +[65] +oper = 14 +begin = 09.07.2020 00:53:54 +norma = 40 +vac_time = 9 +real = 36 + +[66] +oper = 15 +begin = 09.07.2020 01:30:31 +norma = 30 +real = 22 + +[67] +oper = 16 +begin = 09.07.2020 01:53:04 +norma = 40 +real = 46 + +[68] +oper = 1 +begin = 09.07.2020 02:39:59 +norma = 85 +real = 98 + +[69] +oper = 2 +begin = 09.07.2020 04:18:12 +norma = 110 +vac_time = 13 +real = 207 + +[70] +oper = 5 +begin = 09.07.2020 07:46:06 +norma = 25 +real = 9 + +[71] +oper = 6 +begin = 09.07.2020 07:56:05 +norma = 35 +real = 39 + +[72] +oper = 7 +begin = 09.07.2020 08:35:56 +norma = 30 +real = 17 + +[73] +oper = 8 +begin = 09.07.2020 08:53:20 +norma = 40 +vac_time = 8 +real = 59 + +[74] +oper = 25 +begin = 09.07.2020 09:52:48 +norma = 30 +real = 6 + +[75] +oper = 9 +begin = 09.07.2020 09:59:23 +norma = 0 +real = 19 + +[76] +oper = 10 +begin = 09.07.2020 10:19:04 +norma = 0 +real = 353 + +[77] +oper = 12 +begin = 09.07.2020 16:12:49 +norma = 180 +real = 262 + +[78] +oper = 13 +begin = 09.07.2020 20:34:54 +norma = 45 +real = 128 + +[79] +oper = 2 +begin = 09.07.2020 22:43:12 +norma = 110 +vac_time = 10 +real = 526 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.157 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.157 new file mode 100644 index 0000000..101f05d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.157 @@ -0,0 +1,26 @@ +01:30:26 1594240226 祭 ० ࠧ +01:30:28 1594240228 祭 ० ' ⮪ 㣨' +01:30:29 1594240229 祭 ॣ '-2'(A) +01:52:25 1594241545 ⪫祭 ० ' ⮪ 㣨' +01:53:07 1594241587 ⪫祭 ॣ '-2'(A) +01:53:08 1594241588 ⪫祭 ० ࠧ +01:53:29 1594241609 祭 ० ᪠ +01:53:29 1594241609 祭 ० ᪠ +01:55:59 1594241759 ⪫祭 ० ᪠ (A) +07:56:57 1594263417 祭 ० ᪠ +07:59:40 1594263580 ⪫祭 ० ᪠ (A) +09:51:58 1594270318 祭 ॣ '-2'(A) +09:52:35 1594270355 ⪫祭 ॣ '-2'(A) +10:16:01 1594271761 祭 ॣ '-2' +10:19:26 1594271966 祭 ⠭ ॣ +11:49:25 1594277365 ⪫祭 ॣ '-2'(A) +11:54:26 1594277666 祭 ॣ '-2' +14:41:27 1594287687 ⪫祭 ॣ '-2'(A) +15:12:16 1594289536 祭 ॣ '-2' +16:16:05 1594293365 ⪫祭 ॣ '-2'(A) +16:16:11 1594293371 祭 ० ᪠ +16:16:11 1594293371 祭 ० ᪠ +16:16:20 1594293380 祭 ० ᪠ +16:16:20 1594293380 祭 ० ᪠ +16:16:20 1594293380 祭 ० ᪠ +16:19:09 1594293549 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.159 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.159 new file mode 100644 index 0000000..af7e398 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.159 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.160 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.160 new file mode 100644 index 0000000..ca1337c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.160 @@ -0,0 +1,7 @@ +02:33:43 1594244023 4 3 +02:34:20 1594244060 4 1 +03:04:41 1594245881 1 05369 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 5240 9 5060 10 560 11 12 320507 +03:33:52 1594247632 0 A--32-106-2016 ॢ 1 +18:48:47 1594302527 1 05370 2 BT 3-1, 6, 8, 9, 14, 15, 16 4 2 7 870 9 4790 10 770 11 +23:03:43 1594317823 1 05370 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 870 8 5240 9 4790 10 770 11 12 320507 +23:34:26 1594319666 0 A--32-078-2017 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.161 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.161 new file mode 100644 index 0000000..6d82333 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.161 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.162 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.162 new file mode 100644 index 0000000..985f7f0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.162 @@ -0,0 +1,411 @@ +21 00:28:40 00:28:43 +Rsk= 23.3 Rkk= 20.4 + +20 00:28:47 00:28:57 +Riz_sol= 869.8 + +22 01:54:54 02:04:59 +P1= 15.6 T1=01:59:58 P2= 20.2 T2=02:04:59 Vs= 0.92 + +23 02:05:07 02:05:12 + + +24 02:05:17 02:05:54 + + +30 02:06:10 02:06:34 +Vst= 33.0 + +31 02:06:38 02:07:12 +Rom_sol= 4.7 + +41 02:07:48 02:07:53 +Ukz= 1.26 + +32 02:07:55 02:08:30 +Imax=11.3 Umax=50.0 T= 9.0 + +33 02:08:32 02:08:51 +Imin=16.3 Umin=25.0 T= 0.5 + +34 05:00:00 02:09:18 +V=300.3 T= 9.6 + +35 02:09:20 02:10:19 +Q= 53.8 T= 9.6 + +36 02:10:28 02:10:59 +P1=0.29 T= 3.1 + +37 02:11:02 02:11:27 +T= 1.1 + +38 02:11:31 02:11:38 +t= 52.9 T= 0.8 + +39 02:11:40 02:11:41 +t= 50.3 T= 1.1 + +39 02:11:45 02:11:47 +t= 51.2 T= 1.1 + +40 02:11:52 02:11:54 +t= 0.0 T= 0.0 + +40 02:12:04 02:12:06 +t= 0.0 T= 0.0 + +40 02:12:09 02:12:10 +t= 0.0 T= 0.0 + +39 02:12:16 02:12:17 +t= 51.4 T= 1.1 + +39 02:12:16 02:12:17 +t= 51.4 T= 1.1 + +39 02:12:21 02:12:22 +t= 54.4 T= 1.1 + +39 02:12:21 02:12:22 +t= 54.4 T= 1.1 + +39 02:14:39 02:14:40 +t= 51.6 T= 1.1 + +39 02:14:44 02:14:46 +t= 51.8 T= 1.1 + +40 02:15:31 02:15:33 +t= 0.0 T= 0.0 + +40 02:19:37 02:19:38 +t= 0.0 T= 0.0 + +39 02:20:15 02:20:17 +t= 51.8 T= 1.1 + +39 02:20:15 02:20:17 +t= 51.8 T= 1.1 + +39 02:20:21 02:20:22 +t= 51.8 T= 1.1 + +39 02:20:24 02:20:26 +t= 54.5 T= 1.1 + +39 02:20:32 02:20:34 +t= 54.8 T= 1.1 + +39 02:20:40 02:20:41 +t= 51.9 T= 1.1 + +39 02:20:45 02:20:47 +t= 54.4 T= 1.1 + +39 02:20:51 02:20:53 +t= 54.4 T= 1.1 + +39 02:21:07 02:21:09 +t= 51.9 T= 1.1 + +39 02:21:14 02:21:16 +t= 54.4 T= 1.1 + +39 02:21:19 02:21:21 +t= 51.9 T= 1.1 + +39 02:21:24 02:21:26 +t= 51.8 T= 1.1 + +39 02:21:32 02:21:33 +t= 54.4 T= 1.1 + +39 02:21:37 02:21:39 +t= 52.0 T= 1.1 + +39 02:21:45 02:21:46 +t= 52.0 T= 1.1 + +39 02:21:49 02:21:50 +t= 51.9 T= 1.1 + +39 02:22:00 02:22:01 +t= 54.5 T= 1.1 + +39 02:22:05 02:22:06 +t= 54.6 T= 1.1 + +39 02:22:10 02:22:12 +t= 52.0 T= 1.1 + +39 02:30:29 02:30:31 +t= 54.6 T= 1.1 + +39 02:30:42 02:30:54 +tcam= 54.6 Tcam= 1.0 tfl= 50.9 Tfl= 1.1 + +39 02:31:00 02:31:01 +t= 51.9 T= 1.1 + +39 02:31:08 02:31:09 +t= 52.0 T= 1.1 + +39 02:31:14 02:31:16 +t= 51.9 T= 1.1 + +39 02:31:20 02:31:21 +t= 52.0 T= 1.1 + +39 02:31:27 02:31:28 +t= 51.9 T= 1.1 + +39 02:31:34 02:31:36 +t= 54.6 T= 1.1 + +39 02:31:46 02:31:47 +t= 54.6 T= 1.1 + +39 02:31:53 02:31:54 +t= 55.0 T= 1.1 + +40 02:31:58 02:32:00 +t= 0.0 T= 0.0 + +40 02:31:58 02:32:00 +t= 0.0 T= 0.0 + +40 02:32:02 02:32:03 +t= 0.0 T= 0.0 + +40 02:32:22 02:32:24 +t= 0.0 T= 0.0 + +40 02:32:26 02:32:28 +t= 0.0 T= 0.0 + +40 02:32:26 02:32:28 +t= 0.0 T= 0.0 + +39 02:32:38 02:32:39 +t= 54.8 T= 1.1 + +39 02:32:45 02:32:47 +t= 54.6 T= 1.1 + +39 02:32:45 02:32:47 +t= 54.6 T= 1.1 + +39 02:33:08 02:33:09 +t= 52.1 T= 1.1 + +39 02:33:15 02:33:16 +t= 54.6 T= 1.1 + +39 02:33:52 02:33:53 +t= 54.6 T= 1.1 + +39 02:33:57 02:33:59 +t= 54.5 T= 1.1 + +40 02:34:05 02:34:07 +t= 0.0 T= 0.0 + +39 02:34:37 02:34:38 +t= 54.9 T= 1.1 + +39 02:34:43 02:34:45 +t= 54.4 T= 1.1 + +22 02:35:23 02:45:27 +P1= 16.3 T1=02:40:27 P2= 20.4 T2=02:45:27 Vs= 0.81 + +23 02:45:56 02:46:01 + + +24 02:46:17 02:46:52 + + +30 02:47:11 02:47:36 +Vst= 33.0 + +31 02:47:42 02:48:15 +Rom_sol= 4.7 + +41 02:48:29 02:48:34 +Ukz= 1.34 + +39 02:48:38 02:48:54 +tcam= 54.9 Tcam= 1.0 tfl= 55.6 Tfl= 0.9 + +40 02:48:58 02:49:00 +t= 51.8 T= 1.1 + +40 02:49:05 02:49:07 +t= 0.0 T= 0.0 + +40 02:49:15 02:49:16 +t= 0.0 T= 0.0 + +40 02:49:19 02:49:20 +t= 0.0 T= 0.0 + +40 02:49:31 02:49:32 +t= 0.0 T= 0.0 + +40 02:49:48 02:49:50 +t= 0.0 T= 0.0 + +40 02:49:53 02:49:55 +t= 51.9 T= 1.1 + +40 02:50:02 02:50:03 +t= 0.0 T= 0.0 + +40 02:50:02 02:50:03 +t= 0.0 T= 0.0 + +40 02:50:08 02:50:10 +t= 0.0 T= 0.0 + +40 02:50:08 02:50:10 +t= 0.0 T= 0.0 + +40 02:50:12 02:50:14 +t= 48.4 T= 1.1 + +38 02:50:18 02:50:23 +t= 53.0 T= 0.8 + +40 02:50:27 02:50:29 +t= 50.0 T= 1.1 + +37 02:50:35 02:50:59 +T= 1.1 + +40 02:51:05 02:51:07 +t= 52.0 T= 1.1 + +40 02:51:11 02:51:13 +t= 51.7 T= 1.1 + +40 02:51:15 02:51:17 +t= 0.0 T= 0.0 + +40 02:51:19 02:51:21 +t= 0.0 T= 0.0 + +40 02:51:24 02:51:26 +t= 0.0 T= 0.0 + +32 02:51:31 02:52:07 +Imax=11.2 Umax=50.1 T= 9.0 + +33 02:52:12 02:52:30 +Imin=16.2 Umin=25.0 T= 0.5 + +34 02:52:34 02:52:57 +V=300.2 T= 9.6 + +35 02:53:01 02:54:00 +Q= 50.7 T= 9.6 + +36 02:54:04 02:54:35 +P1=0.29 T= 3.1 + +40 02:54:39 02:54:40 +t= 50.1 T= 1.1 + +40 02:54:42 02:54:44 +t= 0.0 T= 0.0 + +40 02:56:04 02:56:05 +t= 0.0 T= 0.0 + +40 02:56:08 02:56:09 +t= 0.0 T= 0.0 + +40 02:56:08 02:56:09 +t= 0.0 T= 0.0 + +40 02:56:14 02:56:15 +t= 0.0 T= 0.0 + +40 02:56:19 02:56:21 +t= 0.0 T= 0.0 + +40 02:56:27 02:56:29 +t= 0.0 T= 0.0 + +40 03:02:48 03:02:50 +t= 54.9 T= 1.1 + +40 03:03:01 03:03:02 +t= 53.7 T= 1.1 + +40 03:03:11 03:03:18 +t= 53.1 T= 1.0 + +21 18:49:06 18:49:09 +Rsk= 46.6 Rkk= 19.8 + +22 19:25:43 19:40:47 +P1= 43.9 T1=19:35:47 P2= 58.2 T2=19:40:47 Vs= 2.86 + +20 21:40:19 21:40:28 +Riz_sol= 2375.8 + +22 22:01:35 22:16:39 +P1= 48.2 T1=22:11:39 P2= 62.3 T2=22:16:39 Vs= 2.83 + +22 22:43:05 22:53:10 +P1= 18.8 T1=22:48:10 P2= 26.4 T2=22:53:10 Vs= 1.52 + +23 22:53:17 22:53:23 + + +24 22:53:34 22:54:10 + + +30 22:54:25 22:55:02 +Vst= 33.0 + +31 22:55:10 22:55:15 +Rom_sol= -1.0 + +31 22:55:41 22:56:18 +Rom_sol= 13.9 + +21 22:57:28 22:57:31 +Rsk= 19.5 Rkk= 19.7 + +41 22:58:29 22:58:34 +Ukz= 0.83 + +32 22:58:38 22:59:13 +Imax=11.4 Umax=50.1 T= 9.0 + +33 22:59:16 22:59:40 +Imin=16.2 Umin=25.0 T= 0.5 + +34 22:59:43 23:00:10 +V=300.5 T= 9.6 + +35 23:00:13 23:01:29 +Q= 52.0 T=12.6 + +36 23:01:32 23:02:03 +P1=0.30 T= 3.1 + +37 23:02:06 23:02:32 +T= 1.1 + +38 23:02:35 23:02:40 +t= 53.2 T= 0.9 + +39 23:02:43 23:02:57 +tcam= 55.4 Tcam= 0.9 tfl= 55.8 Tfl= 0.9 + +40 23:03:00 23:03:06 +t= 53.5 T= 0.9 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.163 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.163 new file mode 100644 index 0000000..e7c6374 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.163 @@ -0,0 +1,17 @@ +7 00:06:32 1594235192 +8 00:21:40 1594236100 +25 02:06:09 1594242369 +25 02:47:07 1594244827 +9 03:04:41 1594245881 +10 03:33:52 1594247632 +12 07:43:32 1594262612 +13 10:52:24 1594273944 +0 10:52:24 1594273944 +2 18:43:36 1594302216 +5 19:42:36 1594305756 +6 19:54:35 1594306475 +7 20:35:25 1594308925 +8 21:32:19 1594312339 +25 22:57:45 1594317465 +9 23:03:43 1594317823 +10 23:34:26 1594319666 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.164 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.164 new file mode 100644 index 0000000..0a7f589 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.164 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.165 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.165 new file mode 100644 index 0000000..18f6c31 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.165 @@ -0,0 +1,97 @@ +55 02:11:43 1594242703 +55 02:11:48 1594242708 +66 02:11:55 1594242715 +66 02:12:07 1594242727 +66 02:12:12 1594242732 +55 02:12:19 1594242739 +55 02:12:20 1594242740 +55 02:12:24 1594242744 +55 02:12:25 1594242745 +55 02:14:41 1594242881 +55 02:14:46 1594242886 +66 02:15:33 1594242933 +66 02:19:38 1594243178 +55 02:20:17 1594243217 +55 02:20:18 1594243218 +55 02:20:22 1594243222 +55 02:20:26 1594243226 +55 02:20:34 1594243234 +55 02:20:41 1594243241 +55 02:20:47 1594243247 +55 02:20:53 1594243253 +47 02:21:02 1594243262 +47 02:21:04 1594243264 +55 02:21:08 1594243268 +55 02:21:15 1594243275 +55 02:21:20 1594243280 +55 02:21:26 1594243286 +55 02:21:33 1594243293 +55 02:21:38 1594243298 +55 02:21:46 1594243306 +55 02:21:50 1594243310 +47 02:21:54 1594243314 +47 02:21:55 1594243315 +55 02:22:01 1594243321 +55 02:22:06 1594243326 +55 02:22:12 1594243332 +55 02:30:31 1594243831 +55 02:30:54 1594243854 +55 02:31:01 1594243861 +55 02:31:09 1594243869 +55 02:31:16 1594243876 +55 02:31:21 1594243881 +55 02:31:28 1594243888 +55 02:31:36 1594243896 +55 02:31:48 1594243908 +55 02:31:54 1594243914 +66 02:32:00 1594243920 +66 02:32:01 1594243921 +66 02:32:03 1594243923 +66 02:32:24 1594243944 +66 02:32:28 1594243948 +66 02:32:31 1594243951 +55 02:32:39 1594243959 +55 02:32:47 1594243967 +55 02:32:48 1594243968 +55 02:33:09 1594243989 +55 02:33:16 1594243996 +55 02:33:53 1594244033 +55 02:33:59 1594244039 +66 02:34:07 1594244047 +55 02:34:38 1594244078 +55 02:34:45 1594244085 +55 02:48:59 1594244939 +66 02:49:06 1594244946 +66 02:49:16 1594244956 +66 02:49:20 1594244960 +66 02:49:32 1594244972 +66 02:49:49 1594244989 +55 02:49:54 1594244994 +66 02:50:03 1594245003 +66 02:50:03 1594245003 +66 02:50:09 1594245009 +66 02:50:10 1594245010 +55 02:50:13 1594245013 +55 02:50:28 1594245028 +55 02:50:30 1594245030 +55 02:51:06 1594245066 +55 02:51:12 1594245072 +66 02:51:16 1594245076 +66 02:51:18 1594245078 +66 02:51:20 1594245080 +66 02:51:25 1594245085 +55 02:54:39 1594245279 +66 02:54:43 1594245283 +47 02:55:32 1594245332 +47 02:55:39 1594245339 +66 02:56:04 1594245364 +66 02:56:08 1594245368 +66 02:56:09 1594245369 +66 02:56:14 1594245374 +66 02:56:19 1594245379 +66 02:56:28 1594245388 +46 03:02:23 1594245743 +46 03:02:32 1594245752 +55 03:02:50 1594245770 +55 03:03:02 1594245782 +92 22:55:16 1594317316 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.166 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.166 new file mode 100644 index 0000000..8241fbb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.166 @@ -0,0 +1,99 @@ +[54] +oper = 7 +begin = 09.07.2020 00:06:32 +norma = 30 +real = 15 + +[55] +oper = 8 +begin = 09.07.2020 00:21:40 +norma = 40 +vac_time = 8 +real = 104 + +[56] +oper = 25 +begin = 09.07.2020 02:06:09 +norma = 30 +real = 40 + +[57] +oper = 25 +begin = 09.07.2020 02:47:07 +norma = 30 +real = 17 + +[58] +oper = 9 +begin = 09.07.2020 03:04:41 +norma = 0 +real = 29 + +[59] +oper = 10 +begin = 09.07.2020 03:33:52 +norma = 0 +real = 249 + +[60] +oper = 12 +begin = 09.07.2020 07:43:32 +norma = 105 +real = 188 + +[61] +oper = 13 +begin = 09.07.2020 10:52:24 +norma = 45 +real = 471 + +[62] +oper = 2 +begin = 09.07.2020 18:43:36 +norma = 110 +vac_time = 11 +real = 59 + +[63] +oper = 5 +begin = 09.07.2020 19:42:36 +norma = 25 +real = 11 + +[64] +oper = 6 +begin = 09.07.2020 19:54:35 +norma = 35 +real = 40 + +[65] +oper = 7 +begin = 09.07.2020 20:35:25 +norma = 30 +real = 56 + +[66] +oper = 8 +begin = 09.07.2020 21:32:19 +norma = 40 +vac_time = 10 +real = 85 + +[67] +oper = 25 +begin = 09.07.2020 22:57:45 +norma = 30 +real = 5 + +[68] +oper = 9 +begin = 09.07.2020 23:03:43 +norma = 0 +real = 30 + +[69] +oper = 10 +begin = 09.07.2020 23:34:26 +norma = 0 +real = 258 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.167 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.167 new file mode 100644 index 0000000..46fc70b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.167 @@ -0,0 +1,44 @@ +02:05:20 1594242320 祭 ॣ '-2'(A) +02:05:56 1594242356 ⪫祭 ॣ '-2'(A) +02:46:17 1594244777 祭 ॣ '-2'(A) +02:46:52 1594244812 ⪫祭 ॣ '-2'(A) +03:03:32 1594245812 祭 ० ࠧ +03:03:53 1594245833 ⪫祭 ० ࠧ +03:04:10 1594245850 祭 ० ࠧ +03:04:15 1594245855 祭 ० ' ⮪ 㣨' +03:05:54 1594245954 祭 ॣ '-2'(A) +03:33:51 1594247631 祭 ⠭ ॣ +03:33:52 1594247632 ⪫祭 ० ࠧ (A) +07:33:30 1594262010 祭 ० +07:33:31 1594262011 ⪫祭 ॣ '-2'(A) +07:33:32 1594262012 祭 ॣ '-2'(A) +07:39:26 1594262366 ⪫祭 ० ' ⮪ 㣨' +07:43:35 1594262615 ⪫祭 ॣ '-2'(A) +07:43:47 1594262627 祭 ० ᪠ +07:43:48 1594262628 祭 ० ᪠ +07:43:48 1594262628 祭 ० ᪠ +07:43:48 1594262628 祭 ० ᪠ +07:43:48 1594262628 祭 ० ᪠ +07:46:12 1594262772 ⪫祭 ० ᪠ (A) +08:43:30 1594266210 ⪫祭 ० (A) +11:08:30 1594274910 祭 ॣ '-2'(A) +11:49:23 1594277363 ⪫祭 ॣ '-2'(A) +18:48:49 1594302529 : 㦥 +19:55:07 1594306507 祭 ० ᪠ +19:55:07 1594306507 祭 ० ᪠ +19:55:07 1594306507 祭 ० ᪠ +19:55:08 1594306508 祭 ० ᪠ +19:55:08 1594306508 祭 ० ᪠ +19:58:18 1594306698 ⪫祭 ० ᪠ (A) +22:53:35 1594317215 祭 ॣ '-2'(A) +22:54:11 1594317251 ⪫祭 ॣ '-2'(A) +22:55:19 1594317319 ' ' +22:55:19 1594317319 祭 +22:55:19 1594317319 祭 +22:56:19 1594317379 ⪫祭 +23:03:17 1594317797 祭 ० ࠧ +23:03:19 1594317799 祭 ० ' ⮪ 㣨' +23:03:44 1594317824 : 믮 +23:19:57 1594318797 祭 ॣ '-2'(A) +23:34:26 1594319666 ⪫祭 ० ࠧ (A) +23:34:26 1594319666 祭 ॣ . 殮 㣨 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.169 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.169 new file mode 100644 index 0000000..2a58557 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.169 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.170 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.170 new file mode 100644 index 0000000..75612f5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.170 @@ -0,0 +1,4 @@ +01:58:26 1594241906 1 09247 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 37 7 1000 9 6280 10 870 +07:05:03 1594260303 1 09247 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 37 4 3 5 Ti 6 7 1000 8 4460 9 6280 10 870 11 12 321173 +07:45:11 1594262711 0 A--32-009-2013 ॢ 4 +18:38:37 1594301917 3 14 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.171 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.171 new file mode 100644 index 0000000..1b7c2e4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.171 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.172 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.172 new file mode 100644 index 0000000..0ef2de6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.172 @@ -0,0 +1,66 @@ +21 01:57:17 01:57:24 +Rsk= 13.5 Rkk= 7.9 + +21 03:47:39 03:47:46 +Rsk= 7.8 Rkk= 7.9 + +22 04:14:45 04:30:15 +P1= 51.0 T1=04:25:15 P2= 64.2 T2=04:30:15 Vs= 2.63 + +21 06:03:24 06:03:32 +Rsk= 13.7 Rkk= 8.1 + +20 06:09:52 06:10:01 +Riz_sol=11873.9 + +22 06:44:14 06:54:45 +P1= 43.5 T1=06:49:45 P2= 58.6 T2=06:54:45 Vs= 3.02 + +23 06:55:12 06:55:18 + + +24 06:55:35 06:56:09 + + +30 06:56:28 06:57:11 +Vst= 29.0 + +31 06:57:15 06:57:52 +Rom_sol= 13.2 + +41 06:58:19 06:58:24 +Ukz= 0.79 + +32 06:58:32 06:59:43 +Imax=27.3 Umax=54.9 T= 9.4 + +33 06:59:46 07:00:23 +Imin=16.0 Umin=25.2 T= 1.0 + +34 07:00:28 07:00:54 +V=301.2 T= 9.5 + +35 07:00:57 07:01:57 +Q= 55.0 T= 9.2 + +36 07:02:02 07:02:38 +P1=0.28 T= 3.1 + +37 07:02:43 07:03:17 +T= 0.8 + +38 07:03:22 07:03:28 +t= 51.5 T= 0.5 + +39 07:03:31 07:03:37 +t= 51.4 T= 0.5 + +40 07:03:40 07:03:46 +t= 51.5 T= 0.7 + +21 18:38:18 18:38:25 +Rsk= 13.2 Rkk= 7.6 + +22 18:54:23 19:09:54 +P1= 55.6 T1=19:04:54 P2= 71.5 T2=19:09:54 Vs= 3.17 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.173 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.173 new file mode 100644 index 0000000..9fe82b9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.173 @@ -0,0 +1,18 @@ +2 01:52:20 1594241540 +7 03:28:15 1594247295 +2 03:47:04 1594248424 +5 04:30:51 1594251051 +6 04:45:08 1594251908 +7 05:24:12 1594254252 +8 06:00:36 1594256436 +25 06:56:23 1594259783 +9 07:05:03 1594260303 +10 07:45:11 1594262711 +11 10:36:15 1594272975 +12 14:48:32 1594288112 +13 17:17:05 1594297025 +0 17:17:05 1594297025 +14 18:33:14 1594301594 +15 19:10:29 1594303829 +16 19:52:37 1594306357 +1 20:47:30 1594309650 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.174 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.174 new file mode 100644 index 0000000..8a35b5d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.174 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.175 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.175 new file mode 100644 index 0000000..3ffd172 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.175 @@ -0,0 +1 @@ +17 18:38:10 1594301890 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.176 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.176 new file mode 100644 index 0000000..19d9c6a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.176 @@ -0,0 +1,106 @@ +[00] +oper = 2 +begin = 09.07.2020 01:52:20 +norma = 110 +vac_time = 8 +real = 95 + +[01] +oper = 7 +begin = 09.07.2020 03:28:15 +norma = 30 +real = 18 + +[02] +oper = 2 +begin = 09.07.2020 03:47:04 +norma = 110 +vac_time = 8 +real = 43 + +[03] +oper = 5 +begin = 09.07.2020 04:30:51 +norma = 25 +real = 14 + +[04] +oper = 6 +begin = 09.07.2020 04:45:08 +norma = 35 +real = 39 + +[05] +oper = 7 +begin = 09.07.2020 05:24:12 +norma = 30 +real = 36 + +[06] +oper = 8 +begin = 09.07.2020 06:00:36 +norma = 40 +vac_time = 10 +real = 55 + +[07] +oper = 25 +begin = 09.07.2020 06:56:23 +norma = 30 +real = 8 + +[08] +oper = 9 +begin = 09.07.2020 07:05:03 +norma = 0 +real = 40 + +[09] +oper = 10 +begin = 09.07.2020 07:45:11 +norma = 0 +real = 171 + +[10] +oper = 11 +begin = 09.07.2020 10:36:15 +norma = 0 +real = 252 + +[11] +oper = 12 +begin = 09.07.2020 14:48:32 +norma = 105 +real = 148 + +[12] +oper = 13 +begin = 09.07.2020 17:17:05 +norma = 45 +real = 76 + +[13] +oper = 14 +begin = 09.07.2020 18:33:14 +norma = 40 +vac_time = 7 +real = 37 + +[14] +oper = 15 +begin = 09.07.2020 19:10:29 +norma = 30 +real = 42 + +[15] +oper = 16 +begin = 09.07.2020 19:52:37 +norma = 40 +real = 54 + +[16] +oper = 1 +begin = 09.07.2020 20:47:30 +norma = 85 +real = 326 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.177 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.177 new file mode 100644 index 0000000..d20d279 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.177 @@ -0,0 +1,29 @@ +04:45:16 1594251916 祭 ० ᪠ +04:45:16 1594251916 祭 ० ᪠ +04:45:17 1594251917 祭 ० ᪠ +04:48:20 1594252100 ⪫祭 ० ᪠ (A) +06:55:37 1594259737 祭 ॣ '-2'(A) +06:56:10 1594259770 ⪫祭 ॣ '-2'(A) +07:03:55 1594260235 祭 ० ࠧ +07:03:58 1594260238 祭 ० ' ⮪ 㣨' +07:26:25 1594261585 祭 ॣ '-2'(A) +07:45:11 1594262711 ⪫祭 ० ࠧ (A) +07:45:11 1594262711 祭 ⠭ ॣ +10:36:14 1594272974 祭 ० +10:36:14 1594272974 ⪫祭 ॣ '-2'(A) +10:36:15 1594272975 祭 ॣ '-2'(A) +14:48:27 1594288107 ⪫祭 ० (A) +14:48:33 1594288113 ⪫祭 ० ' ⮪ 㣨' +14:48:36 1594288116 ⪫祭 ॣ '-2'(A) +14:49:06 1594288146 祭 ० ᪠ +14:49:06 1594288146 祭 ० ᪠ +14:49:06 1594288146 祭 ० ᪠ +14:49:06 1594288146 祭 ० ᪠ +14:49:07 1594288147 祭 ० ᪠ +14:52:12 1594288332 ⪫祭 ० ᪠ (A) +19:10:26 1594303826 祭 ० ࠧ +19:10:28 1594303828 祭 ० ' ⮪ 㣨' +19:24:31 1594304671 ⪫祭 ० ' ⮪ 㣨' +19:51:20 1594306280 ⪫祭 ० ࠧ (A) +19:52:48 1594306368 祭 ० ᪠ +19:56:00 1594306560 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.179 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.179 new file mode 100644 index 0000000..b03c5ae Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.179 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.210 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.210 new file mode 100644 index 0000000..23bdc98 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.210 @@ -0,0 +1,2 @@ +17:58:25 1594299505 1 07197 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 7 615 8 5040 9 3860 10 495 +22:33:29 1594316009 1 07197 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 615 8 5040 9 3860 10 495 11 12 320279 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.211 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.211 new file mode 100644 index 0000000..c266699 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.211 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.212 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.212 new file mode 100644 index 0000000..85c2e38 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.212 @@ -0,0 +1,66 @@ +21 17:55:56 17:55:59 +Rsk= 11.5 Rkk= 5.6 + +22 18:59:52 19:14:57 +P1= 51.8 T1=19:09:57 P2= 67.1 T2=19:14:57 Vs= 3.05 + +20 21:12:27 21:12:35 +Riz_sol= 4970.6 + +21 21:12:45 21:12:48 +Rsk= 12.9 Rkk= 7.0 + +22 21:39:50 21:54:55 +P1= 57.3 T1=21:49:55 P2= 73.8 T2=21:54:55 Vs= 3.29 + +22 22:09:53 22:19:57 +P1= 27.8 T1=22:14:57 P2= 39.9 T2=22:19:57 Vs= 2.41 + +23 22:20:54 22:20:59 + + +24 22:21:20 22:22:00 + + +30 22:22:30 22:22:57 +Vst= 30.6 + +31 22:23:04 22:23:38 +Rom_sol= 13.8 + +41 22:24:39 22:24:44 +Ukz= 3.10 + +41 22:26:01 22:26:06 +Ukz= 2.05 + +32 22:26:16 22:26:53 +Imax=10.9 Umax=50.1 T= 9.0 + +33 22:26:58 22:27:20 +Imin=15.9 Umin=25.0 T= 0.5 + +34 22:27:25 22:27:48 +V=300.1 T= 9.6 + +35 22:27:52 22:28:52 +Q= 53.3 T= 9.5 + +36 22:28:57 22:29:33 +P1=0.30 T= 3.1 + +37 22:29:37 22:30:08 +T= 1.1 + +38 22:30:14 22:30:22 +t= 51.8 T= 0.7 + +39 22:30:27 22:30:44 +tcam= 52.5 Tcam= 0.7 tfl= 66.0 Tfl= 0.7 + +40 22:30:48 22:30:55 +t= 52.0 T= 0.7 + +40 22:32:39 22:32:46 +t= 53.5 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.213 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.213 new file mode 100644 index 0000000..2341c3c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.213 @@ -0,0 +1,11 @@ +12 00:51:18 1594237878 +13 05:41:31 1594255291 +0 05:41:31 1594255291 +2 17:55:07 1594299307 +5 19:47:36 1594306056 +6 19:58:02 1594306682 +7 20:38:24 1594309104 +8 21:07:27 1594310847 +25 22:22:16 1594315336 +9 22:33:29 1594316009 +10 22:58:17 1594317497 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.214 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.214 new file mode 100644 index 0000000..34e5e36 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.214 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.215 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.215 new file mode 100644 index 0000000..33db629 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.215 @@ -0,0 +1,6 @@ +3 17:55:33 1594299333 +3 17:55:39 1594299339 +47 22:30:55 1594315855 +47 22:31:03 1594315863 +47 22:31:12 1594315872 +47 22:32:10 1594315930 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.216 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.216 new file mode 100644 index 0000000..d50334d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.216 @@ -0,0 +1,62 @@ +[08] +oper = 12 +begin = 09.07.2020 00:51:18 +norma = 180 +real = 290 + +[09] +oper = 13 +begin = 09.07.2020 05:41:31 +norma = 45 +real = 733 + +[10] +oper = 2 +begin = 09.07.2020 17:55:07 +norma = 110 +vac_time = 8 +real = 112 + +[11] +oper = 5 +begin = 09.07.2020 19:47:36 +norma = 25 +real = 10 + +[12] +oper = 6 +begin = 09.07.2020 19:58:02 +norma = 35 +real = 40 + +[13] +oper = 7 +begin = 09.07.2020 20:38:24 +norma = 30 +real = 29 + +[14] +oper = 8 +begin = 09.07.2020 21:07:27 +norma = 40 +vac_time = 8 +real = 74 + +[15] +oper = 25 +begin = 09.07.2020 22:22:16 +norma = 30 +real = 11 + +[16] +oper = 9 +begin = 09.07.2020 22:33:29 +norma = 0 +real = 24 + +[17] +oper = 10 +begin = 09.07.2020 22:58:17 +norma = 0 +real = 185 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.217 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.217 new file mode 100644 index 0000000..dbe97a9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.217 @@ -0,0 +1,9 @@ +00:51:24 1594237884 ⪫祭 ॣ '-2'(A) +00:56:05 1594238165 祭 ० ᪠ +00:59:18 1594238358 ⪫祭 ० ᪠ (A) +19:58:24 1594306704 祭 ० ᪠ +20:01:36 1594306896 ⪫祭 ० ᪠ (A) +22:21:25 1594315285 祭 ॣ '-2'(A) +22:22:01 1594315321 ⪫祭 ॣ '-2'(A) +22:49:28 1594316968 祭 ॣ '-2' +22:58:17 1594317497 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.219 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.219 new file mode 100644 index 0000000..2e3e10a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.219 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.230 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.230 new file mode 100644 index 0000000..0368e3a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.230 @@ -0,0 +1,5 @@ +10:26:39 1594272399 3 14 +11:43:05 1594276985 0 A--32-120-2016 ॢ 0 +15:11:06 1594289466 1 06890 3 37 9 5550 +20:50:59 1594309859 1 06890 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 37 4 3 5 Ti 6 7 920 8 4800 9 5550 10 840 11 12 320252 +21:33:18 1594312398 0 A--32-080-2017 ॢ 3 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.231 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.231 new file mode 100644 index 0000000..9e99ae0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.231 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.232 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.232 new file mode 100644 index 0000000..07b3e30 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.232 @@ -0,0 +1,66 @@ +21 10:26:51 10:26:54 +Rsk= 17.8 Rkk= 15.3 + +22 10:50:52 11:06:23 +P1= 50.7 T1=11:01:23 P2= 66.5 T2=11:06:23 Vs= 3.16 + +21 14:52:10 14:52:13 +Rsk= 17.8 Rkk= 15.4 + +22 15:25:41 15:41:11 +P1= 46.6 T1=15:36:11 P2= 63.6 T2=15:41:11 Vs= 3.41 + +22 16:19:44 16:30:14 +P1= 14.3 T1=16:25:14 P2= 28.7 T2=16:30:14 Vs= 2.87 + +20 19:25:41 19:25:50 +Riz_sol= 4168.5 + +21 19:25:55 19:25:58 +Rsk= 17.8 Rkk= 15.4 + +22 20:29:44 20:40:15 +P1= 15.9 T1=20:35:15 P2= 31.1 T2=20:40:15 Vs= 3.05 + +23 20:40:52 20:40:57 + + +24 20:41:02 20:41:39 + + +30 20:41:50 20:42:21 +Vst= 28.8 + +31 20:42:25 20:43:26 +Rom_sol= 11.9 + +41 20:45:27 20:45:32 +Ukz= 0.99 + +32 20:45:35 20:46:10 +Imax=26.9 Umax=55.0 T= 9.0 + +33 20:46:13 20:46:32 +Imin=15.9 Umin=25.0 T= 0.5 + +34 20:46:34 20:46:57 +V=300.1 T= 9.4 + +35 20:47:00 20:48:10 +Q= 53.0 T=12.4 + +36 20:48:13 20:48:46 +P1=0.30 T= 2.9 + +37 20:48:49 20:49:20 +T= 0.9 + +38 20:49:22 20:49:29 +t= 52.5 T= 0.5 + +39 20:49:33 20:49:39 +t= 53.8 T= 0.5 + +40 20:49:42 20:49:49 +t= 51.8 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.233 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.233 new file mode 100644 index 0000000..85fb4aa --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.233 @@ -0,0 +1,16 @@ +11 02:55:41 1594245341 +12 07:08:13 1594260493 +13 09:15:50 1594268150 +0 09:15:50 1594268150 +14 10:24:49 1594272289 +15 11:07:43 1594274863 +16 11:52:16 1594277536 +1 12:35:20 1594280120 +2 14:48:36 1594288116 +5 16:32:47 1594294367 +6 16:44:05 1594295045 +7 17:25:45 1594297545 +8 19:23:55 1594304635 +25 20:41:48 1594309308 +9 20:50:59 1594309859 +10 21:33:18 1594312398 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.234 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.234 new file mode 100644 index 0000000..082e394 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.234 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.236 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.236 new file mode 100644 index 0000000..1d78fc9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.236 @@ -0,0 +1,93 @@ +[63] +oper = 11 +begin = 09.07.2020 02:55:41 +norma = 0 +real = 252 + +[64] +oper = 12 +begin = 09.07.2020 07:08:13 +norma = 105 +real = 127 + +[65] +oper = 13 +begin = 09.07.2020 09:15:50 +norma = 45 +real = 68 + +[66] +oper = 14 +begin = 09.07.2020 10:24:49 +norma = 40 +vac_time = 7 +real = 42 + +[67] +oper = 15 +begin = 09.07.2020 11:07:43 +norma = 30 +real = 44 + +[68] +oper = 16 +begin = 09.07.2020 11:52:16 +norma = 40 +real = 43 + +[69] +oper = 1 +begin = 09.07.2020 12:35:20 +norma = 85 +real = 133 + +[70] +oper = 2 +begin = 09.07.2020 14:48:36 +norma = 110 +vac_time = 8 +real = 104 + +[71] +oper = 5 +begin = 09.07.2020 16:32:47 +norma = 25 +real = 11 + +[72] +oper = 6 +begin = 09.07.2020 16:44:05 +norma = 35 +real = 41 + +[73] +oper = 7 +begin = 09.07.2020 17:25:45 +norma = 30 +real = 118 + +[74] +oper = 8 +begin = 09.07.2020 19:23:55 +norma = 40 +vac_time = 8 +real = 77 + +[75] +oper = 25 +begin = 09.07.2020 20:41:48 +norma = 30 +real = 9 + +[76] +oper = 9 +begin = 09.07.2020 20:50:59 +norma = 0 +real = 42 + +[77] +oper = 10 +begin = 09.07.2020 21:33:18 +norma = 0 +real = 200 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.237 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.237 new file mode 100644 index 0000000..5d01128 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.237 @@ -0,0 +1,35 @@ +02:55:41 1594245341 祭 ० +02:55:41 1594245341 ⪫祭 ॣ '-2'(A) +02:55:42 1594245342 祭 ॣ '-2'(A) +04:07:42 1594249662 ⪫祭 ॣ '-2'(A) +07:08:08 1594260488 ⪫祭 ० (A) +07:08:10 1594260490 ⪫祭 +07:08:10 1594260490 : +07:08:11 1594260491 ⪫祭 ० ' ⮪ 㣨' +07:09:13 1594260553 祭 ० ᪠ +07:09:13 1594260553 祭 ० ᪠ +07:12:10 1594260730 ⪫祭 ० ᪠ (A) +07:38:12 1594262292 : 믮 +11:06:56 1594274816 祭 ० ࠧ +11:06:58 1594274818 祭 ० ' ⮪ 㣨' +11:09:01 1594274941 祭 ॣ '-2'(A) +11:43:05 1594276985 ⪫祭 ० ࠧ (A) +11:46:59 1594277219 ⪫祭 ० ' ⮪ 㣨' +11:47:47 1594277267 祭 ० ᪠ +11:47:47 1594277267 祭 ० ᪠ +11:50:49 1594277449 ⪫祭 ० ᪠ (A) +11:52:20 1594277540 ⪫祭 ॣ '-2'(A) +15:11:15 1594289475 : 㦥 +16:44:14 1594295054 祭 ० ᪠ +16:47:09 1594295229 ⪫祭 ० ᪠ (A) +20:41:04 1594309264 祭 ॣ '-2'(A) +20:41:41 1594309301 ⪫祭 ॣ '-2'(A) +20:41:53 1594309313 祭 +20:42:27 1594309347 祭 +20:43:27 1594309407 ⪫祭 +20:50:24 1594309824 祭 ० ࠧ +20:50:26 1594309826 祭 ० ' ⮪ 㣨' +20:51:00 1594309860 : 믮 +21:12:17 1594311137 祭 ॣ '-2'(A) +21:33:18 1594312398 ⪫祭 ० ࠧ (A) +21:33:19 1594312399 祭 ॣ . 殮 㣨 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.239 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.239 new file mode 100644 index 0000000..6d5a844 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.239 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.241 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.241 new file mode 100644 index 0000000..3b7bc22 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.241 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.242 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.242 new file mode 100644 index 0000000..f6797e3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.242 @@ -0,0 +1,24 @@ +22 20:43:45 20:48:46 +P1=0.0690 P2=0.1649 T1=20:43:45 T2=20:48:46 Vs=0.0176 + +22 21:37:25 21:42:26 +P1=0.0539 P2=0.0837 T1=21:37:25 T2=21:42:26 Vs=0.0060 + +22 21:42:28 21:44:45 +P1=0.0837 P2=0.1011 T1=21:42:28 T2=21:44:45 Vs=0.0076 + +21 23:23:47 23:23:51 +146.8 162.1 + +21 23:23:52 23:23:53 +146.8 146.8 + +22 23:23:52 23:28:43 +P1=0.0447 P2=0.0683 T1=23:23:52 T2=23:28:43 Vs=0.0047 + +22 23:28:46 23:33:46 +P1=0.0685 P2=0.0985 T1=23:28:46 T2=23:33:46 Vs=0.0060 + +22 23:36:46 23:41:46 +P1=0.1175 P2=0.1500 T1=23:36:46 T2=23:41:46 Vs=0.0065 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.243 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.243 new file mode 100644 index 0000000..0016832 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.243 @@ -0,0 +1 @@ +14 20:18:51 1594307931 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.244 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.244 new file mode 100644 index 0000000..08c1ee1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.244 @@ -0,0 +1,36 @@ +10:43:39 NEW 0239: . 楢 - +13:15:26 RTN 0239: . 楢 - +14:19:08 ACK 0239: . 楢 - +14:58:22 RTN 0010: . - 誠 +E01 +14:58:27 NEW 0010: . - 誠 +E01 +14:59:20 RTN 0010: . - 誠 +E01 +15:01:09 ACK 0010: . - 誠 +E01 +15:01:09 RTN 0030: 訡 ஫ +20:18:50 NEW 0459: PIR001᮪ +20:18:50 NEW 0460: PIR002 ᮪ +20:19:08 ACK 0459: PIR001᮪ +20:19:08 ACK 0460: PIR002 ᮪ +20:48:46 NEW 0190: 訡 ⥪ +23:06:57 ACK 0190: 訡 ⥪ +23:06:57 RTN 0190: 訡 ⥪ +23:06:57 RTN 0459: PIR001᮪ +23:06:57 RTN 0460: PIR002 ᮪ +23:06:58 NEW 0190: 訡 ⥪ +23:24:49 ACK 0190: 訡 ⥪ +23:24:49 RTN 0190: 訡 ⥪ +23:24:51 NEW 0190: 訡 ⥪ +23:26:22 ACK 0190: 訡 ⥪ +23:26:23 RTN 0190: 訡 ⥪ +23:26:25 NEW 0190: 訡 ⥪ +23:27:51 ACK 0190: 訡 ⥪ +23:27:51 RTN 0190: 訡 ⥪ +23:27:54 NEW 0190: 訡 ⥪ +23:28:40 ACK 0190: 訡 ⥪ +23:28:40 RTN 0190: 訡 ⥪ +23:28:42 NEW 0190: 訡 ⥪ +23:29:03 ACK 0190: 訡 ⥪ +23:29:04 RTN 0190: 訡 ⥪ +23:33:47 NEW 0190: 訡 ⥪ +23:36:56 ACK 0190: 訡 ⥪ +23:36:56 RTN 0190: 訡 ⥪ +23:36:58 NEW 0190: 訡 ⥪ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.247 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.247 new file mode 100644 index 0000000..11aaa82 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.247 @@ -0,0 +1,151 @@ +13:50:01 1594284601 >< (OIP1) +13:50:01 1594284601 >嫠 < (OIP1) +13:50:24 1594284624 >嫠 < (OIP1) +13:50:24 1594284624 >७ ⥪騩< (OIP1) +13:50:25 1594284625 >: 롮 稭< (OIP1) +13:50:25 1594284625 >嫠 < (OIP1) +13:50:28 1594284628 >嫠 < (OIP1) +13:50:28 1594284628 >嫠 .< (OIP1) +13:51:28 1594284688 >嫠 .< (OIP1) +13:51:28 1594284688 >嫠 < (OIP1) +13:51:35 1594284695 >嫠 < (OIP1) +13:51:35 1594284695 >७ ⥪騩< (OIP1) +13:51:48 1594284708 >: 롮 稭< (OIP1) +13:51:48 1594284708 >७ < (OIP1) +13:52:38 1594284758 >७ < (OIP1) +13:52:38 1594284758 >७ < (OIP1) +13:52:38 1594284758 >७ < (OIP1) +13:52:38 1594284758 >७ < (OIP1) +13:52:41 1594284761 >७ < (OIP1) +13:52:41 1594284761 >७ ⥪騩< (OIP1) +13:52:45 1594284765 >: 롮 稭< (OIP1) +13:52:45 1594284765 >७ < (OIP1) +14:18:33 1594286313 >७ < (OIP1) +14:18:33 1594286313 >./ᨣ.< (OIP1) +14:19:12 1594286352 >./ᨣ.< (OIP1) +14:19:12 1594286352 >嫠 < (OIP1) +14:19:13 1594286353 >嫠 < (OIP1) +14:19:13 1594286353 >< (OIP1) +14:35:47 1594287347 >< (OIP1) +14:35:47 1594287347 >VarActPrcParStart< (OIP1) +14:36:04 1594287364 >EdtParManag< (OIP1) +14:38:13 1594287493 >VarActPrcParStart< (OIP1) +14:38:13 1594287493 >EdtPar5Misc< (OIP1) +14:39:10 1594287550 >EdtPar5Misc< (OIP1) +14:39:10 1594287550 >EdtPar4Ctrl< (OIP1) +14:39:34 1594287574 >EdtPar4Ctrl< (OIP1) +14:39:34 1594287574 >EdtParManag< (OIP1) +14:43:18 1594287798 >VarActPrcParStart< (OIP1) +14:43:18 1594287798 >./ᨣ.< (OIP1) +14:43:31 1594287811 >./ᨣ.< (OIP1) +14:43:31 1594287811 >./ᨣ. .< (OIP1) +14:43:32 1594287812 >./ᨣ. .< (OIP1) +14:43:32 1594287812 >./ᨣ.< (OIP1) +20:18:43 1594307923 >./ᨣ.< (OIP1) +20:18:43 1594307923 >< (OIP1) +20:18:43 1594307923 >< (OIP1) +20:18:43 1594307923 >< (OIP1) +20:18:44 1594307924 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +20:18:44 1594307924 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +20:18:45 1594307925 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +20:18:46 1594307926 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +20:18:49 1594307929 >< (OIP1) +20:18:49 1594307929 > < (OIP1) +20:18:50 1594307930 > < (OIP1) +20:18:50 1594307930 > < (OIP1) +20:18:51 1594307931 > < (OIP1) +20:18:51 1594307931 >Mpar6Interlocks12< (OIP1) +20:18:52 1594307932 Machine C1_CMD_DIAG_INSU_STING_SK --test insulation stinger(CMD) ஢ (OIP1) +20:19:00 1594307940 >Mpar6Interlocks12< (OIP1) +20:19:00 1594307940 > < (OIP1) +21:37:21 1594312641 > < (OIP1) +21:37:21 1594312641 >< (OIP1) +21:37:24 1594312644 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +21:38:59 1594312739 >< (OIP1) +21:38:59 1594312739 >७ ⥪騩< (OIP1) +21:38:59 1594312739 >: 롮 稭< (OIP1) +21:38:59 1594312739 >७ < (OIP1) +21:39:12 1594312752 >७ < (OIP1) +21:39:12 1594312752 >< (OIP1) +21:39:20 1594312760 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +21:42:28 1594312948 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +21:44:42 1594313082 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +21:44:44 1594313084 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +23:23:24 1594319004 >< (OIP1) +23:23:24 1594319004 >< (OIP1) +23:23:26 1594319006 >< (OIP1) +23:23:26 1594319006 >< (OIP1) +23:23:32 1594319012 >< (OIP1) +23:23:32 1594319012 >< (OIP1) +23:23:33 1594319013 >< (OIP1) +23:23:33 1594319013 >७ ⥪騩< (OIP1) +23:23:34 1594319014 >: 롮 稭< (OIP1) +23:23:34 1594319014 >७ < (OIP1) +23:23:39 1594319019 >७ < (OIP1) +23:23:39 1594319019 >< (OIP1) +23:23:41 1594319021 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +23:23:42 1594319022 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +23:23:45 1594319025 >< (OIP1) +23:23:45 1594319025 > < (OIP1) +23:23:45 1594319025 > < (OIP1) +23:23:45 1594319025 >Mpar6Interlocks12< (OIP1) +23:23:46 1594319026 Machine C1_CMD_DIAG_INSU_STING_SK --test insulation stinger(CMD)࠭ (OIP1) +23:23:52 1594319032 Machine C1_CMD_DIAG_INSU_FNCE_SK --test insulation furnace(CMD)࠭ (OIP1) +23:23:53 1594319033 >Mpar6Interlocks12< (OIP1) +23:23:53 1594319033 > < (OIP1) +23:23:54 1594319034 > < (OIP1) +23:23:54 1594319034 >< (OIP1) +23:24:27 1594319067 >< (OIP1) +23:24:27 1594319067 >< (OIP1) +23:24:27 1594319067 >< (OIP1) +23:24:27 1594319067 >७ ⥪騩< (OIP1) +23:24:28 1594319068 >: 롮 稭< (OIP1) +23:24:28 1594319068 >७ < (OIP1) +23:24:36 1594319076 >७ < (OIP1) +23:24:36 1594319076 >嫠 < (OIP1) +23:24:37 1594319077 >嫠 < (OIP1) +23:24:37 1594319077 >< (OIP1) +23:24:40 1594319080 >< (OIP1) +23:24:40 1594319080 >< (OIP1) +23:24:59 1594319099 >< (OIP1) +23:24:59 1594319099 >< (OIP1) +23:24:59 1594319099 >< (OIP1) +23:24:59 1594319099 >७ ⥪騩< (OIP1) +23:25:01 1594319101 >: 롮 稭< (OIP1) +23:25:01 1594319101 >७ < (OIP1) +23:25:03 1594319103 >७ < (OIP1) +23:25:03 1594319103 >嫠 < (OIP1) +23:25:04 1594319104 >嫠 < (OIP1) +23:25:04 1594319104 >< (OIP1) +23:26:25 1594319185 >< (OIP1) +23:26:25 1594319185 >< (OIP1) +23:26:26 1594319186 >< (OIP1) +23:26:26 1594319186 >७ ⥪騩< (OIP1) +23:26:26 1594319186 >: 롮 稭< (OIP1) +23:26:26 1594319186 >७ < (OIP1) +23:26:28 1594319188 >७ < (OIP1) +23:26:28 1594319188 >嫠 < (OIP1) +23:26:29 1594319189 >嫠 < (OIP1) +23:26:29 1594319189 >< (OIP1) +23:28:34 1594319314 >< (OIP1) +23:28:34 1594319314 >< (OIP1) +23:28:34 1594319314 >< (OIP1) +23:28:34 1594319314 >७ ⥪騩< (OIP1) +23:28:36 1594319316 >: 롮 稭< (OIP1) +23:28:36 1594319316 >७ < (OIP1) +23:28:40 1594319320 >७ < (OIP1) +23:28:40 1594319320 >嫠 < (OIP1) +23:28:41 1594319321 >嫠 < (OIP1) +23:28:41 1594319321 >< (OIP1) +23:28:46 1594319326 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +23:29:20 1594319360 >< (OIP1) +23:29:20 1594319360 >< (OIP1) +23:29:20 1594319360 >< (OIP1) +23:29:20 1594319360 >७ ⥪騩< (OIP1) +23:29:21 1594319361 >: 롮 稭< (OIP1) +23:29:21 1594319361 >७ < (OIP1) +23:29:23 1594319363 >७ < (OIP1) +23:29:23 1594319363 >嫠 < (OIP1) +23:29:24 1594319364 >嫠 < (OIP1) +23:29:24 1594319364 >< (OIP1) +23:36:45 1594319805 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.270 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.270 new file mode 100644 index 0000000..4cf09f4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.270 @@ -0,0 +1,5 @@ +06:59:40 1594259980 3 14 +08:02:46 1594263766 6 +10:55:54 1594274154 1 12138 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 9 4740 11 +15:18:23 1594289903 1 12138 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 3 5 Ti 6 7 870 8 2020 9 4740 10 770 11 12 321801 +15:49:38 1594291778 0 A--32-078-2017 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.271 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.271 new file mode 100644 index 0000000..2a84bf8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.271 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.272 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.272 new file mode 100644 index 0000000..4a7078d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.272 @@ -0,0 +1,72 @@ +21 06:56:35 06:56:38 +Rsk= 13.9 Rkk= 10.1 + +22 07:12:25 07:27:44 +P1= 61.0 T1=07:22:44 P2= 79.3 T2=07:27:44 Vs= 3.66 + +21 10:45:09 10:45:12 +Rsk= 4.1 Rkk= 1.3 + +21 10:46:15 10:46:18 +Rsk= 12.8 Rkk= 10.2 + +22 11:25:16 11:40:35 +P1= 39.1 T1=11:35:35 P2= 53.4 T2=11:40:35 Vs= 2.85 + +21 14:07:39 14:07:42 +Rsk= 12.7 Rkk= 10.1 + +20 14:07:52 14:08:01 +Riz_sol= 5918.8 + +22 14:34:39 14:49:58 +P1= 45.2 T1=14:44:58 P2= 61.7 T2=14:49:58 Vs= 3.28 + +22 14:54:33 15:09:52 +P1= 38.9 T1=15:04:52 P2= 52.0 T2=15:09:52 Vs= 2.61 + +23 15:10:01 15:10:06 + + +24 15:10:13 15:10:50 + + +30 15:11:01 15:11:24 +Vst= 28.1 + +31 15:11:29 15:12:30 +Rom_sol= 13.3 + +41 15:13:11 15:13:16 +Ukz= 0.74 + +32 15:13:31 15:14:06 +Imax=11.4 Umax=50.0 T= 9.0 + +33 15:14:11 15:14:18 +Imin=15.0 Umin=24.0 T= 1.6 + +33 15:14:28 15:14:46 +Imin=16.6 Umin=25.0 T= 0.5 + +34 15:14:53 15:15:16 +V=300.2 T= 9.7 + +35 15:15:19 15:16:14 +Q= 53.8 T= 9.7 + +37 15:16:18 15:16:45 +T= 1.2 + +38 15:16:49 15:16:54 +t= 62.5 T= 0.8 + +39 15:16:59 15:17:14 +tcam= 53.8 Tcam= 0.8 tfl= 60.5 Tfl= 0.9 + +40 15:17:18 15:17:24 +t= 61.0 T= 0.8 + +36 15:17:28 15:17:58 +P1=0.28 T= 3.2 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.273 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.273 new file mode 100644 index 0000000..da300b6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.273 @@ -0,0 +1,18 @@ +11 01:51:51 1594241511 +12 04:31:57 1594251117 +13 06:33:30 1594258410 +0 06:33:30 1594258410 +14 06:54:28 1594259668 +15 07:28:34 1594261714 +16 07:59:14 1594263554 +1 08:43:19 1594266199 +2 10:41:50 1594273310 +5 11:51:51 1594277511 +6 12:04:26 1594278266 +7 12:38:17 1594280297 +8 14:03:16 1594285396 +25 15:10:57 1594289457 +9 15:18:23 1594289903 +10 15:49:38 1594291778 +11 20:26:39 1594308399 +12 23:57:41 1594321061 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.274 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.274 new file mode 100644 index 0000000..fc19d55 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.274 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.275 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.275 new file mode 100644 index 0000000..52c89b3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.275 @@ -0,0 +1 @@ +55 15:14:19 1594289659 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.276 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.276 new file mode 100644 index 0000000..48f9907 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.276 @@ -0,0 +1,105 @@ +[18] +oper = 11 +begin = 09.07.2020 01:51:51 +norma = 115 +real = 160 + +[19] +oper = 12 +begin = 09.07.2020 04:31:57 +norma = 105 +real = 121 + +[20] +oper = 13 +begin = 09.07.2020 06:33:30 +norma = 45 +real = 20 + +[21] +oper = 14 +begin = 09.07.2020 06:54:28 +norma = 40 +vac_time = 6 +real = 34 + +[22] +oper = 15 +begin = 09.07.2020 07:28:34 +norma = 30 +real = 30 + +[23] +oper = 16 +begin = 09.07.2020 07:59:14 +norma = 40 +real = 44 + +[24] +oper = 1 +begin = 09.07.2020 08:43:19 +norma = 85 +real = 118 + +[25] +oper = 2 +begin = 09.07.2020 10:41:50 +norma = 110 +vac_time = 7 +real = 70 + +[26] +oper = 5 +begin = 09.07.2020 11:51:51 +norma = 25 +real = 12 + +[27] +oper = 6 +begin = 09.07.2020 12:04:26 +norma = 35 +real = 33 + +[28] +oper = 7 +begin = 09.07.2020 12:38:17 +norma = 30 +real = 84 + +[29] +oper = 8 +begin = 09.07.2020 14:03:16 +norma = 40 +vac_time = 7 +real = 67 + +[30] +oper = 25 +begin = 09.07.2020 15:10:57 +norma = 30 +real = 7 + +[31] +oper = 9 +begin = 09.07.2020 15:18:23 +norma = 0 +real = 31 + +[32] +oper = 10 +begin = 09.07.2020 15:49:38 +norma = 0 +real = 277 + +[33] +oper = 11 +begin = 09.07.2020 20:26:39 +norma = 0 +real = 211 + +[34] +oper = 12 +begin = 09.07.2020 23:57:41 +norma = 105 +real = 129 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.277 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.277 new file mode 100644 index 0000000..be9f134 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.277 @@ -0,0 +1,46 @@ +01:51:50 1594241510 祭 ० +01:51:51 1594241511 ⪫祭 ॣ '-2'(A) +01:51:52 1594241512 祭 ॣ '-2'(A) +02:51:43 1594245103 祭 ० +02:51:45 1594245105 ⪫祭 ॣ '-2'(A) +04:31:51 1594251111 ⪫祭 ० (A) +04:31:58 1594251118 ⪫祭 ० ' ⮪ 㣨' +04:32:10 1594251130 祭 ० ᪠ +04:34:14 1594251254 ⪫祭 ० ᪠ (A) +07:28:08 1594261688 祭 ० ࠧ +07:28:10 1594261690 祭 ० ' ⮪ 㣨' +07:29:52 1594261792 祭 ॣ '-2'(A) +07:58:57 1594263537 ⪫祭 ० ' ⮪ 㣨' +07:59:17 1594263557 ⪫祭 ॣ '-2'(A) +07:59:43 1594263583 祭 ० ᪠ +08:02:34 1594263754 ⪫祭 ० ᪠ (A) +10:56:03 1594274163 : 㦥 +12:04:49 1594278289 祭 ० ᪠ +12:04:50 1594278290 祭 ० ᪠ +12:05:51 1594278351 ⪫祭 ० ᪠ +12:05:53 1594278353 祭 ० ᪠ +12:05:53 1594278353 祭 ० ᪠ +12:05:53 1594278353 祭 ० ᪠ +12:06:00 1594278360 ⪫祭 ० ᪠ +12:06:02 1594278362 祭 ० ᪠ +12:06:06 1594278366 ⪫祭 ० ᪠ +15:10:14 1594289414 祭 ॣ '-2'(A) +15:10:51 1594289451 ⪫祭 ॣ '-2'(A) +15:11:05 1594289465 祭 +15:11:30 1594289490 祭 +15:12:30 1594289550 ⪫祭 +15:18:07 1594289887 祭 ० ࠧ +15:18:09 1594289889 祭 ० ' ⮪ 㣨' +15:18:24 1594289904 : 믮 +15:35:08 1594290908 祭 ॣ '-2'(A) +15:49:38 1594291778 ⪫祭 ० ࠧ (A) +15:49:38 1594291778 祭 ॣ . 殮 㣨 +20:26:39 1594308399 祭 ० +20:26:39 1594308399 ⪫祭 ॣ '-2'(A) +20:26:41 1594308401 祭 ॣ '-2'(A) +21:22:40 1594311760 ⪫祭 ॣ '-2'(A) +23:57:40 1594321060 ⪫祭 ० (A) +23:57:41 1594321061 ⪫祭 +23:57:41 1594321061 : +23:57:43 1594321063 ⪫祭 ० ' ⮪ 㣨' +23:59:02 1594321142 祭 ० ᪠ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.279 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.279 new file mode 100644 index 0000000..500118b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.279 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.280 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.280 new file mode 100644 index 0000000..329a998 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.280 @@ -0,0 +1 @@ +21:11:55 1594311115 1 11695 8 5230 9 5238 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.281 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.281 new file mode 100644 index 0000000..e0fdda0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.281 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.282 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.282 new file mode 100644 index 0000000..e1272e0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.282 @@ -0,0 +1,12 @@ +21 21:05:04 21:05:07 +Rsk= 9.0 Rkk= 6.1 + +22 21:47:11 22:02:44 +P1= 70.2 T1=21:57:44 P2= 94.9 T2=22:02:44 Vs= 4.95 + +22 22:34:47 22:50:20 +P1= 54.8 T1=22:45:20 P2= 73.2 T2=22:50:20 Vs= 3.67 + +22 23:14:38 23:30:12 +P1= 46.1 T1=23:25:12 P2= 63.1 T2=23:30:12 Vs= 3.39 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.283 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.283 new file mode 100644 index 0000000..7227d24 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.283 @@ -0,0 +1,5 @@ +11 03:14:37 1594246477 +12 03:18:44 1594246724 +13 07:48:36 1594262916 +0 07:48:36 1594262916 +2 21:01:50 1594310510 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.284 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.284 new file mode 100644 index 0000000..45ee149 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.284 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.286 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.286 new file mode 100644 index 0000000..4637415 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.286 @@ -0,0 +1,25 @@ +[77] +oper = 11 +begin = 09.07.2020 03:14:37 +norma = 0 +real = 4 + +[78] +oper = 12 +begin = 09.07.2020 03:18:44 +norma = 105 +real = 269 + +[79] +oper = 13 +begin = 09.07.2020 07:48:36 +norma = 45 +real = 793 + +[80] +oper = 2 +begin = 09.07.2020 21:01:50 +norma = 110 +vac_time = 9 +real = 193 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.287 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.287 new file mode 100644 index 0000000..4328354 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.287 @@ -0,0 +1,7 @@ +00:41:15 1594237275 ⪫祭 ॣ '-2'(A) +00:41:24 1594237284 祭 ० ' ⮪ 㣨' +00:41:25 1594237285 ⪫祭 ० ' ⮪ 㣨' +00:42:35 1594237355 祭 ॣ '-2' +03:19:00 1594246740 祭 ० ᪠ +03:21:25 1594246885 ⪫祭 ॣ '-2'(A) +03:21:35 1594246895 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.289 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.289 new file mode 100644 index 0000000..40b9aaf Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.289 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.290 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.290 new file mode 100644 index 0000000..91d558c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.290 @@ -0,0 +1,4 @@ +00:09:10 1594235350 1 07009 2 OT-4 3 25 4 1 5 Ti 6 7 670 8 4740 9 4520 10 560 11 12 321847 +10:45:45 1594273545 1 07010 +11:18:58 1594275538 8 4450 9 4110 +16:57:00 1594295820 1 07010 2 OT-4 3 25 4 1 5 Ti 6 7 670 8 4450 9 4110 10 560 11 12 321847 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.291 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.291 new file mode 100644 index 0000000..70db04c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.291 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.292 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.292 new file mode 100644 index 0000000..39328cd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.292 @@ -0,0 +1,108 @@ +22 23:45:01 00:00:05 +P1= 59.7 T1=23:55:05 P2= 74.4 T2=00:00:05 Vs= 2.94 + +23 00:00:31 00:00:36 + + +24 00:00:42 00:01:20 + + +30 00:01:34 00:02:00 +Vst= 29.5 + +31 00:02:07 00:02:41 +Rom_sol= 14.7 + +32 00:03:09 00:03:46 +Imax=10.9 Umax=58.3 T= 9.0 + +33 00:03:50 00:04:13 +Imin=15.9 Umin=24.9 T= 0.5 + +34 00:04:17 00:04:42 +V=300.1 T= 9.4 + +35 00:04:45 00:05:48 +Q= 52.9 T= 9.4 + +36 00:05:52 00:06:31 +P1=0.29 T= 2.9 + +37 00:06:35 00:07:16 +T= 0.9 + +38 00:07:21 00:07:28 +t= 53.2 T= 0.5 + +39 00:07:34 00:07:50 +tcam= 53.7 Tcam= 0.5 tfl= 53.8 Tfl= 0.5 + +40 00:07:59 00:08:06 +t= 54.1 T= 0.5 + +21 10:45:50 10:45:53 +Rsk= 25.8 Rkk= 21.8 + +22 11:19:09 11:34:13 +P1= 82.4 T1=11:29:13 P2=103.9 T2=11:34:13 Vs= 4.30 + +22 12:14:04 12:29:08 +P1= 54.2 T1=12:24:08 P2= 68.5 T2=12:29:08 Vs= 2.86 + +20 13:40:35 13:40:43 +Riz_sol= 29.1 + +21 13:40:49 13:40:52 +Rsk= 27.1 Rkk= 23.2 + +22 14:34:57 14:50:02 +P1= 68.2 T1=14:45:01 P2= 88.7 T2=14:50:02 Vs= 4.09 + +22 15:24:27 15:39:31 +P1= 50.8 T1=15:34:31 P2= 66.4 T2=15:39:31 Vs= 3.13 + +22 15:45:02 16:00:07 +P1= 48.3 T1=15:55:07 P2= 63.1 T2=16:00:07 Vs= 2.96 + +22 16:33:19 16:48:23 +P1= 41.2 T1=16:43:23 P2= 54.3 T2=16:48:23 Vs= 2.61 + +23 16:48:43 16:48:48 + + +24 16:48:57 16:49:55 + + +30 16:50:06 16:50:40 +Vst= 29.4 + +31 16:50:45 16:51:19 +Rom_sol= 14.9 + +32 16:51:45 16:52:19 +Imax=10.9 Umax=58.3 T= 9.0 + +33 16:52:22 16:52:41 +Imin=15.9 Umin=24.9 T= 0.5 + +34 16:52:44 16:53:07 +V=300.0 T= 9.4 + +35 16:53:10 16:54:21 +Q= 52.5 T=12.4 + +36 16:54:26 16:55:00 +P1=0.29 T= 2.9 + +38 16:55:04 16:55:11 +t= 53.3 T= 0.5 + +37 16:55:14 16:55:52 +T= 0.9 + +39 16:55:55 16:56:11 +tcam= 54.6 Tcam= 0.5 tfl= 53.0 Tfl= 0.5 + +40 16:56:15 16:56:23 +t= 51.7 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.293 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.293 new file mode 100644 index 0000000..241f1aa --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.293 @@ -0,0 +1,15 @@ +25 00:01:30 1594234890 +9 00:09:10 1594235350 +10 00:35:07 1594236907 +12 04:44:59 1594251899 +13 07:48:43 1594262923 +0 07:48:43 1594262923 +2 10:39:47 1594273187 +5 12:29:59 1594279799 +6 12:43:06 1594280586 +7 13:21:28 1594282888 +8 13:36:59 1594283819 +25 16:50:03 1594295403 +9 16:57:00 1594295820 +10 17:21:38 1594297298 +12 21:05:20 1594310720 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.294 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.294 new file mode 100644 index 0000000..de210c9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.294 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.296 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.296 new file mode 100644 index 0000000..049b845 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.296 @@ -0,0 +1,87 @@ +[49] +oper = 25 +begin = 09.07.2020 00:01:30 +norma = 30 +real = 7 + +[50] +oper = 9 +begin = 09.07.2020 00:09:10 +norma = 0 +real = 25 + +[51] +oper = 10 +begin = 09.07.2020 00:35:07 +norma = 0 +real = 249 + +[52] +oper = 12 +begin = 09.07.2020 04:44:59 +norma = 180 +real = 183 + +[53] +oper = 13 +begin = 09.07.2020 07:48:43 +norma = 45 +real = 171 + +[54] +oper = 2 +begin = 09.07.2020 10:39:47 +norma = 110 +vac_time = 7 +real = 110 + +[55] +oper = 5 +begin = 09.07.2020 12:29:59 +norma = 25 +real = 13 + +[56] +oper = 6 +begin = 09.07.2020 12:43:06 +norma = 35 +real = 38 + +[57] +oper = 7 +begin = 09.07.2020 13:21:28 +norma = 30 +real = 15 + +[58] +oper = 8 +begin = 09.07.2020 13:36:59 +norma = 40 +vac_time = 6 +vac_avg10 = 6.8 +real = 193 + +[59] +oper = 25 +begin = 09.07.2020 16:50:03 +norma = 30 +real = 6 + +[60] +oper = 9 +begin = 09.07.2020 16:57:00 +norma = 0 +real = 24 + +[61] +oper = 10 +begin = 09.07.2020 17:21:38 +norma = 0 +real = 223 + +[62] +oper = 12 +begin = 09.07.2020 21:05:20 +norma = 180 +real = 185 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.297 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.297 new file mode 100644 index 0000000..e238b89 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.297 @@ -0,0 +1,143 @@ +00:00:44 1594234844 祭 ॣ '-2'(A) +00:01:21 1594234881 ⪫祭 ॣ '-2'(A) +00:10:31 1594235431 祭 ॣ '-2' +00:35:17 1594236917 祭 ⠭ ॣ +04:45:02 1594251902 ⪫祭 ॣ '-2'(A) +09:45:18 1594269918 祭 ० ᪠ +09:45:39 1594269939 祭 ० ᪠ +12:43:51 1594280631 祭 ० ᪠ +12:43:52 1594280632 祭 ० ᪠ +12:43:52 1594280632 祭 ० ᪠ +12:43:52 1594280632 祭 ० ᪠ +12:43:53 1594280633 祭 ० ᪠ +12:43:54 1594280634 祭 ० ᪠ +12:43:54 1594280634 祭 ० ᪠ +12:43:55 1594280635 祭 ० ᪠ +12:43:55 1594280635 祭 ० ᪠ +12:43:55 1594280635 祭 ० ᪠ +12:43:55 1594280635 祭 ० ᪠ +12:43:56 1594280636 祭 ० ᪠ +12:43:56 1594280636 祭 ० ᪠ +12:43:57 1594280637 祭 ० ᪠ +12:43:57 1594280637 祭 ० ᪠ +12:43:57 1594280637 祭 ० ᪠ +12:43:57 1594280637 祭 ० ᪠ +12:43:58 1594280638 祭 ० ᪠ +12:43:58 1594280638 祭 ० ᪠ +12:43:58 1594280638 祭 ० ᪠ +12:43:58 1594280638 祭 ० ᪠ +12:43:59 1594280639 祭 ० ᪠ +12:43:59 1594280639 祭 ० ᪠ +12:43:59 1594280639 祭 ० ᪠ +12:44:00 1594280640 祭 ० ᪠ +12:44:01 1594280641 祭 ० ᪠ +12:44:01 1594280641 祭 ० ᪠ +12:44:01 1594280641 祭 ० ᪠ +12:44:02 1594280642 祭 ० ᪠ +12:44:03 1594280643 祭 ० ᪠ +12:44:03 1594280643 祭 ० ᪠ +12:44:03 1594280643 祭 ० ᪠ +12:44:04 1594280644 祭 ० ᪠ +12:44:04 1594280644 祭 ० ᪠ +12:44:06 1594280646 祭 ० ᪠ +12:44:06 1594280646 祭 ० ᪠ +12:44:06 1594280646 祭 ० ᪠ +12:44:06 1594280646 祭 ० ᪠ +12:44:07 1594280647 祭 ० ᪠ +12:44:07 1594280647 祭 ० ᪠ +12:44:15 1594280655 祭 ० ᪠ +12:44:15 1594280655 祭 ० ᪠ +12:44:15 1594280655 祭 ० ᪠ +12:44:16 1594280656 祭 ० ᪠ +12:44:16 1594280656 祭 ० ᪠ +12:44:16 1594280656 祭 ० ᪠ +12:44:16 1594280656 祭 ० ᪠ +12:44:17 1594280657 祭 ० ᪠ +12:44:17 1594280657 祭 ० ᪠ +12:44:17 1594280657 祭 ० ᪠ +12:44:17 1594280657 祭 ० ᪠ +12:44:18 1594280658 祭 ० ᪠ +12:44:19 1594280659 祭 ० ᪠ +12:44:19 1594280659 祭 ० ᪠ +12:44:20 1594280660 祭 ० ᪠ +12:44:20 1594280660 祭 ० ᪠ +12:44:22 1594280662 祭 ० ᪠ +12:44:23 1594280663 祭 ० ᪠ +12:44:26 1594280666 祭 ० ᪠ +12:44:26 1594280666 祭 ० ᪠ +12:44:26 1594280666 祭 ० ᪠ +12:44:27 1594280667 祭 ० ᪠ +12:44:27 1594280667 祭 ० ᪠ +12:44:27 1594280667 祭 ० ᪠ +12:44:28 1594280668 祭 ० ᪠ +12:44:28 1594280668 祭 ० ᪠ +12:44:28 1594280668 祭 ० ᪠ +12:44:28 1594280668 祭 ० ᪠ +12:44:29 1594280669 祭 ० ᪠ +12:44:29 1594280669 祭 ० ᪠ +12:44:29 1594280669 祭 ० ᪠ +12:44:29 1594280669 祭 ० ᪠ +12:44:30 1594280670 祭 ० ᪠ +12:44:30 1594280670 祭 ० ᪠ +12:44:31 1594280671 祭 ० ᪠ +12:44:31 1594280671 祭 ० ᪠ +12:44:32 1594280672 祭 ० ᪠ +12:44:32 1594280672 祭 ० ᪠ +12:44:33 1594280673 祭 ० ᪠ +12:44:34 1594280674 祭 ० ᪠ +12:44:34 1594280674 祭 ० ᪠ +12:44:34 1594280674 祭 ० ᪠ +12:44:35 1594280675 祭 ० ᪠ +12:44:35 1594280675 祭 ० ᪠ +12:44:35 1594280675 祭 ० ᪠ +12:44:35 1594280675 祭 ० ᪠ +12:44:35 1594280675 祭 ० ᪠ +12:44:36 1594280676 祭 ० ᪠ +12:45:00 1594280700 祭 ० ᪠ +12:45:01 1594280701 祭 ० ᪠ +12:45:02 1594280702 祭 ० ᪠ +12:45:02 1594280702 祭 ० ᪠ +12:45:03 1594280703 祭 ० ᪠ +12:45:03 1594280703 祭 ० ᪠ +14:10:01 1594285801 祭 ० ᪠ +14:10:02 1594285802 祭 ० ᪠ +14:10:02 1594285802 祭 ० ᪠ +14:10:02 1594285802 祭 ० ᪠ +14:10:04 1594285804 祭 ० ᪠ +14:10:04 1594285804 祭 ० ᪠ +14:10:05 1594285805 祭 ० ᪠ +14:10:05 1594285805 祭 ० ᪠ +14:10:06 1594285806 祭 ० ᪠ +14:10:07 1594285807 祭 ० ᪠ +14:10:07 1594285807 祭 ० ᪠ +14:10:07 1594285807 祭 ० ᪠ +14:10:27 1594285827 祭 ० ᪠ +14:10:28 1594285828 祭 ० ᪠ +14:10:29 1594285829 祭 ० ᪠ +14:10:29 1594285829 祭 ० ᪠ +14:10:30 1594285830 祭 ० ᪠ +14:10:44 1594285844 祭 ० ᪠ +14:10:44 1594285844 祭 ० ᪠ +14:10:44 1594285844 祭 ० ᪠ +14:10:48 1594285848 祭 ० ᪠ +14:10:50 1594285850 祭 ० ᪠ +14:10:55 1594285855 祭 ० ᪠ +14:10:55 1594285855 祭 ० ᪠ +14:13:04 1594285984 祭 ॣ '-2'(A) +14:13:06 1594285986 ⪫祭 ॣ '-2'(A) +14:15:03 1594286103 祭 ० ᪠ +14:15:04 1594286104 祭 ० ᪠ +14:15:04 1594286104 祭 ० ᪠ +14:15:05 1594286105 祭 ० ᪠ +14:15:12 1594286112 ⪫祭 ० ᪠ +14:15:45 1594286145 祭 ० ᪠ +14:15:52 1594286152 ⪫祭 ० ᪠ +16:49:19 1594295359 祭 ॣ '-2'(A) +16:49:56 1594295396 ⪫祭 ॣ '-2'(A) +16:58:08 1594295888 祭 ॣ '-2' +17:23:29 1594297409 祭 ⠭ ॣ +21:05:23 1594310723 ⪫祭 ॣ '-2'(A) +21:06:04 1594310764 祭 ० ᪠ +21:06:04 1594310764 祭 ० ᪠ +21:06:04 1594310764 祭 ० ᪠ +21:08:37 1594310917 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.299 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.299 new file mode 100644 index 0000000..e1bfeec Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.299 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.310 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.310 new file mode 100644 index 0000000..c356a01 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.310 @@ -0,0 +1,3 @@ +12:24:08 1594279448 1 07437 9 4720 +14:03:01 1594285381 1 07437 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4980 9 4720 10 690 11 12 320469 +14:45:38 1594287938 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.311 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.311 new file mode 100644 index 0000000..6a17647 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.311 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.312 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.312 new file mode 100644 index 0000000..04e9651 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.312 @@ -0,0 +1,54 @@ +20 12:23:08 12:23:17 +Riz_sol= 1170.0 + +21 12:23:25 12:23:28 +Rsk= 21.6 Rkk= 18.8 + +22 13:01:34 13:17:10 +P1= 41.0 T1=13:12:10 P2= 53.2 T2=13:17:10 Vs= 2.45 + +22 13:41:22 13:51:59 +P1= 16.0 T1=13:46:59 P2= 28.6 T2=13:51:59 Vs= 2.52 + +23 13:52:15 13:52:20 + + +24 13:52:26 13:52:59 + + +24 13:53:21 13:53:59 + + +30 13:54:23 13:54:55 +Vst= 29.6 + +31 13:55:23 13:56:01 +Rom_sol= 10.2 + +32 13:56:42 13:57:19 +Imax=11.0 Umax=50.0 T= 9.0 + +33 13:57:22 13:57:50 +Imin=16.0 Umin=25.0 T= 0.5 + +34 13:57:53 13:58:18 +V=300.1 T= 9.6 + +35 13:58:22 13:59:35 +Q= 3.6 T= 9.6 + +36 13:59:39 14:00:16 +P1=0.29 T= 3.1 + +37 14:00:39 14:01:16 +T= 1.1 + +38 14:01:19 14:01:30 +t= 51.1 T= 0.7 + +39 14:01:33 14:01:46 +t= 52.1 T= 0.7 + +40 14:01:49 14:01:57 +t= 52.3 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.313 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.313 new file mode 100644 index 0000000..c810bc5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.313 @@ -0,0 +1,12 @@ +11 03:48:09 1594248489 +12 06:35:11 1594258511 +13 08:24:10 1594265050 +0 08:24:10 1594265050 +8 12:16:27 1594278987 +25 13:54:19 1594284859 +9 14:03:01 1594285381 +10 14:45:38 1594287938 +11 18:42:24 1594302144 +12 21:29:24 1594312164 +13 23:20:24 1594318824 +0 23:20:24 1594318824 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.314 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.314 new file mode 100644 index 0000000..5f0a232 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.314 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.315 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.315 new file mode 100644 index 0000000..37079de --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.315 @@ -0,0 +1 @@ +29 13:52:59 1594284779 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.316 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.316 new file mode 100644 index 0000000..ee84254 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.316 @@ -0,0 +1,61 @@ +[25] +oper = 11 +begin = 09.07.2020 03:48:09 +norma = 0 +real = 167 + +[26] +oper = 12 +begin = 09.07.2020 06:35:11 +norma = 105 +real = 108 + +[27] +oper = 13 +begin = 09.07.2020 08:24:10 +norma = 45 +real = 232 + +[28] +oper = 8 +begin = 09.07.2020 12:16:27 +norma = 40 +vac_time = 7 +real = 97 + +[29] +oper = 25 +begin = 09.07.2020 13:54:19 +norma = 30 +real = 8 + +[30] +oper = 9 +begin = 09.07.2020 14:03:01 +norma = 0 +real = 42 + +[31] +oper = 10 +begin = 09.07.2020 14:45:38 +norma = 0 +real = 236 + +[32] +oper = 11 +begin = 09.07.2020 18:42:24 +norma = 0 +real = 167 + +[33] +oper = 12 +begin = 09.07.2020 21:29:24 +norma = 105 +real = 111 + +[34] +oper = 13 +begin = 09.07.2020 23:20:24 +norma = 45 +real = 340 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.317 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.317 new file mode 100644 index 0000000..9948696 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.317 @@ -0,0 +1,25 @@ +03:48:09 1594248489 祭 ० +03:48:09 1594248489 ⪫祭 ॣ '-2'(A) +03:48:10 1594248490 祭 ॣ '-2'(A) +05:40:09 1594255209 ⪫祭 ॣ '-2'(A) +06:35:07 1594258507 ⪫祭 ० (A) +06:35:13 1594258513 ⪫祭 ० ' ⮪ 㣨' +06:35:51 1594258551 祭 ० ᪠ +06:38:26 1594258706 ⪫祭 ० ᪠ (A) +13:52:27 1594284747 祭 ॣ '-2'(A) +13:53:00 1594284780 ⪫祭 ॣ '-2'(A) +13:53:22 1594284802 祭 ॣ '-2'(A) +13:53:59 1594284839 ⪫祭 ॣ '-2'(A) +14:02:26 1594285346 祭 ० ࠧ +14:02:27 1594285347 祭 ० ' ⮪ 㣨' +14:28:34 1594286914 祭 ॣ '-2'(A) +14:45:38 1594287938 ⪫祭 ० ࠧ (A) +14:45:39 1594287939 祭 ⠭ ॣ +18:42:24 1594302144 祭 ० +18:42:24 1594302144 ⪫祭 ॣ '-2'(A) +18:42:26 1594302146 祭 ॣ '-2'(A) +20:34:25 1594308865 ⪫祭 ॣ '-2'(A) +21:29:21 1594312161 ⪫祭 ० (A) +21:29:25 1594312165 ⪫祭 ० ' ⮪ 㣨' +21:29:53 1594312193 祭 ० ᪠ +21:32:33 1594312353 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.319 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.319 new file mode 100644 index 0000000..40c437d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.319 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.320 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.320 new file mode 100644 index 0000000..51f3eef --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.320 @@ -0,0 +1,6 @@ +01:15:10 1594239310 3 14 +13:47:38 1594284458 1 05165 3 32 6 9 4520 +16:33:37 1594294417 12 321801 +22:50:31 1594317031 6 +22:50:49 1594317049 1 05165 2 OT-4 3 32 4 2 5 Ti 6 7 770 8 4450 9 4520 10 670 11 12 321801 +23:21:50 1594318910 0 A--32-050-2012 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.321 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.321 new file mode 100644 index 0000000..396edf6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.321 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.322 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.322 new file mode 100644 index 0000000..b348555 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.322 @@ -0,0 +1,72 @@ +21 01:10:48 01:10:51 +Rsk= 17.4 Rkk= 12.1 + +22 01:38:21 01:48:26 +P1= 24.5 T1=01:43:26 P2= 45.9 T2=01:48:26 Vs= 4.28 + +21 13:40:59 13:41:02 +Rsk= 19.0 Rkk= 13.4 + +22 14:19:54 14:34:59 +P1= 51.1 T1=14:29:59 P2= 70.2 T2=14:34:59 Vs= 3.84 + +22 14:56:17 15:06:22 +P1= 17.5 T1=15:01:22 P2= 32.2 T2=15:06:22 Vs= 2.93 + +21 16:32:52 16:32:55 +Rsk= 18.1 Rkk= 13.0 + +20 16:33:03 16:33:11 +Riz_sol= 4805.7 + +22 17:07:33 17:22:38 +P1= 40.9 T1=17:17:38 P2= 55.2 T2=17:22:38 Vs= 2.86 + +22 22:31:45 22:41:50 +P1= 8.7 T1=22:36:50 P2= 16.9 T2=22:41:50 Vs= 1.64 + +23 22:42:05 22:42:10 + + +24 22:42:29 22:43:06 + + +30 22:44:04 22:44:09 +Vst= 12.8 + +30 22:44:12 22:44:40 +Vst= 29.6 + +31 22:44:45 22:45:18 +Rom_sol= 10.1 + +41 22:46:04 22:46:09 +Ukz= 1.16 + +32 22:46:11 22:46:48 +Imax=27.2 Umax=55.0 T= 9.0 + +33 22:46:50 22:47:09 +Imin=16.2 Umin=24.9 T= 0.5 + +34 05:00:00 22:47:33 +V=300.1 T= 9.4 + +35 22:47:35 22:48:32 +Q= 54.6 T= 9.4 + +36 22:48:35 22:49:08 +P1=0.29 T= 2.9 + +37 22:49:11 22:49:42 +T= 0.9 + +38 22:49:45 22:49:53 +t= 52.2 T= 0.5 + +39 22:49:56 22:50:12 +tcam= 53.5 Tcam= 0.5 tfl= 52.0 Tfl= 0.5 + +40 22:50:15 22:50:22 +t= 51.9 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.323 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.323 new file mode 100644 index 0000000..330df43 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.323 @@ -0,0 +1,14 @@ +13 00:29:05 1594236545 +0 00:29:05 1594236545 +14 01:10:20 1594239020 +15 01:49:37 1594241377 +16 02:15:32 1594242932 +1 02:50:11 1594245011 +2 13:36:00 1594283760 +5 15:09:03 1594289343 +6 15:20:47 1594290047 +7 16:09:38 1594292978 +8 16:28:49 1594294129 +25 22:44:00 1594316640 +9 22:50:49 1594317049 +10 23:21:50 1594318910 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.324 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.324 new file mode 100644 index 0000000..622f5fd Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.324 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.326 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.326 new file mode 100644 index 0000000..4d060b6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.326 @@ -0,0 +1,81 @@ +[70] +oper = 13 +begin = 09.07.2020 00:29:05 +norma = 45 +real = 41 + +[71] +oper = 14 +begin = 09.07.2020 01:10:20 +norma = 40 +vac_time = 7 +real = 39 + +[72] +oper = 15 +begin = 09.07.2020 01:49:37 +norma = 30 +real = 25 + +[73] +oper = 16 +begin = 09.07.2020 02:15:32 +norma = 40 +real = 34 + +[74] +oper = 1 +begin = 09.07.2020 02:50:11 +norma = 85 +real = 645 + +[75] +oper = 2 +begin = 09.07.2020 13:36:00 +norma = 110 +vac_time = 8 +real = 93 + +[76] +oper = 5 +begin = 09.07.2020 15:09:03 +norma = 25 +real = 11 + +[77] +oper = 6 +begin = 09.07.2020 15:20:47 +norma = 35 +real = 48 + +[78] +oper = 7 +begin = 09.07.2020 16:09:38 +norma = 30 +real = 19 + +[79] +oper = 8 +begin = 09.07.2020 16:28:49 +norma = 40 +vac_time = 8 +real = 375 + +[80] +oper = 25 +begin = 09.07.2020 22:44:00 +norma = 30 +real = 6 + +[81] +oper = 9 +begin = 09.07.2020 22:50:49 +norma = 0 +real = 31 + +[82] +oper = 10 +begin = 09.07.2020 23:21:50 +norma = 0 +real = 162 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.327 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.327 new file mode 100644 index 0000000..ad38de3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.327 @@ -0,0 +1,17 @@ +01:49:33 1594241373 祭 ० ࠧ +01:49:34 1594241374 祭 ० ' ⮪ 㣨' +01:49:37 1594241377 祭 ॣ '-2'(A) +02:13:23 1594242803 ⪫祭 ० ' ⮪ 㣨' +02:15:36 1594242936 ⪫祭 ॣ '-2'(A) +02:15:46 1594242946 祭 ० ᪠ +02:17:51 1594243071 ⪫祭 ० ᪠ (A) +15:21:00 1594290060 祭 ० ᪠ +15:23:05 1594290185 ⪫祭 ० ᪠ (A) +22:42:30 1594316550 祭 ॣ '-2'(A) +22:43:07 1594316587 ⪫祭 ॣ '-2'(A) +22:50:35 1594317035 祭 ० ࠧ +22:50:36 1594317036 祭 ० ' ⮪ 㣨' +23:18:50 1594318730 祭 ॣ '-2'(A) +23:19:09 1594318749 ⪫祭 ० ᪠ (A) +23:21:50 1594318910 ⪫祭 ० ࠧ (A) +23:21:51 1594318911 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.329 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.329 new file mode 100644 index 0000000..44295f0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.329 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.330 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.330 new file mode 100644 index 0000000..54a2357 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.330 @@ -0,0 +1,6 @@ +02:18:01 1594243081 3 14 +03:22:49 1594246969 0 A--32-067-2014 ॢ 0 +04:43:06 1594251786 1 11197 3 25 7 840 9 6476 10 770 11 +07:39:15 1594262355 1 11197 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 840 8 4910 9 6476 10 770 11 12 321544 +20:30:01 1594308601 3 14 +22:51:16 1594317076 1 11198 2 BT 18, 20, 22, 23, 25 3 25 7 870 9 5110 11 12 321672 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.331 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.331 new file mode 100644 index 0000000..b48ec85 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.331 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.332 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.332 new file mode 100644 index 0000000..0a35987 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.332 @@ -0,0 +1,75 @@ +21 02:18:25 02:18:33 +Rsk= 17.6 Rkk= 12.4 + +22 02:39:31 02:50:02 +P1= 9.5 T1=02:45:02 P2= 30.2 T2=02:50:02 Vs= 4.14 + +21 04:43:34 04:43:41 +Rsk= 17.6 Rkk= 12.4 + +22 05:04:30 05:19:59 +P1= 39.8 T1=05:14:59 P2= 54.9 T2=05:19:59 Vs= 3.01 + +20 06:55:57 06:56:07 +Riz_sol= 3532.5 + +21 06:56:17 06:56:24 +Rsk= 17.5 Rkk= 12.3 + +22 07:14:32 07:30:02 +P1= 36.6 T1=07:25:02 P2= 51.0 T2=07:30:02 Vs= 2.86 + +23 07:30:21 07:30:27 + + +24 07:30:39 07:31:14 + + +30 07:31:32 07:32:17 +Vst= 28.4 + +31 07:32:24 07:33:02 +Rom_sol= 15.8 + +41 07:33:37 07:33:42 +Ukz= 0.84 + +32 07:33:46 07:34:55 +Imax=11.0 Umax=50.0 T= 9.2 + +33 07:34:58 07:35:27 +Imin=16.2 Umin=25.1 T= 0.8 + +34 07:35:31 07:35:58 +V=301.8 T= 9.5 + +35 07:36:02 07:36:54 +Q= 55.0 T= 9.1 + +36 07:36:58 07:37:31 +P1=0.29 T= 3.1 + +37 07:37:34 07:38:12 +T= 0.7 + +38 07:38:15 07:38:21 +t= 52.1 T= 0.5 + +39 07:38:24 07:38:31 +t= 52.4 T= 0.8 + +40 07:38:34 07:38:41 +t= 52.0 T= 0.7 + +21 20:30:19 20:30:27 +Rsk= 17.2 Rkk= 12.1 + +22 20:48:58 21:04:28 +P1= 52.2 T1=20:59:28 P2= 70.2 T2=21:04:28 Vs= 3.61 + +21 22:51:29 22:51:37 +Rsk= 17.2 Rkk= 12.1 + +22 23:26:39 23:37:11 +P1= 9.3 T1=23:32:11 P2= 24.5 T2=23:37:11 Vs= 3.03 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.333 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.333 new file mode 100644 index 0000000..bb4a0bb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.333 @@ -0,0 +1,27 @@ +12 00:01:35 1594234895 +13 01:52:09 1594241529 +0 01:52:09 1594241529 +14 02:14:59 1594242899 +15 02:50:40 1594245040 +16 03:22:50 1594246970 +16 03:25:07 1594247107 +1 04:10:05 1594249805 +2 04:37:56 1594251476 +5 05:20:47 1594254047 +6 05:35:15 1594254915 +7 06:13:39 1594257219 +8 06:34:01 1594258441 +25 07:31:28 1594261888 +9 07:39:15 1594262355 +10 08:19:51 1594264791 +11 13:54:20 1594284860 +12 13:59:16 1594285156 +13 18:48:19 1594302499 +0 18:48:21 1594302501 +14 20:27:08 1594308428 +15 21:05:32 1594310732 +16 21:25:10 1594311910 +1 22:09:03 1594314543 +2 22:47:34 1594316854 +5 23:38:32 1594319912 +6 23:52:51 1594320771 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.334 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.334 new file mode 100644 index 0000000..fa2688f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.334 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.336 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.336 new file mode 100644 index 0000000..4fe48e7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.336 @@ -0,0 +1,155 @@ +[87] +oper = 12 +begin = 09.07.2020 00:01:35 +norma = 105 +real = 110 + +[88] +oper = 13 +begin = 09.07.2020 01:52:09 +norma = 45 +real = 22 + +[89] +oper = 14 +begin = 09.07.2020 02:14:59 +norma = 40 +vac_time = 8 +real = 35 + +[90] +oper = 15 +begin = 09.07.2020 02:50:40 +norma = 30 +real = 32 + +[91] +oper = 16 +begin = 09.07.2020 03:22:50 +norma = 40 +real = 2 + +[92] +oper = 16 +begin = 09.07.2020 03:25:07 +norma = 40 +real = 44 + +[93] +oper = 1 +begin = 09.07.2020 04:10:05 +norma = 85 +real = 27 + +[94] +oper = 2 +begin = 09.07.2020 04:37:56 +norma = 110 +vac_time = 8 +real = 42 + +[95] +oper = 5 +begin = 09.07.2020 05:20:47 +norma = 25 +real = 14 + +[96] +oper = 6 +begin = 09.07.2020 05:35:15 +norma = 35 +real = 38 + +[97] +oper = 7 +begin = 09.07.2020 06:13:39 +norma = 30 +real = 20 + +[98] +oper = 8 +begin = 09.07.2020 06:34:01 +norma = 40 +vac_time = 22 +real = 57 + +[99] +oper = 25 +begin = 09.07.2020 07:31:28 +norma = 30 +real = 7 + +[00] +oper = 9 +begin = 09.07.2020 07:39:15 +norma = 0 +real = 40 + +[01] +oper = 10 +begin = 09.07.2020 08:19:51 +norma = 0 +real = 334 + +[02] +oper = 11 +begin = 09.07.2020 13:54:20 +norma = 0 +real = 4 + +[03] +oper = 12 +begin = 09.07.2020 13:59:16 +norma = 105 +real = 289 + +[04] +oper = 13 +begin = 09.07.2020 18:48:19 +norma = 45 +real = 98 + +[05] +oper = 14 +begin = 09.07.2020 20:27:08 +norma = 40 +vac_time = 9 +real = 38 + +[06] +oper = 15 +begin = 09.07.2020 21:05:32 +norma = 30 +real = 19 + +[07] +oper = 16 +begin = 09.07.2020 21:25:10 +norma = 40 +real = 43 + +[08] +oper = 1 +begin = 09.07.2020 22:09:03 +norma = 85 +real = 38 + +[09] +oper = 2 +begin = 09.07.2020 22:47:34 +norma = 110 +vac_time = 10 +real = 50 + +[10] +oper = 5 +begin = 09.07.2020 23:38:32 +norma = 25 +real = 14 + +[11] +oper = 6 +begin = 09.07.2020 23:52:51 +norma = 35 +real = 41 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.337 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.337 new file mode 100644 index 0000000..e5a1c91 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.337 @@ -0,0 +1,88 @@ +00:01:32 1594234892 ⪫祭 ० (A) +00:01:33 1594234893 ⪫祭 +00:01:33 1594234893 : +00:01:36 1594234896 ⪫祭 ० ' ⮪ 㣨' +00:02:05 1594234925 祭 ० ᪠ +00:02:06 1594234926 祭 ० ᪠ +00:02:36 1594234956 . ⪫祭 ० ᪠ (A) +00:06:13 1594235173 祭 ० ᪠ +00:06:41 1594235201 . ⪫祭 ० ᪠ (A) +00:07:02 1594235222 祭 ० ᪠ +00:07:02 1594235222 . ⪫祭 ० ᪠ (A) +00:07:02 1594235222 祭 ० ᪠ +00:07:02 1594235222 . ⪫祭 ० ᪠ (A) +00:07:03 1594235223 祭 ० ᪠ +00:07:03 1594235223 . ⪫祭 ० ᪠ (A) +00:07:04 1594235224 祭 ० ᪠ +00:07:04 1594235224 . ⪫祭 ० ᪠ (A) +00:07:04 1594235224 祭 ० ᪠ +00:07:04 1594235224 . ⪫祭 ० ᪠ (A) +00:07:07 1594235227 祭 ० ᪠ +00:07:07 1594235227 . ⪫祭 ० ᪠ (A) +00:07:07 1594235227 祭 ० ᪠ +00:07:07 1594235227 . ⪫祭 ० ᪠ (A) +00:07:07 1594235227 祭 ० ᪠ +00:07:07 1594235227 . ⪫祭 ० ᪠ (A) +00:07:07 1594235227 祭 ० ᪠ +00:07:07 1594235227 . ⪫祭 ० ᪠ (A) +00:07:08 1594235228 祭 ० ᪠ +00:07:08 1594235228 . ⪫祭 ० ᪠ (A) +00:07:08 1594235228 祭 ० ᪠ +00:07:08 1594235228 . ⪫祭 ० ᪠ (A) +00:07:08 1594235228 祭 ० ᪠ +00:07:08 1594235228 . ⪫祭 ० ᪠ (A) +00:07:08 1594235228 祭 ० ᪠ +00:07:08 1594235228 . ⪫祭 ० ᪠ (A) +00:07:10 1594235230 祭 ० ᪠ +00:07:10 1594235230 . ⪫祭 ० ᪠ (A) +00:07:10 1594235230 祭 ० ᪠ +00:07:10 1594235230 . ⪫祭 ० ᪠ (A) +00:07:11 1594235231 祭 ० ᪠ +00:07:11 1594235231 . ⪫祭 ० ᪠ (A) +00:07:21 1594235241 祭 ० ᪠ +00:07:21 1594235241 . ⪫祭 ० ᪠ (A) +00:07:21 1594235241 祭 ० ᪠ +00:07:21 1594235241 . ⪫祭 ० ᪠ (A) +00:07:21 1594235241 祭 ० ᪠ +00:07:21 1594235241 . ⪫祭 ० ᪠ (A) +00:07:21 1594235241 祭 ० ᪠ +00:07:21 1594235241 . ⪫祭 ० ᪠ (A) +00:07:22 1594235242 祭 ० ᪠ +00:07:22 1594235242 . ⪫祭 ० ᪠ (A) +00:07:43 1594235263 祭 ० ᪠ +00:07:43 1594235263 祭 ० ᪠ +00:10:15 1594235415 ⪫祭 ० ᪠ (A) +00:31:33 1594236693 : 믮 +02:50:30 1594245030 祭 ० ࠧ +02:50:32 1594245032 祭 ० ' ⮪ 㣨' +02:51:15 1594245075 祭 ॣ '-2'(A) +03:22:49 1594246969 ⪫祭 ० ࠧ (A) +03:25:08 1594247108 ⪫祭 ० ' ⮪ 㣨' +03:25:11 1594247111 ⪫祭 ॣ '-2'(A) +03:25:19 1594247119 祭 ० ᪠ +03:25:20 1594247120 祭 ० ᪠ +03:25:50 1594247150 . ⪫祭 ० ᪠ (A) +03:26:18 1594247178 祭 ० ᪠ +03:29:07 1594247347 ⪫祭 ० ᪠ (A) +05:35:26 1594254926 祭 ० ᪠ +05:38:48 1594255128 ⪫祭 ० ᪠ (A) +07:30:42 1594261842 祭 ॣ '-2'(A) +07:31:16 1594261876 ⪫祭 ॣ '-2'(A) +08:18:44 1594264724 祭 ॣ '-2' +08:20:14 1594264814 祭 ⠭ ॣ +13:59:21 1594285161 ⪫祭 ॣ '-2'(A) +13:59:46 1594285186 祭 ० ᪠ +13:59:49 1594285189 祭 ० ᪠ +14:02:44 1594285364 ⪫祭 ० ᪠ (A) +21:05:04 1594310704 祭 ० ࠧ +21:05:06 1594310706 祭 ० ' ⮪ 㣨' +21:05:27 1594310727 祭 ॣ '-2'(A) +21:24:53 1594311893 ⪫祭 ० ' ⮪ 㣨' +21:25:13 1594311913 ⪫祭 ॣ '-2'(A) +21:25:48 1594311948 ⪫祭 ० ࠧ (A) +21:25:49 1594311949 祭 ० ᪠ +21:28:31 1594312111 ⪫祭 ० ᪠ (A) +22:51:17 1594317077 : 㦥 +23:53:03 1594320783 祭 ० ᪠ +23:53:04 1594320784 祭 ० ᪠ +23:56:07 1594320967 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.339 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.339 new file mode 100644 index 0000000..19946de Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.339 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.340 new file mode 100644 index 0000000..7c13b35 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.340 @@ -0,0 +1,5 @@ +01:01:32 1594238492 1 09634 3 25 9 4890 10 690 12 320801 +02:02:09 1594242129 1 09634 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4250 9 4890 10 690 11 12 320801 +02:45:40 1594244740 0 A--32-031-2016 ॢ 5 +22:18:48 1594315128 1 09635 +22:19:56 1594315196 4 1 7 670 8 4650 9 4410 10 560 12 321672 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.341 new file mode 100644 index 0000000..963f79e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.342 new file mode 100644 index 0000000..60d856d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.342 @@ -0,0 +1,54 @@ +20 01:01:47 01:01:56 +Riz_sol= 2072.8 + +21 01:02:01 01:02:04 +Rsk= 14.8 Rkk= 14.2 + +22 01:44:25 01:54:52 +P1= 16.1 T1=01:49:52 P2= 29.0 T2=01:54:52 Vs= 2.58 + +23 01:55:14 01:55:19 + + +24 01:55:27 01:56:06 + + +30 01:56:17 01:56:41 +Vst= 31.1 + +31 01:56:47 01:57:22 +Rom_sol= 11.1 + +32 01:57:48 01:58:24 +Imax=11.0 Umax=50.1 T= 8.9 + +33 01:58:29 01:58:55 +Imin=16.0 Umin=25.0 T= 0.5 + +34 01:58:58 01:59:21 +V=300.4 T= 9.4 + +35 01:59:25 02:00:20 +Q= 54.9 T= 9.4 + +36 02:00:23 02:00:56 +P1=0.29 T= 3.0 + +37 02:00:59 02:01:23 +T= 1.0 + +38 02:01:26 02:01:33 +t= 51.9 T= 0.5 + +39 02:01:37 02:01:43 +t= 51.7 T= 0.6 + +40 02:01:47 02:01:54 +t= 51.8 T= 0.6 + +21 22:19:01 22:19:04 +Rsk= 14.0 Rkk= 13.4 + +22 22:58:25 23:13:53 +P1= 44.2 T1=23:08:53 P2= 59.2 T2=23:13:53 Vs= 3.00 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.343 new file mode 100644 index 0000000..51f4fc7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.343 @@ -0,0 +1,12 @@ +1 00:05:48 1594235148 +8 00:56:56 1594238216 +25 01:56:14 1594241774 +9 02:02:09 1594242129 +10 02:45:40 1594244740 +11 06:42:35 1594258955 +12 09:29:40 1594268980 +13 13:44:03 1594284243 +0 13:44:03 1594284243 +2 22:11:25 1594314685 +5 23:14:52 1594318492 +6 23:26:20 1594319180 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.344 new file mode 100644 index 0000000..e6b85e3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.346 new file mode 100644 index 0000000..2da56b2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.346 @@ -0,0 +1,68 @@ +[19] +oper = 1 +begin = 09.07.2020 00:05:48 +norma = 85 +real = 51 + +[20] +oper = 8 +begin = 09.07.2020 00:56:56 +norma = 40 +vac_time = 7 +real = 59 + +[21] +oper = 25 +begin = 09.07.2020 01:56:14 +norma = 30 +real = 5 + +[22] +oper = 9 +begin = 09.07.2020 02:02:09 +norma = 0 +real = 43 + +[23] +oper = 10 +begin = 09.07.2020 02:45:40 +norma = 0 +real = 236 + +[24] +oper = 11 +begin = 09.07.2020 06:42:35 +norma = 0 +real = 167 + +[25] +oper = 12 +begin = 09.07.2020 09:29:40 +norma = 105 +real = 254 + +[26] +oper = 13 +begin = 09.07.2020 13:44:03 +norma = 45 +real = 507 + +[27] +oper = 2 +begin = 09.07.2020 22:11:25 +norma = 110 +vac_time = 8 +real = 63 + +[28] +oper = 5 +begin = 09.07.2020 23:14:52 +norma = 25 +real = 11 + +[29] +oper = 6 +begin = 09.07.2020 23:26:20 +norma = 35 +real = 45 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.347 new file mode 100644 index 0000000..3d3cbde --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.347 @@ -0,0 +1,20 @@ +01:55:28 1594241728 祭 ॣ '-2'(A) +01:56:07 1594241767 ⪫祭 ॣ '-2'(A) +02:02:48 1594242168 祭 ० ࠧ +02:02:51 1594242171 祭 ० ' ⮪ 㣨' +02:28:34 1594243714 祭 ॣ '-2'(A) +02:45:40 1594244740 祭 ⠭ ॣ +02:45:40 1594244740 ⪫祭 ० ࠧ (A) +06:42:34 1594258954 祭 ० +06:42:35 1594258955 ⪫祭 ॣ '-2'(A) +06:42:36 1594258956 祭 ॣ '-2'(A) +08:34:35 1594265675 ⪫祭 ॣ '-2'(A) +09:29:33 1594268973 ⪫祭 ० (A) +09:29:42 1594268982 ⪫祭 ० ' ⮪ 㣨' +09:30:25 1594269025 祭 ० ᪠ +09:33:59 1594269239 ⪫祭 ० ᪠ (A) +09:52:28 1594270348 祭 ० ᪠ +09:52:28 1594270348 ⪫祭 ० ᪠ (A) +23:26:55 1594319215 祭 ० ᪠ +23:26:55 1594319215 祭 ० ᪠ +23:29:27 1594319367 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.349 new file mode 100644 index 0000000..d52f40a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.350 new file mode 100644 index 0000000..f3ff6b3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.350 @@ -0,0 +1,6 @@ +01:24:57 1594239897 1 09570 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 770 8 4640 9 3770 10 670 11 12 321692 +01:58:39 1594241919 0 A--32-006-2018 ॢ 4 +09:20:28 1594268428 3 14 +18:34:44 1594301684 1 09571 3 17 7 670 9 2900 10 560 +22:45:58 1594316758 4 1 +22:53:29 1594317209 1 09571 2 p. cao M1,M2,M3,M4 3 17 4 1 5 Ti 6 7 670 8 4640 9 2900 10 560 11 12 321692 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.351 new file mode 100644 index 0000000..5a48de3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.352 new file mode 100644 index 0000000..56abef6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.352 @@ -0,0 +1,117 @@ +20 00:20:45 00:20:53 +Riz_sol= 6501.6 + +21 00:21:04 00:21:07 +Rsk= 14.7 Rkk= 12.0 + +22 00:58:25 01:13:55 +P1= 38.9 T1=01:08:55 P2= 51.3 T2=01:13:55 Vs= 2.47 + +23 01:14:43 01:14:48 + + +24 01:14:58 01:15:35 + + +30 01:16:08 01:16:37 +Vst= 28.2 + +31 01:16:48 01:17:21 +Rom_sol= 8.8 + +41 01:17:56 01:18:01 +Ukz= 0.91 + +32 01:18:06 01:18:41 +Imax=27.3 Umax=55.0 T= 9.0 + +33 01:18:46 01:19:04 +Imin=16.2 Umin=25.0 T= 0.5 + +34 01:19:10 01:19:33 +V=300.2 T= 9.5 + +35 01:19:36 01:20:47 +Q= 54.1 T=12.5 + +36 01:20:54 01:21:31 +P1=0.29 T= 3.0 + +37 01:22:54 01:23:18 +T= 1.0 + +38 01:23:23 01:23:31 +t= 52.1 T= 0.8 + +39 01:23:40 01:23:56 +tcam= 54.4 Tcam= 0.8 tfl= 53.1 Tfl= 0.8 + +40 01:24:01 01:24:07 +t= 55.7 T= 0.8 + +21 09:21:23 09:21:26 +Rsk= 14.3 Rkk= 11.5 + +22 09:40:20 09:55:50 +P1= 88.7 T1=09:50:50 P2=111.7 T2=09:55:50 Vs= 4.60 + +21 18:33:23 18:33:26 +Rsk= 14.5 Rkk= 11.8 + +22 19:18:31 19:34:02 +P1= 62.7 T1=19:29:02 P2= 85.0 T2=19:34:02 Vs= 4.46 + +22 19:49:45 20:05:15 +P1= 46.3 T1=20:00:15 P2= 63.0 T2=20:05:15 Vs= 3.34 + +22 20:19:40 20:35:11 +P1= 38.6 T1=20:30:11 P2= 52.7 T2=20:35:11 Vs= 2.83 + +20 21:45:58 21:46:07 +Riz_sol= 1605.0 + +21 21:46:14 21:46:17 +Rsk= 14.4 Rkk= 11.6 + +22 22:29:57 22:45:27 +P1= 43.1 T1=22:40:27 P2= 57.6 T2=22:45:27 Vs= 2.91 + +23 22:45:40 22:45:45 + + +24 22:46:08 22:46:47 + + +30 22:47:10 22:47:33 +Vst= 28.4 + +31 22:47:40 22:48:13 +Rom_sol= 9.1 + +32 22:48:40 22:49:15 +Imax=11.3 Umax=50.0 T= 9.0 + +33 22:49:21 22:49:39 +Imin=16.2 Umin=25.0 T= 0.5 + +34 22:49:43 22:50:06 +V=300.2 T= 9.5 + +35 22:50:10 22:51:09 +Q= 53.1 T= 9.5 + +36 22:51:13 22:51:49 +P1=0.29 T= 3.0 + +37 22:51:53 22:52:17 +T= 1.0 + +38 22:52:21 22:52:26 +t= 52.2 T= 0.8 + +39 22:52:30 22:52:44 +tcam= 54.2 Tcam= 0.8 tfl= 52.9 Tfl= 0.8 + +40 22:52:48 22:52:53 +t= 55.4 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.353 new file mode 100644 index 0000000..ed6ceb9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.353 @@ -0,0 +1,20 @@ +8 00:14:25 1594235665 +25 01:16:04 1594239364 +9 01:24:57 1594239897 +10 01:58:39 1594241919 +11 03:39:20 1594247960 +12 06:28:24 1594258104 +13 08:16:51 1594264611 +0 08:16:51 1594264611 +14 09:20:54 1594268454 +15 09:59:43 1594270783 +16 10:31:27 1594272687 +1 10:59:20 1594274360 +2 18:30:29 1594301429 +5 20:36:35 1594308995 +6 20:47:57 1594309677 +7 21:28:23 1594312103 +8 21:45:32 1594313132 +25 22:47:06 1594316826 +9 22:53:29 1594317209 +10 23:16:02 1594318562 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.354 new file mode 100644 index 0000000..dd26177 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.355 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.355 new file mode 100644 index 0000000..395333b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.355 @@ -0,0 +1 @@ +47 01:21:38 1594239698 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.356 new file mode 100644 index 0000000..e0e560b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.356 @@ -0,0 +1,119 @@ +[75] +oper = 8 +begin = 09.07.2020 00:14:25 +norma = 40 +vac_time = 7 +real = 61 + +[76] +oper = 25 +begin = 09.07.2020 01:16:04 +norma = 30 +real = 8 + +[77] +oper = 9 +begin = 09.07.2020 01:24:57 +norma = 0 +real = 33 + +[78] +oper = 10 +begin = 09.07.2020 01:58:39 +norma = 0 +real = 100 + +[79] +oper = 11 +begin = 09.07.2020 03:39:20 +norma = 0 +real = 169 + +[80] +oper = 12 +begin = 09.07.2020 06:28:24 +norma = 105 +real = 108 + +[81] +oper = 13 +begin = 09.07.2020 08:16:51 +norma = 45 +real = 64 + +[82] +oper = 14 +begin = 09.07.2020 09:20:54 +norma = 40 +vac_time = 6 +real = 38 + +[83] +oper = 15 +begin = 09.07.2020 09:59:43 +norma = 30 +real = 31 + +[84] +oper = 16 +begin = 09.07.2020 10:31:27 +norma = 40 +real = 27 + +[85] +oper = 1 +begin = 09.07.2020 10:59:20 +norma = 85 +real = 451 + +[86] +oper = 2 +begin = 09.07.2020 18:30:29 +norma = 110 +vac_time = 8 +real = 126 + +[87] +oper = 5 +begin = 09.07.2020 20:36:35 +norma = 25 +real = 11 + +[88] +oper = 6 +begin = 09.07.2020 20:47:57 +norma = 35 +real = 40 + +[89] +oper = 7 +begin = 09.07.2020 21:28:23 +norma = 30 +real = 17 + +[90] +oper = 8 +begin = 09.07.2020 21:45:32 +norma = 40 +vac_time = 6 +vac_avg10 = 6.5 +real = 61 + +[91] +oper = 25 +begin = 09.07.2020 22:47:06 +norma = 30 +real = 6 + +[92] +oper = 9 +begin = 09.07.2020 22:53:29 +norma = 0 +real = 22 + +[93] +oper = 10 +begin = 09.07.2020 23:16:02 +norma = 0 +real = 128 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.357 new file mode 100644 index 0000000..e9b9fbe --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.357 @@ -0,0 +1,35 @@ +01:15:01 1594239301 祭 ॣ '-2'(A) +01:15:36 1594239336 ⪫祭 ॣ '-2'(A) +01:24:24 1594239864 祭 ० ࠧ +01:24:26 1594239866 祭 ० ' ⮪ 㣨' +01:44:40 1594241080 祭 ॣ '-2'(A) +01:58:39 1594241919 ⪫祭 ० ࠧ (A) +01:58:39 1594241919 祭 ⠭ ॣ +03:39:19 1594247959 祭 ० +03:39:20 1594247960 ⪫祭 ॣ '-2'(A) +03:39:21 1594247961 祭 ॣ '-2'(A) +04:41:20 1594251680 ⪫祭 ॣ '-2'(A) +06:28:22 1594258102 ⪫祭 ० (A) +06:28:24 1594258104 ⪫祭 ० ' ⮪ 㣨' +06:29:00 1594258140 祭 ० ᪠ +06:29:01 1594258141 祭 ० ᪠ +06:29:01 1594258141 祭 ० ᪠ +06:29:01 1594258141 祭 ० ᪠ +06:32:31 1594258351 ⪫祭 ० ᪠ (A) +09:59:26 1594270766 祭 ० ࠧ +09:59:27 1594270767 祭 ० ' ⮪ 㣨' +10:00:30 1594270830 祭 ॣ '-2'(A) +10:29:43 1594272583 ⪫祭 ० ' ⮪ 㣨' +10:30:03 1594272603 ⪫祭 ० ࠧ (A) +10:31:30 1594272690 ⪫祭 ॣ '-2'(A) +10:32:06 1594272726 祭 ० ᪠ +10:32:06 1594272726 祭 ० ᪠ +10:32:06 1594272726 祭 ० ᪠ +10:32:07 1594272727 祭 ० ᪠ +10:34:35 1594272875 ⪫祭 ० ᪠ (A) +20:49:32 1594309772 祭 ० ᪠ +20:52:39 1594309959 ⪫祭 ० ᪠ (A) +22:46:10 1594316770 祭 ॣ '-2'(A) +22:46:48 1594316808 ⪫祭 ॣ '-2'(A) +23:12:08 1594318328 祭 ॣ '-2' +23:16:33 1594318593 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.359 new file mode 100644 index 0000000..e24f760 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.360 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.360 new file mode 100644 index 0000000..6f5fe6e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.360 @@ -0,0 +1,3 @@ +11:18:18 1594275498 1 10790 2 BT 18, 20, 22, 23, 25 3 25 4 1 5 Ti 6 7 670 8 4280 9 4080 10 560 11 12 320801 +11:47:38 1594277258 0 A--32-106-2018 ॢ 2 +21:22:03 1594311723 1 10791 2 BT 3-1, 6, 8, 9, 14, 15, 16 8 4460 9 4170 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.361 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.361 new file mode 100644 index 0000000..2f2ddb8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.361 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.362 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.362 new file mode 100644 index 0000000..09a0ce8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.362 @@ -0,0 +1,66 @@ +31 09:42:25 09:43:10 +Rom_sol= 9.7 + +20 09:50:23 09:50:31 +Riz_sol= 7179.5 + +21 09:50:38 09:50:41 +Rsk= 12.9 Rkk= 9.4 + +22 10:26:30 10:42:02 +P1= 60.4 T1=10:37:02 P2= 76.1 T2=10:42:02 Vs= 3.14 + +22 10:54:08 11:09:41 +P1= 51.9 T1=11:04:41 P2= 64.6 T2=11:09:41 Vs= 2.55 + +23 11:10:06 11:10:11 + + +24 11:10:26 11:11:01 + + +30 11:11:20 11:11:45 +Vst= 28.9 + +31 11:11:49 11:12:22 +Rom_sol= 9.8 + +41 11:12:46 11:12:51 +Ukz= 1.99 + +32 11:12:54 11:13:30 +Imax=11.0 Umax=50.0 T= 9.0 + +33 11:13:33 11:13:53 +Imin=16.1 Umin=25.0 T= 0.5 + +34 11:13:56 11:14:20 +V=300.2 T= 9.5 + +35 11:14:23 11:15:44 +Q= 54.3 T=12.4 + +36 11:15:47 11:16:21 +P1=0.29 T= 3.0 + +37 11:16:28 11:16:44 +T= 1.0 + +38 11:16:47 11:16:56 +t= 51.2 T= 0.6 + +39 11:17:00 11:17:10 +t= 53.4 T= 0.6 + +40 11:17:13 11:17:21 +t= 53.4 T= 0.6 + +21 21:20:43 21:20:46 +Rsk= 12.7 Rkk= 9.2 + +22 22:29:45 22:45:18 +P1= 60.6 T1=22:40:17 P2= 76.5 T2=22:45:18 Vs= 3.18 + +22 23:04:34 23:20:07 +P1= 50.6 T1=23:15:07 P2= 63.2 T2=23:20:07 Vs= 2.51 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.363 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.363 new file mode 100644 index 0000000..85dff4c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.363 @@ -0,0 +1,11 @@ +13 00:28:25 1594236505 +8 09:48:55 1594270135 +25 11:11:16 1594275076 +9 11:18:18 1594275498 +10 11:47:38 1594277258 +12 15:08:38 1594289318 +13 18:10:49 1594300249 +0 18:10:49 1594300249 +2 21:15:13 1594311313 +5 23:21:35 1594318895 +6 23:33:02 1594319582 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.364 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.364 new file mode 100644 index 0000000..ee04ea2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.364 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.366 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.366 new file mode 100644 index 0000000..5cfc8b8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.366 @@ -0,0 +1,62 @@ +[88] +oper = 13 +begin = 09.07.2020 00:28:25 +norma = 45 +real = 560 + +[89] +oper = 8 +begin = 09.07.2020 09:48:55 +norma = 40 +vac_time = 6 +real = 82 + +[90] +oper = 25 +begin = 09.07.2020 11:11:16 +norma = 30 +real = 7 + +[91] +oper = 9 +begin = 09.07.2020 11:18:18 +norma = 0 +real = 29 + +[92] +oper = 10 +begin = 09.07.2020 11:47:38 +norma = 0 +real = 201 + +[93] +oper = 12 +begin = 09.07.2020 15:08:38 +norma = 105 +real = 182 + +[94] +oper = 13 +begin = 09.07.2020 18:10:49 +norma = 45 +real = 184 + +[95] +oper = 2 +begin = 09.07.2020 21:15:13 +norma = 110 +vac_time = 9 +real = 126 + +[96] +oper = 5 +begin = 09.07.2020 23:21:35 +norma = 25 +real = 11 + +[97] +oper = 6 +begin = 09.07.2020 23:33:02 +norma = 35 +real = 57 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.367 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.367 new file mode 100644 index 0000000..0a52a3a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.367 @@ -0,0 +1,13 @@ +11:10:27 1594275027 祭 ॣ '-2'(A) +11:11:02 1594275062 ⪫祭 ॣ '-2'(A) +11:18:00 1594275480 祭 ० ࠧ +11:18:01 1594275481 祭 ० ' ⮪ 㣨' +11:19:39 1594275579 祭 ॣ '-2'(A) +11:47:38 1594277258 祭 ⠭ ॣ +11:47:38 1594277258 ⪫祭 ० ࠧ (A) +15:00:12 1594288812 祭 ० +15:00:13 1594288813 ⪫祭 ॣ '-2'(A) +15:00:14 1594288814 祭 ॣ '-2'(A) +15:01:53 1594288913 ⪫祭 ० ' ⮪ 㣨' +15:08:42 1594289322 ⪫祭 ॣ '-2'(A) +16:10:12 1594293012 ⪫祭 ० (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.369 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.369 new file mode 100644 index 0000000..2641949 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.369 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.370 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.370 new file mode 100644 index 0000000..93c12b4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.370 @@ -0,0 +1,6 @@ +01:28:17 1594240097 1 06587 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 4740 9 3250 10 495 11 12 321730 +01:53:55 1594241635 0 A--32-090-2018 ॢ 2 +11:52:29 1594277549 1 06588 +15:28:43 1594290523 1 06588 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 4740 9 3250 10 495 11 12 321730 +15:54:02 1594292042 0 A--32-090-2018 ॢ 2 +22:48:57 1594316937 1 06589 2 OT-4 9 4350 10 560 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.371 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.371 new file mode 100644 index 0000000..db7c482 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.371 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.372 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.372 new file mode 100644 index 0000000..48a8872 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.372 @@ -0,0 +1,114 @@ +20 00:21:33 00:21:42 +Riz_sol= 134.2 + +21 00:21:50 00:21:54 +Rsk= 13.1 Rkk= 8.6 + +22 01:04:09 01:19:14 +P1= 42.6 T1=01:14:14 P2= 55.8 T2=01:19:14 Vs= 2.63 + +23 01:19:40 01:19:45 + + +24 01:19:51 01:20:27 + + +30 01:20:46 01:21:15 +Vst= 28.8 + +31 01:21:20 01:21:55 +Rom_sol= 10.5 + +41 01:22:28 01:22:33 +Ukz= 1.85 + +32 01:22:36 01:23:11 +Imax=10.9 Umax=50.0 T= 9.0 + +33 01:23:17 01:23:36 +Imin=15.9 Umin=24.9 T= 0.5 + +34 01:23:41 01:24:04 +V=300.0 T= 9.4 + +35 01:24:09 01:25:14 +Q= 54.2 T= 9.4 + +36 01:25:21 01:25:58 +P1=0.29 T= 2.9 + +37 01:26:03 01:26:35 +T= 0.9 + +38 01:26:39 01:26:45 +t= 57.1 T= 0.5 + +39 01:26:50 01:27:05 +tcam= 51.2 Tcam= 0.5 tfl= 58.4 Tfl= 0.5 + +40 01:27:10 01:27:17 +t= 54.7 T= 0.5 + +21 11:53:23 11:53:27 +Rsk= 13.4 Rkk= 8.9 + +22 12:59:14 13:14:18 +P1= 44.6 T1=13:09:18 P2= 58.3 T2=13:14:18 Vs= 2.74 + +20 14:35:48 14:35:56 +Riz_sol= 101.5 + +21 14:36:11 14:36:14 +Rsk= 8.5 Rkk= 8.6 + +22 15:02:40 15:17:45 +P1= 54.3 T1=15:12:45 P2= 69.2 T2=15:17:45 Vs= 2.98 + +23 15:19:08 15:19:14 + + +24 15:19:53 15:20:29 + + +30 15:21:05 15:21:38 +Vst= 28.4 + +31 15:22:06 15:22:39 +Rom_sol= 9.9 + +41 15:23:08 15:23:13 +Ukz= 1.96 + +32 15:23:16 15:23:51 +Imax=10.9 Umax=50.0 T= 9.0 + +33 15:23:56 15:24:14 +Imin=15.9 Umin=24.9 T= 0.5 + +34 15:24:18 15:24:41 +V=300.0 T= 9.4 + +35 15:24:44 15:25:55 +Q= 54.2 T= 9.4 + +36 15:26:00 15:26:37 +P1=0.29 T= 2.9 + +37 15:26:41 15:27:12 +T= 0.9 + +38 15:27:15 15:27:23 +t= 53.3 T= 0.5 + +39 15:27:26 15:27:42 +tcam= 52.1 Tcam= 0.5 tfl= 59.1 Tfl= 0.5 + +40 15:27:47 15:27:54 +t= 53.4 T= 0.5 + +21 22:49:05 22:49:08 +Rsk= 12.9 Rkk= 8.3 + +22 23:25:33 23:40:38 +P1= 55.0 T1=23:35:38 P2= 69.9 T2=23:40:38 Vs= 2.97 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.373 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.373 new file mode 100644 index 0000000..738fb5c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.373 @@ -0,0 +1,21 @@ +8 00:19:57 1594235997 +25 01:20:43 1594239643 +9 01:28:17 1594240097 +10 01:53:56 1594241636 +12 04:31:02 1594251062 +13 07:40:49 1594262449 +0 07:40:49 1594262449 +2 11:41:38 1594276898 +5 13:19:18 1594282758 +6 13:29:54 1594283394 +7 14:19:08 1594286348 +8 14:33:11 1594287191 +25 15:21:02 1594290062 +9 15:28:43 1594290523 +10 15:54:02 1594292042 +12 18:31:01 1594301461 +13 21:35:26 1594312526 +0 21:35:26 1594312526 +2 22:40:09 1594316409 +5 23:41:49 1594320109 +6 23:52:44 1594320764 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.374 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.374 new file mode 100644 index 0000000..cdfccd2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.374 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.375 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.375 new file mode 100644 index 0000000..67cd0b5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.375 @@ -0,0 +1 @@ +102 12:31:35 1594279895 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.376 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.376 new file mode 100644 index 0000000..47fb4bc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.376 @@ -0,0 +1,119 @@ +[88] +oper = 8 +begin = 09.07.2020 00:19:57 +norma = 40 +vac_time = 8 +real = 60 + +[89] +oper = 25 +begin = 09.07.2020 01:20:43 +norma = 30 +real = 7 + +[90] +oper = 9 +begin = 09.07.2020 01:28:17 +norma = 0 +real = 25 + +[91] +oper = 10 +begin = 09.07.2020 01:53:56 +norma = 0 +real = 157 + +[92] +oper = 12 +begin = 09.07.2020 04:31:02 +norma = 105 +real = 189 + +[93] +oper = 13 +begin = 09.07.2020 07:40:49 +norma = 45 +real = 240 + +[94] +oper = 2 +begin = 09.07.2020 11:41:38 +norma = 110 +vac_time = 12 +real = 97 + +[95] +oper = 5 +begin = 09.07.2020 13:19:18 +norma = 25 +real = 10 + +[96] +oper = 6 +begin = 09.07.2020 13:29:54 +norma = 35 +real = 49 + +[97] +oper = 7 +begin = 09.07.2020 14:19:08 +norma = 30 +real = 14 + +[98] +oper = 8 +begin = 09.07.2020 14:33:11 +norma = 40 +vac_time = 8 +vac_avg10 = 9.0 +real = 47 + +[99] +oper = 25 +begin = 09.07.2020 15:21:02 +norma = 30 +real = 7 + +[00] +oper = 9 +begin = 09.07.2020 15:28:43 +norma = 0 +real = 25 + +[01] +oper = 10 +begin = 09.07.2020 15:54:02 +norma = 0 +real = 156 + +[02] +oper = 12 +begin = 09.07.2020 18:31:01 +norma = 105 +real = 184 + +[03] +oper = 13 +begin = 09.07.2020 21:35:26 +norma = 45 +real = 64 + +[04] +oper = 2 +begin = 09.07.2020 22:40:09 +norma = 110 +vac_time = 9 +real = 61 + +[05] +oper = 5 +begin = 09.07.2020 23:41:49 +norma = 25 +real = 10 + +[06] +oper = 6 +begin = 09.07.2020 23:52:44 +norma = 35 +real = 39 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.377 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.377 new file mode 100644 index 0000000..b074b3e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.377 @@ -0,0 +1,35 @@ +01:19:52 1594239592 祭 ॣ '-2'(A) +01:20:28 1594239628 ⪫祭 ॣ '-2'(A) +01:27:30 1594240050 祭 ० ࠧ +01:27:32 1594240052 祭 ० ' ⮪ 㣨' +01:29:56 1594240196 祭 ॣ '-2'(A) +01:53:55 1594241635 祭 ⠭ ॣ +01:53:55 1594241635 ⪫祭 ० ࠧ (A) +04:20:07 1594250407 祭 ० +04:20:08 1594250408 ⪫祭 ॣ '-2'(A) +04:20:09 1594250409 祭 ॣ '-2'(A) +04:21:32 1594250492 ⪫祭 ० ' ⮪ 㣨' +04:31:05 1594251065 ⪫祭 ॣ '-2'(A) +04:31:15 1594251075 祭 ० ᪠ +04:31:16 1594251076 祭 ० ᪠ +04:33:56 1594251236 ⪫祭 ० ᪠ (A) +05:30:08 1594254608 ⪫祭 ० (A) +13:30:18 1594283418 祭 ० ᪠ +13:32:55 1594283575 ⪫祭 ० ᪠ (A) +15:19:55 1594289995 祭 ॣ '-2'(A) +15:20:29 1594290029 ⪫祭 ॣ '-2'(A) +15:28:04 1594290484 祭 ० ࠧ +15:28:09 1594290489 祭 ० ' ⮪ 㣨' +15:30:03 1594290603 祭 ॣ '-2'(A) +15:54:02 1594292042 祭 ⠭ ॣ +15:54:02 1594292042 ⪫祭 ० ࠧ (A) +18:20:33 1594300833 祭 ० +18:20:34 1594300834 ⪫祭 ॣ '-2'(A) +18:20:35 1594300835 祭 ॣ '-2'(A) +18:31:02 1594301462 ⪫祭 ० ' ⮪ 㣨' +18:31:05 1594301465 ⪫祭 ॣ '-2'(A) +18:31:45 1594301505 祭 ० ᪠ +18:34:19 1594301659 ⪫祭 ० ᪠ (A) +19:30:34 1594305034 ⪫祭 ० (A) +23:52:59 1594320779 祭 ० ᪠ +23:55:34 1594320934 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.379 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.379 new file mode 100644 index 0000000..cc3d14b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.379 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.390 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.390 new file mode 100644 index 0000000..eb94f28 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.390 @@ -0,0 +1,4 @@ +06:05:54 1594256754 3 14 +18:28:54 1594301334 1 09429 2 BT 18, 20, 22, 23, 25 3 25 7 705 9 4310 10 560 +21:59:10 1594313950 1 09429 2 BT 18, 20, 22, 23, 25 3 25 4 1 5 Ti 6 7 705 8 4900 9 4310 10 560 11 12 321021 +22:29:36 1594315776 0 A--32-116-2018 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.391 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.391 new file mode 100644 index 0000000..0692212 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.391 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.392 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.392 new file mode 100644 index 0000000..1046ec7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.392 @@ -0,0 +1,69 @@ +21 06:06:05 06:06:12 +Rsk= 19.4 Rkk= 14.0 + +21 06:11:03 06:11:11 +Rsk= 19.4 Rkk= 14.0 + +22 06:34:32 06:44:39 +P1= 58.6 T1=06:39:39 P2= 67.9 T2=06:44:39 Vs= 1.86 + +21 18:29:17 18:29:25 +Rsk= 15.9 Rkk= 10.7 + +22 19:09:57 19:25:05 +P1= 89.5 T1=19:20:05 P2=107.6 T2=19:25:05 Vs= 3.63 + +22 19:34:57 19:50:05 +P1= 78.9 T1=19:45:05 P2= 92.2 T2=19:50:05 Vs= 2.66 + +20 20:52:57 20:53:08 +Riz_sol= 299.7 + +21 20:53:20 20:53:27 +Rsk= 19.3 Rkk= 13.9 + +22 21:30:16 21:45:23 +P1= 77.5 T1=21:40:23 P2= 89.9 T2=21:45:23 Vs= 2.49 + +23 21:50:17 21:50:23 + + +24 21:50:31 21:51:08 + + +30 21:51:26 21:52:03 +Vst= 27.2 + +31 21:52:16 21:52:54 +Rom_sol= 15.4 + +41 21:53:21 21:53:26 +Ukz= 1.49 + +32 21:53:32 21:54:40 +Imax=11.1 Umax=50.0 T= 9.4 + +33 21:54:45 21:55:16 +Imin=16.3 Umin=25.1 T= 2.3 + +34 21:55:21 21:55:48 +V=301.4 T= 9.5 + +35 21:55:51 21:56:44 +Q= 54.9 T= 9.2 + +36 21:56:49 21:57:22 +P1=0.30 T= 3.1 + +37 21:57:27 21:57:55 +T= 0.7 + +38 21:58:00 21:58:06 +t= 51.5 T= 0.7 + +39 21:58:11 21:58:16 +t= 51.6 T= 0.5 + +40 21:58:20 21:58:26 +t= 51.6 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.393 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.393 new file mode 100644 index 0000000..f4372df --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.393 @@ -0,0 +1,15 @@ +12 02:29:07 1594243747 +13 05:38:00 1594255080 +0 05:38:00 1594255080 +14 06:03:09 1594256589 +15 06:54:10 1594259650 +16 07:11:27 1594260687 +1 08:17:53 1594264673 +2 18:24:43 1594301083 +5 19:50:54 1594306254 +6 20:04:04 1594307044 +7 20:38:34 1594309114 +8 20:52:35 1594309955 +25 21:51:20 1594313480 +9 21:59:10 1594313950 +10 22:29:37 1594315777 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.394 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.394 new file mode 100644 index 0000000..a2a3d86 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.394 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.396 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.396 new file mode 100644 index 0000000..2650e14 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.396 @@ -0,0 +1,87 @@ +[49] +oper = 12 +begin = 09.07.2020 02:29:07 +norma = 105 +real = 188 + +[50] +oper = 13 +begin = 09.07.2020 05:38:00 +norma = 45 +real = 25 + +[51] +oper = 14 +begin = 09.07.2020 06:03:09 +norma = 40 +vac_time = 8 +real = 51 + +[52] +oper = 15 +begin = 09.07.2020 06:54:10 +norma = 30 +real = 17 + +[53] +oper = 16 +begin = 09.07.2020 07:11:27 +norma = 40 +real = 66 + +[54] +oper = 1 +begin = 09.07.2020 08:17:53 +norma = 85 +real = 606 + +[55] +oper = 2 +begin = 09.07.2020 18:24:43 +norma = 110 +vac_time = 10 +real = 86 + +[56] +oper = 5 +begin = 09.07.2020 19:50:54 +norma = 25 +real = 13 + +[57] +oper = 6 +begin = 09.07.2020 20:04:04 +norma = 35 +real = 34 + +[58] +oper = 7 +begin = 09.07.2020 20:38:34 +norma = 30 +real = 14 + +[59] +oper = 8 +begin = 09.07.2020 20:52:35 +norma = 40 +vac_time = 8 +real = 58 + +[60] +oper = 25 +begin = 09.07.2020 21:51:20 +norma = 30 +real = 7 + +[61] +oper = 9 +begin = 09.07.2020 21:59:10 +norma = 0 +real = 30 + +[62] +oper = 10 +begin = 09.07.2020 22:29:37 +norma = 0 +real = 221 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.397 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.397 new file mode 100644 index 0000000..57716f1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.397 @@ -0,0 +1,26 @@ +02:12:37 1594242757 祭 ० +02:12:38 1594242758 ⪫祭 ॣ '-2'(A) +02:12:39 1594242759 祭 ॣ '-2'(A) +02:28:51 1594243731 ⪫祭 ० ' ⮪ 㣨' +02:28:56 1594243736 ⪫祭 ० +02:29:11 1594243751 ⪫祭 ॣ '-2'(A) +02:30:31 1594243831 祭 ० ᪠ +02:33:17 1594243997 ⪫祭 ० ᪠ (A) +06:54:08 1594259648 祭 ० ࠧ +06:54:11 1594259651 祭 ० ' ⮪ 㣨' +06:54:12 1594259652 祭 ॣ '-2'(A) +07:10:56 1594260656 ⪫祭 ० ' ⮪ 㣨' +07:11:14 1594260674 ⪫祭 ० ࠧ +07:11:31 1594260691 ⪫祭 ॣ '-2'(A) +07:11:53 1594260713 祭 ० ᪠ +07:11:53 1594260713 祭 ० ᪠ +07:14:36 1594260876 ⪫祭 ० ᪠ (A) +20:03:57 1594307037 祭 ० ᪠ +20:06:42 1594307202 ⪫祭 ० ᪠ (A) +21:50:34 1594313434 祭 ॣ '-2'(A) +21:51:09 1594313469 ⪫祭 ॣ '-2'(A) +21:58:37 1594313917 祭 ० ࠧ +21:58:39 1594313919 祭 ० ' ⮪ 㣨' +22:00:38 1594314038 祭 ॣ '-2'(A) +22:29:36 1594315776 祭 ⠭ ॣ +22:29:36 1594315776 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.399 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.399 new file mode 100644 index 0000000..94b3b00 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.399 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.410 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.410 new file mode 100644 index 0000000..3885bed --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.410 @@ -0,0 +1,6 @@ +00:57:40 1594238260 4 1 +13:58:39 1594285119 3 14 +17:49:38 1594298978 1 11454 3 10 9 5150 10 690 +18:54:26 1594302866 4 2 +19:01:13 1594303273 1 11454 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 10 4 2 5 Ti 6 7 770 8 3810 9 5150 10 690 11 12 320839 +19:56:01 1594306561 0 A--32-170-2018 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.411 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.411 new file mode 100644 index 0000000..e69d02d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.411 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.412 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.412 new file mode 100644 index 0000000..6c6d887 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.412 @@ -0,0 +1,60 @@ +21 13:59:07 13:59:10 +Rsk= 8.2 Rkk= 5.2 + +22 14:48:06 14:58:13 +P1= 33.6 T1=14:53:13 P2= 54.0 T2=14:58:13 Vs= 4.07 + +21 17:50:21 17:50:24 +Rsk= 36.8 Rkk= 34.0 + +20 17:56:17 17:56:25 +Riz_sol= 4756.9 + +22 18:36:29 18:51:36 +P1= 52.4 T1=18:46:36 P2= 64.1 T2=18:51:36 Vs= 2.34 + +23 18:51:48 18:51:55 + + +24 18:52:04 18:52:41 + + +30 18:52:53 18:53:19 +Vst= 32.1 + +31 18:53:26 18:54:03 +Rom_sol= 13.9 + +31 18:54:43 18:55:17 +Rom_sol= 12.7 + +41 18:55:48 18:55:53 +Ukz= 1.17 + +32 18:56:04 18:56:39 +Imax=11.0 Umax=50.0 T= 9.0 + +33 18:56:42 18:57:08 +Imin= 8.0 Umin=17.9 T= 3.0 + +34 18:57:11 18:57:35 +V=300.1 T= 9.5 + +35 18:57:38 18:58:55 +Q= 55.0 T= 9.4 + +36 18:58:58 18:59:32 +P1=0.29 T= 3.0 + +37 18:59:43 19:00:06 +T= 0.9 + +38 19:00:09 19:00:15 +t= 51.8 T= 0.6 + +39 19:00:19 19:00:34 +tcam= 53.0 Tcam= 0.5 tfl= 52.7 Tfl= 0.6 + +40 19:00:36 19:00:43 +t= 51.9 T= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.413 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.413 new file mode 100644 index 0000000..14d6c3c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.413 @@ -0,0 +1,11 @@ +12 03:50:03 1594248603 +13 08:30:40 1594265440 +0 08:30:40 1594265440 +14 13:34:54 1594283694 +15 14:59:47 1594288787 +16 15:20:52 1594290052 +1 15:55:19 1594292119 +8 17:42:41 1594298561 +25 18:52:50 1594302770 +9 19:01:13 1594303273 +10 19:46:02 1594305962 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.414 new file mode 100644 index 0000000..7149a6a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.415 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.415 new file mode 100644 index 0000000..608d827 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.415 @@ -0,0 +1 @@ +17 17:50:13 1594299013 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.416 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.416 new file mode 100644 index 0000000..099d1af --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.416 @@ -0,0 +1,62 @@ +[88] +oper = 12 +begin = 09.07.2020 03:50:03 +norma = 105 +real = 280 + +[89] +oper = 13 +begin = 09.07.2020 08:30:40 +norma = 45 +real = 304 + +[90] +oper = 14 +begin = 09.07.2020 13:34:54 +norma = 40 +vac_time = 28 +real = 84 + +[91] +oper = 15 +begin = 09.07.2020 14:59:47 +norma = 30 +real = 21 + +[92] +oper = 16 +begin = 09.07.2020 15:20:52 +norma = 40 +real = 34 + +[93] +oper = 1 +begin = 09.07.2020 15:55:19 +norma = 85 +real = 107 + +[94] +oper = 8 +begin = 09.07.2020 17:42:41 +norma = 40 +vac_time = 15 +real = 70 + +[95] +oper = 25 +begin = 09.07.2020 18:52:50 +norma = 30 +real = 8 + +[96] +oper = 9 +begin = 09.07.2020 19:01:13 +norma = 0 +real = 44 + +[97] +oper = 10 +begin = 09.07.2020 19:46:02 +norma = 0 +real = 964 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.417 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.417 new file mode 100644 index 0000000..758b5ae --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.417 @@ -0,0 +1,41 @@ +03:20:48 1594246848 祭 ० +03:20:49 1594246849 ⪫祭 ॣ '-2'(A) +03:20:50 1594246850 祭 ॣ '-2'(A) +03:50:05 1594248605 ⪫祭 ० ' ⮪ 㣨' +03:50:07 1594248607 ⪫祭 ॣ '-2'(A) +03:52:00 1594248720 祭 ० ᪠ +03:52:00 1594248720 祭 ० ᪠ +03:52:24 1594248744 ⪫祭 ० ᪠ +03:52:24 1594248744 ⪫祭 ० ᪠ +03:52:26 1594248746 祭 ० ᪠ +03:52:30 1594248750 ⪫祭 ० ᪠ +03:52:30 1594248750 ⪫祭 ० ᪠ +03:52:31 1594248751 祭 ० ᪠ +03:52:37 1594248757 ⪫祭 ० ᪠ +03:52:37 1594248757 ⪫祭 ० ᪠ +03:52:39 1594248759 祭 ० ᪠ +03:52:39 1594248759 祭 ० ᪠ +03:52:44 1594248764 ⪫祭 ० ᪠ +03:52:44 1594248764 ⪫祭 ० ᪠ +03:52:45 1594248765 祭 ० ᪠ +03:52:46 1594248766 祭 ० ᪠ +03:52:50 1594248770 ⪫祭 ० ᪠ (A) +04:30:48 1594251048 ⪫祭 ० (A) +14:59:10 1594288750 祭 ० ࠧ +14:59:12 1594288752 祭 ० ' ⮪ 㣨' +15:00:29 1594288829 祭 ॣ '-2'(A) +15:20:53 1594290053 ⪫祭 ० ' ⮪ 㣨' +15:20:56 1594290056 ⪫祭 ॣ '-2'(A) +15:21:01 1594290061 祭 ० ᪠ +15:21:01 1594290061 祭 ० ᪠ +15:21:02 1594290062 祭 ० ᪠ +15:21:35 1594290095 ⪫祭 ० ࠧ (A) +15:23:22 1594290202 ⪫祭 ० ᪠ (A) +18:52:06 1594302726 祭 ॣ '-2'(A) +18:52:41 1594302761 ⪫祭 ॣ '-2'(A) +19:00:54 1594303254 祭 ० ࠧ +19:00:56 1594303256 祭 ० ' ⮪ 㣨' +19:16:59 1594304219 祭 ॣ '-2'(A) +19:46:01 1594305961 ⪫祭 ० ࠧ (A) +19:46:02 1594305962 祭 ⠭ ॣ +19:56:01 1594306561 祭 ॣ ।. 60 ᥪ. 殮 㣨 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.419 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.419 new file mode 100644 index 0000000..7b7f337 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.419 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.420 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.420 new file mode 100644 index 0000000..0398159 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.420 @@ -0,0 +1,3 @@ +00:47:34 1594237654 2 p. cao M1,M2,M3,M4 +06:19:13 1594257553 1 09421 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 870 8 3200 9 6090 10 770 11 12 320242 +17:48:54 1594298934 3 14 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.421 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.421 new file mode 100644 index 0000000..1073bb2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.421 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.422 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.422 new file mode 100644 index 0000000..328bc68 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.422 @@ -0,0 +1,69 @@ +20 04:55:36 04:55:45 +Riz_sol= 159.5 + +21 04:55:54 04:55:57 +Rsk= 7.1 Rkk= 7.7 + +22 05:25:00 05:40:04 +P1= 56.2 T1=05:35:04 P2= 75.8 T2=05:40:04 Vs= 3.92 + +22 05:55:00 06:05:04 +P1= 19.6 T1=06:00:04 P2= 34.1 T2=06:05:04 Vs= 2.92 + +23 06:06:31 06:06:36 + + +24 06:06:45 06:07:24 + + +30 06:07:47 06:08:12 +Vst= 28.7 + +31 06:08:18 06:08:54 +Rom_sol= 14.3 + +32 06:10:12 06:10:48 +Imax=27.3 Umax=55.0 T= 9.0 + +33 06:10:52 06:11:19 +Imin=16.2 Umin=24.9 T= 0.5 + +34 06:11:23 06:11:46 +V=300.1 T= 9.6 + +35 06:11:50 06:12:55 +Q= 51.6 T= 9.5 + +36 06:12:59 06:13:38 +P1=0.28 T= 3.0 + +37 06:13:43 06:14:15 +T= 0.0 + +37 06:14:34 06:15:06 +T= 0.0 + +38 06:15:15 06:15:21 +t= 53.3 T= 0.8 + +39 06:15:26 06:15:41 +tcam= 51.4 Tcam= 0.8 tfl= 51.0 Tfl= 0.8 + +40 06:15:49 06:15:55 +t= 50.1 T= 0.8 + +37 06:16:00 06:16:32 +T= 0.0 + +37 06:16:53 06:17:42 +T= 1.0 + +21 17:48:11 17:48:14 +Rsk= 15.0 Rkk= 14.4 + +21 17:49:04 17:49:07 +Rsk= 15.1 Rkk= 14.4 + +21 21:43:21 21:43:24 +Rsk= 14.7 Rkk= 14.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.423 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.423 new file mode 100644 index 0000000..4deaa53 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.423 @@ -0,0 +1,12 @@ +7 02:45:24 1594244724 +8 04:48:06 1594252086 +25 06:07:44 1594256864 +9 06:19:13 1594257553 +10 06:56:15 1594259775 +11 09:58:05 1594270685 +12 13:20:05 1594282805 +13 15:39:24 1594291164 +0 15:39:24 1594291164 +14 17:42:58 1594298578 +1 21:27:19 1594312039 +14 21:41:33 1594312893 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.424 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.424 new file mode 100644 index 0000000..3143ec8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.424 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.425 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.425 new file mode 100644 index 0000000..95f624c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.425 @@ -0,0 +1,4 @@ +71 06:14:15 1594257255 +70 06:14:23 1594257263 +71 06:15:06 1594257306 +71 06:16:32 1594257392 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.426 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.426 new file mode 100644 index 0000000..446601d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.426 @@ -0,0 +1,70 @@ +[14] +oper = 7 +begin = 09.07.2020 02:45:24 +norma = 30 +real = 122 + +[15] +oper = 8 +begin = 09.07.2020 04:48:06 +norma = 40 +vac_time = 8 +vac_avg10 = 13.1 +real = 79 + +[16] +oper = 25 +begin = 09.07.2020 06:07:44 +norma = 30 +real = 11 + +[17] +oper = 9 +begin = 09.07.2020 06:19:13 +norma = 0 +real = 37 + +[18] +oper = 10 +begin = 09.07.2020 06:56:15 +norma = 0 +real = 181 + +[19] +oper = 11 +begin = 09.07.2020 09:58:05 +norma = 0 +real = 202 + +[20] +oper = 12 +begin = 09.07.2020 13:20:05 +norma = 105 +real = 139 + +[21] +oper = 13 +begin = 09.07.2020 15:39:24 +norma = 45 +real = 123 + +[22] +oper = 14 +begin = 09.07.2020 17:42:58 +norma = 40 +vac_time = 16 +real = 224 + +[23] +oper = 1 +begin = 09.07.2020 21:27:19 +norma = 85 +real = 14 + +[24] +oper = 14 +begin = 09.07.2020 21:41:33 +norma = 40 +vac_time = 7 +real = 165 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.427 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.427 new file mode 100644 index 0000000..11b8e6a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.427 @@ -0,0 +1,12 @@ +00:03:09 1594234989 ⪫祭 ० ᪠ (A) +06:06:48 1594256808 祭 ॣ '-2'(A) +06:07:25 1594256845 ⪫祭 ॣ '-2'(A) +06:53:51 1594259631 祭 ॣ '-2' +06:56:14 1594259774 祭 ⠭ ॣ +13:20:09 1594282809 ⪫祭 ॣ '-2'(A) +13:20:39 1594282839 祭 ० ᪠ +13:20:39 1594282839 祭 ० ᪠ +13:20:40 1594282840 祭 ० ᪠ +13:20:40 1594282840 祭 ० ᪠ +13:20:40 1594282840 祭 ० ᪠ +13:24:25 1594283065 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.429 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.429 new file mode 100644 index 0000000..a9eaad1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.429 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.440 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.440 new file mode 100644 index 0000000..e032170 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.440 @@ -0,0 +1,5 @@ +01:43:50 1594241030 1 09884 2 BT 18, 20, 22, 23, 25 3 25 4 1 5 Ti 6 7 770 8 4370 9 5120 10 650 11 12 1718 +02:17:04 1594243024 0 A--32-129-2018 ॢ 1 +19:12:32 1594303952 1 09885 2 BT 3-1, 6, 8, 9, 14, 15, 16 7 670 8 3930 9 3780 10 560 12 321021 +23:11:22 1594318282 1 09885 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 3930 9 3780 10 560 11 12 321021 +23:40:38 1594320038 0 A--32-106-2018 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.441 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.441 new file mode 100644 index 0000000..fb6d2a6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.441 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.442 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.442 new file mode 100644 index 0000000..69f5a71 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.442 @@ -0,0 +1,120 @@ +20 00:45:48 00:45:58 +Riz_sol= 212.1 + +21 00:46:46 00:46:54 +Rsk= 16.9 Rkk= 13.7 + +22 01:25:06 01:35:38 +P1= 33.6 T1=01:30:38 P2= 47.6 T2=01:35:38 Vs= 2.81 + +23 01:35:51 01:35:57 + + +24 01:36:03 01:36:38 + + +30 01:36:49 01:37:29 +Vst= 30.3 + +31 01:37:34 01:38:11 +Rom_sol= 14.7 + +41 01:38:42 01:38:47 +Ukz= 1.47 + +32 01:38:50 01:39:57 +Imax=11.4 Umax=49.9 T= 9.4 + +33 01:40:00 01:40:28 +Imin=16.6 Umin=25.1 T= 0.8 + +34 01:40:31 01:40:59 +V=301.4 T= 9.6 + +35 01:41:02 01:41:56 +Q= 54.9 T= 9.2 + +36 01:41:59 01:42:29 +P1=0.26 T= 3.0 + +37 01:42:33 01:43:01 +T= 0.7 + +38 01:43:04 01:43:10 +t= 51.9 T= 0.5 + +39 01:43:13 01:43:19 +t= 51.6 T= 0.7 + +40 01:43:25 01:43:31 +t= 52.1 T= 0.7 + +21 19:11:31 19:11:38 +Rsk= 16.2 Rkk= 13.2 + +22 20:20:06 20:35:39 +P1= 48.0 T1=20:30:39 P2= 62.8 T2=20:35:39 Vs= 2.97 + +20 21:51:19 21:51:29 +Riz_sol= 77.4 + +21 21:51:36 21:51:43 +Rsk= 16.2 Rkk= 13.2 + +22 22:20:59 22:36:33 +P1= 58.7 T1=22:31:33 P2= 75.8 T2=22:36:33 Vs= 3.43 + +22 22:44:43 23:00:16 +P1= 44.0 T1=22:55:16 P2= 56.3 T2=23:00:16 Vs= 2.46 + +23 23:00:48 23:00:54 + + +24 23:01:06 23:01:43 + + +30 23:01:53 23:02:39 +Vst= 30.3 + +31 23:02:48 23:03:26 +Rom_sol= 13.7 + +41 23:03:51 23:03:56 +Ukz= 1.29 + +32 23:04:43 23:05:49 +Imax=11.5 Umax=49.9 T= 9.4 + +33 23:05:53 23:06:19 +Imin=16.6 Umin=25.2 T= 1.7 + +33 23:06:23 23:06:49 +Imin=16.6 Umin=25.2 T= 1.7 + +33 23:06:55 23:07:21 +Imin=16.6 Umin=25.2 T= 1.7 + +33 23:07:33 23:08:00 +Imin=16.6 Umin=25.1 T= 0.8 + +34 23:08:04 23:08:32 +V=301.4 T= 9.6 + +35 23:08:35 23:09:28 +Q= 54.9 T= 9.1 + +36 23:09:30 23:10:02 +P1=0.29 T= 3.1 + +37 23:10:04 23:10:33 +T= 0.7 + +38 23:10:36 23:10:42 +t= 51.9 T= 0.5 + +39 23:10:44 23:10:50 +t= 51.6 T= 0.5 + +40 23:10:52 23:10:58 +t= 52.1 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.443 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.443 new file mode 100644 index 0000000..6d20bbd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.443 @@ -0,0 +1,16 @@ +7 00:27:31 1594236451 +8 00:43:06 1594237386 +25 01:36:46 1594240606 +9 01:43:50 1594241030 +10 02:17:05 1594243025 +12 06:34:22 1594258462 +13 10:57:22 1594274242 +0 10:57:23 1594274243 +2 19:08:42 1594303722 +5 20:37:27 1594309047 +6 20:47:50 1594309670 +7 21:29:22 1594312162 +8 21:46:38 1594313198 +25 23:01:50 1594317710 +9 23:11:22 1594318282 +10 23:40:38 1594320038 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.444 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.444 new file mode 100644 index 0000000..081936f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.444 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.445 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.445 new file mode 100644 index 0000000..77f7a3b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.445 @@ -0,0 +1,4 @@ +46 23:04:30 1594317870 +55 23:06:19 1594317979 +55 23:06:49 1594318009 +55 23:07:21 1594318041 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.446 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.446 new file mode 100644 index 0000000..2375a13 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.446 @@ -0,0 +1,94 @@ +[29] +oper = 7 +begin = 09.07.2020 00:27:31 +norma = 30 +real = 15 + +[30] +oper = 8 +begin = 09.07.2020 00:43:06 +norma = 40 +vac_time = 8 +real = 53 + +[31] +oper = 25 +begin = 09.07.2020 01:36:46 +norma = 30 +real = 7 + +[32] +oper = 9 +begin = 09.07.2020 01:43:50 +norma = 0 +real = 33 + +[33] +oper = 10 +begin = 09.07.2020 02:17:05 +norma = 0 +real = 257 + +[34] +oper = 12 +begin = 09.07.2020 06:34:22 +norma = 105 +real = 263 + +[35] +oper = 13 +begin = 09.07.2020 10:57:22 +norma = 45 +real = 491 + +[36] +oper = 2 +begin = 09.07.2020 19:08:42 +norma = 110 +vac_time = 9 +real = 88 + +[37] +oper = 5 +begin = 09.07.2020 20:37:27 +norma = 25 +real = 10 + +[38] +oper = 6 +begin = 09.07.2020 20:47:50 +norma = 35 +real = 41 + +[39] +oper = 7 +begin = 09.07.2020 21:29:22 +norma = 30 +real = 17 + +[40] +oper = 8 +begin = 09.07.2020 21:46:38 +norma = 40 +vac_time = 8 +vac_avg10 = 9.9 +real = 75 + +[41] +oper = 25 +begin = 09.07.2020 23:01:50 +norma = 30 +real = 9 + +[42] +oper = 9 +begin = 09.07.2020 23:11:22 +norma = 0 +real = 29 + +[43] +oper = 10 +begin = 09.07.2020 23:40:38 +norma = 0 +real = 185 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.447 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.447 new file mode 100644 index 0000000..c7b761d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.447 @@ -0,0 +1,26 @@ +01:36:04 1594240564 祭 ॣ '-2'(A) +01:36:39 1594240599 ⪫祭 ॣ '-2'(A) +01:43:38 1594241018 祭 ० ࠧ +01:43:41 1594241021 祭 ० ' ⮪ 㣨' +01:45:06 1594241106 祭 ॣ '-2'(A) +02:17:04 1594243024 ⪫祭 ० ࠧ (A) +02:17:04 1594243024 祭 ⠭ ॣ +06:24:21 1594257861 祭 ० +06:24:21 1594257861 ⪫祭 ॣ '-2'(A) +06:24:22 1594257862 祭 ॣ '-2'(A) +06:28:37 1594258117 ⪫祭 ० ' ⮪ 㣨' +06:29:09 1594258149 ⪫祭 ॣ '-2' +06:29:17 1594258157 祭 ॣ '-2' +06:34:26 1594258466 ⪫祭 ॣ '-2'(A) +06:34:40 1594258480 祭 ० ᪠ +06:38:01 1594258681 ⪫祭 ० ᪠ (A) +07:34:21 1594262061 ⪫祭 ० (A) +20:48:34 1594309714 祭 ० ᪠ +20:51:35 1594309895 ⪫祭 ० ᪠ (A) +23:01:08 1594317668 祭 ॣ '-2'(A) +23:01:44 1594317704 ⪫祭 ॣ '-2'(A) +23:11:07 1594318267 祭 ० ࠧ +23:11:09 1594318269 祭 ० ' ⮪ 㣨' +23:12:38 1594318358 祭 ॣ '-2'(A) +23:40:38 1594320038 ⪫祭 ० ࠧ (A) +23:40:38 1594320038 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.449 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.449 new file mode 100644 index 0000000..df89fa3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.449 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.450 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.450 new file mode 100644 index 0000000..f51523f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.450 @@ -0,0 +1,6 @@ +05:41:32 1594255292 1 11459 3 32 7 870 10 770 11 +07:11:48 1594260708 1 11460 +09:59:06 1594270746 4 2 +10:17:03 1594271823 3 37 11 +10:45:35 1594273535 1 11460 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 870 8 3000 9 6090 10 770 11 12 321731 +22:05:27 1594314327 1 11461 2 BT 18, 20, 22, 23, 25 3 25 9 5120 11 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.451 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.451 new file mode 100644 index 0000000..d061a8f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.451 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.452 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.452 new file mode 100644 index 0000000..af2430d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.452 @@ -0,0 +1,63 @@ +21 05:39:27 05:39:30 +Rsk= 15.6 Rkk= 11.9 + +22 06:59:53 07:09:58 +P1= 7.2 T1=07:04:58 P2= 20.9 T2=07:09:58 Vs= 2.75 + +20 09:36:02 09:36:11 +Riz_sol= 4854.9 + +21 09:36:16 09:36:19 +Rsk= 15.5 Rkk= 11.9 + +22 10:20:29 10:35:34 +P1= 38.6 T1=10:30:34 P2= 52.2 T2=10:35:34 Vs= 2.74 + +23 10:37:03 10:37:08 + + +24 10:37:15 10:37:53 + + +30 10:38:03 10:38:28 +Vst= 28.7 + +31 10:38:34 10:39:08 +Rom_sol= 14.6 + +32 10:39:49 10:40:25 +Imax=26.8 Umax=55.1 T= 9.0 + +33 10:40:27 10:40:55 +Imin=15.8 Umin=25.0 T= 0.5 + +34 05:00:00 10:41:19 +V=300.2 T= 8.7 + +34 10:41:24 10:41:48 +V=300.6 T= 9.4 + +35 10:41:50 10:43:03 +Q= 53.8 T=12.4 + +36 10:43:10 10:43:40 +P1=0.29 T= 2.9 + +37 10:43:42 10:44:14 +T= 0.9 + +38 10:44:17 10:44:24 +t= 51.6 T= 0.5 + +39 10:44:28 10:44:43 +tcam= 52.3 Tcam= 0.5 tfl= 52.5 Tfl= 0.5 + +40 10:44:46 10:44:53 +t= 51.6 T= 0.5 + +21 22:04:16 22:04:19 +Rsk= 15.4 Rkk= 12.0 + +22 22:36:21 22:51:26 +P1= 41.6 T1=22:46:26 P2= 56.3 T2=22:51:26 Vs= 2.95 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.453 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.453 new file mode 100644 index 0000000..985d2eb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.453 @@ -0,0 +1,19 @@ +13 04:01:05 1594249265 +0 04:01:05 1594249265 +2 05:34:06 1594254846 +5 07:13:40 1594260820 +6 07:24:16 1594261456 +7 08:11:03 1594264263 +13 09:09:36 1594267776 +8 09:33:44 1594269224 +25 10:38:01 1594273081 +9 10:45:35 1594273535 +10 11:22:02 1594275722 +11 14:14:29 1594286069 +12 17:35:03 1594298103 +13 19:42:01 1594305721 +0 19:42:01 1594305721 +2 21:58:59 1594313939 +5 22:52:15 1594317135 +6 23:04:20 1594317860 +7 23:44:02 1594320242 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.454 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.454 new file mode 100644 index 0000000..175885b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.454 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.455 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.455 new file mode 100644 index 0000000..9854731 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.455 @@ -0,0 +1 @@ +56 10:41:19 1594273279 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.456 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.456 new file mode 100644 index 0000000..e577fa6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.456 @@ -0,0 +1,105 @@ +[85] +oper = 13 +begin = 09.07.2020 04:01:05 +norma = 45 +real = 93 + +[86] +oper = 2 +begin = 09.07.2020 05:34:06 +norma = 110 +vac_time = 10 +real = 99 + +[87] +oper = 5 +begin = 09.07.2020 07:13:40 +norma = 25 +real = 10 + +[88] +oper = 6 +begin = 09.07.2020 07:24:16 +norma = 35 +real = 46 + +[89] +oper = 7 +begin = 09.07.2020 08:11:03 +norma = 30 +real = 58 + +[90] +oper = 13 +begin = 09.07.2020 09:09:36 +norma = 45 +real = 24 + +[91] +oper = 8 +begin = 09.07.2020 09:33:44 +norma = 40 +vac_time = 10 +real = 64 + +[92] +oper = 25 +begin = 09.07.2020 10:38:01 +norma = 30 +real = 7 + +[93] +oper = 9 +begin = 09.07.2020 10:45:35 +norma = 0 +real = 36 + +[94] +oper = 10 +begin = 09.07.2020 11:22:02 +norma = 0 +real = 172 + +[95] +oper = 11 +begin = 09.07.2020 14:14:29 +norma = 0 +real = 200 + +[96] +oper = 12 +begin = 09.07.2020 17:35:03 +norma = 105 +real = 126 + +[97] +oper = 13 +begin = 09.07.2020 19:42:01 +norma = 45 +real = 136 + +[98] +oper = 2 +begin = 09.07.2020 21:58:59 +norma = 110 +vac_time = 10 +real = 53 + +[99] +oper = 5 +begin = 09.07.2020 22:52:15 +norma = 25 +real = 12 + +[00] +oper = 6 +begin = 09.07.2020 23:04:20 +norma = 35 +real = 39 + +[01] +oper = 7 +begin = 09.07.2020 23:44:02 +norma = 30 +real = 54 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.457 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.457 new file mode 100644 index 0000000..f1cb3f7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.457 @@ -0,0 +1,17 @@ +05:41:35 1594255295 : 㦥 +07:24:34 1594261474 祭 ० ᪠ +07:24:34 1594261474 祭 ० ᪠ +07:26:56 1594261616 ⪫祭 ० ᪠ (A) +10:17:07 1594271827 : +10:37:15 1594273035 祭 ॣ '-2'(A) +10:37:53 1594273073 ⪫祭 ॣ '-2'(A) +10:57:56 1594274276 祭 ॣ '-2' +11:22:02 1594275722 祭 ⠭ ॣ +17:35:07 1594298107 ⪫祭 ॣ '-2'(A) +17:35:58 1594298158 祭 ० ᪠ +17:35:58 1594298158 祭 ० ᪠ +17:38:21 1594298301 ⪫祭 ० ᪠ (A) +22:05:30 1594314330 : 㦥 +23:04:32 1594317872 祭 ० ᪠ +23:04:32 1594317872 祭 ० ᪠ +23:06:54 1594318014 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.459 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.459 new file mode 100644 index 0000000..1238262 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.459 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.460 new file mode 100644 index 0000000..c77ea7a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.460 @@ -0,0 +1,3 @@ +14:41:29 1594287689 1 11524 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 8 4600 9 5850 +18:58:49 1594303129 1 11524 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4600 9 5850 10 650 11 12 321731 +19:32:07 1594305127 0 A--32-129-2018 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.461 new file mode 100644 index 0000000..357225f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.462 new file mode 100644 index 0000000..abe0141 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.462 @@ -0,0 +1,60 @@ +21 14:40:24 14:40:27 +Rsk= 16.3 Rkk= 14.0 + +22 15:45:46 16:00:53 +P1= 48.2 T1=15:55:53 P2= 64.1 T2=16:00:53 Vs= 3.17 + +22 16:11:06 16:26:13 +P1= 39.9 T1=16:21:13 P2= 54.0 T2=16:26:13 Vs= 2.83 + +20 17:55:57 17:56:05 +Riz_sol= 570.0 + +21 17:56:11 17:56:14 +Rsk= 16.7 Rkk= 14.1 + +22 18:35:25 18:50:32 +P1= 45.1 T1=18:45:32 P2= 58.8 T2=18:50:32 Vs= 2.74 + +23 18:50:51 18:50:56 + + +24 18:51:05 18:51:43 + + +30 18:51:57 18:52:20 +Vst= 28.0 + +31 18:52:24 18:52:58 +Rom_sol= 15.0 + +41 18:53:35 18:53:40 +Ukz= 1.51 + +32 18:53:42 18:54:19 +Imax=11.1 Umax=50.1 T= 9.0 + +33 18:54:23 18:54:55 +Imin=16.1 Umin=25.0 T= 0.5 + +34 18:55:06 18:55:27 +V=300.2 T= 9.4 + +35 18:55:30 18:56:26 +Q= 53.3 T= 9.4 + +36 18:56:29 18:56:58 +P1=0.28 T= 2.9 + +37 18:57:02 18:57:26 +T= 0.9 + +38 18:57:30 18:57:36 +t= 54.0 T= 0.5 + +39 18:57:39 18:57:54 +tcam= 53.5 Tcam= 0.5 tfl= 59.0 Tfl= 0.5 + +40 18:57:58 18:58:04 +t= 51.7 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.463 new file mode 100644 index 0000000..1bd1a55 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.463 @@ -0,0 +1,11 @@ +12 03:53:54 1594248834 +13 08:11:58 1594264318 +0 08:11:58 1594264318 +2 14:36:20 1594287380 +5 16:29:55 1594294195 +6 16:50:39 1594295439 +7 17:27:36 1594297656 +8 17:53:33 1594299213 +25 18:51:54 1594302714 +9 18:58:49 1594303129 +10 19:32:07 1594305127 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.464 new file mode 100644 index 0000000..07c6f6f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.466 new file mode 100644 index 0000000..fe67537 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.466 @@ -0,0 +1,62 @@ +[28] +oper = 12 +begin = 09.07.2020 03:53:54 +norma = 105 +real = 258 + +[29] +oper = 13 +begin = 09.07.2020 08:11:58 +norma = 45 +real = 384 + +[30] +oper = 2 +begin = 09.07.2020 14:36:20 +norma = 110 +vac_time = 11 +real = 113 + +[31] +oper = 5 +begin = 09.07.2020 16:29:55 +norma = 25 +real = 20 + +[32] +oper = 6 +begin = 09.07.2020 16:50:39 +norma = 35 +real = 36 + +[33] +oper = 7 +begin = 09.07.2020 17:27:36 +norma = 30 +real = 25 + +[34] +oper = 8 +begin = 09.07.2020 17:53:33 +norma = 40 +vac_time = 9 +real = 58 + +[35] +oper = 25 +begin = 09.07.2020 18:51:54 +norma = 30 +real = 6 + +[36] +oper = 9 +begin = 09.07.2020 18:58:49 +norma = 0 +real = 33 + +[37] +oper = 10 +begin = 09.07.2020 19:32:07 +norma = 0 +real = 294 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.467 new file mode 100644 index 0000000..d0dcbbd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.467 @@ -0,0 +1,18 @@ +03:39:45 1594247985 祭 ० +03:39:46 1594247986 ⪫祭 ॣ '-2'(A) +03:39:47 1594247987 祭 ॣ '-2'(A) +03:48:07 1594248487 ⪫祭 ० ' ⮪ 㣨' +03:53:58 1594248838 ⪫祭 ॣ '-2'(A) +03:54:26 1594248866 祭 ० ᪠ +03:54:27 1594248867 祭 ० ᪠ +03:56:29 1594248989 ⪫祭 ० ᪠ (A) +04:49:48 1594252188 ⪫祭 ० (A) +16:43:56 1594295036 祭 ० ᪠ +16:45:52 1594295152 ⪫祭 ० ᪠ (A) +18:51:07 1594302667 祭 ॣ '-2'(A) +18:51:43 1594302703 ⪫祭 ॣ '-2'(A) +18:58:19 1594303099 祭 ० ࠧ +18:58:21 1594303101 祭 ० ' ⮪ 㣨' +19:00:11 1594303211 祭 ॣ '-2'(A) +19:32:07 1594305127 ⪫祭 ० ࠧ (A) +19:32:07 1594305127 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.468 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.468 new file mode 100644 index 0000000..c2a6e70 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.468 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.469 new file mode 100644 index 0000000..80ba6b6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.480 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.480 new file mode 100644 index 0000000..1497544 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.480 @@ -0,0 +1,3 @@ +19:09:23 1594303763 1 02563 2 BT 3-1, 6, 8, 9, 14, 15, 16 4 2 9 5060 10 670 +23:08:38 1594318118 1 02563 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4130 9 5060 10 670 11 12 1718 +23:43:37 1594320217 0 A--32-002-2012 ॢ 9 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.481 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.481 new file mode 100644 index 0000000..4879f03 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.481 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.482 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.482 new file mode 100644 index 0000000..0fecf67 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.482 @@ -0,0 +1,66 @@ +21 19:09:45 19:09:48 +Rsk= 15.3 Rkk= 4.7 + +21 19:09:53 19:09:56 +Rsk= 16.0 Rkk= 5.1 + +22 20:00:02 20:15:07 +P1= 67.9 T1=20:10:07 P2= 90.5 T2=20:15:07 Vs= 4.51 + +22 20:25:00 20:40:05 +P1= 57.6 T1=20:35:05 P2= 74.7 T2=20:40:05 Vs= 3.41 + +22 20:49:59 21:05:03 +P1= 51.4 T1=21:00:03 P2= 65.8 T2=21:05:03 Vs= 2.89 + +20 22:01:57 22:02:06 +Riz_sol= 1282.2 + +21 22:02:12 22:02:15 +Rsk= 65.6 Rkk= 56.4 + +22 22:44:56 23:00:01 +P1= 51.4 T1=22:55:01 P2= 65.4 T2=23:00:01 Vs= 2.79 + +23 23:00:09 23:00:14 + + +24 23:00:20 23:00:57 + + +30 23:01:07 23:01:36 +Vst= 23.4 + +31 23:01:40 23:02:15 +Rom_sol= 7.0 + +41 23:02:56 23:03:01 +Ukz= 1.32 + +32 23:03:07 23:03:43 +Imax=10.9 Umax=50.0 T= 9.3 + +33 23:03:47 23:04:05 +Imin=15.8 Umin=25.0 T= 0.8 + +34 23:04:09 23:04:32 +V=300.3 T= 9.4 + +35 23:04:36 23:05:57 +Qkr= 53.6 Tkr= 9.8 Qpd= 0.0 Tpd= 0.0 + +36 23:06:02 23:07:00 +Pkr=0.29 Tkr= 3.2 Ppd=0.00 Tpd= 0.0 + +37 23:07:04 23:07:30 +T= 1.2 + +38 23:07:34 23:07:41 +t= 51.3 T= 0.7 + +39 23:07:45 23:07:52 +t= 51.9 T= 0.7 + +40 23:07:55 23:08:02 +t= 52.3 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.483 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.483 new file mode 100644 index 0000000..8007c7a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.483 @@ -0,0 +1,8 @@ +2 19:03:56 1594303436 +5 21:05:54 1594310754 +6 21:15:53 1594311353 +7 21:44:03 1594313043 +8 21:57:57 1594313877 +25 23:01:04 1594317664 +9 23:08:38 1594318118 +10 23:43:37 1594320217 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.484 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.484 new file mode 100644 index 0000000..c133e1f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.484 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.486 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.486 new file mode 100644 index 0000000..2c99d7b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.486 @@ -0,0 +1,50 @@ +[95] +oper = 2 +begin = 09.07.2020 19:03:56 +norma = 110 +vac_time = 9 +real = 121 + +[96] +oper = 5 +begin = 09.07.2020 21:05:54 +norma = 25 +real = 9 + +[97] +oper = 6 +begin = 09.07.2020 21:15:53 +norma = 35 +real = 28 + +[98] +oper = 7 +begin = 09.07.2020 21:44:03 +norma = 30 +real = 13 + +[99] +oper = 8 +begin = 09.07.2020 21:57:57 +norma = 40 +vac_time = 8 +real = 63 + +[00] +oper = 25 +begin = 09.07.2020 23:01:04 +norma = 30 +real = 7 + +[01] +oper = 9 +begin = 09.07.2020 23:08:38 +norma = 0 +real = 34 + +[02] +oper = 10 +begin = 09.07.2020 23:43:37 +norma = 0 +real = 229 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.487 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.487 new file mode 100644 index 0000000..89add2a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.487 @@ -0,0 +1,9 @@ +21:16:20 1594311380 祭 ० ᪠ +21:19:56 1594311596 ⪫祭 ० ᪠ (A) +23:00:21 1594317621 祭 ॣ '-2'(A) +23:00:58 1594317658 ⪫祭 ॣ '-2'(A) +23:08:10 1594318090 祭 ० ࠧ +23:08:13 1594318093 祭 ० ' ⮪ 㣨' +23:25:52 1594319152 祭 ॣ '-2'(A) +23:43:37 1594320217 祭 ⠭ ॣ +23:43:37 1594320217 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.489 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.489 new file mode 100644 index 0000000..2bf6803 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.489 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.911 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.911 new file mode 100644 index 0000000..22e37a0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.911 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.912 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.912 new file mode 100644 index 0000000..87972d7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.912 @@ -0,0 +1,18 @@ +22 18:22:43 18:27:43 +P1=32.2 P2=58.0 T1=18:22:43 T2=18:27:43 Vs= 5.2 + +22 19:42:35 19:47:35 +P1=25.3 P2=49.5 T1=19:42:35 T2=19:47:35 Vs= 4.8 + +22 20:14:03 20:19:03 +P1=24.0 P2=52.9 T1=20:14:03 T2=20:19:03 Vs= 5.8 + +22 21:28:35 21:33:34 +P1=21.3 P2=49.0 T1=21:28:35 T2=21:33:34 Vs= 5.6 + +22 21:33:40 21:38:40 +P1=49.6 P2=83.9 T1=21:33:40 T2=21:38:40 Vs= 6.9 + +22 21:53:53 21:58:53 +P1=20.9 P2=51.3 T1=21:53:53 T2=21:58:53 Vs= 6.1 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.913 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.913 new file mode 100644 index 0000000..44943d2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.913 @@ -0,0 +1,5 @@ +10 06:16:15 1594257375 +00 06:16:15 1594257375 +13 06:16:15 1594257375 +12 09:55:00 1594270500 +08 15:04:01 1594289041 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.920 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.920 new file mode 100644 index 0000000..508f7df --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.920 @@ -0,0 +1 @@ +09:07:57 1594267677 1 9-92- 2 ‚’1-0Š 3 4 1 5 2 6 7 10 132 11 132 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.921 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.921 new file mode 100644 index 0000000..80fa0b3 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.921 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.922 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.922 new file mode 100644 index 0000000..fe5a5fc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.922 @@ -0,0 +1,21 @@ +22 00:53:28 00:58:28 +P1=68.9 P2=101.7 T1=00:53:28 T2=00:58:28 Vs= 6.6 + +22 03:13:03 03:18:03 +P1=53.6 P2=74.2 T1=03:13:03 T2=03:18:03 Vs= 4.1 + +22 04:04:46 04:09:46 +P1=52.0 P2=70.7 T1=04:04:46 T2=04:09:46 Vs= 3.7 + +22 04:41:09 04:46:10 +P1=51.5 P2=68.5 T1=04:41:09 T2=04:46:10 Vs= 3.4 + +22 05:17:47 05:22:48 +P1=51.0 P2=67.8 T1=05:17:47 T2=05:22:48 Vs= 3.4 + +22 05:58:21 06:03:21 +P1=50.4 P2=65.4 T1=05:58:21 T2=06:03:21 Vs= 3.0 + +22 09:28:14 09:33:14 +P1=49.5 P2=51.4 T1=09:28:14 T2=09:33:14 Vs= 0.4 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.923 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.923 new file mode 100644 index 0000000..19041ed --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.923 @@ -0,0 +1,6 @@ +10 06:13:10 1594257190 +17 09:05:44 1594267544 +10 09:07:57 1594267677 +12 09:55:00 1594270500 +00 18:43:15 1594302195 +13 18:43:15 1594302195 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.930 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.930 new file mode 100644 index 0000000..68a996f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.930 @@ -0,0 +1,2 @@ +09:24:32 1594268672 2 BT9 3 3 11100 7 4995 8 5000 9 320970 +09:58:11 1594270691 0 A_NTC_GRE_32_004_2018_rev2 1 01241 2 BT9 3 3 11100 4 9692 5 9692 6 690 7 4995 8 5000 9 320970 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.931 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.931 new file mode 100644 index 0000000..63201a4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.931 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.932 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.932 new file mode 100644 index 0000000..c442fef --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.932 @@ -0,0 +1,36 @@ +22 06:57:31 07:02:36 +P1= 47.0 T1=06:57:34 P2= 65.0 T2=07:02:36 Vs= 3.55 + +22 09:17:08 09:22:12 +P1= 32.0 T1=09:17:11 P2= 37.0 T2=09:22:12 Vs= 0.99 + +21 09:23:20 09:23:22 +Rsk= 2.2 + +21 09:23:31 09:23:33 +Rsk= 2.2 + +32 09:24:49 09:25:03 +Umax=85.1 T= 3.0 + +34 09:25:06 09:25:34 +V= 0.3 T= 9.0 + +43 09:25:36 09:27:59 +Ttgl= 0.0 + +38 09:28:02 09:28:39 +t= 50.0 T= 0.1 + +42 09:28:44 09:30:46 +Qtgl=63.46 T= 0.0 + +35 09:30:49 09:31:46 +Qizl=106.5 T= 0.0 + +37 09:31:50 09:33:36 +T= 0.0 + +44 09:52:24 09:52:34 + + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.933 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.933 new file mode 100644 index 0000000..624e4ad --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.933 @@ -0,0 +1,8 @@ +8 03:54:19 1594248859 +10 09:53:10 1594270390 +17 12:10:58 1594278658 +12 12:13:05 1594278785 +10 12:21:31 1594279291 +12 12:35:26 1594280126 +13 19:20:39 1594304439 +0 19:20:39 1594304439 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.934 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.934 new file mode 100644 index 0000000..283708c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.934 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.940 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.940 new file mode 100644 index 0000000..f7a93bb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.940 @@ -0,0 +1,3 @@ +05:18:21 1594253901 3 16700 7 5265 8 5560 9 320976 +05:31:45 1594254705 8 5510 +05:38:55 1594255135 0 A_NTC_GRE_32_003_2017_rev0 1 00813 2 Ti6Al4V 3 16700 4 9772 5 9772 6 770 7 5265 8 5510 9 320976 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.941 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.941 new file mode 100644 index 0000000..c8e4922 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.941 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.942 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.942 new file mode 100644 index 0000000..507727d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.942 @@ -0,0 +1,30 @@ +22 05:09:43 05:14:47 +P1= 55.3 T1=05:09:45 P2= 63.8 T2=05:14:47 Vs= 1.68 + +21 05:16:46 05:16:48 +Rsk= 4.2 + +32 05:18:52 05:19:16 +Umax=85.0 T= 3.0 + +34 05:19:22 05:21:52 +V= 0.3 T= 9.0 + +43 05:21:59 05:24:33 +Ttgl= 0.0 + +38 05:24:39 05:26:13 +t= 50.0 T= 0.5 + +42 05:26:23 05:28:32 +Qtgl=61.72 T= 0.0 + +35 05:28:37 05:29:22 +Qizl=109.9 T= 0.0 + +37 05:29:29 05:31:19 +T= 0.0 + +44 05:32:56 05:33:07 + + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.943 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.943 new file mode 100644 index 0000000..1fd6491 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.943 @@ -0,0 +1,6 @@ +8 02:49:15 1594244955 +10 05:33:54 1594254834 +17 08:51:35 1594266695 +12 08:53:35 1594266815 +13 17:57:59 1594299479 +0 17:57:59 1594299479 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200709.944 b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.944 new file mode 100644 index 0000000..e4ad24c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200709.944 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.010 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.010 new file mode 100644 index 0000000..c6511e7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.010 @@ -0,0 +1,2 @@ +11:32:18 1594362738 1 05663 9 4280 +21:26:27 1594398387 1 05663 2 Ti-6Al4V-Ti_Str 3 20 4 1 5 Ti 6 7 770 8 2060 9 0 10 560 11 12 321454 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.011 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.011 new file mode 100644 index 0000000..52fe60f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.011 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.012 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.012 new file mode 100644 index 0000000..d0b71a7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.012 @@ -0,0 +1,69 @@ +21 11:32:39 11:32:42 +Rsk= 8.4 Rkk= 7.7 + +22 12:54:48 13:10:23 +P1= 44.7 T1=13:05:23 P2= 61.4 T2=13:10:23 Vs= 3.33 + +22 13:25:25 13:40:59 +P1= 43.6 T1=13:35:59 P2= 59.3 T2=13:40:59 Vs= 3.15 + +22 13:41:35 13:57:08 +P1= 49.0 T1=13:52:08 P2= 64.2 T2=13:57:08 Vs= 3.05 + +20 18:11:39 18:11:48 +Riz_sol= 2394.0 + +21 18:11:56 18:11:59 +Rsk= 8.2 Rkk= 7.7 + +22 20:07:31 20:23:06 +P1= 46.1 T1=20:18:06 P2= 62.3 T2=20:23:06 Vs= 3.24 + +22 20:33:18 20:48:52 +P1= 46.6 T1=20:43:52 P2= 62.5 T2=20:48:52 Vs= 3.17 + +22 21:00:56 21:16:31 +P1= 44.7 T1=21:11:31 P2= 58.3 T2=21:16:31 Vs= 2.74 + +23 21:18:39 21:18:44 + + +24 21:18:57 21:19:32 + + +30 21:19:51 21:20:16 +Vst= 35.9 + +31 21:20:24 21:20:59 +Rom_sol= 18.5 + +41 21:21:22 21:21:27 +Ukz= 1.21 + +32 21:21:32 21:22:12 +Imax=11.0 Umax=50.0 T= 9.0 + +33 21:22:17 21:22:38 +Imin=15.9 Umin=25.0 T= 0.5 + +34 21:22:44 21:23:08 +V=300.1 T= 9.7 + +35 21:23:12 21:24:06 +Q= 51.9 T= 9.7 + +36 21:24:13 21:24:49 +P1=0.29 T= 3.2 + +37 21:24:54 21:25:20 +T= 1.2 + +38 21:25:26 21:25:34 +t= 53.3 T= 0.8 + +39 21:25:38 21:25:46 +t= 53.6 T= 0.7 + +40 21:25:53 21:26:01 +t= 51.5 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.013 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.013 new file mode 100644 index 0000000..a41b269 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.013 @@ -0,0 +1,11 @@ +12 05:39:06 1594341546 +13 09:55:25 1594356925 +0 09:55:25 1594356925 +2 11:22:40 1594362160 +5 13:59:49 1594371589 +6 14:10:16 1594372216 +7 14:39:50 1594373990 +8 18:00:10 1594386010 +25 21:19:47 1594397987 +9 21:26:27 1594398387 +10 21:48:23 1594399703 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.014 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.014 new file mode 100644 index 0000000..1ccfb16 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.014 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.016 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.016 new file mode 100644 index 0000000..4d3704a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.016 @@ -0,0 +1,62 @@ +[96] +oper = 12 +begin = 10.07.2020 05:39:06 +norma = 180 +real = 256 + +[97] +oper = 13 +begin = 10.07.2020 09:55:25 +norma = 45 +real = 87 + +[98] +oper = 2 +begin = 10.07.2020 11:22:40 +norma = 110 +vac_time = 24 +real = 157 + +[99] +oper = 5 +begin = 10.07.2020 13:59:49 +norma = 25 +real = 10 + +[00] +oper = 6 +begin = 10.07.2020 14:10:16 +norma = 35 +real = 29 + +[01] +oper = 7 +begin = 10.07.2020 14:39:50 +norma = 30 +real = 200 + +[02] +oper = 8 +begin = 10.07.2020 18:00:10 +norma = 40 +vac_time = 24 +real = 199 + +[03] +oper = 25 +begin = 10.07.2020 21:19:47 +norma = 30 +real = 6 + +[04] +oper = 9 +begin = 10.07.2020 21:26:27 +norma = 0 +real = 21 + +[05] +oper = 10 +begin = 10.07.2020 21:48:23 +norma = 0 +real = 473 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.017 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.017 new file mode 100644 index 0000000..020a266 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.017 @@ -0,0 +1,5 @@ +05:39:09 1594341549 ⪫祭 ॣ '-2'(A) +21:18:57 1594397937 祭 ॣ '-2'(A) +21:19:33 1594397973 ⪫祭 ॣ '-2'(A) +21:48:31 1594399711 祭 ॣ '-2' +21:48:34 1594399714 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.019 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.019 new file mode 100644 index 0000000..b17c264 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.019 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.020 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.020 new file mode 100644 index 0000000..f7721b9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.020 @@ -0,0 +1,3 @@ +08:59:24 1594353564 1 05153 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3100 9 3250 10 670 11 12 321284 +09:28:01 1594355281 0 A--32-068-2019 ॢ 2 +17:39:53 1594384793 3 14 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.021 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.021 new file mode 100644 index 0000000..d7bfda5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.021 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.022 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.022 new file mode 100644 index 0000000..5aaea6f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.022 @@ -0,0 +1,81 @@ +22 00:34:54 00:49:59 +P1= 70.6 T1=00:44:59 P2=102.2 T2=00:49:59 Vs= 6.33 + +21 02:37:04 02:37:07 +Rsk= 14.2 Rkk= 10.7 + +20 02:48:25 02:48:35 +Riz_sol= 7340.0 + +22 03:43:45 03:58:50 +P1= 49.4 T1=03:53:50 P2= 69.7 T2=03:58:50 Vs= 4.06 + +20 06:14:13 06:14:22 +Riz_sol= 3742.3 + +21 06:14:30 06:14:33 +Rsk= 13.7 Rkk= 10.3 + +22 06:43:20 06:58:25 +P1= 59.4 T1=06:53:25 P2= 84.3 T2=06:58:25 Vs= 4.99 + +22 07:27:36 07:42:40 +P1= 40.0 T1=07:37:40 P2= 55.7 T2=07:42:40 Vs= 3.13 + +22 07:59:52 08:14:57 +P1= 36.4 T1=08:09:57 P2= 49.8 T2=08:14:57 Vs= 2.68 + +22 08:31:47 08:46:51 +P1= 33.7 T1=08:41:51 P2= 46.0 T2=08:46:51 Vs= 2.47 + +23 08:47:14 08:47:19 + + +24 08:47:26 08:48:01 + + +30 08:48:37 08:49:06 +Vst= 28.7 + +31 08:49:18 08:50:19 +Rom_sol= 12.6 + +41 08:50:48 08:50:53 +Ukz= 2.01 + +41 08:52:15 08:52:20 +Ukz= 1.49 + +32 08:52:27 08:53:04 +Imax=10.8 Umax=50.0 T= 9.0 + +33 08:53:08 08:53:31 +Imin=15.8 Umin=25.0 T= 2.0 + +35 08:54:07 08:55:22 +Q= 53.4 T= 9.4 + +36 08:55:27 08:56:01 +P1=0.27 T= 2.9 + +34 08:56:05 08:56:29 +V=300.0 T= 9.4 + +37 08:56:35 08:56:59 +T= 0.9 + +38 08:57:03 08:57:11 +t= 53.4 T= 0.5 + +39 08:57:15 08:57:33 +tcam= 51.3 Tcam= 0.5 tfl= 53.9 Tfl= 0.5 + +40 08:57:37 08:57:46 +t= 51.5 T= 0.5 + +21 17:39:32 17:39:35 +Rsk= 13.5 Rkk= 10.2 + +22 18:02:54 18:17:58 +P1= 59.1 T1=18:12:58 P2= 81.3 T2=18:17:58 Vs= 4.44 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.023 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.023 new file mode 100644 index 0000000..4a0275d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.023 @@ -0,0 +1,15 @@ +13 01:29:40 1594326580 +8 02:34:50 1594330490 +13 04:04:07 1594335847 +8 06:10:36 1594343436 +25 08:48:35 1594352915 +9 08:59:24 1594353564 +10 09:28:02 1594355282 +11 12:14:22 1594365262 +12 14:58:07 1594375087 +13 16:49:12 1594381752 +0 16:49:12 1594381752 +14 17:37:21 1594384641 +15 18:18:56 1594387136 +16 18:46:42 1594388802 +1 19:19:39 1594390779 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.024 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.024 new file mode 100644 index 0000000..54fd037 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.024 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.025 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.025 new file mode 100644 index 0000000..b0c15b0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.025 @@ -0,0 +1,3 @@ +103 03:17:27 1594333047 +47 08:53:41 1594353221 +47 08:53:48 1594353228 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.026 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.026 new file mode 100644 index 0000000..e563cb4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.026 @@ -0,0 +1,88 @@ +[36] +oper = 13 +begin = 10.07.2020 01:29:40 +norma = 45 +real = 65 + +[37] +oper = 8 +begin = 10.07.2020 02:34:50 +norma = 40 +vac_time = 15 +real = 89 + +[38] +oper = 13 +begin = 10.07.2020 04:04:07 +norma = 45 +real = 126 + +[39] +oper = 8 +begin = 10.07.2020 06:10:36 +norma = 40 +vac_time = 10 +vac_avg10 = 10.4 +real = 157 + +[40] +oper = 25 +begin = 10.07.2020 08:48:35 +norma = 30 +real = 10 + +[41] +oper = 9 +begin = 10.07.2020 08:59:24 +norma = 0 +real = 28 + +[42] +oper = 10 +begin = 10.07.2020 09:28:02 +norma = 0 +real = 166 + +[43] +oper = 11 +begin = 10.07.2020 12:14:22 +norma = 0 +real = 163 + +[44] +oper = 12 +begin = 10.07.2020 14:58:07 +norma = 105 +real = 111 + +[45] +oper = 13 +begin = 10.07.2020 16:49:12 +norma = 45 +real = 48 + +[46] +oper = 14 +begin = 10.07.2020 17:37:21 +norma = 40 +vac_time = 8 +real = 41 + +[47] +oper = 15 +begin = 10.07.2020 18:18:56 +norma = 30 +real = 27 + +[48] +oper = 16 +begin = 10.07.2020 18:46:42 +norma = 40 +real = 32 + +[49] +oper = 1 +begin = 10.07.2020 19:19:39 +norma = 85 +real = 1217 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.027 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.027 new file mode 100644 index 0000000..2202371 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.027 @@ -0,0 +1,34 @@ +08:47:28 1594352848 祭 ॣ '-2'(A) +08:48:03 1594352883 ⪫祭 ॣ '-2'(A) +08:49:17 1594352957 ' ' +08:49:17 1594352957 祭 +08:49:20 1594352960 祭 +08:50:20 1594353020 ⪫祭 +08:57:58 1594353478 祭 ० ࠧ +08:57:59 1594353479 祭 ० ' ⮪ 㣨' +08:59:25 1594353565 : 믮 +09:16:01 1594354561 祭 ॣ '-2'(A) +09:28:01 1594355281 ⪫祭 ० ࠧ (A) +09:28:02 1594355282 祭 ॣ . 殮 㣨 +12:14:21 1594365261 祭 ० +12:14:22 1594365262 ⪫祭 ॣ '-2'(A) +12:14:23 1594365263 祭 ॣ '-2'(A) +13:04:22 1594368262 ⪫祭 ॣ '-2'(A) +14:58:03 1594375083 ⪫祭 ० (A) +14:58:04 1594375084 ⪫祭 +14:58:04 1594375084 : +14:58:08 1594375088 ⪫祭 ० ' ⮪ 㣨' +14:58:26 1594375106 祭 ० ᪠ +14:58:26 1594375106 祭 ० ᪠ +15:00:04 1594375204 : 믮 +15:01:04 1594375264 ⪫祭 ० ᪠ (A) +18:18:28 1594387108 祭 ० ࠧ +18:18:30 1594387110 祭 ० ' ⮪ 㣨' +18:33:37 1594388017 ⪫祭 ० ' ⮪ 㣨' +18:44:58 1594388698 ⪫祭 ० ࠧ (A) +18:47:07 1594388827 祭 ० ᪠ +18:48:06 1594388886 ⪫祭 ० ᪠ +18:48:10 1594388890 祭 ० ᪠ +18:48:33 1594388913 ⪫祭 ० ᪠ +18:48:35 1594388915 祭 ० ᪠ +18:48:49 1594388929 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.029 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.029 new file mode 100644 index 0000000..115f805 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.029 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.030 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.030 new file mode 100644 index 0000000..353b981 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.030 @@ -0,0 +1,3 @@ +20:24:46 1594394686 1 08237 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 9 4450 +21:20:40 1594398040 1 08237 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 2400 9 4450 10 690 11 12 321594 +22:03:12 1594400592 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.031 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.031 new file mode 100644 index 0000000..fe0fddb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.031 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.032 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.032 new file mode 100644 index 0000000..b0e044c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.032 @@ -0,0 +1,48 @@ +21 20:19:44 20:19:52 +Rsk= 11.4 Rkk= 6.4 + +20 20:23:41 20:23:51 +Riz_sol= 8092.8 + +22 20:54:32 21:09:52 +P1= 37.4 T1=21:04:52 P2= 49.3 T2=21:09:52 Vs= 2.37 + +23 21:11:58 21:12:04 + + +24 21:12:15 21:12:48 + + +30 21:13:02 21:13:41 +Vst= 31.1 + +31 21:13:51 21:14:28 +Rom_sol= 10.5 + +32 21:15:12 21:16:18 +Imax=11.4 Umax=50.0 T= 9.4 + +33 21:16:23 21:16:51 +Imin=16.5 Umin=25.1 T= 0.8 + +34 21:16:56 21:17:23 +V=301.4 T= 9.3 + +35 21:17:27 21:18:19 +Q= 55.0 T= 9.1 + +36 21:18:24 21:18:55 +P1=0.28 T= 2.9 + +37 21:18:59 21:19:27 +T= 0.6 + +38 21:19:33 21:19:39 +t= 51.3 T= 0.5 + +39 21:19:43 21:19:49 +t= 51.6 T= 0.4 + +40 21:19:53 21:19:59 +t= 51.9 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.033 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.033 new file mode 100644 index 0000000..1b910d8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.033 @@ -0,0 +1,8 @@ +11 12:43:37 1594367017 +12 15:14:50 1594376090 +13 17:08:10 1594382890 +0 17:08:10 1594382890 +8 20:19:07 1594394347 +25 21:12:58 1594397578 +9 21:20:40 1594398040 +10 22:03:13 1594400593 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.034 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.034 new file mode 100644 index 0000000..ebc3a2f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.034 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.036 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.036 new file mode 100644 index 0000000..9816833 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.036 @@ -0,0 +1,43 @@ +[41] +oper = 11 +begin = 10.07.2020 12:43:37 +norma = 0 +real = 151 + +[42] +oper = 12 +begin = 10.07.2020 15:14:50 +norma = 105 +real = 113 + +[43] +oper = 13 +begin = 10.07.2020 17:08:10 +norma = 45 +real = 190 + +[44] +oper = 8 +begin = 10.07.2020 20:19:07 +norma = 40 +vac_time = 7 +real = 53 + +[45] +oper = 25 +begin = 10.07.2020 21:12:58 +norma = 30 +real = 7 + +[46] +oper = 9 +begin = 10.07.2020 21:20:40 +norma = 0 +real = 42 + +[47] +oper = 10 +begin = 10.07.2020 22:03:13 +norma = 0 +real = 217 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.037 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.037 new file mode 100644 index 0000000..b16fef9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.037 @@ -0,0 +1,14 @@ +12:43:36 1594367016 祭 ० +12:43:37 1594367017 ⪫祭 ॣ '-2'(A) +15:14:44 1594376084 ⪫祭 ० (A) +15:14:52 1594376092 ⪫祭 ० ' ⮪ 㣨' +15:15:34 1594376134 祭 ० ᪠ +15:15:34 1594376134 祭 ० ᪠ +15:17:52 1594376272 ⪫祭 ० ᪠ (A) +21:12:15 1594397535 祭 ॣ '-2'(A) +21:12:48 1594397568 ⪫祭 ॣ '-2'(A) +21:20:12 1594398012 祭 ० ࠧ +21:20:13 1594398013 祭 ० ' ⮪ 㣨' +21:46:06 1594399566 祭 ॣ '-2'(A) +22:03:12 1594400592 祭 ⠭ ॣ +22:03:12 1594400592 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.039 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.039 new file mode 100644 index 0000000..bbf9bfe Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.039 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.050 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.050 new file mode 100644 index 0000000..678adcc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.050 @@ -0,0 +1,2 @@ +05:21:10 1594340470 1 10158 2 p. cao M1,M2,M3,M4 3 30 4 1 5 Ti 6 7 920 8 5340 9 8500 10 750 11 12 321427 +19:56:43 1594393003 1 10159 8 5330 9 8460 12 321602 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.051 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.051 new file mode 100644 index 0000000..c1d9eb6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.051 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.052 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.052 new file mode 100644 index 0000000..d5d3ac2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.052 @@ -0,0 +1,78 @@ +22 01:43:19 01:58:27 +P1= 48.2 T1=01:53:27 P2= 61.2 T2=01:58:27 Vs= 2.60 + +20 03:55:25 03:55:35 +Riz_sol= 1739.9 + +21 03:55:41 03:55:49 +Rsk= 19.7 Rkk= 14.4 + +22 04:55:06 05:10:14 +P1= 41.8 T1=05:05:14 P2= 52.8 T2=05:10:14 Vs= 2.20 + +23 05:10:37 05:10:43 + + +24 05:10:52 05:11:24 + + +30 05:11:37 05:12:17 +Vst= 29.6 + +31 05:12:25 05:13:05 +Rom_sol= 19.2 + +32 05:14:36 05:15:44 +Imax=27.7 Umax=55.0 T= 9.2 + +33 05:15:48 05:16:23 +Imin=16.4 Umin=25.2 T= 1.0 + +34 05:16:26 05:16:55 +V=301.2 T= 9.6 + +35 05:16:58 05:18:04 +Q= 54.8 T= 9.3 + +36 05:18:09 05:18:56 +P1=0.28 T= 3.1 + +37 05:19:00 05:19:34 +T= 0.8 + +38 05:19:38 05:19:44 +t= 51.7 T= 0.5 + +39 05:19:47 05:20:03 +tcam= 51.3 Tcam= 0.5 tfl= 51.6 Tfl= 0.9 + +40 05:20:06 05:20:12 +t= 51.5 T= 0.7 + +21 19:55:54 19:56:02 +Rsk= 0.1 Rkk= 3.2 + +21 19:56:57 19:57:04 +Rsk= 0.1 Rkk= 3.6 + +21 20:04:23 20:04:30 +Rsk= 0.2 Rkk= 4.3 + +21 20:04:45 20:04:53 +Rsk= 1.1 Rkk= 4.7 + +21 20:05:12 20:05:20 +Rsk= 8.7 Rkk= 8.4 + +22 21:03:01 21:18:09 +P1= 69.9 T1=21:13:09 P2= 89.6 T2=21:18:09 Vs= 3.94 + +22 21:44:56 22:00:04 +P1= 57.8 T1=21:55:04 P2= 71.2 T2=22:00:04 Vs= 2.68 + +20 22:59:27 22:59:38 +Riz_sol= 196.6 + +21 22:59:46 22:59:53 +Rsk= 18.7 Rkk= 13.2 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.053 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.053 new file mode 100644 index 0000000..6a2813f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.053 @@ -0,0 +1,15 @@ +5 02:24:39 1594329879 +6 02:36:49 1594330609 +7 03:18:41 1594333121 +8 03:53:20 1594335200 +25 05:11:34 1594339894 +9 05:21:10 1594340470 +10 05:47:03 1594342023 +12 11:27:29 1594362449 +13 16:12:43 1594379563 +0 16:12:43 1594379563 +2 19:51:29 1594392689 +5 22:00:50 1594400450 +6 22:11:32 1594401092 +7 22:44:31 1594403071 +8 22:56:14 1594403774 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.054 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.054 new file mode 100644 index 0000000..5db1608 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.054 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.056 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.056 new file mode 100644 index 0000000..aff2ec8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.056 @@ -0,0 +1,87 @@ +[33] +oper = 5 +begin = 10.07.2020 02:24:39 +norma = 25 +real = 12 + +[34] +oper = 6 +begin = 10.07.2020 02:36:49 +norma = 35 +real = 41 + +[35] +oper = 7 +begin = 10.07.2020 03:18:41 +norma = 30 +real = 34 + +[36] +oper = 8 +begin = 10.07.2020 03:53:20 +norma = 40 +vac_time = 10 +real = 78 + +[37] +oper = 25 +begin = 10.07.2020 05:11:34 +norma = 30 +real = 9 + +[38] +oper = 9 +begin = 10.07.2020 05:21:10 +norma = 0 +real = 25 + +[39] +oper = 10 +begin = 10.07.2020 05:47:03 +norma = 0 +real = 340 + +[40] +oper = 12 +begin = 10.07.2020 11:27:29 +norma = 180 +real = 285 + +[41] +oper = 13 +begin = 10.07.2020 16:12:43 +norma = 45 +real = 218 + +[42] +oper = 2 +begin = 10.07.2020 19:51:29 +norma = 110 +vac_time = 12 +real = 129 + +[43] +oper = 5 +begin = 10.07.2020 22:00:50 +norma = 25 +real = 10 + +[44] +oper = 6 +begin = 10.07.2020 22:11:32 +norma = 35 +real = 32 + +[45] +oper = 7 +begin = 10.07.2020 22:44:31 +norma = 30 +real = 11 + +[46] +oper = 8 +begin = 10.07.2020 22:56:14 +norma = 40 +vac_time = 15 +real = 441 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.057 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.057 new file mode 100644 index 0000000..4671518 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.057 @@ -0,0 +1,12 @@ +02:39:49 1594330789 祭 ० ᪠ +02:42:18 1594330938 ⪫祭 ० ᪠ (A) +05:10:53 1594339853 祭 ॣ '-2'(A) +05:11:25 1594339885 ⪫祭 ॣ '-2'(A) +05:46:23 1594341983 祭 ॣ '-2' +05:47:02 1594342022 祭 ⠭ ॣ +11:27:33 1594362453 ⪫祭 ॣ '-2'(A) +11:28:04 1594362484 祭 ० ᪠ +11:30:38 1594362638 ⪫祭 ० ᪠ (A) +22:11:55 1594401115 祭 ० ᪠ +22:11:55 1594401115 祭 ० ᪠ +22:14:41 1594401281 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.059 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.059 new file mode 100644 index 0000000..01020c5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.059 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.080 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.080 new file mode 100644 index 0000000..d1cea62 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.080 @@ -0,0 +1,3 @@ +13:42:47 1594370567 1 05939 3 25 +21:03:34 1594397014 1 05940 9 6356 12 321427 +23:00:01 1594404001 1 05940 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 840 8 4890 9 6356 10 770 11 12 321427 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.081 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.081 new file mode 100644 index 0000000..b1931a5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.081 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.082 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.082 new file mode 100644 index 0000000..fda1f3b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.082 @@ -0,0 +1,78 @@ +21 13:43:16 13:43:23 +Rsk= 17.5 Rkk= 17.6 + +22 14:34:58 14:50:03 +P1= 54.9 T1=14:45:03 P2= 69.5 T2=14:50:03 Vs= 2.91 + +21 16:27:55 16:28:03 +Rsk= 17.6 Rkk= 17.6 + +21 16:40:20 16:40:28 +Rsk= 17.6 Rkk= 17.6 + +22 17:09:59 17:25:05 +P1= 59.5 T1=17:20:05 P2= 74.1 T2=17:25:05 Vs= 2.92 + +21 20:59:15 20:59:22 +Rsk= 22.7 Rkk= 17.2 + +20 21:02:42 21:02:52 +Riz_sol= 2917.5 + +22 21:40:15 21:55:20 +P1= 56.1 T1=21:50:20 P2= 70.2 T2=21:55:20 Vs= 2.83 + +22 22:35:01 22:45:06 +P1= 24.3 T1=22:40:06 P2= 38.9 T2=22:45:06 Vs= 2.91 + +23 22:45:22 22:45:28 + + +24 22:46:21 22:46:55 + + +30 22:47:13 22:47:56 +Vst= 28.6 + +31 22:48:06 22:48:47 +Rom_sol= 14.6 + +41 22:49:27 22:49:32 +Ukz= 1.71 + +41 22:50:59 22:51:04 +Ukz= 1.56 + +41 22:51:09 22:51:14 +Ukz= 1.51 + +41 22:51:20 22:51:25 +Ukz= 1.49 + +32 22:51:29 22:52:38 +Imax=11.5 Umax=50.0 T= 9.4 + +33 22:52:43 22:53:20 +Imin=16.7 Umin=25.1 T= 0.8 + +34 22:53:23 22:53:53 +V=301.2 T= 9.6 + +35 22:53:55 22:55:16 +Q= 55.0 T=12.1 + +36 22:55:24 22:56:13 +P1=0.29 T= 3.1 + +37 22:56:17 22:56:47 +T= 0.7 + +38 22:56:52 22:57:00 +t= 51.5 T= 0.7 + +39 22:57:05 22:57:28 +tcam= 51.5 Tcam= 0.7 tfl= 51.7 Tfl= 0.8 + +40 22:57:32 22:57:43 +t= 51.7 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.083 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.083 new file mode 100644 index 0000000..bf2aa2d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.083 @@ -0,0 +1,17 @@ +12 06:06:45 1594343205 +13 10:59:16 1594360756 +0 10:59:16 1594360756 +2 13:41:56 1594370516 +5 14:55:37 1594374937 +6 15:09:21 1594375761 +7 16:13:29 1594379609 +13 16:31:30 1594380690 +14 16:33:38 1594380818 +15 17:25:54 1594383954 +16 17:59:47 1594385987 +1 19:08:35 1594390115 +8 20:55:38 1594396538 +00 21:39:19 1594399159 +25 22:47:12 1594403232 +9 23:00:01 1594404001 +10 23:39:08 1594406348 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.084 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.084 new file mode 100644 index 0000000..f64f491 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.084 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.086 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.086 new file mode 100644 index 0000000..984fd9d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.086 @@ -0,0 +1,94 @@ +[61] +oper = 12 +begin = 10.07.2020 06:06:45 +norma = 180 +real = 292 + +[62] +oper = 13 +begin = 10.07.2020 10:59:16 +norma = 45 +real = 162 + +[63] +oper = 2 +begin = 10.07.2020 13:41:56 +norma = 110 +vac_time = 8 +vac_avg10 = 7.8 +real = 73 + +[64] +oper = 5 +begin = 10.07.2020 14:55:37 +norma = 25 +real = 13 + +[65] +oper = 6 +begin = 10.07.2020 15:09:21 +norma = 35 +real = 64 + +[66] +oper = 7 +begin = 10.07.2020 16:13:29 +norma = 30 +real = 18 + +[67] +oper = 13 +begin = 10.07.2020 16:31:30 +norma = 45 +real = 2 + +[68] +oper = 14 +begin = 10.07.2020 16:33:38 +norma = 40 +vac_time = 8 +real = 52 + +[69] +oper = 15 +begin = 10.07.2020 17:25:54 +norma = 30 +real = 33 + +[70] +oper = 16 +begin = 10.07.2020 17:59:47 +norma = 40 +real = 68 + +[71] +oper = 1 +begin = 10.07.2020 19:08:35 +norma = 85 +real = 107 + +[72] +oper = 8 +begin = 10.07.2020 20:55:38 +norma = 40 +vac_time = 8 +real = 111 + +[73] +oper = 25 +begin = 10.07.2020 22:47:12 +norma = 30 +real = 12 + +[74] +oper = 9 +begin = 10.07.2020 23:00:01 +norma = 0 +real = 39 + +[75] +oper = 10 +begin = 10.07.2020 23:39:08 +norma = 0 +real = 373 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.087 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.087 new file mode 100644 index 0000000..0d5fe7c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.087 @@ -0,0 +1,7 @@ +06:06:50 1594343210 ⪫祭 ॣ '-2'(A) +17:54:28 1594385668 祭 ॣ '-2' +17:59:51 1594385991 ⪫祭 ॣ '-2'(A) +22:46:24 1594403184 祭 ॣ '-2'(A) +22:46:57 1594403217 ⪫祭 ॣ '-2'(A) +23:32:35 1594405955 祭 ॣ '-2' +23:39:07 1594406347 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.089 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.089 new file mode 100644 index 0000000..268323a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.089 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.090 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.090 new file mode 100644 index 0000000..a4f2d8c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.090 @@ -0,0 +1 @@ +19:45:49 1594392349 1 10059 3 25 9 4250 12 320936 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.091 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.091 new file mode 100644 index 0000000..3ad1f6c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.091 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.092 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.092 new file mode 100644 index 0000000..b37f237 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.092 @@ -0,0 +1,45 @@ +20 19:44:12 19:44:21 +Riz_sol= 6986.3 + +21 19:44:47 19:44:50 +Rsk= 24.3 Rkk= 21.0 + +22 20:25:07 20:40:14 +P1= 76.6 T1=20:35:14 P2=104.5 T2=20:40:14 Vs= 5.58 + +20 21:03:02 21:03:11 +Riz_sol= 6094.0 + +21 21:03:15 21:03:18 +Rsk= 24.0 Rkk= 20.7 + +22 21:39:58 21:55:05 +P1=105.3 T1=21:50:05 P2=148.8 T2=21:55:05 Vs= 8.70 + +22 22:05:32 22:20:39 +P1= 98.6 T1=22:15:39 P2=140.4 T2=22:20:39 Vs= 8.35 + +22 22:29:59 22:45:06 +P1= 93.9 T1=22:40:06 P2=133.7 T2=22:45:06 Vs= 7.96 + +20 23:01:32 23:01:40 +Riz_sol= 4266.4 + +21 23:01:47 23:01:50 +Rsk= 24.1 Rkk= 20.7 + +22 23:30:15 23:45:22 +P1= 40.5 T1=23:40:22 P2= 50.9 T2=23:45:22 Vs= 2.06 + +23 23:56:14 23:56:19 + + +24 23:56:25 23:57:03 + + +30 23:57:17 23:57:46 +Vst= 29.5 + +31 23:57:51 23:58:27 +Rom_sol= 13.0 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.093 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.093 new file mode 100644 index 0000000..a181d92 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.093 @@ -0,0 +1,10 @@ +11 13:20:59 1594369259 +12 15:52:14 1594378334 +13 17:45:11 1594385111 +0 17:45:11 1594385111 +8 19:41:24 1594392084 +13 20:58:00 1594396680 +8 21:02:56 1594396976 +13 22:49:01 1594403341 +8 22:59:34 1594403974 +25 23:57:15 1594407435 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.094 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.094 new file mode 100644 index 0000000..f7ae573 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.094 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.096 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.096 new file mode 100644 index 0000000..7b69a22 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.096 @@ -0,0 +1,57 @@ +[71] +oper = 11 +begin = 10.07.2020 13:20:59 +norma = 0 +real = 151 + +[72] +oper = 12 +begin = 10.07.2020 15:52:14 +norma = 105 +real = 112 + +[73] +oper = 13 +begin = 10.07.2020 17:45:11 +norma = 45 +real = 116 + +[74] +oper = 8 +begin = 10.07.2020 19:41:24 +norma = 40 +vac_time = 8 +real = 76 + +[75] +oper = 13 +begin = 10.07.2020 20:58:00 +norma = 45 +real = 4 + +[76] +oper = 8 +begin = 10.07.2020 21:02:56 +norma = 40 +vac_time = 8 +real = 106 + +[77] +oper = 13 +begin = 10.07.2020 22:49:01 +norma = 45 +real = 10 + +[78] +oper = 8 +begin = 10.07.2020 22:59:34 +norma = 40 +vac_time = 8 +real = 57 + +[79] +oper = 25 +begin = 10.07.2020 23:57:15 +norma = 30 +real = 8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.097 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.097 new file mode 100644 index 0000000..5dbe489 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.097 @@ -0,0 +1,10 @@ +13:20:59 1594369259 祭 ० +13:20:59 1594369259 ⪫祭 ॣ '-2'(A) +15:52:07 1594378327 ⪫祭 ० (A) +15:52:15 1594378335 ⪫祭 ० ' ⮪ 㣨' +15:52:43 1594378363 祭 ० ᪠ +15:52:43 1594378363 祭 ० ᪠ +15:52:44 1594378364 祭 ० ᪠ +15:55:07 1594378507 ⪫祭 ० ᪠ (A) +23:56:28 1594407388 祭 ॣ '-2'(A) +23:57:03 1594407423 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.099 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.099 new file mode 100644 index 0000000..e1043a1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.099 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.100 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.100 new file mode 100644 index 0000000..1a78531 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.100 @@ -0,0 +1,4 @@ +02:36:52 1594330612 3 14 +04:59:36 1594339176 1 11163 2 BT 18, 20, 22, 23, 25 3 25 9 4080 +17:22:30 1594383750 1 11163 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 4570 9 4080 10 670 11 12 321801 +17:51:12 1594385472 0 A--32-068-2019 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.101 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.101 new file mode 100644 index 0000000..f632716 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.101 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.102 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.102 new file mode 100644 index 0000000..989412d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.102 @@ -0,0 +1,66 @@ +21 02:37:07 02:37:14 +Rsk= 18.5 Rkk= 16.9 + +22 02:56:54 03:11:59 +P1= 53.5 T1=03:06:59 P2= 71.1 T2=03:11:59 Vs= 3.52 + +21 04:59:53 05:00:01 +Rsk= 18.4 Rkk= 16.9 + +22 05:24:54 05:40:00 +P1= 41.4 T1=05:34:59 P2= 55.2 T2=05:40:00 Vs= 2.76 + +20 08:58:47 08:58:56 +Riz_sol= 9178.0 + +21 08:59:09 08:59:16 +Rsk= 18.1 Rkk= 16.6 + +22 09:39:59 09:55:05 +P1= 31.4 T1=09:50:05 P2= 42.9 T2=09:55:05 Vs= 2.30 + +22 17:02:47 17:12:52 +P1= 14.4 T1=17:07:52 P2= 23.5 T2=17:12:52 Vs= 1.84 + +23 17:13:05 17:13:11 + + +24 17:13:24 17:14:00 + + +30 17:14:18 17:14:56 +Vst= 28.5 + +31 17:15:06 17:16:07 +Rom_sol= 13.3 + +41 17:16:33 17:16:38 +Ukz= 1.17 + +32 17:16:41 17:17:47 +Imax=11.3 Umax=50.0 T= 9.4 + +33 17:17:50 17:18:19 +Imin=16.5 Umin=25.1 T= 0.8 + +34 17:18:22 17:18:49 +V=301.8 T= 9.5 + +35 17:18:53 17:19:51 +Q= 54.8 T= 9.2 + +36 17:19:54 17:20:28 +P1=0.28 T= 3.0 + +37 17:20:32 17:21:09 +T= 0.7 + +38 17:21:13 17:21:19 +t= 51.6 T= 0.7 + +39 17:21:23 17:21:28 +t= 51.5 T= 0.5 + +40 17:21:31 17:21:37 +t= 51.6 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.103 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.103 new file mode 100644 index 0000000..992f9e8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.103 @@ -0,0 +1,17 @@ +12 00:11:50 1594321910 +13 01:59:46 1594328386 +0 01:59:46 1594328386 +14 02:34:27 1594330467 +15 03:13:38 1594332818 +16 03:34:13 1594334053 +16 03:39:07 1594334347 +1 03:59:34 1594335574 +2 04:56:35 1594338995 +5 05:40:36 1594341636 +6 05:51:00 1594342260 +7 06:24:11 1594344251 +8 08:54:55 1594353295 +25 17:14:16 1594383256 +9 17:22:30 1594383750 +10 17:51:12 1594385472 +11 21:30:04 1594398604 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.104 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.104 new file mode 100644 index 0000000..afeeea9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.104 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.106 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.106 new file mode 100644 index 0000000..ba52908 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.106 @@ -0,0 +1,99 @@ +[00] +oper = 12 +begin = 10.07.2020 00:11:50 +norma = 105 +real = 107 + +[01] +oper = 13 +begin = 10.07.2020 01:59:46 +norma = 45 +real = 34 + +[02] +oper = 14 +begin = 10.07.2020 02:34:27 +norma = 40 +vac_time = 7 +real = 39 + +[03] +oper = 15 +begin = 10.07.2020 03:13:38 +norma = 30 +real = 20 + +[04] +oper = 16 +begin = 10.07.2020 03:34:13 +norma = 40 +real = 4 + +[05] +oper = 16 +begin = 10.07.2020 03:39:07 +norma = 40 +real = 20 + +[06] +oper = 1 +begin = 10.07.2020 03:59:34 +norma = 85 +real = 57 + +[07] +oper = 2 +begin = 10.07.2020 04:56:35 +norma = 110 +vac_time = 7 +real = 44 + +[08] +oper = 5 +begin = 10.07.2020 05:40:36 +norma = 25 +real = 10 + +[09] +oper = 6 +begin = 10.07.2020 05:51:00 +norma = 35 +real = 33 + +[10] +oper = 7 +begin = 10.07.2020 06:24:11 +norma = 30 +real = 150 + +[11] +oper = 8 +begin = 10.07.2020 08:54:55 +norma = 40 +vac_time = 8 +real = 499 + +[12] +oper = 25 +begin = 10.07.2020 17:14:16 +norma = 30 +real = 8 + +[13] +oper = 9 +begin = 10.07.2020 17:22:30 +norma = 0 +real = 28 + +[14] +oper = 10 +begin = 10.07.2020 17:51:12 +norma = 0 +real = 218 + +[15] +oper = 11 +begin = 10.07.2020 21:30:04 +norma = 0 +real = 163 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.107 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.107 new file mode 100644 index 0000000..d754c83 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.107 @@ -0,0 +1,28 @@ +00:11:46 1594321906 ⪫祭 ० (A) +00:11:48 1594321908 ⪫祭 +00:11:48 1594321908 : +00:11:52 1594321912 ⪫祭 ० ' ⮪ 㣨' +00:41:48 1594323708 : 믮 +03:12:46 1594332766 祭 ० ࠧ +03:12:48 1594332768 祭 ० ' ⮪ 㣨' +03:14:29 1594332869 祭 ॣ '-2'(A) +03:33:06 1594333986 ⪫祭 ० ' ⮪ 㣨' +03:33:40 1594334020 ⪫祭 ० ࠧ +03:39:11 1594334351 ⪫祭 ॣ '-2'(A) +04:59:38 1594339178 : 㦥 +17:13:25 1594383205 祭 ॣ '-2'(A) +17:14:00 1594383240 ⪫祭 ॣ '-2'(A) +17:15:01 1594383301 ' ' +17:15:01 1594383301 祭 +17:15:07 1594383307 祭 +17:16:07 1594383367 ⪫祭 +17:21:59 1594383719 祭 ० ࠧ +17:22:02 1594383722 祭 ० ' ⮪ 㣨' +17:22:31 1594383751 : 믮 +17:39:12 1594384752 祭 ॣ '-2'(A) +17:51:12 1594385472 ⪫祭 ० ࠧ (A) +17:51:12 1594385472 祭 ॣ . 殮 㣨 +21:30:04 1594398604 祭 ० +21:30:05 1594398605 ⪫祭 ॣ '-2'(A) +21:30:06 1594398606 祭 ॣ '-2'(A) +22:20:05 1594401605 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.109 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.109 new file mode 100644 index 0000000..722636c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.109 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.110 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.110 new file mode 100644 index 0000000..152335a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.110 @@ -0,0 +1,7 @@ +03:12:05 1594332725 1 10826 2 BT 3-1, 6, 8, 9, 14, 15, 16 7 920 9 4975 10 840 11 +11:53:00 1594363980 10 770 +11:54:34 1594364074 10 840 +12:20:01 1594365601 1 10826 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 37 4 2 5 Ti 6 7 920 8 3100 9 4975 10 840 11 12 321438 +13:01:16 1594368076 0 A--32-034-2016 ॢ 2 +21:56:20 1594400180 3 14 +23:16:21 1594404981 0 A--32-120-2016 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.111 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.111 new file mode 100644 index 0000000..7aa0bfb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.111 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.112 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.112 new file mode 100644 index 0000000..c25c1ad --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.112 @@ -0,0 +1,72 @@ +21 03:12:22 03:12:25 +Rsk= 22.2 Rkk= 18.9 + +22 03:42:22 03:57:27 +P1= 59.3 T1=03:52:27 P2= 75.6 T2=03:57:27 Vs= 3.24 + +22 04:04:56 04:20:00 +P1= 51.4 T1=04:15:00 P2= 64.6 T2=04:20:00 Vs= 2.65 + +21 06:29:10 06:29:13 +Rsk= 22.1 Rkk= 18.8 + +20 06:39:53 06:40:01 +Riz_sol= 4856.9 + +22 07:36:40 07:51:45 +P1= 49.2 T1=07:46:45 P2= 66.6 T2=07:51:45 Vs= 3.47 + +22 08:15:12 08:25:16 +P1= 30.1 T1=08:20:16 P2= 44.7 T2=08:25:16 Vs= 2.92 + +22 12:00:03 12:10:07 +P1= 31.2 T1=12:05:07 P2= 43.3 T2=12:10:07 Vs= 2.43 + +23 12:10:35 12:10:40 + + +24 12:10:45 12:11:23 + + +30 12:12:59 12:13:25 +Vst= 30.0 + +31 12:13:30 12:13:58 +Rom_sol= 14.0 + +41 12:14:32 12:14:37 +Ukz= 1.08 + +32 12:14:40 12:15:15 +Imax=27.0 Umax=55.0 T= 9.0 + +33 12:15:19 12:15:41 +Imin=15.9 Umin=25.0 T= 0.5 + +34 12:15:45 12:16:07 +V=300.2 T= 9.4 + +35 12:16:11 12:17:26 +Q= 54.0 T= 9.4 + +36 12:17:30 12:18:04 +P1=0.29 T= 2.9 + +37 12:18:08 12:18:38 +T= 0.9 + +38 12:18:42 12:18:49 +t= 51.3 T= 0.5 + +39 12:18:52 12:19:08 +tcam= 53.4 Tcam= 0.5 tfl= 52.2 Tfl= 0.5 + +40 12:19:11 12:19:18 +t= 53.2 T= 0.5 + +21 21:55:12 21:55:15 +Rsk= 21.7 Rkk= 18.3 + +22 22:29:13 22:39:18 +P1= 26.5 T1=22:34:18 P2= 41.9 T2=22:39:18 Vs= 3.07 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.113 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.113 new file mode 100644 index 0000000..b6665bd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.113 @@ -0,0 +1,17 @@ +13 00:24:07 1594322647 +0 00:24:07 1594322647 +2 03:09:37 1594332577 +5 04:22:24 1594336944 +6 04:35:03 1594337703 +7 05:14:44 1594340084 +8 06:26:01 1594344361 +25 12:12:56 1594365176 +9 12:20:01 1594365601 +10 13:01:16 1594368076 +11 15:17:26 1594376246 +12 19:27:41 1594391261 +13 21:33:54 1594398834 +0 21:33:54 1594398834 +14 21:53:32 1594400012 +15 22:45:43 1594403143 +16 23:18:09 1594405089 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.114 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.114 new file mode 100644 index 0000000..50bb07f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.114 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.116 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.116 new file mode 100644 index 0000000..67098c6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.116 @@ -0,0 +1,94 @@ +[29] +oper = 13 +begin = 10.07.2020 00:24:07 +norma = 45 +real = 165 + +[30] +oper = 2 +begin = 10.07.2020 03:09:37 +norma = 110 +vac_time = 8 +real = 72 + +[31] +oper = 5 +begin = 10.07.2020 04:22:24 +norma = 25 +real = 12 + +[32] +oper = 6 +begin = 10.07.2020 04:35:03 +norma = 35 +real = 39 + +[33] +oper = 7 +begin = 10.07.2020 05:14:44 +norma = 30 +real = 71 + +[34] +oper = 8 +begin = 10.07.2020 06:26:01 +norma = 40 +vac_time = 15 +real = 346 + +[35] +oper = 25 +begin = 10.07.2020 12:12:56 +norma = 30 +real = 7 + +[36] +oper = 9 +begin = 10.07.2020 12:20:01 +norma = 0 +real = 41 + +[37] +oper = 10 +begin = 10.07.2020 13:01:16 +norma = 0 +real = 136 + +[38] +oper = 11 +begin = 10.07.2020 15:17:26 +norma = 0 +real = 250 + +[39] +oper = 12 +begin = 10.07.2020 19:27:41 +norma = 105 +real = 126 + +[40] +oper = 13 +begin = 10.07.2020 21:33:54 +norma = 45 +real = 19 + +[41] +oper = 14 +begin = 10.07.2020 21:53:32 +norma = 40 +vac_time = 7 +vac_avg10 = 10.8 +real = 52 + +[42] +oper = 15 +begin = 10.07.2020 22:45:43 +norma = 30 +real = 32 + +[43] +oper = 16 +begin = 10.07.2020 23:18:09 +norma = 40 +real = 62 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.117 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.117 new file mode 100644 index 0000000..0c9469d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.117 @@ -0,0 +1,28 @@ +04:35:35 1594337735 祭 ० ᪠ +04:35:35 1594337735 祭 ० ᪠ +04:35:35 1594337735 祭 ० ᪠ +04:35:35 1594337735 祭 ० ᪠ +04:37:45 1594337865 ⪫祭 ० ᪠ (A) +12:10:47 1594365047 祭 ॣ '-2'(A) +12:11:24 1594365084 ⪫祭 ॣ '-2'(A) +12:19:29 1594365569 祭 ० ࠧ +12:19:32 1594365572 祭 ० ' ⮪ 㣨' +12:41:17 1594366877 祭 ॣ '-2'(A) +13:01:16 1594368076 祭 ⠭ ॣ +13:01:16 1594368076 ⪫祭 ० ࠧ (A) +15:17:25 1594376245 祭 ० +15:17:26 1594376246 ⪫祭 ॣ '-2'(A) +15:17:27 1594376247 祭 ॣ '-2'(A) +16:17:27 1594379847 ⪫祭 ॣ '-2'(A) +19:27:37 1594391257 ⪫祭 ० (A) +19:27:42 1594391262 ⪫祭 ० ' ⮪ 㣨' +19:29:14 1594391354 祭 ० ᪠ +19:31:42 1594391502 ⪫祭 ० ᪠ (A) +22:45:22 1594403122 祭 ० ࠧ +22:45:23 1594403123 祭 ० ' ⮪ 㣨' +22:45:24 1594403124 祭 ॣ '-2'(A) +23:16:21 1594404981 ⪫祭 ० ࠧ (A) +23:16:35 1594404995 ⪫祭 ० ' ⮪ 㣨' +23:18:12 1594405092 ⪫祭 ॣ '-2'(A) +23:18:30 1594405110 祭 ० ᪠ +23:20:22 1594405222 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.119 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.119 new file mode 100644 index 0000000..5225265 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.119 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.120 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.120 new file mode 100644 index 0000000..bc33ae9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.120 @@ -0,0 +1,4 @@ +00:31:31 1594323091 1 10887 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 1000 8 8450 9 8370 10 920 11 12 321438 +17:43:37 1594385017 1 10888 2 BT 18, 20, 22, 23, 25 3 25 4 3 7 870 9 4720 10 770 11 +22:58:32 1594403912 1 10888 2 BT 18, 20, 22, 23, 25 3 25 4 3 5 Ti 6 7 870 8 8450 9 4720 10 770 11 12 321438 +23:29:11 1594405751 0 A--32-078-2017 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.121 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.121 new file mode 100644 index 0000000..3708b3d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.121 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.122 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.122 new file mode 100644 index 0000000..b45e057 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.122 @@ -0,0 +1,111 @@ +22 00:06:21 00:21:28 +P1= 43.5 T1=00:16:28 P2= 57.1 T2=00:21:28 Vs= 2.72 + +23 00:22:07 00:22:12 + + +24 00:22:20 00:23:01 + + +30 00:23:17 00:23:43 +Vst= 30.9 + +31 00:23:48 00:24:27 +Rom_sol= 14.4 + +41 00:25:11 00:25:16 +Ukz= 0.68 + +32 00:25:22 00:25:57 +Imax=27.0 Umax=55.0 T= 9.0 + +33 00:26:05 00:26:24 +Imin=16.0 Umin=24.9 T= 0.5 + +34 00:26:30 00:26:52 +V=300.3 T= 9.4 + +35 00:26:58 00:27:56 +Q= 53.7 T= 9.4 + +36 00:28:34 00:29:06 +P1=0.29 T= 2.9 + +37 00:29:12 00:29:42 +T= 0.9 + +38 00:29:48 00:29:57 +t= 53.4 T= 0.5 + +39 00:30:04 00:30:27 +tcam= 53.1 Tcam= 0.5 tfl= 53.2 Tfl= 0.5 + +40 00:30:37 00:30:44 +t= 53.4 T= 0.5 + +21 17:42:24 17:42:27 +Rsk= 14.5 Rkk= 10.5 + +22 18:24:12 18:39:19 +P1= 55.6 T1=18:34:19 P2= 71.9 T2=18:39:19 Vs= 3.26 + +22 18:54:10 19:09:17 +P1= 45.8 T1=19:04:17 P2= 59.0 T2=19:09:17 Vs= 2.64 + +20 21:07:25 21:07:34 +Riz_sol= 4976.3 + +21 21:07:42 21:07:45 +Rsk= 14.3 Rkk= 10.4 + +22 21:57:37 22:12:44 +P1= 43.6 T1=22:07:44 P2= 56.0 T2=22:12:44 Vs= 2.48 + +22 22:35:14 22:45:20 +P1= 20.0 T1=22:40:20 P2= 33.1 T2=22:45:20 Vs= 2.61 + +23 22:46:05 22:46:10 + + +24 22:46:17 22:46:54 + + +30 22:47:06 22:47:38 +Vst= 31.0 + +31 22:47:42 22:47:47 +Rom_sol= -1.0 + +31 22:48:22 22:49:25 +Rom_sol= 9.2 + +41 22:50:09 22:50:14 +Ukz= 0.69 + +32 22:50:17 22:51:08 +Imax=11.0 Umax=50.0 T= 9.0 + +33 22:51:12 22:51:43 +Imin=16.0 Umin=24.9 T= 0.5 + +34 22:51:46 22:52:24 +V=300.2 T= 9.4 + +35 22:52:27 22:53:30 +Q= 52.1 T= 9.4 + +36 22:53:33 22:54:08 +P1=0.27 T= 2.9 + +37 22:54:11 22:54:49 +T= 0.9 + +38 22:54:51 22:55:00 +t= 53.4 T= 0.5 + +39 22:55:02 22:55:25 +tcam= 52.0 Tcam= 0.5 tfl= 53.1 Tfl= 0.5 + +40 22:55:30 22:55:38 +t= 52.4 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.123 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.123 new file mode 100644 index 0000000..a793452 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.123 @@ -0,0 +1,14 @@ +25 00:23:15 1594322595 +9 00:31:31 1594323091 +10 01:29:15 1594326555 +12 06:08:02 1594343282 +13 12:22:47 1594365767 +0 12:22:47 1594365767 +2 17:37:11 1594384631 +5 19:10:19 1594390219 +6 19:20:40 1594390840 +7 19:51:27 1594392687 +8 21:04:02 1594397042 +25 22:47:02 1594403222 +9 22:58:32 1594403912 +10 23:29:11 1594405751 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.124 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.124 new file mode 100644 index 0000000..1147360 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.124 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.125 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.125 new file mode 100644 index 0000000..42d42d4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.125 @@ -0,0 +1 @@ +92 22:47:47 1594403267 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.126 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.126 new file mode 100644 index 0000000..5563d63 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.126 @@ -0,0 +1,80 @@ +[24] +oper = 25 +begin = 10.07.2020 00:23:15 +norma = 30 +real = 8 + +[25] +oper = 9 +begin = 10.07.2020 00:31:31 +norma = 0 +real = 57 + +[26] +oper = 10 +begin = 10.07.2020 01:29:15 +norma = 0 +real = 278 + +[27] +oper = 12 +begin = 10.07.2020 06:08:02 +norma = 180 +real = 374 + +[28] +oper = 13 +begin = 10.07.2020 12:22:47 +norma = 45 +real = 314 + +[29] +oper = 2 +begin = 10.07.2020 17:37:11 +norma = 110 +vac_time = 7 +real = 93 + +[30] +oper = 5 +begin = 10.07.2020 19:10:19 +norma = 25 +real = 10 + +[31] +oper = 6 +begin = 10.07.2020 19:20:40 +norma = 35 +real = 30 + +[32] +oper = 7 +begin = 10.07.2020 19:51:27 +norma = 30 +real = 72 + +[33] +oper = 8 +begin = 10.07.2020 21:04:02 +norma = 40 +vac_time = 7 +real = 103 + +[34] +oper = 25 +begin = 10.07.2020 22:47:02 +norma = 30 +real = 11 + +[35] +oper = 9 +begin = 10.07.2020 22:58:32 +norma = 0 +real = 30 + +[36] +oper = 10 +begin = 10.07.2020 23:29:11 +norma = 0 +real = 262 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.127 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.127 new file mode 100644 index 0000000..0f8aa59 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.127 @@ -0,0 +1,27 @@ +00:22:25 1594322545 祭 ॣ '-2'(A) +00:23:03 1594322583 ⪫祭 ॣ '-2'(A) +00:36:42 1594323402 祭 ॣ '-2' +01:29:14 1594326554 祭 ⠭ ॣ +06:08:05 1594343285 ⪫祭 ॣ '-2'(A) +06:08:33 1594343313 祭 ० ᪠ +06:08:33 1594343313 祭 ० ᪠ +06:08:33 1594343313 祭 ० ᪠ +06:08:34 1594343314 祭 ० ᪠ +06:08:34 1594343314 祭 ० ᪠ +06:08:34 1594343314 祭 ० ᪠ +06:11:59 1594343519 ⪫祭 ० ᪠ +17:43:41 1594385021 : 㦥 +19:26:29 1594391189 祭 ० ᪠ +19:26:30 1594391190 祭 ० ᪠ +19:28:53 1594391333 ⪫祭 ० ᪠ (A) +22:46:18 1594403178 祭 ॣ '-2'(A) +22:46:54 1594403214 ⪫祭 ॣ '-2'(A) +22:48:25 1594403305 祭 +22:48:25 1594403305 祭 +22:49:25 1594403365 ⪫祭 +22:58:06 1594403886 祭 ० ࠧ +22:58:08 1594403888 祭 ० ' ⮪ 㣨' +22:58:33 1594403913 : 믮 +23:14:43 1594404883 祭 ॣ '-2'(A) +23:29:11 1594405751 ⪫祭 ० ࠧ (A) +23:29:12 1594405752 祭 ॣ . 殮 㣨 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.129 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.129 new file mode 100644 index 0000000..5b2da88 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.129 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.150 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.150 new file mode 100644 index 0000000..80536db --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.150 @@ -0,0 +1,2 @@ +15:59:17 1594378757 1 05005 2 BT 18, 20, 22, 23, 25 3 25 4 1 5 Ti 6 7 770 8 4050 9 5120 10 650 11 12 320995 +16:33:12 1594380792 0 A--32-129-2018 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.151 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.151 new file mode 100644 index 0000000..db112dc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.151 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.152 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.152 new file mode 100644 index 0000000..dd99e21 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.152 @@ -0,0 +1,54 @@ +20 10:19:53 10:20:01 +Riz_sol= 772.2 + +21 10:20:09 10:20:12 +Rsk= 46.1 Rkk= 18.3 + +22 11:16:12 11:26:27 +P1= 16.3 T1=11:21:27 P2= 30.6 T2=11:26:27 Vs= 2.88 + +22 15:40:33 15:50:48 +P1= 14.0 T1=15:45:48 P2= 22.6 T2=15:50:48 Vs= 1.73 + +23 15:51:02 15:51:08 + + +24 15:51:55 15:52:31 + + +30 15:52:51 15:53:17 +Vst= 47.8 + +31 15:53:22 15:53:57 +Rom_sol= 11.1 + +41 15:54:20 15:54:25 +Ukz= 1.70 + +32 15:54:32 15:55:08 +Imax=10.9 Umax=50.0 T= 9.0 + +33 15:55:11 15:55:29 +Imin=15.9 Umin=25.0 T= 0.5 + +34 15:55:32 15:55:55 +V=300.1 T= 9.8 + +35 15:55:58 15:57:04 +Q= 54.4 T= 9.8 + +36 15:57:06 15:57:42 +P1=0.28 T= 3.4 + +37 15:57:44 15:58:04 +T= 1.3 + +38 15:58:07 15:58:14 +t= 51.2 T= 1.0 + +39 15:58:17 15:58:24 +t= 52.0 T= 0.9 + +40 15:58:27 05:00:00 +t= 53.3 T= 0.9 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.153 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.153 new file mode 100644 index 0000000..6034296 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.153 @@ -0,0 +1,8 @@ +5 07:29:55 1594348195 +6 07:40:41 1594348841 +7 08:29:35 1594351775 +8 10:18:03 1594358283 +25 15:52:41 1594378361 +9 15:59:17 1594378757 +10 16:33:12 1594380792 +12 20:51:17 1594396277 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.154 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.154 new file mode 100644 index 0000000..474a028 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.154 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.156 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.156 new file mode 100644 index 0000000..5cffa7a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.156 @@ -0,0 +1,50 @@ +[80] +oper = 5 +begin = 10.07.2020 07:29:55 +norma = 25 +real = 10 + +[81] +oper = 6 +begin = 10.07.2020 07:40:41 +norma = 35 +real = 48 + +[82] +oper = 7 +begin = 10.07.2020 08:29:35 +norma = 30 +real = 108 + +[83] +oper = 8 +begin = 10.07.2020 10:18:03 +norma = 40 +vac_time = 9 +vac_avg10 = 10.3 +real = 334 + +[84] +oper = 25 +begin = 10.07.2020 15:52:41 +norma = 30 +real = 6 + +[85] +oper = 9 +begin = 10.07.2020 15:59:17 +norma = 0 +real = 33 + +[86] +oper = 10 +begin = 10.07.2020 16:33:12 +norma = 0 +real = 258 + +[87] +oper = 12 +begin = 10.07.2020 20:51:17 +norma = 105 +real = 263 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.157 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.157 new file mode 100644 index 0000000..8c032f0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.157 @@ -0,0 +1,18 @@ +15:51:22 1594378282 祭 ॣ '-2'(A) +15:51:47 1594378307 ⪫祭 ॣ '-2'(A) +15:51:56 1594378316 祭 ॣ '-2'(A) +15:52:32 1594378352 ⪫祭 ॣ '-2'(A) +16:00:02 1594378802 祭 ० ࠧ +16:00:03 1594378803 祭 ० ' ⮪ 㣨' +16:01:15 1594378875 祭 ॣ '-2'(A) +16:33:12 1594380792 祭 ⠭ ॣ +16:33:12 1594380792 ⪫祭 ० ࠧ (A) +20:36:04 1594395364 祭 ० +20:36:05 1594395365 ⪫祭 ॣ '-2'(A) +20:36:06 1594395366 祭 ॣ '-2'(A) +20:40:46 1594395646 ⪫祭 ० ' ⮪ 㣨' +20:51:20 1594396280 ⪫祭 ॣ '-2'(A) +20:51:51 1594396311 祭 ० ᪠ +20:51:51 1594396311 祭 ० ᪠ +20:54:34 1594396474 ⪫祭 ० ᪠ (A) +21:46:05 1594399565 ⪫祭 ० (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.159 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.159 new file mode 100644 index 0000000..a9ac26c Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.159 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.160 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.160 new file mode 100644 index 0000000..a4c67dd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.160 @@ -0,0 +1,4 @@ +10:18:14 1594358294 3 14 +14:09:22 1594372162 1 05371 3 25 9 5850 12 320995 +22:59:27 1594403967 1 05371 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 870 8 5240 9 5850 10 770 11 12 320995 +23:30:10 1594405810 0 A--32-078-2017 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.161 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.161 new file mode 100644 index 0000000..df5dda0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.161 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.162 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.162 new file mode 100644 index 0000000..36a42c3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.162 @@ -0,0 +1,66 @@ +21 10:18:29 10:18:32 +Rsk= 45.6 Rkk= 18.7 + +22 10:41:35 10:51:39 +P1= 25.7 T1=10:46:39 P2= 41.3 T2=10:51:39 Vs= 3.12 + +21 14:09:45 14:09:48 +Rsk= 21.9 Rkk= 19.0 + +22 14:51:15 15:06:20 +P1= 45.0 T1=15:01:20 P2= 56.2 T2=15:06:20 Vs= 2.26 + +20 18:08:30 18:08:39 +Riz_sol= 2293.8 + +21 18:08:47 18:08:50 +Rsk= 45.5 Rkk= 19.5 + +22 18:36:28 18:51:33 +P1= 42.8 T1=18:46:33 P2= 56.4 T2=18:51:33 Vs= 2.73 + +22 22:39:33 22:49:38 +P1= 34.8 T1=22:44:38 P2= 37.7 T2=22:49:38 Vs= 0.59 + +23 22:49:46 22:49:51 + + +24 22:49:56 22:50:32 + + +30 22:50:41 22:51:03 +Vst= 33.0 + +31 22:51:07 22:52:08 +Rom_sol= 14.0 + +41 22:52:37 22:52:42 +Ukz= 0.70 + +32 22:52:44 22:53:19 +Imax=11.3 Umax=50.1 T= 9.0 + +33 22:53:24 22:53:42 +Imin=16.4 Umin=25.0 T= 0.5 + +34 22:53:45 22:54:08 +V=300.1 T= 9.6 + +35 22:54:11 22:55:10 +Q= 51.9 T= 9.6 + +36 22:55:13 22:56:06 +P1=0.29 T= 3.1 + +37 22:56:09 22:56:37 +T= 1.1 + +38 22:56:40 22:56:46 +t= 52.8 T= 0.9 + +39 22:56:50 22:57:05 +tcam= 55.3 Tcam= 0.8 tfl= 55.5 Tfl= 0.9 + +40 22:57:08 22:57:14 +t= 53.3 T= 0.9 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.163 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.163 new file mode 100644 index 0000000..bf632cf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.163 @@ -0,0 +1,16 @@ +11 03:52:36 1594335156 +12 07:23:38 1594347818 +13 09:31:33 1594355493 +0 09:31:33 1594355493 +14 10:18:04 1594358284 +15 10:53:39 1594360419 +16 11:30:26 1594362626 +1 12:09:06 1594364946 +2 14:06:10 1594371970 +5 15:07:03 1594375623 +6 15:19:06 1594376346 +7 16:12:05 1594379525 +8 18:04:56 1594386296 +25 22:50:40 1594403440 +9 22:59:27 1594403967 +10 23:30:10 1594405810 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.164 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.164 new file mode 100644 index 0000000..e904e02 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.164 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.166 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.166 new file mode 100644 index 0000000..2fb987a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.166 @@ -0,0 +1,93 @@ +[70] +oper = 11 +begin = 10.07.2020 03:52:36 +norma = 0 +real = 211 + +[71] +oper = 12 +begin = 10.07.2020 07:23:38 +norma = 105 +real = 127 + +[72] +oper = 13 +begin = 10.07.2020 09:31:33 +norma = 45 +real = 46 + +[73] +oper = 14 +begin = 10.07.2020 10:18:04 +norma = 40 +vac_time = 8 +real = 35 + +[74] +oper = 15 +begin = 10.07.2020 10:53:39 +norma = 30 +real = 36 + +[75] +oper = 16 +begin = 10.07.2020 11:30:26 +norma = 40 +real = 38 + +[76] +oper = 1 +begin = 10.07.2020 12:09:06 +norma = 85 +real = 117 + +[77] +oper = 2 +begin = 10.07.2020 14:06:10 +norma = 110 +vac_time = 10 +real = 60 + +[78] +oper = 5 +begin = 10.07.2020 15:07:03 +norma = 25 +real = 12 + +[79] +oper = 6 +begin = 10.07.2020 15:19:06 +norma = 35 +real = 52 + +[80] +oper = 7 +begin = 10.07.2020 16:12:05 +norma = 30 +real = 112 + +[81] +oper = 8 +begin = 10.07.2020 18:04:56 +norma = 40 +vac_time = 9 +real = 285 + +[82] +oper = 25 +begin = 10.07.2020 22:50:40 +norma = 30 +real = 8 + +[83] +oper = 9 +begin = 10.07.2020 22:59:27 +norma = 0 +real = 30 + +[84] +oper = 10 +begin = 10.07.2020 23:30:10 +norma = 0 +real = 343 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.167 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.167 new file mode 100644 index 0000000..90c39b5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.167 @@ -0,0 +1,43 @@ +03:52:35 1594335155 祭 ० +03:52:35 1594335155 ⪫祭 ॣ '-2'(A) +03:52:36 1594335156 祭 ॣ '-2'(A) +04:48:38 1594338518 ⪫祭 ॣ '-2'(A) +07:23:37 1594347817 ⪫祭 ० (A) +07:23:38 1594347818 ⪫祭 +07:23:38 1594347818 : +07:23:39 1594347819 ⪫祭 ० ' ⮪ 㣨' +07:24:20 1594347860 祭 ० ᪠ +07:24:21 1594347861 祭 ० ᪠ +07:24:21 1594347861 祭 ० ᪠ +07:24:21 1594347861 祭 ० ᪠ +07:24:21 1594347861 祭 ० ᪠ +07:24:44 1594347884 ⪫祭 ० ᪠ +07:24:50 1594347890 祭 ० ᪠ +07:27:17 1594348037 ⪫祭 ० ᪠ (A) +07:33:38 1594348418 : 믮 +10:52:17 1594360337 祭 ० ࠧ +10:52:20 1594360340 祭 ० ' ⮪ 㣨' +10:52:28 1594360348 ⪫祭 ० ࠧ +10:52:31 1594360351 ⪫祭 ० ' ⮪ 㣨' +10:53:36 1594360416 祭 ० ࠧ +10:53:44 1594360424 祭 ० ' ⮪ 㣨' +10:53:45 1594360425 祭 ॣ '-2'(A) +11:07:37 1594361257 ⪫祭 ० ' ⮪ 㣨' +11:30:30 1594362630 ⪫祭 ॣ '-2'(A) +11:30:40 1594362640 祭 ० ᪠ +11:33:05 1594362785 ⪫祭 ० ᪠ (A) +14:09:24 1594372164 : 㦥 +15:19:15 1594376355 祭 ० ᪠ +15:19:16 1594376356 祭 ० ᪠ +15:21:37 1594376497 ⪫祭 ० ᪠ (A) +22:49:58 1594403398 祭 ॣ '-2'(A) +22:50:34 1594403434 ⪫祭 ॣ '-2'(A) +22:50:48 1594403448 祭 +22:51:09 1594403469 祭 +22:52:09 1594403529 ⪫祭 +22:59:02 1594403942 祭 ० ࠧ +22:59:04 1594403944 祭 ० ' ⮪ 㣨' +22:59:28 1594403968 : 믮 +23:15:41 1594404941 祭 ॣ '-2'(A) +23:30:10 1594405810 ⪫祭 ० ࠧ (A) +23:30:10 1594405810 祭 ॣ . 殮 㣨 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.169 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.169 new file mode 100644 index 0000000..8136ba5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.169 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.170 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.170 new file mode 100644 index 0000000..2303ecd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.170 @@ -0,0 +1,7 @@ +02:19:34 1594329574 1 09248 2 p. cao M1,M2,M3,M4 3 37 4 2 7 870 9 4850 10 770 +02:21:28 1594329688 9 4050 +06:04:19 1594343059 1 09248 2 p. cao M1,M2,M3,M4 3 37 4 2 5 Ti 6 7 870 8 4460 9 4050 10 770 11 12 321173 +15:22:31 1594376551 3 14 +19:14:54 1594390494 1 09245 3 32 4 1 8 4700 9 7280 10 750 12 321847 +19:18:20 1594390700 1 09249 +22:31:11 1594402271 3 30 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.171 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.171 new file mode 100644 index 0000000..485dd1d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.171 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.172 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.172 new file mode 100644 index 0000000..b837c85 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.172 @@ -0,0 +1,81 @@ +21 02:18:29 02:18:37 +Rsk= 13.3 Rkk= 7.7 + +22 03:14:45 03:30:15 +P1= 39.5 T1=03:25:15 P2= 52.3 T2=03:30:15 Vs= 2.56 + +21 05:08:01 05:08:09 +Rsk= 13.4 Rkk= 7.9 + +20 05:08:59 05:09:08 +Riz_sol=10246.7 + +22 05:40:16 05:55:47 +P1= 45.5 T1=05:50:47 P2= 59.4 T2=05:55:47 Vs= 2.77 + +23 05:55:52 05:55:59 + + +24 05:56:05 05:56:38 + + +30 05:56:49 05:57:45 +Vst= 28.7 + +31 05:57:49 05:58:26 +Rom_sol= 9.9 + +32 05:58:59 06:00:08 +Imax=27.3 Umax=54.9 T= 9.4 + +33 06:00:11 06:00:40 +Imin=16.0 Umin=25.1 T= 0.8 + +34 06:00:43 06:01:11 +V=301.2 T= 9.6 + +35 06:01:21 06:02:21 +Q= 54.8 T= 9.2 + +36 06:02:25 06:03:00 +P1=0.27 T= 3.1 + +37 06:03:03 06:03:38 +T= 0.7 + +38 06:03:42 06:03:48 +t= 51.5 T= 0.5 + +39 06:03:51 06:03:56 +t= 51.4 T= 0.5 + +40 06:03:59 06:04:05 +t= 51.4 T= 0.7 + +21 14:47:31 14:47:38 +Rsk= 13.1 Rkk= 7.5 + +22 15:09:50 15:20:23 +P1= 16.2 T1=15:15:23 P2= 36.8 T2=15:20:23 Vs= 4.14 + +21 19:12:18 19:12:26 +Rsk= 13.1 Rkk= 7.5 + +22 19:41:26 19:56:57 +P1= 88.7 T1=19:51:57 P2=115.7 T2=19:56:57 Vs= 5.41 + +22 20:10:01 20:25:32 +P1= 60.3 T1=20:20:32 P2= 78.9 T2=20:25:32 Vs= 3.71 + +22 20:40:03 20:55:34 +P1= 45.8 T1=20:50:34 P2= 60.6 T2=20:55:34 Vs= 2.95 + +20 22:25:10 22:25:19 +Riz_sol= 1123.2 + +21 22:25:24 22:25:32 +Rsk= 13.3 Rkk= 7.7 + +22 23:25:24 23:40:55 +P1= 35.5 T1=23:35:55 P2= 46.9 T2=23:40:55 Vs= 2.28 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.173 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.173 new file mode 100644 index 0000000..9ee5c71 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.173 @@ -0,0 +1,21 @@ +2 02:14:04 1594329244 +5 03:30:44 1594333844 +6 03:43:10 1594334590 +7 04:24:46 1594337086 +8 05:05:50 1594339550 +25 05:56:44 1594342604 +9 06:04:19 1594343059 +10 06:40:11 1594345211 +11 08:42:04 1594352524 +12 12:01:59 1594364519 +13 14:12:42 1594372362 +0 14:12:42 1594372362 +14 14:44:20 1594374260 +15 15:23:25 1594376605 +16 15:59:35 1594378775 +1 16:48:05 1594381685 +2 19:08:26 1594390106 +5 20:56:24 1594396584 +6 21:06:50 1594397210 +7 21:44:03 1594399443 +8 22:21:18 1594401678 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.174 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.174 new file mode 100644 index 0000000..d0ef4c6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.174 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.176 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.176 new file mode 100644 index 0000000..9915892 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.176 @@ -0,0 +1,126 @@ +[17] +oper = 2 +begin = 10.07.2020 02:14:04 +norma = 110 +vac_time = 8 +real = 76 + +[18] +oper = 5 +begin = 10.07.2020 03:30:44 +norma = 25 +real = 12 + +[19] +oper = 6 +begin = 10.07.2020 03:43:10 +norma = 35 +real = 41 + +[20] +oper = 7 +begin = 10.07.2020 04:24:46 +norma = 30 +real = 41 + +[21] +oper = 8 +begin = 10.07.2020 05:05:50 +norma = 40 +vac_time = 7 +real = 50 + +[22] +oper = 25 +begin = 10.07.2020 05:56:44 +norma = 30 +real = 7 + +[23] +oper = 9 +begin = 10.07.2020 06:04:19 +norma = 0 +real = 35 + +[24] +oper = 10 +begin = 10.07.2020 06:40:11 +norma = 0 +real = 121 + +[25] +oper = 11 +begin = 10.07.2020 08:42:04 +norma = 0 +real = 199 + +[26] +oper = 12 +begin = 10.07.2020 12:01:59 +norma = 105 +real = 130 + +[27] +oper = 13 +begin = 10.07.2020 14:12:42 +norma = 45 +real = 31 + +[28] +oper = 14 +begin = 10.07.2020 14:44:20 +norma = 40 +vac_time = 7 +real = 39 + +[29] +oper = 15 +begin = 10.07.2020 15:23:25 +norma = 30 +real = 36 + +[30] +oper = 16 +begin = 10.07.2020 15:59:35 +norma = 40 +real = 48 + +[31] +oper = 1 +begin = 10.07.2020 16:48:05 +norma = 85 +real = 140 + +[32] +oper = 2 +begin = 10.07.2020 19:08:26 +norma = 110 +vac_time = 8 +vac_avg10 = 8.3 +real = 107 + +[33] +oper = 5 +begin = 10.07.2020 20:56:24 +norma = 25 +real = 10 + +[34] +oper = 6 +begin = 10.07.2020 21:06:50 +norma = 35 +real = 37 + +[35] +oper = 7 +begin = 10.07.2020 21:44:03 +norma = 30 +real = 37 + +[36] +oper = 8 +begin = 10.07.2020 22:21:18 +norma = 40 +vac_time = 7 +real = 111 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.177 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.177 new file mode 100644 index 0000000..311a3ab --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.177 @@ -0,0 +1,41 @@ +03:43:22 1594334602 祭 ० ᪠ +03:46:19 1594334779 ⪫祭 ० ᪠ (A) +05:56:06 1594342566 祭 ॣ '-2'(A) +05:56:39 1594342599 ⪫祭 ॣ '-2'(A) +06:11:21 1594343481 祭 ॣ '-2' +06:40:10 1594345210 祭 ⠭ ॣ +12:02:04 1594364524 ⪫祭 ॣ '-2'(A) +12:02:16 1594364536 祭 ० ᪠ +12:02:16 1594364536 祭 ० ᪠ +12:02:17 1594364537 祭 ० ᪠ +12:02:17 1594364537 祭 ० ᪠ +12:02:17 1594364537 祭 ० ᪠ +12:05:22 1594364722 ⪫祭 ० ᪠ (A) +15:21:19 1594376479 祭 ० ࠧ +15:21:20 1594376480 祭 ० ' ⮪ 㣨' +15:21:59 1594376519 ⪫祭 ० ࠧ +15:22:01 1594376521 ⪫祭 ० ' ⮪ 㣨' +15:22:06 1594376526 祭 ० ࠧ +15:22:07 1594376527 祭 ० ' ⮪ 㣨' +15:22:13 1594376533 ⪫祭 ० ࠧ +15:22:15 1594376535 ⪫祭 ० ' ⮪ 㣨' +15:22:39 1594376559 祭 ० ࠧ +15:22:40 1594376560 祭 ० ' ⮪ 㣨' +15:22:47 1594376567 ⪫祭 ० ࠧ +15:22:48 1594376568 ⪫祭 ० ' ⮪ 㣨' +15:23:26 1594376606 祭 ० ࠧ +15:23:27 1594376607 祭 ० ' ⮪ 㣨' +15:23:28 1594376608 祭 ॣ '-2'(A) +15:58:59 1594378739 ⪫祭 ० ' ⮪ 㣨' +15:59:38 1594378778 ⪫祭 ० ࠧ +15:59:39 1594378779 ⪫祭 ॣ '-2'(A) +15:59:45 1594378785 祭 ० ᪠ +15:59:45 1594378785 祭 ० ᪠ +15:59:45 1594378785 祭 ० ᪠ +16:02:52 1594378972 ⪫祭 ० ᪠ (A) +21:07:51 1594397271 祭 ० ᪠ +21:07:52 1594397272 祭 ० ᪠ +21:07:52 1594397272 祭 ० ᪠ +21:10:31 1594397431 ⪫祭 ० ᪠ +21:10:33 1594397433 祭 ० ᪠ +21:10:41 1594397441 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.179 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.179 new file mode 100644 index 0000000..601fecc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.179 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.210 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.210 new file mode 100644 index 0000000..7de4a11 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.210 @@ -0,0 +1,5 @@ +05:56:01 1594342561 3 14 +07:04:55 1594346695 0 A--32-067-2014 ॢ 0 +10:51:29 1594360289 1 07198 2 p. cao M1,M2,M3,M4 3 25 7 770 9 5070 10 650 +16:13:09 1594379589 1 07198 2 p. cao M1,M2,M3,M4 3 25 4 1 5 Ti 6 7 770 8 5040 9 5070 10 650 11 12 320279 +16:18:36 1594379916 12 321173 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.211 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.211 new file mode 100644 index 0000000..ac64acb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.211 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.212 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.212 new file mode 100644 index 0000000..ca790d5 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.212 @@ -0,0 +1,72 @@ +21 05:55:42 05:55:45 +Rsk= 12.7 Rkk= 6.8 + +22 06:20:02 06:30:06 +P1= 33.0 T1=06:25:06 P2= 51.7 T2=06:30:06 Vs= 3.73 + +21 10:10:39 10:10:42 +Rsk= 12.2 Rkk= 6.4 + +21 10:51:45 10:51:48 +Rsk= 12.1 Rkk= 6.4 + +22 10:55:45 11:10:49 +P1=132.3 T1=11:05:49 P2=182.3 T2=11:10:49 Vs=10.00 + +22 11:57:04 12:12:08 +P1= 67.2 T1=12:07:08 P2= 91.6 T2=12:12:08 Vs= 4.87 + +22 12:28:45 12:43:50 +P1= 58.0 T1=12:38:50 P2= 77.2 T2=12:43:50 Vs= 3.85 + +22 13:43:01 13:53:05 +P1= 26.2 T1=13:48:05 P2= 39.5 T2=13:53:05 Vs= 2.64 + +20 14:57:48 14:57:56 +Riz_sol= 4971.6 + +21 14:58:05 14:58:08 +Rsk= 12.1 Rkk= 6.4 + +22 15:46:06 16:01:11 +P1= 46.9 T1=15:56:11 P2= 59.7 T2=16:01:11 Vs= 2.55 + +23 16:03:17 16:03:22 + + +24 16:03:37 16:04:14 + + +30 16:04:34 16:05:03 +Vst= 30.3 + +31 16:05:11 16:05:52 +Rom_sol= 11.7 + +32 16:06:42 16:07:48 +Imax=10.9 Umax=50.0 T= 9.0 + +33 16:07:59 16:08:24 +Imin=15.9 Umin=24.9 T= 0.5 + +34 16:08:29 16:08:51 +V=300.1 T= 9.6 + +35 16:08:57 16:09:57 +Q= 54.5 T= 9.6 + +36 16:10:03 16:10:38 +P1=0.30 T= 3.1 + +37 16:10:43 16:11:12 +T= 1.1 + +38 16:11:16 16:11:23 +t= 51.7 T= 0.7 + +40 16:11:27 16:11:34 +t= 53.5 T= 0.7 + +39 16:11:38 16:11:54 +tcam= 52.4 Tcam= 0.7 tfl= 65.4 Tfl= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.213 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.213 new file mode 100644 index 0000000..6b834b8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.213 @@ -0,0 +1,16 @@ +12 02:04:02 1594328642 +13 05:01:58 1594339318 +0 05:01:58 1594339318 +14 05:45:18 1594341918 +15 06:46:17 1594345577 +16 07:18:49 1594347529 +1 08:13:27 1594350807 +2 10:05:27 1594357527 +5 13:54:05 1594371245 +6 14:03:17 1594371797 +7 14:38:58 1594373938 +8 14:54:37 1594374877 +25 16:04:30 1594379070 +9 16:13:09 1594379589 +10 16:38:08 1594381088 +12 20:48:34 1594396114 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.214 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.214 new file mode 100644 index 0000000..b314238 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.214 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.216 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.216 new file mode 100644 index 0000000..30df639 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.216 @@ -0,0 +1,93 @@ +[18] +oper = 12 +begin = 10.07.2020 02:04:02 +norma = 180 +real = 177 + +[19] +oper = 13 +begin = 10.07.2020 05:01:58 +norma = 45 +real = 43 + +[20] +oper = 14 +begin = 10.07.2020 05:45:18 +norma = 40 +vac_time = 10 +real = 60 + +[21] +oper = 15 +begin = 10.07.2020 06:46:17 +norma = 30 +real = 32 + +[22] +oper = 16 +begin = 10.07.2020 07:18:49 +norma = 40 +real = 54 + +[23] +oper = 1 +begin = 10.07.2020 08:13:27 +norma = 85 +real = 112 + +[24] +oper = 2 +begin = 10.07.2020 10:05:27 +norma = 110 +vac_time = 9 +real = 228 + +[25] +oper = 5 +begin = 10.07.2020 13:54:05 +norma = 25 +real = 9 + +[26] +oper = 6 +begin = 10.07.2020 14:03:17 +norma = 35 +real = 35 + +[27] +oper = 7 +begin = 10.07.2020 14:38:58 +norma = 30 +real = 15 + +[28] +oper = 8 +begin = 10.07.2020 14:54:37 +norma = 40 +vac_time = 7 +real = 69 + +[29] +oper = 25 +begin = 10.07.2020 16:04:30 +norma = 30 +real = 8 + +[30] +oper = 9 +begin = 10.07.2020 16:13:09 +norma = 0 +real = 24 + +[31] +oper = 10 +begin = 10.07.2020 16:38:08 +norma = 0 +real = 250 + +[32] +oper = 12 +begin = 10.07.2020 20:48:34 +norma = 180 +real = 263 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.217 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.217 new file mode 100644 index 0000000..8e3232c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.217 @@ -0,0 +1,23 @@ +02:04:07 1594328647 ⪫祭 ॣ '-2'(A) +02:04:55 1594328695 祭 ० ᪠ +02:04:55 1594328695 祭 ० ᪠ +02:08:01 1594328881 ⪫祭 ० ᪠ (A) +06:45:44 1594345544 祭 ० ࠧ +06:45:45 1594345545 祭 ० ' ⮪ 㣨' +06:47:07 1594345627 祭 ॣ '-2'(A) +07:04:55 1594346695 ⪫祭 ० ࠧ (A) +07:05:42 1594346742 ⪫祭 ० ' ⮪ 㣨' +07:18:53 1594347533 ⪫祭 ॣ '-2'(A) +07:19:21 1594347561 祭 ० ᪠ +07:19:21 1594347561 祭 ० ᪠ +07:21:47 1594347707 ⪫祭 ० ᪠ (A) +14:03:33 1594371813 祭 ० ᪠ +14:05:59 1594371959 ⪫祭 ० ᪠ (A) +16:03:40 1594379020 祭 ॣ '-2'(A) +16:04:15 1594379055 ⪫祭 ॣ '-2'(A) +16:34:34 1594380874 祭 ॣ '-2' +16:39:27 1594381167 祭 ⠭ ॣ +20:48:37 1594396117 ⪫祭 ॣ '-2'(A) +20:58:41 1594396721 祭 ० ᪠ +20:58:41 1594396721 祭 ० ᪠ +21:01:11 1594396871 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.219 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.219 new file mode 100644 index 0000000..a455658 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.219 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.230 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.230 new file mode 100644 index 0000000..c43aa5a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.230 @@ -0,0 +1,5 @@ +07:25:01 1594347901 3 14 +08:52:00 1594353120 0 A--32-120-2016 ॢ 0 +10:47:35 1594360055 1 06891 3 37 9 5100 +22:59:29 1594403969 1 06891 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 37 4 3 5 Ti 6 7 920 8 4800 9 5100 10 840 11 12 320252 +23:41:50 1594406510 0 A--32-080-2017 ॢ 3 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.231 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.231 new file mode 100644 index 0000000..27b749a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.231 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.232 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.232 new file mode 100644 index 0000000..2b327d7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.232 @@ -0,0 +1,66 @@ +21 07:24:44 07:24:47 +Rsk= 17.4 Rkk= 14.7 + +22 07:46:50 08:02:21 +P1= 49.1 T1=07:57:21 P2= 63.3 T2=08:02:21 Vs= 2.83 + +21 10:46:20 10:46:23 +Rsk= 17.9 Rkk= 15.3 + +22 11:20:36 11:36:07 +P1= 39.1 T1=11:31:07 P2= 53.2 T2=11:36:07 Vs= 2.82 + +20 14:46:22 14:46:31 +Riz_sol= 4834.4 + +21 14:46:38 14:46:41 +Rsk= 17.7 Rkk= 15.2 + +22 15:47:26 16:02:57 +P1= 30.9 T1=15:57:57 P2= 41.8 T2=16:02:57 Vs= 2.18 + +22 22:35:08 22:45:38 +P1= 12.1 T1=22:40:38 P2= 21.2 T2=22:45:38 Vs= 1.83 + +23 22:46:57 22:47:02 + + +24 22:47:13 22:47:50 + + +30 22:48:10 22:48:43 +Vst= 29.1 + +31 22:48:48 22:49:54 +Rom_sol= 12.4 + +41 22:50:43 22:50:48 +Ukz= 1.04 + +32 22:50:56 22:51:31 +Imax=26.9 Umax=55.0 T= 9.0 + +33 22:51:37 22:51:56 +Imin=15.9 Umin=25.0 T= 0.5 + +34 22:52:00 22:52:22 +V=300.1 T= 9.4 + +35 22:52:26 22:53:23 +Q= 51.0 T= 9.4 + +36 22:53:27 22:54:01 +P1=0.29 T= 2.9 + +37 22:54:05 22:54:37 +T= 0.9 + +38 22:54:40 22:54:47 +t= 52.6 T= 0.5 + +39 22:54:51 22:54:58 +t= 52.9 T= 0.5 + +40 22:55:01 22:55:08 +t= 53.9 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.233 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.233 new file mode 100644 index 0000000..2b72354 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.233 @@ -0,0 +1,16 @@ +11 00:54:15 1594324455 +12 05:06:43 1594339603 +13 07:09:27 1594346967 +0 07:09:27 1594346967 +14 07:24:30 1594347870 +15 08:15:17 1594350917 +16 08:53:45 1594353225 +1 09:39:09 1594355949 +2 10:41:02 1594359662 +5 11:37:21 1594363041 +6 11:49:29 1594363769 +7 12:34:28 1594366468 +8 14:31:21 1594373481 +25 22:48:08 1594403288 +9 22:59:29 1594403969 +10 23:41:51 1594406511 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.234 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.234 new file mode 100644 index 0000000..4704b86 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.234 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.236 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.236 new file mode 100644 index 0000000..9e15739 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.236 @@ -0,0 +1,94 @@ +[78] +oper = 11 +begin = 10.07.2020 00:54:15 +norma = 0 +real = 252 + +[79] +oper = 12 +begin = 10.07.2020 05:06:43 +norma = 105 +real = 122 + +[80] +oper = 13 +begin = 10.07.2020 07:09:27 +norma = 45 +real = 15 + +[81] +oper = 14 +begin = 10.07.2020 07:24:30 +norma = 40 +vac_time = 6 +real = 50 + +[82] +oper = 15 +begin = 10.07.2020 08:15:17 +norma = 30 +real = 38 + +[83] +oper = 16 +begin = 10.07.2020 08:53:45 +norma = 40 +real = 45 + +[84] +oper = 1 +begin = 10.07.2020 09:39:09 +norma = 85 +real = 61 + +[85] +oper = 2 +begin = 10.07.2020 10:41:02 +norma = 110 +vac_time = 8 +vac_avg10 = 7.6 +real = 56 + +[86] +oper = 5 +begin = 10.07.2020 11:37:21 +norma = 25 +real = 12 + +[87] +oper = 6 +begin = 10.07.2020 11:49:29 +norma = 35 +real = 44 + +[88] +oper = 7 +begin = 10.07.2020 12:34:28 +norma = 30 +real = 116 + +[89] +oper = 8 +begin = 10.07.2020 14:31:21 +norma = 40 +vac_time = 15 +real = 496 + +[90] +oper = 25 +begin = 10.07.2020 22:48:08 +norma = 30 +real = 11 + +[91] +oper = 9 +begin = 10.07.2020 22:59:29 +norma = 0 +real = 42 + +[92] +oper = 10 +begin = 10.07.2020 23:41:51 +norma = 0 +real = 178 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.237 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.237 new file mode 100644 index 0000000..70bb9af --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.237 @@ -0,0 +1,37 @@ +00:54:14 1594324454 祭 ० +00:54:15 1594324455 ⪫祭 ॣ '-2'(A) +00:54:16 1594324456 祭 ॣ '-2'(A) +02:06:16 1594328776 ⪫祭 ॣ '-2'(A) +05:06:42 1594339602 ⪫祭 ० (A) +05:06:43 1594339603 ⪫祭 +05:06:43 1594339603 : +05:06:44 1594339604 ⪫祭 ० ' ⮪ 㣨' +05:07:05 1594339625 祭 ० ᪠ +05:10:05 1594339805 ⪫祭 ० ᪠ (A) +05:36:45 1594341405 : 믮 +08:13:25 1594350805 祭 ० ࠧ +08:13:28 1594350808 祭 ० ' ⮪ 㣨' +08:16:34 1594350994 祭 ॣ '-2'(A) +08:52:00 1594353120 ⪫祭 ० ࠧ (A) +08:53:47 1594353227 ⪫祭 ० ' ⮪ 㣨' +08:53:49 1594353229 ⪫祭 ॣ '-2'(A) +08:54:09 1594353249 祭 ० ᪠ +08:57:12 1594353432 ⪫祭 ० ᪠ (A) +10:47:38 1594360058 : 㦥 +11:49:42 1594363782 祭 ० ᪠ +11:52:40 1594363960 ⪫祭 ० ᪠ (A) +22:47:03 1594403223 祭 +22:47:17 1594403237 祭 ॣ '-2'(A) +22:47:51 1594403271 ⪫祭 ॣ '-2'(A) +22:48:50 1594403330 祭 +22:49:50 1594403390 ⪫祭 +22:55:18 1594403718 祭 ० ࠧ +22:55:23 1594403723 祭 ० ' ⮪ 㣨' +22:55:55 1594403755 ⪫祭 ० ࠧ +22:55:59 1594403759 ⪫祭 ० ' ⮪ 㣨' +22:59:15 1594403955 祭 ० ' ⮪ 㣨' +22:59:18 1594403958 祭 ० ࠧ +22:59:30 1594403970 : 믮 +23:20:53 1594405253 祭 ॣ '-2'(A) +23:41:50 1594406510 ⪫祭 ० ࠧ (A) +23:41:51 1594406511 祭 ॣ . 殮 㣨 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.239 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.239 new file mode 100644 index 0000000..2f53709 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.239 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.240 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.240 new file mode 100644 index 0000000..58f85f8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.240 @@ -0,0 +1,2 @@ +11:41:22 1594363282 12 24 1 01542 +17:06:48 1594382808 12 24 1 01542 0 A-NTC-ALD-32-24027-2 2 TI6AL4V 4 01 13 8-28-11694 14 8446 8 3000 9 5000 17 2355 7 2355 15 4.43 16 390.0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.241 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.241 new file mode 100644 index 0000000..81fef07 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.241 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.242 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.242 new file mode 100644 index 0000000..43325df --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.242 @@ -0,0 +1,156 @@ +21 01:02:09 01:02:13 +146.8 146.8 + +21 01:02:14 01:02:15 +146.8 146.8 + +22 01:20:07 01:23:02 +P1=0.0291 P2=0.0514 T1=01:20:07 T2=01:23:02 Vs=0.0077 + +22 01:23:03 01:24:24 +P1=0.0516 P2=0.0616 T1=01:23:03 T2=01:24:24 Vs=0.0076 + +22 01:26:57 01:27:11 +P1=0.0288 P2=0.0309 T1=01:26:57 T2=01:27:11 Vs=0.0088 + +22 01:33:58 01:35:09 +P1=0.0270 P2=0.0339 T1=01:33:58 T2=01:35:09 Vs=0.0057 + +22 01:35:10 01:37:42 +P1=0.0339 P2=0.0483 T1=01:35:10 T2=01:37:42 Vs=0.0057 + +22 01:37:43 01:37:50 +P1=0.0483 P2=0.0491 T1=01:37:43 T2=01:37:50 Vs=0.0066 + +22 01:45:04 01:48:38 +P1=0.0262 P2=0.0447 T1=01:45:04 T2=01:48:38 Vs=0.0052 + +22 01:48:39 01:49:22 +P1=0.0447 P2=0.0488 T1=01:48:39 T2=01:49:22 Vs=0.0056 + +22 01:49:23 01:49:31 +P1=0.0491 P2=0.0496 T1=01:49:23 T2=01:49:31 Vs=0.0058 + +22 01:53:56 01:54:05 +P1=0.0262 P2=0.0270 T1=01:53:56 T2=01:54:05 Vs=0.0058 + +22 01:54:07 01:59:06 +P1=0.0273 P2=0.0529 T1=01:54:07 T2=01:59:06 Vs=0.0051 + +22 01:59:16 01:59:27 +P1=0.0537 P2=0.0547 T1=01:59:16 T2=01:59:27 Vs=0.0056 + +22 02:04:25 02:04:34 +P1=0.0262 P2=0.0270 T1=02:04:25 T2=02:04:34 Vs=0.0077 + +22 02:04:35 02:09:35 +P1=0.0270 P2=0.0519 T1=02:04:35 T2=02:09:35 Vs=0.0050 + +21 06:59:20 06:59:23 +114.0 146.8 + +21 06:59:26 06:59:27 +118.4 114.0 + +22 07:21:23 07:21:29 +P1=0.0309 P2=0.0319 T1=07:21:23 T2=07:21:29 Vs=0.0123 + +22 07:44:10 07:48:37 +P1=0.0260 P2=0.0432 T1=07:44:10 T2=07:48:37 Vs=0.0039 + +22 07:48:38 07:53:38 +P1=0.0434 P2=0.0649 T1=07:48:38 T2=07:53:38 Vs=0.0043 + +21 11:41:30 11:41:33 +123.2 114.0 + +21 11:41:35 11:41:36 +123.2 123.2 + +22 11:57:53 12:02:54 +P1=0.0242 P2=0.0475 T1=11:57:53 T2=12:02:54 Vs=0.0047 + +22 12:59:36 13:04:36 +P1=0.0201 P2=0.0296 T1=12:59:36 T2=13:04:36 Vs=0.0019 + +22 13:04:38 13:09:38 +P1=0.0296 P2=0.0391 T1=13:04:38 T2=13:09:38 Vs=0.0019 + +20 16:50:22 16:50:23 +0.4 + +20 16:50:29 16:50:30 +0.4 + +21 16:50:38 16:50:40 +140.1 123.2 + +21 16:50:43 16:50:44 +140.1 146.8 + +24 16:50:47 16:50:49 + + +23 16:50:50 16:50:51 + + +41 16:50:53 16:50:57 + + +30 16:51:01 16:52:10 +6.0 10.0 + +31 16:52:42 16:53:32 + + +22 17:07:47 17:12:48 +P1=0.0291 P2=0.0537 T1=17:07:47 T2=17:12:48 Vs=0.0049 + +22 18:21:03 18:26:03 +P1=0.0260 P2=0.0401 T1=18:21:03 T2=18:26:03 Vs=0.0028 + +22 18:28:35 18:33:33 +P1=0.0478 P2=0.0639 T1=18:28:35 T2=18:33:33 Vs=0.0032 + +22 22:35:22 22:40:23 +P1=0.0242 P2=0.0352 T1=22:35:22 T2=22:40:23 Vs=0.0022 + +22 22:40:27 22:45:26 +P1=0.0355 P2=0.0483 T1=22:40:27 T2=22:45:26 Vs=0.0026 + +38 22:46:08 22:46:17 +64.7 1.8 + +39 22:46:20 22:46:34 +64.5 1.6 + +40 22:46:35 22:46:49 +64.9 1.8 + +35 22:46:54 22:47:26 +48.6 11.0 + +35 22:47:57 22:48:25 +51.3 10.5 + +35 22:49:01 22:50:04 +49.8 10.9 + +37 22:50:06 22:50:11 +2.0 + +37 22:50:25 22:50:46 +1.7 + +36 22:50:48 22:51:43 +0.0 4.2 + +34 22:51:48 22:52:09 +1.0 0.0 + +32 22:52:11 22:52:31 +0.6 56.3 10.9 + +33 22:52:35 22:53:13 +0.8 0.6 4.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.243 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.243 new file mode 100644 index 0000000..bed8683 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.243 @@ -0,0 +1,14 @@ +15 03:29:24 1594333764 +16 03:47:46 1594334866 +1 06:18:11 1594343891 +14 06:59:17 1594346357 +15 08:44:45 1594352685 +16 08:57:18 1594353438 +1 09:36:02 1594355762 +2 11:41:11 1594363271 +5 14:07:34 1594372054 +6 14:23:53 1594373033 +7 15:02:03 1594375323 +8 16:50:19 1594381819 +9 22:59:02 1594403942 +10 23:27:03 1594405623 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.244 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.244 new file mode 100644 index 0000000..0887d18 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.244 @@ -0,0 +1,373 @@ +00:04:13 NEW 0459: PIR001᮪ +00:53:32 ACK 0190: 訡 ⥪ +00:53:32 ACK 0459: PIR001᮪ +00:53:34 RTN 0190: 訡 ⥪ +00:53:35 NEW 0190: 訡 ⥪ +01:02:01 NEW 0460: PIR002 ᮪ +01:02:06 ACK 0190: 訡 ⥪ +01:02:06 ACK 0460: PIR002 ᮪ +01:02:06 RTN 0190: 訡 ⥪ +01:06:14 RTN 0451: FISAL104 . - +01:06:14 RTN 0452: PISAL104 . , - +01:06:14 RTN 0459: PIR001᮪ +01:06:14 RTN 0460: PIR002 ᮪ +01:06:15 RTN ।0081: FISAL104 . - +01:06:15 RTN ।0126: PISAL104 . , - +01:59:06 NEW 0190: 訡 ⥪ +01:59:30 ACK 0190: 訡 ⥪ +01:59:31 RTN 0190: 訡 ⥪ +01:59:33 NEW 0190: 訡 ⥪ +02:02:54 ACK 0190: 訡 ⥪ +02:02:54 RTN 0190: 訡 ⥪ +02:02:56 NEW 0190: 訡 ⥪ +02:03:49 ACK 0190: 訡 ⥪ +02:03:49 RTN 0190: 訡 ⥪ +02:03:50 NEW 0190: 訡 ⥪ +02:09:46 ACK 0190: 訡 ⥪ +02:09:46 RTN 0190: 訡 ⥪ +02:10:37 NEW 0089: FSAL113 (+) +02:10:37 NEW 0091: FSAL114 (-) +02:10:37 NEW 0093: FSAL115 (-) +02:10:42 ACK 0089: FSAL113 (+) +02:10:42 ACK 0091: FSAL114 (-) +02:10:42 ACK 0093: FSAL115 (-) +02:10:42 RTN 0089: FSAL113 (+) +02:10:42 RTN 0091: FSAL114 (-) +02:10:42 RTN 0455: FSAL116 -- +02:10:45 RTN 0093: FSAL115 (-) +02:21:36 NEW 0108: TICAH101 - . +02:21:36 NEW 0109: TICAH101 - . +02:21:42 ACK 0108: TICAH101 - . +02:21:42 ACK 0109: TICAH101 - . +02:26:33 NEW ।0106: TISAH120 - . -- +02:26:54 ACK ।0106: TISAH120 - . -- +02:32:59 RTN ।0106: TISAH120 - . -- +02:32:59 RTN 0108: TICAH101 - . +02:32:59 RTN 0109: TICAH101 - . +02:44:42 NEW 0452: PISAL104 . , - +02:44:43 NEW ।0126: PISAL104 . , - +02:59:39 ACK ।0126: PISAL104 . , - +02:59:39 ACK 0452: PISAL104 . , - +03:00:07 NEW ।0081: FISAL104 . - +03:00:10 ACK ।0081: FISAL104 . - +03:00:12 NEW 0451: FISAL104 . - +03:01:17 ACK 0451: FISAL104 . - +03:02:09 RTN ।0081: FISAL104 . - +03:02:09 RTN 0451: FISAL104 . - +03:06:10 NEW 0465: . 5 . +03:06:23 ACK 0465: . 5 . +03:09:30 RTN 0457: FSAL111 +03:10:23 NEW ।0081: FISAL104 . - +03:10:26 NEW 0451: FISAL104 . - +03:10:32 ACK ।0081: FISAL104 . - +03:10:32 ACK 0451: FISAL104 . - +03:11:18 RTN 0451: FISAL104 . - +03:11:37 RTN ।0081: FISAL104 . - +03:28:19 RTN 0452: PISAL104 . , - +03:28:20 RTN ।0126: PISAL104 . , - +03:28:59 RTN 0465: . 5 . +03:34:23 NEW ।0350: ஦-⠩ +03:34:24 ACK ।0350: ஦-⠩ +03:34:24 RTN ।0350: ஦-⠩ +03:39:31 NEW ।0350: ஦-⠩ +03:39:32 RTN ।0350: ஦-⠩ +03:39:33 ACK ।0350: ஦-⠩ +03:44:32 NEW ।0350: ஦-⠩ +03:44:34 ACK ।0350: ஦-⠩ +03:44:34 RTN ।0350: ஦-⠩ +03:47:46 NEW 0378: / -. , ࠭- +03:47:46 RTN 0378: / -. , ࠭- +03:47:47 ACK 0378: / -. , ࠭- +03:48:38 NEW 0459: PIR001᮪ +03:49:03 ACK 0459: PIR001᮪ +03:50:34 NEW 0460: PIR002 ᮪ +03:58:52 NEW 0183: 室 +03:59:11 RTN 0183: 室 +04:00:01 NEW 0183: 室 +04:00:02 RTN 0183: 室 +04:00:22 NEW 0183: 室 +04:00:22 RTN 0183: 室 +04:01:11 NEW 0183: 室 +04:01:18 RTN 0183: 室 +04:01:28 NEW 0183: 室 +04:01:35 RTN 0183: 室 +04:01:56 NEW 0183: 室 +04:02:35 RTN 0183: 室 +04:02:45 NEW 0183: 室 +04:02:52 RTN 0183: 室 +04:03:03 NEW 0183: 室 +04:03:05 RTN 0183: 室 +04:03:14 NEW 0183: 室 +04:03:32 RTN 0183: 室 +04:03:44 NEW 0183: 室 +04:03:52 RTN 0183: 室 +04:04:02 NEW 0183: 室 +04:05:24 RTN 0183: 室 +04:05:40 NEW 0183: 室 +04:06:50 RTN 0183: 室 +04:07:01 NEW 0183: 室 +04:07:04 RTN 0183: 室 +04:07:37 NEW 0183: 室 +04:08:10 RTN 0183: 室 +04:08:31 NEW 0183: 室 +04:08:50 RTN 0183: 室 +04:09:00 NEW 0183: 室 +04:11:06 RTN 0183: 室 +04:11:16 NEW 0183: 室 +06:18:02 RTN 0183: 室 +06:18:32 NEW ।0081: FISAL104 . - +06:18:37 NEW 0452: PISAL104 . , - +06:18:37 NEW 0451: FISAL104 . - +06:18:38 NEW ।0126: PISAL104 . , - +06:18:58 ACK ।0081: FISAL104 . - +06:18:58 ACK ।0126: PISAL104 . , - +06:18:58 ACK 0183: 室 +06:18:58 ACK 0451: FISAL104 . - +06:18:58 ACK 0452: PISAL104 . , - +06:18:58 ACK 0460: PIR002 ᮪ +06:18:58 RTN 0459: PIR001᮪ +06:18:58 RTN 0460: PIR002 ᮪ +06:59:13 RTN 0451: FISAL104 . - +06:59:13 RTN 0452: PISAL104 . , - +06:59:13 RTN ।0081: FISAL104 . - +06:59:13 RTN ।0126: PISAL104 . , - +06:59:16 NEW 0459: PIR001᮪ +06:59:16 NEW 0460: PIR002 ᮪ +06:59:21 ACK 0459: PIR001᮪ +06:59:21 ACK 0460: PIR002 ᮪ +07:54:03 RTN 0459: PIR001᮪ +07:54:03 RTN 0460: PIR002 ᮪ +08:41:56 NEW 0459: PIR001᮪ +08:42:01 ACK 0459: PIR001᮪ +08:43:55 RTN 0459: PIR001᮪ +08:57:17 NEW 0378: / -. , ࠭- +08:57:18 RTN 0378: / -. , ࠭- +09:36:19 NEW ।0081: FISAL104 . - +09:36:23 NEW 0451: FISAL104 . - +09:36:23 NEW 0452: PISAL104 . , - +09:36:24 NEW ।0126: PISAL104 . , - +09:45:25 ACK ।0081: FISAL104 . - +09:45:25 ACK ।0126: PISAL104 . , - +09:45:25 ACK 0378: / -. , ࠭- +09:45:25 ACK 0451: FISAL104 . - +09:45:25 ACK 0452: PISAL104 . , - +10:44:25 NEW 0457: FSAL111 +10:50:13 ACK 0457: FSAL111 +11:31:17 NEW 0239: . 楢 - +11:31:18 RTN 0239: . 楢 - +11:41:23 NEW ।0124: TISAH121 - +11:42:08 ACK ।0124: TISAH121 - +11:42:08 ACK 0239: . 楢 - +11:42:08 RTN ।0081: FISAL104 . - +11:42:08 RTN ।0126: PISAL104 . , - +11:42:08 RTN 0451: FISAL104 . - +11:42:08 RTN 0452: PISAL104 . , - +11:42:08 RTN 0457: FSAL111 +12:02:54 NEW 0190: 訡 ⥪ +12:04:28 ACK 0190: 訡 ⥪ +12:04:29 RTN ।0124: TISAH121 - +12:04:29 RTN 0190: 訡 ⥪ +12:04:31 NEW 0190: 訡 ⥪ +12:05:35 ACK 0190: 訡 ⥪ +12:05:35 RTN 0190: 訡 ⥪ +12:05:38 NEW 0190: 訡 ⥪ +13:06:58 ACK 0190: 訡 ⥪ +13:06:58 RTN 0190: 訡 ⥪ +14:23:51 NEW 0450: . 㣨 +14:23:52 NEW 0371: / - +14:23:53 RTN 0371: / - +14:23:53 NEW 0378: / -. , ࠭- +14:23:53 RTN 0450: . 㣨 +14:23:54 ACK 0371: / - +14:23:54 ACK 0378: / -. , ࠭- +14:23:54 ACK 0450: . 㣨 +14:23:54 RTN 0378: / -. , ࠭- +14:47:35 NEW ।0081: FISAL104 . - +14:47:39 NEW 0451: FISAL104 . - +14:47:41 NEW 0452: PISAL104 . , - +14:47:42 NEW ।0126: PISAL104 . , - +14:47:45 ACK ।0081: FISAL104 . - +14:47:45 ACK ।0126: PISAL104 . , - +14:47:45 ACK 0451: FISAL104 . - +14:47:45 ACK 0452: PISAL104 . , - +15:02:59 NEW 0239: . 楢 - +15:03:01 RTN 0239: . 楢 - +15:09:36 ACK 0239: . 楢 - +16:34:45 NEW 0023: 訡 ஫ +16:34:45 NEW 0034: ஫ ⮢ +16:37:10 NEW 0239: . 楢 - +16:37:11 RTN 0239: . 楢 - +16:37:34 NEW 0239: . 楢 - +16:37:35 RTN 0239: . 楢 - +16:38:37 ACK 0023: 訡 ஫ +16:38:37 ACK 0034: ஫ ⮢ +16:38:37 ACK 0239: . 楢 - +16:38:37 RTN 0023: 訡 ஫ +16:38:37 RTN 0034: ஫ ⮢ +16:50:11 RTN ।0081: FISAL104 . - +16:50:11 RTN ।0126: PISAL104 . , - +16:50:11 RTN 0451: FISAL104 . - +16:50:11 RTN 0452: PISAL104 . , - +16:50:23 NEW 0323: . . +16:51:22 RTN 0323: . . +16:51:24 ACK 0323: . . +17:12:48 NEW 0190: 訡 ⥪ +18:20:47 ACK 0190: 訡 ⥪ +18:20:47 RTN 0190: 訡 ⥪ +18:20:49 NEW 0190: 訡 ⥪ +18:25:03 ACK 0190: 訡 ⥪ +18:25:03 RTN 0190: 訡 ⥪ +18:25:06 NEW 0190: 訡 ⥪ +18:26:02 ACK 0190: 訡 ⥪ +18:26:02 RTN 0190: 訡 ⥪ +18:26:04 NEW 0190: 訡 ⥪ +22:36:06 ACK 0190: 訡 ⥪ +22:36:07 RTN 0190: 訡 ⥪ +22:36:10 NEW 0190: 訡 ⥪ +22:40:12 ACK 0190: 訡 ⥪ +22:40:12 RTN 0190: 訡 ⥪ +22:40:15 NEW 0190: 訡 ⥪ +22:45:06 ACK 0190: 訡 ⥪ +22:45:07 RTN 0190: 訡 ⥪ +22:46:08 NEW 0454: TISAH103 - . - +22:46:13 ACK 0454: TISAH103 - . - +22:46:14 RTN 0454: TISAH103 - . - +22:46:23 NEW 0458: TISAH121 Temperatur Ofen +22:46:28 NEW ।0124: TISAH121 - +22:46:30 RTN 0458: TISAH121 Temperatur Ofen +22:46:31 ACK ।0124: TISAH121 - +22:46:31 ACK 0458: TISAH121 Temperatur Ofen +22:46:31 RTN ।0124: TISAH121 - +22:46:40 NEW 0456: TISAH120 - . -- +22:46:45 ACK 0456: TISAH120 - . -- +22:46:45 RTN 0456: TISAH120 - . -- +22:47:20 NEW ।0081: FISAL104 . - +22:47:24 NEW 0451: FISAL104 . - +22:47:27 ACK ।0081: FISAL104 . - +22:47:27 ACK 0451: FISAL104 . - +22:47:27 NEW ।0126: PISAL104 . , - +22:47:27 NEW 0332: . : - +22:47:30 RTN 0332: . : - +22:47:30 ACK ।0126: PISAL104 . , - +22:47:30 ACK 0332: . : - +22:47:30 NEW 0452: PISAL104 . , - +22:47:44 ACK 0452: PISAL104 . , - +22:47:44 RTN ।0126: PISAL104 . , - +22:47:44 RTN 0452: PISAL104 . , - +22:47:53 RTN ।0081: FISAL104 . - +22:47:53 RTN 0451: FISAL104 . - +22:48:19 NEW ।0081: FISAL104 . - +22:48:23 NEW 0451: FISAL104 . - +22:48:25 ACK ।0081: FISAL104 . - +22:48:25 ACK 0451: FISAL104 . - +22:48:26 NEW ।0126: PISAL104 . , - +22:48:26 NEW 0332: . : - +22:48:26 RTN 0332: . : - +22:48:28 NEW 0452: PISAL104 . , - +22:48:39 ACK ।0126: PISAL104 . , - +22:48:39 ACK 0332: . : - +22:48:39 ACK 0452: PISAL104 . , - +22:48:39 RTN ।0126: PISAL104 . , - +22:48:39 RTN 0452: PISAL104 . , - +22:48:54 RTN 0451: FISAL104 . - +22:48:56 RTN ।0081: FISAL104 . - +22:49:29 NEW ।0081: FISAL104 . - +22:49:32 NEW 0451: FISAL104 . - +22:49:35 NEW ।0126: PISAL104 . , - +22:49:59 ACK ।0081: FISAL104 . - +22:49:59 ACK ।0126: PISAL104 . , - +22:49:59 ACK 0451: FISAL104 . - +22:49:59 RTN ।0081: FISAL104 . - +22:49:59 RTN ।0126: PISAL104 . , - +22:49:59 RTN 0451: FISAL104 . - +22:50:08 NEW 0455: FSAL116 -- +22:50:11 NEW 0333: . : ⮪ +22:50:20 ACK 0333: . : ⮪ +22:50:20 ACK 0455: FSAL116 -- +22:50:20 RTN 0333: . : ⮪ +22:50:22 RTN 0455: FSAL116 -- +22:50:28 NEW 0455: FSAL116 -- +22:50:42 ACK 0455: FSAL116 -- +22:50:42 RTN 0455: FSAL116 -- +22:51:16 NEW ।0081: FISAL104 . - +22:51:22 NEW ।0126: PISAL104 . , - +22:51:22 NEW 0452: PISAL104 . , - +22:51:41 RTN 0452: PISAL104 . , - +22:51:42 ACK ।0081: FISAL104 . - +22:51:42 ACK ।0126: PISAL104 . , - +22:51:42 ACK 0452: PISAL104 . , - +22:51:42 RTN ।0126: PISAL104 . , - +22:51:57 NEW 0459: PIR001᮪ +22:52:05 ACK 0459: PIR001᮪ +22:52:06 RTN ।0081: FISAL104 . - +22:52:06 RTN 0459: PIR001᮪ +22:52:11 NEW 0450: . 㣨 +22:52:12 RTN 0450: . 㣨 +22:52:14 NEW 0449: . 㣨 +22:52:26 ACK 0449: . 㣨 +22:52:26 ACK 0450: . 㣨 +22:52:27 RTN 0449: . 㣨 +22:52:38 NEW 0450: . 㣨 +22:52:46 ACK 0450: . 㣨 +22:52:47 RTN 0450: . 㣨 +22:52:55 NEW 0450: . 㣨 +22:53:02 ACK 0450: . 㣨 +22:53:02 RTN 0450: . 㣨 +22:53:03 NEW 0450: . 㣨 +22:53:09 ACK 0450: . 㣨 +22:53:09 RTN 0450: . 㣨 +22:53:10 NEW 0450: . 㣨 +22:53:13 ACK 0450: . 㣨 +22:53:13 NEW 0378: / -. , ࠭- +22:53:13 RTN 0450: . 㣨 +22:53:14 RTN 0378: / -. , ࠭- +22:53:16 ACK 0378: / -. , ࠭- +22:53:16 ACK 0450: . 㣨 +22:58:36 NEW 0450: . 㣨 +22:58:37 RTN 0450: . 㣨 +22:58:38 ACK 0450: . 㣨 +22:58:41 NEW 0341: 誠 ⠫ 몫祭 +22:58:44 ACK 0341: 誠 ⠫ 몫祭 +22:58:48 RTN 0341: 誠 ⠫ 몫祭 +22:58:50 NEW 0023: 訡 ஫ +22:58:50 NEW 0034: ஫ ⮢ +22:58:51 ACK 0023: 訡 ஫ +22:58:51 ACK 0034: ஫ ⮢ +22:58:52 RTN 0023: 訡 ஫ +22:58:52 RTN 0034: ஫ ⮢ +22:58:57 NEW 0262: ᫨誮 +22:59:00 ACK 0262: ᫨誮 +22:59:13 NEW 0023: 訡 ஫ +22:59:13 NEW 0034: ஫ ⮢ +22:59:17 ACK 0023: 訡 ஫ +22:59:17 ACK 0034: ஫ ⮢ +22:59:17 RTN 0023: 訡 ஫ +22:59:17 RTN 0034: ஫ ⮢ +23:00:02 NEW 0023: 訡 ஫ +23:00:02 NEW 0034: ஫ ⮢ +23:00:06 ACK 0023: 訡 ஫ +23:00:06 ACK 0034: ஫ ⮢ +23:00:06 RTN 0023: 訡 ஫ +23:00:06 RTN 0034: ஫ ⮢ +23:00:10 NEW 0023: 訡 ஫ +23:00:10 NEW 0034: ஫ ⮢ +23:00:13 ACK 0023: 訡 ஫ +23:00:13 ACK 0034: ஫ ⮢ +23:00:13 RTN 0023: 訡 ஫ +23:00:13 RTN 0034: ஫ ⮢ +23:02:23 RTN 0262: ᫨誮 +23:08:02 NEW ।0350: ஦-⠩ +23:08:02 ACK ।0350: ஦-⠩ +23:08:03 RTN ।0350: ஦-⠩ +23:13:03 NEW ।0350: ஦-⠩ +23:13:04 ACK ।0350: ஦-⠩ +23:13:04 RTN ।0350: ஦-⠩ +23:27:45 NEW ।0350: ஦-⠩ +23:27:48 ACK ।0350: ஦-⠩ +23:27:48 RTN ।0350: ஦-⠩ +23:38:59 NEW ।0350: ஦-⠩ +23:39:00 ACK ।0350: ஦-⠩ +23:39:01 RTN ।0350: ஦-⠩ +23:56:45 NEW ।0350: ஦-⠩ +23:56:47 ACK ।0350: ஦-⠩ +23:56:48 RTN ।0350: ஦-⠩ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.247 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.247 new file mode 100644 index 0000000..dab5724 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.247 @@ -0,0 +1,1774 @@ +00:53:35 1594324415 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +00:53:36 1594324416 >< (OIP1) +00:53:36 1594324416 > < (OIP1) +00:53:38 1594324418 > < (OIP1) +00:53:38 1594324418 >< (OIP1) +00:56:18 1594324578 >< (OIP1) +00:56:18 1594324578 >< (OIP1) +00:56:22 1594324582 >< (OIP1) +00:56:22 1594324582 >< (OIP1) +00:56:23 1594324583 >< (OIP1) +00:56:23 1594324583 > < (OIP1) +00:56:25 1594324585 > < (OIP1) +00:56:25 1594324585 >< (OIP1) +00:56:26 1594324586 ⢨ (OIP1) +00:56:27 1594324587 >< (OIP1) +00:56:27 1594324587 > < (OIP1) +00:56:29 1594324589 > < (OIP1) +00:56:29 1594324589 >< (OIP1) +00:56:30 1594324590 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +00:56:31 1594324591 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +00:56:34 1594324594 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:01:53 1594324913 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:01:54 1594324914 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +01:01:55 1594324915 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +01:01:56 1594324916 >< (OIP1) +01:01:56 1594324916 >嫠 < (OIP1) +01:01:59 1594324919 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +01:01:59 1594324919 >嫠 < (OIP1) +01:01:59 1594324919 > < (OIP1) +01:02:02 1594324922 > < (OIP1) +01:02:02 1594324922 > < (OIP1) +01:02:06 1594324926 > < (OIP1) +01:02:06 1594324926 >< (OIP1) +01:02:07 1594324927 >< (OIP1) +01:02:07 1594324927 > < (OIP1) +01:02:08 1594324928 > < (OIP1) +01:02:08 1594324928 >Mpar6Interlocks12< (OIP1) +01:02:09 1594324929 Machine C1_CMD_DIAG_INSU_STING_SK --test insulation stinger(CMD)࠭ (OIP1) +01:02:14 1594324934 Machine C1_CMD_DIAG_INSU_FNCE_SK --test insulation furnace(CMD)࠭ (OIP1) +01:02:15 1594324935 >Mpar6Interlocks12< (OIP1) +01:02:15 1594324935 > < (OIP1) +01:02:16 1594324936 > < (OIP1) +01:02:16 1594324936 >< (OIP1) +01:02:21 1594324941 >< (OIP1) +01:02:21 1594324941 >嫠 < (OIP1) +01:02:23 1594324943 >嫠 < (OIP1) +01:02:23 1594324943 > < (OIP1) +01:02:24 1594324944 > < (OIP1) +01:02:24 1594324944 >< (OIP1) +01:05:53 1594325153 >< (OIP1) +01:05:53 1594325153 >< (OIP1) +01:05:54 1594325154 >< (OIP1) +01:05:54 1594325154 >७ ⥪騩< (OIP1) +01:05:56 1594325156 >: 롮 稭< (OIP1) +01:05:56 1594325156 >७ < (OIP1) +01:05:58 1594325158 >७ < (OIP1) +01:05:58 1594325158 >< (OIP1) +01:06:01 1594325161 >< (OIP1) +01:06:01 1594325161 > < (OIP1) +01:06:10 1594325170 > < (OIP1) +01:06:10 1594325170 >< (OIP1) +01:06:11 1594325171 >< (OIP1) +01:06:11 1594325171 >< (OIP1) +01:06:12 1594325172 >< (OIP1) +01:06:12 1594325172 >嫠 < (OIP1) +01:06:17 1594325177 >嫠 < (OIP1) +01:06:17 1594325177 >< (OIP1) +01:12:25 1594325545 >< (OIP1) +01:12:25 1594325545 >< (OIP1) +01:12:26 1594325546 >< (OIP1) +01:12:26 1594325546 >७ ⥪騩< (OIP1) +01:12:26 1594325546 >: 롮 稭< (OIP1) +01:12:26 1594325546 >७ < (OIP1) +01:12:51 1594325571 >७ < (OIP1) +01:12:51 1594325571 >< (OIP1) +01:20:06 1594326006 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:20:08 1594326008 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:23:01 1594326181 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:23:02 1594326182 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:24:23 1594326263 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:24:25 1594326265 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:27:05 1594326425 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:27:11 1594326431 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:27:12 1594326432 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:27:14 1594326434 >< (OIP1) +01:27:14 1594326434 >< (OIP1) +01:27:15 1594326435 >< (OIP1) +01:27:15 1594326435 >७ ⥪騩< (OIP1) +01:27:15 1594326435 >: 롮 稭< (OIP1) +01:27:15 1594326435 >७ < (OIP1) +01:27:18 1594326438 >७ < (OIP1) +01:27:18 1594326438 >< (OIP1) +01:31:27 1594326687 >< (OIP1) +01:31:27 1594326687 >< (OIP1) +01:31:47 1594326707 >< (OIP1) +01:31:47 1594326707 >< (OIP1) +01:31:51 1594326711 >< (OIP1) +01:31:51 1594326711 >< (OIP1) +01:31:51 1594326711 >< (OIP1) +01:31:51 1594326711 >७ ⥪騩< (OIP1) +01:31:51 1594326711 >: 롮 稭< (OIP1) +01:31:51 1594326711 >७ < (OIP1) +01:31:58 1594326718 >७ < (OIP1) +01:31:58 1594326718 >嫠 < (OIP1) +01:31:58 1594326718 >嫠 < (OIP1) +01:31:58 1594326718 >< (OIP1) +01:33:57 1594326837 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:33:59 1594326839 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:34:00 1594326840 >< (OIP1) +01:34:00 1594326840 >< (OIP1) +01:34:00 1594326840 >< (OIP1) +01:34:00 1594326840 >७ ⥪騩< (OIP1) +01:34:01 1594326841 >: 롮 稭< (OIP1) +01:34:01 1594326841 >७ < (OIP1) +01:34:04 1594326844 >७ < (OIP1) +01:34:04 1594326844 >< (OIP1) +01:35:09 1594326909 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:35:09 1594326909 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:37:34 1594327054 >< (OIP1) +01:37:34 1594327054 >< (OIP1) +01:37:34 1594327054 >< (OIP1) +01:37:34 1594327054 >७ ⥪騩< (OIP1) +01:37:35 1594327055 >: 롮 稭< (OIP1) +01:37:35 1594327055 >७ < (OIP1) +01:37:38 1594327058 >७ < (OIP1) +01:37:38 1594327058 >< (OIP1) +01:37:41 1594327061 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:37:42 1594327062 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:37:43 1594327063 >< (OIP1) +01:37:43 1594327063 >< (OIP1) +01:37:44 1594327064 >< (OIP1) +01:37:44 1594327064 >७ ⥪騩< (OIP1) +01:37:45 1594327065 >: 롮 稭< (OIP1) +01:37:45 1594327065 >७ < (OIP1) +01:37:48 1594327068 >७ < (OIP1) +01:37:48 1594327068 >嫠 < (OIP1) +01:37:48 1594327068 >嫠 < (OIP1) +01:37:48 1594327068 >< (OIP1) +01:37:49 1594327069 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:37:50 1594327070 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:41:26 1594327286 >< (OIP1) +01:41:26 1594327286 > < (OIP1) +01:41:27 1594327287 > < (OIP1) +01:41:27 1594327287 >< (OIP1) +01:41:47 1594327307 >< (OIP1) +01:41:47 1594327307 >< (OIP1) +01:41:48 1594327308 >< (OIP1) +01:41:48 1594327308 >७ ⥪騩< (OIP1) +01:41:49 1594327309 >: 롮 稭< (OIP1) +01:41:49 1594327309 >७ < (OIP1) +01:41:50 1594327310 >७ < (OIP1) +01:41:50 1594327310 >< (OIP1) +01:41:52 1594327312 >< (OIP1) +01:41:52 1594327312 >< (OIP1) +01:41:53 1594327313 >< (OIP1) +01:41:53 1594327313 >< (OIP1) +01:45:04 1594327504 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:45:05 1594327505 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:48:31 1594327711 >< (OIP1) +01:48:31 1594327711 >< (OIP1) +01:48:31 1594327711 >< (OIP1) +01:48:31 1594327711 >७ ⥪騩< (OIP1) +01:48:32 1594327712 >: 롮 稭< (OIP1) +01:48:32 1594327712 >७ < (OIP1) +01:48:34 1594327714 >७ < (OIP1) +01:48:34 1594327714 >嫠 < (OIP1) +01:48:34 1594327714 >嫠 < (OIP1) +01:48:34 1594327714 >< (OIP1) +01:48:36 1594327716 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:48:38 1594327718 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:48:39 1594327719 >< (OIP1) +01:48:39 1594327719 >< (OIP1) +01:48:39 1594327719 >< (OIP1) +01:48:39 1594327719 >७ ⥪騩< (OIP1) +01:48:40 1594327720 >: 롮 稭< (OIP1) +01:48:40 1594327720 >७ < (OIP1) +01:48:42 1594327722 >७ < (OIP1) +01:48:42 1594327722 >嫠 < (OIP1) +01:48:43 1594327723 >嫠 < (OIP1) +01:48:43 1594327723 >< (OIP1) +01:49:06 1594327746 >< (OIP1) +01:49:06 1594327746 >< (OIP1) +01:49:06 1594327746 >< (OIP1) +01:49:06 1594327746 >७ ⥪騩< (OIP1) +01:49:07 1594327747 >: 롮 稭< (OIP1) +01:49:07 1594327747 > < (OIP1) +01:49:07 1594327747 > < (OIP1) +01:49:07 1594327747 >< (OIP1) +01:49:10 1594327750 >< (OIP1) +01:49:10 1594327750 >嫠 < (OIP1) +01:49:11 1594327751 >嫠 < (OIP1) +01:49:11 1594327751 >< (OIP1) +01:49:11 1594327751 >< (OIP1) +01:49:11 1594327751 >< (OIP1) +01:49:13 1594327753 >< (OIP1) +01:49:13 1594327753 >७ ⥪騩< (OIP1) +01:49:14 1594327754 >: 롮 稭< (OIP1) +01:49:14 1594327754 >嫠 < (OIP1) +01:49:14 1594327754 >嫠 < (OIP1) +01:49:14 1594327754 >< (OIP1) +01:49:16 1594327756 >< (OIP1) +01:49:16 1594327756 >< (OIP1) +01:49:17 1594327757 >< (OIP1) +01:49:17 1594327757 >७ ⥪騩< (OIP1) +01:49:18 1594327758 >: 롮 稭< (OIP1) +01:49:18 1594327758 >७ < (OIP1) +01:49:21 1594327761 >७ < (OIP1) +01:49:21 1594327761 >嫠 < (OIP1) +01:49:21 1594327761 >嫠 < (OIP1) +01:49:21 1594327761 >< (OIP1) +01:49:22 1594327762 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:49:23 1594327763 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:49:24 1594327764 >< (OIP1) +01:49:24 1594327764 >७ ⥪騩< (OIP1) +01:49:25 1594327765 >: 롮 稭< (OIP1) +01:49:25 1594327765 >嫠 < (OIP1) +01:49:25 1594327765 >嫠 < (OIP1) +01:49:25 1594327765 >< (OIP1) +01:49:31 1594327771 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:49:32 1594327772 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:49:34 1594327774 >< (OIP1) +01:49:34 1594327774 >< (OIP1) +01:49:35 1594327775 >< (OIP1) +01:49:35 1594327775 >७ ⥪騩< (OIP1) +01:49:35 1594327775 >: 롮 稭< (OIP1) +01:49:35 1594327775 >७ < (OIP1) +01:49:39 1594327779 >७ < (OIP1) +01:49:39 1594327779 >嫠 < (OIP1) +01:49:42 1594327782 >嫠 < (OIP1) +01:49:42 1594327782 >< (OIP1) +01:50:03 1594327803 >< (OIP1) +01:50:03 1594327803 >< (OIP1) +01:50:03 1594327803 >< (OIP1) +01:50:03 1594327803 >७ ⥪騩< (OIP1) +01:50:05 1594327805 >: 롮 稭< (OIP1) +01:50:05 1594327805 >७ < (OIP1) +01:50:09 1594327809 >७ < (OIP1) +01:50:09 1594327809 >嫠 < (OIP1) +01:50:10 1594327810 >嫠 < (OIP1) +01:50:10 1594327810 >< (OIP1) +01:50:18 1594327818 >< (OIP1) +01:50:18 1594327818 >< (OIP1) +01:50:19 1594327819 >< (OIP1) +01:50:19 1594327819 >७ ⥪騩< (OIP1) +01:50:20 1594327820 >: 롮 稭< (OIP1) +01:50:20 1594327820 >७ < (OIP1) +01:50:35 1594327835 >७ < (OIP1) +01:50:35 1594327835 >嫠 < (OIP1) +01:50:35 1594327835 >嫠 < (OIP1) +01:50:35 1594327835 >< (OIP1) +01:51:08 1594327868 >< (OIP1) +01:51:08 1594327868 >< (OIP1) +01:51:09 1594327869 >< (OIP1) +01:51:09 1594327869 >७ ⥪騩< (OIP1) +01:51:09 1594327869 >: 롮 稭< (OIP1) +01:51:09 1594327869 >७ < (OIP1) +01:51:15 1594327875 >७ < (OIP1) +01:51:15 1594327875 >< (OIP1) +01:51:17 1594327877 >< (OIP1) +01:51:17 1594327877 >嫠 < (OIP1) +01:51:19 1594327879 >嫠 < (OIP1) +01:51:19 1594327879 >< (OIP1) +01:51:57 1594327917 >< (OIP1) +01:51:57 1594327917 >< (OIP1) +01:51:58 1594327918 >< (OIP1) +01:51:58 1594327918 >७ ⥪騩< (OIP1) +01:51:59 1594327919 >: 롮 稭< (OIP1) +01:51:59 1594327919 >७ < (OIP1) +01:52:12 1594327932 >७ < (OIP1) +01:52:12 1594327932 >< (OIP1) +01:52:16 1594327936 >< (OIP1) +01:52:16 1594327936 >嫠 < (OIP1) +01:52:17 1594327937 >嫠 < (OIP1) +01:52:17 1594327937 >< (OIP1) +01:52:25 1594327945 >< (OIP1) +01:52:25 1594327945 > < (OIP1) +01:52:26 1594327946 > < (OIP1) +01:52:26 1594327946 >< (OIP1) +01:52:47 1594327967 >< (OIP1) +01:52:47 1594327967 >嫠 < (OIP1) +01:52:50 1594327970 >嫠 < (OIP1) +01:52:50 1594327970 >< (OIP1) +01:53:08 1594327988 >< (OIP1) +01:53:08 1594327988 >< (OIP1) +01:53:09 1594327989 >< (OIP1) +01:53:09 1594327989 >७ ⥪騩< (OIP1) +01:53:11 1594327991 >: 롮 稭< (OIP1) +01:53:11 1594327991 >७ < (OIP1) +01:53:14 1594327994 >७ < (OIP1) +01:53:14 1594327994 >嫠 < (OIP1) +01:53:15 1594327995 >嫠 < (OIP1) +01:53:15 1594327995 >< (OIP1) +01:53:56 1594328036 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:53:57 1594328037 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +01:54:05 1594328045 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:54:07 1594328047 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:54:08 1594328048 >< (OIP1) +01:54:08 1594328048 >< (OIP1) +01:54:08 1594328048 >< (OIP1) +01:54:08 1594328048 >< (OIP1) +01:59:16 1594328356 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:59:27 1594328367 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +01:59:27 1594328367 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +02:03:34 1594328614 >< (OIP1) +02:03:34 1594328614 >< (OIP1) +02:03:35 1594328615 >< (OIP1) +02:03:35 1594328615 >७ ⥪騩< (OIP1) +02:03:35 1594328615 >: 롮 稭< (OIP1) +02:03:35 1594328615 >७ < (OIP1) +02:03:38 1594328618 >७ < (OIP1) +02:03:38 1594328618 >嫠 < (OIP1) +02:03:38 1594328618 >嫠 < (OIP1) +02:03:38 1594328618 >< (OIP1) +02:03:41 1594328621 >< (OIP1) +02:03:41 1594328621 >< (OIP1) +02:03:42 1594328622 >< (OIP1) +02:03:42 1594328622 >७ ⥪騩< (OIP1) +02:03:42 1594328622 >: 롮 稭< (OIP1) +02:03:42 1594328622 >७ < (OIP1) +02:03:45 1594328625 >७ < (OIP1) +02:03:45 1594328625 >嫠 < (OIP1) +02:03:45 1594328625 >嫠 < (OIP1) +02:03:45 1594328625 >< (OIP1) +02:03:55 1594328635 >< (OIP1) +02:03:55 1594328635 >< (OIP1) +02:03:55 1594328635 >< (OIP1) +02:03:55 1594328635 >७ ⥪騩< (OIP1) +02:03:56 1594328636 >: 롮 稭< (OIP1) +02:03:56 1594328636 >७ < (OIP1) +02:04:02 1594328642 >७ < (OIP1) +02:04:02 1594328642 >嫠 < (OIP1) +02:04:03 1594328643 >嫠 < (OIP1) +02:04:03 1594328643 >< (OIP1) +02:04:16 1594328656 >< (OIP1) +02:04:16 1594328656 >< (OIP1) +02:04:16 1594328656 >< (OIP1) +02:04:16 1594328656 >७ ⥪騩< (OIP1) +02:04:17 1594328657 >: 롮 稭< (OIP1) +02:04:17 1594328657 >७ < (OIP1) +02:04:19 1594328659 >७ < (OIP1) +02:04:19 1594328659 >嫠 < (OIP1) +02:04:20 1594328660 >嫠 < (OIP1) +02:04:20 1594328660 >< (OIP1) +02:04:24 1594328664 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +02:04:25 1594328665 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +02:04:34 1594328674 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +02:04:34 1594328674 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +02:04:37 1594328677 >< (OIP1) +02:04:37 1594328677 >< (OIP1) +02:04:37 1594328677 >< (OIP1) +02:04:37 1594328677 >७ ⥪騩< (OIP1) +02:04:38 1594328678 >: 롮 稭< (OIP1) +02:04:38 1594328678 >७ < (OIP1) +02:04:39 1594328679 >७ < (OIP1) +02:04:39 1594328679 >嫠 < (OIP1) +02:04:39 1594328679 >嫠 < (OIP1) +02:04:39 1594328679 >< (OIP1) +02:09:39 1594328979 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +02:09:52 1594328992 >< (OIP1) +02:09:52 1594328992 > < (OIP1) +02:09:53 1594328993 > < (OIP1) +02:09:53 1594328993 >< (OIP1) +02:10:09 1594329009 >< (OIP1) +02:10:09 1594329009 >嫠 < (OIP1) +02:10:14 1594329014 >嫠 < (OIP1) +02:10:14 1594329014 >< (OIP1) +02:10:17 1594329017 >< (OIP1) +02:10:17 1594329017 >嫠 < (OIP1) +02:10:22 1594329022 >嫠 < (OIP1) +02:10:22 1594329022 >嫠 .< (OIP1) +02:10:24 1594329024 >嫠 .< (OIP1) +02:10:24 1594329024 >嫠 < (OIP1) +02:10:28 1594329028 Cooling C1_CMD_CWT_EXT_SK --softkey external cooling water system on/off (CMD࠭ (OIP1) +02:10:32 1594329032 >嫠 < (OIP1) +02:10:32 1594329032 >嫠 .< (OIP1) +02:11:17 1594329077 >嫠 .< (OIP1) +02:11:17 1594329077 >< (OIP1) +02:11:20 1594329080 >< (OIP1) +02:11:20 1594329080 > < (OIP1) +02:11:21 1594329081 > < (OIP1) +02:11:21 1594329081 >< (OIP1) +02:11:24 1594329084 >< (OIP1) +02:11:24 1594329084 >< (OIP1) +02:11:24 1594329084 >< (OIP1) +02:11:24 1594329084 >< (OIP1) +02:11:25 1594329085 >< (OIP1) +02:11:25 1594329085 >嫠 < (OIP1) +02:11:26 1594329086 >嫠 < (OIP1) +02:11:26 1594329086 >嫠 .< (OIP1) +02:12:23 1594329143 >嫠 .< (OIP1) +02:12:23 1594329143 >< (OIP1) +02:12:29 1594329149 >< (OIP1) +02:12:29 1594329149 >嫠 < (OIP1) +02:12:30 1594329150 >嫠 < (OIP1) +02:12:30 1594329150 >嫠 .< (OIP1) +02:12:36 1594329156 >嫠 .< (OIP1) +02:12:36 1594329156 >嫠 < (OIP1) +02:12:38 1594329158 >嫠 < (OIP1) +02:12:38 1594329158 >< (OIP1) +02:12:40 1594329160 >< (OIP1) +02:12:40 1594329160 >< (OIP1) +02:12:41 1594329161 >< (OIP1) +02:12:41 1594329161 >< (OIP1) +02:14:00 1594329240 >< (OIP1) +02:14:00 1594329240 >< (OIP1) +02:14:01 1594329241 >< (OIP1) +02:14:01 1594329241 >< (OIP1) +02:14:02 1594329242 >< (OIP1) +02:14:02 1594329242 >嫠 < (OIP1) +02:14:06 1594329246 >嫠 < (OIP1) +02:14:06 1594329246 >嫠 .< (OIP1) +02:14:12 1594329252 >嫠 .< (OIP1) +02:14:12 1594329252 >< (OIP1) +02:14:13 1594329253 >< (OIP1) +02:14:13 1594329253 >< (OIP1) +02:14:23 1594329263 >< (OIP1) +02:14:23 1594329263 >嫠 < (OIP1) +02:14:26 1594329266 >嫠 < (OIP1) +02:14:26 1594329266 >嫠 .< (OIP1) +02:15:42 1594329342 >嫠 .< (OIP1) +02:15:42 1594329342 >< (OIP1) +02:15:43 1594329343 >< (OIP1) +02:15:43 1594329343 >< (OIP1) +02:15:43 1594329343 >< (OIP1) +02:15:43 1594329343 >嫠 < (OIP1) +02:15:45 1594329345 >嫠 < (OIP1) +02:15:45 1594329345 >< (OIP1) +02:15:46 1594329346 >< (OIP1) +02:15:46 1594329346 > < (OIP1) +02:15:47 1594329347 > < (OIP1) +02:15:47 1594329347 >< (OIP1) +02:15:49 1594329349 >< (OIP1) +02:15:49 1594329349 >嫠 < (OIP1) +02:15:50 1594329350 >嫠 < (OIP1) +02:15:50 1594329350 >< (OIP1) +02:15:53 1594329353 >< (OIP1) +02:15:53 1594329353 >< (OIP1) +02:15:54 1594329354 >< (OIP1) +02:15:54 1594329354 >७ ⥪騩< (OIP1) +02:15:56 1594329356 >: 롮 稭< (OIP1) +02:15:56 1594329356 >७ < (OIP1) +02:16:11 1594329371 >७ < (OIP1) +02:16:11 1594329371 >嫠 < (OIP1) +02:16:13 1594329373 >嫠 < (OIP1) +02:16:13 1594329373 >嫠 .< (OIP1) +02:16:18 1594329378 >嫠 .< (OIP1) +02:16:18 1594329378 >< (OIP1) +02:16:19 1594329379 >< (OIP1) +02:16:19 1594329379 >< (OIP1) +02:16:20 1594329380 >< (OIP1) +02:16:20 1594329380 >嫠 < (OIP1) +02:16:22 1594329382 >嫠 < (OIP1) +02:16:22 1594329382 >< (OIP1) +02:16:24 1594329384 >< (OIP1) +02:16:24 1594329384 > < (OIP1) +02:16:25 1594329385 > < (OIP1) +02:16:25 1594329385 >嫠 < (OIP1) +02:16:25 1594329385 >嫠 < (OIP1) +02:16:25 1594329385 >嫠 .< (OIP1) +02:16:27 1594329387 >嫠 .< (OIP1) +02:16:27 1594329387 >< (OIP1) +02:16:29 1594329389 >< (OIP1) +02:16:29 1594329389 >< (OIP1) +02:16:32 1594329392 >< (OIP1) +02:16:32 1594329392 >७ ⥪騩< (OIP1) +02:16:33 1594329393 >: 롮 稭< (OIP1) +02:16:33 1594329393 >७ < (OIP1) +02:16:39 1594329399 >७ < (OIP1) +02:16:39 1594329399 >< (OIP1) +02:16:42 1594329402 >< (OIP1) +02:16:42 1594329402 >嫠 < (OIP1) +02:16:43 1594329403 >嫠 < (OIP1) +02:16:43 1594329403 >嫠 .< (OIP1) +02:16:46 1594329406 >嫠 .< (OIP1) +02:16:46 1594329406 >७ ⥪騩< (OIP1) +02:16:49 1594329409 >: 롮 稭< (OIP1) +02:16:49 1594329409 >嫠 < (OIP1) +02:16:50 1594329410 >嫠 < (OIP1) +02:16:50 1594329410 >< (OIP1) +02:16:57 1594329417 >< (OIP1) +02:16:57 1594329417 >嫠 < (OIP1) +02:16:57 1594329417 >嫠 < (OIP1) +02:16:57 1594329417 >嫠 .< (OIP1) +02:17:18 1594329438 >嫠 .< (OIP1) +02:17:18 1594329438 >७ ⥪騩< (OIP1) +02:17:20 1594329440 >: 롮 稭< (OIP1) +02:17:20 1594329440 >嫠 < (OIP1) +02:17:21 1594329441 >嫠 < (OIP1) +02:17:21 1594329441 >< (OIP1) +02:17:23 1594329443 >< (OIP1) +02:17:23 1594329443 >< (OIP1) +02:17:23 1594329443 >< (OIP1) +02:17:23 1594329443 >७ ⥪騩< (OIP1) +02:17:24 1594329444 >: 롮 稭< (OIP1) +02:17:24 1594329444 >७ < (OIP1) +02:17:31 1594329451 >७ < (OIP1) +02:17:31 1594329451 >嫠 < (OIP1) +02:17:32 1594329452 >嫠 < (OIP1) +02:17:32 1594329452 >< (OIP1) +02:17:35 1594329455 >< (OIP1) +02:17:35 1594329455 >< (OIP1) +02:17:37 1594329457 >< (OIP1) +02:17:37 1594329457 >嫠 < (OIP1) +02:17:38 1594329458 >嫠 < (OIP1) +02:17:38 1594329458 >嫠 .< (OIP1) +02:18:23 1594329503 >嫠 .< (OIP1) +02:18:23 1594329503 >< (OIP1) +02:18:24 1594329504 >< (OIP1) +02:18:24 1594329504 >७ ⥪騩< (OIP1) +02:18:25 1594329505 >: 롮 稭< (OIP1) +02:18:25 1594329505 >७ < (OIP1) +02:18:31 1594329511 >७ < (OIP1) +02:18:31 1594329511 >嫠 < (OIP1) +02:18:32 1594329512 >嫠 < (OIP1) +02:18:32 1594329512 >嫠 .< (OIP1) +02:18:34 1594329514 >嫠 .< (OIP1) +02:18:34 1594329514 >< (OIP1) +02:18:38 1594329518 >< (OIP1) +02:18:38 1594329518 >< (OIP1) +02:18:39 1594329519 >< (OIP1) +02:18:39 1594329519 >< (OIP1) +02:18:40 1594329520 >< (OIP1) +02:18:40 1594329520 >嫠 < (OIP1) +02:18:42 1594329522 >嫠 < (OIP1) +02:18:42 1594329522 >嫠 .< (OIP1) +02:18:45 1594329525 >嫠 .< (OIP1) +02:18:45 1594329525 >७ ⥪騩< (OIP1) +02:18:46 1594329526 >: 롮 稭< (OIP1) +02:18:46 1594329526 >< (OIP1) +02:18:53 1594329533 >< (OIP1) +02:18:53 1594329533 >< (OIP1) +02:18:54 1594329534 >< (OIP1) +02:18:54 1594329534 >७ ⥪騩< (OIP1) +02:18:55 1594329535 >: 롮 稭< (OIP1) +02:18:55 1594329535 >७ < (OIP1) +02:19:22 1594329562 >७ < (OIP1) +02:19:22 1594329562 >嫠 < (OIP1) +02:19:23 1594329563 >嫠 < (OIP1) +02:19:23 1594329563 >< (OIP1) +02:19:27 1594329567 >< (OIP1) +02:19:27 1594329567 >< (OIP1) +02:19:27 1594329567 >< (OIP1) +02:19:27 1594329567 >嫠 < (OIP1) +02:19:28 1594329568 >嫠 < (OIP1) +02:19:28 1594329568 >嫠 .< (OIP1) +02:19:31 1594329571 Cooling C1_CMD_CWT_HTR_SK --softkey heater cooling water(CMD)࠭ (OIP1) +02:19:35 1594329575 >嫠 .< (OIP1) +02:19:35 1594329575 >< (OIP1) +02:19:37 1594329577 >< (OIP1) +02:19:37 1594329577 >嫠 < (OIP1) +02:19:40 1594329580 >嫠 < (OIP1) +02:19:40 1594329580 >嫠 .< (OIP1) +02:19:41 1594329581 Cooling C1_CMD_CWT_HTR_SK --softkey heater cooling water(CMD)࠭ (OIP1) +02:20:58 1594329658 >嫠 .< (OIP1) +02:20:58 1594329658 >嫠 < (OIP1) +02:21:23 1594329683 >嫠 < (OIP1) +02:21:23 1594329683 >嫠 .< (OIP1) +02:21:48 1594329708 >嫠 .< (OIP1) +02:21:48 1594329708 >./ᨣ.< (OIP1) +02:21:49 1594329709 >./ᨣ.< (OIP1) +02:21:49 1594329709 >./ᨣ. .< (OIP1) +02:21:53 1594329713 >./ᨣ. .< (OIP1) +02:21:53 1594329713 >< (OIP1) +02:21:54 1594329714 >< (OIP1) +02:21:54 1594329714 >७ ⥪騩< (OIP1) +02:21:54 1594329714 >: 롮 稭< (OIP1) +02:21:54 1594329714 >嫠 < (OIP1) +02:24:35 1594329875 >嫠 < (OIP1) +02:24:35 1594329875 >嫠 .< (OIP1) +02:24:39 1594329879 >嫠 .< (OIP1) +02:24:39 1594329879 >७ ⥪騩< (OIP1) +02:24:42 1594329882 >: 롮 稭< (OIP1) +02:24:42 1594329882 >嫠 < (OIP1) +02:25:21 1594329921 >嫠 < (OIP1) +02:25:21 1594329921 >< (OIP1) +02:25:24 1594329924 >< (OIP1) +02:25:24 1594329924 >< (OIP1) +02:25:25 1594329925 >< (OIP1) +02:25:25 1594329925 >७ ⥪騩< (OIP1) +02:25:25 1594329925 >: 롮 稭< (OIP1) +02:25:25 1594329925 >嫠 < (OIP1) +02:26:10 1594329970 >嫠 < (OIP1) +02:26:10 1594329970 >< (OIP1) +02:26:12 1594329972 >< (OIP1) +02:26:12 1594329972 >嫠 < (OIP1) +02:26:33 1594329993 >嫠 < (OIP1) +02:26:33 1594329993 >< (OIP1) +02:26:35 1594329995 >< (OIP1) +02:26:35 1594329995 >< (OIP1) +02:26:36 1594329996 >< (OIP1) +02:26:36 1594329996 >嫠 < (OIP1) +02:26:40 1594330000 >嫠 < (OIP1) +02:26:40 1594330000 >嫠 .< (OIP1) +02:26:41 1594330001 >嫠 .< (OIP1) +02:26:41 1594330001 >嫠 < (OIP1) +02:26:48 1594330008 >嫠 < (OIP1) +02:26:48 1594330008 >< (OIP1) +02:26:48 1594330008 >< (OIP1) +02:26:48 1594330008 >< (OIP1) +02:26:49 1594330009 >< (OIP1) +02:26:49 1594330009 >嫠 < (OIP1) +02:27:25 1594330045 >嫠 < (OIP1) +02:27:25 1594330045 >嫠 .< (OIP1) +02:27:39 1594330059 >嫠 .< (OIP1) +02:27:39 1594330059 >< (OIP1) +02:27:41 1594330061 >< (OIP1) +02:27:41 1594330061 >嫠 < (OIP1) +02:27:45 1594330065 >嫠 < (OIP1) +02:27:45 1594330065 >嫠 .< (OIP1) +02:27:53 1594330073 >嫠 .< (OIP1) +02:27:53 1594330073 >७ ⥪騩< (OIP1) +02:27:55 1594330075 >: 롮 稭< (OIP1) +02:27:55 1594330075 >< (OIP1) +02:27:55 1594330075 >< (OIP1) +02:27:55 1594330075 >< (OIP1) +02:27:58 1594330078 >< (OIP1) +02:27:58 1594330078 >嫠 < (OIP1) +02:28:02 1594330082 >嫠 < (OIP1) +02:28:02 1594330082 >嫠 .< (OIP1) +02:28:07 1594330087 >嫠 .< (OIP1) +02:28:07 1594330087 >嫠 < (OIP1) +02:28:14 1594330094 >嫠 < (OIP1) +02:28:14 1594330094 >嫠 .< (OIP1) +02:28:22 1594330102 >嫠 .< (OIP1) +02:28:22 1594330102 >嫠 < (OIP1) +02:28:28 1594330108 >嫠 < (OIP1) +02:28:28 1594330108 >嫠 .< (OIP1) +02:28:39 1594330119 >嫠 .< (OIP1) +02:28:39 1594330119 >嫠 < (OIP1) +02:28:46 1594330126 >嫠 < (OIP1) +02:28:46 1594330126 >嫠 .< (OIP1) +02:28:48 1594330128 >嫠 .< (OIP1) +02:28:48 1594330128 >嫠 < (OIP1) +02:28:55 1594330135 >嫠 < (OIP1) +02:28:55 1594330135 >嫠 .< (OIP1) +02:29:01 1594330141 >嫠 .< (OIP1) +02:29:01 1594330141 >嫠 < (OIP1) +02:29:18 1594330158 >嫠 < (OIP1) +02:29:18 1594330158 >嫠 .< (OIP1) +02:29:29 1594330169 >嫠 .< (OIP1) +02:29:29 1594330169 >嫠 < (OIP1) +02:29:38 1594330178 >嫠 < (OIP1) +02:29:38 1594330178 >嫠 .< (OIP1) +02:29:45 1594330185 >嫠 .< (OIP1) +02:29:45 1594330185 >嫠 < (OIP1) +02:29:51 1594330191 >嫠 < (OIP1) +02:29:51 1594330191 >嫠 .< (OIP1) +02:30:18 1594330218 >嫠 .< (OIP1) +02:30:18 1594330218 >嫠 < (OIP1) +02:30:20 1594330220 >嫠 < (OIP1) +02:30:20 1594330220 >嫠 .< (OIP1) +02:30:28 1594330228 >嫠 .< (OIP1) +02:30:28 1594330228 >< (OIP1) +02:30:35 1594330235 >< (OIP1) +02:30:35 1594330235 >嫠 < (OIP1) +02:30:39 1594330239 >嫠 < (OIP1) +02:30:39 1594330239 >嫠 .< (OIP1) +02:30:47 1594330247 >嫠 .< (OIP1) +02:30:47 1594330247 >< (OIP1) +02:30:52 1594330252 >< (OIP1) +02:30:52 1594330252 >嫠 < (OIP1) +02:30:57 1594330257 >嫠 < (OIP1) +02:30:57 1594330257 >嫠 .< (OIP1) +02:31:08 1594330268 >嫠 .< (OIP1) +02:31:08 1594330268 >嫠 < (OIP1) +02:31:13 1594330273 >嫠 < (OIP1) +02:31:13 1594330273 >嫠 .< (OIP1) +02:31:28 1594330288 >嫠 .< (OIP1) +02:31:28 1594330288 >嫠 < (OIP1) +02:31:32 1594330292 >嫠 < (OIP1) +02:31:32 1594330292 >嫠 .< (OIP1) +02:31:39 1594330299 >嫠 .< (OIP1) +02:31:39 1594330299 >嫠 < (OIP1) +02:32:03 1594330323 >嫠 < (OIP1) +02:32:03 1594330323 >嫠 .< (OIP1) +02:32:18 1594330338 >嫠 .< (OIP1) +02:32:18 1594330338 >嫠 < (OIP1) +02:32:26 1594330346 >嫠 < (OIP1) +02:32:26 1594330346 >嫠 .< (OIP1) +02:32:38 1594330358 >嫠 .< (OIP1) +02:32:38 1594330358 >嫠 < (OIP1) +02:32:52 1594330372 >嫠 < (OIP1) +02:32:52 1594330372 >嫠 .< (OIP1) +02:33:03 1594330383 >嫠 .< (OIP1) +02:33:03 1594330383 >嫠 < (OIP1) +02:36:01 1594330561 >嫠 < (OIP1) +02:36:01 1594330561 >嫠 .< (OIP1) +02:36:03 1594330563 >嫠 .< (OIP1) +02:36:03 1594330563 >७ ⥪騩< (OIP1) +02:36:05 1594330565 >: 롮 稭< (OIP1) +02:36:05 1594330565 >७ < (OIP1) +02:36:14 1594330574 >७ < (OIP1) +02:36:14 1594330574 >嫠 < (OIP1) +02:36:23 1594330583 >嫠 < (OIP1) +02:36:23 1594330583 >嫠 .< (OIP1) +02:59:44 1594331984 >嫠 .< (OIP1) +02:59:44 1594331984 >嫠 < (OIP1) +02:59:50 1594331990 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +03:01:15 1594332075 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +03:01:20 1594332080 >嫠 < (OIP1) +03:01:20 1594332080 >嫠 .< (OIP1) +03:01:21 1594332081 >嫠 .< (OIP1) +03:01:21 1594332081 >< (OIP1) +03:01:22 1594332082 >< (OIP1) +03:01:22 1594332082 >< (OIP1) +03:01:28 1594332088 >< (OIP1) +03:01:28 1594332088 >< (OIP1) +03:01:31 1594332091 >< (OIP1) +03:01:31 1594332091 >嫠 < (OIP1) +03:01:43 1594332103 >嫠 < (OIP1) +03:01:43 1594332103 >嫠 .< (OIP1) +03:01:45 1594332105 >嫠 .< (OIP1) +03:01:45 1594332105 >嫠 < (OIP1) +03:02:03 1594332123 >嫠 < (OIP1) +03:02:03 1594332123 >嫠 .< (OIP1) +03:02:05 1594332125 >嫠 .< (OIP1) +03:02:05 1594332125 >嫠 < (OIP1) +03:03:08 1594332188 >嫠 < (OIP1) +03:03:08 1594332188 >嫠 .< (OIP1) +03:03:09 1594332189 >嫠 .< (OIP1) +03:03:09 1594332189 >嫠 < (OIP1) +03:03:14 1594332194 >嫠 < (OIP1) +03:03:14 1594332194 >嫠 .< (OIP1) +03:03:19 1594332199 >嫠 .< (OIP1) +03:03:19 1594332199 >嫠 < (OIP1) +03:03:27 1594332207 >嫠 < (OIP1) +03:03:27 1594332207 >嫠 .< (OIP1) +03:03:29 1594332209 >嫠 .< (OIP1) +03:03:29 1594332209 >嫠 < (OIP1) +03:03:36 1594332216 >嫠 < (OIP1) +03:03:36 1594332216 >嫠 .< (OIP1) +03:03:43 1594332223 >嫠 .< (OIP1) +03:03:43 1594332223 >嫠 < (OIP1) +03:03:47 1594332227 >嫠 < (OIP1) +03:03:47 1594332227 >嫠 .< (OIP1) +03:03:51 1594332231 >嫠 .< (OIP1) +03:03:51 1594332231 >嫠 < (OIP1) +03:03:57 1594332237 >嫠 < (OIP1) +03:03:57 1594332237 >嫠 .< (OIP1) +03:04:01 1594332241 >嫠 .< (OIP1) +03:04:01 1594332241 >嫠 < (OIP1) +03:04:02 1594332242 >嫠 < (OIP1) +03:04:02 1594332242 >./ᨣ.< (OIP1) +03:04:03 1594332243 >./ᨣ.< (OIP1) +03:04:03 1594332243 >./ᨣ. .< (OIP1) +03:04:05 1594332245 >./ᨣ. .< (OIP1) +03:04:05 1594332245 >./ᨣ.< (OIP1) +03:04:07 1594332247 >./ᨣ.< (OIP1) +03:04:07 1594332247 >./ᨣ. .< (OIP1) +03:04:08 1594332248 >./ᨣ. .< (OIP1) +03:04:08 1594332248 >< (OIP1) +03:04:09 1594332249 >< (OIP1) +03:04:09 1594332249 >嫠 < (OIP1) +03:04:14 1594332254 >嫠 < (OIP1) +03:04:14 1594332254 >७ ⥪騩< (OIP1) +03:04:15 1594332255 >: 롮 稭< (OIP1) +03:04:15 1594332255 >७ < (OIP1) +03:04:17 1594332257 >७ < (OIP1) +03:04:17 1594332257 >嫠 < (OIP1) +03:04:23 1594332263 >嫠 < (OIP1) +03:04:23 1594332263 >< (OIP1) +03:04:29 1594332269 >< (OIP1) +03:04:29 1594332269 >< (OIP1) +03:04:29 1594332269 >< (OIP1) +03:04:29 1594332269 >嫠 < (OIP1) +03:04:37 1594332277 >嫠 < (OIP1) +03:04:37 1594332277 >嫠 .< (OIP1) +03:04:44 1594332284 >嫠 .< (OIP1) +03:04:44 1594332284 >嫠 < (OIP1) +03:04:51 1594332291 >嫠 < (OIP1) +03:04:51 1594332291 >嫠 .< (OIP1) +03:05:15 1594332315 >嫠 .< (OIP1) +03:05:15 1594332315 >嫠 < (OIP1) +03:05:18 1594332318 >嫠 < (OIP1) +03:05:18 1594332318 >< (OIP1) +03:05:20 1594332320 >< (OIP1) +03:05:20 1594332320 >< (OIP1) +03:05:21 1594332321 >< (OIP1) +03:05:21 1594332321 >७ ⥪騩< (OIP1) +03:05:21 1594332321 >: 롮 稭< (OIP1) +03:05:21 1594332321 >嫠 < (OIP1) +03:05:25 1594332325 >嫠 < (OIP1) +03:05:25 1594332325 >嫠 .< (OIP1) +03:05:33 1594332333 >嫠 .< (OIP1) +03:05:33 1594332333 >嫠 < (OIP1) +03:05:40 1594332340 >嫠 < (OIP1) +03:05:40 1594332340 >७ ⥪騩< (OIP1) +03:05:41 1594332341 >: 롮 稭< (OIP1) +03:05:41 1594332341 >嫠 < (OIP1) +03:05:46 1594332346 >嫠 < (OIP1) +03:05:46 1594332346 >< (OIP1) +03:05:48 1594332348 >< (OIP1) +03:05:48 1594332348 >< (OIP1) +03:05:49 1594332349 >< (OIP1) +03:05:49 1594332349 >嫠 < (OIP1) +03:05:57 1594332357 >嫠 < (OIP1) +03:05:57 1594332357 >< (OIP1) +03:06:00 1594332360 >< (OIP1) +03:06:00 1594332360 >< (OIP1) +03:06:00 1594332360 >< (OIP1) +03:06:00 1594332360 >嫠 < (OIP1) +03:06:02 1594332362 >嫠 < (OIP1) +03:06:02 1594332362 >嫠 .< (OIP1) +03:06:06 1594332366 >嫠 .< (OIP1) +03:06:06 1594332366 >< (OIP1) +03:06:16 1594332376 >< (OIP1) +03:06:16 1594332376 >嫠 < (OIP1) +03:06:29 1594332389 >嫠 < (OIP1) +03:06:29 1594332389 >< (OIP1) +03:06:29 1594332389 >< (OIP1) +03:06:29 1594332389 >७ ⥪騩< (OIP1) +03:06:30 1594332390 >: 롮 稭< (OIP1) +03:06:30 1594332390 >७ < (OIP1) +03:06:41 1594332401 >७ < (OIP1) +03:06:41 1594332401 >嫠 < (OIP1) +03:06:43 1594332403 >嫠 < (OIP1) +03:06:43 1594332403 >嫠 .< (OIP1) +03:06:56 1594332416 >嫠 .< (OIP1) +03:06:56 1594332416 >७ ⥪騩< (OIP1) +03:06:56 1594332416 >: 롮 稭< (OIP1) +03:06:56 1594332416 >嫠 < (OIP1) +03:07:03 1594332423 >嫠 < (OIP1) +03:07:03 1594332423 >嫠 .< (OIP1) +03:07:07 1594332427 >嫠 .< (OIP1) +03:07:07 1594332427 >< (OIP1) +03:07:10 1594332430 >< (OIP1) +03:07:10 1594332430 >嫠 < (OIP1) +03:07:21 1594332441 >嫠 < (OIP1) +03:07:21 1594332441 >嫠 .< (OIP1) +03:07:28 1594332448 >嫠 .< (OIP1) +03:07:28 1594332448 >嫠 < (OIP1) +03:07:45 1594332465 >嫠 < (OIP1) +03:07:45 1594332465 >७ ⥪騩< (OIP1) +03:07:45 1594332465 >: 롮 稭< (OIP1) +03:07:45 1594332465 >嫠 < (OIP1) +03:07:48 1594332468 >嫠 < (OIP1) +03:07:48 1594332468 >嫠 .< (OIP1) +03:07:54 1594332474 >嫠 .< (OIP1) +03:07:54 1594332474 >७ ⥪騩< (OIP1) +03:07:55 1594332475 >: 롮 稭< (OIP1) +03:07:55 1594332475 >嫠 < (OIP1) +03:07:55 1594332475 >嫠 < (OIP1) +03:07:55 1594332475 >< (OIP1) +03:07:56 1594332476 >< (OIP1) +03:07:56 1594332476 >嫠 < (OIP1) +03:08:06 1594332486 >嫠 < (OIP1) +03:08:06 1594332486 >嫠 .< (OIP1) +03:08:13 1594332493 >嫠 .< (OIP1) +03:08:13 1594332493 >< (OIP1) +03:08:14 1594332494 >< (OIP1) +03:08:14 1594332494 >嫠 < (OIP1) +03:08:20 1594332500 >嫠 < (OIP1) +03:08:20 1594332500 >嫠 .< (OIP1) +03:08:36 1594332516 >嫠 .< (OIP1) +03:08:36 1594332516 >嫠 < (OIP1) +03:08:40 1594332520 >嫠 < (OIP1) +03:08:40 1594332520 >嫠 .< (OIP1) +03:08:43 1594332523 >嫠 .< (OIP1) +03:08:43 1594332523 >嫠 < (OIP1) +03:09:33 1594332573 >嫠 < (OIP1) +03:09:33 1594332573 >嫠 .< (OIP1) +03:09:38 1594332578 >嫠 .< (OIP1) +03:09:38 1594332578 >७ ⥪騩< (OIP1) +03:09:38 1594332578 >: 롮 稭< (OIP1) +03:09:38 1594332578 >< (OIP1) +03:09:40 1594332580 >< (OIP1) +03:09:40 1594332580 >嫠 < (OIP1) +03:10:01 1594332601 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +03:10:26 1594332626 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +03:11:28 1594332688 >嫠 < (OIP1) +03:11:28 1594332688 >< (OIP1) +03:11:30 1594332690 >< (OIP1) +03:11:30 1594332690 >< (OIP1) +03:11:31 1594332691 >< (OIP1) +03:11:31 1594332691 >嫠 < (OIP1) +03:12:34 1594332754 >嫠 < (OIP1) +03:12:34 1594332754 >< (OIP1) +03:12:35 1594332755 >< (OIP1) +03:12:35 1594332755 >嫠 < (OIP1) +03:16:40 1594333000 >嫠 < (OIP1) +03:16:40 1594333000 >嫠 .< (OIP1) +03:16:43 1594333003 >嫠 .< (OIP1) +03:16:43 1594333003 >嫠 < (OIP1) +03:18:05 1594333085 >嫠 < (OIP1) +03:18:05 1594333085 >< (OIP1) +03:18:05 1594333085 >< (OIP1) +03:18:05 1594333085 >< (OIP1) +03:18:09 1594333089 >< (OIP1) +03:18:09 1594333089 >< (OIP1) +03:18:14 1594333094 >< (OIP1) +03:18:14 1594333094 >嫠 < (OIP1) +03:18:35 1594333115 >嫠 < (OIP1) +03:18:35 1594333115 >./ᨣ.< (OIP1) +03:18:36 1594333116 >./ᨣ.< (OIP1) +03:18:36 1594333116 >./ᨣ. .< (OIP1) +03:18:50 1594333130 >./ᨣ. .< (OIP1) +03:18:50 1594333130 >< (OIP1) +03:18:51 1594333131 >< (OIP1) +03:18:51 1594333131 >嫠 < (OIP1) +03:18:53 1594333133 >嫠 < (OIP1) +03:18:53 1594333133 >./ᨣ.< (OIP1) +03:18:54 1594333134 >./ᨣ.< (OIP1) +03:18:54 1594333134 >./ᨣ. .< (OIP1) +03:19:08 1594333148 >./ᨣ. .< (OIP1) +03:19:08 1594333148 >./ᨣ.< (OIP1) +03:19:13 1594333153 >./ᨣ.< (OIP1) +03:19:13 1594333153 >嫠 < (OIP1) +03:20:44 1594333244 >嫠 < (OIP1) +03:20:44 1594333244 >< (OIP1) +03:20:49 1594333249 >< (OIP1) +03:20:49 1594333249 >< (OIP1) +03:20:50 1594333250 >< (OIP1) +03:20:50 1594333250 > < (OIP1) +03:20:52 1594333252 > < (OIP1) +03:20:52 1594333252 >७ ⥪騩< (OIP1) +03:20:53 1594333253 >: 롮 稭< (OIP1) +03:20:53 1594333253 >७ < (OIP1) +03:20:56 1594333256 >७ < (OIP1) +03:20:56 1594333256 >嫠 < (OIP1) +03:29:09 1594333749 >嫠 < (OIP1) +03:29:09 1594333749 > < (OIP1) +03:29:10 1594333750 > < (OIP1) +03:29:10 1594333750 >< (OIP1) +03:29:24 1594333764 >< (OIP1) +03:29:24 1594333764 >ਢઠ< (OIP1) +03:29:57 1594333797 >ਢઠ< (OIP1) +03:29:57 1594333797 >嫠 < (OIP1) +03:29:59 1594333799 >嫠 < (OIP1) +03:29:59 1594333799 >嫠 .< (OIP1) +03:30:03 1594333803 >嫠 .< (OIP1) +03:30:03 1594333803 >< (OIP1) +03:30:03 1594333803 >< (OIP1) +03:30:03 1594333803 >ਢઠ< (OIP1) +03:31:26 1594333886 >ਢઠ< (OIP1) +03:31:26 1594333886 >< (OIP1) +03:31:35 1594333895 >< (OIP1) +03:31:35 1594333895 >ਢઠ< (OIP1) +03:38:11 1594334291 >ਢઠ< (OIP1) +03:38:11 1594334291 >७ ⥪騩< (OIP1) +03:38:12 1594334292 >: 롮 稭< (OIP1) +03:38:12 1594334292 >७ < (OIP1) +03:38:18 1594334298 >७ < (OIP1) +03:38:18 1594334298 >ਢઠ< (OIP1) +03:44:43 1594334683 >ਢઠ< (OIP1) +03:44:43 1594334683 >< (OIP1) +03:44:46 1594334686 >< (OIP1) +03:44:46 1594334686 >ਢઠ< (OIP1) +03:46:17 1594334777 >ਢઠ< (OIP1) +03:46:17 1594334777 >< (OIP1) +03:46:22 1594334782 >< (OIP1) +03:46:22 1594334782 >ਢઠ< (OIP1) +03:47:46 1594334866 >ਢઠ< (OIP1) +03:47:46 1594334866 >< (OIP1) +03:47:59 1594334879 >< (OIP1) +03:47:59 1594334879 >< (OIP1) +03:48:14 1594334894 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +03:48:15 1594334895 >஫ < (OIP1) +03:48:18 1594334898 Vacuum C1_CMD_GAS_PRS_CTR_SK --softkey pressure control gas on/off(CMD)࠭ (OIP1) +03:48:42 1594334922 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:48:48 1594334928 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:48:49 1594334929 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:48:51 1594334931 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:48:52 1594334932 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:48:52 1594334932 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:48:55 1594334935 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:48:57 1594334937 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:48:58 1594334938 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:49:00 1594334940 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:49:02 1594334942 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:49:02 1594334942 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:49:03 1594334943 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:49:06 1594334946 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:49:10 1594334950 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:49:10 1594334950 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:49:11 1594334951 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:49:11 1594334951 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +03:49:17 1594334957 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +06:18:02 1594343882 Vacuum C1_CMD_GAS_PRS_CTR_SK --softkey pressure control gas on/off(CMD)࠭ (OIP1) +06:18:02 1594343882 >஫ < (OIP1) +06:18:04 1594343884 >< (OIP1) +06:18:04 1594343884 >< (OIP1) +06:18:06 1594343886 ⢨ (OIP1) +06:18:08 1594343888 >< (OIP1) +06:18:08 1594343888 >< (OIP1) +06:18:09 1594343889 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +06:18:09 1594343889 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +06:18:11 1594343891 >< (OIP1) +06:18:11 1594343891 >嫠 < (OIP1) +06:18:12 1594343892 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +06:18:13 1594343893 >嫠 < (OIP1) +06:18:13 1594343893 >< (OIP1) +06:56:18 1594346178 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +06:56:19 1594346179 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +06:56:20 1594346180 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +06:56:21 1594346181 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +06:56:24 1594346184 >< (OIP1) +06:56:24 1594346184 > < (OIP1) +06:56:27 1594346187 > < (OIP1) +06:56:27 1594346187 >嫠 < (OIP1) +06:56:28 1594346188 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +06:59:14 1594346354 >嫠 < (OIP1) +06:59:14 1594346354 > < (OIP1) +06:59:17 1594346357 > < (OIP1) +06:59:17 1594346357 > < (OIP1) +06:59:20 1594346360 > < (OIP1) +06:59:20 1594346360 >Mpar6Interlocks12< (OIP1) +06:59:20 1594346360 Machine C1_CMD_DIAG_INSU_STING_SK --test insulation stinger(CMD)࠭ (OIP1) +06:59:24 1594346364 Machine C1_CMD_DIAG_INSU_FNCE_SK --test insulation furnace(CMD)࠭ (OIP1) +06:59:27 1594346367 >Mpar6Interlocks12< (OIP1) +06:59:27 1594346367 > < (OIP1) +06:59:28 1594346368 > < (OIP1) +06:59:28 1594346368 >< (OIP1) +07:00:45 1594346445 >< (OIP1) +07:00:45 1594346445 > < (OIP1) +07:00:50 1594346450 > < (OIP1) +07:00:50 1594346450 >< (OIP1) +07:00:51 1594346451 >< (OIP1) +07:00:51 1594346451 > < (OIP1) +07:00:52 1594346452 > < (OIP1) +07:00:52 1594346452 >< (OIP1) +07:00:54 1594346454 >< (OIP1) +07:00:54 1594346454 >< (OIP1) +07:00:55 1594346455 >< (OIP1) +07:00:55 1594346455 >७ ⥪騩< (OIP1) +07:00:57 1594346457 >: 롮 稭< (OIP1) +07:00:57 1594346457 >७ < (OIP1) +07:01:02 1594346462 >७ < (OIP1) +07:01:02 1594346462 >嫠 < (OIP1) +07:01:04 1594346464 >嫠 < (OIP1) +07:01:04 1594346464 >< (OIP1) +07:01:09 1594346469 >< (OIP1) +07:01:09 1594346469 > < (OIP1) +07:01:12 1594346472 > < (OIP1) +07:01:12 1594346472 >< (OIP1) +07:01:12 1594346472 >< (OIP1) +07:01:12 1594346472 >嫠 < (OIP1) +07:01:12 1594346472 >嫠 < (OIP1) +07:01:12 1594346472 >< (OIP1) +07:01:15 1594346475 >< (OIP1) +07:01:15 1594346475 > < (OIP1) +07:01:18 1594346478 > < (OIP1) +07:01:18 1594346478 >< (OIP1) +07:01:18 1594346478 >< (OIP1) +07:01:18 1594346478 >७ ⥪騩< (OIP1) +07:01:19 1594346479 >: 롮 稭< (OIP1) +07:01:19 1594346479 >७ < (OIP1) +07:01:21 1594346481 >७ < (OIP1) +07:01:21 1594346481 > < (OIP1) +07:01:23 1594346483 > < (OIP1) +07:01:23 1594346483 >< (OIP1) +07:01:25 1594346485 >< (OIP1) +07:01:25 1594346485 >< (OIP1) +07:01:27 1594346487 >< (OIP1) +07:01:27 1594346487 > < (OIP1) +07:01:28 1594346488 > < (OIP1) +07:01:28 1594346488 >< (OIP1) +07:01:47 1594346507 >< (OIP1) +07:01:47 1594346507 >嫠 < (OIP1) +07:01:49 1594346509 >嫠 < (OIP1) +07:01:49 1594346509 > < (OIP1) +07:01:50 1594346510 > < (OIP1) +07:01:50 1594346510 >< (OIP1) +07:01:54 1594346514 >< (OIP1) +07:01:54 1594346514 > < (OIP1) +07:01:54 1594346514 > < (OIP1) +07:01:54 1594346514 >< (OIP1) +07:01:56 1594346516 >< (OIP1) +07:01:56 1594346516 >嫠 < (OIP1) +07:02:17 1594346537 >嫠 < (OIP1) +07:02:17 1594346537 > < (OIP1) +07:02:19 1594346539 > < (OIP1) +07:02:19 1594346539 >< (OIP1) +07:02:22 1594346542 >< (OIP1) +07:02:22 1594346542 >< (OIP1) +07:02:22 1594346542 >< (OIP1) +07:02:22 1594346542 >७ ⥪騩< (OIP1) +07:02:23 1594346543 >: 롮 稭< (OIP1) +07:02:23 1594346543 >७ < (OIP1) +07:02:30 1594346550 >७ < (OIP1) +07:02:30 1594346550 >嫠 < (OIP1) +07:02:31 1594346551 >嫠 < (OIP1) +07:02:31 1594346551 >< (OIP1) +07:02:43 1594346563 >< (OIP1) +07:02:43 1594346563 > < (OIP1) +07:02:45 1594346565 > < (OIP1) +07:02:45 1594346565 >< (OIP1) +07:03:13 1594346593 >< (OIP1) +07:03:13 1594346593 > < (OIP1) +07:03:18 1594346598 > < (OIP1) +07:03:18 1594346598 >< (OIP1) +07:03:18 1594346598 >< (OIP1) +07:03:18 1594346598 >< (OIP1) +07:03:18 1594346598 >< (OIP1) +07:03:18 1594346598 >७ ⥪騩< (OIP1) +07:03:20 1594346600 >: 롮 稭< (OIP1) +07:03:20 1594346600 >७ < (OIP1) +07:03:26 1594346606 >७ < (OIP1) +07:03:26 1594346606 >< (OIP1) +07:03:36 1594346616 >< (OIP1) +07:03:36 1594346616 > < (OIP1) +07:03:38 1594346618 > < (OIP1) +07:03:38 1594346618 >< (OIP1) +07:03:43 1594346623 >< (OIP1) +07:03:43 1594346623 >< (OIP1) +07:03:43 1594346623 >< (OIP1) +07:03:43 1594346623 >७ ⥪騩< (OIP1) +07:03:45 1594346625 >: 롮 稭< (OIP1) +07:03:45 1594346625 >७ < (OIP1) +07:04:09 1594346649 >७ < (OIP1) +07:04:09 1594346649 >< (OIP1) +07:04:11 1594346651 >< (OIP1) +07:04:11 1594346651 > < (OIP1) +07:04:13 1594346653 > < (OIP1) +07:04:13 1594346653 >< (OIP1) +07:04:30 1594346670 >< (OIP1) +07:04:30 1594346670 > < (OIP1) +07:04:31 1594346671 > < (OIP1) +07:04:31 1594346671 >< (OIP1) +07:11:35 1594347095 >< (OIP1) +07:11:35 1594347095 > < (OIP1) +07:11:36 1594347096 > < (OIP1) +07:11:36 1594347096 >< (OIP1) +07:21:29 1594347689 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +07:43:36 1594349016 >< (OIP1) +07:43:36 1594349016 >७ ⥪騩< (OIP1) +07:43:37 1594349017 >: 롮 稭< (OIP1) +07:43:37 1594349017 >७ < (OIP1) +07:44:05 1594349045 >७ < (OIP1) +07:44:05 1594349045 >< (OIP1) +07:44:09 1594349049 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +07:47:19 1594349239 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +07:47:23 1594349243 >< (OIP1) +07:47:23 1594349243 >< (OIP1) +07:47:23 1594349243 >< (OIP1) +07:47:23 1594349243 >७ ⥪騩< (OIP1) +07:47:24 1594349244 >: 롮 稭< (OIP1) +07:47:24 1594349244 >७ < (OIP1) +07:47:27 1594349247 >७ < (OIP1) +07:47:27 1594349247 >< (OIP1) +07:47:30 1594349250 >< (OIP1) +07:47:30 1594349250 > < (OIP1) +07:47:31 1594349251 > < (OIP1) +07:47:31 1594349251 >< (OIP1) +07:47:35 1594349255 >< (OIP1) +07:47:35 1594349255 >< (OIP1) +07:47:37 1594349257 >< (OIP1) +07:47:37 1594349257 >७ ⥪騩< (OIP1) +07:47:37 1594349257 >: 롮 稭< (OIP1) +07:47:37 1594349257 >७ < (OIP1) +07:47:40 1594349260 >७ < (OIP1) +07:47:40 1594349260 >嫠 < (OIP1) +07:47:42 1594349262 >嫠 < (OIP1) +07:47:42 1594349262 >< (OIP1) +07:48:03 1594349283 >< (OIP1) +07:48:03 1594349283 > < (OIP1) +07:48:05 1594349285 > < (OIP1) +07:48:05 1594349285 >< (OIP1) +07:48:06 1594349286 >< (OIP1) +07:48:06 1594349286 >< (OIP1) +07:48:13 1594349293 >< (OIP1) +07:48:13 1594349293 >< (OIP1) +07:48:13 1594349293 >< (OIP1) +07:48:13 1594349293 >७ ⥪騩< (OIP1) +07:48:14 1594349294 >: 롮 稭< (OIP1) +07:48:14 1594349294 >७ < (OIP1) +07:48:19 1594349299 >७ < (OIP1) +07:48:19 1594349299 >嫠 < (OIP1) +07:48:20 1594349300 >嫠 < (OIP1) +07:48:20 1594349300 >< (OIP1) +07:48:26 1594349306 >< (OIP1) +07:48:26 1594349306 >< (OIP1) +07:48:26 1594349306 >< (OIP1) +07:48:26 1594349306 >७ ⥪騩< (OIP1) +07:48:27 1594349307 >: 롮 稭< (OIP1) +07:48:27 1594349307 >७ < (OIP1) +07:48:33 1594349313 >७ < (OIP1) +07:48:33 1594349313 >嫠 < (OIP1) +07:48:34 1594349314 >嫠 < (OIP1) +07:48:34 1594349314 >< (OIP1) +07:48:37 1594349317 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +07:48:37 1594349317 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +07:49:46 1594349386 >< (OIP1) +07:49:46 1594349386 >< (OIP1) +07:49:47 1594349387 >< (OIP1) +07:49:47 1594349387 >७ ⥪騩< (OIP1) +07:49:48 1594349388 >: 롮 稭< (OIP1) +07:49:48 1594349388 >७ < (OIP1) +07:49:52 1594349392 >७ < (OIP1) +07:49:52 1594349392 >嫠 < (OIP1) +07:49:52 1594349392 >嫠 < (OIP1) +07:49:52 1594349392 >< (OIP1) +07:49:53 1594349393 >< (OIP1) +07:49:53 1594349393 >< (OIP1) +07:50:08 1594349408 >< (OIP1) +07:50:08 1594349408 >< (OIP1) +07:50:08 1594349408 >< (OIP1) +07:50:08 1594349408 >७ ⥪騩< (OIP1) +07:50:09 1594349409 >: 롮 稭< (OIP1) +07:50:09 1594349409 >७ < (OIP1) +07:50:13 1594349413 >७ < (OIP1) +07:50:13 1594349413 >嫠 < (OIP1) +07:50:15 1594349415 >嫠 < (OIP1) +07:50:15 1594349415 >< (OIP1) +07:51:12 1594349472 >< (OIP1) +07:51:12 1594349472 > < (OIP1) +07:51:15 1594349475 > < (OIP1) +07:51:15 1594349475 >< (OIP1) +07:51:17 1594349477 >< (OIP1) +07:51:17 1594349477 >< (OIP1) +07:51:17 1594349477 >< (OIP1) +07:51:17 1594349477 >७ ⥪騩< (OIP1) +07:51:18 1594349478 >: 롮 稭< (OIP1) +07:51:18 1594349478 >७ < (OIP1) +07:51:28 1594349488 >७ < (OIP1) +07:51:28 1594349488 >嫠 < (OIP1) +07:51:29 1594349489 >嫠 < (OIP1) +07:51:29 1594349489 >< (OIP1) +07:51:31 1594349491 >< (OIP1) +07:51:31 1594349491 >< (OIP1) +07:51:32 1594349492 >< (OIP1) +07:51:32 1594349492 >७ ⥪騩< (OIP1) +07:51:33 1594349493 >: 롮 稭< (OIP1) +07:51:33 1594349493 >७ < (OIP1) +07:51:39 1594349499 >७ < (OIP1) +07:51:39 1594349499 >嫠 < (OIP1) +07:51:39 1594349499 >嫠 < (OIP1) +07:51:39 1594349499 >< (OIP1) +07:51:43 1594349503 >< (OIP1) +07:51:43 1594349503 >< (OIP1) +07:51:43 1594349503 >< (OIP1) +07:51:43 1594349503 >७ ⥪騩< (OIP1) +07:51:44 1594349504 >: 롮 稭< (OIP1) +07:51:44 1594349504 >७ < (OIP1) +07:51:54 1594349514 >७ < (OIP1) +07:51:54 1594349514 >嫠 < (OIP1) +07:51:54 1594349514 >嫠 < (OIP1) +07:51:54 1594349514 >< (OIP1) +07:51:59 1594349519 >< (OIP1) +07:51:59 1594349519 >< (OIP1) +07:52:00 1594349520 >< (OIP1) +07:52:00 1594349520 >७ ⥪騩< (OIP1) +07:52:01 1594349521 >: 롮 稭< (OIP1) +07:52:01 1594349521 >७ < (OIP1) +07:52:05 1594349525 >७ < (OIP1) +07:52:05 1594349525 >嫠 < (OIP1) +07:52:06 1594349526 >嫠 < (OIP1) +07:52:06 1594349526 >< (OIP1) +07:52:10 1594349530 >< (OIP1) +07:52:10 1594349530 >< (OIP1) +07:52:10 1594349530 >< (OIP1) +07:52:10 1594349530 >७ ⥪騩< (OIP1) +07:52:11 1594349531 >: 롮 稭< (OIP1) +07:52:11 1594349531 >७ < (OIP1) +07:52:21 1594349541 >७ < (OIP1) +07:52:21 1594349541 >< (OIP1) +07:52:25 1594349545 >< (OIP1) +07:52:25 1594349545 >< (OIP1) +07:52:25 1594349545 >< (OIP1) +07:52:25 1594349545 >७ ⥪騩< (OIP1) +07:52:26 1594349546 >: 롮 稭< (OIP1) +07:52:26 1594349546 >७ < (OIP1) +07:52:35 1594349555 >७ < (OIP1) +07:52:35 1594349555 >< (OIP1) +07:52:39 1594349559 >< (OIP1) +07:52:39 1594349559 >< (OIP1) +07:52:39 1594349559 >< (OIP1) +07:52:39 1594349559 >७ ⥪騩< (OIP1) +07:52:40 1594349560 >: 롮 稭< (OIP1) +07:52:40 1594349560 >७ < (OIP1) +07:52:43 1594349563 >७ < (OIP1) +07:52:43 1594349563 >< (OIP1) +07:52:46 1594349566 >< (OIP1) +07:52:46 1594349566 >嫠 < (OIP1) +07:52:46 1594349566 >嫠 < (OIP1) +07:52:46 1594349566 >< (OIP1) +07:52:47 1594349567 >< (OIP1) +07:52:47 1594349567 >< (OIP1) +07:52:48 1594349568 >< (OIP1) +07:52:48 1594349568 >< (OIP1) +07:52:49 1594349569 >< (OIP1) +07:52:49 1594349569 >७ ⥪騩< (OIP1) +07:52:50 1594349570 >: 롮 稭< (OIP1) +07:52:50 1594349570 >७ < (OIP1) +07:52:53 1594349573 >७ < (OIP1) +07:52:53 1594349573 >嫠 < (OIP1) +07:52:54 1594349574 >嫠 < (OIP1) +07:52:54 1594349574 >< (OIP1) +07:52:59 1594349579 >< (OIP1) +07:52:59 1594349579 >< (OIP1) +07:52:59 1594349579 >< (OIP1) +07:52:59 1594349579 >७ ⥪騩< (OIP1) +07:53:00 1594349580 >: 롮 稭< (OIP1) +07:53:00 1594349580 >७ < (OIP1) +07:53:14 1594349594 >७ < (OIP1) +07:53:14 1594349594 >< (OIP1) +07:53:22 1594349602 >< (OIP1) +07:53:22 1594349602 >嫠 < (OIP1) +07:53:23 1594349603 >嫠 < (OIP1) +07:53:23 1594349603 >< (OIP1) +07:53:23 1594349603 >< (OIP1) +07:53:23 1594349603 >< (OIP1) +07:53:24 1594349604 >< (OIP1) +07:53:24 1594349604 >< (OIP1) +07:53:27 1594349607 >< (OIP1) +07:53:27 1594349607 >< (OIP1) +07:53:27 1594349607 >< (OIP1) +07:53:27 1594349607 >७ ⥪騩< (OIP1) +07:53:28 1594349608 >: 롮 稭< (OIP1) +07:53:28 1594349608 >७ < (OIP1) +07:53:31 1594349611 >७ < (OIP1) +07:53:31 1594349611 >嫠 < (OIP1) +07:53:31 1594349611 >嫠 < (OIP1) +07:53:31 1594349611 >< (OIP1) +07:53:45 1594349625 >< (OIP1) +07:53:45 1594349625 >< (OIP1) +07:53:46 1594349626 >< (OIP1) +07:53:46 1594349626 >७ ⥪騩< (OIP1) +07:53:48 1594349628 >: 롮 稭< (OIP1) +07:53:48 1594349628 >७ < (OIP1) +07:53:50 1594349630 >७ < (OIP1) +07:53:50 1594349630 >嫠 < (OIP1) +07:53:52 1594349632 >嫠 < (OIP1) +07:53:52 1594349632 >< (OIP1) +07:53:59 1594349639 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +07:54:10 1594349650 >< (OIP1) +07:54:10 1594349650 >< (OIP1) +07:54:11 1594349651 >< (OIP1) +07:54:11 1594349651 >७ ⥪騩< (OIP1) +07:54:12 1594349652 >: 롮 稭< (OIP1) +07:54:12 1594349652 >७ < (OIP1) +07:54:17 1594349657 >७ < (OIP1) +07:54:17 1594349657 >嫠 < (OIP1) +07:54:17 1594349657 >嫠 < (OIP1) +07:54:17 1594349657 >< (OIP1) +07:54:21 1594349661 >< (OIP1) +07:54:21 1594349661 >< (OIP1) +07:54:24 1594349664 >< (OIP1) +07:54:24 1594349664 >< (OIP1) +08:42:03 1594352523 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +08:42:03 1594352523 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +08:42:06 1594352526 >< (OIP1) +08:42:06 1594352526 >嫠 < (OIP1) +08:42:09 1594352529 >嫠 < (OIP1) +08:42:09 1594352529 >./ᨣ.< (OIP1) +08:42:10 1594352530 >./ᨣ.< (OIP1) +08:42:10 1594352530 >./ᨣ. .< (OIP1) +08:42:13 1594352533 >./ᨣ. .< (OIP1) +08:42:13 1594352533 > < (OIP1) +08:42:17 1594352537 > < (OIP1) +08:42:17 1594352537 >< (OIP1) +08:42:38 1594352558 >< (OIP1) +08:42:38 1594352558 >< (OIP1) +08:44:34 1594352674 >< (OIP1) +08:44:34 1594352674 >< (OIP1) +08:44:45 1594352685 >< (OIP1) +08:44:45 1594352685 >ਢઠ< (OIP1) +08:45:46 1594352746 >ਢઠ< (OIP1) +08:45:46 1594352746 >< (OIP1) +08:47:36 1594352856 >< (OIP1) +08:47:36 1594352856 >< (OIP1) +08:48:07 1594352887 >< (OIP1) +08:48:07 1594352887 >ਢઠ< (OIP1) +08:57:18 1594353438 >ਢઠ< (OIP1) +08:57:18 1594353438 >< (OIP1) +08:57:55 1594353475 ⢨ (OIP1) +08:57:56 1594353476 >஫ < (OIP1) +08:57:58 1594353478 Melting C1_CMD_GAS_PRS_CTR_SK --softkey pressure control gas on/off(CMD)࠭ (OIP1) +08:57:58 1594353478 >< (OIP1) +08:57:58 1594353478 >஫ < (OIP1) +08:57:58 1594353478 >< (OIP1) +08:57:59 1594353479 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +09:03:53 1594353833 >஫ < (OIP1) +09:03:55 1594353835 Vacuum C1_CMD_GAS_PRS_CTR_SK --softkey pressure control gas on/off(CMD)࠭ (OIP1) +09:04:10 1594353850 >஫ < (OIP1) +09:35:49 1594355749 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +09:35:51 1594355751 >< (OIP1) +09:35:51 1594355751 >嫠 < (OIP1) +09:35:54 1594355754 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +09:35:55 1594355755 >஫ < (OIP1) +09:35:57 1594355757 >嫠 < (OIP1) +09:35:57 1594355757 >஫ < (OIP1) +09:35:57 1594355757 >< (OIP1) +09:35:58 1594355758 >< (OIP1) +09:35:58 1594355758 >< (OIP1) +09:36:00 1594355760 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +09:36:01 1594355761 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +09:45:28 1594356328 Vacuum C1_CMD_HYD_SK --softkey hydraulic system on/off(CMD)࠭ (OIP1) +10:44:18 1594359858 >< (OIP1) +10:44:18 1594359858 >嫠 < (OIP1) +10:44:19 1594359859 >嫠 < (OIP1) +10:44:19 1594359859 >嫠 .< (OIP1) +10:44:20 1594359860 Cooling C1_CMD_CWT_HTR_SK --softkey heater cooling water(CMD)࠭ (OIP1) +10:50:08 1594360208 >嫠 .< (OIP1) +10:50:08 1594360208 >< (OIP1) +10:50:09 1594360209 Vacuum C1_CMD_HYD_SK --softkey hydraulic system on/off(CMD)࠭ (OIP1) +11:32:44 1594362764 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +11:32:48 1594362768 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +11:32:49 1594362769 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +11:32:51 1594362771 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +11:40:57 1594363257 >< (OIP1) +11:40:57 1594363257 >嫠 < (OIP1) +11:40:58 1594363258 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +11:40:58 1594363258 >嫠 < (OIP1) +11:40:58 1594363258 >嫠 .< (OIP1) +11:41:00 1594363260 Cooling C1_CMD_CWT_HTR_SK --softkey heater cooling water(CMD)࠭ (OIP1) +11:41:01 1594363261 >嫠 .< (OIP1) +11:41:01 1594363261 >< (OIP1) +11:41:07 1594363267 >< (OIP1) +11:41:07 1594363267 > < (OIP1) +11:41:11 1594363271 > < (OIP1) +11:41:11 1594363271 > < (OIP1) +11:41:27 1594363287 > < (OIP1) +11:41:27 1594363287 >Mpar6Interlocks12< (OIP1) +11:41:29 1594363289 Machine C1_CMD_DIAG_INSU_STING_SK --test insulation stinger(CMD)࠭ (OIP1) +11:41:34 1594363294 Machine C1_CMD_DIAG_INSU_FNCE_SK --test insulation furnace(CMD)࠭ (OIP1) +11:41:36 1594363296 >Mpar6Interlocks12< (OIP1) +11:41:36 1594363296 > < (OIP1) +11:41:37 1594363297 > < (OIP1) +11:41:37 1594363297 >< (OIP1) +11:41:40 1594363300 >< (OIP1) +11:41:40 1594363300 >嫠 < (OIP1) +11:42:12 1594363332 >嫠 < (OIP1) +11:42:12 1594363332 >< (OIP1) +12:04:25 1594364665 >< (OIP1) +12:04:25 1594364665 >< (OIP1) +12:05:28 1594364728 >< (OIP1) +12:05:28 1594364728 >< (OIP1) +12:05:30 1594364730 >< (OIP1) +12:05:30 1594364730 >嫠 < (OIP1) +12:05:32 1594364732 >嫠 < (OIP1) +12:05:32 1594364732 >७ ⥪騩< (OIP1) +12:05:38 1594364738 >: 롮 稭< (OIP1) +12:05:38 1594364738 >< (OIP1) +12:59:35 1594367975 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +13:04:31 1594368271 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +13:04:37 1594368277 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +13:06:02 1594368362 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +13:06:54 1594368414 >< (OIP1) +13:06:54 1594368414 > < (OIP1) +13:07:06 1594368426 > < (OIP1) +13:07:06 1594368426 >< (OIP1) +13:07:15 1594368435 >< (OIP1) +13:07:15 1594368435 > < (OIP1) +13:08:21 1594368501 > < (OIP1) +13:08:21 1594368501 >< (OIP1) +13:31:12 1594369872 >< (OIP1) +13:31:12 1594369872 >< (OIP1) +13:31:13 1594369873 >< (OIP1) +13:31:13 1594369873 >嫠 < (OIP1) +13:31:13 1594369873 >嫠 < (OIP1) +13:31:13 1594369873 >७ ⥪騩< (OIP1) +13:31:13 1594369873 >: 롮 稭< (OIP1) +13:31:13 1594369873 >७ < (OIP1) +13:31:20 1594369880 >७ < (OIP1) +13:31:20 1594369880 >< (OIP1) +13:31:22 1594369882 >< (OIP1) +13:31:22 1594369882 > < (OIP1) +14:07:12 1594372032 > < (OIP1) +14:07:12 1594372032 >< (OIP1) +14:07:34 1594372054 >< (OIP1) +14:07:34 1594372054 >ਢઠ< (OIP1) +14:08:09 1594372089 >ਢઠ< (OIP1) +14:08:09 1594372089 >< (OIP1) +14:08:12 1594372092 >< (OIP1) +14:08:12 1594372092 >७ ⥪騩< (OIP1) +14:08:12 1594372092 >: 롮 稭< (OIP1) +14:08:12 1594372092 >७ < (OIP1) +14:08:23 1594372103 >७ < (OIP1) +14:08:23 1594372103 >ਢઠ< (OIP1) +14:08:33 1594372113 >ਢઠ< (OIP1) +14:08:33 1594372113 >< (OIP1) +14:09:58 1594372198 >< (OIP1) +14:09:58 1594372198 >ਢઠ< (OIP1) +14:19:47 1594372787 >ਢઠ< (OIP1) +14:19:47 1594372787 >< (OIP1) +14:19:52 1594372792 >< (OIP1) +14:19:52 1594372792 >ਢઠ< (OIP1) +14:23:53 1594373033 >ਢઠ< (OIP1) +14:23:53 1594373033 >< (OIP1) +14:24:28 1594373068 ⢨ (OIP1) +14:24:29 1594373069 >஫ < (OIP1) +14:24:31 1594373071 Melting C1_CMD_GAS_PRS_CTR_SK --softkey pressure control gas on/off(CMD)࠭ (OIP1) +14:24:32 1594373072 >< (OIP1) +14:24:32 1594373072 >஫ < (OIP1) +14:24:32 1594373072 >< (OIP1) +14:24:32 1594373072 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +14:25:50 1594373150 >< (OIP1) +14:25:50 1594373150 >嫠 < (OIP1) +14:26:03 1594373163 >嫠 < (OIP1) +14:26:03 1594373163 >< (OIP1) +14:28:52 1594373332 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +14:29:11 1594373351 >஫ < (OIP1) +14:29:12 1594373352 >஫ < (OIP1) +14:29:51 1594373391 >஫ < (OIP1) +14:29:53 1594373393 Vacuum C1_CMD_GAS_PRS_CTR_SK --softkey pressure control gas on/off(CMD)࠭ (OIP1) +14:29:54 1594373394 >஫ < (OIP1) +14:47:05 1594374425 >< (OIP1) +14:47:05 1594374425 >嫠 < (OIP1) +14:47:06 1594374426 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +15:01:31 1594375291 >嫠 < (OIP1) +15:01:31 1594375291 >७ ⥪騩< (OIP1) +15:01:31 1594375291 >: 롮 稭< (OIP1) +15:01:31 1594375291 >७ < (OIP1) +15:01:51 1594375311 >७ < (OIP1) +15:01:51 1594375311 >< (OIP1) +15:01:52 1594375312 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +15:01:52 1594375312 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD) ஢ (OIP1) +15:01:56 1594375316 >< (OIP1) +15:01:56 1594375316 >< (OIP1) +15:01:59 1594375319 >< (OIP1) +15:01:59 1594375319 >< (OIP1) +15:02:01 1594375321 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +16:14:08 1594379648 >< (OIP1) +16:14:08 1594379648 >७ ⥪騩< (OIP1) +16:14:09 1594379649 >: 롮 稭< (OIP1) +16:14:09 1594379649 >७ < (OIP1) +16:19:57 1594379997 >७ < (OIP1) +16:19:57 1594379997 >७ ⥪騩< (OIP1) +16:19:57 1594379997 >: 롮 稭< (OIP1) +16:19:57 1594379997 >嫠 < (OIP1) +16:38:30 1594381110 >嫠 < (OIP1) +16:38:30 1594381110 >< (OIP1) +16:38:31 1594381111 Vacuum C1_CMD_VAC_V085 --[V085] vacuum pump (pre)(CMD)࠭ (OIP1) +16:38:34 1594381114 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +16:38:41 1594381121 >< (OIP1) +16:38:41 1594381121 >< (OIP1) +16:42:44 1594381364 >< (OIP1) +16:42:44 1594381364 >< (OIP1) +16:42:46 1594381366 Vacuum C1_CMD_VAC_VNT_SK --softkey vacuum system vent on/off(CMD)࠭ (OIP1) +16:42:47 1594381367 Vacuum C1_CMD_VAC_EVC_SK --softkey vacuum system evacuate on/off(CMD)࠭ (OIP1) +16:46:17 1594381577 >< (OIP1) +16:46:17 1594381577 >嫠 < (OIP1) +16:46:17 1594381577 Cooling C1_CMD_CWT_FNC_SK --softkey furnace cooling water system on/off (CMD)࠭ (OIP1) +16:50:15 1594381815 >嫠 < (OIP1) +16:50:15 1594381815 >< (OIP1) +16:50:16 1594381816 >< (OIP1) +16:50:16 1594381816 > < (OIP1) +16:50:19 1594381819 > < (OIP1) +16:50:19 1594381819 > < (OIP1) +16:50:22 1594381822 > < (OIP1) +16:50:22 1594381822 >Mpar6Interlocks13< (OIP1) +16:50:22 1594381822 Machine C1_CMD_DIAG_INSU_COIL_SK --test insulation crucible coil(CMD)࠭ (OIP1) +16:50:29 1594381829 Machine C1_CMD_DIAG_INSU_COIL_SK --test insulation crucible coil(CMD)࠭ (OIP1) +16:50:35 1594381835 >Mpar6Interlocks13< (OIP1) +16:50:35 1594381835 > < (OIP1) +16:50:36 1594381836 > < (OIP1) +16:50:36 1594381836 >Mpar6Interlocks12< (OIP1) +16:50:37 1594381837 Machine C1_CMD_DIAG_INSU_STING_SK --test insulation stinger(CMD)࠭ (OIP1) +16:50:43 1594381843 Machine C1_CMD_DIAG_INSU_FNCE_SK --test insulation furnace(CMD)࠭ (OIP1) +16:50:45 1594381845 >Mpar6Interlocks12< (OIP1) +16:50:45 1594381845 > < (OIP1) +16:50:46 1594381846 > < (OIP1) +16:50:46 1594381846 >Mpar6Interlocks16< (OIP1) +16:50:46 1594381846 Machine C1_CMD_DIAG_AMC_SK --test AMC(CMD)࠭ (OIP1) +16:50:47 1594381847 >Mpar6Interlocks16< (OIP1) +16:50:47 1594381847 > < (OIP1) +16:50:50 1594381850 > < (OIP1) +16:50:50 1594381850 >Mpar6Interlocks14< (OIP1) +16:50:50 1594381850 Machine C1_CMD_DIAG_MPS_SK --test melt power supply(CMD)࠭ (OIP1) +16:50:50 1594381850 >Mpar6Interlocks14< (OIP1) +16:50:50 1594381850 > < (OIP1) +16:50:52 1594381852 > < (OIP1) +16:50:52 1594381852 >Mpar6Interlocks15< (OIP1) +16:50:53 1594381853 Machine C1_CMD_DIAG_CHD_SK --test charging drive(CMD)࠭ (OIP1) +16:50:57 1594381857 >Mpar6Interlocks15< (OIP1) +16:50:57 1594381857 > < (OIP1) +16:50:59 1594381859 > < (OIP1) +16:50:59 1594381859 >Mpar6Interlocks01< (OIP1) +16:51:00 1594381860 Machine C1_CMD_DIAG_EPD_SK --test electrode processs drive(CMD)࠭ (OIP1) +16:52:38 1594381958 >Mpar6Interlocks01< (OIP1) +16:52:38 1594381958 > < (OIP1) +16:52:41 1594381961 > < (OIP1) +16:52:41 1594381961 >Mpar6Interlocks02< (OIP1) +16:52:42 1594381962 Machine C1_CMD_DIAG_COIL_SK --test crucible coil(CMD)࠭ (OIP1) +16:54:50 1594382090 >Mpar6Interlocks< (OIP1) +16:54:50 1594382090 >< (OIP1) +16:54:52 1594382092 >< (OIP1) +16:54:52 1594382092 > < (OIP1) +16:54:52 1594382092 > < (OIP1) +16:54:52 1594382092 > < (OIP1) +17:06:24 1594382784 > < (OIP1) +17:06:24 1594382784 >७ ⥪騩< (OIP1) +17:06:25 1594382785 >: 롮 稭< (OIP1) +17:06:25 1594382785 >७ < (OIP1) +17:06:37 1594382797 >७ < (OIP1) +17:06:37 1594382797 > < (OIP1) +17:06:38 1594382798 > < (OIP1) +17:06:38 1594382798 > < (OIP1) +17:06:45 1594382805 > < (OIP1) +17:06:45 1594382805 >EdtPar1Start< (OIP1) +17:06:46 1594382806 >EdtPar1Start< (OIP1) +17:06:46 1594382806 >EdtPar1Start_2ndPage< (OIP1) +17:06:46 1594382806 >EdtPar1Start_2ndPage< (OIP1) +17:06:46 1594382806 >EdtPar2Melt< (OIP1) +17:06:46 1594382806 >EdtPar2Melt< (OIP1) +17:06:46 1594382806 >EdtPar2Melt_2ndPage< (OIP1) +17:06:46 1594382806 >EdtPar2Melt_2ndPage< (OIP1) +17:06:46 1594382806 >EdtPar3Hottop< (OIP1) +17:06:46 1594382806 >EdtPar3Hottop< (OIP1) +17:06:46 1594382806 >EdtPar3Hottop_2ndPage< (OIP1) +17:06:46 1594382806 >EdtPar3Hottop_2ndPage< (OIP1) +17:06:46 1594382806 >EdtPar4Ctrl< (OIP1) +17:06:48 1594382808 >EdtPar4Ctrl< (OIP1) +17:06:48 1594382808 >EdtPar5Misc< (OIP1) +17:06:48 1594382808 >EdtPar5Misc< (OIP1) +17:06:48 1594382808 >< (OIP1) +17:06:48 1594382808 >஢< (OIP1) +17:06:49 1594382809 - ஢ (OIP1) +17:06:52 1594382812 >஢< (OIP1) +17:10:12 1594383012 >< (OIP1) +17:10:12 1594383012 >७ ⥪騩< (OIP1) +17:10:12 1594383012 >: 롮 稭< (OIP1) +17:10:12 1594383012 >< (OIP1) +18:20:53 1594387253 >< (OIP1) +18:20:53 1594387253 >७ ⥪騩< (OIP1) +18:20:54 1594387254 >: 롮 稭< (OIP1) +18:20:54 1594387254 >७ < (OIP1) +18:21:01 1594387261 >७ < (OIP1) +18:21:01 1594387261 >嫠 < (OIP1) +18:21:01 1594387261 >嫠 < (OIP1) +18:21:01 1594387261 >< (OIP1) +18:21:02 1594387262 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +18:21:03 1594387263 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +18:25:13 1594387513 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +18:25:56 1594387556 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +18:28:33 1594387713 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +18:32:37 1594387957 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +22:35:22 1594402522 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +22:36:11 1594402571 >< (OIP1) +22:36:11 1594402571 > < (OIP1) +22:36:12 1594402572 > < (OIP1) +22:36:12 1594402572 >< (OIP1) +22:40:13 1594402813 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +22:40:26 1594402826 Vacuum C1_CMD_VAC_LTS_SK --softkey vacuum system leak test(CMD)࠭ (OIP1) +22:45:09 1594403109 >< (OIP1) +22:45:09 1594403109 >嫠 < (OIP1) +22:45:10 1594403110 >嫠 < (OIP1) +22:45:10 1594403110 >७ ⥪騩< (OIP1) +22:45:11 1594403111 >: 롮 稭< (OIP1) +22:45:11 1594403111 >嫠 < (OIP1) +22:45:11 1594403111 >嫠 < (OIP1) +22:45:11 1594403111 >嫠 .< (OIP1) +22:45:14 1594403114 >嫠 .< (OIP1) +22:45:14 1594403114 >嫠 < (OIP1) +22:45:16 1594403116 >嫠 < (OIP1) +22:45:16 1594403116 >< (OIP1) +22:45:26 1594403126 Vacuum C1_CMD_VAC_V003 --[V003] vacuum valve (roots pump 2) (CMD)࠭ (OIP1) +22:45:31 1594403131 >< (OIP1) +22:45:31 1594403131 >< (OIP1) +22:45:45 1594403145 >< (OIP1) +22:45:45 1594403145 > < (OIP1) +22:46:03 1594403163 > < (OIP1) +22:46:03 1594403163 >Mpar6Interlocks09< (OIP1) +22:46:07 1594403167 Machine C1_CMD_DIAG_CWT_TMP_CRU_SK --test cooling water temperature crucible(CMD)࠭ (OIP1) +22:46:19 1594403179 >Mpar6Interlocks09< (OIP1) +22:46:19 1594403179 > < (OIP1) +22:46:19 1594403179 > < (OIP1) +22:46:19 1594403179 >Mpar6Interlocks10< (OIP1) +22:46:20 1594403180 Machine C1_CMD_DIAG_CWT_TMP_FNC_SK --test cooling water temperature furnace(CMD)࠭ (OIP1) +22:46:34 1594403194 >Mpar6Interlocks< (OIP1) +22:46:34 1594403194 > < (OIP1) +22:46:34 1594403194 > < (OIP1) +22:46:34 1594403194 >Mpar6Interlocks11< (OIP1) +22:46:35 1594403195 Machine C1_CMD_DIAG_CWT_TMP_STING_SK --test cooling water temperature stinger(CMD)࠭ (OIP1) +22:46:50 1594403210 >Mpar6Interlocks11< (OIP1) +22:46:50 1594403210 > < (OIP1) +22:46:51 1594403211 > < (OIP1) +22:46:51 1594403211 >Mpar6Interlocks06< (OIP1) +22:46:52 1594403212 Machine C1_CMD_DIAG_CWT_FLW_CRU_SK --test cooling water flow crucible(CMD)࠭ (OIP1) +22:47:55 1594403275 Machine C1_CMD_DIAG_CWT_FLW_CRU_SK --test cooling water flow crucible(CMD)࠭ (OIP1) +22:48:41 1594403321 Machine C1_CMD_DIAG_CWT_FLW_CRU_SK --test cooling water flow crucible(CMD) ஢ (OIP1) +22:49:01 1594403341 Machine C1_CMD_DIAG_CWT_FLW_CRU_SK --test cooling water flow crucible(CMD)࠭ (OIP1) +22:50:04 1594403404 >Mpar6Interlocks06< (OIP1) +22:50:04 1594403404 > < (OIP1) +22:50:05 1594403405 > < (OIP1) +22:50:05 1594403405 >Mpar6Interlocks08< (OIP1) +22:50:05 1594403405 Machine C1_CMD_DIAG_CWT_FLW_STING_SK --test cooling water flow stinger(CMD)࠭ (OIP1) +22:50:25 1594403425 Machine C1_CMD_DIAG_CWT_FLW_STING_SK --test cooling water flow stinger(CMD) ஢ (OIP1) +22:50:25 1594403425 Machine C1_CMD_DIAG_CWT_FLW_STING_SK --test cooling water flow stinger(CMD)࠭ (OIP1) +22:50:46 1594403446 >Mpar6Interlocks08< (OIP1) +22:50:46 1594403446 > < (OIP1) +22:50:47 1594403447 > < (OIP1) +22:50:47 1594403447 >Mpar6Interlocks07< (OIP1) +22:50:48 1594403448 Machine C1_CMD_DIAG_CWT_PRS_CRU_SK --test cooling water pressure crucible(CMD)࠭ (OIP1) +22:51:44 1594403504 >Mpar6Interlocks07< (OIP1) +22:51:44 1594403504 > < (OIP1) +22:51:45 1594403505 > < (OIP1) +22:51:45 1594403505 >Mpar6Interlocks05< (OIP1) +22:51:46 1594403506 Machine C1_CMD_DIAG_VAC_SK --test vaccum interlock(CMD)࠭ (OIP1) +22:52:10 1594403530 >Mpar6Interlocks05< (OIP1) +22:52:10 1594403530 > < (OIP1) +22:52:10 1594403530 > < (OIP1) +22:52:10 1594403530 >Mpar6Interlocks03< (OIP1) +22:52:11 1594403531 Machine C1_CMD_DIAG_ARC_VLT_MAX_SK --test max arc voltage interlock(CMD)࠭ (OIP1) +22:52:32 1594403552 >Mpar6Interlocks03< (OIP1) +22:52:32 1594403552 > < (OIP1) +22:52:33 1594403553 > < (OIP1) +22:52:33 1594403553 >Mpar6Interlocks04< (OIP1) +22:52:34 1594403554 Machine C1_CMD_DIAG_ARC_VLT_MIN_SK --test min arc voltage interlock(CMD)࠭ (OIP1) +22:53:17 1594403597 >Mpar6Interlocks04< (OIP1) +22:53:17 1594403597 >< (OIP1) +22:58:45 1594403925 >롮 ० < (OIP1) +22:58:48 1594403928 Melting C1_CMD_CRU_COIL --crucible coil(CMD)࠭ (OIP1) +22:58:48 1594403928 >롮 ० < (OIP1) +22:59:45 1594403985 >< (OIP1) +22:59:45 1594403985 >< (OIP1) +22:59:54 1594403994 >< (OIP1) +22:59:54 1594403994 >< (OIP1) +23:00:41 1594404041 >< (OIP1) +23:00:41 1594404041 >< (OIP1) +23:00:55 1594404055 >< (OIP1) +23:00:55 1594404055 >< (OIP1) +23:01:22 1594404082 >< (OIP1) +23:01:22 1594404082 >< (OIP1) +23:01:55 1594404115 >< (OIP1) +23:01:55 1594404115 >< (OIP1) +23:02:33 1594404153 >< (OIP1) +23:02:33 1594404153 >< (OIP1) +23:02:35 1594404155 >< (OIP1) +23:02:35 1594404155 >< (OIP1) +23:03:02 1594404182 >< (OIP1) +23:03:02 1594404182 >< (OIP1) +23:03:17 1594404197 >< (OIP1) +23:03:17 1594404197 >< (OIP1) +23:03:45 1594404225 >< (OIP1) +23:03:45 1594404225 >< (OIP1) +23:03:54 1594404234 >< (OIP1) +23:03:54 1594404234 >< (OIP1) +23:03:58 1594404238 >< (OIP1) +23:03:58 1594404238 >< (OIP1) +23:04:19 1594404259 >< (OIP1) +23:04:19 1594404259 >嫠 < (OIP1) +23:04:21 1594404261 >嫠 < (OIP1) +23:04:21 1594404261 >嫠 .< (OIP1) +23:04:25 1594404265 >嫠 .< (OIP1) +23:04:25 1594404265 >嫠 < (OIP1) +23:04:29 1594404269 >嫠 < (OIP1) +23:04:29 1594404269 >< (OIP1) +23:04:34 1594404274 >< (OIP1) +23:04:34 1594404274 >< (OIP1) +23:04:53 1594404293 >< (OIP1) +23:04:53 1594404293 >< (OIP1) +23:10:18 1594404618 >< (OIP1) +23:10:18 1594404618 >< (OIP1) +23:10:37 1594404637 >< (OIP1) +23:10:37 1594404637 >< (OIP1) +23:11:25 1594404685 >< (OIP1) +23:11:25 1594404685 >< (OIP1) +23:11:41 1594404701 >< (OIP1) +23:11:41 1594404701 >< (OIP1) +23:15:11 1594404911 >< (OIP1) +23:15:11 1594404911 >嫠 < (OIP1) +23:15:16 1594404916 >嫠 < (OIP1) +23:15:16 1594404916 >嫠 .< (OIP1) +23:15:32 1594404932 >嫠 .< (OIP1) +23:15:32 1594404932 >< (OIP1) +23:17:56 1594405076 >< (OIP1) +23:17:56 1594405076 >७ ⥪騩< (OIP1) +23:17:57 1594405077 >: 롮 稭< (OIP1) +23:17:57 1594405077 >७ < (OIP1) +23:18:18 1594405098 >७ < (OIP1) +23:18:18 1594405098 >< (OIP1) +23:24:57 1594405497 >< (OIP1) +23:24:57 1594405497 >७ ⥪騩< (OIP1) +23:24:57 1594405497 >: 롮 稭< (OIP1) +23:24:57 1594405497 >७ < (OIP1) +23:25:38 1594405538 >७ < (OIP1) +23:25:38 1594405538 >< (OIP1) +23:25:39 1594405539 >< (OIP1) +23:25:39 1594405539 >< (OIP1) +23:34:53 1594406093 >< (OIP1) +23:34:53 1594406093 >< (OIP1) +23:34:59 1594406099 >< (OIP1) +23:34:59 1594406099 >< (OIP1) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.270 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.270 new file mode 100644 index 0000000..c0f7e1e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.270 @@ -0,0 +1,4 @@ +03:20:52 1594333252 3 14 +06:02:30 1594342950 1 12139 3 25 +14:38:50 1594373930 1 12139 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 3 5 Ti 6 7 870 8 2020 9 4740 10 770 11 12 321801 +15:10:00 1594375800 0 A--32-078-2017 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.271 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.271 new file mode 100644 index 0000000..9e02eec Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.271 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.272 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.272 new file mode 100644 index 0000000..62bf0c0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.272 @@ -0,0 +1,75 @@ +21 03:21:10 03:21:13 +Rsk= 13.6 Rkk= 11.0 + +22 03:59:32 04:09:51 +P1= 18.6 T1=04:04:51 P2= 37.6 T2=04:09:51 Vs= 3.80 + +21 06:01:30 06:01:33 +Rsk= 13.6 Rkk= 11.0 + +22 06:44:50 06:55:09 +P1= 14.4 T1=06:50:09 P2= 28.8 T2=06:55:09 Vs= 2.88 + +21 11:14:19 11:14:22 +Rsk= 12.9 Rkk= 10.3 + +20 11:17:04 11:17:13 +Riz_sol= 5918.3 + +22 11:47:07 12:02:26 +P1= 42.7 T1=11:57:26 P2= 58.0 T2=12:02:26 Vs= 3.05 + +22 12:19:13 12:29:31 +P1= 17.4 T1=12:24:31 P2= 30.9 T2=12:29:31 Vs= 2.70 + +22 13:35:34 13:45:52 +P1= 12.2 T1=13:40:52 P2= 22.8 T2=13:45:52 Vs= 2.11 + +22 14:19:54 14:30:12 +P1= 11.0 T1=14:25:12 P2= 20.5 T2=14:30:12 Vs= 1.89 + +23 14:30:19 14:30:24 + + +24 14:30:30 14:31:06 + + +30 14:31:18 14:31:40 +Vst= 27.9 + +31 14:31:44 14:32:44 +Rom_sol= 13.3 + +41 14:33:02 14:33:07 +Ukz= 0.72 + +32 14:33:12 14:33:37 +Imax= 0.0 Umax= 0.0 T= 0.0 + +32 14:33:47 14:34:23 +Imax=11.3 Umax=50.0 T= 9.0 + +33 14:34:28 14:34:47 +Imin=16.5 Umin=24.9 T= 0.5 + +34 14:34:51 14:35:14 +V=300.2 T= 9.7 + +35 14:35:16 14:36:11 +Q= 54.2 T= 9.7 + +36 14:36:15 14:36:46 +P1=0.28 T= 3.2 + +37 14:36:49 14:37:18 +T= 1.2 + +38 14:37:21 14:37:26 +t= 60.9 T= 0.8 + +39 14:37:30 14:37:45 +tcam= 54.5 Tcam= 0.8 tfl= 60.5 Tfl= 0.8 + +40 14:37:49 14:37:55 +t= 59.5 T= 0.8 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.273 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.273 new file mode 100644 index 0000000..7eb3cfd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.273 @@ -0,0 +1,16 @@ +13 02:06:50 1594328810 +0 02:06:50 1594328810 +14 03:20:22 1594333222 +15 04:12:22 1594336342 +16 04:44:14 1594338254 +1 05:29:11 1594340951 +2 05:59:51 1594342791 +5 07:18:01 1594347481 +6 07:30:27 1594348227 +7 08:12:09 1594350729 +8 11:09:44 1594361384 +25 14:31:15 1594373475 +9 14:38:50 1594373930 +10 15:10:01 1594375801 +11 19:50:44 1594392644 +12 23:21:46 1594405306 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.274 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.274 new file mode 100644 index 0000000..e3d4db8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.274 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.275 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.275 new file mode 100644 index 0000000..f7a0264 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.275 @@ -0,0 +1 @@ +52 14:33:37 1594373617 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.276 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.276 new file mode 100644 index 0000000..92199f4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.276 @@ -0,0 +1,93 @@ +[35] +oper = 13 +begin = 10.07.2020 02:06:50 +norma = 45 +real = 73 + +[36] +oper = 14 +begin = 10.07.2020 03:20:22 +norma = 40 +vac_time = 7 +real = 52 + +[37] +oper = 15 +begin = 10.07.2020 04:12:22 +norma = 30 +real = 31 + +[38] +oper = 16 +begin = 10.07.2020 04:44:14 +norma = 40 +real = 44 + +[39] +oper = 1 +begin = 10.07.2020 05:29:11 +norma = 85 +real = 30 + +[40] +oper = 2 +begin = 10.07.2020 05:59:51 +norma = 110 +vac_time = 7 +real = 78 + +[41] +oper = 5 +begin = 10.07.2020 07:18:01 +norma = 25 +real = 12 + +[42] +oper = 6 +begin = 10.07.2020 07:30:27 +norma = 35 +real = 41 + +[43] +oper = 7 +begin = 10.07.2020 08:12:09 +norma = 30 +real = 177 + +[44] +oper = 8 +begin = 10.07.2020 11:09:44 +norma = 40 +vac_time = 8 +real = 201 + +[45] +oper = 25 +begin = 10.07.2020 14:31:15 +norma = 30 +real = 7 + +[46] +oper = 9 +begin = 10.07.2020 14:38:50 +norma = 0 +real = 31 + +[47] +oper = 10 +begin = 10.07.2020 15:10:01 +norma = 0 +real = 280 + +[48] +oper = 11 +begin = 10.07.2020 19:50:44 +norma = 0 +real = 211 + +[49] +oper = 12 +begin = 10.07.2020 23:21:46 +norma = 105 +real = 123 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.277 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.277 new file mode 100644 index 0000000..6166f77 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.277 @@ -0,0 +1,45 @@ +00:02:11 1594321331 ⪫祭 ० ᪠ (A) +00:27:41 1594322861 : 믮 +04:12:13 1594336333 祭 ० ࠧ +04:12:15 1594336335 祭 ० ' ⮪ 㣨' +04:13:39 1594336419 祭 ॣ '-2'(A) +04:42:25 1594338145 ⪫祭 ० ' ⮪ 㣨' +04:44:18 1594338258 ⪫祭 ॣ '-2'(A) +04:44:19 1594338259 ⪫祭 ० ࠧ +04:44:35 1594338275 祭 ० ᪠ +04:44:35 1594338275 祭 ० ᪠ +04:44:35 1594338275 祭 ० ᪠ +04:44:35 1594338275 祭 ० ᪠ +04:44:36 1594338276 祭 ० ᪠ +04:44:36 1594338276 祭 ० ᪠ +04:47:22 1594338442 ⪫祭 ० ᪠ (A) +06:02:32 1594342952 : 㦥 +07:30:57 1594348257 祭 ० ᪠ +07:30:57 1594348257 祭 ० ᪠ +07:30:57 1594348257 祭 ० ᪠ +07:30:58 1594348258 祭 ० ᪠ +07:30:58 1594348258 祭 ० ᪠ +07:30:58 1594348258 祭 ० ᪠ +07:33:35 1594348415 ⪫祭 ० ᪠ (A) +14:30:31 1594373431 祭 ॣ '-2'(A) +14:31:07 1594373467 ⪫祭 ॣ '-2'(A) +14:31:24 1594373484 祭 +14:31:45 1594373505 祭 +14:32:45 1594373565 ⪫祭 +14:38:04 1594373884 祭 ० ࠧ +14:38:06 1594373886 祭 ० ' ⮪ 㣨' +14:38:51 1594373931 : 믮 +14:55:30 1594374930 祭 ॣ '-2'(A) +15:10:00 1594375800 祭 ॣ . 殮 㣨 +15:10:00 1594375800 ⪫祭 ० ࠧ (A) +19:50:44 1594392644 祭 ० +19:50:45 1594392645 ⪫祭 ॣ '-2'(A) +19:50:46 1594392646 祭 ॣ '-2'(A) +20:46:46 1594396006 ⪫祭 ॣ '-2'(A) +23:21:44 1594405304 ⪫祭 ० (A) +23:21:46 1594405306 ⪫祭 +23:21:46 1594405306 : +23:21:48 1594405308 ⪫祭 ० ' ⮪ 㣨' +23:22:35 1594405355 祭 ० ᪠ +23:24:55 1594405495 ⪫祭 ० ᪠ (A) +23:51:46 1594407106 : 믮 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.279 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.279 new file mode 100644 index 0000000..f3991b4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.279 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.280 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.280 new file mode 100644 index 0000000..bd96d76 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.280 @@ -0,0 +1,2 @@ +02:40:26 1594330826 1 11695 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 5230 9 5238 10 650 11 12 321801 +20:59:11 1594396751 1 11696 4 1 7 615 9 3670 10 495 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.281 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.281 new file mode 100644 index 0000000..bf986d1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.281 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.282 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.282 new file mode 100644 index 0000000..b652440 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.282 @@ -0,0 +1,69 @@ +22 23:58:50 00:14:24 +P1= 41.2 T1=00:09:24 P2= 56.2 T2=00:14:24 Vs= 3.01 + +21 01:37:18 01:37:21 +Rsk= 9.6 Rkk= 6.8 + +20 01:37:40 01:37:48 +Riz_sol= 4788.1 + +22 02:15:13 02:30:47 +P1= 37.8 T1=02:25:47 P2= 48.9 T2=02:30:47 Vs= 2.21 + +23 02:31:00 02:31:06 + + +24 02:31:13 02:31:53 + + +30 02:32:05 02:32:35 +Vst= 29.8 + +31 02:32:43 02:33:16 +Rom_sol= 14.0 + +41 02:33:55 02:34:45 +Ukz= 2.08 + +32 02:34:51 02:35:27 +Imax=11.0 Umax=50.0 T= 9.0 + +33 02:35:30 02:35:49 +Imin=15.9 Umin=24.9 T= 0.5 + +34 02:35:52 02:36:16 +V=300.1 T= 9.4 + +35 02:36:18 02:37:44 +Q= 54.0 T= 9.4 + +36 02:37:47 02:38:22 +P1=0.29 T= 2.9 + +37 02:38:38 02:39:09 +T= 0.9 + +38 02:39:13 02:39:21 +t= 51.5 T= 0.5 + +39 02:39:24 02:39:40 +tcam= 54.0 Tcam= 0.5 tfl= 62.8 Tfl= 0.4 + +40 02:39:42 02:39:51 +t= 54.6 T= 0.4 + +21 20:57:00 20:57:03 +Rsk= 9.7 Rkk= 6.8 + +22 21:30:08 21:45:42 +P1= 75.8 T1=21:40:42 P2=102.8 T2=21:45:42 Vs= 5.41 + +22 22:07:59 22:23:33 +P1= 60.4 T1=22:18:33 P2= 82.5 T2=22:23:33 Vs= 4.43 + +22 23:10:00 23:25:33 +P1= 50.3 T1=23:20:33 P2= 70.4 T2=23:25:33 Vs= 4.03 + +22 23:26:12 23:41:45 +P1= 55.5 T1=23:36:45 P2= 74.8 T2=23:41:45 Vs= 3.87 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.283 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.283 new file mode 100644 index 0000000..c974696 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.283 @@ -0,0 +1,11 @@ +5 00:15:44 1594322144 +6 00:30:09 1594323009 +7 01:07:26 1594325246 +8 01:33:59 1594326839 +25 02:32:02 1594330322 +9 02:40:26 1594330826 +10 03:05:16 1594332316 +12 07:14:11 1594347251 +13 11:47:12 1594363632 +0 11:47:12 1594363632 +2 20:54:42 1594396482 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.284 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.284 new file mode 100644 index 0000000..1433d90 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.284 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.285 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.285 new file mode 100644 index 0000000..e32fc12 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.285 @@ -0,0 +1 @@ +4 01:37:10 1594327030 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.286 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.286 new file mode 100644 index 0000000..a0bc193 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.286 @@ -0,0 +1,62 @@ +[81] +oper = 5 +begin = 10.07.2020 00:15:44 +norma = 25 +real = 14 + +[82] +oper = 6 +begin = 10.07.2020 00:30:09 +norma = 35 +real = 37 + +[83] +oper = 7 +begin = 10.07.2020 01:07:26 +norma = 30 +real = 26 + +[84] +oper = 8 +begin = 10.07.2020 01:33:59 +norma = 40 +vac_time = 8 +real = 58 + +[85] +oper = 25 +begin = 10.07.2020 02:32:02 +norma = 30 +real = 8 + +[86] +oper = 9 +begin = 10.07.2020 02:40:26 +norma = 0 +real = 24 + +[87] +oper = 10 +begin = 10.07.2020 03:05:16 +norma = 0 +real = 248 + +[88] +oper = 12 +begin = 10.07.2020 07:14:11 +norma = 180 +real = 273 + +[89] +oper = 13 +begin = 10.07.2020 11:47:12 +norma = 45 +real = 547 + +[90] +oper = 2 +begin = 10.07.2020 20:54:42 +norma = 110 +vac_time = 8 +real = 208 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.287 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.287 new file mode 100644 index 0000000..efb0c69 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.287 @@ -0,0 +1,17 @@ +00:30:22 1594323022 祭 ० ᪠ +00:30:22 1594323022 祭 ० ᪠ +00:30:22 1594323022 祭 ० ᪠ +00:30:22 1594323022 祭 ० ᪠ +00:32:59 1594323179 ⪫祭 ० ᪠ (A) +02:31:14 1594330274 祭 ॣ '-2'(A) +02:31:54 1594330314 ⪫祭 ॣ '-2'(A) +02:58:46 1594331926 祭 ॣ '-2' +03:05:16 1594332316 祭 ⠭ ॣ +07:14:15 1594347255 ⪫祭 ॣ '-2'(A) +07:14:46 1594347286 祭 ० ᪠ +07:14:46 1594347286 祭 ० ᪠ +07:14:47 1594347287 祭 ० ᪠ +07:14:47 1594347287 祭 ० ᪠ +07:14:47 1594347287 祭 ० ᪠ +07:14:48 1594347288 祭 ० ᪠ +07:17:56 1594347476 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.289 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.289 new file mode 100644 index 0000000..afff765 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.289 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.290 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.290 new file mode 100644 index 0000000..8eac0ef --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.290 @@ -0,0 +1,6 @@ +01:42:25 1594327345 3 14 +02:53:16 1594331596 0 A--32-067-2014 ॢ 0 +04:51:14 1594338674 1 07101 2 p. cao M1,M2,M3,M4 3 25 7 770 8 4415 9 5500 10 650 +07:11:34 1594347094 1 07011 +10:04:29 1594357469 1 07011 2 p. cao M1,M2,M3,M4 3 25 4 1 5 Ti 6 7 770 8 4415 9 5500 10 650 11 12 321847 +20:32:19 1594395139 1 07012 9 5060 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.291 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.291 new file mode 100644 index 0000000..7f9da2e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.291 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.292 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.292 new file mode 100644 index 0000000..818c9af --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.292 @@ -0,0 +1,90 @@ +21 01:05:27 01:05:30 +Rsk= 27.4 Rkk= 23.4 + +21 01:42:41 01:42:44 +Rsk= 27.0 Rkk= 23.0 + +21 01:55:41 01:55:44 +Rsk= 26.9 Rkk= 22.9 + +21 02:02:06 02:02:09 +Rsk= 26.8 Rkk= 22.8 + +22 02:03:12 02:13:17 +P1= 30.4 T1=02:08:17 P2= 40.8 T2=02:13:17 Vs= 2.10 + +21 04:49:28 04:49:31 +Rsk= 6.9 Rkk= 3.1 + +21 04:49:40 04:49:44 +Rsk= 8.0 Rkk= 4.2 + +21 04:51:24 04:51:27 +Rsk= 20.1 Rkk= 16.4 + +22 06:01:23 06:16:27 +P1= 88.8 T1=06:11:27 P2=114.8 T2=06:16:27 Vs= 5.20 + +22 06:55:01 07:10:06 +P1= 52.1 T1=07:05:06 P2= 67.3 T2=07:10:06 Vs= 3.03 + +21 08:52:48 08:52:51 +Rsk= 26.3 Rkk= 22.3 + +20 08:55:37 08:55:46 +Riz_sol= 8.8 + +22 09:39:39 09:54:44 +P1= 51.1 T1=09:49:44 P2= 64.9 T2=09:54:44 Vs= 2.76 + +23 09:56:14 09:56:19 + + +24 09:56:33 09:57:11 + + +30 09:57:20 09:57:48 +Vst= 29.4 + +31 09:57:51 09:58:25 +Rom_sol= 14.9 + +32 09:59:06 09:59:43 +Imax=10.9 Umax=58.3 T= 9.0 + +33 09:59:45 10:00:16 +Imin=15.9 Umin=24.9 T= 0.5 + +34 10:00:19 10:00:48 +V=300.1 T= 9.4 + +35 10:00:50 10:01:53 +Q= 53.5 T= 9.4 + +36 10:01:55 10:02:32 +P1=0.29 T= 2.9 + +37 10:02:35 10:03:13 +T= 0.9 + +38 10:03:16 10:03:24 +t= 53.4 T= 0.5 + +39 10:03:27 10:03:42 +tcam= 51.5 Tcam= 0.5 tfl= 52.8 Tfl= 0.5 + +40 10:03:46 10:03:53 +t= 53.1 T= 0.5 + +21 20:31:55 20:31:58 +Rsk= 24.8 Rkk= 20.9 + +22 21:26:09 21:41:14 +P1= 97.5 T1=21:36:14 P2=125.5 T2=21:41:14 Vs= 5.59 + +21 22:58:05 22:58:08 +Rsk= 26.4 Rkk= 22.4 + +22 23:30:05 23:45:09 +P1= 65.6 T1=23:40:09 P2= 81.6 T2=23:45:09 Vs= 3.20 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.293 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.293 new file mode 100644 index 0000000..f8d12ba --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.293 @@ -0,0 +1,20 @@ +13 00:11:08 1594321868 +0 00:11:08 1594321868 +14 01:01:47 1594324907 +15 02:15:45 1594329345 +16 02:55:29 1594331729 +1 03:37:27 1594334247 +2 04:46:43 1594338403 +5 07:12:50 1594347170 +6 07:24:31 1594347871 +7 08:08:47 1594350527 +8 08:17:56 1594351076 +25 09:57:18 1594357038 +9 10:04:29 1594357469 +10 10:27:37 1594358857 +12 15:06:38 1594375598 +13 19:20:04 1594390804 +0 19:20:04 1594390804 +2 20:29:11 1594394951 +7 22:39:23 1594402763 +2 22:57:56 1594403876 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.294 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.294 new file mode 100644 index 0000000..a4cfd4a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.294 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.296 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.296 new file mode 100644 index 0000000..a58dfc6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.296 @@ -0,0 +1,113 @@ +[63] +oper = 13 +begin = 10.07.2020 00:11:08 +norma = 45 +real = 50 + +[64] +oper = 14 +begin = 10.07.2020 01:01:47 +norma = 40 +vac_time = 6 +real = 73 + +[65] +oper = 15 +begin = 10.07.2020 02:15:45 +norma = 30 +real = 39 + +[66] +oper = 16 +begin = 10.07.2020 02:55:29 +norma = 40 +real = 41 + +[67] +oper = 1 +begin = 10.07.2020 03:37:27 +norma = 85 +real = 69 + +[68] +oper = 2 +begin = 10.07.2020 04:46:43 +norma = 110 +vac_time = 7 +real = 146 + +[69] +oper = 5 +begin = 10.07.2020 07:12:50 +norma = 25 +real = 11 + +[70] +oper = 6 +begin = 10.07.2020 07:24:31 +norma = 35 +real = 44 + +[71] +oper = 7 +begin = 10.07.2020 08:08:47 +norma = 30 +real = 9 + +[72] +oper = 8 +begin = 10.07.2020 08:17:56 +norma = 40 +vac_time = 38 +real = 99 + +[73] +oper = 25 +begin = 10.07.2020 09:57:18 +norma = 30 +real = 7 + +[74] +oper = 9 +begin = 10.07.2020 10:04:29 +norma = 0 +real = 23 + +[75] +oper = 10 +begin = 10.07.2020 10:27:37 +norma = 0 +real = 279 + +[76] +oper = 12 +begin = 10.07.2020 15:06:38 +norma = 180 +real = 253 + +[77] +oper = 13 +begin = 10.07.2020 19:20:04 +norma = 45 +real = 69 + +[78] +oper = 2 +begin = 10.07.2020 20:29:11 +norma = 110 +vac_time = 6 +real = 130 + +[79] +oper = 7 +begin = 10.07.2020 22:39:23 +norma = 30 +real = 18 + +[80] +oper = 2 +begin = 10.07.2020 22:57:56 +norma = 110 +vac_time = 7 +real = 79 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.297 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.297 new file mode 100644 index 0000000..b253280 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.297 @@ -0,0 +1,29 @@ +01:54:58 1594328098 祭 ॣ '-2'(A) +01:55:00 1594328100 ⪫祭 ॣ '-2'(A) +02:01:29 1594328489 祭 ॣ '-2'(A) +02:01:31 1594328491 ⪫祭 ॣ '-2'(A) +02:15:14 1594329314 祭 ० ࠧ +02:15:16 1594329316 祭 ० ' ⮪ 㣨' +02:16:32 1594329392 祭 ॣ '-2'(A) +02:53:16 1594331596 ⪫祭 ० ࠧ (A) +02:54:41 1594331681 ⪫祭 ० ' ⮪ 㣨' +02:55:32 1594331732 ⪫祭 ॣ '-2'(A) +02:57:05 1594331825 祭 ० ᪠ +02:59:57 1594331997 ⪫祭 ० ᪠ (A) +07:25:15 1594347915 祭 ० ᪠ +07:28:04 1594348084 ⪫祭 ० ᪠ (A) +09:56:34 1594356994 祭 ॣ '-2'(A) +09:57:11 1594357031 ⪫祭 ॣ '-2'(A) +10:20:29 1594358429 祭 ॣ '-2' +10:27:37 1594358857 祭 ⠭ ॣ +15:06:42 1594375602 ⪫祭 ॣ '-2'(A) +15:07:01 1594375621 祭 ० ᪠ +15:07:02 1594375622 祭 ० ᪠ +15:07:45 1594375665 ⪫祭 ० ᪠ +15:07:50 1594375670 祭 ० ᪠ +15:07:50 1594375670 祭 ० ᪠ +15:09:55 1594375795 ⪫祭 ० ᪠ (A) +21:25:47 1594398347 祭 ॣ '-2'(A) +21:25:49 1594398349 ⪫祭 ॣ '-2'(A) +22:22:17 1594401737 祭 ॣ '-2'(A) +22:22:20 1594401740 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.299 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.299 new file mode 100644 index 0000000..d5fdd30 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.299 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.310 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.310 new file mode 100644 index 0000000..76ca41b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.310 @@ -0,0 +1,5 @@ +05:05:07 1594339507 1 07438 9 3250 10 670 +09:01:01 1594353661 11 +11:42:42 1594363362 1 07438 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 4980 9 3250 10 670 11 12 320469 +12:11:19 1594365079 0 A--32-068-2019 ॢ 2 +22:01:26 1594400486 1 07439 9 3780 12 321689 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.311 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.311 new file mode 100644 index 0000000..2818176 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.311 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.312 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.312 new file mode 100644 index 0000000..51095d3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.312 @@ -0,0 +1,75 @@ +21 05:05:27 05:05:30 +Rsk= 21.0 Rkk= 18.2 + +22 05:50:47 06:06:23 +P1= 38.0 T1=06:01:23 P2= 49.7 T2=06:06:23 Vs= 2.33 + +21 09:01:10 09:01:14 +Rsk= 173.5 Rkk= 18.1 + +20 09:02:01 09:02:10 +Riz_sol= 1310.8 + +22 10:22:34 10:33:10 +P1= 15.6 T1=10:28:09 P2= 27.7 T2=10:33:10 Vs= 2.42 + +22 11:21:08 11:31:44 +P1= 12.9 T1=11:26:43 P2= 22.6 T2=11:31:44 Vs= 1.93 + +23 11:32:05 11:32:10 + + +24 11:32:17 11:32:50 + + +24 11:32:55 11:33:31 + + +30 11:33:48 11:33:55 +Vst= 0.0 + +30 11:33:59 11:34:33 +Vst= 29.9 + +31 11:34:38 11:35:39 +Rom_sol= 9.4 + +41 11:36:17 11:36:22 +Ukz= 1.34 + +32 11:36:27 11:37:09 +Imax=11.0 Umax=50.0 T= 9.0 + +33 11:37:12 11:37:43 +Imin=16.0 Umin=25.0 T= 0.5 + +34 11:37:47 11:38:11 +V=300.1 T= 9.5 + +35 11:38:15 11:39:15 +Q= 3.6 T= 9.6 + +36 11:39:19 11:40:08 +P1=0.29 T= 3.1 + +37 11:40:11 11:40:53 +T= 1.1 + +38 11:40:56 11:41:05 +t= 52.1 T= 0.7 + +39 11:41:09 11:41:18 +t= 52.2 T= 0.7 + +40 11:41:21 11:41:29 +t= 51.4 T= 0.7 + +21 22:00:00 22:00:03 +Rsk=1266.7 Rkk= 17.7 + +21 22:00:12 22:00:15 +Rsk= 20.5 Rkk= 17.7 + +22 22:31:59 22:47:35 +P1= 45.6 T1=22:42:35 P2= 59.2 T2=22:47:35 Vs= 2.72 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.313 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.313 new file mode 100644 index 0000000..4b8f35a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.313 @@ -0,0 +1,16 @@ +2 05:01:23 1594339283 +5 06:07:40 1594343260 +6 06:19:14 1594343954 +7 07:04:29 1594346669 +8 08:58:05 1594353485 +25 11:33:40 1594362820 +9 11:42:42 1594363362 +10 12:11:19 1594365079 +11 14:59:12 1594375152 +12 17:42:57 1594384977 +13 19:30:42 1594391442 +0 19:30:42 1594391442 +2 21:55:27 1594400127 +5 22:50:36 1594403436 +6 23:02:11 1594404131 +7 23:44:07 1594406647 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.314 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.314 new file mode 100644 index 0000000..d05061f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.314 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.315 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.315 new file mode 100644 index 0000000..8d62bd1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.315 @@ -0,0 +1 @@ +29 11:32:50 1594362770 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.316 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.316 new file mode 100644 index 0000000..c1db695 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.316 @@ -0,0 +1,94 @@ +[35] +oper = 2 +begin = 10.07.2020 05:01:23 +norma = 110 +vac_time = 8 +vac_avg10 = 31.9 +real = 66 + +[36] +oper = 5 +begin = 10.07.2020 06:07:40 +norma = 25 +real = 11 + +[37] +oper = 6 +begin = 10.07.2020 06:19:14 +norma = 35 +real = 45 + +[38] +oper = 7 +begin = 10.07.2020 07:04:29 +norma = 30 +real = 113 + +[39] +oper = 8 +begin = 10.07.2020 08:58:05 +norma = 40 +vac_time = 8 +real = 155 + +[40] +oper = 25 +begin = 10.07.2020 11:33:40 +norma = 30 +real = 9 + +[41] +oper = 9 +begin = 10.07.2020 11:42:42 +norma = 0 +real = 28 + +[42] +oper = 10 +begin = 10.07.2020 12:11:19 +norma = 0 +real = 167 + +[43] +oper = 11 +begin = 10.07.2020 14:59:12 +norma = 0 +real = 163 + +[44] +oper = 12 +begin = 10.07.2020 17:42:57 +norma = 105 +real = 107 + +[45] +oper = 13 +begin = 10.07.2020 19:30:42 +norma = 45 +real = 144 + +[46] +oper = 2 +begin = 10.07.2020 21:55:27 +norma = 110 +vac_time = 7 +real = 55 + +[47] +oper = 5 +begin = 10.07.2020 22:50:36 +norma = 25 +real = 11 + +[48] +oper = 6 +begin = 10.07.2020 23:02:11 +norma = 35 +real = 41 + +[49] +oper = 7 +begin = 10.07.2020 23:44:07 +norma = 30 +real = 73 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.317 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.317 new file mode 100644 index 0000000..0618aa7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.317 @@ -0,0 +1,34 @@ +06:19:23 1594343963 祭 ० ᪠ +06:19:24 1594343964 祭 ० ᪠ +06:19:24 1594343964 祭 ० ᪠ +06:22:28 1594344148 ⪫祭 ० ᪠ (A) +09:01:03 1594353663 : 㦥 +11:32:18 1594362738 祭 ॣ '-2'(A) +11:32:52 1594362772 ⪫祭 ॣ '-2'(A) +11:32:56 1594362776 祭 ॣ '-2'(A) +11:33:31 1594362811 ⪫祭 ॣ '-2'(A) +11:33:44 1594362824 祭 +11:34:40 1594362880 祭 +11:35:39 1594362939 ⪫祭 +11:41:58 1594363318 祭 ० ࠧ +11:42:03 1594363323 祭 ० ' ⮪ 㣨' +11:42:43 1594363363 : 믮 +11:59:19 1594364359 祭 ॣ '-2'(A) +12:11:19 1594365079 ⪫祭 ० ࠧ (A) +12:11:19 1594365079 祭 ॣ . 殮 㣨 +14:59:12 1594375152 祭 ० +14:59:12 1594375152 ⪫祭 ॣ '-2'(A) +14:59:14 1594375154 祭 ॣ '-2'(A) +15:49:13 1594378153 ⪫祭 ॣ '-2'(A) +17:42:54 1594384974 ⪫祭 ० (A) +17:42:56 1594384976 ⪫祭 +17:42:56 1594384976 : +17:42:58 1594384978 ⪫祭 ० ' ⮪ 㣨' +17:44:52 1594385092 祭 ० ᪠ +17:44:52 1594385092 祭 ० ᪠ +17:44:52 1594385092 祭 ० ᪠ +17:47:20 1594385240 ⪫祭 ० ᪠ (A) +18:12:55 1594386775 : 믮 +23:02:20 1594404140 祭 ० ᪠ +23:02:20 1594404140 祭 ० ᪠ +23:05:26 1594404326 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.319 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.319 new file mode 100644 index 0000000..8f1f595 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.319 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.320 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.320 new file mode 100644 index 0000000..fc038b7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.320 @@ -0,0 +1,8 @@ +06:33:59 1594344839 3 14 +06:34:34 1594344874 6 +07:47:28 1594349248 0 A--32-067-2014 ॢ 0 +10:22:16 1594358536 1 05166 3 32 +14:45:26 1594374326 9 4110 +17:31:57 1594384317 6 12 321689 +17:32:33 1594384353 1 05166 2 OT-4 3 32 4 2 5 Ti 6 7 770 8 4450 9 4110 10 670 11 12 321689 +18:01:52 1594386112 0 A--32-050-2012 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.321 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.321 new file mode 100644 index 0000000..e971f6f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.321 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.322 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.322 new file mode 100644 index 0000000..3b368f4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.322 @@ -0,0 +1,75 @@ +21 06:35:43 06:35:46 +Rsk= 17.1 Rkk= 11.7 + +22 06:58:49 07:08:54 +P1= 26.1 T1=07:03:54 P2= 47.5 T2=07:08:54 Vs= 4.28 + +21 10:21:46 10:21:49 +Rsk=1606.2 Rkk= 11.8 + +21 10:22:00 10:22:03 +Rsk= 17.3 Rkk= 11.8 + +22 10:53:17 11:08:22 +P1= 33.0 T1=11:03:22 P2= 45.9 T2=11:08:22 Vs= 2.57 + +20 14:43:59 14:44:08 +Riz_sol= 4806.4 + +21 14:44:51 14:44:54 +Rsk=2865.0 Rkk= 11.7 + +21 14:45:01 14:45:04 +Rsk= 65.6 Rkk= 11.8 + +22 15:32:50 15:47:55 +P1= 42.5 T1=15:42:55 P2= 60.2 T2=15:47:55 Vs= 3.54 + +22 16:12:56 16:28:01 +P1= 31.9 T1=16:23:01 P2= 45.6 T2=16:28:01 Vs= 2.74 + +22 17:05:08 17:20:13 +P1= 29.3 T1=17:15:13 P2= 40.8 T2=17:20:13 Vs= 2.29 + +23 17:21:33 17:21:38 + + +24 17:21:48 17:22:26 + + +30 17:22:44 17:23:10 +Vst= 29.7 + +31 17:23:17 17:23:51 +Rom_sol= 7.9 + +41 17:25:48 17:25:54 +Ukz= 1.04 + +32 17:25:56 17:26:32 +Imax=27.2 Umax=55.0 T= 9.0 + +33 17:26:35 17:27:06 +Imin=16.2 Umin=24.9 T= 0.5 + +34 17:27:09 17:27:32 +V=300.4 T= 9.4 + +35 17:27:36 17:29:12 +Q= 53.8 T= 9.4 + +36 17:29:16 17:30:05 +P1=0.29 T= 2.9 + +37 17:30:14 17:30:45 +T= 0.9 + +38 17:30:50 17:31:00 +t= 53.4 T= 0.5 + +39 17:31:08 17:31:26 +tcam= 53.5 Tcam= 0.5 tfl= 52.1 Tfl= 0.5 + +40 17:31:29 17:31:37 +t= 53.2 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.323 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.323 new file mode 100644 index 0000000..c74a8e0 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.323 @@ -0,0 +1,18 @@ +11 02:04:07 1594328647 +12 04:04:10 1594335850 +13 05:57:32 1594342652 +0 05:57:33 1594342653 +14 06:35:03 1594344903 +15 07:18:31 1594347511 +16 07:56:18 1594349778 +1 09:17:33 1594354653 +2 10:13:13 1594357993 +5 11:10:12 1594361412 +6 11:22:52 1594362172 +7 12:07:18 1594364838 +8 14:42:45 1594374165 +25 17:22:38 1594383758 +9 17:32:33 1594384353 +10 18:01:52 1594386112 +11 20:21:35 1594394495 +12 22:23:00 1594401780 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.324 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.324 new file mode 100644 index 0000000..6ff604e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.324 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.326 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.326 new file mode 100644 index 0000000..3715444 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.326 @@ -0,0 +1,105 @@ +[83] +oper = 11 +begin = 10.07.2020 02:04:07 +norma = 115 +real = 120 + +[84] +oper = 12 +begin = 10.07.2020 04:04:10 +norma = 105 +real = 113 + +[85] +oper = 13 +begin = 10.07.2020 05:57:32 +norma = 45 +real = 37 + +[86] +oper = 14 +begin = 10.07.2020 06:35:03 +norma = 40 +vac_time = 7 +real = 43 + +[87] +oper = 15 +begin = 10.07.2020 07:18:31 +norma = 30 +real = 37 + +[88] +oper = 16 +begin = 10.07.2020 07:56:18 +norma = 40 +real = 81 + +[89] +oper = 1 +begin = 10.07.2020 09:17:33 +norma = 85 +real = 55 + +[90] +oper = 2 +begin = 10.07.2020 10:13:13 +norma = 110 +vac_time = 9 +real = 56 + +[91] +oper = 5 +begin = 10.07.2020 11:10:12 +norma = 25 +real = 12 + +[92] +oper = 6 +begin = 10.07.2020 11:22:52 +norma = 35 +real = 44 + +[93] +oper = 7 +begin = 10.07.2020 12:07:18 +norma = 30 +real = 155 + +[94] +oper = 8 +begin = 10.07.2020 14:42:45 +norma = 40 +vac_time = 8 +real = 159 + +[95] +oper = 25 +begin = 10.07.2020 17:22:38 +norma = 30 +real = 9 + +[96] +oper = 9 +begin = 10.07.2020 17:32:33 +norma = 0 +real = 29 + +[97] +oper = 10 +begin = 10.07.2020 18:01:52 +norma = 0 +real = 139 + +[98] +oper = 11 +begin = 10.07.2020 20:21:35 +norma = 115 +real = 121 + +[99] +oper = 12 +begin = 10.07.2020 22:23:00 +norma = 105 +real = 106 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.327 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.327 new file mode 100644 index 0000000..578247d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.327 @@ -0,0 +1,48 @@ +02:04:07 1594328647 祭 ० +02:04:07 1594328647 ⪫祭 ॣ '-2'(A) +02:04:08 1594328648 祭 ॣ '-2'(A) +02:43:33 1594331013 祭 ० +02:43:35 1594331015 ⪫祭 ॣ '-2'(A) +04:04:07 1594335847 ⪫祭 ० (A) +04:04:09 1594335849 ⪫祭 ० ' ⮪ 㣨' +04:05:02 1594335902 祭 ० ᪠ +04:07:18 1594336038 ⪫祭 ० ᪠ (A) +07:17:37 1594347457 祭 ० ࠧ +07:17:39 1594347459 祭 ० ' ⮪ 㣨' +07:19:19 1594347559 祭 ॣ '-2'(A) +07:47:28 1594349248 ⪫祭 ० ࠧ (A) +07:56:19 1594349779 ⪫祭 ० ' ⮪ 㣨' +07:56:22 1594349782 ⪫祭 ॣ '-2'(A) +07:57:37 1594349857 祭 ० ᪠ +07:59:42 1594349982 ⪫祭 ० ᪠ (A) +11:23:02 1594362182 祭 ० ᪠ +11:25:12 1594362312 ⪫祭 ० ᪠ (A) +17:04:45 1594382685 祭 ॣ '-2'(A) +17:04:46 1594382686 ⪫祭 ॣ '-2'(A) +17:21:50 1594383710 祭 ॣ '-2'(A) +17:22:27 1594383747 ⪫祭 ॣ '-2'(A) +17:32:06 1594384326 祭 ० ࠧ +17:32:08 1594384328 祭 ० ' ⮪ 㣨' +17:58:52 1594385932 祭 ॣ '-2'(A) +17:59:06 1594385946 ⪫祭 ० ᪠ (A) +18:01:52 1594386112 ⪫祭 ० ࠧ (A) +18:01:52 1594386112 祭 ⠭ ॣ +20:21:34 1594394494 祭 ० +20:21:35 1594394495 ⪫祭 ॣ '-2'(A) +20:21:36 1594394496 祭 ॣ '-2'(A) +20:24:50 1594394690 祭 ० ᪠ +20:24:50 1594394690 祭 ० ᪠ +20:24:51 1594394691 . ⪫祭 ० ᪠ (A) +20:24:53 1594394693 祭 ० ᪠ +20:24:53 1594394693 祭 ० ᪠ +20:24:54 1594394694 祭 ० ᪠ +20:24:55 1594394695 祭 ० ᪠ +20:31:43 1594395103 ⪫祭 ० ᪠ +20:31:43 1594395103 ⪫祭 ० ᪠ +20:31:44 1594395104 ⪫祭 ० ᪠ +20:55:43 1594396543 祭 ० +20:55:45 1594396545 ⪫祭 ॣ '-2'(A) +22:21:34 1594401694 ⪫祭 ० (A) +22:21:36 1594401696 ⪫祭 ० ' ⮪ 㣨' +22:27:09 1594402029 祭 ० ᪠ +22:29:21 1594402161 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.329 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.329 new file mode 100644 index 0000000..9a58eda Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.329 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.330 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.330 new file mode 100644 index 0000000..04de7bf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.330 @@ -0,0 +1,9 @@ +01:34:49 1594326889 12 321544 +02:44:43 1594331083 1 11198 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 870 8 4910 9 5110 10 770 11 12 321544 +03:15:37 1594332937 0 A--32-078-2017 ॢ 1 +14:47:03 1594374423 3 14 +15:59:09 1594378749 0 A--32-120-2016 ॢ 0 +17:50:57 1594385457 1 11199 3 25 8 4310 +17:51:21 1594385481 7 770 10 705 +21:48:58 1594399738 1 11199 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 770 8 4310 9 5110 10 705 11 12 321544 +22:19:03 1594401543 0 A--32-076-2015 ॢ 0 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.331 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.331 new file mode 100644 index 0000000..639a2c6 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.331 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.332 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.332 new file mode 100644 index 0000000..eecd36e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.332 @@ -0,0 +1,120 @@ +20 01:35:16 01:35:25 +Riz_sol= 3004.2 + +21 01:35:34 01:35:41 +Rsk= 17.2 Rkk= 12.1 + +22 01:59:31 02:15:02 +P1= 38.8 T1=02:10:02 P2= 54.3 T2=02:15:02 Vs= 3.11 + +22 02:24:32 02:35:03 +P1= 9.8 T1=02:30:03 P2= 22.1 T2=02:35:03 Vs= 2.46 + +23 02:35:21 02:35:27 + + +24 02:35:34 02:36:11 + + +30 02:36:30 02:37:10 +Vst= 28.5 + +31 02:37:17 02:38:18 +Rom_sol= 16.5 + +41 02:38:49 02:38:54 +Ukz= 0.76 + +32 02:38:59 02:40:09 +Imax=11.0 Umax=50.0 T= 9.4 + +33 02:40:13 02:40:43 +Imin=16.2 Umin=25.1 T= 0.8 + +34 02:40:47 02:41:15 +V=301.8 T= 9.6 + +35 02:41:19 02:42:12 +Q= 54.8 T= 9.1 + +36 02:42:18 02:42:51 +P1=0.27 T= 3.1 + +37 02:42:54 02:43:32 +T= 0.7 + +38 02:43:36 02:43:42 +t= 52.1 T= 0.7 + +39 02:43:47 02:43:53 +t= 52.4 T= 0.5 + +40 02:43:57 02:44:03 +t= 52.0 T= 0.7 + +21 14:46:44 14:46:51 +Rsk= 11.7 Rkk= 11.7 + +22 15:08:57 15:24:28 +P1= 40.9 T1=15:19:28 P2= 55.4 T2=15:24:28 Vs= 2.91 + +21 17:45:05 17:45:13 +Rsk= 17.0 Rkk= 11.9 + +22 18:09:26 18:24:57 +P1= 31.8 T1=18:19:57 P2= 45.3 T2=18:24:57 Vs= 2.70 + +20 19:58:22 19:58:32 +Riz_sol= 3282.0 + +21 19:58:39 19:58:47 +Rsk= 16.8 Rkk= 11.6 + +22 20:31:13 20:41:44 +P1= 7.4 T1=20:36:44 P2= 19.4 T2=20:41:44 Vs= 2.41 + +22 21:09:40 21:20:10 +P1= 5.0 T1=21:15:10 P2= 10.4 T2=21:20:10 Vs= 1.08 + +23 21:40:09 21:40:16 + + +24 21:40:22 21:40:56 + + +30 21:41:06 21:41:44 +Vst= 28.4 + +31 21:41:51 21:42:52 +Rom_sol= 15.5 + +41 21:43:14 21:43:19 +Ukz= 1.19 + +32 05:00:00 21:44:29 +Imax=11.0 Umax=50.0 T= 9.2 + +33 21:44:32 21:44:59 +Imin=16.2 Umin=25.1 T= 1.0 + +34 21:45:02 21:45:30 +V=301.7 T= 9.5 + +35 21:45:34 21:47:00 +Q= 55.0 T= 9.3 + +36 21:47:03 21:47:35 +P1=0.30 T= 3.0 + +38 21:47:38 21:47:44 +t= 52.1 T= 0.7 + +37 21:47:47 21:48:24 +T= 0.6 + +39 21:48:27 21:48:32 +t= 52.4 T= 0.8 + +40 21:48:35 21:48:40 +t= 52.0 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.333 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.333 new file mode 100644 index 0000000..6028a16 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.333 @@ -0,0 +1,22 @@ +7 00:34:09 1594323249 +8 01:31:08 1594326668 +25 02:36:24 1594330584 +9 02:44:43 1594331083 +10 03:15:37 1594332937 +11 07:51:26 1594349486 +12 11:22:31 1594362151 +13 13:27:38 1594369658 +0 13:27:38 1594369658 +14 14:44:52 1594374292 +15 15:25:32 1594376732 +16 15:59:09 1594378749 +16 16:02:02 1594378922 +1 16:43:08 1594381388 +2 17:41:38 1594384898 +5 18:26:09 1594387569 +6 18:37:15 1594388235 +7 19:17:33 1594390653 +8 19:53:23 1594392803 +25 21:41:03 1594399263 +9 21:48:58 1594399738 +10 22:19:04 1594401544 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.334 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.334 new file mode 100644 index 0000000..a806db5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.334 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.336 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.336 new file mode 100644 index 0000000..01263e3 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.336 @@ -0,0 +1,130 @@ +[12] +oper = 7 +begin = 10.07.2020 00:34:09 +norma = 30 +real = 56 + +[13] +oper = 8 +begin = 10.07.2020 01:31:08 +norma = 40 +vac_time = 10 +real = 65 + +[14] +oper = 25 +begin = 10.07.2020 02:36:24 +norma = 30 +real = 8 + +[15] +oper = 9 +begin = 10.07.2020 02:44:43 +norma = 0 +real = 30 + +[16] +oper = 10 +begin = 10.07.2020 03:15:37 +norma = 0 +real = 275 + +[17] +oper = 11 +begin = 10.07.2020 07:51:26 +norma = 0 +real = 211 + +[18] +oper = 12 +begin = 10.07.2020 11:22:31 +norma = 105 +real = 125 + +[19] +oper = 13 +begin = 10.07.2020 13:27:38 +norma = 45 +real = 77 + +[20] +oper = 14 +begin = 10.07.2020 14:44:52 +norma = 40 +vac_time = 8 +real = 40 + +[21] +oper = 15 +begin = 10.07.2020 15:25:32 +norma = 30 +real = 33 + +[22] +oper = 16 +begin = 10.07.2020 15:59:09 +norma = 40 +real = 2 + +[23] +oper = 16 +begin = 10.07.2020 16:02:02 +norma = 40 +real = 41 + +[24] +oper = 1 +begin = 10.07.2020 16:43:08 +norma = 85 +real = 58 + +[25] +oper = 2 +begin = 10.07.2020 17:41:38 +norma = 110 +vac_time = 9 +real = 44 + +[26] +oper = 5 +begin = 10.07.2020 18:26:09 +norma = 25 +real = 11 + +[27] +oper = 6 +begin = 10.07.2020 18:37:15 +norma = 35 +real = 40 + +[28] +oper = 7 +begin = 10.07.2020 19:17:33 +norma = 30 +real = 35 + +[29] +oper = 8 +begin = 10.07.2020 19:53:23 +norma = 40 +vac_time = 10 +real = 107 + +[30] +oper = 25 +begin = 10.07.2020 21:41:03 +norma = 30 +real = 7 + +[31] +oper = 9 +begin = 10.07.2020 21:48:58 +norma = 0 +real = 30 + +[32] +oper = 10 +begin = 10.07.2020 22:19:04 +norma = 0 +real = 250 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.337 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.337 new file mode 100644 index 0000000..64456d8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.337 @@ -0,0 +1,277 @@ +02:35:36 1594330536 祭 ॣ '-2'(A) +02:35:39 1594330539 祭 +02:36:12 1594330572 ⪫祭 ॣ '-2'(A) +02:37:18 1594330638 祭 +02:38:17 1594330697 ⪫祭 +02:44:15 1594331055 祭 ० ࠧ +02:44:18 1594331058 祭 ० ' ⮪ 㣨' +02:44:44 1594331084 : 믮 +03:01:08 1594332068 祭 ॣ '-2'(A) +03:15:37 1594332937 ⪫祭 ० ࠧ (A) +03:15:38 1594332938 祭 ॣ . 殮 㣨 +07:51:25 1594349485 祭 ० +07:51:26 1594349486 ⪫祭 ॣ '-2'(A) +07:51:27 1594349487 祭 ॣ '-2'(A) +08:47:28 1594352848 ⪫祭 ॣ '-2'(A) +11:22:26 1594362146 ⪫祭 ० (A) +11:22:28 1594362148 ⪫祭 +11:22:28 1594362148 : +11:22:33 1594362153 ⪫祭 ० ' ⮪ 㣨' +11:23:54 1594362234 祭 ० ᪠ +11:23:54 1594362234 祭 ० ᪠ +11:23:54 1594362234 祭 ० ᪠ +11:23:54 1594362234 祭 ० ᪠ +11:23:55 1594362235 祭 ० ᪠ +11:23:55 1594362235 . ⪫祭 ० ᪠ (A) +11:23:55 1594362235 祭 ० ᪠ +11:23:55 1594362235 . ⪫祭 ० ᪠ (A) +11:24:03 1594362243 祭 ० ᪠ +11:24:03 1594362243 . ⪫祭 ० ᪠ (A) +11:24:03 1594362243 祭 ० ᪠ +11:24:03 1594362243 . ⪫祭 ० ᪠ (A) +11:24:04 1594362244 祭 ० ᪠ +11:24:04 1594362244 . ⪫祭 ० ᪠ (A) +11:24:04 1594362244 祭 ० ᪠ +11:24:04 1594362244 . ⪫祭 ० ᪠ (A) +11:24:05 1594362245 祭 ० ᪠ +11:24:05 1594362245 . ⪫祭 ० ᪠ (A) +11:24:06 1594362246 祭 ० ᪠ +11:24:06 1594362246 . ⪫祭 ० ᪠ (A) +11:24:08 1594362248 祭 ० ᪠ +11:24:08 1594362248 . ⪫祭 ० ᪠ (A) +11:24:08 1594362248 祭 ० ᪠ +11:24:08 1594362248 . ⪫祭 ० ᪠ (A) +11:24:08 1594362248 祭 ० ᪠ +11:24:08 1594362248 . ⪫祭 ० ᪠ (A) +11:24:08 1594362248 祭 ० ᪠ +11:24:08 1594362248 . ⪫祭 ० ᪠ (A) +11:24:09 1594362249 祭 ० ᪠ +11:24:09 1594362249 . ⪫祭 ० ᪠ (A) +11:24:09 1594362249 祭 ० ᪠ +11:24:09 1594362249 . ⪫祭 ० ᪠ (A) +11:24:10 1594362250 祭 ० ᪠ +11:24:10 1594362250 . ⪫祭 ० ᪠ (A) +11:24:10 1594362250 祭 ० ᪠ +11:24:10 1594362250 . ⪫祭 ० ᪠ (A) +11:24:23 1594362263 祭 ० ᪠ +11:24:23 1594362263 . ⪫祭 ० ᪠ (A) +11:24:24 1594362264 祭 ० ᪠ +11:24:24 1594362264 . ⪫祭 ० ᪠ (A) +11:24:24 1594362264 祭 ० ᪠ +11:24:24 1594362264 . ⪫祭 ० ᪠ (A) +11:24:24 1594362264 祭 ० ᪠ +11:24:24 1594362264 . ⪫祭 ० ᪠ (A) +11:24:27 1594362267 祭 ० ᪠ +11:24:27 1594362267 . ⪫祭 ० ᪠ (A) +11:24:28 1594362268 祭 ० ᪠ +11:24:28 1594362268 . ⪫祭 ० ᪠ (A) +11:24:28 1594362268 祭 ० ᪠ +11:24:28 1594362268 . ⪫祭 ० ᪠ (A) +11:24:29 1594362269 祭 ० ᪠ +11:24:29 1594362269 . ⪫祭 ० ᪠ (A) +11:24:29 1594362269 祭 ० ᪠ +11:24:29 1594362269 . ⪫祭 ० ᪠ (A) +11:24:31 1594362271 祭 ० ᪠ +11:24:31 1594362271 . ⪫祭 ० ᪠ (A) +11:24:35 1594362275 祭 ० ᪠ +11:24:35 1594362275 . ⪫祭 ० ᪠ (A) +11:24:35 1594362275 祭 ० ᪠ +11:24:35 1594362275 . ⪫祭 ० ᪠ (A) +11:24:35 1594362275 祭 ० ᪠ +11:24:35 1594362275 . ⪫祭 ० ᪠ (A) +11:24:35 1594362275 祭 ० ᪠ +11:24:35 1594362275 . ⪫祭 ० ᪠ (A) +11:24:46 1594362286 祭 ० ᪠ +11:24:46 1594362286 . ⪫祭 ० ᪠ (A) +11:24:46 1594362286 祭 ० ᪠ +11:24:46 1594362286 . ⪫祭 ० ᪠ (A) +11:24:47 1594362287 祭 ० ᪠ +11:24:47 1594362287 . ⪫祭 ० ᪠ (A) +11:24:47 1594362287 祭 ० ᪠ +11:24:47 1594362287 . ⪫祭 ० ᪠ (A) +11:24:47 1594362287 祭 ० ᪠ +11:24:47 1594362287 . ⪫祭 ० ᪠ (A) +11:24:47 1594362287 祭 ० ᪠ +11:24:47 1594362287 . ⪫祭 ० ᪠ (A) +11:24:48 1594362288 祭 ० ᪠ +11:24:48 1594362288 . ⪫祭 ० ᪠ (A) +11:24:50 1594362290 祭 ० ᪠ +11:24:50 1594362290 . ⪫祭 ० ᪠ (A) +11:24:50 1594362290 祭 ० ᪠ +11:24:50 1594362290 . ⪫祭 ० ᪠ (A) +11:24:50 1594362290 祭 ० ᪠ +11:24:50 1594362290 . ⪫祭 ० ᪠ (A) +11:24:54 1594362294 祭 ० ᪠ +11:24:54 1594362294 . ⪫祭 ० ᪠ (A) +11:24:54 1594362294 祭 ० ᪠ +11:24:54 1594362294 . ⪫祭 ० ᪠ (A) +11:24:55 1594362295 祭 ० ᪠ +11:24:55 1594362295 . ⪫祭 ० ᪠ (A) +11:24:55 1594362295 祭 ० ᪠ +11:24:55 1594362295 . ⪫祭 ० ᪠ (A) +11:24:55 1594362295 祭 ० ᪠ +11:24:55 1594362295 . ⪫祭 ० ᪠ (A) +11:24:55 1594362295 祭 ० ᪠ +11:24:55 1594362295 . ⪫祭 ० ᪠ (A) +11:24:56 1594362296 祭 ० ᪠ +11:24:56 1594362296 . ⪫祭 ० ᪠ (A) +11:24:58 1594362298 祭 ० ᪠ +11:24:58 1594362298 . ⪫祭 ० ᪠ (A) +11:24:58 1594362298 祭 ० ᪠ +11:24:58 1594362298 . ⪫祭 ० ᪠ (A) +11:25:06 1594362306 祭 ० ᪠ +11:25:06 1594362306 . ⪫祭 ० ᪠ (A) +11:25:10 1594362310 祭 ० ᪠ +11:25:10 1594362310 . ⪫祭 ० ᪠ (A) +11:25:11 1594362311 祭 ० ᪠ +11:25:11 1594362311 . ⪫祭 ० ᪠ (A) +11:25:11 1594362311 祭 ० ᪠ +11:25:11 1594362311 . ⪫祭 ० ᪠ (A) +11:25:21 1594362321 祭 ० ᪠ +11:25:21 1594362321 . ⪫祭 ० ᪠ (A) +11:25:21 1594362321 祭 ० ᪠ +11:25:21 1594362321 . ⪫祭 ० ᪠ (A) +11:25:21 1594362321 祭 ० ᪠ +11:25:21 1594362321 . ⪫祭 ० ᪠ (A) +11:25:24 1594362324 祭 ० ᪠ +11:25:24 1594362324 . ⪫祭 ० ᪠ (A) +11:25:25 1594362325 祭 ० ᪠ +11:25:25 1594362325 . ⪫祭 ० ᪠ (A) +11:25:31 1594362331 祭 ० ᪠ +11:25:31 1594362331 . ⪫祭 ० ᪠ (A) +11:25:31 1594362331 祭 ० ᪠ +11:25:31 1594362331 . ⪫祭 ० ᪠ (A) +11:25:31 1594362331 祭 ० ᪠ +11:25:31 1594362331 . ⪫祭 ० ᪠ (A) +11:25:32 1594362332 祭 ० ᪠ +11:25:32 1594362332 . ⪫祭 ० ᪠ (A) +11:25:32 1594362332 祭 ० ᪠ +11:25:32 1594362332 . ⪫祭 ० ᪠ (A) +11:25:32 1594362332 祭 ० ᪠ +11:25:32 1594362332 . ⪫祭 ० ᪠ (A) +11:25:32 1594362332 祭 ० ᪠ +11:25:32 1594362332 . ⪫祭 ० ᪠ (A) +11:25:32 1594362332 祭 ० ᪠ +11:25:32 1594362332 . ⪫祭 ० ᪠ (A) +11:25:32 1594362332 祭 ० ᪠ +11:25:32 1594362332 . ⪫祭 ० ᪠ (A) +11:25:33 1594362333 祭 ० ᪠ +11:25:33 1594362333 . ⪫祭 ० ᪠ (A) +11:25:46 1594362346 祭 ० ᪠ +11:25:46 1594362346 . ⪫祭 ० ᪠ (A) +11:25:46 1594362346 祭 ० ᪠ +11:25:46 1594362346 . ⪫祭 ० ᪠ (A) +11:25:47 1594362347 祭 ० ᪠ +11:25:47 1594362347 . ⪫祭 ० ᪠ (A) +11:25:47 1594362347 祭 ० ᪠ +11:25:47 1594362347 . ⪫祭 ० ᪠ (A) +11:25:47 1594362347 祭 ० ᪠ +11:25:47 1594362347 . ⪫祭 ० ᪠ (A) +11:25:47 1594362347 祭 ० ᪠ +11:25:47 1594362347 . ⪫祭 ० ᪠ (A) +11:25:48 1594362348 祭 ० ᪠ +11:25:48 1594362348 . ⪫祭 ० ᪠ (A) +11:25:48 1594362348 祭 ० ᪠ +11:25:48 1594362348 . ⪫祭 ० ᪠ (A) +11:25:48 1594362348 祭 ० ᪠ +11:25:48 1594362348 . ⪫祭 ० ᪠ (A) +11:25:48 1594362348 祭 ० ᪠ +11:25:48 1594362348 . ⪫祭 ० ᪠ (A) +11:25:49 1594362349 祭 ० ᪠ +11:25:49 1594362349 . ⪫祭 ० ᪠ (A) +11:25:49 1594362349 祭 ० ᪠ +11:25:49 1594362349 . ⪫祭 ० ᪠ (A) +11:25:51 1594362351 祭 ० ᪠ +11:25:51 1594362351 . ⪫祭 ० ᪠ (A) +11:25:52 1594362352 祭 ० ᪠ +11:25:52 1594362352 . ⪫祭 ० ᪠ (A) +11:25:58 1594362358 祭 ० ᪠ +11:25:58 1594362358 . ⪫祭 ० ᪠ (A) +11:25:58 1594362358 祭 ० ᪠ +11:25:58 1594362358 . ⪫祭 ० ᪠ (A) +11:25:58 1594362358 祭 ० ᪠ +11:25:58 1594362358 . ⪫祭 ० ᪠ (A) +11:25:59 1594362359 祭 ० ᪠ +11:25:59 1594362359 . ⪫祭 ० ᪠ (A) +11:25:59 1594362359 祭 ० ᪠ +11:25:59 1594362359 . ⪫祭 ० ᪠ (A) +11:25:59 1594362359 祭 ० ᪠ +11:25:59 1594362359 . ⪫祭 ० ᪠ (A) +11:26:00 1594362360 祭 ० ᪠ +11:26:00 1594362360 . ⪫祭 ० ᪠ (A) +11:26:00 1594362360 祭 ० ᪠ +11:26:00 1594362360 . ⪫祭 ० ᪠ (A) +11:26:00 1594362360 祭 ० ᪠ +11:26:00 1594362360 . ⪫祭 ० ᪠ (A) +11:26:01 1594362361 祭 ० ᪠ +11:26:01 1594362361 . ⪫祭 ० ᪠ (A) +11:26:01 1594362361 祭 ० ᪠ +11:26:01 1594362361 . ⪫祭 ० ᪠ (A) +11:26:02 1594362362 祭 ० ᪠ +11:26:02 1594362362 . ⪫祭 ० ᪠ (A) +11:26:06 1594362366 祭 ० ᪠ +11:26:06 1594362366 . ⪫祭 ० ᪠ (A) +11:26:07 1594362367 祭 ० ᪠ +11:26:07 1594362367 . ⪫祭 ० ᪠ (A) +11:26:07 1594362367 祭 ० ᪠ +11:26:07 1594362367 . ⪫祭 ० ᪠ (A) +11:26:07 1594362367 祭 ० ᪠ +11:26:07 1594362367 . ⪫祭 ० ᪠ (A) +11:26:08 1594362368 祭 ० ᪠ +11:26:08 1594362368 . ⪫祭 ० ᪠ (A) +11:26:08 1594362368 祭 ० ᪠ +11:26:08 1594362368 . ⪫祭 ० ᪠ (A) +11:26:08 1594362368 祭 ० ᪠ +11:26:08 1594362368 . ⪫祭 ० ᪠ (A) +11:26:08 1594362368 祭 ० ᪠ +11:26:08 1594362368 . ⪫祭 ० ᪠ (A) +11:26:20 1594362380 祭 ० ᪠ +11:26:20 1594362380 . ⪫祭 ० ᪠ (A) +11:26:20 1594362380 祭 ० ᪠ +11:26:20 1594362380 . ⪫祭 ० ᪠ (A) +11:26:21 1594362381 祭 ० ᪠ +11:26:21 1594362381 . ⪫祭 ० ᪠ (A) +11:26:21 1594362381 祭 ० ᪠ +11:26:21 1594362381 . ⪫祭 ० ᪠ (A) +11:26:21 1594362381 祭 ० ᪠ +11:26:21 1594362381 . ⪫祭 ० ᪠ (A) +11:26:22 1594362382 祭 ० ᪠ +11:26:22 1594362382 . ⪫祭 ० ᪠ (A) +11:26:22 1594362382 祭 ० ᪠ +11:26:22 1594362382 . ⪫祭 ० ᪠ (A) +11:26:22 1594362382 祭 ० ᪠ +11:26:22 1594362382 . ⪫祭 ० ᪠ (A) +11:26:22 1594362382 祭 ० ᪠ +11:26:22 1594362382 . ⪫祭 ० ᪠ (A) +11:26:22 1594362382 祭 ० ᪠ +11:26:22 1594362382 . ⪫祭 ० ᪠ (A) +11:26:23 1594362383 祭 ० ᪠ +11:26:24 1594362384 祭 ० ᪠ +11:26:24 1594362384 祭 ० ᪠ +11:28:47 1594362527 ⪫祭 ० ᪠ (A) +11:52:27 1594363947 : 믮 +15:25:23 1594376723 祭 ० ࠧ +15:25:24 1594376724 祭 ० ' ⮪ 㣨' +15:25:52 1594376752 祭 ॣ '-2'(A) +15:59:09 1594378749 ⪫祭 ० ࠧ (A) +16:02:04 1594378924 ⪫祭 ० ' ⮪ 㣨' +16:02:07 1594378927 ⪫祭 ॣ '-2'(A) +16:03:42 1594379022 祭 ० ᪠ +16:03:42 1594379022 祭 ० ᪠ +16:03:42 1594379022 祭 ० ᪠ +16:06:42 1594379202 ⪫祭 ० ᪠ (A) +17:50:59 1594385459 : 㦥 +18:37:22 1594388242 祭 ० ᪠ +18:40:35 1594388435 ⪫祭 ० ᪠ (A) +21:40:24 1594399224 祭 ॣ '-2'(A) +21:40:56 1594399256 ⪫祭 ॣ '-2'(A) +21:41:49 1594399309 ' ' +21:41:49 1594399309 祭 +21:41:51 1594399311 祭 +21:42:51 1594399371 ⪫祭 +21:49:04 1594399744 祭 ० ࠧ +21:49:05 1594399745 祭 ० ' ⮪ 㣨' +21:49:06 1594399746 : 믮 +22:10:03 1594401003 祭 ॣ '-2'(A) +22:19:03 1594401543 祭 ⠭ ॣ +22:19:03 1594401543 ⪫祭 ० ࠧ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.339 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.339 new file mode 100644 index 0000000..b108266 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.339 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.340 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.340 new file mode 100644 index 0000000..28b6141 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.340 @@ -0,0 +1,2 @@ +16:16:58 1594379818 1 09635 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 4650 9 4410 10 560 11 12 321672 +16:46:37 1594381597 0 A--32-106-2018 ॢ 2 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.341 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.341 new file mode 100644 index 0000000..0f25e33 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.341 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.342 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.342 new file mode 100644 index 0000000..2f62beb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.342 @@ -0,0 +1,54 @@ +20 12:13:19 12:13:28 +Riz_sol= 11.1 + +21 12:13:34 12:13:37 +Rsk= 14.3 Rkk= 13.7 + +22 13:05:21 13:20:48 +P1= 40.9 T1=13:15:48 P2= 53.7 T2=13:20:48 Vs= 2.56 + +22 15:39:47 15:50:14 +P1= 24.9 T1=15:45:14 P2= 34.7 T2=15:50:14 Vs= 1.96 + +23 15:52:12 15:52:17 + + +24 15:53:01 05:00:00 + + +30 15:55:16 15:55:46 +Vst= 31.0 + +31 15:56:03 15:56:37 +Rom_sol= 15.6 + +41 15:57:12 15:57:17 +Ukz= 1.68 + +32 15:57:23 15:58:04 +Imax=11.0 Umax=50.0 T= 9.0 + +33 15:58:07 15:58:31 +Imin=16.0 Umin=25.0 T= 0.5 + +34 15:58:35 15:58:58 +V=300.2 T= 9.5 + +35 15:59:02 15:59:58 +Q= 53.0 T= 9.5 + +36 16:00:03 16:00:38 +P1=0.30 T= 3.0 + +37 16:00:55 16:01:20 +T= 1.0 + +38 16:01:26 16:01:33 +t= 52.0 T= 0.6 + +39 16:01:41 16:01:48 +t= 51.7 T= 0.5 + +40 16:01:54 16:02:01 +t= 51.8 T= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.343 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.343 new file mode 100644 index 0000000..67239ad --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.343 @@ -0,0 +1,8 @@ +7 00:11:48 1594321908 +8 12:11:08 1594365068 +25 15:54:14 1594378454 +9 16:16:58 1594379818 +10 16:46:37 1594381597 +12 20:32:21 1594395141 +13 23:40:55 1594406455 +0 23:40:55 1594406455 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.344 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.344 new file mode 100644 index 0000000..2e6f075 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.344 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.346 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.346 new file mode 100644 index 0000000..04b8356 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.346 @@ -0,0 +1,44 @@ +[30] +oper = 7 +begin = 10.07.2020 00:11:48 +norma = 30 +real = 719 + +[31] +oper = 8 +begin = 10.07.2020 12:11:08 +norma = 40 +vac_time = 8 +vac_avg10 = 7.9 +real = 223 + +[32] +oper = 25 +begin = 10.07.2020 15:54:14 +norma = 30 +real = 22 + +[33] +oper = 9 +begin = 10.07.2020 16:16:58 +norma = 0 +real = 29 + +[34] +oper = 10 +begin = 10.07.2020 16:46:37 +norma = 0 +real = 225 + +[35] +oper = 12 +begin = 10.07.2020 20:32:21 +norma = 105 +real = 188 + +[36] +oper = 13 +begin = 10.07.2020 23:40:55 +norma = 45 +real = 351 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.347 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.347 new file mode 100644 index 0000000..9bff73d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.347 @@ -0,0 +1,16 @@ +15:53:03 1594378383 祭 ॣ '-2'(A) +15:53:43 1594378423 ⪫祭 ॣ '-2'(A) +16:16:22 1594379782 祭 ० ࠧ +16:16:24 1594379784 祭 ० ' ⮪ 㣨' +16:18:37 1594379917 祭 ॣ '-2'(A) +16:46:37 1594381597 ⪫祭 ० ࠧ (A) +16:46:37 1594381597 祭 ⠭ ॣ +20:19:48 1594394388 祭 ० +20:19:49 1594394389 ⪫祭 ॣ '-2'(A) +20:19:50 1594394390 祭 ॣ '-2'(A) +20:27:56 1594394876 ⪫祭 ० ' ⮪ 㣨' +20:32:25 1594395145 ⪫祭 ॣ '-2'(A) +20:33:11 1594395191 祭 ० ᪠ +20:33:11 1594395191 祭 ० ᪠ +20:35:45 1594395345 ⪫祭 ० ᪠ (A) +21:29:47 1594398587 ⪫祭 ० (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.349 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.349 new file mode 100644 index 0000000..f6a3476 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.349 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.350 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.350 new file mode 100644 index 0000000..2177c25 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.350 @@ -0,0 +1,2 @@ +07:32:50 1594348370 1 09571 2 p. cao M1,M2,M3,M4 3 17 4 1 5 Ti 6 7 670 8 4640 9 2900 10 560 11 12 321692 +23:49:36 1594406976 1 09572 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 7 615 9 3850 10 495 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.351 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.351 new file mode 100644 index 0000000..9955277 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.351 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.352 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.352 new file mode 100644 index 0000000..1e7a38b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.352 @@ -0,0 +1,84 @@ +20 06:20:52 06:21:01 +Riz_sol= 1677.1 + +21 06:21:26 06:21:29 +Rsk= 14.1 Rkk= 11.3 + +22 07:02:39 07:18:10 +P1= 53.7 T1=07:13:10 P2= 68.3 T2=07:18:10 Vs= 2.93 + +23 07:18:45 07:18:50 + + +24 07:19:07 07:19:45 + + +30 07:20:09 07:21:17 +Vst= 27.9 + +31 07:21:30 07:22:13 +Rom_sol= 9.2 + +32 07:27:33 07:28:09 +Imax=11.3 Umax=50.0 T= 9.0 + +33 07:28:15 07:28:34 +Imin=16.2 Umin=25.0 T= 0.5 + +34 07:28:41 07:29:04 +V=300.3 T= 9.5 + +35 07:29:10 07:30:10 +Q= 54.0 T= 9.5 + +36 07:30:15 07:30:52 +P1=0.30 T= 3.0 + +37 07:30:58 07:31:22 +T= 1.0 + +38 07:31:28 07:31:35 +t= 52.6 T= 0.8 + +39 07:31:40 07:31:55 +tcam= 54.5 Tcam= 0.7 tfl= 53.2 Tfl= 0.8 + +40 07:32:01 07:32:07 +t= 55.4 T= 0.8 + +21 22:13:33 22:13:36 +Rsk= 1.2 Rkk= 3.1 + +21 22:13:41 22:13:44 +Rsk= 1.3 Rkk= 3.1 + +21 22:13:58 22:14:01 +Rsk= 1.2 Rkk= 3.1 + +21 22:14:10 22:14:13 +Rsk= 1.3 Rkk= 3.1 + +21 22:14:27 22:14:30 +Rsk= 1.4 Rkk= 3.3 + +21 22:14:34 22:14:37 +Rsk= 1.5 Rkk= 3.3 + +21 22:14:48 22:14:51 +Rsk= 1.5 Rkk= 3.3 + +21 22:15:10 22:15:13 +Rsk= 3.4 Rkk= 3.6 + +21 22:15:16 22:15:19 +Rsk= 3.5 Rkk= 3.7 + +21 22:15:22 22:15:25 +Rsk= 3.5 Rkk= 3.7 + +21 22:15:40 22:15:43 +Rsk= 5.1 Rkk= 5.3 + +22 23:26:10 23:41:40 +P1= 65.8 T1=23:36:40 P2= 86.0 T2=23:41:40 Vs= 4.04 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.353 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.353 new file mode 100644 index 0000000..6707763 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.353 @@ -0,0 +1,11 @@ +12 01:24:40 1594326280 +13 04:31:35 1594337495 +0 04:31:35 1594337495 +8 06:14:58 1594343698 +25 07:20:01 1594347601 +9 07:32:50 1594348370 +10 08:50:17 1594353017 +12 10:07:13 1594357633 +13 13:23:15 1594369395 +0 13:23:15 1594369395 +2 22:07:05 1594400825 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.354 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.354 new file mode 100644 index 0000000..184a46d Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.354 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.356 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.356 new file mode 100644 index 0000000..87f8870 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.356 @@ -0,0 +1,56 @@ +[94] +oper = 12 +begin = 10.07.2020 01:24:40 +norma = 180 +real = 186 + +[95] +oper = 13 +begin = 10.07.2020 04:31:35 +norma = 45 +real = 103 + +[96] +oper = 8 +begin = 10.07.2020 06:14:58 +norma = 40 +vac_time = 7 +real = 65 + +[97] +oper = 25 +begin = 10.07.2020 07:20:01 +norma = 30 +real = 12 + +[98] +oper = 9 +begin = 10.07.2020 07:32:50 +norma = 0 +real = 77 + +[99] +oper = 10 +begin = 10.07.2020 08:50:17 +norma = 0 +real = 76 + +[00] +oper = 12 +begin = 10.07.2020 10:07:13 +norma = 180 +real = 196 + +[01] +oper = 13 +begin = 10.07.2020 13:23:15 +norma = 45 +real = 523 + +[02] +oper = 2 +begin = 10.07.2020 22:07:05 +norma = 110 +vac_time = 8 +real = 135 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.357 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.357 new file mode 100644 index 0000000..0e88fa9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.357 @@ -0,0 +1,24 @@ +00:38:30 1594323510 ⪫祭 ॣ '-2'(A) +00:41:32 1594323692 祭 ॣ '-2' +01:17:26 1594325846 ⪫祭 ॣ '-2'(A) +01:25:05 1594326305 祭 ० ᪠ +01:25:05 1594326305 祭 ० ᪠ +01:25:06 1594326306 祭 ० ᪠ +01:25:06 1594326306 祭 ० ᪠ +01:25:06 1594326306 祭 ० ᪠ +01:25:07 1594326307 祭 ० ᪠ +01:25:07 1594326307 祭 ० ᪠ +01:25:07 1594326307 祭 ० ᪠ +01:28:37 1594326517 ⪫祭 ० ᪠ (A) +07:19:10 1594347550 祭 ॣ '-2'(A) +07:19:46 1594347586 ⪫祭 ॣ '-2'(A) +07:37:32 1594348652 祭 ॣ '-2' +08:50:16 1594353016 祭 ⠭ ॣ +09:18:22 1594354702 ⪫祭 ॣ '-2'(A) +09:25:10 1594355110 祭 ॣ '-2' +10:00:16 1594357216 ⪫祭 ॣ '-2' +10:08:59 1594357739 祭 ० ᪠ +10:09:00 1594357740 祭 ० ᪠ +10:11:23 1594357883 ⪫祭 ० ᪠ (A) +23:50:43 1594407043 祭 ० ᪠ +23:51:31 1594407091 ⪫祭 ० ᪠ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.359 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.359 new file mode 100644 index 0000000..23cf3c1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.359 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.360 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.360 new file mode 100644 index 0000000..2e13857 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.360 @@ -0,0 +1,4 @@ +03:29:14 1594333754 1 10791 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 670 8 4460 9 4170 10 560 11 12 320801 +03:58:33 1594335513 0 A--32-106-2018 ॢ 2 +11:35:08 1594362908 1 10792 3 35 4 2 7 705 9 3900 10 615 +17:30:20 1594384220 1 10792 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 35 4 2 5 Ti 6 7 705 8 4460 9 3900 10 615 11 12 320801 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.361 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.361 new file mode 100644 index 0000000..f7b7391 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.361 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.362 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.362 new file mode 100644 index 0000000..e5ed74b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.362 @@ -0,0 +1,120 @@ +20 01:54:54 01:55:02 +Riz_sol= 4847.6 + +21 01:55:14 01:55:17 +Rsk= 13.1 Rkk= 9.5 + +22 02:29:49 02:45:23 +P1= 66.1 T1=02:40:23 P2= 83.5 T2=02:45:23 Vs= 3.48 + +22 03:04:38 03:20:11 +P1= 50.8 T1=03:15:11 P2= 63.5 T2=03:20:11 Vs= 2.54 + +23 03:20:38 03:20:43 + + +24 03:20:53 03:21:30 + + +30 03:22:00 03:22:27 +Vst= 28.6 + +31 03:22:37 03:23:12 +Rom_sol= 9.3 + +41 03:23:38 03:23:43 +Ukz= 1.45 + +32 03:23:51 03:24:25 +Imax=11.0 Umax=50.0 T= 9.0 + +33 03:24:34 03:24:53 +Imin=16.1 Umin=24.9 T= 0.5 + +34 03:24:59 03:25:22 +V=300.1 T= 9.5 + +35 03:25:26 03:26:23 +Q= 54.0 T= 9.5 + +36 03:26:28 03:27:00 +P1=0.30 T= 3.0 + +37 03:27:08 03:27:27 +T= 1.0 + +38 03:27:32 03:27:40 +t= 53.5 T= 0.6 + +39 03:27:44 03:27:52 +t= 52.3 T= 0.6 + +39 03:28:04 03:28:13 +t= 53.4 T= 0.6 + +40 03:28:21 03:28:30 +t= 52.3 T= 0.6 + +21 11:35:21 11:35:24 +Rsk= 12.6 Rkk= 9.1 + +22 12:20:04 12:35:37 +P1= 74.4 T1=12:30:36 P2= 94.3 T2=12:35:37 Vs= 3.98 + +22 12:55:08 13:10:41 +P1= 58.9 T1=13:05:41 P2= 74.8 T2=13:10:41 Vs= 3.18 + +22 13:30:17 13:45:50 +P1= 51.6 T1=13:40:50 P2= 65.1 T2=13:45:50 Vs= 2.69 + +20 15:22:17 15:22:25 +Riz_sol= 4848.3 + +21 15:22:31 15:22:34 +Rsk= 13.0 Rkk= 9.5 + +22 16:29:29 16:45:02 +P1= 55.7 T1=16:40:02 P2= 70.6 T2=16:45:02 Vs= 2.98 + +22 17:04:29 17:20:02 +P1= 46.5 T1=17:15:02 P2= 58.0 T2=17:20:02 Vs= 2.29 + +23 17:21:01 17:21:06 + + +24 17:21:16 17:21:53 + + +30 17:22:07 17:22:32 +Vst= 28.7 + +31 17:22:45 17:23:19 +Rom_sol= 11.6 + +32 17:23:56 17:24:32 +Imax=27.1 Umax=55.1 T= 9.0 + +33 17:24:36 17:24:56 +Imin=16.1 Umin=25.0 T= 0.5 + +34 17:25:00 17:25:23 +V=300.1 T= 9.5 + +35 17:25:30 17:26:27 +Q= 54.3 T= 9.5 + +36 17:26:57 17:27:30 +P1=0.30 T= 3.0 + +37 17:27:36 17:27:58 +T= 1.0 + +38 17:28:08 17:28:16 +t= 52.3 T= 0.6 + +39 17:28:21 17:28:30 +t= 53.5 T= 0.6 + +40 17:28:38 17:28:46 +t= 52.3 T= 0.6 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.363 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.363 new file mode 100644 index 0000000..8795f45 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.363 @@ -0,0 +1,18 @@ +7 00:30:48 1594323048 +8 01:50:14 1594327814 +25 03:21:56 1594333316 +9 03:29:14 1594333754 +10 03:58:34 1594335514 +12 07:28:15 1594348095 +13 10:29:25 1594358965 +0 10:29:25 1594358965 +2 11:33:09 1594362789 +5 13:46:48 1594370808 +6 13:59:09 1594371549 +7 14:27:59 1594373279 +8 15:21:18 1594376478 +25 17:22:03 1594383723 +9 17:30:20 1594384220 +10 18:10:06 1594386606 +11 20:21:00 1594394460 +12 20:21:51 1594394511 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.364 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.364 new file mode 100644 index 0000000..fd81885 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.364 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.365 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.365 new file mode 100644 index 0000000..b36ba17 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.365 @@ -0,0 +1 @@ +47 03:27:52 1594333672 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.366 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.366 new file mode 100644 index 0000000..870d3de --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.366 @@ -0,0 +1,105 @@ +[98] +oper = 7 +begin = 10.07.2020 00:30:48 +norma = 30 +real = 79 + +[99] +oper = 8 +begin = 10.07.2020 01:50:14 +norma = 40 +vac_time = 7 +real = 91 + +[00] +oper = 25 +begin = 10.07.2020 03:21:56 +norma = 30 +real = 7 + +[01] +oper = 9 +begin = 10.07.2020 03:29:14 +norma = 0 +real = 29 + +[02] +oper = 10 +begin = 10.07.2020 03:58:34 +norma = 0 +real = 209 + +[03] +oper = 12 +begin = 10.07.2020 07:28:15 +norma = 105 +real = 181 + +[04] +oper = 13 +begin = 10.07.2020 10:29:25 +norma = 45 +real = 63 + +[05] +oper = 2 +begin = 10.07.2020 11:33:09 +norma = 110 +vac_time = 7 +real = 133 + +[06] +oper = 5 +begin = 10.07.2020 13:46:48 +norma = 25 +real = 12 + +[07] +oper = 6 +begin = 10.07.2020 13:59:09 +norma = 35 +real = 28 + +[08] +oper = 7 +begin = 10.07.2020 14:27:59 +norma = 30 +real = 53 + +[09] +oper = 8 +begin = 10.07.2020 15:21:18 +norma = 40 +vac_time = 6 +real = 120 + +[10] +oper = 25 +begin = 10.07.2020 17:22:03 +norma = 30 +real = 8 + +[11] +oper = 9 +begin = 10.07.2020 17:30:20 +norma = 0 +real = 39 + +[12] +oper = 10 +begin = 10.07.2020 18:10:06 +norma = 0 +real = 130 + +[13] +oper = 11 +begin = 10.07.2020 20:21:00 +norma = 0 +real = 0 + +[14] +oper = 12 +begin = 10.07.2020 20:21:51 +norma = 105 +real = 229 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.367 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.367 new file mode 100644 index 0000000..767683e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.367 @@ -0,0 +1,48 @@ +03:20:56 1594333256 祭 ॣ '-2'(A) +03:21:31 1594333291 ⪫祭 ॣ '-2'(A) +03:28:45 1594333725 祭 ० ࠧ +03:28:47 1594333727 祭 ० ' ⮪ 㣨' +03:30:33 1594333833 祭 ॣ '-2'(A) +03:58:33 1594335513 祭 ⠭ ॣ +03:58:33 1594335513 ⪫祭 ० ࠧ (A) +07:19:56 1594347596 祭 ० +07:19:57 1594347597 ⪫祭 ॣ '-2'(A) +07:19:59 1594347599 祭 ॣ '-2'(A) +07:22:01 1594347721 ⪫祭 ० ' ⮪ 㣨' +07:28:19 1594348099 ⪫祭 ॣ '-2'(A) +07:30:42 1594348242 祭 ० ᪠ +07:30:42 1594348242 祭 ० ᪠ +07:30:42 1594348242 祭 ० ᪠ +07:30:43 1594348243 祭 ० ᪠ +07:30:43 1594348243 祭 ० ᪠ +07:30:44 1594348244 祭 ० ᪠ +07:30:44 1594348244 祭 ० ᪠ +07:30:44 1594348244 祭 ० ᪠ +07:30:44 1594348244 祭 ० ᪠ +07:31:26 1594348286 ⪫祭 ० ᪠ +07:31:32 1594348292 祭 ० ᪠ +07:31:32 1594348292 祭 ० ᪠ +07:31:32 1594348292 祭 ० ᪠ +07:32:33 1594348353 ⪫祭 ० ᪠ +07:32:34 1594348354 祭 ० ᪠ +07:32:55 1594348375 . ⪫祭 ० ᪠ (A) +07:32:57 1594348377 祭 ० ᪠ +07:35:51 1594348551 ⪫祭 ० ᪠ (A) +08:29:56 1594351796 ⪫祭 ० (A) +13:59:53 1594371593 祭 ० ᪠ +13:59:53 1594371593 祭 ० ᪠ +13:59:53 1594371593 祭 ० ᪠ +14:00:15 1594371615 . ⪫祭 ० ᪠ (A) +14:03:25 1594371805 祭 ० ᪠ +14:03:25 1594371805 祭 ० ᪠ +14:03:25 1594371805 祭 ० ᪠ +14:05:33 1594371933 ⪫祭 ० ᪠ (A) +17:21:19 1594383679 祭 ॣ '-2'(A) +17:21:54 1594383714 ⪫祭 ॣ '-2'(A) +18:01:57 1594386117 祭 ॣ '-2' +18:10:05 1594386605 祭 ⠭ ॣ +20:21:54 1594394514 ⪫祭 ॣ '-2'(A) +20:22:37 1594394557 祭 ० ᪠ +20:23:19 1594394599 . ⪫祭 ० ᪠ (A) +20:28:45 1594394925 祭 ० ᪠ +20:30:44 1594395044 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.369 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.369 new file mode 100644 index 0000000..082c93e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.369 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.370 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.370 new file mode 100644 index 0000000..7ae96eb --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.370 @@ -0,0 +1,4 @@ +03:14:51 1594332891 1 06589 2 OT-4 3 25 4 1 5 Ti 6 7 670 8 4740 9 4350 10 560 11 12 321730 +17:01:14 1594382474 3 14 +18:17:26 1594387046 0 A--32-067-2014 ॢ 0 +20:39:59 1594395599 1 06590 2 BT 18, 20, 22, 23, 25 3 25 7 770 9 5100 10 650 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.371 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.371 new file mode 100644 index 0000000..162a589 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.371 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.372 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.372 new file mode 100644 index 0000000..a3e8821 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.372 @@ -0,0 +1,66 @@ +20 01:43:14 01:43:22 +Riz_sol= 175.0 + +21 01:43:32 01:43:35 +Rsk= 13.5 Rkk= 9.0 + +22 02:47:07 03:02:11 +P1= 51.1 T1=02:57:11 P2= 66.0 T2=03:02:11 Vs= 2.98 + +23 03:07:21 03:07:26 + + +24 03:07:32 03:08:09 + + +30 03:08:25 03:08:48 +Vst= 28.6 + +31 03:08:56 03:09:31 +Rom_sol= 9.9 + +32 03:10:02 03:10:37 +Imax=10.9 Umax=50.0 T= 9.0 + +33 03:10:40 03:10:59 +Imin=15.9 Umin=25.0 T= 0.5 + +34 03:11:02 03:11:25 +V=300.1 T= 9.4 + +35 03:11:28 03:12:26 +Q= 54.9 T= 9.4 + +36 03:12:29 03:13:05 +P1=0.29 T= 2.9 + +37 03:13:08 03:13:38 +T= 0.9 + +38 03:13:41 03:13:48 +t= 52.0 T= 0.5 + +39 03:13:51 03:14:05 +tcam= 52.2 Tcam= 0.5 tfl= 57.4 Tfl= 0.5 + +40 03:14:09 03:14:16 +t= 54.6 T= 0.5 + +21 17:00:57 17:01:00 +Rsk= 12.4 Rkk= 7.9 + +22 17:29:03 17:44:07 +P1= 84.1 T1=17:39:07 P2=107.8 T2=17:44:07 Vs= 4.75 + +21 20:32:38 20:32:41 +Rsk= 12.7 Rkk= 8.2 + +22 21:33:36 21:48:41 +P1= 42.1 T1=21:43:41 P2= 54.2 T2=21:48:41 Vs= 2.43 + +20 23:22:29 23:22:36 +Riz_sol= 50.5 + +21 23:22:54 23:22:57 +Rsk= 12.7 Rkk= 8.3 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.373 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.373 new file mode 100644 index 0000000..c85c903 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.373 @@ -0,0 +1,17 @@ +7 00:32:19 1594323139 +8 01:41:04 1594327264 +25 03:08:22 1594332502 +9 03:14:51 1594332891 +10 03:42:08 1594334528 +12 07:40:04 1594348804 +13 10:44:31 1594359871 +0 10:44:31 1594359871 +14 16:57:10 1594382230 +15 17:45:22 1594385122 +16 18:21:09 1594387269 +1 18:58:48 1594389528 +2 20:30:32 1594395032 +5 21:49:53 1594399793 +6 22:02:40 1594400560 +7 22:38:00 1594402680 +8 23:21:15 1594405275 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.374 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.374 new file mode 100644 index 0000000..2e76557 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.374 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.376 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.376 new file mode 100644 index 0000000..6f00155 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.376 @@ -0,0 +1,100 @@ +[07] +oper = 7 +begin = 10.07.2020 00:32:19 +norma = 30 +real = 68 + +[08] +oper = 8 +begin = 10.07.2020 01:41:04 +norma = 40 +vac_time = 9 +real = 87 + +[09] +oper = 25 +begin = 10.07.2020 03:08:22 +norma = 30 +real = 6 + +[10] +oper = 9 +begin = 10.07.2020 03:14:51 +norma = 0 +real = 27 + +[11] +oper = 10 +begin = 10.07.2020 03:42:08 +norma = 0 +real = 237 + +[12] +oper = 12 +begin = 10.07.2020 07:40:04 +norma = 180 +real = 184 + +[13] +oper = 13 +begin = 10.07.2020 10:44:31 +norma = 45 +real = 372 + +[14] +oper = 14 +begin = 10.07.2020 16:57:10 +norma = 40 +vac_time = 10 +real = 48 + +[15] +oper = 15 +begin = 10.07.2020 17:45:22 +norma = 30 +real = 35 + +[16] +oper = 16 +begin = 10.07.2020 18:21:09 +norma = 40 +real = 37 + +[17] +oper = 1 +begin = 10.07.2020 18:58:48 +norma = 85 +real = 91 + +[18] +oper = 2 +begin = 10.07.2020 20:30:32 +norma = 110 +vac_time = 9 +real = 79 + +[19] +oper = 5 +begin = 10.07.2020 21:49:53 +norma = 25 +real = 12 + +[20] +oper = 6 +begin = 10.07.2020 22:02:40 +norma = 35 +real = 35 + +[21] +oper = 7 +begin = 10.07.2020 22:38:00 +norma = 30 +real = 43 + +[22] +oper = 8 +begin = 10.07.2020 23:21:15 +norma = 40 +vac_time = 10 +real = 79 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.377 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.377 new file mode 100644 index 0000000..05ad838 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.377 @@ -0,0 +1,20 @@ +03:07:34 1594332454 祭 ॣ '-2'(A) +03:08:10 1594332490 ⪫祭 ॣ '-2'(A) +03:39:43 1594334383 祭 ॣ '-2' +03:46:17 1594334777 祭 ⠭ ॣ +07:40:06 1594348806 ⪫祭 ॣ '-2'(A) +07:40:19 1594348819 祭 ० ᪠ +07:43:13 1594348993 ⪫祭 ० ᪠ (A) +17:45:19 1594385119 祭 ० ࠧ +17:45:21 1594385121 祭 ० ' ⮪ 㣨' +17:45:22 1594385122 祭 ॣ '-2'(A) +18:17:26 1594387046 ⪫祭 ० ࠧ (A) +18:21:10 1594387270 ⪫祭 ० ' ⮪ 㣨' +18:21:13 1594387273 ⪫祭 ॣ '-2'(A) +18:21:45 1594387305 祭 ० ᪠ +18:21:45 1594387305 祭 ० ᪠ +18:24:37 1594387477 ⪫祭 ० ᪠ (A) +22:03:07 1594400587 祭 ० ᪠ +22:03:07 1594400587 祭 ० ᪠ +22:03:07 1594400587 祭 ० ᪠ +22:05:44 1594400744 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.379 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.379 new file mode 100644 index 0000000..3ac9ee5 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.379 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.390 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.390 new file mode 100644 index 0000000..d1ffbdd --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.390 @@ -0,0 +1 @@ +20:56:47 1594396607 1 09430 7 615 9 3660 10 495 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.391 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.391 new file mode 100644 index 0000000..b7ff1b9 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.391 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.392 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.392 new file mode 100644 index 0000000..d30721b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.392 @@ -0,0 +1,6 @@ +21 20:57:15 20:57:23 +Rsk= 11.0 Rkk= 9.4 + +22 22:08:13 22:18:20 +P1= 54.6 T1=22:13:20 P2= 66.2 T2=22:18:20 Vs= 2.32 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.393 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.393 new file mode 100644 index 0000000..f200fad --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.393 @@ -0,0 +1,6 @@ +12 02:10:41 1594329041 +13 05:56:56 1594342616 +0 05:56:56 1594342616 +2 20:54:25 1594396465 +5 23:24:43 1594405483 +6 23:34:13 1594406053 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.394 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.394 new file mode 100644 index 0000000..1801d56 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.394 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.396 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.396 new file mode 100644 index 0000000..6d1aae8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.396 @@ -0,0 +1,31 @@ +[63] +oper = 12 +begin = 10.07.2020 02:10:41 +norma = 105 +real = 226 + +[64] +oper = 13 +begin = 10.07.2020 05:56:56 +norma = 45 +real = 897 + +[65] +oper = 2 +begin = 10.07.2020 20:54:25 +norma = 110 +vac_time = 8 +real = 150 + +[66] +oper = 5 +begin = 10.07.2020 23:24:43 +norma = 25 +real = 9 + +[67] +oper = 6 +begin = 10.07.2020 23:34:13 +norma = 35 +real = 48 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.397 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.397 new file mode 100644 index 0000000..5311140 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.397 @@ -0,0 +1,18 @@ +01:55:28 1594328128 祭 ० +01:55:28 1594328128 祭 ० +01:55:28 1594328128 ⪫祭 ॣ '-2'(A) +01:55:30 1594328130 祭 ॣ '-2'(A) +01:59:34 1594328374 ⪫祭 ० ' ⮪ 㣨' +02:10:44 1594329044 ⪫祭 ॣ '-2'(A) +02:11:28 1594329088 祭 ० ᪠ +02:11:29 1594329089 祭 ० ᪠ +02:11:29 1594329089 祭 ० ᪠ +02:11:29 1594329089 祭 ० ᪠ +02:11:30 1594329090 祭 ० ᪠ +02:11:30 1594329090 祭 ० ᪠ +02:14:21 1594329261 ⪫祭 ० ᪠ (A) +03:05:28 1594332328 ⪫祭 ० (A) +09:19:54 1594354794 祭 ॣ '-2'(A) +09:19:56 1594354796 ⪫祭 ॣ '-2'(A) +23:35:20 1594406120 祭 ० ᪠ +23:39:48 1594406388 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.399 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.399 new file mode 100644 index 0000000..f1de2bc Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.399 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.410 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.410 new file mode 100644 index 0000000..d32e7ab --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.410 @@ -0,0 +1,3 @@ +17:48:48 1594385328 1 11455 3 25 4 1 8 4000 9 5100 10 650 +21:14:53 1594397693 1 11455 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4000 9 5100 10 650 11 12 320839 +21:48:25 1594399705 0 A--32-129-2018 ॢ 1 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.411 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.411 new file mode 100644 index 0000000..e612a68 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.411 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.412 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.412 new file mode 100644 index 0000000..29a5c67 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.412 @@ -0,0 +1,66 @@ +21 17:49:10 17:49:13 +Rsk= 10.1 Rkk= 7.2 + +22 18:15:16 18:30:23 +P1= 58.8 T1=18:25:23 P2= 73.1 T2=18:30:23 Vs= 2.85 + +20 19:47:10 19:47:19 +Riz_sol= 4755.9 + +21 19:47:24 19:47:27 +Rsk= 9.1 Rkk= 6.2 + +22 20:23:35 20:38:42 +P1= 45.6 T1=20:33:42 P2= 56.4 T2=20:38:42 Vs= 2.16 + +22 20:50:03 21:00:10 +P1= 22.4 T1=20:55:10 P2= 34.6 T2=21:00:10 Vs= 2.44 + +23 21:03:48 21:03:53 + + +21 21:04:00 21:04:03 +Rsk= 8.9 Rkk= 6.0 + +30 21:04:13 21:04:31 +Vst= 31.6 + +30 21:04:34 21:05:02 +Vst= 31.8 + +31 21:05:05 21:05:38 +Rom_sol= 12.6 + +24 21:08:30 21:09:04 + + +41 21:09:52 21:09:57 +Ukz= 1.92 + +32 21:09:59 21:10:35 +Imax=11.0 Umax=50.0 T= 9.0 + +33 21:10:40 21:11:01 +Imin=16.0 Umin=25.0 T= 0.5 + +34 21:11:04 21:11:26 +V=300.1 T= 9.5 + +35 21:11:29 21:12:41 +Q= 54.3 T= 9.5 + +36 21:12:44 21:13:18 +P1=0.29 T= 2.9 + +37 21:13:20 21:13:43 +T= 1.0 + +38 21:13:45 21:13:52 +t= 51.9 T= 0.6 + +39 21:13:55 21:14:10 +tcam= 53.0 Tcam= 0.6 tfl= 54.4 Tfl= 0.6 + +40 21:14:12 21:14:19 +t= 54.4 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.413 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.413 new file mode 100644 index 0000000..8bccaac --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.413 @@ -0,0 +1,12 @@ +11 11:51:01 1594363861 +12 14:22:10 1594372930 +13 16:08:06 1594379286 +0 16:08:06 1594379286 +2 17:45:03 1594385103 +5 18:30:57 1594387857 +6 18:41:17 1594388477 +7 19:18:28 1594390708 +8 19:44:59 1594392299 +25 21:09:10 1594397350 +9 21:14:53 1594397693 +10 21:48:26 1594399706 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.414 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.414 new file mode 100644 index 0000000..b885668 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.414 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.416 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.416 new file mode 100644 index 0000000..1c026e7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.416 @@ -0,0 +1,68 @@ +[98] +oper = 11 +begin = 10.07.2020 11:51:01 +norma = 0 +real = 151 + +[99] +oper = 12 +begin = 10.07.2020 14:22:10 +norma = 105 +real = 105 + +[00] +oper = 13 +begin = 10.07.2020 16:08:06 +norma = 45 +real = 96 + +[01] +oper = 2 +begin = 10.07.2020 17:45:03 +norma = 110 +vac_time = 8 +real = 45 + +[02] +oper = 5 +begin = 10.07.2020 18:30:57 +norma = 25 +real = 10 + +[03] +oper = 6 +begin = 10.07.2020 18:41:17 +norma = 35 +real = 37 + +[04] +oper = 7 +begin = 10.07.2020 19:18:28 +norma = 30 +real = 26 + +[05] +oper = 8 +begin = 10.07.2020 19:44:59 +norma = 40 +vac_time = 8 +real = 84 + +[06] +oper = 25 +begin = 10.07.2020 21:09:10 +norma = 30 +real = 5 + +[07] +oper = 9 +begin = 10.07.2020 21:14:53 +norma = 0 +real = 33 + +[08] +oper = 10 +begin = 10.07.2020 21:48:26 +norma = 0 +real = 264 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.417 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.417 new file mode 100644 index 0000000..e809717 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.417 @@ -0,0 +1,19 @@ +11:51:00 1594363860 祭 ० +11:51:01 1594363861 ⪫祭 ॣ '-2'(A) +14:22:06 1594372926 ⪫祭 ० (A) +14:22:11 1594372931 ⪫祭 ० ' ⮪ 㣨' +14:22:19 1594372939 祭 ० ᪠ +14:22:20 1594372940 祭 ० ᪠ +14:22:20 1594372940 祭 ० ᪠ +14:24:42 1594373082 ⪫祭 ० ᪠ (A) +18:41:30 1594388490 祭 ० ᪠ +18:43:40 1594388620 ⪫祭 ० ᪠ (A) +21:08:20 1594397300 祭 ॣ '-2'(A) +21:08:22 1594397302 ⪫祭 ॣ '-2'(A) +21:08:30 1594397310 祭 ॣ '-2'(A) +21:09:04 1594397344 ⪫祭 ॣ '-2'(A) +21:14:23 1594397663 祭 ० ࠧ +21:14:25 1594397665 祭 ० ' ⮪ 㣨' +21:16:26 1594397786 祭 ॣ '-2'(A) +21:48:25 1594399705 ⪫祭 ० ࠧ (A) +21:48:26 1594399706 祭 ⠭ ॣ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.419 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.419 new file mode 100644 index 0000000..9c735d4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.419 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.420 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.420 new file mode 100644 index 0000000..ff681bf --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.420 @@ -0,0 +1 @@ +17:41:07 1594384867 1 09422 3 25 4 1 7 770 8 3890 9 4820 10 650 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.421 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.421 new file mode 100644 index 0000000..6f16dc1 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.421 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.422 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.422 new file mode 100644 index 0000000..4b4e119 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.422 @@ -0,0 +1,57 @@ +21 01:34:42 01:34:45 +Rsk= 11.6 Rkk= 11.8 + +21 12:04:35 12:04:38 +Rsk= 11.8 Rkk= 12.0 + +22 13:05:01 13:15:04 +P1= 11.7 T1=13:10:04 P2= 20.7 T2=13:15:04 Vs= 1.80 + +21 17:39:43 17:39:46 +Rsk= 12.7 Rkk= 12.0 + +22 19:10:10 19:25:13 +P1= 41.5 T1=19:20:13 P2= 56.9 T2=19:25:13 Vs= 3.09 + +22 19:35:00 19:45:04 +P1= 26.3 T1=19:40:03 P2= 41.5 T2=19:45:04 Vs= 3.03 + +21 21:49:36 21:49:39 +Rsk= 11.2 Rkk= 10.8 + +20 22:05:22 22:05:30 +Riz_sol= 156.7 + +22 22:44:56 23:00:00 +P1= 37.6 T1=22:55:00 P2= 51.0 T2=23:00:00 Vs= 2.69 + +22 23:40:53 23:50:56 +P1= 12.2 T1=23:45:56 P2= 21.9 T2=23:50:56 Vs= 1.93 + +23 23:51:35 23:51:40 + + +24 23:51:59 23:52:36 + + +30 23:52:53 23:53:18 +Vst= 28.6 + +31 23:53:39 23:54:20 +Rom_sol= 10.9 + +32 23:55:12 23:55:49 +Imax=11.4 Umax=50.0 T= 9.0 + +33 23:56:22 23:56:44 +Imin=16.2 Umin=25.0 T= 0.5 + +34 23:56:49 23:57:17 +V=300.2 T= 9.5 + +35 23:57:21 23:58:40 +Q= 54.2 T= 9.6 + +36 23:58:46 23:59:26 +P1=0.29 T= 3.0 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.423 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.423 new file mode 100644 index 0000000..8ec899e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.423 @@ -0,0 +1,13 @@ +1 00:27:00 1594322820 +14 01:34:19 1594326859 +1 09:38:58 1594355938 +14 11:58:02 1594364282 +15 13:24:57 1594369497 +16 13:59:29 1594371569 +1 14:55:45 1594374945 +2 17:35:01 1594384501 +5 19:47:13 1594392433 +6 19:57:08 1594393028 +7 21:12:59 1594397579 +8 21:41:22 1594399282 +25 23:52:51 1594407171 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.424 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.424 new file mode 100644 index 0000000..82a1b6f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.424 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.426 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.426 new file mode 100644 index 0000000..1120bb6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.426 @@ -0,0 +1,82 @@ +[25] +oper = 1 +begin = 10.07.2020 00:27:00 +norma = 85 +real = 67 + +[26] +oper = 14 +begin = 10.07.2020 01:34:19 +norma = 40 +vac_time = 7 +real = 484 + +[27] +oper = 1 +begin = 10.07.2020 09:38:58 +norma = 85 +real = 139 + +[28] +oper = 14 +begin = 10.07.2020 11:58:02 +norma = 40 +vac_time = 18 +real = 86 + +[29] +oper = 15 +begin = 10.07.2020 13:24:57 +norma = 30 +real = 34 + +[30] +oper = 16 +begin = 10.07.2020 13:59:29 +norma = 40 +real = 56 + +[31] +oper = 1 +begin = 10.07.2020 14:55:45 +norma = 85 +real = 159 + +[32] +oper = 2 +begin = 10.07.2020 17:35:01 +norma = 110 +vac_time = 12 +real = 132 + +[33] +oper = 5 +begin = 10.07.2020 19:47:13 +norma = 25 +real = 9 + +[34] +oper = 6 +begin = 10.07.2020 19:57:08 +norma = 35 +real = 75 + +[35] +oper = 7 +begin = 10.07.2020 21:12:59 +norma = 30 +real = 28 + +[36] +oper = 8 +begin = 10.07.2020 21:41:22 +norma = 40 +vac_time = 24 +real = 131 + +[37] +oper = 25 +begin = 10.07.2020 23:52:51 +norma = 30 +real = 39 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.427 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.427 new file mode 100644 index 0000000..a3b0b39 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.427 @@ -0,0 +1,11 @@ +13:24:29 1594369469 祭 ० ' ⮪ 㣨' +13:24:31 1594369471 祭 ० ࠧ +13:26:16 1594369576 祭 ॣ '-2'(A) +13:59:30 1594371570 ⪫祭 ० ' ⮪ 㣨' +13:59:31 1594371571 ⪫祭 ॣ '-2'(A) +13:59:53 1594371593 祭 ० ᪠ +14:02:09 1594371729 ⪫祭 ० ᪠ (A) +19:57:40 1594393060 祭 ० ᪠ +20:00:02 1594393202 ⪫祭 ० ᪠ (A) +23:52:02 1594407122 祭 ॣ '-2'(A) +23:52:39 1594407159 ⪫祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.440 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.440 new file mode 100644 index 0000000..98d0ae7 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.440 @@ -0,0 +1,2 @@ +13:24:30 1594369470 1 09886 7 615 8 4980 9 3860 10 495 +20:24:43 1594394683 1 09886 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 615 8 4980 9 3860 10 495 11 12 321021 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.441 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.441 new file mode 100644 index 0000000..d626ced Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.441 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.442 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.442 new file mode 100644 index 0000000..18c1441 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.442 @@ -0,0 +1,75 @@ +21 13:23:28 13:23:35 +Rsk= 13.8 Rkk= 11.4 + +22 14:28:25 14:43:59 +P1= 82.7 T1=14:38:58 P2=114.6 T2=14:43:59 Vs= 6.37 + +22 15:09:17 15:24:50 +P1= 72.2 T1=15:19:50 P2=101.0 T2=15:24:50 Vs= 5.75 + +22 15:49:27 16:05:00 +P1= 70.8 T1=16:00:00 P2= 97.4 T2=16:05:00 Vs= 5.31 + +21 16:38:56 16:39:04 +Rsk= 15.1 Rkk= 12.2 + +22 17:44:43 17:55:16 +P1= 22.4 T1=17:50:16 P2= 29.7 T2=17:55:16 Vs= 1.46 + +21 19:07:30 19:07:37 +Rsk= 15.3 Rkk= 12.4 + +20 19:15:04 19:15:14 +Riz_sol= 29.6 + +20 20:01:17 20:01:27 +Riz_sol= 236.3 + +22 20:01:36 20:12:08 +P1= 17.5 T1=20:07:08 P2= 30.2 T2=20:12:08 Vs= 2.54 + +23 20:13:28 20:13:34 + + +24 20:13:50 20:14:31 + + +30 20:14:42 20:15:22 +Vst= 30.1 + +31 20:15:26 20:16:06 +Rom_sol= 18.9 + +41 20:16:33 20:16:33 +Ukz= 5.10 + +41 20:18:14 20:18:19 +Ukz= 2.08 + +32 20:18:23 20:19:33 +Imax=11.4 Umax=49.9 T= 9.4 + +33 20:19:38 20:20:15 +Imin=16.6 Umin=25.2 T= 1.0 + +34 20:20:19 20:20:48 +V=301.4 T= 9.7 + +35 20:20:52 20:22:10 +Q= 54.8 T= 9.3 + +36 20:22:14 20:22:48 +P1=0.29 T= 3.1 + +37 20:22:52 20:23:22 +T= 0.8 + +38 20:23:26 20:23:32 +t= 51.9 T= 0.7 + +39 20:23:36 20:23:42 +t= 51.6 T= 0.7 + +40 20:23:45 20:23:52 +t= 52.1 T= 0.7 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.443 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.443 new file mode 100644 index 0000000..e05d147 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.443 @@ -0,0 +1,14 @@ +12 02:45:43 1594331143 +13 05:53:10 1594342390 +0 05:53:10 1594342390 +2 13:20:47 1594369247 +7 16:19:24 1594379964 +2 16:36:15 1594380975 +5 17:56:18 1594385778 +6 18:06:18 1594386378 +7 18:46:24 1594388784 +8 19:03:49 1594389829 +25 20:14:39 1594394079 +9 20:24:43 1594394683 +10 20:48:25 1594396105 +12 23:50:08 1594407008 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.444 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.444 new file mode 100644 index 0000000..4bf91d4 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.444 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.445 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.445 new file mode 100644 index 0000000..fa604ff --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.445 @@ -0,0 +1 @@ +17 19:07:17 1594390037 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.446 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.446 new file mode 100644 index 0000000..8583c72 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.446 @@ -0,0 +1,81 @@ +[44] +oper = 12 +begin = 10.07.2020 02:45:43 +norma = 105 +real = 187 + +[45] +oper = 13 +begin = 10.07.2020 05:53:10 +norma = 45 +real = 447 + +[46] +oper = 2 +begin = 10.07.2020 13:20:47 +norma = 110 +vac_time = 9 +real = 178 + +[47] +oper = 7 +begin = 10.07.2020 16:19:24 +norma = 30 +real = 16 + +[48] +oper = 2 +begin = 10.07.2020 16:36:15 +norma = 110 +vac_time = 9 +real = 80 + +[49] +oper = 5 +begin = 10.07.2020 17:56:18 +norma = 25 +real = 10 + +[50] +oper = 6 +begin = 10.07.2020 18:06:18 +norma = 35 +real = 40 + +[51] +oper = 7 +begin = 10.07.2020 18:46:24 +norma = 30 +real = 17 + +[52] +oper = 8 +begin = 10.07.2020 19:03:49 +norma = 40 +vac_time = 12 +real = 70 + +[53] +oper = 25 +begin = 10.07.2020 20:14:39 +norma = 30 +real = 10 + +[54] +oper = 9 +begin = 10.07.2020 20:24:43 +norma = 0 +real = 23 + +[55] +oper = 10 +begin = 10.07.2020 20:48:25 +norma = 0 +real = 181 + +[56] +oper = 12 +begin = 10.07.2020 23:50:08 +norma = 180 +real = 170 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.447 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.447 new file mode 100644 index 0000000..cacc93a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.447 @@ -0,0 +1,17 @@ +02:38:31 1594330711 祭 ० +02:38:31 1594330711 ⪫祭 ॣ '-2'(A) +02:38:32 1594330712 祭 ॣ '-2'(A) +02:41:44 1594330904 ⪫祭 ० ' ⮪ 㣨' +02:45:46 1594331146 ⪫祭 ॣ '-2'(A) +02:46:40 1594331200 祭 ० ᪠ +02:49:10 1594331350 ⪫祭 ० ᪠ (A) +03:48:31 1594334911 ⪫祭 ० (A) +18:06:59 1594386419 祭 ० ᪠ +18:09:34 1594386574 ⪫祭 ० ᪠ (A) +20:13:53 1594394033 祭 ॣ '-2'(A) +20:14:31 1594394071 ⪫祭 ॣ '-2'(A) +20:48:23 1594396103 祭 ॣ '-2' +20:48:24 1594396104 祭 ⠭ ॣ +23:50:11 1594407011 ⪫祭 ॣ '-2'(A) +23:51:59 1594407119 祭 ० ᪠ +23:54:32 1594407272 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.449 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.449 new file mode 100644 index 0000000..6015fef Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.449 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.450 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.450 new file mode 100644 index 0000000..222c698 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.450 @@ -0,0 +1,8 @@ +01:55:46 1594328146 1 11461 2 BT 18, 20, 22, 23, 25 3 25 4 2 5 Ti 6 7 870 8 3000 9 5120 10 770 11 12 321731 +02:26:35 1594329995 0 A--32-078-2017 ॢ 1 +14:47:32 1594374452 3 14 +15:37:15 1594377435 0 A--32-120-2016 ॢ 0 +17:48:00 1594385280 1 11462 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 7 770 9 4490 10 690 +17:48:23 1594385303 11 +18:45:43 1594388743 1 11462 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 2 5 Ti 6 7 770 8 3000 9 4490 10 690 11 12 321731 +19:28:22 1594391302 0 A--32-031-2016 ॢ 5 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.451 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.451 new file mode 100644 index 0000000..b42944f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.451 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.452 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.452 new file mode 100644 index 0000000..552b3e1 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.452 @@ -0,0 +1,111 @@ +20 00:42:33 00:42:42 +Riz_sol= 4854.4 + +21 00:44:30 00:44:33 +Rsk= 15.4 Rkk= 11.8 + +22 01:30:12 01:45:17 +P1= 37.2 T1=01:40:17 P2= 49.5 T2=01:45:17 Vs= 2.46 + +23 01:45:44 01:45:49 + + +24 01:46:05 01:46:45 + + +30 01:47:06 01:47:38 +Vst= 28.7 + +31 01:47:56 01:48:56 +Rom_sol= 14.4 + +41 01:49:41 01:49:46 +Ukz= 1.10 + +32 01:49:51 01:50:27 +Imax=10.9 Umax=50.0 T= 9.0 + +33 01:50:34 01:50:54 +Imin=15.8 Umin=25.0 T= 0.5 + +34 01:51:00 01:51:24 +V=300.2 T= 9.4 + +35 01:51:32 01:52:32 +Q= 54.5 T= 9.4 + +36 01:52:44 01:53:25 +P1=0.30 T= 2.9 + +37 01:53:38 01:54:11 +T= 0.9 + +38 01:54:22 01:54:29 +t= 51.6 T= 0.5 + +39 01:54:39 01:54:54 +tcam= 52.3 Tcam= 0.5 tfl= 53.6 Tfl= 0.5 + +40 01:55:00 01:55:07 +t= 51.7 T= 0.5 + +21 14:46:29 14:46:32 +Rsk= 15.1 Rkk= 11.6 + +22 15:06:38 15:21:43 +P1= 84.4 T1=15:16:43 P2=107.8 T2=15:21:43 Vs= 4.67 + +20 17:46:58 17:47:08 +Riz_sol= 4853.8 + +21 17:47:14 17:47:17 +Rsk= 15.3 Rkk= 11.7 + +22 18:22:42 18:37:47 +P1= 39.2 T1=18:32:47 P2= 52.7 T2=18:37:47 Vs= 2.69 + +23 18:38:02 18:38:07 + + +24 18:38:12 18:38:50 + + +30 18:39:00 18:39:24 +Vst= 28.6 + +31 18:39:28 18:40:02 +Rom_sol= 11.4 + +41 18:40:34 18:40:39 +Ukz= 1.15 + +32 18:40:42 18:41:17 +Imax=10.9 Umax=50.1 T= 9.0 + +33 18:41:19 18:41:39 +Imin=15.8 Umin=25.0 T= 0.5 + +34 18:41:43 18:42:06 +V=300.5 T= 9.4 + +35 18:42:16 18:43:11 +Q= 54.1 T= 9.4 + +36 18:43:14 18:43:44 +P1=0.29 T= 2.9 + +37 18:43:48 18:44:18 +T= 0.9 + +38 18:44:21 18:44:27 +t= 51.7 T= 0.5 + +38 18:44:30 18:44:37 +t= 51.6 T= 0.5 + +39 18:44:41 18:44:56 +tcam= 52.3 Tcam= 0.5 tfl= 56.0 Tfl= 0.5 + +40 18:44:59 18:45:06 +t= 51.7 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.453 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.453 new file mode 100644 index 0000000..52f84d8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.453 @@ -0,0 +1,17 @@ +8 00:38:36 1594323516 +25 01:47:00 1594327620 +9 01:55:46 1594328146 +10 02:26:35 1594329995 +11 07:08:41 1594346921 +12 10:39:47 1594359587 +13 12:42:56 1594366976 +0 12:42:56 1594366976 +14 14:44:21 1594374261 +15 15:23:22 1594376602 +16 15:49:27 1594378167 +1 16:34:52 1594380892 +8 17:43:52 1594385032 +25 18:38:58 1594388338 +9 18:45:43 1594388743 +10 19:28:22 1594391302 +11 23:08:43 1594404523 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.454 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.454 new file mode 100644 index 0000000..992b5e7 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.454 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.455 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.455 new file mode 100644 index 0000000..f0dfc9b --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.455 @@ -0,0 +1 @@ +47 18:44:27 1594388667 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.456 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.456 new file mode 100644 index 0000000..f5a249e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.456 @@ -0,0 +1,99 @@ +[02] +oper = 8 +begin = 10.07.2020 00:38:36 +norma = 40 +vac_time = 10 +real = 68 + +[03] +oper = 25 +begin = 10.07.2020 01:47:00 +norma = 30 +real = 8 + +[04] +oper = 9 +begin = 10.07.2020 01:55:46 +norma = 0 +real = 30 + +[05] +oper = 10 +begin = 10.07.2020 02:26:35 +norma = 0 +real = 282 + +[06] +oper = 11 +begin = 10.07.2020 07:08:41 +norma = 0 +real = 211 + +[07] +oper = 12 +begin = 10.07.2020 10:39:47 +norma = 105 +real = 123 + +[08] +oper = 13 +begin = 10.07.2020 12:42:56 +norma = 45 +real = 121 + +[09] +oper = 14 +begin = 10.07.2020 14:44:21 +norma = 40 +vac_time = 9 +real = 39 + +[10] +oper = 15 +begin = 10.07.2020 15:23:22 +norma = 30 +real = 26 + +[11] +oper = 16 +begin = 10.07.2020 15:49:27 +norma = 40 +real = 45 + +[12] +oper = 1 +begin = 10.07.2020 16:34:52 +norma = 85 +real = 69 + +[13] +oper = 8 +begin = 10.07.2020 17:43:52 +norma = 40 +vac_time = 9 +real = 55 + +[14] +oper = 25 +begin = 10.07.2020 18:38:58 +norma = 30 +real = 6 + +[15] +oper = 9 +begin = 10.07.2020 18:45:43 +norma = 0 +real = 42 + +[16] +oper = 10 +begin = 10.07.2020 19:28:22 +norma = 0 +real = 220 + +[17] +oper = 11 +begin = 10.07.2020 23:08:43 +norma = 0 +real = 167 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.457 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.457 new file mode 100644 index 0000000..ade0458 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.457 @@ -0,0 +1,42 @@ +01:46:09 1594327569 祭 ॣ '-2'(A) +01:46:46 1594327606 ⪫祭 ॣ '-2'(A) +01:47:52 1594327672 祭 +01:47:57 1594327677 祭 +01:48:57 1594327737 ⪫祭 +01:55:24 1594328124 祭 ० ࠧ +01:55:26 1594328126 祭 ० ' ⮪ 㣨' +01:55:47 1594328147 : 믮 +02:12:05 1594329125 祭 ॣ '-2'(A) +02:26:35 1594329995 ⪫祭 ० ࠧ (A) +02:26:35 1594329995 祭 ॣ . 殮 㣨 +07:08:41 1594346921 祭 ० +07:08:41 1594346921 ⪫祭 ॣ '-2'(A) +07:08:42 1594346922 祭 ॣ '-2'(A) +08:04:43 1594350283 ⪫祭 ॣ '-2'(A) +10:39:41 1594359581 ⪫祭 ० (A) +10:39:42 1594359582 ⪫祭 +10:39:42 1594359582 : +10:39:48 1594359588 ⪫祭 ० ' ⮪ 㣨' +10:39:58 1594359598 祭 ० ᪠ +10:42:17 1594359737 ⪫祭 ० ᪠ (A) +11:09:42 1594361382 : 믮 +15:22:40 1594376560 祭 ० ࠧ +15:22:42 1594376562 祭 ० ' ⮪ 㣨' +15:23:18 1594376598 祭 ॣ '-2'(A) +15:37:15 1594377435 ⪫祭 ० ࠧ (A) +15:37:29 1594377449 ⪫祭 ० ' ⮪ 㣨' +15:49:30 1594378170 ⪫祭 ॣ '-2'(A) +15:49:43 1594378183 祭 ० ᪠ +15:52:01 1594378321 ⪫祭 ० ᪠ (A) +17:48:03 1594385283 : 㦥 +17:48:25 1594385305 : +18:38:13 1594388293 祭 ॣ '-2'(A) +18:38:51 1594388331 ⪫祭 ॣ '-2'(A) +18:45:13 1594388713 祭 ० ࠧ +18:45:15 1594388715 祭 ० ' ⮪ 㣨' +19:11:17 1594390277 祭 ॣ '-2'(A) +19:28:22 1594391302 ⪫祭 ० ࠧ (A) +19:28:22 1594391302 祭 ⠭ ॣ +23:08:43 1594404523 祭 ० +23:08:44 1594404524 ⪫祭 ॣ '-2'(A) +23:08:45 1594404525 祭 ॣ '-2'(A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.459 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.459 new file mode 100644 index 0000000..08255ae Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.459 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.460 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.460 new file mode 100644 index 0000000..9128fe6 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.460 @@ -0,0 +1,2 @@ +06:37:31 1594345051 1 11525 9 6350 +12:51:59 1594367519 1 11525 2 BT 3-1, 6, 8, 9, 14, 15, 16 3 25 4 1 5 Ti 6 7 770 8 4600 9 6350 10 650 11 12 321731 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.461 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.461 new file mode 100644 index 0000000..6685516 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.461 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.462 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.462 new file mode 100644 index 0000000..d09deda --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.462 @@ -0,0 +1,72 @@ +21 06:35:15 06:35:18 +Rsk= 16.0 Rkk= 13.8 + +22 07:44:58 08:00:05 +P1= 54.6 T1=07:55:05 P2= 74.3 T2=08:00:05 Vs= 3.95 + +22 08:17:05 08:32:12 +P1= 41.3 T1=08:27:12 P2= 57.3 T2=08:32:12 Vs= 3.20 + +22 08:50:08 09:05:15 +P1= 34.9 T1=09:00:15 P2= 49.0 T2=09:05:15 Vs= 2.83 + +20 10:26:08 10:26:16 +Riz_sol= 536.1 + +21 10:26:23 10:26:26 +Rsk= 15.9 Rkk= 13.3 + +22 10:54:10 11:09:17 +P1= 69.3 T1=11:04:17 P2= 91.4 T2=11:09:17 Vs= 4.40 + +22 11:35:36 11:50:44 +P1= 45.4 T1=11:45:44 P2= 61.6 T2=11:50:44 Vs= 3.24 + +22 12:28:08 12:43:15 +P1= 36.0 T1=12:38:15 P2= 49.9 T2=12:43:15 Vs= 2.78 + +23 12:43:31 12:43:37 + + +24 12:43:52 12:44:31 + + +30 12:44:44 12:45:19 +Vst= 24.0 + +30 12:45:22 12:45:45 +Vst= 27.8 + +31 12:45:50 12:46:24 +Rom_sol= 16.0 + +41 12:46:49 12:46:54 +Ukz= 2.28 + +32 12:46:55 12:47:31 +Imax=11.1 Umax=50.2 T= 9.0 + +33 12:47:36 12:48:03 +Imin=16.1 Umin=25.0 T= 0.5 + +34 12:48:08 12:48:32 +V=300.5 T= 9.4 + +35 12:48:37 12:49:33 +Q= 51.3 T= 9.4 + +36 12:49:38 12:50:07 +P1=0.29 T= 2.9 + +37 12:50:12 12:50:38 +T= 0.9 + +38 12:50:42 12:50:51 +t= 52.9 T= 0.5 + +39 12:50:56 12:51:14 +tcam= 53.4 Tcam= 0.5 tfl= 59.6 Tfl= 0.5 + +40 12:51:18 12:51:25 +t= 51.9 T= 0.5 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.463 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.463 new file mode 100644 index 0000000..84be4d4 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.463 @@ -0,0 +1,14 @@ +12 00:26:31 1594322791 +13 04:53:22 1594338802 +0 04:53:22 1594338802 +2 06:31:33 1594344693 +5 09:06:22 1594353982 +6 09:17:22 1594354642 +7 09:53:31 1594356811 +8 10:19:47 1594358387 +25 12:44:37 1594367077 +9 12:51:59 1594367519 +10 13:19:42 1594369182 +12 15:01:34 1594375294 +13 19:18:04 1594390684 +0 19:18:04 1594390684 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.464 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.464 new file mode 100644 index 0000000..5895291 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.464 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.466 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.466 new file mode 100644 index 0000000..9087719 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.466 @@ -0,0 +1,75 @@ +[38] +oper = 12 +begin = 10.07.2020 00:26:31 +norma = 105 +real = 266 + +[39] +oper = 13 +begin = 10.07.2020 04:53:22 +norma = 45 +real = 98 + +[40] +oper = 2 +begin = 10.07.2020 06:31:33 +norma = 110 +vac_time = 10 +real = 154 + +[41] +oper = 5 +begin = 10.07.2020 09:06:22 +norma = 25 +real = 11 + +[42] +oper = 6 +begin = 10.07.2020 09:17:22 +norma = 35 +real = 36 + +[43] +oper = 7 +begin = 10.07.2020 09:53:31 +norma = 30 +real = 26 + +[44] +oper = 8 +begin = 10.07.2020 10:19:47 +norma = 40 +vac_time = 9 +vac_avg10 = 10.0 +real = 144 + +[45] +oper = 25 +begin = 10.07.2020 12:44:37 +norma = 30 +real = 7 + +[46] +oper = 9 +begin = 10.07.2020 12:51:59 +norma = 0 +real = 27 + +[47] +oper = 10 +begin = 10.07.2020 13:19:42 +norma = 0 +real = 101 + +[48] +oper = 12 +begin = 10.07.2020 15:01:34 +norma = 180 +real = 256 + +[49] +oper = 13 +begin = 10.07.2020 19:18:04 +norma = 45 +real = 618 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.467 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.467 new file mode 100644 index 0000000..8d3905c --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.467 @@ -0,0 +1,25 @@ +00:16:07 1594322167 祭 ० +00:16:08 1594322168 ⪫祭 ॣ '-2'(A) +00:16:09 1594322169 祭 ॣ '-2'(A) +00:19:23 1594322363 ⪫祭 ० ' ⮪ 㣨' +00:26:34 1594322794 ⪫祭 ॣ '-2'(A) +00:26:57 1594322817 祭 ० ᪠ +00:28:55 1594322935 ⪫祭 ० ᪠ (A) +01:26:07 1594326367 ⪫祭 ० (A) +09:17:32 1594354652 祭 ० ᪠ +09:17:34 1594354654 祭 ० ᪠ +09:19:35 1594354775 ⪫祭 ० ᪠ (A) +12:43:51 1594367031 祭 ॣ '-2'(A) +12:44:29 1594367069 ⪫祭 ॣ '-2'(A) +12:51:36 1594367496 祭 ० ࠧ +12:51:38 1594367498 祭 ० ' ⮪ 㣨' +12:53:20 1594367600 祭 ॣ '-2'(A) +13:19:16 1594369156 ⪫祭 ० ' ⮪ 㣨' +13:19:16 1594369156 祭 ⠭ ॣ +13:20:28 1594369228 ⪫祭 ॣ '-2'(A) +13:23:18 1594369398 祭 ॣ '-2' +13:25:16 1594369516 ⪫祭 ० ࠧ (A) +15:00:00 1594375200 ⪫祭 ॣ '-2'(A) +15:02:46 1594375366 祭 ० ᪠ +15:02:47 1594375367 祭 ० ᪠ +15:04:51 1594375491 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.469 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.469 new file mode 100644 index 0000000..95c922f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.469 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.481 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.481 new file mode 100644 index 0000000..d02d1e2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.481 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.483 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.483 new file mode 100644 index 0000000..6475bdc --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.483 @@ -0,0 +1,4 @@ +11 03:33:36 1594334016 +12 06:15:15 1594343715 +13 08:08:46 1594350526 +0 08:08:46 1594350526 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.484 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.484 new file mode 100644 index 0000000..e132538 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.484 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.486 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.486 new file mode 100644 index 0000000..ded6fc9 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.486 @@ -0,0 +1,18 @@ +[03] +oper = 11 +begin = 10.07.2020 03:33:36 +norma = 0 +real = 161 + +[04] +oper = 12 +begin = 10.07.2020 06:15:15 +norma = 105 +real = 113 + +[05] +oper = 13 +begin = 10.07.2020 08:08:46 +norma = 45 +real = 3015 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.487 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.487 new file mode 100644 index 0000000..0ad9ff8 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.487 @@ -0,0 +1,9 @@ +03:33:35 1594334015 祭 ० +03:33:37 1594334017 ⪫祭 ॣ '-2'(A) +03:33:38 1594334018 祭 ॣ '-2'(A) +04:42:35 1594338155 ⪫祭 ॣ '-2'(A) +06:15:11 1594343711 ⪫祭 ० (A) +06:15:13 1594343713 ⪫祭 ० ' ⮪ 㣨' +06:15:49 1594343749 祭 ० ᪠ +06:15:49 1594343749 祭 ० ᪠ +06:18:30 1594343910 ⪫祭 ० ᪠ (A) diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.489 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.489 new file mode 100644 index 0000000..96725a0 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.489 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.911 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.911 new file mode 100644 index 0000000..08f8704 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.911 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.912 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.912 new file mode 100644 index 0000000..21a63c2 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.912 @@ -0,0 +1,24 @@ +22 07:18:50 07:23:50 +P1=18.2 P2=41.1 T1=07:18:50 T2=07:23:50 Vs= 4.6 + +22 17:54:11 17:59:11 +P1=31.1 P2=70.6 T1=17:54:11 T2=17:59:11 Vs= 7.9 + +22 18:42:21 18:47:22 +P1=27.6 P2=55.6 T1=18:42:21 T2=18:47:22 Vs= 5.6 + +22 19:27:25 19:32:25 +P1=25.0 P2=51.2 T1=19:27:25 T2=19:32:25 Vs= 5.2 + +22 19:46:20 19:51:20 +P1=24.5 P2=49.4 T1=19:46:20 T2=19:51:20 Vs= 5.0 + +22 20:03:46 20:08:45 +P1=23.4 P2=48.0 T1=20:03:46 T2=20:08:45 Vs= 4.9 + +22 20:23:08 20:28:09 +P1=23.2 P2=47.5 T1=20:23:08 T2=20:28:09 Vs= 4.9 + +22 20:34:09 20:39:09 +P1=58.2 P2=62.5 T1=20:34:09 T2=20:39:09 Vs= 0.9 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.920 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.920 new file mode 100644 index 0000000..9bed359 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.920 @@ -0,0 +1 @@ +19:18:17 1594390697 1 9-92-07037 2 ‚’25-1“ƒ„3 3 10440 4 2 5 2 6 690 7 5292 10 116 11 116 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.921 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.921 new file mode 100644 index 0000000..5f0bb3e Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.921 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.922 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.922 new file mode 100644 index 0000000..b463575 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.922 @@ -0,0 +1,15 @@ +22 10:26:15 10:31:15 +P1=53.9 P2=75.3 T1=10:26:15 T2=10:31:15 Vs= 4.3 + +22 12:00:05 12:05:06 +P1=50.8 P2=69.7 T1=12:00:05 T2=12:05:06 Vs= 3.8 + +22 14:15:47 14:20:47 +P1=49.5 P2=66.6 T1=14:15:47 T2=14:20:47 Vs= 3.4 + +22 16:20:36 16:25:36 +P1=48.3 P2=63.3 T1=16:20:36 T2=16:25:36 Vs= 3.0 + +22 19:28:27 19:33:28 +P1=53.1 P2=53.0 T1=19:28:27 T2=19:33:28 Vs= 0.0 + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.923 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.923 new file mode 100644 index 0000000..e3dbd79 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.923 @@ -0,0 +1,5 @@ +08 06:05:50 1594343150 +10 16:30:05 1594380605 +17 19:16:21 1594390581 +10 19:18:17 1594390697 +12 19:55:00 1594392900 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.930 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.930 new file mode 100644 index 0000000..66bff1e --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.930 @@ -0,0 +1,2 @@ +12:55:56 1594367756 3 11800 7 4979 8 4850 9 321715 +13:20:39 1594369239 0 A_NTC_GRE_32_004_2018_rev2 1 01242 2 BT9 3 3 11800 4 9692 5 9692 6 690 7 4979 8 4850 9 321715 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.931 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.931 new file mode 100644 index 0000000..4bfa64f Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.931 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.932 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.932 new file mode 100644 index 0000000..cdc7b3a --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.932 @@ -0,0 +1,30 @@ +22 12:47:47 12:52:52 +P1= 51.4 T1=12:47:50 P2= 54.7 T2=12:52:52 Vs= 0.65 + +21 12:56:13 12:56:15 +Rsk= 2.1 + +32 12:56:32 12:56:45 +Umax=85.1 T= 3.0 + +34 12:56:49 12:57:14 +V= 0.3 T= 9.0 + +43 12:57:21 12:59:42 +Ttgl= 0.0 + +38 12:59:47 13:00:06 +t= 55.0 T= 0.1 + +42 13:00:15 13:02:17 +Qtgl=63.96 T= 0.0 + +35 13:02:22 13:03:14 +Qizl=109.1 T= 0.0 + +37 13:03:20 13:05:06 +T= 0.0 + +44 13:14:44 13:14:52 + + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.933 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.933 new file mode 100644 index 0000000..b1f7c7d --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.933 @@ -0,0 +1,8 @@ +8 07:37:11 1594348631 +10 13:15:38 1594368938 +17 15:28:12 1594376892 +12 15:30:27 1594377027 +10 15:41:54 1594377714 +12 16:00:30 1594378830 +13 22:47:51 1594403271 +0 22:47:51 1594403271 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.934 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.934 new file mode 100644 index 0000000..0cf60a8 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.934 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.940 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.940 new file mode 100644 index 0000000..b19d728 --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.940 @@ -0,0 +1,2 @@ +06:25:30 1594344330 2 BT3-1 3 3 16800 4 9691 5 9691 6 690 7 4952 8 5170 9 320976 +06:46:44 1594345604 0 A_NTC_GRE_32_003_2017_rev0 1 00814 2 BT3-1 3 3 16800 4 9691 5 9691 6 690 7 4952 8 5170 9 320976 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.941 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.941 new file mode 100644 index 0000000..318d6cd Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.941 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.942 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.942 new file mode 100644 index 0000000..22f2d6f --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.942 @@ -0,0 +1,30 @@ +22 06:08:11 06:13:15 +P1= 47.6 T1=06:08:14 P2= 62.0 T2=06:13:15 Vs= 2.84 + +21 06:25:55 06:25:57 +Rsk= 4.2 + +32 06:26:59 06:27:12 +Umax=85.0 T= 3.0 + +34 06:27:20 06:27:46 +V= 0.3 T= 9.0 + +43 06:27:59 06:30:33 +Ttgl= 0.0 + +38 06:30:41 06:31:21 +t= 57.0 T= 0.5 + +42 06:31:33 06:33:52 +Qtgl=61.80 T= 0.0 + +35 06:34:02 06:34:55 +Qizl=109.5 T= 0.0 + +37 06:35:01 06:36:51 +T= 0.0 + +44 06:40:50 06:40:59 + + diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.943 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.943 new file mode 100644 index 0000000..8da89ea --- /dev/null +++ b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.943 @@ -0,0 +1,6 @@ +8 04:18:27 1594336707 +10 06:41:43 1594345303 +17 10:03:47 1594357427 +12 10:05:44 1594357544 +13 19:19:38 1594390778 +0 19:19:38 1594390778 diff --git a/Tests/bin/Debug/netcoreapp3.1/temp/20200710.944 b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.944 new file mode 100644 index 0000000..303b07b Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/temp/20200710.944 differ diff --git a/Tests/bin/Debug/netcoreapp3.1/times.ttf b/Tests/bin/Debug/netcoreapp3.1/times.ttf new file mode 100644 index 0000000..f71d84a Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/times.ttf differ diff --git a/Tests/bin/Debug/netcoreapp3.1/timesbd.ttf b/Tests/bin/Debug/netcoreapp3.1/timesbd.ttf new file mode 100644 index 0000000..43259eb Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/timesbd.ttf differ diff --git a/Tests/bin/Debug/netcoreapp3.1/timesbi.ttf b/Tests/bin/Debug/netcoreapp3.1/timesbi.ttf new file mode 100644 index 0000000..c0b27d2 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/timesbi.ttf differ diff --git a/Tests/bin/Debug/netcoreapp3.1/timesi.ttf b/Tests/bin/Debug/netcoreapp3.1/timesi.ttf new file mode 100644 index 0000000..4bcad69 Binary files /dev/null and b/Tests/bin/Debug/netcoreapp3.1/timesi.ttf differ diff --git a/Tests/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs b/Tests/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs new file mode 100644 index 0000000..ad8dfe1 --- /dev/null +++ b/Tests/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")] diff --git a/Tests/obj/Debug/netcoreapp3.1/Tests.AssemblyInfo.cs b/Tests/obj/Debug/netcoreapp3.1/Tests.AssemblyInfo.cs new file mode 100644 index 0000000..0ce4c3b --- /dev/null +++ b/Tests/obj/Debug/netcoreapp3.1/Tests.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Tests")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("Tests")] +[assembly: System.Reflection.AssemblyTitleAttribute("Tests")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Создано классом WriteCodeFragment MSBuild. + diff --git a/Tests/obj/Debug/netcoreapp3.1/Tests.AssemblyInfoInputs.cache b/Tests/obj/Debug/netcoreapp3.1/Tests.AssemblyInfoInputs.cache new file mode 100644 index 0000000..a24b739 --- /dev/null +++ b/Tests/obj/Debug/netcoreapp3.1/Tests.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +bdd25c44f887057362504246fd9280a56ad898bc diff --git a/Tests/obj/Debug/netcoreapp3.1/Tests.assets.cache b/Tests/obj/Debug/netcoreapp3.1/Tests.assets.cache new file mode 100644 index 0000000..d180b0d Binary files /dev/null and b/Tests/obj/Debug/netcoreapp3.1/Tests.assets.cache differ diff --git a/Tests/obj/Debug/netcoreapp3.1/Tests.csproj.CopyComplete b/Tests/obj/Debug/netcoreapp3.1/Tests.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/Tests/obj/Debug/netcoreapp3.1/Tests.csproj.CoreCompileInputs.cache b/Tests/obj/Debug/netcoreapp3.1/Tests.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..b3e4bc5 --- /dev/null +++ b/Tests/obj/Debug/netcoreapp3.1/Tests.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +ab0bad1eb5e1d40101b998bacf77bedb60769496 diff --git a/Tests/obj/Debug/netcoreapp3.1/Tests.csproj.FileListAbsolute.txt b/Tests/obj/Debug/netcoreapp3.1/Tests.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..148ac6a --- /dev/null +++ b/Tests/obj/Debug/netcoreapp3.1/Tests.csproj.FileListAbsolute.txt @@ -0,0 +1,73 @@ +D:\Projects\Tests\bin\Debug\netcoreapp3.1\Tests.exe +D:\Projects\Tests\bin\Debug\netcoreapp3.1\Tests.deps.json +D:\Projects\Tests\bin\Debug\netcoreapp3.1\Tests.runtimeconfig.json +D:\Projects\Tests\bin\Debug\netcoreapp3.1\Tests.runtimeconfig.dev.json +D:\Projects\Tests\bin\Debug\netcoreapp3.1\Tests.dll +D:\Projects\Tests\bin\Debug\netcoreapp3.1\Tests.pdb +D:\Projects\Tests\bin\Debug\netcoreapp3.1\STPClient.dll +D:\Projects\Tests\bin\Debug\netcoreapp3.1\STPClient.pdb +D:\Projects\Tests\obj\Debug\netcoreapp3.1\Tests.csprojAssemblyReference.cache +D:\Projects\Tests\obj\Debug\netcoreapp3.1\Tests.AssemblyInfoInputs.cache +D:\Projects\Tests\obj\Debug\netcoreapp3.1\Tests.AssemblyInfo.cs +D:\Projects\Tests\obj\Debug\netcoreapp3.1\Tests.csproj.CopyComplete +D:\Projects\Tests\obj\Debug\netcoreapp3.1\Tests.dll +D:\Projects\Tests\obj\Debug\netcoreapp3.1\Tests.pdb +D:\Projects\Tests\obj\Debug\netcoreapp3.1\Tests.genruntimeconfig.cache +D:\Projects\Tests\obj\Debug\netcoreapp3.1\Tests.csproj.CoreCompileInputs.cache +D:\Projects\Tests\bin\Debug\netcoreapp3.1\System.Text.Encoding.CodePages.dll +D:\Projects\Tests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.0\System.Text.Encoding.CodePages.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\ICSharpCode.SharpZipLib.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\System.Text.Encoding.CodePages.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.0\System.Text.Encoding.CodePages.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\DataClients.dll +F:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.csprojAssemblyReference.cache +F:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.AssemblyInfoInputs.cache +F:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.AssemblyInfo.cs +F:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.dll +F:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.pdb +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\Tests.exe +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\Tests.deps.json +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\Tests.runtimeconfig.json +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\Tests.runtimeconfig.dev.json +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\Tests.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\Tests.pdb +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\DataClients.pdb +F:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.csproj.CoreCompileInputs.cache +F:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.csproj.CopyComplete +F:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.genruntimeconfig.cache +G:\Projects1\Tests\bin\Debug\netcoreapp3.1\Tests.exe +G:\Projects1\Tests\bin\Debug\netcoreapp3.1\Tests.deps.json +G:\Projects1\Tests\bin\Debug\netcoreapp3.1\Tests.runtimeconfig.json +G:\Projects1\Tests\bin\Debug\netcoreapp3.1\Tests.runtimeconfig.dev.json +G:\Projects1\Tests\bin\Debug\netcoreapp3.1\Tests.dll +G:\Projects1\Tests\bin\Debug\netcoreapp3.1\Tests.pdb +G:\Projects1\Tests\bin\Debug\netcoreapp3.1\ICSharpCode.SharpZipLib.dll +G:\Projects1\Tests\bin\Debug\netcoreapp3.1\System.Text.Encoding.CodePages.dll +G:\Projects1\Tests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.0\System.Text.Encoding.CodePages.dll +G:\Projects1\Tests\bin\Debug\netcoreapp3.1\DataClients.dll +G:\Projects1\Tests\bin\Debug\netcoreapp3.1\DataClients.pdb +G:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.csprojAssemblyReference.cache +G:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.AssemblyInfoInputs.cache +G:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.AssemblyInfo.cs +G:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.csproj.CoreCompileInputs.cache +G:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.csproj.CopyComplete +G:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.dll +G:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.pdb +G:\Projects1\Tests\obj\Debug\netcoreapp3.1\Tests.genruntimeconfig.cache +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\Mailing.exe +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\Microsoft.Win32.SystemEvents.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\System.Drawing.Common.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.0\Microsoft.Win32.SystemEvents.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\runtimes\unix\lib\netcoreapp2.0\System.Drawing.Common.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.0\System.Drawing.Common.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\Mailing.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\MigraDoc.DocumentObjectModel.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\MigraDoc.Rendering.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\PdfSharp.Charting.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\PdfSharp.dll +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\Mailing.pdb +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\MigraDoc.DocumentObjectModel.pdb +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\MigraDoc.Rendering.pdb +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\PdfSharp.pdb +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\PdfSharp.Charting.pdb +F:\Projects1\Tests\bin\Debug\netcoreapp3.1\de\MigraDoc.Rendering.resources.dll diff --git a/Tests/obj/Debug/netcoreapp3.1/Tests.csprojAssemblyReference.cache b/Tests/obj/Debug/netcoreapp3.1/Tests.csprojAssemblyReference.cache new file mode 100644 index 0000000..712e79c Binary files /dev/null and b/Tests/obj/Debug/netcoreapp3.1/Tests.csprojAssemblyReference.cache differ diff --git a/Tests/obj/Debug/netcoreapp3.1/Tests.dll b/Tests/obj/Debug/netcoreapp3.1/Tests.dll new file mode 100644 index 0000000..0826cba Binary files /dev/null and b/Tests/obj/Debug/netcoreapp3.1/Tests.dll differ diff --git a/Tests/obj/Debug/netcoreapp3.1/Tests.exe b/Tests/obj/Debug/netcoreapp3.1/Tests.exe new file mode 100644 index 0000000..c6b6f06 Binary files /dev/null and b/Tests/obj/Debug/netcoreapp3.1/Tests.exe differ diff --git a/Tests/obj/Debug/netcoreapp3.1/Tests.genruntimeconfig.cache b/Tests/obj/Debug/netcoreapp3.1/Tests.genruntimeconfig.cache new file mode 100644 index 0000000..34bedab --- /dev/null +++ b/Tests/obj/Debug/netcoreapp3.1/Tests.genruntimeconfig.cache @@ -0,0 +1 @@ +86c8e15dd33445635927cfaf398408205fd11473 diff --git a/Tests/obj/Debug/netcoreapp3.1/Tests.pdb b/Tests/obj/Debug/netcoreapp3.1/Tests.pdb new file mode 100644 index 0000000..d0f64d3 Binary files /dev/null and b/Tests/obj/Debug/netcoreapp3.1/Tests.pdb differ diff --git a/Tests/obj/Tests.csproj.nuget.dgspec.json b/Tests/obj/Tests.csproj.nuget.dgspec.json new file mode 100644 index 0000000..3cc671c --- /dev/null +++ b/Tests/obj/Tests.csproj.nuget.dgspec.json @@ -0,0 +1,496 @@ +{ + "format": 1, + "restore": { + "F:\\Projects1\\Tests\\Tests.csproj": {} + }, + "projects": { + "F:\\Projects1\\DataClients\\DataClients.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\DataClients\\DataClients.csproj", + "projectName": "DataClients", + "projectPath": "F:\\Projects1\\DataClients\\DataClients.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\DataClients\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "SharpZipLib": { + "target": "Package", + "version": "[1.2.0, )" + }, + "System.Text.Encoding.CodePages": { + "target": "Package", + "version": "[4.7.1, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\Mailing\\Mailing.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\Mailing\\Mailing.csproj", + "projectName": "Mailing", + "projectPath": "F:\\Projects1\\Mailing\\Mailing.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\Mailing\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": { + "F:\\Projects1\\DataClients\\DataClients.csproj": { + "projectPath": "F:\\Projects1\\DataClients\\DataClients.csproj" + }, + "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj": { + "projectPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj" + }, + "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj": { + "projectPath": "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj" + }, + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "dependencies": { + "SharpZipLib": { + "target": "Package", + "version": "[1.2.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj", + "projectName": "MigraDoc.DocumentObjectModel", + "projectPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj", + "projectName": "MigraDoc.Rendering", + "projectPath": "F:\\Projects1\\MigraDoc.Rendering\\MigraDoc.Rendering.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\MigraDoc.Rendering\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": { + "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj": { + "projectPath": "F:\\Projects1\\MigraDoc.DocumentObjectModel\\MigraDoc.DocumentObjectModel.csproj" + }, + "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj" + }, + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj", + "projectName": "PdfSharp.Charting", + "projectPath": "F:\\Projects1\\PdfSharp.Charting\\PdfSharp.Charting.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\PdfSharp.Charting\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": { + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\PdfSharp\\PdfSharp.csproj": { + "version": "3.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj", + "projectName": "PdfSharp", + "projectPath": "F:\\Projects1\\PdfSharp\\PdfSharp.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\PdfSharp\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + }, + "System.Drawing.Common": { + "target": "Package", + "version": "[4.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + }, + "F:\\Projects1\\Tests\\Tests.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\Tests\\Tests.csproj", + "projectName": "Tests", + "projectPath": "F:\\Projects1\\Tests\\Tests.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\Tests\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": { + "F:\\Projects1\\DataClients\\DataClients.csproj": { + "projectPath": "F:\\Projects1\\DataClients\\DataClients.csproj" + }, + "F:\\Projects1\\Mailing\\Mailing.csproj": { + "projectPath": "F:\\Projects1\\Mailing\\Mailing.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "dependencies": { + "SharpZipLib": { + "target": "Package", + "version": "[1.2.0, )" + }, + "System.Text.Encoding.CodePages": { + "target": "Package", + "version": "[4.7.1, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/obj/Tests.csproj.nuget.g.props b/Tests/obj/Tests.csproj.nuget.g.props new file mode 100644 index 0000000..1771934 --- /dev/null +++ b/Tests/obj/Tests.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\google\.nuget\packages\;C:\Microsoft\Xamarin\NuGet\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder + PackageReference + 5.6.0 + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/Tests/obj/Tests.csproj.nuget.g.targets b/Tests/obj/Tests.csproj.nuget.g.targets new file mode 100644 index 0000000..53cfaa1 --- /dev/null +++ b/Tests/obj/Tests.csproj.nuget.g.targets @@ -0,0 +1,6 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/Tests/obj/project.assets.json b/Tests/obj/project.assets.json new file mode 100644 index 0000000..912bd07 --- /dev/null +++ b/Tests/obj/project.assets.json @@ -0,0 +1,419 @@ +{ + "version": 3, + "targets": { + ".NETCoreApp,Version=v3.1": { + "Microsoft.NETCore.Platforms/3.1.1": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.Win32.SystemEvents/4.5.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "2.0.0" + }, + "compile": { + "ref/netstandard2.0/_._": {} + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Win32.SystemEvents.dll": {} + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "SharpZipLib/1.2.0": { + "type": "package", + "compile": { + "lib/netstandard2.0/ICSharpCode.SharpZipLib.dll": {} + }, + "runtime": { + "lib/netstandard2.0/ICSharpCode.SharpZipLib.dll": {} + } + }, + "System.Drawing.Common/4.5.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "2.0.0", + "Microsoft.Win32.SystemEvents": "4.5.0" + }, + "compile": { + "ref/netstandard2.0/System.Drawing.Common.dll": {} + }, + "runtime": { + "lib/netstandard2.0/System.Drawing.Common.dll": {} + }, + "runtimeTargets": { + "runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll": { + "assetType": "runtime", + "rid": "unix" + }, + "runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Text.Encoding.CodePages/4.7.1": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "3.1.1" + }, + "compile": { + "lib/netstandard2.0/System.Text.Encoding.CodePages.dll": {} + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encoding.CodePages.dll": {} + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "DataClients/1.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "SharpZipLib": "1.2.0", + "System.Text.Encoding.CodePages": "4.7.1" + }, + "compile": { + "bin/placeholder/DataClients.dll": {} + }, + "runtime": { + "bin/placeholder/DataClients.dll": {} + } + }, + "Mailing/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v3.1", + "dependencies": { + "DataClients": "1.0.0", + "MigraDoc.DocumentObjectModel": "3.0.0", + "MigraDoc.Rendering": "3.0.0", + "PdfSharp": "3.0.0", + "SharpZipLib": "1.2.0" + }, + "compile": { + "bin/placeholder/Mailing.dll": {} + }, + "runtime": { + "bin/placeholder/Mailing.dll": {} + } + }, + "MigraDoc.DocumentObjectModel/3.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "compile": { + "bin/placeholder/MigraDoc.DocumentObjectModel.dll": {} + }, + "runtime": { + "bin/placeholder/MigraDoc.DocumentObjectModel.dll": {} + } + }, + "MigraDoc.Rendering/3.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "MigraDoc.DocumentObjectModel": "3.0.0", + "PdfSharp": "3.0.0", + "PdfSharp.Charting": "3.0.0", + "System.Drawing.Common": "4.5.0" + }, + "compile": { + "bin/placeholder/MigraDoc.Rendering.dll": {} + }, + "runtime": { + "bin/placeholder/MigraDoc.Rendering.dll": {} + } + }, + "PdfSharp/3.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "System.Drawing.Common": "4.5.0" + }, + "compile": { + "bin/placeholder/PdfSharp.dll": {} + }, + "runtime": { + "bin/placeholder/PdfSharp.dll": {} + } + }, + "PdfSharp.Charting/3.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "dependencies": { + "PdfSharp": "3.0.0", + "System.Drawing.Common": "4.5.0" + }, + "compile": { + "bin/placeholder/PdfSharp.Charting.dll": {} + }, + "runtime": { + "bin/placeholder/PdfSharp.Charting.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.NETCore.Platforms/3.1.1": { + "sha512": "RmINcaqiEkawM9C8oxFMN/CZmn1fGKWVsosbSY/8ARUNdHqV47hqhPVbrG3qUqLaRQI5w4HuqFOqrbhoSWcH6w==", + "type": "package", + "path": "microsoft.netcore.platforms/3.1.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.3.1.1.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "Microsoft.Win32.SystemEvents/4.5.0": { + "sha512": "LuI1oG+24TUj1ZRQQjM5Ew73BKnZE5NZ/7eAdh1o8ST5dPhUnJvIkiIn2re3MwnkRy6ELRnvEbBxHP8uALKhJw==", + "type": "package", + "path": "microsoft.win32.systemevents/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/Microsoft.Win32.SystemEvents.dll", + "lib/netstandard2.0/Microsoft.Win32.SystemEvents.dll", + "microsoft.win32.systemevents.4.5.0.nupkg.sha512", + "microsoft.win32.systemevents.nuspec", + "ref/net461/Microsoft.Win32.SystemEvents.dll", + "ref/netstandard2.0/Microsoft.Win32.SystemEvents.dll", + "runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "SharpZipLib/1.2.0": { + "sha512": "zvWa/L02JHNatdtjya6Swpudb2YEHaOLHL1eRrqpjm71iGRNUNONO5adUF/9CHbSJbzhELW1UoH4NGy7n7+3bQ==", + "type": "package", + "path": "sharpziplib/1.2.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net45/ICSharpCode.SharpZipLib.dll", + "lib/net45/ICSharpCode.SharpZipLib.pdb", + "lib/net45/ICSharpCode.SharpZipLib.xml", + "lib/netstandard2.0/ICSharpCode.SharpZipLib.dll", + "lib/netstandard2.0/ICSharpCode.SharpZipLib.pdb", + "lib/netstandard2.0/ICSharpCode.SharpZipLib.xml", + "sharpziplib.1.2.0.nupkg.sha512", + "sharpziplib.nuspec" + ] + }, + "System.Drawing.Common/4.5.0": { + "sha512": "AiJFxxVPdeITstiRS5aAu8+8Dpf5NawTMoapZ53Gfirml24p7HIfhjmCRxdXnmmf3IUA3AX3CcW7G73CjWxW/Q==", + "type": "package", + "path": "system.drawing.common/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net461/System.Drawing.Common.dll", + "lib/netstandard2.0/System.Drawing.Common.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net461/System.Drawing.Common.dll", + "ref/netstandard2.0/System.Drawing.Common.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll", + "runtimes/win/lib/netcoreapp2.0/System.Drawing.Common.dll", + "system.drawing.common.4.5.0.nupkg.sha512", + "system.drawing.common.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Text.Encoding.CodePages/4.7.1": { + "sha512": "i2fOvznVVgOOTLUz8FgSap/MsR98I4Iaoz99VXcOW/e7Y2OdY42zhYpBYpZyivk5alYY/UsOWAVswhtjxceodA==", + "type": "package", + "path": "system.text.encoding.codepages/4.7.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Text.Encoding.CodePages.dll", + "lib/net461/System.Text.Encoding.CodePages.dll", + "lib/net461/System.Text.Encoding.CodePages.xml", + "lib/netstandard1.3/System.Text.Encoding.CodePages.dll", + "lib/netstandard2.0/System.Text.Encoding.CodePages.dll", + "lib/netstandard2.0/System.Text.Encoding.CodePages.xml", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/win/lib/net461/System.Text.Encoding.CodePages.dll", + "runtimes/win/lib/net461/System.Text.Encoding.CodePages.xml", + "runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll", + "runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.xml", + "runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll", + "runtimes/win/lib/netstandard2.0/System.Text.Encoding.CodePages.dll", + "runtimes/win/lib/netstandard2.0/System.Text.Encoding.CodePages.xml", + "system.text.encoding.codepages.4.7.1.nupkg.sha512", + "system.text.encoding.codepages.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "DataClients/1.0.0": { + "type": "project", + "path": "../DataClients/DataClients.csproj", + "msbuildProject": "../DataClients/DataClients.csproj" + }, + "Mailing/1.0.0": { + "type": "project", + "path": "../Mailing/Mailing.csproj", + "msbuildProject": "../Mailing/Mailing.csproj" + }, + "MigraDoc.DocumentObjectModel/3.0.0": { + "type": "project", + "path": "../MigraDoc.DocumentObjectModel/MigraDoc.DocumentObjectModel.csproj", + "msbuildProject": "../MigraDoc.DocumentObjectModel/MigraDoc.DocumentObjectModel.csproj" + }, + "MigraDoc.Rendering/3.0.0": { + "type": "project", + "path": "../MigraDoc.Rendering/MigraDoc.Rendering.csproj", + "msbuildProject": "../MigraDoc.Rendering/MigraDoc.Rendering.csproj" + }, + "PdfSharp/3.0.0": { + "type": "project", + "path": "../PdfSharp/PdfSharp.csproj", + "msbuildProject": "../PdfSharp/PdfSharp.csproj" + }, + "PdfSharp.Charting/3.0.0": { + "type": "project", + "path": "../PdfSharp.Charting/PdfSharp.Charting.csproj", + "msbuildProject": "../PdfSharp.Charting/PdfSharp.Charting.csproj" + } + }, + "projectFileDependencyGroups": { + ".NETCoreApp,Version=v3.1": [ + "DataClients >= 1.0.0", + "Mailing >= 1.0.0", + "SharpZipLib >= 1.2.0", + "System.Text.Encoding.CodePages >= 4.7.1" + ] + }, + "packageFolders": { + "C:\\Users\\google\\.nuget\\packages\\": {}, + "C:\\Microsoft\\Xamarin\\NuGet\\": {}, + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\Projects1\\Tests\\Tests.csproj", + "projectName": "Tests", + "projectPath": "F:\\Projects1\\Tests\\Tests.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "F:\\Projects1\\Tests\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": { + "F:\\Projects1\\DataClients\\DataClients.csproj": { + "projectPath": "F:\\Projects1\\DataClients\\DataClients.csproj" + }, + "F:\\Projects1\\Mailing\\Mailing.csproj": { + "projectPath": "F:\\Projects1\\Mailing\\Mailing.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "dependencies": { + "SharpZipLib": { + "target": "Package", + "version": "[1.2.0, )" + }, + "System.Text.Encoding.CodePages": { + "target": "Package", + "version": "[4.7.1, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/Tests/obj/project.nuget.cache b/Tests/obj/project.nuget.cache new file mode 100644 index 0000000..7964b68 --- /dev/null +++ b/Tests/obj/project.nuget.cache @@ -0,0 +1,14 @@ +{ + "version": 2, + "dgSpecHash": "k0nb/WQn8I5z1UWbwuOf/0mOeAbT2YNW/DunGCpkZkMXzHQLEOGYAwvof9tgdYsYWG72lvOYykdQM8096NvY5A==", + "success": true, + "projectFilePath": "F:\\Projects1\\Tests\\Tests.csproj", + "expectedPackageFiles": [ + "C:\\Users\\google\\.nuget\\packages\\microsoft.netcore.platforms\\3.1.1\\microsoft.netcore.platforms.3.1.1.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\microsoft.win32.systemevents\\4.5.0\\microsoft.win32.systemevents.4.5.0.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\sharpziplib\\1.2.0\\sharpziplib.1.2.0.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\system.drawing.common\\4.5.0\\system.drawing.common.4.5.0.nupkg.sha512", + "C:\\Users\\google\\.nuget\\packages\\system.text.encoding.codepages\\4.7.1\\system.text.encoding.codepages.4.7.1.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file